gridjs-spreadsheet 26.4.3 → 26.4.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.
package/index.d.ts CHANGED
@@ -35,14 +35,67 @@ 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 UPDATE_SERVER_ERROR = 'updateServerError';
75
+ export type UPDATE_CELL_ERROR = 'updateCellError';
43
76
 
44
77
  export type CellMerge = [number, number];
45
78
 
79
+ export interface CellRange {
80
+ sri: number;
81
+ sci: number;
82
+ eri: number;
83
+ eci: number;
84
+ }
85
+
86
+ export interface RedactionData {
87
+ id: string;
88
+ originId?: string;
89
+ redactionReason?: string;
90
+ redactionLabel?: string;
91
+ redactionColor?: string;
92
+ bgColor?: string;
93
+ targetType?: string;
94
+ targetId?: string;
95
+ isRedaction?: boolean;
96
+ fabobj?: any;
97
+ }
98
+
46
99
  export interface SpreadsheetEventHandler {
47
100
  (
48
101
  envt: CELL_SELECTED,
@@ -52,13 +105,93 @@ declare module 'gridjs-spreadsheet' {
52
105
  envt: CELLS_SELECTED,
53
106
  callback: (
54
107
  cell: Cell,
55
- parameters: { sri: number; sci: number; eri: number; eci: number }
108
+ range: CellRange
56
109
  ) => void
57
110
  ): void;
58
111
  (
59
- evnt: CELL_EDITED,
112
+ envt: OBJECT_SELECTED,
113
+ callback: (obj: { id: string; type: string; left: number; top: number; width: number; height: number }) => void
114
+ ): void;
115
+ (
116
+ envt: SHEET_SELECTED,
117
+ callback: (index: number, name: string) => void
118
+ ): void;
119
+ (
120
+ envt: CELL_EDITED,
60
121
  callback: (text: string, rowIndex: number, colIndex: number) => void
61
122
  ): void;
123
+ (
124
+ envt: SHEET_LOADED,
125
+ callback: (index: number, name: string) => void
126
+ ): void;
127
+ (
128
+ envt: VERTICAL_SCROLLED,
129
+ callback: (rowIndex: number) => void
130
+ ): void;
131
+ (
132
+ envt: HORIZONTAL_SCROLLED,
133
+ callback: (colIndex: number) => void
134
+ ): void;
135
+ (
136
+ envt: CELLS_DELETED,
137
+ callback: (range: CellRange) => void
138
+ ): void;
139
+ (
140
+ envt: CELLS_UPDATED,
141
+ callback: (sheetName: string, cells: any) => void
142
+ ): void;
143
+ (
144
+ envt: ROWS_INSERTED,
145
+ callback: (rowIndex: number, count: number) => void
146
+ ): void;
147
+ (
148
+ envt: COLUMNS_INSERTED,
149
+ callback: (colIndex: number, count: number) => void
150
+ ): void;
151
+ (
152
+ envt: ROWS_DELETED,
153
+ callback: (rowIndex: number, count: number) => void
154
+ ): void;
155
+ (
156
+ envt: COLUMNS_DELETED,
157
+ callback: (colIndex: number, count: number) => void
158
+ ): void;
159
+ (
160
+ envt: CHANGE,
161
+ callback: (...args: any[]) => void
162
+ ): void;
163
+ (
164
+ envt: REDACTION_BURNED,
165
+ callback: () => void
166
+ ): void;
167
+ (
168
+ envt: REDACTION_INSERTED,
169
+ callback: (sheetName: string, redactionData: RedactionData) => void
170
+ ): void;
171
+ (
172
+ envt: REDACTION_DELETED,
173
+ callback: (sheetName: string, redactionData: RedactionData) => void
174
+ ): void;
175
+ (
176
+ envt: REDACTION_UPDATED,
177
+ callback: (sheetName: string, shape: any) => void
178
+ ): void;
179
+ (
180
+ envt: REDACTION_REASON_INSERTED,
181
+ callback: (reason: string) => void
182
+ ): void;
183
+ (
184
+ envt: REDACTION_REASON_CLEARED,
185
+ callback: () => void
186
+ ): void;
187
+ (
188
+ envt: UPDATE_SERVER_ERROR,
189
+ callback: (...args: any[]) => void
190
+ ): void;
191
+ (
192
+ envt: UPDATE_CELL_ERROR,
193
+ callback: (...args: any[]) => void
194
+ ): void;
62
195
  }
63
196
 
64
197
  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.4",
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",