@deephaven/grid 0.7.0 → 0.7.1-beta.4

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.
@@ -1,54 +1,62 @@
1
- declare var _default: Readonly<{
1
+ /** A color parsed as CSS color value, eg. '#FF0000' */
2
+ export declare type GridColor = string;
3
+ /** A nullable color, eg. pass `null` to skip drawing this item */
4
+ export declare type NullableGridColor = GridColor | null;
5
+ /** One or more colors parsed as CSS color value separated by space, eg. '#FF0000 #00FF00' */
6
+ export declare type GridColorWay = string;
7
+ /** A font parsed as CSS font value */
8
+ export declare type GridFont = string;
9
+ export declare type GridTheme = {
2
10
  allowColumnResize: boolean;
3
11
  allowRowResize: boolean;
4
12
  autoSelectRow: boolean;
5
13
  autoSelectColumn: boolean;
6
14
  autoSizeColumns: boolean;
7
15
  autoSizeRows: boolean;
8
- backgroundColor: string;
16
+ backgroundColor: GridColor;
17
+ textColor: GridColor;
9
18
  cellHorizontalPadding: number;
10
19
  headerHorizontalPadding: number;
11
- font: string;
12
- gridColumnColor: string;
13
- gridRowColor: string;
14
- headerBackgroundColor: string;
15
- headerSeparatorColor: string;
16
- headerSeparatorHoverColor: string;
20
+ font: GridFont;
21
+ gridColumnColor: NullableGridColor;
22
+ gridRowColor: NullableGridColor;
23
+ headerBackgroundColor: GridColor;
24
+ headerSeparatorColor: GridColor;
25
+ headerSeparatorHoverColor: GridColor;
17
26
  headerSeparatorHandleSize: number;
18
27
  headerHiddenSeparatorSize: number;
19
- headerHiddenSeparatorHoverColor: string;
20
- headerColor: string;
21
- headerFont: string;
22
- columnHoverBackgroundColor: string;
23
- selectedColumnHoverBackgroundColor: string;
24
- rowBackgroundColors: string;
25
- rowHoverBackgroundColor: string;
26
- selectedRowHoverBackgroundColor: string;
28
+ headerHiddenSeparatorHoverColor: GridColor;
29
+ headerColor: GridColor;
30
+ headerFont: GridFont;
31
+ columnHoverBackgroundColor: NullableGridColor;
32
+ selectedColumnHoverBackgroundColor: NullableGridColor;
33
+ rowHoverBackgroundColor: NullableGridColor;
34
+ selectedRowHoverBackgroundColor: NullableGridColor;
35
+ rowBackgroundColors: GridColorWay;
27
36
  minScrollHandleSize: number;
28
- scrollBarBackgroundColor: string;
29
- scrollBarHoverBackgroundColor: string;
30
- scrollBarCasingColor: string;
31
- scrollBarCornerColor: string;
32
- scrollBarColor: string;
33
- scrollBarHoverColor: string;
34
- scrollBarActiveColor: string;
37
+ scrollBarBackgroundColor: GridColor;
38
+ scrollBarHoverBackgroundColor: GridColor;
39
+ scrollBarCasingColor: GridColor;
40
+ scrollBarCornerColor: GridColor;
41
+ scrollBarColor: GridColor;
42
+ scrollBarHoverColor: GridColor;
43
+ scrollBarActiveColor: GridColor;
35
44
  scrollBarSize: number;
36
45
  scrollBarHoverSize: number;
37
46
  scrollBarCasingWidth: number;
38
47
  scrollSnapToColumn: boolean;
39
48
  scrollSnapToRow: boolean;
40
- selectionColor: string;
41
- selectionOutlineColor: string;
42
- selectionOutlineCasingColor: string;
49
+ selectionColor: GridColor;
50
+ selectionOutlineColor: GridColor;
51
+ selectionOutlineCasingColor: GridColor;
43
52
  shadowBlur: number;
44
- shadowColor: string;
45
- textColor: string;
53
+ shadowColor: GridColor;
46
54
  maxDepth: number;
47
55
  treeDepthIndent: number;
48
56
  treeHorizontalPadding: number;
49
- treeLineColor: string;
50
- treeMarkerColor: string;
51
- treeMarkerHoverColor: string;
57
+ treeLineColor: GridColor;
58
+ treeMarkerColor: GridColor;
59
+ treeMarkerHoverColor: GridColor;
52
60
  rowHeight: number;
53
61
  columnWidth: number;
54
62
  minRowHeight: number;
@@ -61,11 +69,15 @@ declare var _default: Readonly<{
61
69
  allowColumnReorder: boolean;
62
70
  allowRowReorder: boolean;
63
71
  reorderOffset: number;
64
- floatingGridColumnColor: string;
65
- floatingGridRowColor: string;
66
- floatingRowBackgroundColors: string;
67
- floatingDividerOuterColor: string;
68
- floatingDividerInnerColor: string;
69
- }>;
72
+ floatingGridColumnColor: GridColor;
73
+ floatingGridRowColor: GridColor;
74
+ floatingRowBackgroundColors: GridColorWay;
75
+ floatingDividerOuterColor: GridColor;
76
+ floatingDividerInnerColor: GridColor;
77
+ };
78
+ declare const _default: GridTheme;
79
+ /**
80
+ * Default theme for a Grid.
81
+ */
70
82
  export default _default;
71
83
  //# sourceMappingURL=GridTheme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GridTheme.d.ts","sourceRoot":"","sources":["../src/GridTheme.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"GridTheme.d.ts","sourceRoot":"","sources":["../src/GridTheme.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,oBAAY,SAAS,GAAG,MAAM,CAAC;AAE/B,kEAAkE;AAClE,oBAAY,iBAAiB,GAAG,SAAS,GAAG,IAAI,CAAC;AAEjD,6FAA6F;AAC7F,oBAAY,YAAY,GAAG,MAAM,CAAC;AAElC,sCAAsC;AACtC,oBAAY,QAAQ,GAAG,MAAM,CAAC;AAE9B,oBAAY,SAAS,GAAG;IAEtB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;IAGxB,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;IAG1B,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IAGtB,eAAe,EAAE,SAAS,CAAC;IAG3B,SAAS,EAAE,SAAS,CAAC;IAGrB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,uBAAuB,EAAE,MAAM,CAAC;IAGhC,IAAI,EAAE,QAAQ,CAAC;IAGf,eAAe,EAAE,iBAAiB,CAAC;IACnC,YAAY,EAAE,iBAAiB,CAAC;IAGhC,qBAAqB,EAAE,SAAS,CAAC;IACjC,oBAAoB,EAAE,SAAS,CAAC;IAChC,yBAAyB,EAAE,SAAS,CAAC;IACrC,yBAAyB,EAAE,MAAM,CAAC;IAClC,yBAAyB,EAAE,MAAM,CAAC;IAClC,+BAA+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AAE,MAAM,CAAC;IAGvB,yBAAyB,EAAE,MAAM,CAAC;IAClC,+BAA+B,EAAE,MAAM,CAAC;IAGxC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;IAGzB,aAAa,EAAE,MAAM,CAAC;IAGtB,uBAAuB,EAAE,SAAS,CAAC;IACnC,oBAAoB,EAAE,SAAS,CAAC;IAGhC,2BAA2B,EAAE,YAAY,CAAC;IAG1C,yBAAyB,EAAE,SAAS,CAAC;IACrC,yBAAyB,EAAE,SAAS,CAAC;CACtC,CAAC;;AAEF;;GAEG;AACH,wBA8EgB"}
package/dist/GridTheme.js CHANGED
@@ -1,3 +1,11 @@
1
+ /** A color parsed as CSS color value, eg. '#FF0000' */
2
+
3
+ /** A nullable color, eg. pass `null` to skip drawing this item */
4
+
5
+ /** One or more colors parsed as CSS color value separated by space, eg. '#FF0000 #00FF00' */
6
+
7
+ /** A font parsed as CSS font value */
8
+
1
9
  /**
2
10
  * Default theme for a Grid.
3
11
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/GridTheme.js"],"names":["Object","freeze","allowColumnResize","allowRowResize","autoSelectRow","autoSelectColumn","autoSizeColumns","autoSizeRows","backgroundColor","cellHorizontalPadding","headerHorizontalPadding","font","gridColumnColor","gridRowColor","headerBackgroundColor","headerSeparatorColor","headerSeparatorHoverColor","headerSeparatorHandleSize","headerHiddenSeparatorSize","headerHiddenSeparatorHoverColor","headerColor","headerFont","columnHoverBackgroundColor","selectedColumnHoverBackgroundColor","rowBackgroundColors","rowHoverBackgroundColor","selectedRowHoverBackgroundColor","minScrollHandleSize","scrollBarBackgroundColor","scrollBarHoverBackgroundColor","scrollBarCasingColor","scrollBarCornerColor","scrollBarColor","scrollBarHoverColor","scrollBarActiveColor","scrollBarSize","scrollBarHoverSize","scrollBarCasingWidth","scrollSnapToColumn","scrollSnapToRow","selectionColor","selectionOutlineColor","selectionOutlineCasingColor","shadowBlur","shadowColor","textColor","maxDepth","treeDepthIndent","treeHorizontalPadding","treeLineColor","treeMarkerColor","treeMarkerHoverColor","rowHeight","columnWidth","minRowHeight","minColumnWidth","columnHeaderHeight","rowHeaderWidth","rowFooterWidth","headerResizeSnapThreshold","headerResizeHiddenSnapThreshold","allowColumnReorder","allowRowReorder","reorderOffset","floatingGridColumnColor","floatingGridRowColor","floatingRowBackgroundColors","floatingDividerOuterColor","floatingDividerInnerColor"],"mappings":"AAAA;AACA;AACA;AACA,eAAeA,MAAM,CAACC,MAAP,CAAc;AAC3BC,EAAAA,iBAAiB,EAAE,IADQ;AAE3BC,EAAAA,cAAc,EAAE,IAFW;AAG3BC,EAAAA,aAAa,EAAE,KAHY;AAGL;AACtBC,EAAAA,gBAAgB,EAAE,KAJS;AAIF;AACzBC,EAAAA,eAAe,EAAE,IALU;AAKJ;AACvBC,EAAAA,YAAY,EAAE,IANa;AAO3BC,EAAAA,eAAe,EAAE,SAPU;AAQ3BC,EAAAA,qBAAqB,EAAE,CARI;AAS3BC,EAAAA,uBAAuB,EAAE,CATE;AAU3BC,EAAAA,IAAI,EAAE,wBAVqB;AAW3BC,EAAAA,eAAe,EAAE,WAXU;AAY3BC,EAAAA,YAAY,EAAE,WAZa;AAa3BC,EAAAA,qBAAqB,EAAE,SAbI;AAc3BC,EAAAA,oBAAoB,EAAE,SAdK;AAe3BC,EAAAA,yBAAyB,EAAE,SAfA;AAgB3BC,EAAAA,yBAAyB,EAAE,CAhBA;AAiB3BC,EAAAA,yBAAyB,EAAE,CAjBA;AAkB3BC,EAAAA,+BAA+B,EAAE,SAlBN;AAmB3BC,EAAAA,WAAW,EAAE,SAnBc;AAoB3BC,EAAAA,UAAU,EAAE,wBApBe;AAqB3BC,EAAAA,0BAA0B,EAAE,SArBD;AAsB3BC,EAAAA,kCAAkC,EAAE,SAtBT;AAuB3BC,EAAAA,mBAAmB,EAAE,iBAvBM;AAwB3BC,EAAAA,uBAAuB,EAAE,SAxBE;AAyB3BC,EAAAA,+BAA+B,EAAE,SAzB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,EA7DA;AA8D3BC,EAAAA,+BAA+B,EAAE,CA9DN;AAgE3BC,EAAAA,kBAAkB,EAAE,IAhEO;AAiE3BC,EAAAA,eAAe,EAAE,IAjEU;AAkE3BC,EAAAA,aAAa,EAAE,CAlEY;AAoE3B;AACAC,EAAAA,uBAAuB,EAAE,WArEE;AAsE3BC,EAAAA,oBAAoB,EAAE,WAtEK;AAwE3B;AACAC,EAAAA,2BAA2B,EAAE,iBAzEF;AA2E3B;AACAC,EAAAA,yBAAyB,EAAE,SA5EA;AA6E3BC,EAAAA,yBAAyB,EAAE;AA7EA,CAAd,CAAf","sourcesContent":["/**\n * Default theme for a Grid.\n */\nexport default Object.freeze({\n allowColumnResize: true,\n allowRowResize: true,\n autoSelectRow: false, // Select the full row upon selection\n autoSelectColumn: false, // Select the full column upon selection\n autoSizeColumns: true, // Automatically size the columns to fit content\n autoSizeRows: true,\n backgroundColor: '#000000',\n cellHorizontalPadding: 5,\n headerHorizontalPadding: 5,\n font: '12px Arial, sans serif',\n gridColumnColor: '#8f8f8f66',\n gridRowColor: '#8f8f8f66',\n headerBackgroundColor: '#222222',\n headerSeparatorColor: '#000000',\n headerSeparatorHoverColor: '#888888',\n headerSeparatorHandleSize: 5,\n headerHiddenSeparatorSize: 5,\n headerHiddenSeparatorHoverColor: '#8888FF',\n headerColor: '#d5d5d5',\n headerFont: '10px Arial, sans serif',\n columnHoverBackgroundColor: '#444444',\n selectedColumnHoverBackgroundColor: '#494949',\n rowBackgroundColors: '#333333 #222222',\n rowHoverBackgroundColor: '#444444',\n selectedRowHoverBackgroundColor: '#494949',\n minScrollHandleSize: 50,\n scrollBarBackgroundColor: '#111111',\n scrollBarHoverBackgroundColor: '#333333',\n scrollBarCasingColor: '#000000',\n scrollBarCornerColor: '#000000',\n scrollBarColor: '#555555',\n scrollBarHoverColor: '#888888',\n scrollBarActiveColor: '#AAAAAA',\n scrollBarSize: 12,\n scrollBarHoverSize: 16,\n scrollBarCasingWidth: 1,\n scrollSnapToColumn: false,\n scrollSnapToRow: false,\n selectionColor: '#4286f433',\n selectionOutlineColor: '#4286f4',\n selectionOutlineCasingColor: '#222222',\n shadowBlur: 8,\n shadowColor: '#000000',\n textColor: '#ffffff',\n maxDepth: 6,\n treeDepthIndent: 10,\n treeHorizontalPadding: 5,\n treeLineColor: '#888888',\n treeMarkerColor: '#cccccc',\n treeMarkerHoverColor: '#ffffff',\n\n rowHeight: 20,\n columnWidth: 100,\n minRowHeight: 20,\n minColumnWidth: 55,\n columnHeaderHeight: 20,\n rowHeaderWidth: 30,\n rowFooterWidth: 0,\n\n // When resizing the header, will snap to the auto size of the header within this threshold\n headerResizeSnapThreshold: 10,\n headerResizeHiddenSnapThreshold: 8,\n\n allowColumnReorder: true,\n allowRowReorder: true,\n reorderOffset: 2,\n\n // Colors for the grid in floating sections\n floatingGridColumnColor: '#8f8f8f66',\n floatingGridRowColor: '#8f8f8f66',\n\n // Background row colors for grid in the floating sections\n floatingRowBackgroundColors: '#393939 #292929',\n\n // Divider colors between the floating parts and the grid\n floatingDividerOuterColor: '#000000',\n floatingDividerInnerColor: '#cccccc',\n});\n"],"file":"GridTheme.js"}
1
+ {"version":3,"sources":["../src/GridTheme.ts"],"names":["Object","freeze","allowColumnResize","allowRowResize","autoSelectRow","autoSelectColumn","autoSizeColumns","autoSizeRows","backgroundColor","cellHorizontalPadding","headerHorizontalPadding","font","gridColumnColor","gridRowColor","headerBackgroundColor","headerSeparatorColor","headerSeparatorHoverColor","headerSeparatorHandleSize","headerHiddenSeparatorSize","headerHiddenSeparatorHoverColor","headerColor","headerFont","columnHoverBackgroundColor","selectedColumnHoverBackgroundColor","rowBackgroundColors","rowHoverBackgroundColor","selectedRowHoverBackgroundColor","minScrollHandleSize","scrollBarBackgroundColor","scrollBarHoverBackgroundColor","scrollBarCasingColor","scrollBarCornerColor","scrollBarColor","scrollBarHoverColor","scrollBarActiveColor","scrollBarSize","scrollBarHoverSize","scrollBarCasingWidth","scrollSnapToColumn","scrollSnapToRow","selectionColor","selectionOutlineColor","selectionOutlineCasingColor","shadowBlur","shadowColor","textColor","maxDepth","treeDepthIndent","treeHorizontalPadding","treeLineColor","treeMarkerColor","treeMarkerHoverColor","rowHeight","columnWidth","minRowHeight","minColumnWidth","columnHeaderHeight","rowHeaderWidth","rowFooterWidth","headerResizeSnapThreshold","headerResizeHiddenSnapThreshold","allowColumnReorder","allowRowReorder","reorderOffset","floatingGridColumnColor","floatingGridRowColor","floatingRowBackgroundColors","floatingDividerOuterColor","floatingDividerInnerColor"],"mappings":"AAAA;;AAGA;;AAGA;;AAGA;;AAsHA;AACA;AACA;AACA,eAAeA,MAAM,CAACC,MAAP,CAAc;AAC3BC,EAAAA,iBAAiB,EAAE,IADQ;AAE3BC,EAAAA,cAAc,EAAE,IAFW;AAG3BC,EAAAA,aAAa,EAAE,KAHY;AAGL;AACtBC,EAAAA,gBAAgB,EAAE,KAJS;AAIF;AACzBC,EAAAA,eAAe,EAAE,IALU;AAKJ;AACvBC,EAAAA,YAAY,EAAE,IANa;AAO3BC,EAAAA,eAAe,EAAE,SAPU;AAQ3BC,EAAAA,qBAAqB,EAAE,CARI;AAS3BC,EAAAA,uBAAuB,EAAE,CATE;AAU3BC,EAAAA,IAAI,EAAE,wBAVqB;AAW3BC,EAAAA,eAAe,EAAE,WAXU;AAY3BC,EAAAA,YAAY,EAAE,WAZa;AAa3BC,EAAAA,qBAAqB,EAAE,SAbI;AAc3BC,EAAAA,oBAAoB,EAAE,SAdK;AAe3BC,EAAAA,yBAAyB,EAAE,SAfA;AAgB3BC,EAAAA,yBAAyB,EAAE,CAhBA;AAiB3BC,EAAAA,yBAAyB,EAAE,CAjBA;AAkB3BC,EAAAA,+BAA+B,EAAE,SAlBN;AAmB3BC,EAAAA,WAAW,EAAE,SAnBc;AAoB3BC,EAAAA,UAAU,EAAE,wBApBe;AAqB3BC,EAAAA,0BAA0B,EAAE,SArBD;AAsB3BC,EAAAA,kCAAkC,EAAE,SAtBT;AAuB3BC,EAAAA,mBA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AA,cAAc,EAAE,EAzDW;AA0D3BC,EAAAA,cAAc,EAAE,CA1DW;AA4D3B;AACAC,EAAAA,yBAAyB,EAAE,EA7DA;AA8D3BC,EAAAA,+BAA+B,EAAE,CA9DN;AAgE3BC,EAAAA,kBAAkB,EAAE,IAhEO;AAiE3BC,EAAAA,eAAe,EAAE,IAjEU;AAkE3BC,EAAAA,aAAa,EAAE,CAlEY;AAoE3B;AACAC,EAAAA,uBAAuB,EAAE,WArEE;AAsE3BC,EAAAA,oBAAoB,EAAE,WAtEK;AAwE3B;AACAC,EAAAA,2BAA2B,EAAE,iBAzEF;AA2E3B;AACAC,EAAAA,yBAAyB,EAAE,SA5EA;AA6E3BC,EAAAA,yBAAyB,EAAE;AA7EA,CAAd,CAAf","sourcesContent":["/** A color parsed as CSS color value, eg. '#FF0000' */\nexport type GridColor = string;\n\n/** A nullable color, eg. pass `null` to skip drawing this item */\nexport type NullableGridColor = GridColor | null;\n\n/** One or more colors parsed as CSS color value separated by space, eg. '#FF0000 #00FF00' */\nexport type GridColorWay = string;\n\n/** A font parsed as CSS font value */\nexport type GridFont = string;\n\nexport type GridTheme = {\n // Allow column/row resizing\n allowColumnResize: boolean;\n allowRowResize: boolean;\n\n // Select the full row/column upon selection\n autoSelectRow: boolean;\n autoSelectColumn: boolean;\n\n // Automatically size rows/columns to fit contents\n autoSizeColumns: boolean;\n autoSizeRows: boolean;\n\n // The background color for the whole grid\n backgroundColor: GridColor;\n\n // Color to draw text\n textColor: GridColor;\n\n // Amount of padding within a cell and header\n cellHorizontalPadding: number;\n headerHorizontalPadding: number;\n\n // The font to use in the grid\n font: GridFont;\n\n // Colors to draw grid lines between columns and rows\n gridColumnColor: NullableGridColor;\n gridRowColor: NullableGridColor;\n\n // Colors for drawing the column and row headers\n headerBackgroundColor: GridColor;\n headerSeparatorColor: GridColor;\n headerSeparatorHoverColor: GridColor;\n headerSeparatorHandleSize: number;\n headerHiddenSeparatorSize: number;\n headerHiddenSeparatorHoverColor: GridColor;\n headerColor: GridColor;\n headerFont: GridFont;\n\n // Background color to highlight entire column/row if set\n columnHoverBackgroundColor: NullableGridColor;\n selectedColumnHoverBackgroundColor: NullableGridColor;\n rowHoverBackgroundColor: NullableGridColor;\n selectedRowHoverBackgroundColor: NullableGridColor;\n\n // Background colors to draw for each row, cycling through each value (eg. alternating stripes)\n rowBackgroundColors: GridColorWay;\n\n // Scroll bar look and sizing\n minScrollHandleSize: number;\n scrollBarBackgroundColor: GridColor;\n scrollBarHoverBackgroundColor: GridColor;\n scrollBarCasingColor: GridColor;\n scrollBarCornerColor: GridColor;\n scrollBarColor: GridColor;\n scrollBarHoverColor: GridColor;\n scrollBarActiveColor: GridColor;\n scrollBarSize: number;\n scrollBarHoverSize: number;\n scrollBarCasingWidth: number;\n scrollSnapToColumn: boolean;\n scrollSnapToRow: boolean;\n\n // Look of the current selection\n selectionColor: GridColor;\n selectionOutlineColor: GridColor;\n selectionOutlineCasingColor: GridColor;\n\n // Shadows to draw when representing a hierarchy, eg. when one row is a higher \"depth\" than the row above it\n shadowBlur: number;\n shadowColor: GridColor;\n maxDepth: number; // max depth of the shadowing\n\n // Other tree table metrics\n treeDepthIndent: number;\n treeHorizontalPadding: number;\n treeLineColor: GridColor;\n treeMarkerColor: GridColor;\n treeMarkerHoverColor: GridColor;\n\n // Default row height/column width\n rowHeight: number;\n columnWidth: number;\n minRowHeight: number;\n minColumnWidth: number;\n\n // Default row/column header/footers width/height\n columnHeaderHeight: number;\n rowHeaderWidth: number;\n rowFooterWidth: number;\n\n // When resizing the header, will snap to the auto size of the header within this threshold\n headerResizeSnapThreshold: number;\n headerResizeHiddenSnapThreshold: number;\n\n // Allow moving/reordering columns/rows\n allowColumnReorder: boolean;\n allowRowReorder: boolean;\n\n // The number of pixels to offset a column/row while it is being dragged to move\n reorderOffset: number;\n\n // Colors for the grid in floating sections\n floatingGridColumnColor: GridColor;\n floatingGridRowColor: GridColor;\n\n // Background row colors for grid in the floating sections\n floatingRowBackgroundColors: GridColorWay;\n\n // Divider colors between the floating parts and the grid\n floatingDividerOuterColor: GridColor;\n floatingDividerInnerColor: GridColor;\n};\n\n/**\n * Default theme for a Grid.\n */\nexport default Object.freeze({\n allowColumnResize: true,\n allowRowResize: true,\n autoSelectRow: false, // Select the full row upon selection\n autoSelectColumn: false, // Select the full column upon selection\n autoSizeColumns: true, // Automatically size the columns to fit content\n autoSizeRows: true,\n backgroundColor: '#000000',\n cellHorizontalPadding: 5,\n headerHorizontalPadding: 5,\n font: '12px Arial, sans serif',\n gridColumnColor: '#8f8f8f66',\n gridRowColor: '#8f8f8f66',\n headerBackgroundColor: '#222222',\n headerSeparatorColor: '#000000',\n headerSeparatorHoverColor: '#888888',\n headerSeparatorHandleSize: 5,\n headerHiddenSeparatorSize: 5,\n headerHiddenSeparatorHoverColor: '#8888FF',\n headerColor: '#d5d5d5',\n headerFont: '10px Arial, sans serif',\n columnHoverBackgroundColor: '#444444',\n selectedColumnHoverBackgroundColor: '#494949',\n rowBackgroundColors: '#333333 #222222',\n rowHoverBackgroundColor: '#444444',\n selectedRowHoverBackgroundColor: '#494949',\n minScrollHandleSize: 50,\n scrollBarBackgroundColor: '#111111',\n scrollBarHoverBackgroundColor: '#333333',\n scrollBarCasingColor: '#000000',\n scrollBarCornerColor: '#000000',\n scrollBarColor: '#555555',\n scrollBarHoverColor: '#888888',\n scrollBarActiveColor: '#AAAAAA',\n scrollBarSize: 12,\n scrollBarHoverSize: 16,\n scrollBarCasingWidth: 1,\n scrollSnapToColumn: false,\n scrollSnapToRow: false,\n selectionColor: '#4286f433',\n selectionOutlineColor: '#4286f4',\n selectionOutlineCasingColor: '#222222',\n shadowBlur: 8,\n shadowColor: '#000000',\n textColor: '#ffffff',\n maxDepth: 6,\n treeDepthIndent: 10,\n treeHorizontalPadding: 5,\n treeLineColor: '#888888',\n treeMarkerColor: '#cccccc',\n treeMarkerHoverColor: '#ffffff',\n\n rowHeight: 20,\n columnWidth: 100,\n minRowHeight: 20,\n minColumnWidth: 55,\n columnHeaderHeight: 20,\n rowHeaderWidth: 30,\n rowFooterWidth: 0,\n\n // When resizing the header, will snap to the auto size of the header within this threshold\n headerResizeSnapThreshold: 10,\n headerResizeHiddenSnapThreshold: 8,\n\n allowColumnReorder: true,\n allowRowReorder: true,\n reorderOffset: 2,\n\n // Colors for the grid in floating sections\n floatingGridColumnColor: '#8f8f8f66',\n floatingGridRowColor: '#8f8f8f66',\n\n // Background row colors for grid in the floating sections\n floatingRowBackgroundColors: '#393939 #292929',\n\n // Divider colors between the floating parts and the grid\n floatingDividerOuterColor: '#000000',\n floatingDividerInnerColor: '#cccccc',\n}) as GridTheme;\n"],"file":"GridTheme.js"}
@@ -1,163 +1,302 @@
1
- export default GridUtils;
1
+ import React from 'react';
2
+ import GridRange, { GridRangeIndex } from './GridRange';
3
+ import { BoxCoordinates, Coordinate, CoordinateMap, VisibleIndex, IndexModelMap, ModelIndex, ModelSizeMap, MoveOperation, SizeMap } from './GridMetrics';
4
+ import type { GridMetrics } from './GridMetrics';
5
+ import { GridTheme } from './GridTheme';
6
+ export declare type AxisRange = [start: VisibleIndex, end: VisibleIndex];
7
+ export declare type GridAxisRange = [start: GridRangeIndex, end: GridRangeIndex];
8
+ export declare type GridPoint = {
9
+ x: Coordinate;
10
+ y: Coordinate;
11
+ column: GridRangeIndex;
12
+ row: GridRangeIndex;
13
+ };
14
+ export declare type IndexCallback<T> = (itemIndex: VisibleIndex) => T | undefined;
2
15
  declare class GridUtils {
3
16
  static PIXELS_PER_LINE: number;
4
- static getGridPointFromXY(x: any, y: any, metrics: any): {
5
- x: any;
6
- y: any;
7
- row: any;
8
- column: any;
9
- };
10
- static iterateFloatingStart(start: any, total: any, callback: any): any;
17
+ /**
18
+ * Get the GridPoint for the coordinates provided
19
+ * @param x The grid x coordinate
20
+ * @param y The grid y coordinate
21
+ * @param metrics The grid metrics
22
+ * @returns The GridPoint including the column/row information
23
+ */
24
+ static getGridPointFromXY(x: Coordinate, y: Coordinate, metrics: GridMetrics): GridPoint;
25
+ /**
26
+ * Iterate through each floating item at the start and call a callback, returning the first result
27
+ * @param start The count of floating items at the start
28
+ * @param total The total number of items
29
+ * @param callback Function to call for each item
30
+ * @returns The result from the callback
31
+ */
32
+ static iterateFloatingStart<T>(start: number, total: number, callback: IndexCallback<T>): T | undefined;
11
33
  /**
12
34
  * Iterate through floating items at the end. Iterates in increasing order.
35
+ * @param end The count of floating items at the end
36
+ * @param total The total number of items
37
+ * @param callback Function to call for each item
38
+ * @returns The result from the callback
13
39
  */
14
- static iterateFloatingEnd(end: any, total: any, callback: any): any;
40
+ static iterateFloatingEnd<T>(end: number, total: number, callback: IndexCallback<T>): T | undefined;
15
41
  /**
16
42
  * Iterate through all floating items in increasing order, starting with the top items.
17
- * @param {number} start Count of start floating rows, eg. floatingTopRowCount
18
- * @param {number} end Count of end floating rows, eg. floatingBottomRowCount
19
- * @param {number} total Total number of items
20
- * @param {(itemIndex:number) => any | undefined} callback Callback called for each value, stopping the iterating and returning the value if one is returned
21
- */
22
- static iterateFloating(start: number, end: number, total: number, callback: (itemIndex: number) => any | undefined): any;
23
- static iterateAllItems(visibleStart: any, visibleEnd: any, floatingStartCount: any, floatingEndCount: any, totalCount: any, callback: any): any;
24
- static isInItem(itemIndex: any, itemXs: any, itemSizes: any, x: any): boolean;
25
- static getItemAtOffset(offset: any, itemCount: any, floatingStart: any, floatingEnd: any, items: any, itemXs: any, itemSizes: any): any;
26
- static getColumnAtX(x: any, metrics: any): any;
27
- static getRowAtY(y: any, metrics: any): any;
43
+ * @param start Count of start floating rows, e.g. floatingTopRowCount
44
+ * @param end Count of end floating rows, e.g. floatingBottomRowCount
45
+ * @param total Total number of items
46
+ * @param callback Callback called for each value, stopping the iterating and returning the value if one is returned
47
+ */
48
+ static iterateFloating<T>(start: number, end: number, total: number, callback: IndexCallback<T>): T | undefined;
49
+ /**
50
+ * Iterate through all items in one dimension on the grid - first floating, then visible.
51
+ * Call the callback for each item, break if a result is returned and return that result.
52
+ * @param visibleStart Index of the start of the visible viewport
53
+ * @param visibleEnd Index of the end of the visible viewport
54
+ * @param floatingStartCount Number of items floating at the start
55
+ * @param floatingEndCount Number of items floating at the end
56
+ * @param totalCount Total number of items
57
+ * @param callback Callback to call for each item
58
+ * @returns The first result from the callback called, or undefined
59
+ */
60
+ static iterateAllItems<T>(visibleStart: VisibleIndex, visibleEnd: VisibleIndex, floatingStartCount: number, floatingEndCount: number, totalCount: number, callback: IndexCallback<T>): T | undefined;
61
+ /**
62
+ * Check if the coordinate is within the item specified in this dimension
63
+ * @param itemIndex Index of the item to check
64
+ * @param itemCoordinatess Coordinate of all items in this dimension
65
+ * @param itemSizes Size of all items in this dimension
66
+ * @param coordinate The coordinate to check
67
+ * @returns True if the coordinate is within the item specified, false otherwise
68
+ */
69
+ static isInItem(itemIndex: VisibleIndex, itemCoordinates: CoordinateMap, itemSizes: SizeMap, coordinate: Coordinate): boolean;
70
+ /**
71
+ * Get the Index of the item at the provided offset
72
+ * @param offset Coordinate of the offset to get the item of
73
+ * @param itemCount The total count of items
74
+ * @param floatingStart Count of floating items at the start
75
+ * @param floatingEnd Count of floating items at the end
76
+ * @param items Index of all items
77
+ * @param itemCoordinates The coordinate of each item
78
+ * @param itemSizes The size of each item
79
+ * @returns The item index, or null if no item matches
80
+ */
81
+ static getItemAtOffset(offset: Coordinate, itemCount: number, floatingStart: number, floatingEnd: number, items: VisibleIndex[], itemCoordinates: CoordinateMap, itemSizes: SizeMap): VisibleIndex | null;
82
+ /**
83
+ * Get the index of the column at the specified x coordinate
84
+ * @param x Coordinate to get the item of
85
+ * @param metrics Grid metrics
86
+ * @returns Index of the column at that coordinate, or null if no column matches
87
+ */
88
+ static getColumnAtX(x: Coordinate, metrics: GridMetrics): VisibleIndex | null;
89
+ /**
90
+ * Get the index of the row at the specified y coordinate
91
+ * @param y Coordinate to get the item of
92
+ * @param metrics Grid metrics
93
+ * @returns Index of the row at that coordinate, or null if no row matches
94
+ */
95
+ static getRowAtY(y: Coordinate, metrics: GridMetrics): VisibleIndex | null;
28
96
  /**
29
97
  * Iterate backward through the visible items until a shown item is hit
30
98
  * @param {Number} startIndex The index to start from
31
99
  * @param {Map} modelIndexes The mapping of model indexes
32
100
  * @param {Number[]} visibleItems The visible items
33
101
  * @param {Map} userSizes The user set sizes
102
+ * @returns Index of the next visible item, or null if no more are visible
34
103
  */
35
- static getNextShownItem(startIndex: number, modelIndexes: Map<any, any>, visibleItems: number[], userSizes: Map<any, any>): number | null;
104
+ static getNextShownItem(startIndex: VisibleIndex, modelIndexes: IndexModelMap, visibleItems: VisibleIndex[], userSizes: ModelSizeMap): VisibleIndex | null;
36
105
  /**
37
106
  * Iterate backward through the visible columns until a shown column is hit
38
- * @param {Number} columnIndex The column index to start iterating backward from
39
- * @param {GridMetrics} metrics The GridMetricCalculator metrics
107
+ * @param columnIndex The column index to start iterating backward from
108
+ * @param metrics The GridMetricCalculator metrics
109
+ * @returns Index of the next visible item, or null if no more are visible
40
110
  */
41
- static getNextShownColumn(startIndex: any, metrics: any): number | null;
111
+ static getNextShownColumn(startIndex: VisibleIndex, metrics: GridMetrics): VisibleIndex | null;
42
112
  /**
43
113
  * Iterate backward through the visible rows until a shown row is hit
44
- * @param {Number} rowIndex The row index to start iterating backward from
45
- * @param {GridMetrics} metrics The GridMetricCalculator metrics
114
+ * @param rowIndex The row index to start iterating backward from
115
+ * @param metrics The GridMetricCalculator metrics
116
+ * @returns Index of the next visible item, or null if no more are visible
46
117
  */
47
- static getNextShownRow(startIndex: any, metrics: any): number | null;
118
+ static getNextShownRow(startIndex: VisibleIndex, metrics: GridMetrics): VisibleIndex | null;
48
119
  /**
49
- * Gets the column index if the x/y coordinated provided are close enough
50
- * @param {Number} x Mouse x coordinate
51
- * @param {Number} y Mouse y coordinate
52
- * @param {GridMetrics} metrics The GridMetricCalculator metrics
53
- * @param {GridTheme} theme The grid theme with potantial user overrides
54
- * @returns {Number|null} Column index or null
120
+ * Gets the column index if the x/y coordinates provided are close enough to the separator, otherwise null
121
+ * @param x Mouse x coordinate
122
+ * @param y Mouse y coordinate
123
+ * @param metrics The grid metrics
124
+ * @param theme The grid theme with potential user overrides
125
+ * @returns Index of the column separator at the coordinates provided, or null if none match
55
126
  */
56
- static getColumnSeparatorIndex(x: number, y: number, metrics: any, theme: any): number | null;
57
- static isItemHidden(itemIndex: any, visibleSizes: any): boolean;
58
- static isColumnHidden(columnIndex: any, metrics: any): boolean;
127
+ static getColumnSeparatorIndex(x: Coordinate, y: Coordinate, metrics: GridMetrics, theme: GridTheme): VisibleIndex | null;
128
+ /**
129
+ * Check if the item specified is hidden
130
+ * @param itemIndex Index of the item to check
131
+ * @param visibleSizes Sizes of all visible items
132
+ * @returns True if the item is hidden, false otherwise
133
+ */
134
+ static isItemHidden(itemIndex: VisibleIndex, visibleSizes: SizeMap): boolean;
135
+ /**
136
+ * Check if the column specified is hidden
137
+ * @param columnIndex Index of the column to check
138
+ * @param metrics Grid metrics
139
+ * @returns True if the column is hidden, false otherwise
140
+ */
141
+ static isColumnHidden(columnIndex: VisibleIndex, metrics: GridMetrics): boolean;
59
142
  /**
60
143
  * Check if the provided row is a floating row
61
- * @param {number} row The row index to check
62
- * @param {GridMetrics} metrics The grid metrics to check against
144
+ * @param row The row index to check
145
+ * @param metrics The grid metrics to check against
146
+ * @returns True if it's a floating row, false otherwise
63
147
  */
64
- static isFloatingRow(row: number, metrics: any): boolean;
148
+ static isFloatingRow(row: VisibleIndex, metrics: GridMetrics): boolean;
65
149
  /**
66
150
  * Check if the provided column is a floating column
67
- * @param {number} column The column index to check
68
- * @param {GridMetrics} metrics The grid metrics to check against
151
+ * @param column The column index to check
152
+ * @param metrics The grid metrics to check against
153
+ * @returns True if it's a floating column, false otherwise
154
+ */
155
+ static isFloatingColumn(column: VisibleIndex, metrics: GridMetrics): boolean;
156
+ /**
157
+ * Get all the items that are hidden under the same Index
158
+ * E.g. If columns are 1, 2, 3, 4, 5, and column 2, 3, 4 are hidden, and we check for item 4, the return will be [2, 3, 4]
159
+ * @param itemIndex Index of the item to start at
160
+ * @param visibleSizes Visible size map
161
+ * @param visibleItems Visible items
162
+ * @returns Array of items that are hidden
163
+ */
164
+ static getHiddenItems(itemIndex: VisibleIndex, visibleSizes: SizeMap, visibleItems: VisibleIndex[]): VisibleIndex[];
165
+ /**
166
+ * Get all the columns that are hidden under the same Index
167
+ * @param columnIndex Index of the item to start at
168
+ * @param metrics Grid metrics
169
+ * @returns Array of items that are hidden
69
170
  */
70
- static isFloatingColumn(column: number, metrics: any): boolean;
71
- static getHiddenItems(itemIndex: any, visibleSizes: any, visibleItems: any): any[];
72
- static getHiddenColumns(columnIndex: any, metrics: any): any[];
73
- static getRowSeparatorIndex(x: any, y: any, metrics: any, theme: any): any;
74
- static isRowHidden(rowIndex: any, metrics: any): boolean;
75
- static getHiddenRows(rowIndex: any, metrics: any): any[];
171
+ static getHiddenColumns(columnIndex: VisibleIndex, metrics: GridMetrics): VisibleIndex[];
172
+ /**
173
+ * Returns the row index if the x/y coordinates provided are close enough to the separator, otherwise null
174
+ * @param x X coordinate to check
175
+ * @param y Y coordinate to check
176
+ * @param metrics The grid metrics
177
+ * @param theme The grid theme
178
+ * @returns Index of the row separator at the coordinates provided, or null if none match
179
+ */
180
+ static getRowSeparatorIndex(x: Coordinate, y: Coordinate, metrics: GridMetrics, theme: GridTheme): VisibleIndex | null;
181
+ /**
182
+ * Check if the row specified is hidden
183
+ * @param rowIndex Index of the row to check
184
+ * @param metrics Grid metrics
185
+ * @returns True if the row is hidden, false otherwise
186
+ */
187
+ static isRowHidden(rowIndex: VisibleIndex, metrics: GridMetrics): boolean;
188
+ /**
189
+ * Get all the rows that are hidden under the same Index
190
+ * @param rowIndex Index of the item to start at
191
+ * @param metrics Grid metrics
192
+ * @returns Array of items that are hidden
193
+ */
194
+ static getHiddenRows(rowIndex: VisibleIndex, metrics: GridMetrics): VisibleIndex[];
76
195
  /**
77
196
  * Set a new order for items in the grid
78
- * @param {Number} from The visible index to move from
79
- * @param {Number} to The visible index to move the itme to
80
- * @param {Array} oldMovedItems The old reordered items
81
- * @returns {Number} The new reordered items
197
+ * @param from The visible index to move from
198
+ * @param to The visible index to move the itme to
199
+ * @param oldMovedItems The old reordered items
200
+ * @returns The new reordered items
82
201
  */
83
- static moveItem(from: number, to: number, oldMovedItems?: any[]): number;
202
+ static moveItem(from: VisibleIndex, to: VisibleIndex, oldMovedItems?: MoveOperation[]): MoveOperation[];
84
203
  /**
85
204
  * Retrieve the model index given the currently moved items
86
- * @param {Number} visibleIndex The visible index of the item to get the model index for
87
- * @param {Array} movedItems The moved items
88
- * @returns {Number} The model index of the item
205
+ * @param visibleIndex The visible index of the item to get the model index for
206
+ * @param movedItems The moved items
207
+ * @returns The model index of the item
89
208
  */
90
- static getModelIndex(visibleIndex: number, movedItems?: any[]): number;
209
+ static getModelIndex(visibleIndex: VisibleIndex, movedItems?: MoveOperation[]): ModelIndex;
91
210
  /**
92
211
  * Translate the provided UI start/end indexes to the model start/end indexes by applying the `movedItems` transformations.
93
212
  * Since moved items can split apart a range, multiple pairs of indexes are returned
94
213
  *
95
- * @param {number} start Start item in one dimension
96
- * @param {number} end End item in one dimension
97
- * @param {MovedItem[]} movedItems Moved item pairs in this dimension
98
- * @returns {AxisRange[]} Array of start/end pairs of the indexes after transformations applied.
214
+ * @param start Start item in one dimension
215
+ * @param end End item in one dimension
216
+ * @param movedItems Moved item pairs in this dimension
217
+ * @returns Array of start/end pairs of the indexes after transformations applied.
99
218
  */
100
- static getModelRangeIndexes(start: number, end: number, movedItems: any[]): any[];
219
+ static getModelRangeIndexes(start: GridRangeIndex, end: GridRangeIndex, movedItems: MoveOperation[]): GridAxisRange[];
101
220
  /**
102
221
  * Translate the provided UI range into model range, using the `movedColumns` and `movedRows` to apply the necessary transforms.
103
222
  * `movedColumns` and `movedRows` are array of operations done to the UI indexes to re-order items
104
223
  *
105
- * @param {GridRange} uiRange The currently selected UI ranges
106
- * @param {Array} movedColumns The moved column pairs
107
- * @param {Array} movedRows The moved row pairs
108
- * @returns {GridRange[]} The model ranges after translation.
224
+ * @param uiRange The currently selected UI ranges
225
+ * @param movedColumns The moved column pairs
226
+ * @param movedRows The moved row pairs
227
+ * @returns The model ranges after translation.
109
228
  */
110
- static getModelRange(uiRange: GridRange, movedColumns?: any[], movedRows?: any[]): GridRange[];
229
+ static getModelRange(uiRange: GridRange, movedColumns?: MoveOperation[], movedRows?: MoveOperation[]): GridRange[];
111
230
  /**
112
231
  * Translate the provided UI range into model ranges, using the `movedColumns` and `movedRows` to apply the necessary transforms.
113
232
  * `movedColumns` and `movedRows` are array of operations done to the UI indexes to re-order items
114
233
  *
115
- * @param {GridRange[]} uiRanges The currently selected UI ranges
116
- * @param {Array} movedColumns The moved column pairs
117
- * @param {Array} movedRows The moved row pairs
118
- * @returns {GridRange[]} The model ranges after translation.
234
+ * @param uiRanges The currently selected UI ranges
235
+ * @param movedColumns The moved column pairs
236
+ * @param movedRows The moved row pairs
237
+ * @returns The model ranges after translation.
119
238
  */
120
- static getModelRanges(uiRanges: GridRange[], movedColumns?: any[], movedRows?: any[]): GridRange[];
239
+ static getModelRanges(uiRanges: GridRange[], movedColumns?: MoveOperation[], movedRows?: MoveOperation[]): GridRange[];
121
240
  /**
122
241
  * Retrieve the visible index given the currently moved items
123
- * @param {Number} modelIndex The model index to get the visible index for
124
- * @param {Array} movedItems Moved items
125
- * @returns {Number} The visible index of the item
242
+ * @param modelIndex The model index to get the visible index for
243
+ * @param movedItems Moved items
244
+ * @returns The visible index of the item
245
+ */
246
+ static getVisibleIndex(modelIndex: ModelIndex, movedItems?: MoveOperation[]): VisibleIndex;
247
+ /**
248
+ * Check if the current platform is Mac
249
+ * @returns True if this platform is a Mac, false otherwise
126
250
  */
127
- static getVisibleIndex(modelIndex: number, movedItems?: any[]): number;
128
251
  static isMacPlatform(): boolean;
129
- static getModifierKey(): "metaKey" | "ctrlKey";
130
- static isModifierKeyDown(event: any): any;
131
- static checkColumnHidden(modelIndex: any, userColumnWidths: any): boolean;
132
- static checkAllColumnsHidden(columns: any, userColumnWidths: any): any;
252
+ /**
253
+ * Get the modifier key for the current platform
254
+ * @returns The modifier key for the current platform
255
+ */
256
+ static getModifierKey(): 'metaKey' | 'ctrlKey';
257
+ /**
258
+ * Check if the modifier key is down for the given event
259
+ * @param event The event to check
260
+ * @returns True if the modifier key is down, false otherwise
261
+ */
262
+ static isModifierKeyDown(event: MouseEvent | KeyboardEvent | React.KeyboardEvent | React.MouseEvent): boolean;
263
+ /**
264
+ * Check if the user has hidden the specified column
265
+ * @param modelIndex The model index to check
266
+ * @param userColumnWidths The user set column widths
267
+ * @returns True if the user has hidden the column
268
+ */
269
+ static checkColumnHidden(modelIndex: ModelIndex, userColumnWidths: ModelSizeMap): boolean;
270
+ /**
271
+ * Check if all the columns specified are hidden
272
+ * @param columns Columns to check
273
+ * @param userColumnWidths The user set column widths
274
+ * @returns True if the user has hidden all of the columns
275
+ */
276
+ static checkAllColumnsHidden(columns: ModelIndex[], userColumnWidths: ModelSizeMap): boolean;
133
277
  /**
134
278
  * Get the bounds the mouse needs to be dragged outside of from an initial selection before scrolling occurs.
135
279
  * Taking into account any floating rows that may be covering the viewport.
136
- * @param {GridMetrics} metrics Grid metrics
137
- * @param {number} row The row they started dragging in
138
- * @param {number} column The column they started the drag from
280
+ * @param metrics Grid metrics
281
+ * @param row The row they started dragging in
282
+ * @param column The column they started the drag from
139
283
  * @returns Dimensions of the drag area in relation to the canvas they need to drag outside of to start scrolling
140
284
  */
141
- static getScrollDragBounds(metrics: any, row: number, column: number): {
142
- x: any;
143
- y: any;
144
- x2: any;
145
- y2: any;
146
- };
285
+ static getScrollDragBounds(metrics: GridMetrics, row: GridRangeIndex, column: GridRangeIndex): BoxCoordinates;
147
286
  /**
148
287
  * Converts the delta coordinates from the provided wheel event to pixels
149
288
  * Different platforms have different ways of providing the delta so this normalizes it
150
- * @param {WheelEvent} wheelEvent The mouse wheel event to get the scrolling delta for
151
- * @param {number?} pageWidth The width of the page that is scrolling
152
- * @param {number?} pageHeight The height of the page that is scrolling
153
- * @param {number?} lineWidth The width of the line scrolling in line mode
154
- * @param {number?} lineHeight The height of the line scrolling in line mode
155
- * @returns {{deltaX:number, deltaY: number}} The delta coordinates normalized to pixels
156
- */
157
- static getScrollDelta(wheelEvent: WheelEvent, pageWidth?: number | null, pageHeight?: number | null, lineWidth?: number | null, lineHeight?: number | null): {
289
+ * @param wheelEvent The mouse wheel event to get the scrolling delta for
290
+ * @param pageWidth The width of the page that is scrolling
291
+ * @param pageHeight The height of the page that is scrolling
292
+ * @param lineWidth The width of the line scrolling in line mode
293
+ * @param lineHeight The height of the line scrolling in line mode
294
+ * @returns The delta coordinates normalized to pixels
295
+ */
296
+ static getScrollDelta(wheelEvent: WheelEvent, pageWidth?: number, pageHeight?: number, lineWidth?: number, lineHeight?: number): {
158
297
  deltaX: number;
159
298
  deltaY: number;
160
299
  };
161
300
  }
162
- import GridRange from "./GridRange";
301
+ export default GridUtils;
163
302
  //# sourceMappingURL=GridUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GridUtils.d.ts","sourceRoot":"","sources":["../src/GridUtils.js"],"names":[],"mappings":";AAEA;IAGE,+BAAiC;IAEjC;;;;;MAKC;IAED,wEASC;IAED;;OAEG;IACH,oEASC;IAED;;;;;;OAMG;IACH,8BALW,MAAM,OACN,MAAM,SACN,MAAM,wBACK,MAAM,KAAK,GAAG,GAAG,SAAS,OAQ/C;IAED,gJA+BC;IAED,8EAIC;IAED,wIAgCC;IAED,+CAwBC;IAED,4CAwBC;IAED;;;;;;OAMG;IACH,uFAHW,QAAQ,2CAkBlB;IAED;;;;OAIG;IACH,wEAQC;IAED;;;;OAIG;IACH,qEAQC;IAED;;;;;;;OAOG;IACH,gFAFa,SAAO,IAAI,CAqFvB;IAED,gEAEC;IAED,+DAGC;IAED;;;;OAIG;IACH,0BAHW,MAAM,yBAYhB;IAED;;;;OAIG;IACH,gCAHW,MAAM,yBAiBhB;IAED,mFAmBC;IAED,+DAOC;IAGD,2EAgDC;IAED,yDAGC;IAED,yDAGC;IAED;;;;;;OAMG;IACH,yEAoBC;IAED;;;;;OAKG;IACH,uEAeC;IAED;;;;;;;;OAQG;IACH,mCALW,MAAM,OACN,MAAM,cACN,KAAW,GACT,KAAW,CA4EvB;IAED;;;;;;;;OAQG;IACH,8BALW,SAAS,4CAGP,SAAS,EAAE,CAsBvB;IAED;;;;;;;;OAQG;IACH,gCALW,SAAS,EAAE,4CAGT,SAAS,EAAE,CAUvB;IAED;;;;;OAKG;IACH,uEAqBC;IAED,gCAGC;IAED,+CAMC;IAED,0CAGC;IAED,0EAEC;IAED,uEAKC;IAED;;;;;;;OAOG;IACH,8CAJW,MAAM,UACN,MAAM;;;;;MA0ChB;IAED;;;;;;;;;OASG;IACH,kCAPW,UAAU,cACV,MAAM,sBACN,MAAM,qBACN,MAAM,sBACN,MAAM;gBACI,MAAM;gBAAU,MAAM;MAoD1C;CACF"}
1
+ {"version":3,"file":"GridUtils.d.ts","sourceRoot":"","sources":["../src/GridUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,EAAE,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EACL,cAAc,EACd,UAAU,EACV,aAAa,EACb,YAAY,EACZ,aAAa,EACb,UAAU,EACV,YAAY,EACZ,aAAa,EACb,OAAO,EACR,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,oBAAY,SAAS,GAAG,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC;AAEjE,oBAAY,aAAa,GAAG,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;AAEzE,oBAAY,SAAS,GAAG;IACtB,CAAC,EAAE,UAAU,CAAC;IACd,CAAC,EAAE,UAAU,C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