@univerjs/sheets 0.5.4 → 0.5.5-experimental.20250123-34738ff
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/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +3 -3
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +2664 -1499
- package/lib/es/index.js +9211 -8683
- package/lib/es/locale/en-US.js +2 -2
- package/lib/es/locale/fa-IR.js +2 -2
- package/lib/es/locale/fr-FR.js +2 -2
- package/lib/es/locale/ru-RU.js +2 -2
- package/lib/es/locale/vi-VN.js +2 -2
- package/lib/es/locale/zh-CN.js +2 -2
- package/lib/es/locale/zh-TW.js +2 -2
- package/lib/types/basics/const/command-listener-const.d.ts +149 -13
- package/lib/types/commands/commands/remove-sheet.command.d.ts +1 -1
- package/lib/types/commands/commands/split-text-to-columns.command.d.ts +1 -1
- package/lib/types/commands/operations/selection.operation.d.ts +1 -0
- package/lib/types/commands/utils/selection-command-util.d.ts +1 -1
- package/lib/types/controllers/config.schema.d.ts +4 -0
- package/lib/types/facade/f-defined-name.d.ts +22 -16
- package/lib/types/facade/f-enum.d.ts +24 -0
- package/lib/types/facade/f-event.d.ts +474 -24
- package/lib/types/facade/f-permission.d.ts +141 -9
- package/lib/types/facade/f-range.d.ts +416 -98
- package/lib/types/facade/f-selection.d.ts +27 -1
- package/lib/types/facade/f-sheet-hooks.d.ts +3 -0
- package/lib/types/facade/f-univer.d.ts +39 -3
- package/lib/types/facade/f-workbook.d.ts +57 -60
- package/lib/types/facade/f-worksheet.d.ts +654 -209
- package/lib/types/facade/index.d.ts +2 -0
- package/lib/types/index.d.ts +2 -1
- package/lib/types/model/range-protection-rule.model.d.ts +1 -1
- package/lib/types/model/range-theme-util.d.ts +3 -3
- package/lib/types/services/permission/permission-point/const.d.ts +117 -4
- package/lib/types/services/permission/range-permission/range-protection.ref-range.d.ts +1 -1
- package/lib/types/services/permission/range-permission/range-protection.service.d.ts +1 -1
- package/lib/types/services/permission/worksheet-permission/worksheet-permission-rule.model.d.ts +1 -1
- package/lib/types/services/selections/selection-data-model.d.ts +7 -7
- package/lib/types/services/selections/selection.service.d.ts +4 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +3 -3
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +8 -8
- package/LICENSE +0 -176
- package/lib/types/basics/__tests__/cell-type.spec.d.ts +0 -16
- package/lib/types/basics/__tests__/cell-value.spec.d.ts +0 -16
- package/lib/types/basics/__tests__/expand.data.d.ts +0 -2
- package/lib/types/basics/__tests__/expand.spec.d.ts +0 -16
- package/lib/types/basics/__tests__/rangeMerge.spec.d.ts +0 -16
- package/lib/types/basics/__tests__/row-column-value.spec.d.ts +0 -16
- package/lib/types/basics/__tests__/utils.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/add-merge-command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/clear-selection.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/copy-worksheet.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/create-command-test-bed.d.ts +0 -7
- package/lib/types/commands/commands/__tests__/delete-range.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/insert-range.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/insert-remove-rows-cols.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/move-range-commands.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/move-rows-cols.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/range-template-command.sepc.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/remove-rows-cols.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/remove-sheet.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-border.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-col-data.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-col-width.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-frozen.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-gridlines-command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-range-values.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-row-col-visible.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-row-data.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-row-height.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-style.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-tab-color.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-worksheet-default-style.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-worksheet-hide.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-worksheet-name.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-worksheet-order.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-worksheet-show.command.spec.d.ts +0 -16
- package/lib/types/commands/mutations/__tests__/create-command-test-bed.d.ts +0 -8
- package/lib/types/commands/mutations/__tests__/move-rows-cols.mutation.spec.d.ts +0 -16
- package/lib/types/commands/mutations/__tests__/remove-row-col.mutation.spec.d.ts +0 -16
- package/lib/types/controllers/__tests__/util.d.ts +0 -13
- package/lib/types/facade/__tests__/utils.spec.d.ts +0 -16
- package/lib/types/services/__tests__/move-active-cell.spec.d.ts +0 -16
- package/lib/types/services/__tests__/numfmt.service.test.d.ts +0 -16
- package/lib/types/services/__tests__/ref-range.setvice.spec.d.ts +0 -16
- package/lib/types/services/__tests__/util.d.ts +0 -14
- package/lib/types/services/ref-range/__tests__/__testing__.d.ts +0 -14
- package/lib/types/services/ref-range/__tests__/ref-range.service.spec.d.ts +0 -13
- package/lib/types/services/ref-range/__tests__/utils.spec.d.ts +0 -16
- package/lib/types/services/ref-range/__tests__/watch-range.spec.d.ts +0 -16
- package/lib/types/services/sheet-interceptor/__tests__/create-core-test-bed.d.ts +0 -13
- package/lib/types/services/sheet-interceptor/__tests__/sheet-interceptor.service.spec.d.ts +0 -16
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { IEventBase, IWorkbookData, IWorksheetData, UniverInstanceType, FEventName } from '@univerjs/core';
|
|
2
|
+
import { CommandListenerValueChange } from '@univerjs/sheets';
|
|
3
|
+
import { FRange } from './f-range';
|
|
2
4
|
import { FWorkbook } from './f-workbook';
|
|
3
5
|
import { FWorksheet } from './f-worksheet';
|
|
6
|
+
/**
|
|
7
|
+
* Interface for sheet-related events
|
|
8
|
+
* Provides event names for sheet creation, workbook creation, and gridline changes
|
|
9
|
+
* @ignore
|
|
10
|
+
*/
|
|
4
11
|
export interface IFSheetEventMixin {
|
|
5
12
|
/**
|
|
6
13
|
* Event fired after a sheet is created
|
|
7
14
|
* @see {@link ISheetCreatedEventParams}
|
|
8
15
|
* @example
|
|
9
16
|
* ```ts
|
|
10
|
-
* univerAPI.addEvent(univerAPI.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
17
|
+
* univerAPI.addEvent(univerAPI.Event.SheetCreated, (params) => {
|
|
18
|
+
* const { workbook, worksheet } = params;
|
|
19
|
+
* console.log('sheet created', params);
|
|
13
20
|
* });
|
|
14
21
|
* ```
|
|
15
22
|
*/
|
|
@@ -19,21 +26,165 @@ export interface IFSheetEventMixin {
|
|
|
19
26
|
* @see {@link IBeforeSheetCreateEventParams}
|
|
20
27
|
* @example
|
|
21
28
|
* ```ts
|
|
22
|
-
* univerAPI.addEvent(univerAPI.
|
|
23
|
-
*
|
|
24
|
-
*
|
|
29
|
+
* univerAPI.addEvent(univerAPI.Event.BeforeSheetCreate, (params) => {
|
|
30
|
+
* const { workbook, index, sheet } = params;
|
|
31
|
+
* console.log('before sheet create', params);
|
|
25
32
|
* });
|
|
26
33
|
* ```
|
|
27
34
|
*/
|
|
28
35
|
get BeforeSheetCreate(): 'BeforeSheetCreate';
|
|
36
|
+
/**
|
|
37
|
+
* Event fired before the active sheet changes
|
|
38
|
+
* @see {@link IActiveSheetChangedEvent}
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* univerAPI.addEvent(univerAPI.Event.ActiveSheetChanged, (params) => {
|
|
42
|
+
* const { workbook, activeSheet, oldActiveSheet } = params;
|
|
43
|
+
* console.log('before active sheet changed', params);
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
get BeforeActiveSheetChange(): 'BeforeActiveSheetChange';
|
|
48
|
+
/**
|
|
49
|
+
* Event fired after the active sheet changes
|
|
50
|
+
* @see {@link IActiveSheetChangedEvent}
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* univerAPI.addEvent(univerAPI.Event.ActiveSheetChanged, (params) => {
|
|
54
|
+
* const { workbook, activeSheet } = params;
|
|
55
|
+
* console.log('after active sheet changed', params);
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
get ActiveSheetChanged(): 'ActiveSheetChanged';
|
|
60
|
+
/**
|
|
61
|
+
* Event fired before a sheet is deleted
|
|
62
|
+
* @see {@link IBeforeSheetDeleteEvent}
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* univerAPI.addEvent(univerAPI.Event.BeforeSheetDelete, (params) => {
|
|
66
|
+
* const { workbook, worksheetId } = params;
|
|
67
|
+
* console.log('before sheet delete', params);
|
|
68
|
+
* });
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
get SheetDeleted(): 'SheetDeleted';
|
|
72
|
+
/**
|
|
73
|
+
* Event fired before a sheet is deleted
|
|
74
|
+
* @see {@link IBeforeSheetDeleteEvent}
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* univerAPI.addEvent(univerAPI.Event.BeforeSheetDelete, (params) => {
|
|
78
|
+
* const { workbook, worksheet } = params;
|
|
79
|
+
* console.log('before sheet delete', params);
|
|
80
|
+
* });
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
get BeforeSheetDelete(): 'BeforeSheetDelete';
|
|
84
|
+
/**
|
|
85
|
+
* Event fired after a sheet is moved
|
|
86
|
+
* @see {@link ISheetMovedEvent}
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* univerAPI.addEvent(univerAPI.Event.SheetMoved, (params) => {
|
|
90
|
+
* const { workbook, worksheet, newIndex } = params;
|
|
91
|
+
* console.log('sheet moved', params);
|
|
92
|
+
* });
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
get SheetMoved(): 'SheetMoved';
|
|
96
|
+
/**
|
|
97
|
+
* Event fired before a sheet is moved
|
|
98
|
+
* @see {@link IBeforeSheetMoveEvent}
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* univerAPI.addEvent(univerAPI.Event.BeforeSheetMove, (params) => {
|
|
102
|
+
* const { workbook, worksheet, newIndex, oldIndex } = params;
|
|
103
|
+
* console.log('before sheet move', params);
|
|
104
|
+
* });
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
get BeforeSheetMove(): 'BeforeSheetMove';
|
|
108
|
+
/**
|
|
109
|
+
* Event fired after a sheet name is changed
|
|
110
|
+
* @see {@link ISheetNameChangedEvent}
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* univerAPI.addEvent(univerAPI.Event.SheetNameChanged, (params) => {
|
|
114
|
+
* const { workbook, worksheet, newName } = params;
|
|
115
|
+
* console.log('sheet name changed', params);
|
|
116
|
+
* });
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
get SheetNameChanged(): 'SheetNameChanged';
|
|
120
|
+
/**
|
|
121
|
+
* Event fired before a sheet name is changed
|
|
122
|
+
* @see {@link IBeforeSheetNameChangeEvent}
|
|
123
|
+
* @example
|
|
124
|
+
* ```ts
|
|
125
|
+
* univerAPI.addEvent(univerAPI.Event.BeforeSheetNameChange, (params) => {
|
|
126
|
+
* const { workbook, worksheet, newName, oldName } = params;
|
|
127
|
+
* console.log('before sheet name changed', params);
|
|
128
|
+
* });
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
get BeforeSheetNameChange(): 'BeforeSheetNameChange';
|
|
132
|
+
/**
|
|
133
|
+
* Event fired after a sheet tab color is changed
|
|
134
|
+
* @see {@link ISheetTabColorChangedEvent}
|
|
135
|
+
* @example
|
|
136
|
+
* ```ts
|
|
137
|
+
* univerAPI.addEvent(univerAPI.Event.SheetTabColorChanged, (params) => {
|
|
138
|
+
* const { workbook, worksheet, color } = params;
|
|
139
|
+
* console.log('sheet tab color changed', params);
|
|
140
|
+
* });
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
get SheetTabColorChanged(): 'SheetTabColorChanged';
|
|
144
|
+
/**
|
|
145
|
+
* Event fired before a sheet tab color is changed
|
|
146
|
+
* @see {@link IBeforeSheetTabColorChangeEvent}
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts
|
|
149
|
+
* univerAPI.addEvent(univerAPI.Event.BeforeSheetTabColorChange, (params) => {
|
|
150
|
+
* const { workbook, worksheet, color, oldColor } = params;
|
|
151
|
+
* console.log('before sheet tab color changed', params);
|
|
152
|
+
* });
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
get BeforeSheetTabColorChange(): 'BeforeSheetTabColorChange';
|
|
156
|
+
/**
|
|
157
|
+
* Event fired after a sheet is hidden
|
|
158
|
+
* @see {@link ISheetHideChangedEvent}
|
|
159
|
+
* @example
|
|
160
|
+
* ```ts
|
|
161
|
+
* univerAPI.addEvent(univerAPI.Event.SheetHideChanged, (params) => {
|
|
162
|
+
* const { workbook, worksheet } = params;
|
|
163
|
+
* console.log('sheet hide changed', params);
|
|
164
|
+
* });
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
get SheetHideChanged(): 'SheetHideChanged';
|
|
168
|
+
/**
|
|
169
|
+
* Event fired before a sheet is hidden
|
|
170
|
+
* @see {@link IBeforeSheetHideChangeEvent}
|
|
171
|
+
* @example
|
|
172
|
+
* ```ts
|
|
173
|
+
* univerAPI.addEvent(univerAPI.Event.BeforeSheetHideChange, (params) => {
|
|
174
|
+
* const { workbook, worksheet, hide } = params;
|
|
175
|
+
* console.log('before sheet hide changed', params);
|
|
176
|
+
* });
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
get BeforeSheetHideChange(): 'BeforeSheetHideChange';
|
|
29
180
|
/**
|
|
30
181
|
* Event fired after a workbook is created
|
|
31
182
|
* @see {@link IWorkbookCreateParam}
|
|
32
183
|
* @example
|
|
33
184
|
* ```ts
|
|
34
|
-
* univerAPI.addEvent(univerAPI.
|
|
35
|
-
*
|
|
36
|
-
*
|
|
185
|
+
* univerAPI.addEvent(univerAPI.Event.WorkbookCreated, (params) => {
|
|
186
|
+
* const { unitId, type, workbook, unit } = params;
|
|
187
|
+
* console.log('workbook created', params);
|
|
37
188
|
* });
|
|
38
189
|
* ```
|
|
39
190
|
*/
|
|
@@ -43,35 +194,127 @@ export interface IFSheetEventMixin {
|
|
|
43
194
|
* @see {@link IWorkbookDisposedEvent}
|
|
44
195
|
* @example
|
|
45
196
|
* ```ts
|
|
46
|
-
* univerAPI.addEvent(univerAPI.
|
|
47
|
-
*
|
|
48
|
-
*
|
|
197
|
+
* univerAPI.addEvent(univerAPI.Event.WorkbookDisposed, (params) => {
|
|
198
|
+
* const { unitId, unitType, snapshot } = params;
|
|
199
|
+
* console.log('unit disposed', params);
|
|
49
200
|
* });
|
|
50
201
|
* ```
|
|
51
202
|
*/
|
|
52
203
|
get WorkbookDisposed(): 'WorkbookDisposed';
|
|
204
|
+
/**
|
|
205
|
+
* Event fired when gridline changed
|
|
206
|
+
* @see {@link IGridlineChangedEvent}
|
|
207
|
+
* @example
|
|
208
|
+
* ```ts
|
|
209
|
+
* univerAPI.addEvent(univerAPI.Event.GridlineChanged, (params) => {
|
|
210
|
+
* const { workbook, worksheet, enabled, color } = params;
|
|
211
|
+
* console.log('gridline changed', params);
|
|
212
|
+
* });
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
get GridlineChanged(): 'GridlineChanged';
|
|
216
|
+
/**
|
|
217
|
+
* Event fired before gridline enable changed
|
|
218
|
+
* @see {@link IBeforeGridlineEnableChange}
|
|
219
|
+
* @example
|
|
220
|
+
* ```ts
|
|
221
|
+
* univerAPI.addEvent(univerAPI.Event.BeforeGridlineEnableChange, (params) => {
|
|
222
|
+
* const { workbook, worksheet, enabled } = params;
|
|
223
|
+
* console.log('gridline changed', params);
|
|
224
|
+
* });
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
227
|
+
get BeforeGridlineEnableChange(): 'BeforeGridlineEnableChange';
|
|
228
|
+
/**
|
|
229
|
+
* Event fired before gridline color changed
|
|
230
|
+
* @see {@link IBeforeGridlineColorChanged}
|
|
231
|
+
* @example
|
|
232
|
+
* ```ts
|
|
233
|
+
* univerAPI.addEvent(univerAPI.Event.BeforeGridlineColorChange, (params) => {
|
|
234
|
+
* const { workbook, worksheet, color } = params;
|
|
235
|
+
* console.log('gridline changed', params);
|
|
236
|
+
* });
|
|
237
|
+
* ```
|
|
238
|
+
*/
|
|
239
|
+
get BeforeGridlineColorChange(): 'BeforeGridlineColorChange';
|
|
240
|
+
/**
|
|
241
|
+
* Event fired when sheet value changed
|
|
242
|
+
* @example
|
|
243
|
+
* ```ts
|
|
244
|
+
* univerAPI.addEvent(univerAPI.Event.SheetValueChanged, (p)=> {
|
|
245
|
+
* const { workbook, effectedRanges, payload } = p;
|
|
246
|
+
* });
|
|
247
|
+
* ```
|
|
248
|
+
*/
|
|
249
|
+
readonly SheetValueChanged: 'SheetValueChanged';
|
|
53
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* Interface for workbook creation parameters
|
|
253
|
+
* Extends the base event interface and includes workbook initialization details
|
|
254
|
+
*/
|
|
54
255
|
export interface IWorkbookCreateParam extends IEventBase {
|
|
256
|
+
/** Unique identifier for the workbook unit */
|
|
55
257
|
unitId: string;
|
|
258
|
+
/** Type identifier specifying this is a sheet instance */
|
|
56
259
|
type: UniverInstanceType.UNIVER_SHEET;
|
|
260
|
+
/** The workbook instance being created */
|
|
57
261
|
workbook: FWorkbook;
|
|
262
|
+
/** The workbook unit reference */
|
|
58
263
|
unit: FWorkbook;
|
|
59
264
|
}
|
|
265
|
+
/**
|
|
266
|
+
* Interface for workbook disposal event
|
|
267
|
+
* Contains information about the disposed workbook including its snapshot data
|
|
268
|
+
*/
|
|
60
269
|
export interface IWorkbookDisposedEvent extends IEventBase {
|
|
270
|
+
/** Unique identifier of the disposed workbook unit */
|
|
61
271
|
unitId: string;
|
|
272
|
+
/** Type identifier specifying this was a sheet instance */
|
|
62
273
|
unitType: UniverInstanceType.UNIVER_SHEET;
|
|
274
|
+
/** Snapshot data of the workbook at the time of disposal */
|
|
63
275
|
snapshot: IWorkbookData;
|
|
64
276
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
277
|
+
/**
|
|
278
|
+
* Interface for gridline change event
|
|
279
|
+
* Triggered when gridline visibility or color changes in a worksheet
|
|
280
|
+
*/
|
|
281
|
+
export interface IGridlineChangedEvent extends IEventBase {
|
|
282
|
+
/** The workbook instance containing the worksheet */
|
|
283
|
+
workbook: FWorkbook;
|
|
284
|
+
/** The worksheet where gridline changes occurred */
|
|
285
|
+
worksheet: FWorksheet;
|
|
286
|
+
/** Flag indicating whether gridlines are enabled or disabled */
|
|
287
|
+
enabled: boolean;
|
|
288
|
+
/** The color of the gridlines, undefined if using default color */
|
|
289
|
+
color: string | undefined;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Interface for event before gridline enable/disable
|
|
293
|
+
* Triggered before changing the gridline visibility state
|
|
294
|
+
*/
|
|
295
|
+
export interface IBeforeGridlineEnableChange extends IEventBase {
|
|
296
|
+
/** The workbook instance containing the worksheet */
|
|
297
|
+
workbook: FWorkbook;
|
|
298
|
+
/** The worksheet where gridline state will change */
|
|
299
|
+
worksheet: FWorksheet;
|
|
300
|
+
/** The new enabled state to be applied */
|
|
301
|
+
enabled: boolean;
|
|
70
302
|
}
|
|
71
303
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
|
|
304
|
+
* Interface for event before gridline color change
|
|
305
|
+
* Triggered before changing the gridline color
|
|
306
|
+
*/
|
|
307
|
+
export interface IBeforeGridlineColorChanged extends IEventBase {
|
|
308
|
+
/** The workbook instance containing the worksheet */
|
|
309
|
+
workbook: FWorkbook;
|
|
310
|
+
/** The worksheet where gridline color will change */
|
|
311
|
+
worksheet: FWorksheet;
|
|
312
|
+
/** The new color to be applied, undefined to use default color */
|
|
313
|
+
color: string | undefined;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Interface for event parameters triggered before creating a new worksheet
|
|
317
|
+
* Extends the base event interface and includes workbook and worksheet details
|
|
75
318
|
*/
|
|
76
319
|
export interface IBeforeSheetCreateEventParams extends IEventBase {
|
|
77
320
|
/** The workbook instance */
|
|
@@ -82,9 +325,8 @@ export interface IBeforeSheetCreateEventParams extends IEventBase {
|
|
|
82
325
|
sheet?: IWorksheetData;
|
|
83
326
|
}
|
|
84
327
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* @augments {IEventBase}
|
|
328
|
+
* Interface for event parameters triggered after a worksheet is created
|
|
329
|
+
* Extends the base event interface and includes workbook and worksheet details
|
|
88
330
|
*/
|
|
89
331
|
export interface ISheetCreatedEventParams extends IEventBase {
|
|
90
332
|
/** The workbook instance */
|
|
@@ -92,9 +334,163 @@ export interface ISheetCreatedEventParams extends IEventBase {
|
|
|
92
334
|
/** The newly created worksheet */
|
|
93
335
|
worksheet: FWorksheet;
|
|
94
336
|
}
|
|
337
|
+
/**
|
|
338
|
+
* Interface for sheet active change event
|
|
339
|
+
* Contains information about the sheet that will become active
|
|
340
|
+
*/
|
|
341
|
+
export interface IBeforeActiveSheetChangeEvent extends IEventBase {
|
|
342
|
+
/** The workbook instance containing the worksheet */
|
|
343
|
+
workbook: FWorkbook;
|
|
344
|
+
/** The worksheet that will become active */
|
|
345
|
+
activeSheet: FWorksheet;
|
|
346
|
+
/** The currently active worksheet */
|
|
347
|
+
oldActiveSheet: FWorksheet;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Interface for sheet active changed event
|
|
351
|
+
* Contains information about the newly activated sheet
|
|
352
|
+
*/
|
|
353
|
+
export interface IActiveSheetChangedEvent extends IEventBase {
|
|
354
|
+
/** The workbook instance containing the worksheet */
|
|
355
|
+
workbook: FWorkbook;
|
|
356
|
+
/** The worksheet that has become active */
|
|
357
|
+
activeSheet: FWorksheet;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Interface for sheet deletion event
|
|
361
|
+
* Contains information about the sheet that was deleted
|
|
362
|
+
*/
|
|
363
|
+
export interface ISheetDeletedEvent extends IEventBase {
|
|
364
|
+
/** The workbook instance containing the worksheet */
|
|
365
|
+
workbook: FWorkbook;
|
|
366
|
+
/** The worksheet that was deleted */
|
|
367
|
+
sheetId: string;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Interface for before sheet deletion event
|
|
371
|
+
* Contains information about the sheet that will be deleted
|
|
372
|
+
*/
|
|
373
|
+
export interface IBeforeSheetDeleteEvent extends IEventBase {
|
|
374
|
+
/** The workbook instance containing the worksheet */
|
|
375
|
+
workbook: FWorkbook;
|
|
376
|
+
/** The worksheet that will be deleted */
|
|
377
|
+
worksheet: FWorksheet;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Interface for sheet moved event
|
|
381
|
+
* Contains information about the sheet movement
|
|
382
|
+
*/
|
|
383
|
+
export interface ISheetMovedEvent extends IEventBase {
|
|
384
|
+
/** The workbook instance containing the worksheet */
|
|
385
|
+
workbook: FWorkbook;
|
|
386
|
+
/** The worksheet that was moved */
|
|
387
|
+
worksheet: FWorksheet;
|
|
388
|
+
/** The new position index of the sheet */
|
|
389
|
+
newIndex: number;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Interface for before sheet move event
|
|
393
|
+
* Contains information about the planned sheet movement
|
|
394
|
+
*/
|
|
395
|
+
export interface IBeforeSheetMoveEvent extends IEventBase {
|
|
396
|
+
/** The workbook instance containing the worksheet */
|
|
397
|
+
workbook: FWorkbook;
|
|
398
|
+
/** The worksheet that will be moved */
|
|
399
|
+
worksheet: FWorksheet;
|
|
400
|
+
/** The target position index for the sheet */
|
|
401
|
+
newIndex: number;
|
|
402
|
+
/** The current position index of the sheet */
|
|
403
|
+
oldIndex: number;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Interface for sheet name change event
|
|
407
|
+
* Contains information about the sheet name change
|
|
408
|
+
*/
|
|
409
|
+
export interface ISheetNameChangedEvent extends IEventBase {
|
|
410
|
+
/** The workbook instance containing the worksheet */
|
|
411
|
+
workbook: FWorkbook;
|
|
412
|
+
/** The worksheet whose name was changed */
|
|
413
|
+
worksheet: FWorksheet;
|
|
414
|
+
/** The new name of the sheet */
|
|
415
|
+
newName: string;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Interface for before sheet name change event
|
|
419
|
+
* Contains information about the planned sheet name change
|
|
420
|
+
*/
|
|
421
|
+
export interface IBeforeSheetNameChangeEvent extends IEventBase {
|
|
422
|
+
/** The workbook instance containing the worksheet */
|
|
423
|
+
workbook: FWorkbook;
|
|
424
|
+
/** The worksheet whose name will be changed */
|
|
425
|
+
worksheet: FWorksheet;
|
|
426
|
+
/** The new name to be applied */
|
|
427
|
+
newName: string;
|
|
428
|
+
/** The current name of the sheet */
|
|
429
|
+
oldName: string;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Interface for sheet tab color change event
|
|
433
|
+
* Contains information about the sheet tab color change
|
|
434
|
+
*/
|
|
435
|
+
export interface ISheetTabColorChangedEvent extends IEventBase {
|
|
436
|
+
/** The workbook instance containing the worksheet */
|
|
437
|
+
workbook: FWorkbook;
|
|
438
|
+
/** The worksheet whose tab color was changed */
|
|
439
|
+
worksheet: FWorksheet;
|
|
440
|
+
/** The new color of the sheet tab */
|
|
441
|
+
newColor: string | undefined;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Interface for before sheet tab color change event
|
|
445
|
+
* Contains information about the planned sheet tab color change
|
|
446
|
+
*/
|
|
447
|
+
export interface IBeforeSheetTabColorChangeEvent extends IEventBase {
|
|
448
|
+
/** The workbook instance containing the worksheet */
|
|
449
|
+
workbook: FWorkbook;
|
|
450
|
+
/** The worksheet whose tab color will be changed */
|
|
451
|
+
worksheet: FWorksheet;
|
|
452
|
+
/** The new color to be applied */
|
|
453
|
+
newColor: string | undefined;
|
|
454
|
+
/** The current color of the sheet tab */
|
|
455
|
+
oldColor: string | undefined;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Interface for sheet hide state change event
|
|
459
|
+
* Contains information about the sheet visibility change
|
|
460
|
+
*/
|
|
461
|
+
export interface ISheetHideChangedEvent extends IEventBase {
|
|
462
|
+
/** The workbook instance containing the worksheet */
|
|
463
|
+
workbook: FWorkbook;
|
|
464
|
+
/** The worksheet whose visibility was changed */
|
|
465
|
+
worksheet: FWorksheet;
|
|
466
|
+
/** The new visibility state */
|
|
467
|
+
hidden: boolean;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Interface for before sheet hide state change event
|
|
471
|
+
* Contains information about the planned sheet visibility change
|
|
472
|
+
*/
|
|
473
|
+
export interface IBeforeSheetHideChangeEvent extends IEventBase {
|
|
474
|
+
/** The workbook instance containing the worksheet */
|
|
475
|
+
workbook: FWorkbook;
|
|
476
|
+
/** The worksheet whose visibility will be changed */
|
|
477
|
+
worksheet: FWorksheet;
|
|
478
|
+
/** The new visibility state to be applied */
|
|
479
|
+
hidden: boolean;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Interface for sheet value changed event
|
|
483
|
+
* Contains information about the sheet value change
|
|
484
|
+
*/
|
|
485
|
+
export interface ISheetValueChangedEvent extends IEventBase {
|
|
486
|
+
/** The affected ranges of the sheet */
|
|
487
|
+
effectedRanges: FRange[];
|
|
488
|
+
/** The payload of the value change */
|
|
489
|
+
payload: CommandListenerValueChange;
|
|
490
|
+
}
|
|
95
491
|
/**
|
|
96
492
|
* Configuration interface for sheet-related events
|
|
97
|
-
*
|
|
493
|
+
* Provides event names and their corresponding event parameter interfaces
|
|
98
494
|
*/
|
|
99
495
|
export interface ISheetEventParamConfig {
|
|
100
496
|
/** Event fired after a worksheet is created */
|
|
@@ -105,6 +501,60 @@ export interface ISheetEventParamConfig {
|
|
|
105
501
|
WorkbookCreated: IWorkbookCreateParam;
|
|
106
502
|
/** Event fired when a workbook is disposed */
|
|
107
503
|
WorkbookDisposed: IWorkbookDisposedEvent;
|
|
504
|
+
/** Event fired when gridline changed */
|
|
505
|
+
GridlineChanged: IGridlineChangedEvent;
|
|
506
|
+
/** Event fired before gridline enable changed */
|
|
507
|
+
BeforeGridlineEnableChange: IBeforeGridlineEnableChange;
|
|
508
|
+
/** Event fired before gridline color changed */
|
|
509
|
+
BeforeGridlineColorChange: IBeforeGridlineColorChanged;
|
|
510
|
+
/** Event fired before active sheet changes */
|
|
511
|
+
BeforeActiveSheetChange: IBeforeActiveSheetChangeEvent;
|
|
512
|
+
/** Event fired after active sheet changed */
|
|
513
|
+
ActiveSheetChanged: IActiveSheetChangedEvent;
|
|
514
|
+
/** Event fired after a sheet is deleted */
|
|
515
|
+
SheetDeleted: ISheetDeletedEvent;
|
|
516
|
+
/** Event fired before a sheet is deleted */
|
|
517
|
+
BeforeSheetDelete: IBeforeSheetDeleteEvent;
|
|
518
|
+
/** Event fired after a sheet is moved */
|
|
519
|
+
SheetMoved: ISheetMovedEvent;
|
|
520
|
+
/** Event fired before a sheet is moved */
|
|
521
|
+
BeforeSheetMove: IBeforeSheetMoveEvent;
|
|
522
|
+
/** Event fired after a sheet name is changed */
|
|
523
|
+
SheetNameChanged: ISheetNameChangedEvent;
|
|
524
|
+
/** Event fired before a sheet name is changed */
|
|
525
|
+
BeforeSheetNameChange: IBeforeSheetNameChangeEvent;
|
|
526
|
+
/** Event fired after a sheet tab color is changed */
|
|
527
|
+
SheetTabColorChanged: ISheetTabColorChangedEvent;
|
|
528
|
+
/** Event fired before a sheet tab color is changed */
|
|
529
|
+
BeforeSheetTabColorChange: IBeforeSheetTabColorChangeEvent;
|
|
530
|
+
/** Event fired after a sheet visibility is changed */
|
|
531
|
+
SheetHideChanged: ISheetHideChangedEvent;
|
|
532
|
+
/** Event fired before a sheet visibility is changed */
|
|
533
|
+
BeforeSheetHideChange: IBeforeSheetHideChangeEvent;
|
|
534
|
+
/** Event fired after a sheet value is changed */
|
|
535
|
+
SheetValueChanged: ISheetValueChangedEvent;
|
|
536
|
+
}
|
|
537
|
+
export declare class FSheetEventName extends FEventName implements IFSheetEventMixin {
|
|
538
|
+
get SheetCreated(): 'SheetCreated';
|
|
539
|
+
get BeforeSheetCreate(): 'BeforeSheetCreate';
|
|
540
|
+
get WorkbookCreated(): 'WorkbookCreated';
|
|
541
|
+
get WorkbookDisposed(): 'WorkbookDisposed';
|
|
542
|
+
get GridlineChanged(): 'GridlineChanged';
|
|
543
|
+
get BeforeGridlineEnableChange(): 'BeforeGridlineEnableChange';
|
|
544
|
+
get BeforeGridlineColorChange(): 'BeforeGridlineColorChange';
|
|
545
|
+
get BeforeActiveSheetChange(): 'BeforeActiveSheetChange';
|
|
546
|
+
get ActiveSheetChanged(): 'ActiveSheetChanged';
|
|
547
|
+
get SheetDeleted(): 'SheetDeleted';
|
|
548
|
+
get BeforeSheetDelete(): 'BeforeSheetDelete';
|
|
549
|
+
get SheetMoved(): 'SheetMoved';
|
|
550
|
+
get BeforeSheetMove(): 'BeforeSheetMove';
|
|
551
|
+
get SheetNameChanged(): 'SheetNameChanged';
|
|
552
|
+
get BeforeSheetNameChange(): 'BeforeSheetNameChange';
|
|
553
|
+
get SheetTabColorChanged(): 'SheetTabColorChanged';
|
|
554
|
+
get BeforeSheetTabColorChange(): 'BeforeSheetTabColorChange';
|
|
555
|
+
get SheetHideChanged(): 'SheetHideChanged';
|
|
556
|
+
get BeforeSheetHideChange(): 'BeforeSheetHideChange';
|
|
557
|
+
get SheetValueChanged(): 'SheetValueChanged';
|
|
108
558
|
}
|
|
109
559
|
declare module '@univerjs/core' {
|
|
110
560
|
interface FEventName extends IFSheetEventMixin {
|