@univerjs-pro/engine-pivot 0.5.3 → 0.5.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/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/types/types/json-types.d.ts +234 -0
- package/lib/umd/index.js +1 -1
- package/package.json +2 -2
|
@@ -90,95 +90,329 @@ export interface IDataFieldManagerBaseJSON {
|
|
|
90
90
|
collections: Record<string, IFieldsCollectionJSON>;
|
|
91
91
|
dataFields: Record<string, IDataFieldJSON>;
|
|
92
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Represents the change type of the pivot table.
|
|
95
|
+
*/
|
|
93
96
|
export declare enum PivotTableChangeTypeEnum {
|
|
97
|
+
/**
|
|
98
|
+
* Add field to the pivot table.
|
|
99
|
+
*/
|
|
94
100
|
AddField = 0,
|
|
101
|
+
/**
|
|
102
|
+
* Set subtotal to the field in the pivot table.
|
|
103
|
+
*/
|
|
95
104
|
SetSubtotalType = 1,
|
|
105
|
+
/**
|
|
106
|
+
* Remove field from the pivot table.
|
|
107
|
+
*/
|
|
96
108
|
RemoveField = 2,
|
|
109
|
+
/**
|
|
110
|
+
* Rename the field in the pivot table.
|
|
111
|
+
*/
|
|
97
112
|
RenameField = 3,
|
|
113
|
+
/**
|
|
114
|
+
* Set filter information to the field in the pivot table.
|
|
115
|
+
*/
|
|
98
116
|
SetFilterInfo = 4,
|
|
117
|
+
/**
|
|
118
|
+
* Set sort information to the field in the pivot table.
|
|
119
|
+
*/
|
|
99
120
|
SetSortInfo = 5,
|
|
121
|
+
/**
|
|
122
|
+
* Update field position in the pivot table.
|
|
123
|
+
*/
|
|
100
124
|
UpdateFieldPosition = 6,
|
|
125
|
+
/**
|
|
126
|
+
* Set options to the pivot table.
|
|
127
|
+
*/
|
|
101
128
|
UpdateValuePosition = 7,
|
|
129
|
+
/**
|
|
130
|
+
* Set options to the pivot table.
|
|
131
|
+
*/
|
|
102
132
|
SetOptions = 8,
|
|
133
|
+
/**
|
|
134
|
+
* Set format to the field in the pivot table.
|
|
135
|
+
*/
|
|
103
136
|
SetFieldFormat = 9,
|
|
137
|
+
/**
|
|
138
|
+
* Set collapse to the field in the pivot table.
|
|
139
|
+
*/
|
|
104
140
|
SetCollapse = 10,
|
|
141
|
+
/**
|
|
142
|
+
* Update source of the field in the pivot table.
|
|
143
|
+
*/
|
|
105
144
|
UpdateSource = 11
|
|
106
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* The change of adding field to the pivot table.
|
|
148
|
+
*/
|
|
107
149
|
export interface IPivotTableAddFieldChange {
|
|
150
|
+
/**
|
|
151
|
+
* @property {PivotTableChangeTypeEnum} type The type of the change.
|
|
152
|
+
*/
|
|
108
153
|
type: PivotTableChangeTypeEnum.AddField;
|
|
154
|
+
/**
|
|
155
|
+
* @property {IPivotTableValueFieldJSON | IPivotTableLabelFieldJSON} fieldJson The field json.
|
|
156
|
+
*/
|
|
109
157
|
fieldJson: IPivotTableValueFieldJSON | IPivotTableLabelFieldJSON;
|
|
158
|
+
/**
|
|
159
|
+
* @property {PivotTableFiledAreaEnum} area Which area the field is added to.
|
|
160
|
+
*/
|
|
110
161
|
area: PivotTableFiledAreaEnum;
|
|
162
|
+
/**
|
|
163
|
+
* @property {number} index The index of the field in the area.
|
|
164
|
+
*/
|
|
111
165
|
index: number;
|
|
112
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* The change of updating source of the field in the pivot table.
|
|
169
|
+
*/
|
|
113
170
|
export interface IPivotUpdateSourceChange {
|
|
171
|
+
/**
|
|
172
|
+
* @property {PivotTableChangeTypeEnum} type The type of the change.
|
|
173
|
+
*/
|
|
114
174
|
type: PivotTableChangeTypeEnum.UpdateSource;
|
|
175
|
+
/**
|
|
176
|
+
* @property {string} tableFieldId The pivot field id.
|
|
177
|
+
*/
|
|
115
178
|
tableFieldId: string;
|
|
179
|
+
/**
|
|
180
|
+
* @property {string} oldSourceName The old source name.
|
|
181
|
+
*/
|
|
116
182
|
oldSourceName: string;
|
|
183
|
+
/**
|
|
184
|
+
* @property {string} newSourceName The new source name.
|
|
185
|
+
*/
|
|
117
186
|
newSourceName: string;
|
|
187
|
+
/**
|
|
188
|
+
* @property {string} oldDataFieldId The old data field id.
|
|
189
|
+
*/
|
|
118
190
|
oldDataFieldId: string;
|
|
191
|
+
/**
|
|
192
|
+
* @property {string} newDataFieldId The new data field id.
|
|
193
|
+
*/
|
|
119
194
|
newDataFieldId: string;
|
|
120
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* The change of setting subtotal type to the field in the pivot table.
|
|
198
|
+
*/
|
|
121
199
|
export interface IPivotTableSetSubtotalTypeChange {
|
|
200
|
+
/**
|
|
201
|
+
* @property {PivotTableChangeTypeEnum} type The type of the change.
|
|
202
|
+
*/
|
|
122
203
|
type: PivotTableChangeTypeEnum.SetSubtotalType;
|
|
204
|
+
/**
|
|
205
|
+
* @property {string} fieldId The pivot table field id.
|
|
206
|
+
*/
|
|
123
207
|
fieldId: string;
|
|
208
|
+
/**
|
|
209
|
+
* @property {PivotSubtotalTypeEnum} newSubtotalType The new subtotal type.
|
|
210
|
+
*/
|
|
124
211
|
newSubtotalType: PivotSubtotalTypeEnum;
|
|
212
|
+
/**
|
|
213
|
+
* @property {PivotSubtotalTypeEnum} oldSubtotalType The old subtotal type.
|
|
214
|
+
*/
|
|
125
215
|
oldSubtotalType: PivotSubtotalTypeEnum;
|
|
126
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* The change of removing field from the pivot table.
|
|
219
|
+
*/
|
|
127
220
|
export interface IPivotTableRemoveFieldChange {
|
|
221
|
+
/**
|
|
222
|
+
* @property {PivotTableChangeTypeEnum} type The type of the change.
|
|
223
|
+
*/
|
|
128
224
|
type: PivotTableChangeTypeEnum.RemoveField;
|
|
225
|
+
/**
|
|
226
|
+
* @property {string} fieldId The pivot table field id.
|
|
227
|
+
*/
|
|
129
228
|
fieldId: string;
|
|
229
|
+
/**
|
|
230
|
+
* @property {PivotTableFiledAreaEnum} area Which area the field is removed from.
|
|
231
|
+
*/
|
|
130
232
|
area: PivotTableFiledAreaEnum;
|
|
233
|
+
/**
|
|
234
|
+
* @property {number} index The index of the field in the area.
|
|
235
|
+
*/
|
|
131
236
|
index: number;
|
|
237
|
+
/**
|
|
238
|
+
* @property {IPivotTableValueFieldJSON | IPivotTableLabelFieldJSON} fieldJson The field json.
|
|
239
|
+
*/
|
|
132
240
|
fieldJson: IPivotTableValueFieldJSON | IPivotTableLabelFieldJSON;
|
|
133
241
|
}
|
|
242
|
+
/**
|
|
243
|
+
* The change of renaming the field in the pivot table.
|
|
244
|
+
*/
|
|
134
245
|
export interface IPivotTableRenameFieldChange {
|
|
246
|
+
/**
|
|
247
|
+
* @property {PivotTableChangeTypeEnum} type The type of the change.
|
|
248
|
+
*/
|
|
135
249
|
type: PivotTableChangeTypeEnum.RenameField;
|
|
250
|
+
/**
|
|
251
|
+
* @property {string} fieldId The pivot table field id.
|
|
252
|
+
*/
|
|
136
253
|
fieldId: string;
|
|
254
|
+
/**
|
|
255
|
+
* @property {string} oldName The old name of the field.
|
|
256
|
+
*/
|
|
137
257
|
oldName: string;
|
|
258
|
+
/**
|
|
259
|
+
* @property {string} newName The new name of the field.
|
|
260
|
+
*/
|
|
138
261
|
newName: string;
|
|
139
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* The change of updating field position in the pivot table.
|
|
265
|
+
*/
|
|
140
266
|
export interface IPivotTableUpdatePositionChange {
|
|
267
|
+
/**
|
|
268
|
+
* @property {PivotTableChangeTypeEnum} type The type of the change.
|
|
269
|
+
*/
|
|
141
270
|
type: PivotTableChangeTypeEnum.UpdateFieldPosition;
|
|
271
|
+
/**
|
|
272
|
+
* @property {string} fieldId The pivot table field id.
|
|
273
|
+
*/
|
|
142
274
|
fieldId: string;
|
|
275
|
+
/**
|
|
276
|
+
* @property {PivotTableFiledAreaEnum} oldArea The old area of the field.
|
|
277
|
+
*/
|
|
143
278
|
oldArea: PivotTableFiledAreaEnum;
|
|
279
|
+
/**
|
|
280
|
+
* @property {PivotTableFiledAreaEnum} newArea The new area of the field.
|
|
281
|
+
*/
|
|
144
282
|
newArea: PivotTableFiledAreaEnum;
|
|
283
|
+
/**
|
|
284
|
+
* @property {number} oldIndex The old index of the field in the area.
|
|
285
|
+
*/
|
|
145
286
|
oldIndex: number;
|
|
287
|
+
/**
|
|
288
|
+
* @property {number} newIndex The new index of the field in the area.
|
|
289
|
+
*/
|
|
146
290
|
newIndex: number;
|
|
147
291
|
}
|
|
292
|
+
/**
|
|
293
|
+
* The change of setting options to the pivot table.
|
|
294
|
+
*/
|
|
148
295
|
export interface IPivotTableSetOptionsChange {
|
|
296
|
+
/**
|
|
297
|
+
* @property {PivotTableChangeTypeEnum} type The type of the change.
|
|
298
|
+
*/
|
|
149
299
|
type: PivotTableChangeTypeEnum.SetOptions;
|
|
300
|
+
/**
|
|
301
|
+
* @property {IPivotTableOptions} oldOptions The old options of the pivot table.
|
|
302
|
+
*/
|
|
150
303
|
oldOptions: IPivotTableOptions;
|
|
304
|
+
/**
|
|
305
|
+
* @property {IPivotTableOptions} newOptions The new options of the pivot table.
|
|
306
|
+
*/
|
|
151
307
|
newOptions: IPivotTableOptions;
|
|
152
308
|
}
|
|
309
|
+
/**
|
|
310
|
+
* The change of updating value position in the pivot table.
|
|
311
|
+
*/
|
|
153
312
|
export interface IPivotTableUpdateValuePositionChange {
|
|
313
|
+
/**
|
|
314
|
+
* @property {PivotTableChangeTypeEnum} type The type of the change.
|
|
315
|
+
*/
|
|
154
316
|
type: PivotTableChangeTypeEnum.UpdateValuePosition;
|
|
317
|
+
/**
|
|
318
|
+
* @property {PivotTableValuePositionEnum} oldValuePosition The old value position.
|
|
319
|
+
*/
|
|
155
320
|
oldValuePosition: PivotTableValuePositionEnum;
|
|
321
|
+
/**
|
|
322
|
+
* @property {PivotTableValuePositionEnum} newValuePosition The new value position.
|
|
323
|
+
*/
|
|
156
324
|
newValuePosition: PivotTableValuePositionEnum;
|
|
325
|
+
/**
|
|
326
|
+
* @property {number} oldIndex The old index of the value position.
|
|
327
|
+
*/
|
|
157
328
|
oldIndex: number;
|
|
329
|
+
/**
|
|
330
|
+
* @property {number} newIndex The new index of the value position.
|
|
331
|
+
*/
|
|
158
332
|
newIndex: number;
|
|
159
333
|
}
|
|
334
|
+
/**
|
|
335
|
+
* The change of setting filter information to the field in the pivot table.
|
|
336
|
+
*/
|
|
160
337
|
export interface IPivotTableSetFilterInfoChange {
|
|
338
|
+
/**
|
|
339
|
+
* @property {PivotTableChangeTypeEnum} type The type of the change.
|
|
340
|
+
*/
|
|
161
341
|
type: PivotTableChangeTypeEnum.SetFilterInfo;
|
|
342
|
+
/**
|
|
343
|
+
* @property {string} fieldId The pivot table field id.
|
|
344
|
+
*/
|
|
162
345
|
fieldId: string;
|
|
346
|
+
/**
|
|
347
|
+
* @property {IPivotTableFilterInfo} oldFilterInfo The old filter information.
|
|
348
|
+
*/
|
|
163
349
|
oldFilterInfo: IPivotTableFilterInfo;
|
|
350
|
+
/**
|
|
351
|
+
* @property {IPivotTableFilterInfo} newFilterInfo The new filter information.
|
|
352
|
+
*/
|
|
164
353
|
newFilterInfo: IPivotTableFilterInfo;
|
|
165
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
* The change of setting sort information to the field in the pivot table.
|
|
357
|
+
*/
|
|
166
358
|
export interface IPivotTableSetSortInfoChange {
|
|
359
|
+
/**
|
|
360
|
+
* @property {PivotTableChangeTypeEnum} type The type of the change.
|
|
361
|
+
*/
|
|
167
362
|
type: PivotTableChangeTypeEnum.SetSortInfo;
|
|
363
|
+
/**
|
|
364
|
+
* @property {string} fieldId The pivot table field id.
|
|
365
|
+
*/
|
|
168
366
|
fieldId: string;
|
|
367
|
+
/**
|
|
368
|
+
* @property {IPivotTableSortInfo | undefined} oldSortInfo The old sort information.
|
|
369
|
+
*/
|
|
169
370
|
oldSortInfo: IPivotTableSortInfo | undefined;
|
|
371
|
+
/**
|
|
372
|
+
* @property {IPivotTableSortInfo | undefined} newSortInfo The new sort information.
|
|
373
|
+
*/
|
|
170
374
|
newSortInfo: IPivotTableSortInfo | undefined;
|
|
171
375
|
}
|
|
376
|
+
/**
|
|
377
|
+
* The change of setting format to the field in the pivot table.
|
|
378
|
+
*/
|
|
172
379
|
export interface IPivotTableSetFormatChange {
|
|
380
|
+
/**
|
|
381
|
+
* @property {PivotTableChangeTypeEnum} type The type of the change.
|
|
382
|
+
*/
|
|
173
383
|
type: PivotTableChangeTypeEnum.SetFieldFormat;
|
|
384
|
+
/**
|
|
385
|
+
* @property {string} fieldId The pivot table field id.
|
|
386
|
+
*/
|
|
174
387
|
fieldId: string;
|
|
388
|
+
/**
|
|
389
|
+
* @property {string | undefined} oldFormat The old format of the field.
|
|
390
|
+
*/
|
|
175
391
|
oldFormat: string | undefined;
|
|
392
|
+
/**
|
|
393
|
+
* @property {string | undefined} newFormat The new format of the field.
|
|
394
|
+
*/
|
|
176
395
|
newFormat: string | undefined;
|
|
177
396
|
}
|
|
397
|
+
/**
|
|
398
|
+
* The change of setting collapse to the field in the pivot table.
|
|
399
|
+
*/
|
|
178
400
|
export interface IPivotTableSetCollapseChange {
|
|
401
|
+
/**
|
|
402
|
+
* @property {PivotTableChangeTypeEnum} type The type of the change.
|
|
403
|
+
*/
|
|
179
404
|
type: PivotTableChangeTypeEnum.SetCollapse;
|
|
405
|
+
/**
|
|
406
|
+
* @property {string} fieldId The pivot table field id.
|
|
407
|
+
*/
|
|
180
408
|
fieldId: string;
|
|
409
|
+
/**
|
|
410
|
+
* @property {boolean} collapse The collapse state of the field.
|
|
411
|
+
*/
|
|
181
412
|
collapse: boolean;
|
|
413
|
+
/**
|
|
414
|
+
* @property {string} [item] The item associated with the collapse state.
|
|
415
|
+
*/
|
|
182
416
|
item?: string;
|
|
183
417
|
}
|
|
184
418
|
export type IPivotTableChangeSet = IPivotTableAddFieldChange | IPivotTableSetSubtotalTypeChange | IPivotTableRemoveFieldChange | IPivotTableRenameFieldChange | IPivotTableSetFilterInfoChange | IPivotTableSetSortInfoChange | IPivotTableUpdatePositionChange | IPivotTableUpdateValuePositionChange | IPivotTableSetOptionsChange | IPivotTableSetFormatChange | IPivotTableSetCollapseChange | IPivotUpdateSourceChange;
|