@fileverse-dev/dsheet 0.0.8 → 0.0.10
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/dist/index.es.js +111141 -110776
- package/dist/package/components/{ImportButton.d.ts → import-button-ui.d.ts} +4 -4
- package/dist/package/hooks/use-apply-templates.d.ts +12 -0
- package/dist/package/hooks/{useFortuneToolbarImportBtn.d.ts → use-fortune-toolbar-import.d.ts} +4 -4
- package/dist/package/hooks/use-toggle-template.d.ts +3 -0
- package/dist/package/hooks/use-xlsx-import.d.ts +11 -0
- package/dist/package/types.d.ts +5 -5
- package/dist/package/use-dsheet-editor.d.ts +38 -38
- package/dist/package/utils/csv-export.d.ts +4 -0
- package/dist/package/utils/csv-import.d.ts +4 -0
- package/dist/package/utils/{diffSheet.d.ts → diff-sheet.d.ts} +1 -1
- package/dist/package/utils/json-export.d.ts +3 -0
- package/dist/package/utils/{updateSheetUI.d.ts → update-sheet-ui.d.ts} +3 -3
- package/dist/package/utils/xlsx-export.d.ts +4 -0
- package/dist/style.css +1 -1
- package/package.json +4 -5
- package/dist/package/hooks/useCSVExport.d.ts +0 -5
- package/dist/package/hooks/useCSVImport.d.ts +0 -1
- package/dist/package/hooks/useJSONExport.d.ts +0 -1
- package/dist/package/hooks/useXLSXExport.d.ts +0 -5
- package/dist/package/hooks/useXLSXImport.d.ts +0 -9
- package/dist/package/utils/handleFileImport.d.ts +0 -0
- /package/dist/package/{constant/shared-constant.d.ts → constants/shared-constants.d.ts} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ChangeEventHandler } from 'react';
|
|
2
2
|
|
|
3
|
-
export declare const CustomButton: ({ handleCSVUpload, handleXLSXUpload, handleExportToXLSX, handleExportToCSV, handleExportToJSON }: {
|
|
3
|
+
export declare const CustomButton: ({ handleCSVUpload, handleXLSXUpload, handleExportToXLSX, handleExportToCSV, handleExportToJSON, }: {
|
|
4
4
|
handleCSVUpload: ChangeEventHandler<HTMLInputElement>;
|
|
5
5
|
handleXLSXUpload: ChangeEventHandler<HTMLInputElement>;
|
|
6
|
-
handleExportToXLSX:
|
|
7
|
-
handleExportToCSV:
|
|
8
|
-
handleExportToJSON:
|
|
6
|
+
handleExportToXLSX: () => void;
|
|
7
|
+
handleExportToCSV: () => void;
|
|
8
|
+
handleExportToJSON: () => void;
|
|
9
9
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { WorkbookInstance } from '@mritunjaygoutam12/react';
|
|
3
|
+
|
|
4
|
+
import * as Y from 'yjs';
|
|
5
|
+
export declare const useApplyTemplatesBtn: ({ selectedTemplate, ydocRef, dsheetId, currentDataRef, setForceSheetRender, sheetEditorRef, }: {
|
|
6
|
+
selectedTemplate: string | undefined;
|
|
7
|
+
ydocRef: React.RefObject<Y.Doc | null>;
|
|
8
|
+
dsheetId: string;
|
|
9
|
+
currentDataRef: React.MutableRefObject<object | null>;
|
|
10
|
+
setForceSheetRender: Dispatch<SetStateAction<number>>;
|
|
11
|
+
sheetEditorRef: React.RefObject<WorkbookInstance | null>;
|
|
12
|
+
}) => void;
|
package/dist/package/hooks/{useFortuneToolbarImportBtn.d.ts → use-fortune-toolbar-import.d.ts}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ChangeEventHandler } from 'react';
|
|
2
2
|
|
|
3
|
-
export declare const useFortuneToolbarImportBtn: ({ handleCSVUpload, handleXLSXUpload, handleExportToXLSX, handleExportToCSV, handleExportToJSON }: {
|
|
3
|
+
export declare const useFortuneToolbarImportBtn: ({ handleCSVUpload, handleXLSXUpload, handleExportToXLSX, handleExportToCSV, handleExportToJSON, }: {
|
|
4
4
|
handleCSVUpload: ChangeEventHandler<HTMLInputElement>;
|
|
5
5
|
handleXLSXUpload: ChangeEventHandler<HTMLInputElement>;
|
|
6
|
-
handleExportToXLSX:
|
|
7
|
-
handleExportToCSV:
|
|
8
|
-
handleExportToJSON:
|
|
6
|
+
handleExportToXLSX: () => void;
|
|
7
|
+
handleExportToCSV: () => void;
|
|
8
|
+
handleExportToJSON: () => void;
|
|
9
9
|
}) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { WorkbookInstance } from '@mritunjaygoutam12/react';
|
|
2
|
+
import * as Y from 'yjs';
|
|
3
|
+
export declare const useXLSXImport: ({ sheetEditorRef, ydocRef, setForceSheetRender, dsheetId, currentDataRef, }: {
|
|
4
|
+
sheetEditorRef: React.RefObject<WorkbookInstance | null>;
|
|
5
|
+
ydocRef: React.RefObject<Y.Doc | null>;
|
|
6
|
+
setForceSheetRender: React.Dispatch<React.SetStateAction<number>>;
|
|
7
|
+
dsheetId: string;
|
|
8
|
+
currentDataRef: React.MutableRefObject<object | null>;
|
|
9
|
+
}) => {
|
|
10
|
+
handleXLSXUpload: (event: React.ChangeEvent<HTMLInputElement>) => Promise<void>;
|
|
11
|
+
};
|
package/dist/package/types.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Sheet } from '@
|
|
1
|
+
import { Sheet } from '@mritunjaygoutam12/core-mod';
|
|
2
2
|
|
|
3
3
|
export interface DsheetProp {
|
|
4
4
|
renderNavbar?: () => JSX.Element;
|
|
5
5
|
initialSheetData?: Sheet[];
|
|
6
6
|
enableIndexeddbSync?: boolean;
|
|
7
|
-
dsheetId
|
|
7
|
+
dsheetId: string;
|
|
8
8
|
onChange?: (updatedSheetContent: string, updateChunk: string) => void;
|
|
9
9
|
username?: string;
|
|
10
10
|
enableWebrtc?: boolean;
|
|
11
|
-
portalContent?:
|
|
11
|
+
portalContent?: string;
|
|
12
12
|
isReadOnly?: boolean;
|
|
13
13
|
isCollaborative?: boolean;
|
|
14
|
+
selectedTemplate?: string;
|
|
14
15
|
setForceSheetRender?: React.Dispatch<React.SetStateAction<number>>;
|
|
15
|
-
|
|
16
|
-
export interface sheetEditorRef {
|
|
16
|
+
toggleTemplateSidebar?: () => void;
|
|
17
17
|
}
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import { Sheet } from '@
|
|
1
|
+
import { Sheet } from '@mritunjaygoutam12/core-mod';
|
|
2
2
|
import { DsheetProp } from './types';
|
|
3
3
|
import * as Y from 'yjs';
|
|
4
|
-
export declare const useDsheetEditor: ({ initialSheetData, enableIndexeddbSync, dsheetId, onChange, username, enableWebrtc, portalContent,
|
|
4
|
+
export declare const useDsheetEditor: ({ initialSheetData, enableIndexeddbSync, dsheetId, onChange, username, enableWebrtc, portalContent, }: Partial<DsheetProp>) => {
|
|
5
5
|
sheetEditorRef: import('react').RefObject<{
|
|
6
|
-
applyOp: (ops: import('@
|
|
7
|
-
getCellValue: (row: number, column: number, options?: import('@
|
|
8
|
-
type?: keyof import('@
|
|
6
|
+
applyOp: (ops: import('@mritunjaygoutam12/core-mod').Op[]) => void;
|
|
7
|
+
getCellValue: (row: number, column: number, options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions & {
|
|
8
|
+
type?: keyof import('@mritunjaygoutam12/core-mod').Cell;
|
|
9
9
|
}) => any;
|
|
10
|
-
setCellValue: (row: number, column: number, value: any, options?: import('@
|
|
11
|
-
type?: keyof import('@
|
|
10
|
+
setCellValue: (row: number, column: number, value: any, options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions & {
|
|
11
|
+
type?: keyof import('@mritunjaygoutam12/core-mod').Cell;
|
|
12
12
|
}) => void;
|
|
13
|
-
clearCell: (row: number, column: number, options?: import('@
|
|
14
|
-
setCellFormat: (row: number, column: number, attr: keyof import('@
|
|
15
|
-
autoFillCell: (copyRange: import('@
|
|
13
|
+
clearCell: (row: number, column: number, options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => void;
|
|
14
|
+
setCellFormat: (row: number, column: number, attr: keyof import('@mritunjaygoutam12/core-mod').Cell, value: any, options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => void;
|
|
15
|
+
autoFillCell: (copyRange: import('@mritunjaygoutam12/core-mod').SingleRange, applyRange: import('@mritunjaygoutam12/core-mod').SingleRange, direction: "up" | "down" | "left" | "right") => void;
|
|
16
16
|
freeze: (type: "row" | "column" | "both", range: {
|
|
17
17
|
row: number;
|
|
18
18
|
column: number;
|
|
19
|
-
}, options?: import('@
|
|
20
|
-
insertRowOrColumn: (type: "row" | "column", index: number, count: number, direction?: "lefttop" | "rightbottom", options?: import('@
|
|
21
|
-
deleteRowOrColumn: (type: "row" | "column", start: number, end: number, options?: import('@
|
|
19
|
+
}, options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => void;
|
|
20
|
+
insertRowOrColumn: (type: "row" | "column", index: number, count: number, direction?: "lefttop" | "rightbottom", options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => void;
|
|
21
|
+
deleteRowOrColumn: (type: "row" | "column", start: number, end: number, options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => void;
|
|
22
22
|
hideRowOrColumn: (rowOrColInfo: string[], type: "row" | "column") => void;
|
|
23
23
|
showRowOrColumn: (rowOrColInfo: string[], type: "row" | "column") => void;
|
|
24
|
-
setRowHeight: (rowInfo: Record<string, number>, options?: import('@
|
|
25
|
-
setColumnWidth: (columnInfo: Record<string, number>, options?: import('@
|
|
26
|
-
getRowHeight: (rows: number[], options?: import('@
|
|
27
|
-
getColumnWidth: (columns: number[], options?: import('@
|
|
24
|
+
setRowHeight: (rowInfo: Record<string, number>, options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions, custom?: boolean) => void;
|
|
25
|
+
setColumnWidth: (columnInfo: Record<string, number>, options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions, custom?: boolean) => void;
|
|
26
|
+
getRowHeight: (rows: number[], options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => Record<number, number>;
|
|
27
|
+
getColumnWidth: (columns: number[], options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => Record<number, number>;
|
|
28
28
|
getSelection: () => {
|
|
29
29
|
row: number[];
|
|
30
30
|
column: number[];
|
|
31
31
|
}[] | undefined;
|
|
32
|
-
getFlattenRange: (range: import('@
|
|
32
|
+
getFlattenRange: (range: import('@mritunjaygoutam12/core-mod').Range) => {
|
|
33
33
|
r: number;
|
|
34
34
|
c: number;
|
|
35
35
|
}[];
|
|
36
36
|
getCellsByFlattenRange: (range?: {
|
|
37
37
|
r: number;
|
|
38
38
|
c: number;
|
|
39
|
-
}[]
|
|
39
|
+
}[]) => (import('@mritunjaygoutam12/core-mod').Cell | null)[];
|
|
40
40
|
getSelectionCoordinates: () => string[];
|
|
41
|
-
getCellsByRange: (range: import('@
|
|
42
|
-
getHtmlByRange: (range: import('@
|
|
43
|
-
setSelection: (range: import('@
|
|
44
|
-
setCellValuesByRange: (data: any[][], range: import('@
|
|
45
|
-
setCellFormatByRange: (attr: keyof import('@
|
|
46
|
-
mergeCells: (ranges: import('@
|
|
47
|
-
cancelMerge: (ranges: import('@
|
|
41
|
+
getCellsByRange: (range: import('@mritunjaygoutam12/core-mod').Selection, options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => (import('@mritunjaygoutam12/core-mod').Cell | null)[][];
|
|
42
|
+
getHtmlByRange: (range: import('@mritunjaygoutam12/core-mod').Range, options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => string | null;
|
|
43
|
+
setSelection: (range: import('@mritunjaygoutam12/core-mod').Range, options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => void;
|
|
44
|
+
setCellValuesByRange: (data: any[][], range: import('@mritunjaygoutam12/core-mod').SingleRange, options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => void;
|
|
45
|
+
setCellFormatByRange: (attr: keyof import('@mritunjaygoutam12/core-mod').Cell, value: any, range: import('@mritunjaygoutam12/core-mod').Range | import('@mritunjaygoutam12/core-mod').SingleRange, options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => void;
|
|
46
|
+
mergeCells: (ranges: import('@mritunjaygoutam12/core-mod').Range, type: string, options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => void;
|
|
47
|
+
cancelMerge: (ranges: import('@mritunjaygoutam12/core-mod').Range, options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => void;
|
|
48
48
|
getAllSheets: () => Sheet[];
|
|
49
|
-
getSheet: (options?: import('@
|
|
50
|
-
celldata: import('@
|
|
49
|
+
getSheet: (options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => {
|
|
50
|
+
celldata: import('@mritunjaygoutam12/core-mod').CellWithRowAndCol[];
|
|
51
51
|
name: string;
|
|
52
|
-
config?: import('@
|
|
52
|
+
config?: import('@mritunjaygoutam12/core-mod').SheetConfig | undefined;
|
|
53
53
|
order?: number | undefined;
|
|
54
54
|
color?: string | undefined;
|
|
55
|
-
data?: import('@
|
|
55
|
+
data?: import('@mritunjaygoutam12/core-mod').CellMatrix | undefined;
|
|
56
56
|
id?: string | undefined;
|
|
57
|
-
images?: import('@
|
|
57
|
+
images?: import('@mritunjaygoutam12/core-mod').Image[] | undefined;
|
|
58
58
|
zoomRatio?: number | undefined;
|
|
59
59
|
column?: number | undefined;
|
|
60
60
|
row?: number | undefined;
|
|
61
61
|
addRows?: number | undefined;
|
|
62
62
|
status?: number | undefined;
|
|
63
63
|
hide?: number | undefined;
|
|
64
|
-
luckysheet_select_save?: import('@
|
|
64
|
+
luckysheet_select_save?: import('@mritunjaygoutam12/core-mod').Selection[] | undefined;
|
|
65
65
|
luckysheet_selection_range?: {
|
|
66
66
|
row: number[];
|
|
67
67
|
column: number[];
|
|
@@ -95,10 +95,10 @@ export declare const useDsheetEditor: ({ initialSheetData, enableIndexeddbSync,
|
|
|
95
95
|
} | undefined;
|
|
96
96
|
};
|
|
97
97
|
addSheet: () => void;
|
|
98
|
-
deleteSheet: (options?: import('@
|
|
98
|
+
deleteSheet: (options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => void;
|
|
99
99
|
updateSheet: (data: Sheet[]) => void;
|
|
100
|
-
activateSheet: (options?: import('@
|
|
101
|
-
setSheetName: (name: string, options?: import('@
|
|
100
|
+
activateSheet: (options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => void;
|
|
101
|
+
setSheetName: (name: string, options?: import('@mritunjaygoutam12/core-mod/dist/api').CommonOptions) => void;
|
|
102
102
|
setSheetOrder: (orderList: Record<string, number>) => void;
|
|
103
103
|
scroll: (options: {
|
|
104
104
|
scrollLeft?: number;
|
|
@@ -106,7 +106,7 @@ export declare const useDsheetEditor: ({ initialSheetData, enableIndexeddbSync,
|
|
|
106
106
|
targetRow?: number;
|
|
107
107
|
targetColumn?: number;
|
|
108
108
|
}) => void;
|
|
109
|
-
addPresences: (newPresences: import('@
|
|
109
|
+
addPresences: (newPresences: import('@mritunjaygoutam12/core-mod').Presence[]) => void;
|
|
110
110
|
removePresences: (arr: {
|
|
111
111
|
username: string;
|
|
112
112
|
userId?: string;
|
|
@@ -114,8 +114,8 @@ export declare const useDsheetEditor: ({ initialSheetData, enableIndexeddbSync,
|
|
|
114
114
|
handleUndo: () => void;
|
|
115
115
|
handleRedo: () => void;
|
|
116
116
|
calculateFormula: () => void;
|
|
117
|
-
dataToCelldata: (data: import('@
|
|
118
|
-
celldataToData: (celldata: import('@
|
|
117
|
+
dataToCelldata: (data: import('@mritunjaygoutam12/core-mod').CellMatrix | undefined) => import('@mritunjaygoutam12/core-mod').CellWithRowAndCol[];
|
|
118
|
+
celldataToData: (celldata: import('@mritunjaygoutam12/core-mod').CellWithRowAndCol[], rowCount?: number, colCount?: number) => import('@mritunjaygoutam12/core-mod').CellMatrix | null;
|
|
119
119
|
}>;
|
|
120
120
|
handleChange: (data: Sheet[]) => void;
|
|
121
121
|
currentDataRef: import('react').MutableRefObject<Sheet[] | null>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { WorkbookInstance } from '@mritunjaygoutam12/react';
|
|
2
|
+
import { MutableRefObject } from 'react';
|
|
3
|
+
import * as Y from 'yjs';
|
|
4
|
+
export declare const handleExportToCSV: (workbookRef: MutableRefObject<WorkbookInstance | null>, ydocRef: MutableRefObject<Y.Doc | null>, dsheetId: string) => void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
import * as Y from 'yjs';
|
|
4
|
+
export declare const handleCSVUpload: (event: React.ChangeEvent<HTMLInputElement>, ydoc: Y.Doc | null, setForceSheetRender: React.Dispatch<React.SetStateAction<number>>, dsheetId: string, currentDataRef: React.MutableRefObject<object | null>) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { WorkbookInstance } from '@
|
|
2
|
-
import { Sheet } from '@
|
|
1
|
+
import { WorkbookInstance } from '@mritunjaygoutam12/react';
|
|
2
|
+
import { Sheet } from '@mritunjaygoutam12/core-mod';
|
|
3
3
|
|
|
4
|
-
export declare const updateSheetUIToYjs: ({ sheetEditorRef, sheetData }: {
|
|
4
|
+
export declare const updateSheetUIToYjs: ({ sheetEditorRef, sheetData, }: {
|
|
5
5
|
sheetEditorRef: WorkbookInstance;
|
|
6
6
|
sheetData: Sheet[];
|
|
7
7
|
}) => void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { WorkbookInstance } from '@mritunjaygoutam12/react';
|
|
2
|
+
import { MutableRefObject } from 'react';
|
|
3
|
+
import * as Y from 'yjs';
|
|
4
|
+
export declare const handleExportToXLSX: (workbookRef: MutableRefObject<WorkbookInstance | null>, ydocRef: MutableRefObject<Y.Doc | null>, dsheetId: string) => void;
|