@univerjs/core 0.1.4 → 0.1.6
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/README.md +22 -0
- package/lib/cjs/index.js +8 -8
- package/lib/es/index.js +3059 -2952
- package/lib/types/basics/plugin-holder.d.ts +5 -19
- package/lib/types/basics/univer-doc.d.ts +5 -19
- package/lib/types/basics/univer-sheet.d.ts +5 -20
- package/lib/types/basics/univer-slide.d.ts +5 -19
- package/lib/types/basics/univer.d.ts +9 -23
- package/lib/types/common/equal.d.ts +20 -0
- package/lib/types/common/interceptor.d.ts +2 -16
- package/lib/types/docs/data-model/action-types.d.ts +3 -17
- package/lib/types/docs/data-model/apply-utils/common.d.ts +2 -16
- package/lib/types/docs/data-model/apply-utils/delete-apply.d.ts +2 -16
- package/lib/types/docs/data-model/apply-utils/insert-apply.d.ts +2 -16
- package/lib/types/docs/data-model/apply-utils/update-apply.d.ts +2 -16
- package/lib/types/docs/data-model/document-data-model.d.ts +8 -22
- package/lib/types/docs/data-model/empty-snapshot.d.ts +2 -16
- package/lib/types/docs/data-model/preset-list-type.d.ts +1 -15
- package/lib/types/docs/data-model/replacement.d.ts +2 -16
- package/lib/types/docs/data-model/text-x/action-iterator.d.ts +2 -17
- package/lib/types/docs/data-model/text-x/text-x.d.ts +4 -18
- package/lib/types/docs/data-model/text-x/utils.d.ts +3 -17
- package/lib/types/index.d.ts +11 -1
- package/lib/types/observer/observable-hooks.d.ts +3 -18
- package/lib/types/observer/observable.d.ts +2 -16
- package/lib/types/plugin/plugin.d.ts +2 -16
- package/lib/types/services/command/command.service.d.ts +6 -21
- package/lib/types/services/config/config.service.d.ts +3 -17
- package/lib/types/services/context/context.service.d.ts +3 -17
- package/lib/types/services/error/error.service.d.ts +2 -16
- package/lib/types/services/floating-object/floating-object-manager.service.d.ts +6 -20
- package/lib/types/services/instance/instance.service.d.ts +9 -23
- package/lib/types/services/lifecycle/lifecycle.d.ts +33 -17
- package/lib/types/services/lifecycle/lifecycle.service.d.ts +5 -19
- package/lib/types/services/local-storage/local-storage.service.d.ts +1 -1
- package/lib/types/services/locale/locale.service.d.ts +5 -18
- package/lib/types/services/log/log.service.d.ts +2 -16
- package/lib/types/services/permission/permission-point.d.ts +1 -15
- package/lib/types/services/permission/permission.service.d.ts +6 -21
- package/lib/types/services/permission/univer.permission.service.d.ts +3 -17
- package/lib/types/services/resource-manager/resource-manager.service.d.ts +4 -18
- package/lib/types/services/resource-manager/type.d.ts +7 -21
- package/lib/types/services/snapshot/__tests__/snapshot-mock.d.ts +5 -19
- package/lib/types/services/snapshot/snapshot-server.service.d.ts +4 -18
- package/lib/types/services/snapshot/snapshot-transform.d.ts +6 -20
- package/lib/types/services/snapshot/snapshot-utils.d.ts +7 -21
- package/lib/types/services/theme/theme.service.d.ts +2 -16
- package/lib/types/services/undoredo/undoredo.service.d.ts +18 -24
- package/lib/types/shared/__test__/common.spec.d.ts +16 -0
- package/lib/types/shared/color/color.d.ts +2 -16
- package/lib/types/shared/common.d.ts +15 -22
- package/lib/types/shared/compare.d.ts +2 -16
- package/lib/types/shared/doc-tool.d.ts +2 -16
- package/lib/types/shared/index.d.ts +1 -0
- package/lib/types/shared/lifecycle.d.ts +5 -20
- package/lib/types/shared/lru/lru-map.d.ts +2 -16
- package/lib/types/shared/object-matrix-query.d.ts +4 -0
- package/lib/types/shared/object-matrix.d.ts +5 -18
- package/lib/types/shared/props-from.d.ts +2 -16
- package/lib/types/shared/rectangle.d.ts +4 -18
- package/lib/types/shared/ref-alias.d.ts +8 -1
- package/lib/types/shared/rxjs.d.ts +2 -16
- package/lib/types/shared/tools.d.ts +4 -16
- package/lib/types/sheets/__tests__/create-core-test-bed.d.ts +9 -23
- package/lib/types/sheets/column-manager.d.ts +4 -18
- package/lib/types/sheets/empty-snapshot.d.ts +4 -0
- package/lib/types/sheets/range.d.ts +6 -22
- package/lib/types/sheets/row-manager.d.ts +4 -18
- package/lib/types/sheets/sheet-snapshot-utils.d.ts +2 -16
- package/lib/types/sheets/styles.d.ts +3 -17
- package/lib/types/sheets/view-model.d.ts +10 -24
- package/lib/types/sheets/workbook.d.ts +9 -23
- package/lib/types/sheets/worksheet.d.ts +8 -23
- package/lib/types/slides/domain/slide-model.d.ts +5 -19
- package/lib/types/types/const/const.d.ts +1 -20
- package/lib/types/types/enum/data-validation-error-style.d.ts +20 -0
- package/lib/types/types/enum/data-validation-ime-mode.d.ts +28 -0
- package/lib/types/types/enum/data-validation-operator.d.ts +25 -0
- package/lib/types/types/enum/data-validation-render-mode.d.ts +20 -0
- package/lib/types/types/enum/data-validation-status.d.ts +20 -0
- package/lib/types/types/enum/data-validation-type.d.ts +36 -0
- package/lib/types/types/enum/interpolation-point-type.d.ts +3 -3
- package/lib/types/types/interfaces/i-cell-custom-render.d.ts +28 -0
- package/lib/types/types/interfaces/i-cell-data.d.ts +20 -18
- package/lib/types/types/interfaces/i-cell-validation-data.d.ts +9 -0
- package/lib/types/types/interfaces/i-column-data.d.ts +2 -16
- package/lib/types/types/interfaces/i-data-validation.d.ts +44 -0
- package/lib/types/types/interfaces/i-document-data.d.ts +5 -19
- package/lib/types/types/interfaces/i-placeholder.d.ts +2 -16
- package/lib/types/types/interfaces/i-row-data.d.ts +2 -16
- package/lib/types/types/interfaces/i-selection-data.d.ts +3 -17
- package/lib/types/types/interfaces/i-shape-properties.d.ts +3 -17
- package/lib/types/types/interfaces/i-slide-data.d.ts +12 -26
- package/lib/types/types/interfaces/i-style-data.d.ts +5 -19
- package/lib/types/types/interfaces/i-univer-data.d.ts +5 -19
- package/lib/types/types/interfaces/i-workbook-data.d.ts +6 -20
- package/lib/types/types/interfaces/i-worksheet-data.d.ts +8 -22
- package/lib/umd/index.js +8 -8
- package/package.json +6 -7
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
import type { IKeyType, Nullable } from '../shared';
|
|
17
|
-
import type { ICellDataForSheetInterceptor, IStyleData } from '../types/interfaces';
|
|
1
|
+
import { ICellDataForSheetInterceptor, IStyleData } from '../types/interfaces';
|
|
2
|
+
import { IKeyType, Nullable } from '../shared';
|
|
3
|
+
|
|
18
4
|
/**
|
|
19
5
|
* Styles in a workbook, cells locate styles based on style IDs
|
|
20
6
|
*
|
|
@@ -1,24 +1,10 @@
|
|
|
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
|
-
import type { IDisposable } from '@wendellhu/redi';
|
|
17
|
-
import type { Nullable } from '../common/type-utils';
|
|
1
|
+
import { ICellDataForSheetInterceptor } from '../types/interfaces/i-cell-data';
|
|
18
2
|
import { Disposable } from '../shared/lifecycle';
|
|
19
|
-
import
|
|
3
|
+
import { Nullable } from '../common/type-utils';
|
|
4
|
+
import { IDisposable } from '@wendellhu/redi';
|
|
5
|
+
|
|
20
6
|
export interface ICellContentInterceptor {
|
|
21
|
-
getCell(row: number, col: number)
|
|
7
|
+
getCell: (row: number, col: number) => Nullable<ICellDataForSheetInterceptor>;
|
|
22
8
|
}
|
|
23
9
|
export interface IRowFilteredInterceptor {
|
|
24
10
|
}
|
|
@@ -27,11 +13,11 @@ export interface IRowVisibleInterceptor {
|
|
|
27
13
|
export interface IColVisibleInterceptor {
|
|
28
14
|
}
|
|
29
15
|
export interface ISheetViewModel {
|
|
30
|
-
registerCellContentInterceptor(interceptor: ICellContentInterceptor)
|
|
31
|
-
registerRowFilteredInterceptor(interceptor: IRowFilteredInterceptor)
|
|
32
|
-
registerRowVisibleInterceptor(interceptor: IRowVisibleInterceptor)
|
|
33
|
-
registerColVisibleInterceptor(interceptor: IColVisibleInterceptor)
|
|
34
|
-
getCell(row: number, col: number)
|
|
16
|
+
registerCellContentInterceptor: (interceptor: ICellContentInterceptor) => IDisposable;
|
|
17
|
+
registerRowFilteredInterceptor: (interceptor: IRowFilteredInterceptor) => IDisposable;
|
|
18
|
+
registerRowVisibleInterceptor: (interceptor: IRowVisibleInterceptor) => IDisposable;
|
|
19
|
+
registerColVisibleInterceptor: (interceptor: IColVisibleInterceptor) => IDisposable;
|
|
20
|
+
getCell: (row: number, col: number) => Nullable<ICellDataForSheetInterceptor>;
|
|
35
21
|
}
|
|
36
22
|
/**
|
|
37
23
|
* SheetViewModel
|
|
@@ -1,24 +1,10 @@
|
|
|
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
|
-
import { ILogService } from '../services/log/log.service';
|
|
17
|
-
import type { Nullable } from '../shared';
|
|
18
|
-
import { Disposable } from '../shared/lifecycle';
|
|
19
|
-
import type { IGridRange, IRangeType, IWorkbookData, IWorksheetData } from '../types/interfaces';
|
|
20
|
-
import { Styles } from './styles';
|
|
21
1
|
import { Worksheet } from './worksheet';
|
|
2
|
+
import { Styles } from './styles';
|
|
3
|
+
import { IGridRange, IRangeType, IWorkbookData, IWorksheetData } from '../types/interfaces';
|
|
4
|
+
import { Disposable } from '../shared/lifecycle';
|
|
5
|
+
import { Nullable } from '../shared';
|
|
6
|
+
import { ILogService } from '../services/log/log.service';
|
|
7
|
+
|
|
22
8
|
export declare function getWorksheetUID(workbook: Workbook, worksheet: Worksheet): string;
|
|
23
9
|
/**
|
|
24
10
|
* Access and create Univer Sheets files
|
|
@@ -26,12 +12,12 @@ export declare function getWorksheetUID(workbook: Workbook, worksheet: Worksheet
|
|
|
26
12
|
export declare class Workbook extends Disposable {
|
|
27
13
|
private readonly _logService;
|
|
28
14
|
private readonly _sheetCreated$;
|
|
29
|
-
readonly sheetCreated$: import(
|
|
15
|
+
readonly sheetCreated$: import('rxjs').Observable<Worksheet>;
|
|
30
16
|
private readonly _sheetDisposed$;
|
|
31
|
-
readonly sheetDisposed$: import(
|
|
17
|
+
readonly sheetDisposed$: import('rxjs').Observable<Worksheet>;
|
|
32
18
|
private readonly _activeSheet$;
|
|
33
19
|
private get _activeSheet();
|
|
34
|
-
readonly activeSheet$: import(
|
|
20
|
+
readonly activeSheet$: import('rxjs').Observable<Nullable<Worksheet>>;
|
|
35
21
|
/**
|
|
36
22
|
* sheets list
|
|
37
23
|
* @private
|
|
@@ -1,27 +1,12 @@
|
|
|
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
|
-
import type { Nullable } from '../shared';
|
|
17
|
-
import { ObjectMatrix } from '../shared';
|
|
18
|
-
import type { BooleanNumber } from '../types/enum';
|
|
19
|
-
import type { ICellData, ICellDataForSheetInterceptor, IFreeze, IRange, IWorksheetData } from '../types/interfaces';
|
|
20
|
-
import { ColumnManager } from './column-manager';
|
|
21
|
-
import { Range } from './range';
|
|
22
|
-
import { RowManager } from './row-manager';
|
|
23
|
-
import type { Styles } from './styles';
|
|
24
1
|
import { SheetViewModel } from './view-model';
|
|
2
|
+
import { Styles } from './styles';
|
|
3
|
+
import { RowManager } from './row-manager';
|
|
4
|
+
import { Range } from './range';
|
|
5
|
+
import { ColumnManager } from './column-manager';
|
|
6
|
+
import { ICellData, ICellDataForSheetInterceptor, IFreeze, IRange, IWorksheetData } from '../types/interfaces';
|
|
7
|
+
import { BooleanNumber } from '../types/enum';
|
|
8
|
+
import { Nullable, ObjectMatrix } from '../shared';
|
|
9
|
+
|
|
25
10
|
/**
|
|
26
11
|
* The model of a Worksheet.
|
|
27
12
|
*/
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
import type { ISlideData, ISlidePage } from '../../types/interfaces';
|
|
1
|
+
import { ISlideData, ISlidePage } from '../../types/interfaces';
|
|
2
|
+
|
|
17
3
|
export declare class SlideDataModel {
|
|
18
4
|
private _snapshot;
|
|
19
5
|
private _unitId;
|
|
@@ -28,9 +14,9 @@ export declare class SlideDataModel {
|
|
|
28
14
|
getPageOrder(): string[] | undefined;
|
|
29
15
|
getPage(pageId: string): ISlidePage | undefined;
|
|
30
16
|
getElementsByPage(pageId: string): {
|
|
31
|
-
[elementId: string]: import(
|
|
17
|
+
[elementId: string]: import('../../types/interfaces').IPageElement;
|
|
32
18
|
} | undefined;
|
|
33
|
-
getElement(pageId: string, elementId: string): import(
|
|
34
|
-
getPageSize(): import(
|
|
19
|
+
getElement(pageId: string, elementId: string): import('../../types/interfaces').IPageElement | undefined;
|
|
20
|
+
getPageSize(): import('../..').ISize;
|
|
35
21
|
addPage(): ISlidePage;
|
|
36
22
|
}
|
|
@@ -1,20 +1,5 @@
|
|
|
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
1
|
import { BooleanNumber, HorizontalAlign, TextDirection, VerticalAlign, WrapStrategy } from '../enum';
|
|
17
|
-
|
|
2
|
+
|
|
18
3
|
/**
|
|
19
4
|
* Used as an illegal range array return value
|
|
20
5
|
*/
|
|
@@ -52,10 +37,6 @@ export declare const DEFAULT_CELL: {
|
|
|
52
37
|
row: number;
|
|
53
38
|
column: number;
|
|
54
39
|
};
|
|
55
|
-
/**
|
|
56
|
-
* Used as an init workbook return value
|
|
57
|
-
*/
|
|
58
|
-
export declare const DEFAULT_WORKBOOK: IWorkbookData;
|
|
59
40
|
/**
|
|
60
41
|
* Default styles.
|
|
61
42
|
*/
|
|
@@ -0,0 +1,20 @@
|
|
|
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 DataValidationErrorStyle {
|
|
17
|
+
INFO = 0,
|
|
18
|
+
STOP = 1,
|
|
19
|
+
WARNING = 2
|
|
20
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 DataValidationImeMode {
|
|
17
|
+
DISABLED = 0,
|
|
18
|
+
FULL_ALPHA = 1,
|
|
19
|
+
FULL_HANGUL = 2,
|
|
20
|
+
FULL_KATAKANA = 3,
|
|
21
|
+
HALF_ALPHA = 4,
|
|
22
|
+
HALF_HANGUL = 5,
|
|
23
|
+
HALF_KATAKANA = 6,
|
|
24
|
+
HIRAGANA = 7,
|
|
25
|
+
NO_CONTROL = 8,
|
|
26
|
+
OFF = 9,
|
|
27
|
+
ON = 10
|
|
28
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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 DataValidationOperator {
|
|
17
|
+
BETWEEN = "between",
|
|
18
|
+
EQUAL = "equal",
|
|
19
|
+
GREATER_THAN = "greaterThan",
|
|
20
|
+
GREATER_THAN_OR_EQUAL = "greaterThanOrEqual",
|
|
21
|
+
LESS_THAN = "lessThan",
|
|
22
|
+
LESS_THAN_OR_EQUAL = "lessThanOrEqual",
|
|
23
|
+
NOT_BETWEEN = "notBetween",
|
|
24
|
+
NOT_EQUAL = "notEqual"
|
|
25
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 DataValidationRenderMode {
|
|
17
|
+
TEXT = 0,
|
|
18
|
+
ARROW = 1,
|
|
19
|
+
CUSTOM = 2
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 DataValidationStatus {
|
|
17
|
+
VALID = "valid",
|
|
18
|
+
INVALID = "invalid",
|
|
19
|
+
VALIDATING = "validating"
|
|
20
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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 DataValidationType {
|
|
17
|
+
/**
|
|
18
|
+
* custom formula
|
|
19
|
+
*/
|
|
20
|
+
CUSTOM = "custom",
|
|
21
|
+
LIST = "list",
|
|
22
|
+
LIST_MULTIPLE = "listMultiple",
|
|
23
|
+
NONE = "none",
|
|
24
|
+
TEXT_LENGTH = "textLength",
|
|
25
|
+
DATE = "date",
|
|
26
|
+
TIME = "time",
|
|
27
|
+
/**
|
|
28
|
+
* integer number
|
|
29
|
+
*/
|
|
30
|
+
WHOLE = "whole",
|
|
31
|
+
/**
|
|
32
|
+
* decimal number
|
|
33
|
+
*/
|
|
34
|
+
DECIMAL = "decimal",
|
|
35
|
+
CHECKBOX = "checkbox"
|
|
36
|
+
}
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
export declare enum InterpolationPointType {
|
|
17
17
|
INTERPOLATION_POINT_TYPE_UNSPECIFIED = 0,// The default value, do not use.
|
|
18
|
-
MIN = 1,// The interpolation point uses the minimum value in the cells over the range of the conditional
|
|
19
|
-
MAX = 2,// The interpolation point uses the maximum value in the cells over the range of the conditional
|
|
18
|
+
MIN = 1,// The interpolation point uses the minimum value in the cells over the range of the conditional formatting.
|
|
19
|
+
MAX = 2,// The interpolation point uses the maximum value in the cells over the range of the conditional formatting.
|
|
20
20
|
NUMBER = 3,// The interpolation point uses exactly the value in InterpolationPoint.value
|
|
21
|
-
PERCENT = 4,// The interpolation point is the given percentage over all the cells in the range of the conditional
|
|
21
|
+
PERCENT = 4,// The interpolation point is the given percentage over all the cells in the range of the conditional formatting. This is equivalent to NUMBER if the value was: =(MAX(FLATTEN(range)) * (value / 100)) + (MIN(FLATTEN(range)) * (1 - (value / 100))) (where errors in the range are ignored when flattening).
|
|
22
22
|
PERCENTILE = 5
|
|
23
23
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ICellDataForSheetInterceptor } from './i-cell-data';
|
|
2
|
+
import { IStyleData } from './i-style-data';
|
|
3
|
+
import { ISelectionCellWithCoord } from './i-selection-data';
|
|
4
|
+
import { Nullable } from '../../shared';
|
|
5
|
+
|
|
6
|
+
export interface ICellRenderContext {
|
|
7
|
+
data: ICellDataForSheetInterceptor;
|
|
8
|
+
style: Nullable<IStyleData>;
|
|
9
|
+
primaryWithCoord: ISelectionCellWithCoord;
|
|
10
|
+
unitId?: string;
|
|
11
|
+
subUnitId: string;
|
|
12
|
+
row: number;
|
|
13
|
+
col: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @debt This shouldn't exist in core package.
|
|
17
|
+
*/
|
|
18
|
+
export interface ICellCustomRender {
|
|
19
|
+
drawWith(ctx: CanvasRenderingContext2D, info: ICellRenderContext, skeleton: any, spreadsheets: any): void;
|
|
20
|
+
zIndex?: number;
|
|
21
|
+
isHit?: (position: {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
}, info: ICellRenderContext) => boolean;
|
|
25
|
+
onPointerDown?: (info: ICellRenderContext, evt: any) => void;
|
|
26
|
+
onPointerEnter?: (info: ICellRenderContext, evt: any) => void;
|
|
27
|
+
onPointerLeave?: (info: ICellRenderContext, evt: any) => void;
|
|
28
|
+
}
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
import type { Nullable } from '../../shared/types';
|
|
1
|
+
import { ICellValidationData } from './i-cell-validation-data';
|
|
2
|
+
import { IStyleData } from './i-style-data';
|
|
3
|
+
import { IDocumentData } from './i-document-data';
|
|
4
|
+
import { ICellCustomRender } from './i-cell-custom-render';
|
|
17
5
|
import { CellValueType } from '../enum/text-style';
|
|
18
|
-
import
|
|
19
|
-
|
|
6
|
+
import { Nullable } from '../../shared/types';
|
|
7
|
+
|
|
20
8
|
/**
|
|
21
9
|
* Cell value type
|
|
22
10
|
*/
|
|
@@ -46,9 +34,23 @@ export interface ICellData {
|
|
|
46
34
|
*/
|
|
47
35
|
si?: Nullable<string>;
|
|
48
36
|
}
|
|
37
|
+
export interface ICellMarksStyle {
|
|
38
|
+
color: string;
|
|
39
|
+
size: number;
|
|
40
|
+
}
|
|
41
|
+
export interface ICellMarks {
|
|
42
|
+
tl?: ICellMarksStyle;
|
|
43
|
+
tr?: ICellMarksStyle;
|
|
44
|
+
bl?: ICellMarksStyle;
|
|
45
|
+
br?: ICellMarksStyle;
|
|
46
|
+
}
|
|
49
47
|
export interface ICellDataForSheetInterceptor extends ICellData {
|
|
50
48
|
interceptorStyle?: Nullable<IStyleData>;
|
|
51
49
|
isInArrayFormulaRange?: Nullable<boolean>;
|
|
50
|
+
dataValidation?: Nullable<ICellValidationData>;
|
|
51
|
+
markers?: ICellMarks;
|
|
52
|
+
customRender?: Nullable<ICellCustomRender[]>;
|
|
53
|
+
interceptorAutoHeight?: number;
|
|
52
54
|
}
|
|
53
55
|
export declare function isICellData(value: any): value is ICellData;
|
|
54
56
|
export declare function getCellValueType(cell: ICellData): CellValueType | null | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IDataValidationRule } from './i-data-validation';
|
|
2
|
+
import { DataValidationStatus } from '../enum/data-validation-status';
|
|
3
|
+
|
|
4
|
+
export interface ICellValidationData {
|
|
5
|
+
ruleId: string;
|
|
6
|
+
validStatus: DataValidationStatus;
|
|
7
|
+
rule: IDataValidationRule;
|
|
8
|
+
validator: any;
|
|
9
|
+
}
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
import type { BooleanNumber } from '../enum';
|
|
1
|
+
import { BooleanNumber } from '../enum';
|
|
2
|
+
|
|
17
3
|
/**
|
|
18
4
|
* Properties of column data
|
|
19
5
|
*/
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IRange } from './i-range';
|
|
2
|
+
import { DataValidationRenderMode } from '../enum/data-validation-render-mode';
|
|
3
|
+
import { DataValidationErrorStyle } from '../enum/data-validation-error-style';
|
|
4
|
+
import { DataValidationImeMode } from '../enum/data-validation-ime-mode';
|
|
5
|
+
import { DataValidationType } from '../enum/data-validation-type';
|
|
6
|
+
import { DataValidationOperator } from '../enum/data-validation-operator';
|
|
7
|
+
|
|
8
|
+
export interface IDataValidationRuleBase {
|
|
9
|
+
type: DataValidationType;
|
|
10
|
+
allowBlank?: boolean;
|
|
11
|
+
formula1?: string;
|
|
12
|
+
formula2?: string;
|
|
13
|
+
operator?: DataValidationOperator;
|
|
14
|
+
}
|
|
15
|
+
export interface IDataValidationRuleOptions {
|
|
16
|
+
error?: string;
|
|
17
|
+
errorStyle?: DataValidationErrorStyle;
|
|
18
|
+
errorTitle?: string;
|
|
19
|
+
imeMode?: DataValidationImeMode;
|
|
20
|
+
prompt?: string;
|
|
21
|
+
promptTitle?: string;
|
|
22
|
+
showDropDown?: boolean;
|
|
23
|
+
showErrorMessage?: boolean;
|
|
24
|
+
showInputMessage?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* cell render mode of data validation
|
|
27
|
+
*/
|
|
28
|
+
renderMode?: DataValidationRenderMode;
|
|
29
|
+
}
|
|
30
|
+
export interface IDataValidationRule extends IDataValidationRuleBase, IDataValidationRuleOptions {
|
|
31
|
+
uid: string;
|
|
32
|
+
/**
|
|
33
|
+
* @debt should using specific type cover sheet、doc、slide range type
|
|
34
|
+
*/
|
|
35
|
+
ranges: any;
|
|
36
|
+
}
|
|
37
|
+
export interface ISheetDataValidationRule extends IDataValidationRule {
|
|
38
|
+
ranges: IRange[];
|
|
39
|
+
}
|
|
40
|
+
export interface IDataValidationRuleInfo {
|
|
41
|
+
rule: IDataValidationRule;
|
|
42
|
+
unitId: string;
|
|
43
|
+
subUnitId: string;
|
|
44
|
+
}
|
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
import type { ISize } from '../../services/floating-object/floating-object-interfaces';
|
|
17
|
-
import type { BooleanNumber, CellValueType, HorizontalAlign, LocaleType, TextDirection, VerticalAlign, WrapStrategy } from '../enum';
|
|
18
|
-
import type { IExtraModelData } from './i-extra-model-data';
|
|
19
|
-
import type { IColorStyle, IStyleBase } from './i-style-data';
|
|
1
|
+
import { IColorStyle, IStyleBase } from './i-style-data';
|
|
2
|
+
import { IExtraModelData } from './i-extra-model-data';
|
|
3
|
+
import { BooleanNumber, CellValueType, HorizontalAlign, LocaleType, TextDirection, VerticalAlign, WrapStrategy } from '../enum';
|
|
4
|
+
import { ISize } from '../../services/floating-object/floating-object-interfaces';
|
|
5
|
+
|
|
20
6
|
/**
|
|
21
7
|
* Properties of document
|
|
22
8
|
*/
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
import type { PlaceholderType } from '../enum/place-holder-type';
|
|
1
|
+
import { PlaceholderType } from '../enum/place-holder-type';
|
|
2
|
+
|
|
17
3
|
export interface IPlaceholder {
|
|
18
4
|
type: PlaceholderType;
|
|
19
5
|
index: number;
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
import type { BooleanNumber } from '../enum';
|
|
1
|
+
import { BooleanNumber } from '../enum';
|
|
2
|
+
|
|
17
3
|
/**
|
|
18
4
|
* Properties of row data
|
|
19
5
|
*/
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
import type { Nullable } from '../../shared/types';
|
|
17
|
-
import type { IRange } from './i-range';
|
|
1
|
+
import { IRange } from './i-range';
|
|
2
|
+
import { Nullable } from '../../shared/types';
|
|
3
|
+
|
|
18
4
|
/**
|
|
19
5
|
* Properties of selection data
|
|
20
6
|
*/
|