@sage-bionetworks/react-datasheet-grid 4.11.5-sage.1
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/LICENSE +21 -0
- package/README.md +77 -0
- package/dist/columns/checkboxColumn.d.ts +3 -0
- package/dist/columns/checkboxColumn.d.ts.map +1 -0
- package/dist/columns/dateColumn.d.ts +3 -0
- package/dist/columns/dateColumn.d.ts.map +1 -0
- package/dist/columns/floatColumn.d.ts +9 -0
- package/dist/columns/floatColumn.d.ts.map +1 -0
- package/dist/columns/intColumn.d.ts +9 -0
- package/dist/columns/intColumn.d.ts.map +1 -0
- package/dist/columns/isoDateColumn.d.ts +3 -0
- package/dist/columns/isoDateColumn.d.ts.map +1 -0
- package/dist/columns/keyColumn.d.ts +8 -0
- package/dist/columns/keyColumn.d.ts.map +1 -0
- package/dist/columns/percentColumn.d.ts +9 -0
- package/dist/columns/percentColumn.d.ts.map +1 -0
- package/dist/columns/textColumn.d.ts +24 -0
- package/dist/columns/textColumn.d.ts.map +1 -0
- package/dist/components/AddRows.d.ts +8 -0
- package/dist/components/AddRows.d.ts.map +1 -0
- package/dist/components/Cell.d.ts +12 -0
- package/dist/components/Cell.d.ts.map +1 -0
- package/dist/components/ContextMenu.d.ts +7 -0
- package/dist/components/ContextMenu.d.ts.map +1 -0
- package/dist/components/DataSheetGrid.d.ts +6 -0
- package/dist/components/DataSheetGrid.d.ts.map +1 -0
- package/dist/components/Grid.d.ts +43 -0
- package/dist/components/Grid.d.ts.map +1 -0
- package/dist/components/SelectionRect.d.ts +4 -0
- package/dist/components/SelectionRect.d.ts.map +1 -0
- package/dist/components/StaticDataSheetGrid.d.ts +6 -0
- package/dist/components/StaticDataSheetGrid.d.ts.map +1 -0
- package/dist/hooks/useColumnWidths.d.ts +14 -0
- package/dist/hooks/useColumnWidths.d.ts.map +1 -0
- package/dist/hooks/useColumns.d.ts +8 -0
- package/dist/hooks/useColumns.d.ts.map +1 -0
- package/dist/hooks/useDebounceState.d.ts +2 -0
- package/dist/hooks/useDebounceState.d.ts.map +1 -0
- package/dist/hooks/useDeepEqualState.d.ts +3 -0
- package/dist/hooks/useDeepEqualState.d.ts.map +1 -0
- package/dist/hooks/useDocumentEventListener.d.ts +2 -0
- package/dist/hooks/useDocumentEventListener.d.ts.map +1 -0
- package/dist/hooks/useEdges.d.ts +8 -0
- package/dist/hooks/useEdges.d.ts.map +1 -0
- package/dist/hooks/useFirstRender.d.ts +2 -0
- package/dist/hooks/useFirstRender.d.ts.map +1 -0
- package/dist/hooks/useGetBoundingClientRect.d.ts +3 -0
- package/dist/hooks/useGetBoundingClientRect.d.ts.map +1 -0
- package/dist/hooks/useMemoizedIndexCallback.d.ts +2 -0
- package/dist/hooks/useMemoizedIndexCallback.d.ts.map +1 -0
- package/dist/hooks/useRowHeights.d.ts +13 -0
- package/dist/hooks/useRowHeights.d.ts.map +1 -0
- package/dist/index.cjs +10 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3145 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +198 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/copyPasting.d.ts +5 -0
- package/dist/utils/copyPasting.d.ts.map +1 -0
- package/dist/utils/domParser.d.ts +2 -0
- package/dist/utils/domParser.d.ts.map +1 -0
- package/dist/utils/tab.d.ts +2 -0
- package/dist/utils/tab.d.ts.map +1 -0
- package/dist/utils/typeCheck.d.ts +6 -0
- package/dist/utils/typeCheck.d.ts.map +1 -0
- package/package.json +87 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Nicolas Keller
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# react-datasheet-grid
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
[](https://coveralls.io/github/nick-keller/react-datasheet-grid)
|
|
5
|
+
[](https://www.npmjs.com/package/react-datasheet-grid)
|
|
6
|
+
[](https://github.com/nick-keller/react-datasheet-grid)
|
|
7
|
+

|
|
8
|
+
[](https://standardjs.com)
|
|
9
|
+
|
|
10
|
+
View [demo and documentation](https://react-datasheet-grid.netlify.app/)
|
|
11
|
+
|
|
12
|
+
An Airtable-like / Excel-like component to create beautiful spreadsheets.
|
|
13
|
+
|
|
14
|
+

|
|
15
|
+
|
|
16
|
+
Feature rich:
|
|
17
|
+
- Dead simple to set up and to use
|
|
18
|
+
- Supports copy / pasting to and from Excel, Google-sheet...
|
|
19
|
+
- Keyboard navigation and shortcuts fully-supported
|
|
20
|
+
- Supports right-clicking and custom context menu
|
|
21
|
+
- Supports dragging corner to expand selection
|
|
22
|
+
- Easy to extend and implement custom widgets
|
|
23
|
+
- Blazing fast, optimized for speed, minimal renders count
|
|
24
|
+
- Smooth animations
|
|
25
|
+
- Virtualized rows and columns, supports hundreds of thousands of rows
|
|
26
|
+
- Extensively customizable, controllable behaviors
|
|
27
|
+
- Built with Typescript
|
|
28
|
+
|
|
29
|
+
## Install
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm i react-datasheet-grid
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import {
|
|
39
|
+
DataSheetGrid,
|
|
40
|
+
checkboxColumn,
|
|
41
|
+
textColumn,
|
|
42
|
+
keyColumn,
|
|
43
|
+
} from 'react-datasheet-grid'
|
|
44
|
+
|
|
45
|
+
// Import the style only once in your app!
|
|
46
|
+
import 'react-datasheet-grid/dist/style.css'
|
|
47
|
+
|
|
48
|
+
const Example = () => {
|
|
49
|
+
const [ data, setData ] = useState([
|
|
50
|
+
{ active: true, firstName: 'Elon', lastName: 'Musk' },
|
|
51
|
+
{ active: false, firstName: 'Jeff', lastName: 'Bezos' },
|
|
52
|
+
])
|
|
53
|
+
|
|
54
|
+
const columns = [
|
|
55
|
+
{
|
|
56
|
+
...keyColumn('active', checkboxColumn),
|
|
57
|
+
title: 'Active',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
...keyColumn('firstName', textColumn),
|
|
61
|
+
title: 'First name',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
...keyColumn('lastName', textColumn),
|
|
65
|
+
title: 'Last name',
|
|
66
|
+
},
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<DataSheetGrid
|
|
71
|
+
value={data}
|
|
72
|
+
onChange={setData}
|
|
73
|
+
columns={columns}
|
|
74
|
+
/>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkboxColumn.d.ts","sourceRoot":"","sources":["../../src/columns/checkboxColumn.tsx"],"names":[],"mappings":"AACA,OAAO,EAA4B,MAAM,EAAE,MAAM,UAAU,CAAA;AAsD3D,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,CAShE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateColumn.d.ts","sourceRoot":"","sources":["../../src/columns/dateColumn.tsx"],"names":[],"mappings":"AACA,OAAO,EAA4B,MAAM,EAAE,MAAM,UAAU,CAAA;AA4C3D,eAAO,MAAM,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAahE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const floatColumn: Partial<import('../types').Column<number | null, {
|
|
2
|
+
placeholder?: string | undefined;
|
|
3
|
+
alignRight: boolean;
|
|
4
|
+
continuousUpdates: boolean;
|
|
5
|
+
parseUserInput: (value: string) => number | null;
|
|
6
|
+
formatBlurredInput: (value: number | null) => string;
|
|
7
|
+
formatInputOnFocus: (value: number | null) => string;
|
|
8
|
+
}, string>>;
|
|
9
|
+
//# sourceMappingURL=floatColumn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floatColumn.d.ts","sourceRoot":"","sources":["../../src/columns/floatColumn.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;;;;;;WAYtB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const intColumn: Partial<import('../types').Column<number | null, {
|
|
2
|
+
placeholder?: string | undefined;
|
|
3
|
+
alignRight: boolean;
|
|
4
|
+
continuousUpdates: boolean;
|
|
5
|
+
parseUserInput: (value: string) => number | null;
|
|
6
|
+
formatBlurredInput: (value: number | null) => string;
|
|
7
|
+
formatInputOnFocus: (value: number | null) => string;
|
|
8
|
+
}, string>>;
|
|
9
|
+
//# sourceMappingURL=intColumn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intColumn.d.ts","sourceRoot":"","sources":["../../src/columns/intColumn.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;WAYpB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isoDateColumn.d.ts","sourceRoot":"","sources":["../../src/columns/isoDateColumn.tsx"],"names":[],"mappings":"AACA,OAAO,EAA4B,MAAM,EAAE,MAAM,UAAU,CAAA;AA8C3D,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAWrE,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Column } from '../types';
|
|
2
|
+
type ColumnData = {
|
|
3
|
+
key: string;
|
|
4
|
+
original: Partial<Column<any, any, any>>;
|
|
5
|
+
};
|
|
6
|
+
export declare const keyColumn: <T extends Record<string, any>, K extends keyof T = keyof T, PasteValue = string>(key: K, column: Partial<Column<T[K], any, PasteValue>>) => Partial<Column<T, ColumnData, PasteValue>>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=keyColumn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyColumn.d.ts","sourceRoot":"","sources":["../../src/columns/keyColumn.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,MAAM,EAAE,MAAM,UAAU,CAAA;AAEhD,KAAK,UAAU,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;CAAE,CAAA;AAsC3E,eAAO,MAAM,SAAS,yLA2CpB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const percentColumn: Partial<import('../types').Column<number | null, {
|
|
2
|
+
placeholder?: string | undefined;
|
|
3
|
+
alignRight: boolean;
|
|
4
|
+
continuousUpdates: boolean;
|
|
5
|
+
parseUserInput: (value: string) => number | null;
|
|
6
|
+
formatBlurredInput: (value: number | null) => string;
|
|
7
|
+
formatInputOnFocus: (value: number | null) => string;
|
|
8
|
+
}, string>>;
|
|
9
|
+
//# sourceMappingURL=percentColumn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"percentColumn.d.ts","sourceRoot":"","sources":["../../src/columns/percentColumn.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa;;;;;;;WAqBxB,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Column } from '../types';
|
|
2
|
+
type TextColumnOptions<T> = {
|
|
3
|
+
placeholder?: string;
|
|
4
|
+
alignRight?: boolean;
|
|
5
|
+
continuousUpdates?: boolean;
|
|
6
|
+
deletedValue?: T;
|
|
7
|
+
parseUserInput?: (value: string) => T;
|
|
8
|
+
formatBlurredInput?: (value: T) => string;
|
|
9
|
+
formatInputOnFocus?: (value: T) => string;
|
|
10
|
+
formatForCopy?: (value: T) => string;
|
|
11
|
+
parsePastedValue?: (value: string) => T;
|
|
12
|
+
};
|
|
13
|
+
type TextColumnData<T> = {
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
alignRight: boolean;
|
|
16
|
+
continuousUpdates: boolean;
|
|
17
|
+
parseUserInput: (value: string) => T;
|
|
18
|
+
formatBlurredInput: (value: T) => string;
|
|
19
|
+
formatInputOnFocus: (value: T) => string;
|
|
20
|
+
};
|
|
21
|
+
export declare const textColumn: Partial<Column<string | null, TextColumnData<string | null>, string>>;
|
|
22
|
+
export declare function createTextColumn<T = string | null>({ placeholder, alignRight, continuousUpdates, deletedValue, parseUserInput, formatBlurredInput, formatInputOnFocus, formatForCopy, parsePastedValue, }?: TextColumnOptions<T>): Partial<Column<T, TextColumnData<T>, string>>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=textColumn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textColumn.d.ts","sourceRoot":"","sources":["../../src/columns/textColumn.tsx"],"names":[],"mappings":"AACA,OAAO,EAA4B,MAAM,EAAE,MAAM,UAAU,CAAA;AAI3D,KAAK,iBAAiB,CAAC,CAAC,IAAI;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IAEpB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAE3B,YAAY,CAAC,EAAE,CAAC,CAAA;IAEhB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,CAAA;IAErC,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAA;IAEzC,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAA;IAEzC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAA;IAEpC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,CAAA;CACxC,CAAA;AAED,KAAK,cAAc,CAAC,CAAC,IAAI;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;IACnB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,CAAA;IACpC,kBAAkB,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAA;IACxC,kBAAkB,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAA;CACzC,CAAA;AAsID,eAAO,MAAM,UAAU,uEAAoC,CAAA;AAE3D,wBAAgB,gBAAgB,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,EAAE,EAClD,WAAW,EACX,UAAkB,EAClB,iBAAwB,EACxB,YAAmC,EACnC,cAAkE,EAClE,kBAAmD,EACnD,kBAAmD,EACnD,aAA8C,EAC9C,gBACmE,GACpE,GAAE,iBAAiB,CAAC,CAAC,CAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAgB3E"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React, FC } from 'react';
|
|
2
|
+
import { AddRowsComponentProps } from '../types';
|
|
3
|
+
export declare const createAddRowsComponent: (translationKeys?: {
|
|
4
|
+
button?: string;
|
|
5
|
+
unit?: string;
|
|
6
|
+
}) => FC<AddRowsComponentProps>;
|
|
7
|
+
export declare const AddRows: React.FC<AddRowsComponentProps>;
|
|
8
|
+
//# sourceMappingURL=AddRows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddRows.d.ts","sourceRoot":"","sources":["../../src/components/AddRows.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,EAAY,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAEhD,eAAO,MAAM,sBAAsB,qBAEd;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,KAClD,GAAG,qBAAqB,CAkC1B,CAAA;AAEH,eAAO,MAAM,OAAO,iCAA2B,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export declare const Cell: FC<{
|
|
3
|
+
gutter: boolean;
|
|
4
|
+
stickyRight: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
children?: any;
|
|
9
|
+
width: number;
|
|
10
|
+
left: number;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=Cell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cell.d.ts","sourceRoot":"","sources":["../../src/components/Cell.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAGjC,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC;IACpB,MAAM,EAAE,OAAO,CAAA;IACf,WAAW,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb,CA4BA,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ContextMenuItem, ContextMenuComponentProps } from '../types';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
export declare const defaultRenderItem: (item: ContextMenuItem) => React.JSX.Element;
|
|
5
|
+
export declare const createContextMenuComponent: (renderItem?: (item: ContextMenuItem) => JSX.Element) => FC<ContextMenuComponentProps>;
|
|
6
|
+
export declare const ContextMenu: React.FC<ContextMenuComponentProps>;
|
|
7
|
+
//# sourceMappingURL=ContextMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextMenu.d.ts","sourceRoot":"","sources":["../../src/components/ContextMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,EAAE,EAAuB,MAAM,OAAO,CAAA;AAE/C,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AAErE,eAAO,MAAM,iBAAiB,SAAU,eAAe,sBA0CtD,CAAA;AAED,eAAO,MAAM,0BAA0B,uBAEhB,eAAe,KAAK,WAAW,KACjD,GAAG,yBAAyB,CAkC9B,CAAA;AAEH,eAAO,MAAM,WAAW,qCAAgD,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DataSheetGridProps, DataSheetGridRef } from '../types';
|
|
3
|
+
export declare const DataSheetGrid: <T extends unknown>(props: DataSheetGridProps<T> & {
|
|
4
|
+
ref?: React.ForwardedRef<DataSheetGridRef> | undefined;
|
|
5
|
+
}) => JSX.Element;
|
|
6
|
+
//# sourceMappingURL=DataSheetGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataSheetGrid.d.ts","sourceRoot":"","sources":["../../src/components/DataSheetGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAA;AACd,OAAO,EAIL,kBAAkB,EAClB,gBAAgB,EAGjB,MAAM,UAAU,CAAA;AA2CjB,eAAO,MAAM,aAAa;;MAkwDrB,WAAW,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { default as React, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { Cell, Column, ContextMenuItem, DataSheetGridProps, Selection } from '../types';
|
|
3
|
+
export declare const Grid: <T extends unknown>({ data, columns, outerRef, innerRef, columnWidths, hasStickyRightColumn, displayHeight, headerRowHeight, rowHeight, rowKey, fullWidth, selection, activeCell, rowClassName, cellClassName, children, editing, getContextMenuItems, setRowData, deleteRows, duplicateRows, insertRowAfter, stopEditing, onScroll, }: {
|
|
4
|
+
data: T[];
|
|
5
|
+
columns: Column<T, any, any>[];
|
|
6
|
+
outerRef: RefObject<HTMLDivElement>;
|
|
7
|
+
innerRef: RefObject<HTMLDivElement>;
|
|
8
|
+
columnWidths?: number[] | undefined;
|
|
9
|
+
hasStickyRightColumn: boolean;
|
|
10
|
+
displayHeight: number;
|
|
11
|
+
headerRowHeight: number;
|
|
12
|
+
rowHeight: (index: number) => {
|
|
13
|
+
height: number;
|
|
14
|
+
};
|
|
15
|
+
rowKey: string | ((opts: {
|
|
16
|
+
rowData: T;
|
|
17
|
+
rowIndex: number;
|
|
18
|
+
}) => string) | undefined;
|
|
19
|
+
rowClassName: string | ((opt: {
|
|
20
|
+
rowData: T;
|
|
21
|
+
rowIndex: number;
|
|
22
|
+
}) => string | undefined) | undefined;
|
|
23
|
+
cellClassName: string | ((opt: {
|
|
24
|
+
rowData: unknown;
|
|
25
|
+
rowIndex: number;
|
|
26
|
+
columnId?: string | undefined;
|
|
27
|
+
}) => string | undefined) | undefined;
|
|
28
|
+
fullWidth: boolean;
|
|
29
|
+
selection: Selection | null;
|
|
30
|
+
activeCell: Cell | null;
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
editing: boolean;
|
|
33
|
+
getContextMenuItems: () => ContextMenuItem[];
|
|
34
|
+
setRowData: (rowIndex: number, item: T) => void;
|
|
35
|
+
deleteRows: (rowMin: number, rowMax?: number) => void;
|
|
36
|
+
duplicateRows: (rowMin: number, rowMax?: number) => void;
|
|
37
|
+
insertRowAfter: (row: number, count?: number) => void;
|
|
38
|
+
stopEditing: (opts?: {
|
|
39
|
+
nextRow?: boolean;
|
|
40
|
+
}) => void;
|
|
41
|
+
onScroll?: React.UIEventHandler<HTMLDivElement> | undefined;
|
|
42
|
+
}) => React.JSX.Element;
|
|
43
|
+
//# sourceMappingURL=Grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../src/components/Grid.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAa,MAAM,OAAO,CAAA;AAC9D,OAAO,EACL,IAAI,EACJ,MAAM,EACN,eAAe,EACf,kBAAkB,EAClB,SAAS,EACV,MAAM,UAAU,CAAA;AAKjB,eAAO,MAAM,IAAI;;;cA4BL,UAAU,cAAc,CAAC;cACzB,UAAU,cAAc,CAAC;;0BAEb,OAAO;mBACd,MAAM;qBACJ,MAAM;uBACJ,MAAM,KAAK;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;eAIrC,OAAO;eACP,SAAS,GAAG,IAAI;gBACf,IAAI,GAAG,IAAI;cACb,SAAS;aACV,OAAO;yBACK,MAAM,eAAe,EAAE;2BACrB,MAAM,cAAc,IAAI;yBAC1B,MAAM,WAAW,MAAM,KAAK,IAAI;4BAC7B,MAAM,WAAW,MAAM,KAAK,IAAI;0BAClC,MAAM,UAAU,MAAM,KAAK,IAAI;yBAChC;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI;;uBA6MpD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectionRect.d.ts","sourceRoot":"","sources":["../../src/components/SelectionRect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAEtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAuC/C,eAAO,MAAM,aAAa,kDAqOzB,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DataSheetGridProps, DataSheetGridRef } from '../types';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export declare const StaticDataSheetGrid: <T extends unknown>(props: DataSheetGridProps<T> & {
|
|
4
|
+
ref?: React.ForwardedRef<DataSheetGridRef> | undefined;
|
|
5
|
+
}) => JSX.Element;
|
|
6
|
+
//# sourceMappingURL=StaticDataSheetGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StaticDataSheetGrid.d.ts","sourceRoot":"","sources":["../../src/components/StaticDataSheetGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAG/D,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,mBAAmB;;MAsD3B,WAAW,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Column } from '../types';
|
|
2
|
+
export declare const getColumnWidths: (containerWidth: number, columns: Pick<Column<any, any, any>, 'basis' | 'grow' | 'shrink' | 'minWidth' | 'maxWidth'>[]) => number[];
|
|
3
|
+
export declare const useColumnWidths: (columns: Column<any, any, any>[], width?: number) => {
|
|
4
|
+
fullWidth: boolean;
|
|
5
|
+
columnWidths: undefined;
|
|
6
|
+
columnRights: undefined;
|
|
7
|
+
totalWidth: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
fullWidth: boolean;
|
|
10
|
+
columnWidths: number[];
|
|
11
|
+
columnRights: number[];
|
|
12
|
+
totalWidth: number;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=useColumnWidths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useColumnWidths.d.ts","sourceRoot":"","sources":["../../src/hooks/useColumnWidths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAGjC,eAAO,MAAM,eAAe,mBACV,MAAM,WACb,KACP,OAAO,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACrB,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CACtD,EAAE,aA8EJ,CAAA;AAED,eAAO,MAAM,eAAe,YACjB,OAAO,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,UACxB,MAAM;;;;;;;;;;CAmCf,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Column, SimpleColumn } from '../types';
|
|
2
|
+
export declare const parseFlexValue: (value: string | number) => {
|
|
3
|
+
basis: number;
|
|
4
|
+
grow: number;
|
|
5
|
+
shrink: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const useColumns: <T extends unknown>(columns: Partial<Column<T, any, any>>[], gutterColumn?: false | Partial<Pick<Column<T, any, string>, "title" | "maxWidth" | "minWidth" | "basis" | "grow" | "shrink" | "component" | "columnData">> | undefined, stickyRightColumn?: Partial<Pick<Column<T, any, string>, "title" | "maxWidth" | "minWidth" | "basis" | "grow" | "shrink" | "component" | "columnData">> | undefined) => Column<T, any, any>[];
|
|
8
|
+
//# sourceMappingURL=useColumns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useColumns.d.ts","sourceRoot":"","sources":["../../src/hooks/useColumns.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,MAAM,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAY1D,eAAO,MAAM,cAAc,UAAW,MAAM,GAAG,MAAM;;;;CAyDpD,CAAA;AAED,eAAO,MAAM,UAAU,oaAyEtB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebounceState.d.ts","sourceRoot":"","sources":["../../src/hooks/useDebounceState.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,8BAEpB,MAAM,yBACQ,IAAI,CAe1B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDeepEqualState.d.ts","sourceRoot":"","sources":["../../src/hooks/useDeepEqualState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAyB,MAAM,OAAO,CAAA;AAGvE,eAAO,MAAM,iBAAiB,0DAoB7B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDocumentEventListener.d.ts","sourceRoot":"","sources":["../../src/hooks/useDocumentEventListener.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB,SAC7B,MAAM,sBACQ,GAAG,EAAE,KAAK,IAAI,SASnC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEdges.d.ts","sourceRoot":"","sources":["../../src/hooks/useEdges.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAIxC,eAAO,MAAM,QAAQ,QACd,MAAM,SAAS,CAAC,WAAW,CAAC,UACzB,MAAM,WACL,MAAM;;;;;CAkChB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFirstRender.d.ts","sourceRoot":"","sources":["../../src/hooks/useFirstRender.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,eAM1B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGetBoundingClientRect.d.ts","sourceRoot":"","sources":["../../src/hooks/useGetBoundingClientRect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgC,MAAM,OAAO,CAAA;AAI/D,eAAO,MAAM,wBAAwB,QAC9B,UAAU,WAAW,CAAC,wDA6B5B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMemoizedIndexCallback.d.ts","sourceRoot":"","sources":["../../src/hooks/useMemoizedIndexCallback.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB,wCACf,MAAM,iBAAiB,IAAI,cACnC,MAAM,aAKD,MAAM,qBAOwB,IAGhD,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DataSheetGridProps } from '../types';
|
|
2
|
+
type RowSize = {
|
|
3
|
+
height: number;
|
|
4
|
+
top: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const useRowHeights: <T extends unknown>({ value, rowHeight, }: Required<Pick<DataSheetGridProps<T>, "value" | "rowHeight">>) => {
|
|
7
|
+
resetAfter: (index: number) => void;
|
|
8
|
+
getRowSize: (index: number) => RowSize;
|
|
9
|
+
getRowIndex: (top: number) => number;
|
|
10
|
+
totalSize: (maxHeight: number) => number;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=useRowHeights.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRowHeights.d.ts","sourceRoot":"","sources":["../../src/hooks/useRowHeights.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAG7C,KAAK,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAE9C,eAAO,MAAM,aAAa;wBA4DA,MAAM;wBAIN,MAAM,KAAG,OAAO;uBAxDZ,MAAM,KAAG,MAAM;2BAmFhB,MAAM;CAclC,CAAA"}
|