@univerjs/core 0.2.8 → 0.2.9
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 +8 -8
- package/lib/es/index.js +205 -212
- package/lib/types/common/equal.d.ts +15 -3
- package/lib/types/common/interceptor.d.ts +1 -1
- package/lib/types/{types/interfaces/i-freeze.d.ts → common/mixin.d.ts} +9 -5
- package/lib/types/common/unit.d.ts +2 -1
- package/lib/types/docs/data-model/document-data-model.d.ts +2 -3
- package/lib/types/index.d.ts +5 -2
- package/lib/types/services/lifecycle/lifecycle.d.ts +5 -0
- package/lib/types/services/permission/type.d.ts +2 -2
- package/lib/types/services/resource-loader/resource-loader.service.d.ts +3 -5
- package/lib/types/services/resource-loader/type.d.ts +4 -6
- package/lib/types/services/resource-manager/resource-manager.service.d.ts +4 -4
- package/lib/types/services/resource-manager/type.d.ts +9 -5
- package/lib/types/services/snapshot/__tests__/snapshot-mock.d.ts +1 -1
- package/lib/types/services/snapshot/snapshot-transform.d.ts +1 -1
- package/lib/types/services/snapshot/snapshot-utils.d.ts +1 -3
- package/lib/types/services/undoredo/undoredo.service.d.ts +1 -1
- package/lib/types/shared/check-if-move.d.ts +1 -1
- package/lib/types/shared/color/color.d.ts +1 -1
- package/lib/types/shared/common.d.ts +2 -4
- package/lib/types/shared/object-matrix-query.d.ts +1 -1
- package/lib/types/shared/object-matrix.d.ts +1 -1
- package/lib/types/shared/range.d.ts +1 -1
- package/lib/types/shared/rectangle.d.ts +1 -1
- package/lib/types/shared/tools.d.ts +1 -2
- package/lib/types/shared/types.d.ts +4 -13
- package/lib/types/{types/interfaces/i-service-data.d.ts → sheets/__tests__/cell-data.spec.d.ts} +1 -2
- package/lib/types/sheets/__tests__/create-core-test-bed.d.ts +1 -1
- package/lib/types/sheets/column-manager.d.ts +2 -2
- package/lib/types/sheets/empty-snapshot.d.ts +1 -1
- package/lib/types/sheets/range.d.ts +2 -1
- package/lib/types/sheets/row-manager.d.ts +1 -1
- package/lib/types/sheets/sheet-snapshot-utils.d.ts +1 -1
- package/lib/types/sheets/styles.d.ts +2 -1
- package/lib/types/sheets/typedef.d.ts +451 -0
- package/lib/types/sheets/util.d.ts +3 -0
- package/lib/types/sheets/view-model.d.ts +2 -2
- package/lib/types/sheets/workbook.d.ts +13 -4
- package/lib/types/sheets/worksheet.d.ts +11 -1
- package/lib/types/slides/slide-model.d.ts +0 -1
- package/lib/types/types/enum/locale-type.d.ts +3 -1
- package/lib/types/types/enum/text-style.d.ts +1 -1
- package/lib/types/types/interfaces/i-cell-custom-render.d.ts +2 -2
- package/lib/types/types/interfaces/i-data-validation.d.ts +1 -1
- package/lib/types/types/interfaces/i-document-data.d.ts +2 -4
- package/lib/types/types/interfaces/i-slide-data.d.ts +5 -3
- package/lib/types/types/interfaces/index.d.ts +0 -11
- package/lib/types/univer.d.ts +14 -2
- package/lib/umd/index.js +8 -8
- package/package.json +4 -4
- package/lib/types/common/type-util.d.ts +0 -16
- package/lib/types/common/type-utils.d.ts +0 -16
- package/lib/types/types/interfaces/i-cell-data.d.ts +0 -66
- package/lib/types/types/interfaces/i-column-data.d.ts +0 -14
- package/lib/types/types/interfaces/i-extra-model-data.d.ts +0 -27
- package/lib/types/types/interfaces/i-range.d.ts +0 -208
- package/lib/types/types/interfaces/i-row-data.d.ts +0 -26
- package/lib/types/types/interfaces/i-selection-data.d.ts +0 -58
- package/lib/types/types/interfaces/i-univer-data.d.ts +0 -13
- package/lib/types/types/interfaces/i-workbook-data.d.ts +0 -39
- package/lib/types/types/interfaces/i-worksheet-data.d.ts +0 -54
- package/lib/types/types/interfaces/i-worksheet-order-data.d.ts +0 -17
- /package/lib/types/{types/interfaces/__tests__/i-cell-data.spec.d.ts → services/__tests__/resources.spec.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Core library for Univer.",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
|
|
50
50
|
"rxjs": ">=7.0.0",
|
|
51
|
-
"@univerjs/core": "0.2.
|
|
51
|
+
"@univerjs/core": "0.2.9"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@types/lodash.mergewith": "^4.6.9",
|
|
55
|
-
"@univerjs/protocol": "0.1.39-alpha.
|
|
55
|
+
"@univerjs/protocol": "0.1.39-alpha.9",
|
|
56
56
|
"@wendellhu/redi": "0.16.1",
|
|
57
57
|
"lodash.mergewith": "^4.6.2",
|
|
58
58
|
"nanoid": "5.0.7",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"typescript": "^5.5.4",
|
|
67
67
|
"vite": "^5.4.0",
|
|
68
68
|
"vitest": "^2.0.5",
|
|
69
|
-
"@univerjs/shared": "0.2.
|
|
69
|
+
"@univerjs/shared": "0.2.9"
|
|
70
70
|
},
|
|
71
71
|
"univerSpace": {
|
|
72
72
|
".": {
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023-present DreamNum Inc.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export type Nullable<T> = T | null | undefined | void;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023-present DreamNum Inc.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export type Nullable<T> = T | null | undefined | void;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { Nullable } from '../../shared/types';
|
|
2
|
-
import { CellValueType } from '../enum/text-style';
|
|
3
|
-
import { ICellCustomRender } from './i-cell-custom-render';
|
|
4
|
-
import { IDocumentData } from './i-document-data';
|
|
5
|
-
import { IStyleData } from './i-style-data';
|
|
6
|
-
import { ICellValidationData } from './i-cell-validation-data';
|
|
7
|
-
/**
|
|
8
|
-
* Cell value type
|
|
9
|
-
*/
|
|
10
|
-
export type CellValue = string | number | boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Cell data
|
|
13
|
-
*/
|
|
14
|
-
export interface ICellData {
|
|
15
|
-
/**
|
|
16
|
-
* The unique key, a random string, is used for the plug-in to associate the cell. When the cell information changes,
|
|
17
|
-
* the plug-in does not need to change the data, reducing the pressure on the back-end interface id?: string.
|
|
18
|
-
*/
|
|
19
|
-
p?: Nullable<IDocumentData>;
|
|
20
|
-
/** style id */
|
|
21
|
-
s?: Nullable<IStyleData | string>;
|
|
22
|
-
/**
|
|
23
|
-
* Origin value
|
|
24
|
-
*/
|
|
25
|
-
v?: Nullable<CellValue>;
|
|
26
|
-
t?: Nullable<CellValueType>;
|
|
27
|
-
/**
|
|
28
|
-
* Raw formula string. For example `=SUM(A1:B4)`.
|
|
29
|
-
*/
|
|
30
|
-
f?: Nullable<string>;
|
|
31
|
-
/**
|
|
32
|
-
* Id of the formula.
|
|
33
|
-
*/
|
|
34
|
-
si?: Nullable<string>;
|
|
35
|
-
/**
|
|
36
|
-
* User stored custom fields
|
|
37
|
-
*/
|
|
38
|
-
custom?: Nullable<Record<string, any>>;
|
|
39
|
-
}
|
|
40
|
-
export interface ICellMarksStyle {
|
|
41
|
-
color: string;
|
|
42
|
-
size: number;
|
|
43
|
-
}
|
|
44
|
-
export interface ICellMarks {
|
|
45
|
-
tl?: ICellMarksStyle;
|
|
46
|
-
tr?: ICellMarksStyle;
|
|
47
|
-
bl?: ICellMarksStyle;
|
|
48
|
-
br?: ICellMarksStyle;
|
|
49
|
-
isSkip?: boolean;
|
|
50
|
-
}
|
|
51
|
-
export interface ICellDataForSheetInterceptor extends ICellData {
|
|
52
|
-
interceptorStyle?: Nullable<IStyleData>;
|
|
53
|
-
isInArrayFormulaRange?: Nullable<boolean>;
|
|
54
|
-
dataValidation?: Nullable<ICellValidationData>;
|
|
55
|
-
markers?: ICellMarks;
|
|
56
|
-
customRender?: Nullable<ICellCustomRender[]>;
|
|
57
|
-
interceptorAutoHeight?: number;
|
|
58
|
-
/**
|
|
59
|
-
* can cell be covered when sibling is overflow
|
|
60
|
-
*/
|
|
61
|
-
coverable?: boolean;
|
|
62
|
-
}
|
|
63
|
-
export declare function isICellData(value: any): value is ICellData;
|
|
64
|
-
export declare function getCellValueType(cell: ICellData): CellValueType | null | undefined;
|
|
65
|
-
export declare function isNullCell(cell: Nullable<ICellData>): boolean;
|
|
66
|
-
export declare function isCellV(cell: Nullable<ICellData | CellValue>): cell is string | number | boolean;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023-present DreamNum Inc.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export interface IExtraModelData {
|
|
17
|
-
/**
|
|
18
|
-
* should start renderLoop Immediately
|
|
19
|
-
* default is true
|
|
20
|
-
*/
|
|
21
|
-
shouldStartRenderingImmediately?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* HTML selector
|
|
24
|
-
* default is null
|
|
25
|
-
*/
|
|
26
|
-
container?: string;
|
|
27
|
-
}
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023-present DreamNum Inc.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export declare enum RANGE_TYPE {
|
|
17
|
-
NORMAL = 0,
|
|
18
|
-
ROW = 1,
|
|
19
|
-
COLUMN = 2,
|
|
20
|
-
ALL = 3
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* none: A1
|
|
24
|
-
* row: A$1
|
|
25
|
-
* column: $A1
|
|
26
|
-
* all: $A$1
|
|
27
|
-
*/
|
|
28
|
-
export declare enum AbsoluteRefType {
|
|
29
|
-
NONE = 0,
|
|
30
|
-
ROW = 1,
|
|
31
|
-
COLUMN = 2,
|
|
32
|
-
ALL = 3
|
|
33
|
-
}
|
|
34
|
-
interface IRangeLocation {
|
|
35
|
-
/**
|
|
36
|
-
* Id of the Workbook the range belongs to.
|
|
37
|
-
* When this field is not defined, it should be considered as the range in the currently activated worksheet.
|
|
38
|
-
*/
|
|
39
|
-
unitId?: string;
|
|
40
|
-
/**
|
|
41
|
-
* Id of the Worksheet the range belongs to.
|
|
42
|
-
* When this field is not defined, it should be considered as the range in the currently activated worksheet.
|
|
43
|
-
*/
|
|
44
|
-
sheetId?: string;
|
|
45
|
-
}
|
|
46
|
-
export interface IRowRange extends IRangeLocation {
|
|
47
|
-
/**
|
|
48
|
-
* The start row (inclusive) of the range
|
|
49
|
-
* startRow
|
|
50
|
-
*/
|
|
51
|
-
startRow: number;
|
|
52
|
-
/**
|
|
53
|
-
* The end row (exclusive) of the range
|
|
54
|
-
* endRow
|
|
55
|
-
*/
|
|
56
|
-
endRow: number;
|
|
57
|
-
}
|
|
58
|
-
export interface IColumnRange extends IRangeLocation {
|
|
59
|
-
/**
|
|
60
|
-
* The start column (inclusive) of the range
|
|
61
|
-
* startColumn
|
|
62
|
-
*/
|
|
63
|
-
startColumn: number;
|
|
64
|
-
/**
|
|
65
|
-
* The end column (exclusive) of the range
|
|
66
|
-
* endColumn
|
|
67
|
-
*/
|
|
68
|
-
endColumn: number;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Range data structure
|
|
72
|
-
*
|
|
73
|
-
* One of the range types,
|
|
74
|
-
*
|
|
75
|
-
* e.g.,
|
|
76
|
-
* {
|
|
77
|
-
* startRow:0 ,
|
|
78
|
-
* startColumn:0,
|
|
79
|
-
* endRow:1,
|
|
80
|
-
* endColumn:1,
|
|
81
|
-
* }
|
|
82
|
-
*
|
|
83
|
-
* means "A1:B2"
|
|
84
|
-
*/
|
|
85
|
-
export interface IRange extends IRowRange, IColumnRange {
|
|
86
|
-
rangeType?: RANGE_TYPE;
|
|
87
|
-
startAbsoluteRefType?: AbsoluteRefType;
|
|
88
|
-
endAbsoluteRefType?: AbsoluteRefType;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Transform an `IRange` object to an array.
|
|
92
|
-
* @param range
|
|
93
|
-
* @returns [rowStart, colStart, rowEnd, colEnd]
|
|
94
|
-
*/
|
|
95
|
-
export declare function selectionToArray(range: IRange): [number, number, number, number];
|
|
96
|
-
/**
|
|
97
|
-
* Range data of grid
|
|
98
|
-
*/
|
|
99
|
-
export interface IGridRange {
|
|
100
|
-
sheetId: string;
|
|
101
|
-
range: IRange;
|
|
102
|
-
}
|
|
103
|
-
export interface IUnitRangeName {
|
|
104
|
-
unitId: string;
|
|
105
|
-
sheetName: string;
|
|
106
|
-
range: IRange;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Range data of Unit
|
|
110
|
-
*/
|
|
111
|
-
export interface IUnitRange extends IGridRange {
|
|
112
|
-
unitId: string;
|
|
113
|
-
}
|
|
114
|
-
export interface IUnitRangeWithName extends IUnitRange {
|
|
115
|
-
sheetName: string;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* One of the range types,
|
|
119
|
-
*
|
|
120
|
-
* e.g.,"A1:B2","sheet1!A1:B2","A1","1:1","A:A","AA1:BB2"
|
|
121
|
-
*/
|
|
122
|
-
export type IRangeStringData = string;
|
|
123
|
-
/**
|
|
124
|
-
* Row data type
|
|
125
|
-
*/
|
|
126
|
-
export type IRowStartEndData = [startRow: number, endRow: number] | number[];
|
|
127
|
-
/**
|
|
128
|
-
* Column data type
|
|
129
|
-
*/
|
|
130
|
-
export type IColumnStartEndData = [startColumn: number, endColumn: number] | number[];
|
|
131
|
-
/**
|
|
132
|
-
* One of the range types,
|
|
133
|
-
*
|
|
134
|
-
* e.g.,
|
|
135
|
-
* {
|
|
136
|
-
* row:[0,1],
|
|
137
|
-
* column:[0,1]
|
|
138
|
-
* }
|
|
139
|
-
*todo
|
|
140
|
-
|
|
141
|
-
true false 枚举
|
|
142
|
-
* means "A1:B2"
|
|
143
|
-
*/
|
|
144
|
-
export interface IRangeArrayData {
|
|
145
|
-
/**
|
|
146
|
-
* row
|
|
147
|
-
*/
|
|
148
|
-
row: IRowStartEndData;
|
|
149
|
-
/**
|
|
150
|
-
* column
|
|
151
|
-
*/
|
|
152
|
-
column: IColumnStartEndData;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* The row and column numbers represent a cell
|
|
156
|
-
*/
|
|
157
|
-
export interface IRangeCellData {
|
|
158
|
-
/**
|
|
159
|
-
* row
|
|
160
|
-
*/
|
|
161
|
-
row: number;
|
|
162
|
-
/**
|
|
163
|
-
* column
|
|
164
|
-
*/
|
|
165
|
-
column: number;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* range types
|
|
169
|
-
*
|
|
170
|
-
* Allow users to provide one of three formats, we need to convert to IRange to store
|
|
171
|
-
*/
|
|
172
|
-
export type IRangeType = IRange | IRangeStringData | IRangeArrayData | IRangeCellData;
|
|
173
|
-
/**
|
|
174
|
-
* Whether to clear only the contents. Whether to clear only the format; note that clearing format also clears data validation rules.
|
|
175
|
-
*/
|
|
176
|
-
export interface IOptionData {
|
|
177
|
-
/**
|
|
178
|
-
* 1. designates that only the format should be copied
|
|
179
|
-
*
|
|
180
|
-
* 2. Whether to clear only the format; note that clearing format also clears data validation rules.
|
|
181
|
-
*
|
|
182
|
-
* 3. worksheet Whether to clear the format.
|
|
183
|
-
*/
|
|
184
|
-
formatOnly?: boolean;
|
|
185
|
-
/**
|
|
186
|
-
* 1. designates that only the content should be copied
|
|
187
|
-
*
|
|
188
|
-
* 2. Whether to clear only the contents.
|
|
189
|
-
*
|
|
190
|
-
* 3. worksheet Whether to clear the content.
|
|
191
|
-
*
|
|
192
|
-
*/
|
|
193
|
-
contentsOnly?: boolean;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Option of copyTo function
|
|
197
|
-
*/
|
|
198
|
-
export interface ICopyToOptionsData extends IOptionData {
|
|
199
|
-
}
|
|
200
|
-
export interface IRectLTRB {
|
|
201
|
-
left: number;
|
|
202
|
-
top: number;
|
|
203
|
-
right: number;
|
|
204
|
-
bottom: number;
|
|
205
|
-
width?: number;
|
|
206
|
-
height?: number;
|
|
207
|
-
}
|
|
208
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { BooleanNumber } from '../enum';
|
|
2
|
-
/**
|
|
3
|
-
* Properties of row data
|
|
4
|
-
*/
|
|
5
|
-
export interface IRowData {
|
|
6
|
-
/**
|
|
7
|
-
* height in pixel
|
|
8
|
-
*/
|
|
9
|
-
h?: number;
|
|
10
|
-
/**
|
|
11
|
-
* is current row self-adaptive to its content, use `ah` to set row height when true, else use `h`.
|
|
12
|
-
*/
|
|
13
|
-
ia?: BooleanNumber;
|
|
14
|
-
/**
|
|
15
|
-
* auto height
|
|
16
|
-
*/
|
|
17
|
-
ah?: number;
|
|
18
|
-
/**
|
|
19
|
-
* hidden
|
|
20
|
-
*/
|
|
21
|
-
hd?: BooleanNumber;
|
|
22
|
-
}
|
|
23
|
-
export interface IRowAutoHeightInfo {
|
|
24
|
-
row: number;
|
|
25
|
-
autoHeight?: number;
|
|
26
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Nullable } from '../../shared/types';
|
|
2
|
-
import { IRange } from './i-range';
|
|
3
|
-
/**
|
|
4
|
-
* Properties of selection data
|
|
5
|
-
*/
|
|
6
|
-
export interface IPosition {
|
|
7
|
-
startX: number;
|
|
8
|
-
startY: number;
|
|
9
|
-
endX: number;
|
|
10
|
-
endY: number;
|
|
11
|
-
}
|
|
12
|
-
export interface ISingleCell {
|
|
13
|
-
actualRow: number;
|
|
14
|
-
actualColumn: number;
|
|
15
|
-
isMerged: boolean;
|
|
16
|
-
isMergedMainCell: boolean;
|
|
17
|
-
}
|
|
18
|
-
export interface IRangeWithCoord extends IPosition, IRange {
|
|
19
|
-
}
|
|
20
|
-
export interface ISelectionCell extends IRange, ISingleCell {
|
|
21
|
-
}
|
|
22
|
-
export interface ISelectionCellWithMergeInfo extends IPosition, ISingleCell {
|
|
23
|
-
mergeInfo: IRangeWithCoord;
|
|
24
|
-
}
|
|
25
|
-
export interface ISelection {
|
|
26
|
-
/**
|
|
27
|
-
* Sheet selection range.
|
|
28
|
-
*/
|
|
29
|
-
range: IRange;
|
|
30
|
-
/**
|
|
31
|
-
* The highlighted cell in the selection range. If there are several selections, only one selection would have a primary cell.
|
|
32
|
-
*/
|
|
33
|
-
primary: Nullable<ISelectionCell>;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Selection range Info, contains selectionrange & primaryrange
|
|
37
|
-
* primaryrange is the range of the highlighted cell.
|
|
38
|
-
*/
|
|
39
|
-
export interface ISelectionWithCoord {
|
|
40
|
-
rangeWithCoord: IRangeWithCoord;
|
|
41
|
-
primaryWithCoord: Nullable<ISelectionCellWithMergeInfo>;
|
|
42
|
-
}
|
|
43
|
-
export interface ITextRangeStart {
|
|
44
|
-
startOffset: number;
|
|
45
|
-
}
|
|
46
|
-
export interface ITextRange extends ITextRangeStart {
|
|
47
|
-
endOffset: number;
|
|
48
|
-
collapsed: boolean;
|
|
49
|
-
}
|
|
50
|
-
export interface ITextRangeParam extends ITextRange {
|
|
51
|
-
segmentId?: string;
|
|
52
|
-
segmentPage?: number;
|
|
53
|
-
isActive?: boolean;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Determines whether the cell(row, column) is within the range of the merged cells.
|
|
57
|
-
*/
|
|
58
|
-
export declare function getCellInfoInMergeData(row: number, column: number, mergeData?: IRange[]): ISelectionCell;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { LogLevel } from '../../services/log/log.service';
|
|
2
|
-
import { DependencyOverride } from '../../services/plugin/plugin-override';
|
|
3
|
-
import { IStyleSheet } from '../../services/theme/theme.service';
|
|
4
|
-
import { ILocales } from '../../shared/locale';
|
|
5
|
-
import { LocaleType } from '../enum';
|
|
6
|
-
export interface IUniverData {
|
|
7
|
-
theme: IStyleSheet;
|
|
8
|
-
locale: LocaleType;
|
|
9
|
-
locales: ILocales;
|
|
10
|
-
logLevel: LogLevel;
|
|
11
|
-
id: string;
|
|
12
|
-
override?: DependencyOverride;
|
|
13
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { IKeyType, Nullable } from '../../shared/types';
|
|
2
|
-
import { LocaleType } from '../enum';
|
|
3
|
-
import { IExtraModelData } from './i-extra-model-data';
|
|
4
|
-
import { IStyleData } from './i-style-data';
|
|
5
|
-
import { IWorksheetData } from './i-worksheet-data';
|
|
6
|
-
export type Resources = Array<{
|
|
7
|
-
id?: string;
|
|
8
|
-
name: string;
|
|
9
|
-
data: string;
|
|
10
|
-
}>;
|
|
11
|
-
/**
|
|
12
|
-
* Properties of a workbook's configuration
|
|
13
|
-
*/
|
|
14
|
-
export interface IWorkbookData extends IExtraModelData {
|
|
15
|
-
/**
|
|
16
|
-
* unit id
|
|
17
|
-
*/
|
|
18
|
-
id: string;
|
|
19
|
-
/**
|
|
20
|
-
* Revision of this spreadsheet. Would be used in collaborated editing. Starts from one.
|
|
21
|
-
*/
|
|
22
|
-
rev?: number;
|
|
23
|
-
/**
|
|
24
|
-
* Name of the spreadsheet.
|
|
25
|
-
*/
|
|
26
|
-
name: string;
|
|
27
|
-
/**
|
|
28
|
-
* Version of Univer model definition.
|
|
29
|
-
*/
|
|
30
|
-
appVersion: string;
|
|
31
|
-
locale: LocaleType;
|
|
32
|
-
/** Style reference. */
|
|
33
|
-
styles: IKeyType<Nullable<IStyleData>>;
|
|
34
|
-
sheetOrder: string[];
|
|
35
|
-
sheets: {
|
|
36
|
-
[sheetId: string]: Partial<IWorksheetData>;
|
|
37
|
-
};
|
|
38
|
-
resources?: Resources;
|
|
39
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { IObjectArrayPrimitiveType, IObjectMatrixPrimitiveType } from '../../shared/object-matrix';
|
|
2
|
-
import { BooleanNumber } from '../enum';
|
|
3
|
-
import { ICellData } from './i-cell-data';
|
|
4
|
-
import { IColumnData } from './i-column-data';
|
|
5
|
-
import { IFreeze } from './i-freeze';
|
|
6
|
-
import { IRange, IRangeType } from './i-range';
|
|
7
|
-
import { IRowData } from './i-row-data';
|
|
8
|
-
/**
|
|
9
|
-
* Snapshot of a worksheet.
|
|
10
|
-
*/
|
|
11
|
-
export interface IWorksheetData {
|
|
12
|
-
/**
|
|
13
|
-
* Id of the worksheet. This should be unique and immutable across the lifecycle of the worksheet.
|
|
14
|
-
*/
|
|
15
|
-
id: string;
|
|
16
|
-
/** Name of the sheet. */
|
|
17
|
-
name: string;
|
|
18
|
-
tabColor: string;
|
|
19
|
-
/**
|
|
20
|
-
* Determine whether the sheet is hidden.
|
|
21
|
-
*
|
|
22
|
-
* @remarks
|
|
23
|
-
* See {@link BooleanNumber| the BooleanNumber enum} for more details.
|
|
24
|
-
*
|
|
25
|
-
* @defaultValue `BooleanNumber.FALSE`
|
|
26
|
-
*/
|
|
27
|
-
hidden: BooleanNumber;
|
|
28
|
-
freeze: IFreeze;
|
|
29
|
-
rowCount: number;
|
|
30
|
-
columnCount: number;
|
|
31
|
-
zoomRatio: number;
|
|
32
|
-
scrollTop: number;
|
|
33
|
-
scrollLeft: number;
|
|
34
|
-
defaultColumnWidth: number;
|
|
35
|
-
defaultRowHeight: number;
|
|
36
|
-
/** All merged cells in this worksheet. */
|
|
37
|
-
mergeData: IRange[];
|
|
38
|
-
/** A matrix storing cell contents by row and column index. */
|
|
39
|
-
cellData: IObjectMatrixPrimitiveType<ICellData>;
|
|
40
|
-
rowData: IObjectArrayPrimitiveType<Partial<IRowData>>;
|
|
41
|
-
columnData: IObjectArrayPrimitiveType<Partial<IColumnData>>;
|
|
42
|
-
rowHeader: {
|
|
43
|
-
width: number;
|
|
44
|
-
hidden?: BooleanNumber;
|
|
45
|
-
};
|
|
46
|
-
columnHeader: {
|
|
47
|
-
height: number;
|
|
48
|
-
hidden?: BooleanNumber;
|
|
49
|
-
};
|
|
50
|
-
showGridlines: BooleanNumber;
|
|
51
|
-
/** @deprecated */
|
|
52
|
-
selections: IRangeType[];
|
|
53
|
-
rightToLeft: BooleanNumber;
|
|
54
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023-present DreamNum Inc.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export interface IWorksheetOrderData {
|
|
17
|
-
}
|
|
File without changes
|