gridjs-spreadsheet 26.4.3 → 26.4.5

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.
Binary file
package/index.d.ts CHANGED
@@ -35,14 +35,68 @@ declare module 'gridjs-spreadsheet' {
35
35
  italic: false;
36
36
  };
37
37
  };
38
+ /** Enable redaction feature */
39
+ enableRedactionShape?: boolean;
40
+ /** Predefined redaction reasons */
41
+ redactionReasons?: string[];
42
+ /** Default redaction color */
43
+ redactionDefaultColor?: string;
44
+ /**
45
+ * Custom callback for adding new redaction reason.
46
+ * If provided, replaces the default modal dialog.
47
+ * @param existingReasons - Current list of existing reasons
48
+ * @returns Promise<string> for the new reason, or null to cancel
49
+ */
50
+ onRedactionAddReason?: (existingReasons: string[]) => Promise<string | null>;
38
51
  }
39
52
 
40
53
  export type CELL_SELECTED = 'cell-selected';
41
54
  export type CELLS_SELECTED = 'cells-selected';
42
55
  export type CELL_EDITED = 'cell-edited';
56
+ export type OBJECT_SELECTED = 'object-selected';
57
+ export type SHEET_SELECTED = 'sheet-selected';
58
+ export type SHEET_LOADED = 'sheet-loaded';
59
+ export type VERTICAL_SCROLLED = 'vertical-scrolled';
60
+ export type HORIZONTAL_SCROLLED = 'horizontal-scrolled';
61
+ export type CELLS_DELETED = 'cells-deleted';
62
+ export type CELLS_UPDATED = 'cells-updated';
63
+ export type ROWS_INSERTED = 'rows-inserted';
64
+ export type COLUMNS_INSERTED = 'columns-inserted';
65
+ export type ROWS_DELETED = 'rows-deleted';
66
+ export type COLUMNS_DELETED = 'columns-deleted';
67
+ export type CHANGE = 'change';
68
+ export type REDACTION_BURNED = 'redaction-burned';
69
+ export type REDACTION_INSERTED = 'redaction-inserted';
70
+ export type REDACTION_DELETED = 'redaction-deleted';
71
+ export type REDACTION_UPDATED = 'redaction-updated';
72
+ export type REDACTION_REASON_INSERTED = 'redactionReason-inserted';
73
+ export type REDACTION_REASON_CLEARED = 'redactionReason-cleared';
74
+ export type REDACTION_TRANSPARENCY_TOGGLED = 'redactionTransparency-toggled';
75
+ export type UPDATE_SERVER_ERROR = 'updateServerError';
76
+ export type UPDATE_CELL_ERROR = 'updateCellError';
43
77
 
44
78
  export type CellMerge = [number, number];
45
79
 
80
+ export interface CellRange {
81
+ sri: number;
82
+ sci: number;
83
+ eri: number;
84
+ eci: number;
85
+ }
86
+
87
+ export interface RedactionData {
88
+ id: string;
89
+ originId?: string;
90
+ redactionReason?: string;
91
+ redactionLabel?: string;
92
+ redactionColor?: string;
93
+ bgColor?: string;
94
+ targetType?: string;
95
+ targetId?: string;
96
+ isRedaction?: boolean;
97
+ fabobj?: any;
98
+ }
99
+
46
100
  export interface SpreadsheetEventHandler {
47
101
  (
48
102
  envt: CELL_SELECTED,
@@ -52,13 +106,97 @@ declare module 'gridjs-spreadsheet' {
52
106
  envt: CELLS_SELECTED,
53
107
  callback: (
54
108
  cell: Cell,
55
- parameters: { sri: number; sci: number; eri: number; eci: number }
109
+ range: CellRange
56
110
  ) => void
57
111
  ): void;
58
112
  (
59
- evnt: CELL_EDITED,
113
+ envt: OBJECT_SELECTED,
114
+ callback: (obj: { id: string; type: string; left: number; top: number; width: number; height: number }) => void
115
+ ): void;
116
+ (
117
+ envt: SHEET_SELECTED,
118
+ callback: (index: number, name: string) => void
119
+ ): void;
120
+ (
121
+ envt: CELL_EDITED,
60
122
  callback: (text: string, rowIndex: number, colIndex: number) => void
61
123
  ): void;
124
+ (
125
+ envt: SHEET_LOADED,
126
+ callback: (index: number, name: string) => void
127
+ ): void;
128
+ (
129
+ envt: VERTICAL_SCROLLED,
130
+ callback: (rowIndex: number) => void
131
+ ): void;
132
+ (
133
+ envt: HORIZONTAL_SCROLLED,
134
+ callback: (colIndex: number) => void
135
+ ): void;
136
+ (
137
+ envt: CELLS_DELETED,
138
+ callback: (range: CellRange) => void
139
+ ): void;
140
+ (
141
+ envt: CELLS_UPDATED,
142
+ callback: (sheetName: string, cells: any) => void
143
+ ): void;
144
+ (
145
+ envt: ROWS_INSERTED,
146
+ callback: (rowIndex: number, count: number) => void
147
+ ): void;
148
+ (
149
+ envt: COLUMNS_INSERTED,
150
+ callback: (colIndex: number, count: number) => void
151
+ ): void;
152
+ (
153
+ envt: ROWS_DELETED,
154
+ callback: (rowIndex: number, count: number) => void
155
+ ): void;
156
+ (
157
+ envt: COLUMNS_DELETED,
158
+ callback: (colIndex: number, count: number) => void
159
+ ): void;
160
+ (
161
+ envt: CHANGE,
162
+ callback: (...args: any[]) => void
163
+ ): void;
164
+ (
165
+ envt: REDACTION_BURNED,
166
+ callback: () => void
167
+ ): void;
168
+ (
169
+ envt: REDACTION_INSERTED,
170
+ callback: (sheetName: string, redactionData: RedactionData) => void
171
+ ): void;
172
+ (
173
+ envt: REDACTION_DELETED,
174
+ callback: (sheetName: string, redactionData: RedactionData) => void
175
+ ): void;
176
+ (
177
+ envt: REDACTION_UPDATED,
178
+ callback: (sheetName: string, shape: any) => void
179
+ ): void;
180
+ (
181
+ envt: REDACTION_REASON_INSERTED,
182
+ callback: (reason: string) => void
183
+ ): void;
184
+ (
185
+ envt: REDACTION_REASON_CLEARED,
186
+ callback: () => void
187
+ ): void;
188
+ (
189
+ envt: REDACTION_TRANSPARENCY_TOGGLED,
190
+ callback: (isTransparent: boolean) => void
191
+ ): void;
192
+ (
193
+ envt: UPDATE_SERVER_ERROR,
194
+ callback: (...args: any[]) => void
195
+ ): void;
196
+ (
197
+ envt: UPDATE_CELL_ERROR,
198
+ callback: (...args: any[]) => void
199
+ ): void;
62
200
  }
63
201
 
64
202
  export interface ColProperties {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gridjs-spreadsheet",
3
- "version": "26.4.3",
3
+ "version": "26.4.5",
4
4
  "description": "this is the client side script for GridJs which is a lightweight, scalable, and customizable toolkit that provides cross-platform web applications, enables convenient development for editing or viewing Excel/Spreadsheet files, offers simple deployment, and provides easy-to-use APIs based on JSON format.",
5
5
  "types": "index.d.ts",
6
6
  "main": "xspreadsheet.js",