@univerjs-pro/bases 1.0.0-alpha.2 → 1.0.0-alpha.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/README.md +8 -5
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ar-SA.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/de-DE.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.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/id-ID.js +1 -1
- package/lib/cjs/locale/it-IT.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/pl-PL.js +1 -1
- package/lib/cjs/locale/pt-BR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.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-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ar-SA.js +1 -1
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/de-DE.js +1 -1
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/id-ID.js +1 -1
- package/lib/es/locale/it-IT.js +1 -1
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/pl-PL.js +1 -1
- package/lib/es/locale/pt-BR.js +1 -1
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/ar-SA.js +1 -1
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/de-DE.js +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/id-ID.js +1 -1
- package/lib/locale/it-IT.js +1 -1
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/pl-PL.js +1 -1
- package/lib/locale/pt-BR.js +1 -1
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/types/commands/commands/set-base-name.command.d.ts +6 -0
- package/lib/types/commands/commands/set-base-view-filter.command.d.ts +2 -2
- package/lib/types/commands/commands/set-base-view-group.command.d.ts +2 -2
- package/lib/types/commands/commands/set-base-view-sort.command.d.ts +2 -2
- package/lib/types/commands/utils/base-validation.d.ts +6 -0
- package/lib/types/config/config.d.ts +1 -0
- package/lib/types/controllers/base-active-dirty.controller.d.ts +5 -6
- package/lib/types/controllers/base-formula-calculation.controller.d.ts +8 -14
- package/lib/types/embed-host-anchor.d.ts +46 -0
- package/lib/types/facade/f-base.d.ts +126 -577
- package/lib/types/facade/f-enum.d.ts +117 -89
- package/lib/types/facade/f-event.d.ts +240 -132
- package/lib/types/facade/f-field.d.ts +137 -313
- package/lib/types/facade/f-range.d.ts +86 -326
- package/lib/types/facade/f-record.d.ts +93 -216
- package/lib/types/facade/f-table.d.ts +473 -1317
- package/lib/types/facade/f-types.d.ts +1 -0
- package/lib/types/facade/f-univer.d.ts +27 -154
- package/lib/types/facade/f-view.d.ts +207 -484
- package/lib/types/facade/field-key.d.ts +6 -6
- package/lib/types/facade/index.d.ts +10 -20
- package/lib/types/fields/field-core-plugin.d.ts +9 -8
- package/lib/types/index.d.ts +12 -8
- package/lib/types/models/base-cell-data.d.ts +6 -6
- package/lib/types/models/default-table.d.ts +13 -0
- package/lib/types/ot/json1-adapter.d.ts +3 -3
- package/lib/types/ot/json1-invalidation.d.ts +2 -2
- package/lib/types/ot/json1-op-applier.d.ts +2 -2
- package/lib/types/ot/json1-op-factory.d.ts +11 -8
- package/lib/types/plugin.d.ts +0 -1
- package/lib/types/search/base-search.d.ts +4 -3
- package/lib/types/services/base-active-dirty.service.d.ts +2 -2
- package/lib/types/services/base-command.service.d.ts +16 -16
- package/lib/types/services/base-compression.service.d.ts +3 -3
- package/lib/types/services/base-field-registry.service.d.ts +5 -5
- package/lib/types/services/base-formula.service.d.ts +11 -23
- package/lib/types/services/base-view-registry.service.d.ts +3 -3
- package/lib/types/views/view-core-plugin.d.ts +4 -3
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.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/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.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-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +7 -8
- package/lib/types/controllers/base-remote-formula.controller.d.ts +0 -13
- package/lib/types/facade/f-error.d.ts +0 -30
- package/lib/types/facade/f-permission.d.ts +0 -749
- package/lib/types/facade/transaction.d.ts +0 -19
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { BaseCellValue, ITableSnapshot } from '@univerjs/core';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
export declare enum BaseFieldKeyEnum {
|
|
3
|
+
Id = "id",
|
|
4
|
+
Name = "name",
|
|
5
|
+
Auto = "auto"
|
|
6
6
|
}
|
|
7
|
-
export declare function resolveBaseFieldValues(table: ITableSnapshot, values: Record<string, BaseCellValue> | undefined, fieldKey?:
|
|
8
|
-
export declare function resolveBaseFieldKey(table: ITableSnapshot, key: string, fieldKey:
|
|
7
|
+
export declare function resolveBaseFieldValues(table: ITableSnapshot, values: Record<string, BaseCellValue> | undefined, fieldKey?: BaseFieldKeyEnum): Record<string, BaseCellValue>;
|
|
8
|
+
export declare function resolveBaseFieldKey(table: ITableSnapshot, key: string, fieldKey: BaseFieldKeyEnum): string;
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
+
import './f-univer';
|
|
1
2
|
import './f-enum';
|
|
2
3
|
export { FBase } from './f-base';
|
|
3
|
-
export type { IBaseSchemaSnapshot
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export {
|
|
7
|
-
export
|
|
8
|
-
export {
|
|
9
|
-
export type {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export { FBaseRange } from './f-range';
|
|
13
|
-
export type { BaseRangeValues } from './f-range';
|
|
14
|
-
export { FRecord } from './f-record';
|
|
15
|
-
export { FTable } from './f-table';
|
|
16
|
-
export type { IAddFieldInput, IAddRecordInput, IBaseRecordFilter, IBaseTableSchemaSnapshot, ICreateViewInput, IListRecordOptions, IQueryRecordsResult, IUpdateRecordOptions, } from './f-table';
|
|
17
|
-
export { FUniverBaseMixin } from './f-univer';
|
|
18
|
-
export type { IFUniverBaseMixin } from './f-univer';
|
|
19
|
-
export { FView } from './f-view';
|
|
20
|
-
export { resolveBaseFieldKey, resolveBaseFieldValues } from './field-key';
|
|
21
|
-
export type { BaseFieldKey, IBaseFieldKeyOptions } from './field-key';
|
|
22
|
-
export { BaseTransactionContext } from './transaction';
|
|
4
|
+
export type { IBaseSchemaSnapshot } from './f-base';
|
|
5
|
+
export * from './f-event';
|
|
6
|
+
export { FBaseTableField } from './f-field';
|
|
7
|
+
export { FBaseTableRange } from './f-range';
|
|
8
|
+
export { FBaseTableRecord } from './f-record';
|
|
9
|
+
export { FBaseTable } from './f-table';
|
|
10
|
+
export type { IBaseRecordFilter, IBaseRecordFilterCondition, IBaseTableSchemaSnapshot, IListRecordOptions, IQueryRecordsResult, } from './f-table';
|
|
11
|
+
export { FBaseTableView } from './f-view';
|
|
12
|
+
export { BaseFieldKeyEnum, resolveBaseFieldKey, resolveBaseFieldValues } from './field-key';
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import type { BaseCellValue
|
|
1
|
+
import type { BaseCellValue, BaseFilterOperator, FieldConfig, IFieldCapabilities, IFieldSnapshot, IValidationResult } from '@univerjs/core';
|
|
2
|
+
import { BaseFieldType } from '@univerjs/core';
|
|
2
3
|
export interface IFieldTypePlugin {
|
|
3
|
-
type:
|
|
4
|
+
type: BaseFieldType;
|
|
4
5
|
enabled: boolean;
|
|
5
6
|
visibleInCreateMenu: boolean;
|
|
6
7
|
}
|
|
7
|
-
export interface IFieldCorePlugin<TValue extends
|
|
8
|
+
export interface IFieldCorePlugin<TValue extends BaseCellValue = BaseCellValue, TConfig = FieldConfig> extends IFieldTypePlugin {
|
|
8
9
|
i18nKey: string;
|
|
9
10
|
createDefaultConfig(): TConfig;
|
|
10
11
|
createDefaultValue(field: IFieldSnapshot): TValue | null;
|
|
11
12
|
normalize(input: unknown, field: IFieldSnapshot): TValue | null;
|
|
12
|
-
validate(value: unknown, field: IFieldSnapshot):
|
|
13
|
+
validate(value: unknown, field: IFieldSnapshot): IValidationResult;
|
|
13
14
|
compare(a: TValue | null, b: TValue | null, field: IFieldSnapshot): number;
|
|
14
|
-
filter(value: TValue | null, operator:
|
|
15
|
+
filter(value: TValue | null, operator: BaseFilterOperator | string, operand: unknown, field: IFieldSnapshot): boolean;
|
|
15
16
|
toPlainText(value: TValue | null, field: IFieldSnapshot): string;
|
|
16
17
|
fromPlainText(text: string, field: IFieldSnapshot): TValue | null;
|
|
17
|
-
getCapabilities(field: IFieldSnapshot):
|
|
18
|
+
getCapabilities(field: IFieldSnapshot): IFieldCapabilities;
|
|
18
19
|
}
|
|
19
20
|
export type BaseConditionDateMode = 'exact' | 'today' | 'tomorrow' | 'yesterday' | 'thisWeek' | 'lastWeek' | 'thisMonth' | 'lastMonth' | 'past7' | 'next7' | 'past30' | 'next30';
|
|
20
21
|
export interface IBaseConditionMatchOptions {
|
|
21
22
|
dateMode?: BaseConditionDateMode;
|
|
22
23
|
now?: number;
|
|
23
24
|
}
|
|
24
|
-
export declare function matchesBaseCondition(value: unknown, operator: string, operand: unknown, field: Pick<IFieldSnapshot, 'type'> & {
|
|
25
|
+
export declare function matchesBaseCondition(value: unknown, operator: BaseFilterOperator | string, operand: unknown, field: Pick<IFieldSnapshot, 'type'> & {
|
|
25
26
|
config?: FieldConfig;
|
|
26
27
|
}, options?: IBaseConditionMatchOptions): boolean;
|
|
27
28
|
export declare function createCoreFieldPlugins(): IFieldCorePlugin[];
|
|
28
29
|
export type FieldTypePlugin = IFieldTypePlugin;
|
|
29
|
-
export type FieldCorePlugin<TValue extends
|
|
30
|
+
export type FieldCorePlugin<TValue extends BaseCellValue = BaseCellValue, TConfig = FieldConfig> = IFieldCorePlugin<TValue, TConfig>;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -24,8 +24,8 @@ export { DuplicateBaseFieldCommand } from './commands/commands/duplicate-base-fi
|
|
|
24
24
|
export type { IDuplicateBaseFieldCommandParams } from './commands/commands/duplicate-base-field.command';
|
|
25
25
|
export { DuplicateBaseRecordCommand } from './commands/commands/duplicate-base-record.command';
|
|
26
26
|
export type { IDuplicateBaseRecordCommandParams } from './commands/commands/duplicate-base-record.command';
|
|
27
|
-
export { EnsureBaseTemporalViewDateFieldsCommand
|
|
28
|
-
export type { IEnsureBaseTemporalViewDateFieldsCommandParams
|
|
27
|
+
export { EnsureBaseTemporalViewDateFieldsCommand } from './commands/commands/ensure-base-temporal-view-date-fields.command';
|
|
28
|
+
export type { IEnsureBaseTemporalViewDateFieldsCommandParams } from './commands/commands/ensure-base-temporal-view-date-fields.command';
|
|
29
29
|
export { MoveBaseFieldCommand } from './commands/commands/move-base-field.command';
|
|
30
30
|
export type { IMoveBaseFieldCommandParams } from './commands/commands/move-base-field.command';
|
|
31
31
|
export { MoveBaseViewCommand } from './commands/commands/move-base-view.command';
|
|
@@ -36,6 +36,8 @@ export { RenameBaseViewCommand } from './commands/commands/rename-base-view.comm
|
|
|
36
36
|
export type { IRenameBaseViewCommandParams } from './commands/commands/rename-base-view.command';
|
|
37
37
|
export { SetBaseKanbanGroupFieldCommand } from './commands/commands/set-base-kanban-group-field.command';
|
|
38
38
|
export type { ISetBaseKanbanGroupFieldCommandParams } from './commands/commands/set-base-kanban-group-field.command';
|
|
39
|
+
export { SetBaseNameCommand } from './commands/commands/set-base-name.command';
|
|
40
|
+
export type { ISetBaseNameCommandParams } from './commands/commands/set-base-name.command';
|
|
39
41
|
export { SetBaseRangeValuesCommand } from './commands/commands/set-base-range-values.command';
|
|
40
42
|
export type { ISetBaseRangeValuesCommandParams } from './commands/commands/set-base-range-values.command';
|
|
41
43
|
export { SetBaseRecordValuesCommand } from './commands/commands/set-base-record-values.command';
|
|
@@ -55,7 +57,7 @@ export type { ISetBaseViewSortCommandParams } from './commands/commands/set-base
|
|
|
55
57
|
export { UpdateBaseCellCommand } from './commands/commands/update-base-cell.command';
|
|
56
58
|
export type { IUpdateBaseCellCommandParams } from './commands/commands/update-base-cell.command';
|
|
57
59
|
export { UpdateBaseFieldDescriptionCommand } from './commands/commands/update-base-field-description.command';
|
|
58
|
-
export type { IUpdateBaseFieldDescriptionCommandParams
|
|
60
|
+
export type { IUpdateBaseFieldDescriptionCommandParams } from './commands/commands/update-base-field-description.command';
|
|
59
61
|
export { UpdateBaseFieldCommand } from './commands/commands/update-base-field.command';
|
|
60
62
|
export type { IUpdateBaseFieldCommandParams } from './commands/commands/update-base-field.command';
|
|
61
63
|
export { UpdateBaseKanbanConfigCommand } from './commands/commands/update-base-kanban-config.command';
|
|
@@ -66,20 +68,22 @@ export { UpdateBaseViewConfigCommand } from './commands/commands/update-base-vie
|
|
|
66
68
|
export type { IUpdateBaseViewConfigCommandParams } from './commands/commands/update-base-view-config.command';
|
|
67
69
|
export { ApplyBaseJson1Mutation } from './commands/mutations/apply-base-json1.mutation';
|
|
68
70
|
export type { IApplyBaseJson1MutationParams } from './commands/mutations/apply-base-json1.mutation';
|
|
71
|
+
export { createEmbedBasesTable, createEmbedBasesTableAddMutation, createEmbedBasesTableRemoveMutation, EMBED_BASES_TABLE_RESOURCE_KEY, } from './embed-host-anchor';
|
|
69
72
|
export { baseDateSerialToDateMs, dateToExcelSerial, formatBaseDateValue, normalizeBaseDateSerial, } from './fields/date-format';
|
|
70
73
|
export { matchesBaseCondition } from './fields/field-core-plugin';
|
|
71
|
-
export { formatBaseNumberValue, inferBaseSeparatorStyle } from './fields/number-format';
|
|
74
|
+
export { formatBaseNumberValue, inferBaseSeparatorStyle, } from './fields/number-format';
|
|
72
75
|
export { uniqueFieldName } from './fields/util';
|
|
73
76
|
export { ensureBaseTableCellLayout, getBaseCellFormulaValue, getBaseCellValue, } from './models/base-cell-data';
|
|
74
77
|
export { copyBaseTableSnapshot } from './models/base-table-copy';
|
|
78
|
+
export { createDefaultBaseTableSnapshot } from './models/default-table';
|
|
75
79
|
export { BaseJson1OpApplier } from './ot/json1-op-applier';
|
|
76
80
|
export { BaseJson1OpFactory } from './ot/json1-op-factory';
|
|
77
|
-
export { UniverBasesPlugin, UniverRemoteBasesPlugin } from './plugin';
|
|
81
|
+
export { UniverBasesPlugin, UniverRemoteBasesPlugin, } from './plugin';
|
|
78
82
|
export { searchBaseTable } from './search/base-search';
|
|
79
|
-
export type {
|
|
80
|
-
export type { BaseTableSearchMatch } from './search/base-search';
|
|
83
|
+
export type { IBaseTableSearchRequest } from './search/base-search';
|
|
84
|
+
export type { BaseTableSearchMatch, IBaseTableSearchResult, } from './search/base-search';
|
|
81
85
|
export { IBaseCommandService } from './services/base-command.service';
|
|
82
|
-
export { traceBasePerformance
|
|
86
|
+
export { traceBasePerformance } from './services/base-performance.service';
|
|
83
87
|
export { IBasePermissionService } from './services/base-permission.service';
|
|
84
88
|
export type { BaseFieldPermission, BasePermissionSnapshot, BaseRecordPermission, BaseTablePermission, } from './services/base-permission.service';
|
|
85
89
|
export { IBaseProjectionService } from './services/base-projection.service';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseCellValue
|
|
1
|
+
import type { BaseCellValue, IBaseCellData, IFieldSnapshot, ITableSnapshot, RecordId } from '@univerjs/core';
|
|
2
2
|
export declare function ensureBaseTableCellLayout(table: ITableSnapshot): ITableSnapshot;
|
|
3
3
|
export declare function syncBaseRecordValuesFromCellData(table: ITableSnapshot): ITableSnapshot;
|
|
4
4
|
export declare function syncBaseRecordValuesFromCellDataRange(table: ITableSnapshot, cells: Array<{
|
|
@@ -10,12 +10,12 @@ export declare function getBaseCellLayoutPosition(table: ITableSnapshot, recordI
|
|
|
10
10
|
col: number;
|
|
11
11
|
} | null;
|
|
12
12
|
export declare function getBaseCell(table: ITableSnapshot, recordId: RecordId, fieldId: string): IBaseCellData | undefined;
|
|
13
|
-
export declare function getBaseCellValue(table: ITableSnapshot, recordId: RecordId, fieldId: string):
|
|
13
|
+
export declare function getBaseCellValue(table: ITableSnapshot, recordId: RecordId, fieldId: string): BaseCellValue;
|
|
14
14
|
export declare function getBaseCellFormulaValue(table: ITableSnapshot, recordId: RecordId, fieldId: string): IBaseCellData['v'];
|
|
15
|
-
export declare function setBaseCell(table: ITableSnapshot, recordId: RecordId, fieldId: string, value:
|
|
16
|
-
export declare function toBaseCellData(value:
|
|
17
|
-
export declare function fromBaseCellData(cell: IBaseCellData | undefined, field?: IFieldSnapshot, table?: ITableSnapshot, recordId?: RecordId):
|
|
18
|
-
export declare function toBaseRecordValue(value:
|
|
15
|
+
export declare function setBaseCell(table: ITableSnapshot, recordId: RecordId, fieldId: string, value: BaseCellValue | IBaseCellData): void;
|
|
16
|
+
export declare function toBaseCellData(value: BaseCellValue | IBaseCellData, field?: IFieldSnapshot): IBaseCellData;
|
|
17
|
+
export declare function fromBaseCellData(cell: IBaseCellData | undefined, field?: IFieldSnapshot, table?: ITableSnapshot, recordId?: RecordId): BaseCellValue;
|
|
18
|
+
export declare function toBaseRecordValue(value: BaseCellValue | IBaseCellData, cell: IBaseCellData, field?: IFieldSnapshot, table?: ITableSnapshot, recordId?: RecordId): BaseCellValue;
|
|
19
19
|
export declare function getBaseAttachmentResourceKey(fieldId: string, recordId: RecordId): string;
|
|
20
20
|
export declare function writeAttachmentResources(table: ITableSnapshot, recordId: RecordId, fieldId: string, value: unknown): void;
|
|
21
21
|
export declare function readAttachmentResources(table: ITableSnapshot, recordId: RecordId, fieldId: string): Record<string, unknown>[] | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ITableSnapshot } from '@univerjs/core';
|
|
2
|
+
export interface ICreateDefaultBaseTableSnapshotOptions {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
primaryFieldId?: string;
|
|
6
|
+
primaryFieldName?: string;
|
|
7
|
+
gridViewId?: string;
|
|
8
|
+
recordCount?: number;
|
|
9
|
+
recordNamePrefix?: string;
|
|
10
|
+
now?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function createDefaultBaseTableSnapshot(options: ICreateDefaultBaseTableSnapshotOptions): ITableSnapshot;
|
|
13
|
+
export type CreateDefaultBaseTableSnapshotOptions = ICreateDefaultBaseTableSnapshotOptions;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IBaseInvalidation, IBaseSnapshot, IFieldSnapshot, IRecordSnapshot, ITableSnapshot, IViewSnapshot, JSONXActions } from '@univerjs/core';
|
|
2
2
|
export type BaseJson1Command = {
|
|
3
3
|
type: 'createTable';
|
|
4
4
|
table: ITableSnapshot;
|
|
@@ -89,7 +89,7 @@ export interface IBaseJson1Adapter {
|
|
|
89
89
|
createOp(command: BaseJson1Command, snapshot: IBaseSnapshot): JSONXActions;
|
|
90
90
|
applyOp(snapshot: IBaseSnapshot, op: JSONXActions): IBaseSnapshot;
|
|
91
91
|
invertOp(snapshot: IBaseSnapshot, op: JSONXActions): JSONXActions;
|
|
92
|
-
getAffectedRanges(op: JSONXActions):
|
|
92
|
+
getAffectedRanges(op: JSONXActions): IBaseInvalidation[];
|
|
93
93
|
}
|
|
94
94
|
export declare class BaseJson1Adapter implements IBaseJson1Adapter {
|
|
95
95
|
private readonly _factory;
|
|
@@ -98,6 +98,6 @@ export declare class BaseJson1Adapter implements IBaseJson1Adapter {
|
|
|
98
98
|
createCollaborativeOp(input: Omit<IBaseCollaborativeOp, 'unitType'>): IBaseCollaborativeOp;
|
|
99
99
|
applyOp(snapshot: IBaseSnapshot, op: JSONXActions): IBaseSnapshot;
|
|
100
100
|
invertOp(snapshot: IBaseSnapshot, op: JSONXActions): JSONXActions;
|
|
101
|
-
getAffectedRanges(op: JSONXActions):
|
|
101
|
+
getAffectedRanges(op: JSONXActions): IBaseInvalidation[];
|
|
102
102
|
}
|
|
103
103
|
export type BaseCollaborativeOp = IBaseCollaborativeOp;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function getBaseInvalidationsFromJson1(op: JSONXActions):
|
|
1
|
+
import type { IBaseInvalidation, JSONXActions } from '@univerjs/core';
|
|
2
|
+
export declare function getBaseInvalidationsFromJson1(op: JSONXActions): IBaseInvalidation[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IBaseInvalidation, IBaseSnapshot, JSONXActions } from '@univerjs/core';
|
|
2
2
|
export declare class BaseJson1OpApplier {
|
|
3
3
|
applyOp(snapshot: IBaseSnapshot, op: JSONXActions): IBaseSnapshot;
|
|
4
4
|
invertOp(snapshot: IBaseSnapshot, op: JSONXActions): JSONXActions;
|
|
5
|
-
getAffectedRanges(op: JSONXActions):
|
|
5
|
+
getAffectedRanges(op: JSONXActions): IBaseInvalidation[];
|
|
6
6
|
private _getTablesToNormalize;
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseCellValue
|
|
1
|
+
import type { BaseCellValue, IBaseCellData, IBaseSnapshot, IFieldSnapshot, IFilterConfig, IGroupConfig, IRecordSnapshot, ISortConfig, ITableSnapshot, IViewSnapshot, JSONXActions, TableId } from '@univerjs/core';
|
|
2
2
|
export interface ICreateFieldOpInput {
|
|
3
3
|
field: IFieldSnapshot;
|
|
4
4
|
index?: number;
|
|
@@ -6,15 +6,17 @@ export interface ICreateFieldOpInput {
|
|
|
6
6
|
}
|
|
7
7
|
export interface ISetRecordValuesPatch {
|
|
8
8
|
recordId: string;
|
|
9
|
-
values: Record<string,
|
|
9
|
+
values: Record<string, BaseCellValue>;
|
|
10
10
|
recordPatch?: Partial<Pick<IRecordSnapshot, 'updatedAt' | 'updatedBy'>>;
|
|
11
11
|
}
|
|
12
12
|
export interface ISetRangeValuesPatch {
|
|
13
13
|
row: number;
|
|
14
14
|
col: number;
|
|
15
|
-
value:
|
|
15
|
+
value: BaseCellValue | IBaseCellData | null;
|
|
16
16
|
}
|
|
17
17
|
export declare class BaseJson1OpFactory {
|
|
18
|
+
setBaseName(snapshot: IBaseSnapshot, name: string): JSONXActions;
|
|
19
|
+
renameFormulaUnitReferences(snapshot: IBaseSnapshot, oldName: string, newName: string): JSONXActions | undefined;
|
|
18
20
|
createTable(snapshot: IBaseSnapshot, table: ITableSnapshot, index?: number): JSONXActions;
|
|
19
21
|
renameTable(snapshot: IBaseSnapshot, tableId: TableId, name: string): JSONXActions;
|
|
20
22
|
deleteTable(snapshot: IBaseSnapshot, tableId: TableId): JSONXActions;
|
|
@@ -24,7 +26,7 @@ export declare class BaseJson1OpFactory {
|
|
|
24
26
|
deleteRecords(snapshot: IBaseSnapshot, tableId: TableId, recordIds: string[]): JSONXActions;
|
|
25
27
|
duplicateRecord(snapshot: IBaseSnapshot, tableId: TableId, sourceRecordId: string, record: IRecordSnapshot): JSONXActions;
|
|
26
28
|
updateRecordOrder(snapshot: IBaseSnapshot, tableId: TableId, recordId: string, orderKey: string): JSONXActions;
|
|
27
|
-
updateCell(snapshot: IBaseSnapshot, tableId: TableId, recordId: string, fieldId: string, value:
|
|
29
|
+
updateCell(snapshot: IBaseSnapshot, tableId: TableId, recordId: string, fieldId: string, value: BaseCellValue): JSONXActions;
|
|
28
30
|
setRecordValues(snapshot: IBaseSnapshot, tableId: TableId, patches: ISetRecordValuesPatch[]): JSONXActions;
|
|
29
31
|
setRangeValues(snapshot: IBaseSnapshot, tableId: TableId, patches: ISetRangeValuesPatch[]): JSONXActions;
|
|
30
32
|
createField(snapshot: IBaseSnapshot, tableId: TableId, input: ICreateFieldOpInput): JSONXActions;
|
|
@@ -44,9 +46,9 @@ export declare class BaseJson1OpFactory {
|
|
|
44
46
|
afterViewId?: string;
|
|
45
47
|
}): JSONXActions;
|
|
46
48
|
updateViewConfig(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, patch: Record<string, unknown>): JSONXActions;
|
|
47
|
-
setViewFilter(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, filter:
|
|
48
|
-
setViewSort(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, sort:
|
|
49
|
-
setViewGroup(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, group:
|
|
49
|
+
setViewFilter(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, filter: IFilterConfig | null): JSONXActions;
|
|
50
|
+
setViewSort(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, sort: ISortConfig[]): JSONXActions;
|
|
51
|
+
setViewGroup(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, group: IGroupConfig[]): JSONXActions;
|
|
50
52
|
setViewFieldVisible(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, fieldId: string, visible: boolean): JSONXActions;
|
|
51
53
|
setViewFieldWidth(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, fieldId: string, width: number): JSONXActions;
|
|
52
54
|
setViewFieldOrder(snapshot: IBaseSnapshot, tableId: TableId, viewId: string, fieldId: string, target: {
|
|
@@ -54,12 +56,13 @@ export declare class BaseJson1OpFactory {
|
|
|
54
56
|
afterFieldId?: string;
|
|
55
57
|
}): JSONXActions;
|
|
56
58
|
private _setViewFieldSetting;
|
|
57
|
-
private _setDeleted;
|
|
58
59
|
private _createRecordOrderOp;
|
|
59
60
|
private _setFormulaFieldCells;
|
|
60
61
|
private _setAttachmentResources;
|
|
62
|
+
private _deleteAttachmentResources;
|
|
61
63
|
private _replaceOptional;
|
|
62
64
|
}
|
|
65
|
+
export declare function renameBaseFormulaTableReferences(formula: string, oldName: string, newName: string): string;
|
|
63
66
|
export type CreateFieldOpInput = ICreateFieldOpInput;
|
|
64
67
|
export type SetRecordValuesPatch = ISetRecordValuesPatch;
|
|
65
68
|
export type SetRangeValuesPatch = ISetRangeValuesPatch;
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -34,5 +34,4 @@ export declare class UniverRemoteBasesPlugin extends Plugin {
|
|
|
34
34
|
static version: string;
|
|
35
35
|
static type: UniverInstanceType;
|
|
36
36
|
constructor(_config: Partial<IUniverRemoteBasesConfig> | undefined, _injector: Injector, _commandService: ICommandService, _configService: IConfigService, _univerInstanceService: IUniverInstanceService);
|
|
37
|
-
onReady(): void;
|
|
38
37
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { FieldId,
|
|
1
|
+
import type { FieldId, IProjectedRow, ITableSnapshot, RecordId } from '@univerjs/core';
|
|
2
|
+
import { BaseFieldType } from '@univerjs/core';
|
|
2
3
|
export interface IBaseTableSearchRequest {
|
|
3
4
|
table: ITableSnapshot;
|
|
4
|
-
rows: ReadonlyArray<Pick<
|
|
5
|
+
rows: ReadonlyArray<Pick<IProjectedRow, 'recordId' | 'values'>>;
|
|
5
6
|
query: string;
|
|
6
7
|
fieldIds: ReadonlyArray<FieldId>;
|
|
7
8
|
limit?: number;
|
|
@@ -9,7 +10,7 @@ export interface IBaseTableSearchRequest {
|
|
|
9
10
|
export interface IBaseTableSearchMatch {
|
|
10
11
|
recordId: RecordId;
|
|
11
12
|
fieldId: FieldId;
|
|
12
|
-
fieldType:
|
|
13
|
+
fieldType: BaseFieldType;
|
|
13
14
|
text: string;
|
|
14
15
|
score: number;
|
|
15
16
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { BaseCellValue
|
|
1
|
+
import type { BaseCellValue, IBaseCellData } from '@univerjs/core';
|
|
2
2
|
export interface IBaseRangeValueDirtyParams {
|
|
3
3
|
unitId: string;
|
|
4
4
|
tableId: string;
|
|
5
5
|
patches: Array<{
|
|
6
6
|
row: number;
|
|
7
7
|
col: number;
|
|
8
|
-
value:
|
|
8
|
+
value: BaseCellValue | IBaseCellData | null;
|
|
9
9
|
}>;
|
|
10
10
|
}
|
|
11
11
|
export interface IBaseFormulaDirtyRange {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BaseCellValue, BaseDataModel, IFieldSnapshot, IFilterConfig, IGroupConfig, IRecordSnapshot, ISortConfig, ITableSnapshot, IViewSnapshot, JSONXActions } from '@univerjs/core';
|
|
2
2
|
import { BaseFieldRegistryService } from './base-field-registry.service';
|
|
3
3
|
import { IBasePermissionService } from './base-permission.service';
|
|
4
4
|
export interface IBaseCommandRuntimeContext {
|
|
@@ -11,10 +11,10 @@ export interface IBaseCommandRuntimeContext {
|
|
|
11
11
|
} | null | undefined;
|
|
12
12
|
}
|
|
13
13
|
export interface IBaseCommandService {
|
|
14
|
-
createUpdateCellOp(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value:
|
|
14
|
+
createUpdateCellOp(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value: BaseCellValue): JSONXActions;
|
|
15
15
|
createSetRecordValuesOp(base: BaseDataModel, tableId: string, patches: Array<{
|
|
16
16
|
recordId: string;
|
|
17
|
-
values: Record<string,
|
|
17
|
+
values: Record<string, BaseCellValue>;
|
|
18
18
|
}>): JSONXActions;
|
|
19
19
|
createCreateRecordOp(base: BaseDataModel, tableId: string, record: IRecordSnapshot): JSONXActions;
|
|
20
20
|
createBatchCreateRecordsOp(base: BaseDataModel, tableId: string, records: IRecordSnapshot[]): JSONXActions;
|
|
@@ -22,10 +22,10 @@ export interface IBaseCommandService {
|
|
|
22
22
|
createTable(base: BaseDataModel, table: ITableSnapshot, index?: number): void;
|
|
23
23
|
renameTable(base: BaseDataModel, tableId: string, name: string): void;
|
|
24
24
|
deleteTable(base: BaseDataModel, tableId: string): void;
|
|
25
|
-
updateCell(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value:
|
|
25
|
+
updateCell(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value: BaseCellValue): void;
|
|
26
26
|
setRecordValues(base: BaseDataModel, tableId: string, patches: Array<{
|
|
27
27
|
recordId: string;
|
|
28
|
-
values: Record<string,
|
|
28
|
+
values: Record<string, BaseCellValue>;
|
|
29
29
|
}>): void;
|
|
30
30
|
createRecord(base: BaseDataModel, tableId: string, record: IRecordSnapshot): void;
|
|
31
31
|
deleteRecord(base: BaseDataModel, tableId: string, recordId: string): void;
|
|
@@ -47,9 +47,9 @@ export interface IBaseCommandService {
|
|
|
47
47
|
afterViewId?: string;
|
|
48
48
|
}): void;
|
|
49
49
|
updateViewConfig(base: BaseDataModel, tableId: string, viewId: string, patch: Record<string, unknown>): void;
|
|
50
|
-
setViewFilter(base: BaseDataModel, tableId: string, viewId: string, filter:
|
|
51
|
-
setViewSort(base: BaseDataModel, tableId: string, viewId: string, sort:
|
|
52
|
-
setViewGroup(base: BaseDataModel, tableId: string, viewId: string, group:
|
|
50
|
+
setViewFilter(base: BaseDataModel, tableId: string, viewId: string, filter: IFilterConfig | null): void;
|
|
51
|
+
setViewSort(base: BaseDataModel, tableId: string, viewId: string, sort: ISortConfig[]): void;
|
|
52
|
+
setViewGroup(base: BaseDataModel, tableId: string, viewId: string, group: IGroupConfig[]): void;
|
|
53
53
|
setViewFieldVisible(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, visible: boolean): void;
|
|
54
54
|
setViewFieldWidth(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, width: number): void;
|
|
55
55
|
setViewFieldOrder(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, target: {
|
|
@@ -68,16 +68,16 @@ export declare class BaseCommandService implements IBaseCommandService {
|
|
|
68
68
|
createTable(base: BaseDataModel, table: ITableSnapshot, index?: number): void;
|
|
69
69
|
renameTable(base: BaseDataModel, tableId: string, name: string): void;
|
|
70
70
|
deleteTable(base: BaseDataModel, tableId: string): void;
|
|
71
|
-
updateCell(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value:
|
|
71
|
+
updateCell(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value: BaseCellValue): void;
|
|
72
72
|
setRecordValues(base: BaseDataModel, tableId: string, patches: Array<{
|
|
73
73
|
recordId: string;
|
|
74
|
-
values: Record<string,
|
|
74
|
+
values: Record<string, BaseCellValue>;
|
|
75
75
|
}>): void;
|
|
76
76
|
createRecord(base: BaseDataModel, tableId: string, record: IRecordSnapshot): void;
|
|
77
|
-
createUpdateCellOp(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value:
|
|
77
|
+
createUpdateCellOp(base: BaseDataModel, tableId: string, recordId: string, fieldId: string, value: BaseCellValue): JSONXActions;
|
|
78
78
|
createSetRecordValuesOp(base: BaseDataModel, tableId: string, patches: Array<{
|
|
79
79
|
recordId: string;
|
|
80
|
-
values: Record<string,
|
|
80
|
+
values: Record<string, BaseCellValue>;
|
|
81
81
|
}>): JSONXActions;
|
|
82
82
|
createCreateRecordOp(base: BaseDataModel, tableId: string, record: IRecordSnapshot): JSONXActions;
|
|
83
83
|
createBatchCreateRecordsOp(base: BaseDataModel, tableId: string, records: IRecordSnapshot[]): JSONXActions;
|
|
@@ -101,9 +101,9 @@ export declare class BaseCommandService implements IBaseCommandService {
|
|
|
101
101
|
afterViewId?: string;
|
|
102
102
|
}): void;
|
|
103
103
|
updateViewConfig(base: BaseDataModel, tableId: string, viewId: string, patch: Record<string, unknown>): void;
|
|
104
|
-
setViewFilter(base: BaseDataModel, tableId: string, viewId: string, filter:
|
|
105
|
-
setViewSort(base: BaseDataModel, tableId: string, viewId: string, sort:
|
|
106
|
-
setViewGroup(base: BaseDataModel, tableId: string, viewId: string, group:
|
|
104
|
+
setViewFilter(base: BaseDataModel, tableId: string, viewId: string, filter: IFilterConfig | null): void;
|
|
105
|
+
setViewSort(base: BaseDataModel, tableId: string, viewId: string, sort: ISortConfig[]): void;
|
|
106
|
+
setViewGroup(base: BaseDataModel, tableId: string, viewId: string, group: IGroupConfig[]): void;
|
|
107
107
|
setViewFieldVisible(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, visible: boolean): void;
|
|
108
108
|
setViewFieldWidth(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, width: number): void;
|
|
109
109
|
setViewFieldOrder(base: BaseDataModel, tableId: string, viewId: string, fieldId: string, target: {
|
|
@@ -118,7 +118,7 @@ export declare class BaseCommandService implements IBaseCommandService {
|
|
|
118
118
|
private _createNumberingAllocators;
|
|
119
119
|
private _createNumberingAllocator;
|
|
120
120
|
private _createNumberingFieldValuePatches;
|
|
121
|
-
private
|
|
121
|
+
private _getOrderedRecords;
|
|
122
122
|
private _isNonEmptyCellValue;
|
|
123
123
|
private _getCurrentUserId;
|
|
124
124
|
private _normalizeCellValue;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { BaseCellValue
|
|
1
|
+
import type { BaseCellValue, IBaseCellData, IBaseSnapshot, ITableSnapshot } from '@univerjs/core';
|
|
2
2
|
export interface IBaseRangeValuesPayload {
|
|
3
3
|
unitId: string;
|
|
4
4
|
tableId: string;
|
|
5
5
|
patches: Array<{
|
|
6
6
|
row: number;
|
|
7
7
|
col: number;
|
|
8
|
-
value:
|
|
8
|
+
value: BaseCellValue | IBaseCellData | null;
|
|
9
9
|
}>;
|
|
10
10
|
trigger?: string;
|
|
11
11
|
}
|
|
@@ -24,7 +24,7 @@ export interface ICompressedBaseCellData {
|
|
|
24
24
|
si?: IBaseCellData['si'];
|
|
25
25
|
p?: IBaseCellData['p'];
|
|
26
26
|
}
|
|
27
|
-
export type CompressedBaseRangeValue =
|
|
27
|
+
export type CompressedBaseRangeValue = BaseCellValue | ICompressedBaseCellData | null;
|
|
28
28
|
export interface ICompressedBaseTableSnapshot extends Omit<ITableSnapshot, 'cellData'> {
|
|
29
29
|
cd?: Array<[number, number, ICompressedBaseCellData]>;
|
|
30
30
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BaseFieldType } from '@univerjs/core';
|
|
2
2
|
import type { IFieldCorePlugin, IFieldTypePlugin } from '../fields/field-core-plugin';
|
|
3
3
|
import { Disposable, toDisposable } from '@univerjs/core';
|
|
4
4
|
export interface IBaseFieldRegistryService {
|
|
5
5
|
register(plugin: IFieldCorePlugin): ReturnType<typeof toDisposable>;
|
|
6
|
-
get(type:
|
|
7
|
-
getTypePlugin(type:
|
|
6
|
+
get(type: BaseFieldType): IFieldCorePlugin;
|
|
7
|
+
getTypePlugin(type: BaseFieldType): IFieldTypePlugin | undefined;
|
|
8
8
|
getAll(): IFieldCorePlugin[];
|
|
9
9
|
}
|
|
10
10
|
export declare const IBaseFieldRegistryService: import("@wendellhu/redi").IdentifierDecorator<IBaseFieldRegistryService>;
|
|
11
11
|
export declare class BaseFieldRegistryService extends Disposable implements IBaseFieldRegistryService {
|
|
12
12
|
private readonly _plugins;
|
|
13
13
|
register(plugin: IFieldCorePlugin): import("@wendellhu/redi").IDisposable;
|
|
14
|
-
get(type:
|
|
15
|
-
getTypePlugin(type:
|
|
14
|
+
get(type: BaseFieldType): IFieldCorePlugin;
|
|
15
|
+
getTypePlugin(type: BaseFieldType): IFieldTypePlugin | undefined;
|
|
16
16
|
getAll(): IFieldCorePlugin[];
|
|
17
17
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ISetFormulaCalculationResultMutation, ISuperTable, ISuperTableService } from '@univerjs-pro/engine-formula';
|
|
1
2
|
import type { IBaseCellData, IBaseSnapshot, ITableSnapshot } from '@univerjs/core';
|
|
2
3
|
import { ObjectMatrix } from '@univerjs/core';
|
|
3
4
|
export interface IBaseFormulaValidationResult {
|
|
@@ -11,20 +12,6 @@ export interface IBaseFormulaDependency {
|
|
|
11
12
|
export interface IBaseFormulaContext {
|
|
12
13
|
snapshot?: IBaseSnapshot;
|
|
13
14
|
}
|
|
14
|
-
export interface IBaseFormulaSuperTableReference {
|
|
15
|
-
sheetId: string;
|
|
16
|
-
titleMap: Map<string, number>;
|
|
17
|
-
range: {
|
|
18
|
-
startRow: number;
|
|
19
|
-
endRow: number;
|
|
20
|
-
startColumn: number;
|
|
21
|
-
endColumn: number;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export interface IBaseFormulaSuperTableServiceLike {
|
|
25
|
-
registerTable(unitId: string, tableName: string, reference: IBaseFormulaSuperTableReference): void;
|
|
26
|
-
remove?(unitId: string, tableName: string): void;
|
|
27
|
-
}
|
|
28
15
|
export interface IBaseFormulaCalculationDataset {
|
|
29
16
|
formulaData: Record<string, Record<string, Record<number, Record<number, {
|
|
30
17
|
f: string;
|
|
@@ -40,9 +27,11 @@ export interface IBaseFormulaCalculationDataset {
|
|
|
40
27
|
unitStylesData: Record<string, Record<string, unknown>>;
|
|
41
28
|
unitSheetNameMap: Record<string, Record<string, string>>;
|
|
42
29
|
}
|
|
43
|
-
export
|
|
44
|
-
|
|
45
|
-
|
|
30
|
+
export type IBaseFormulaCalculationResult = ISetFormulaCalculationResultMutation;
|
|
31
|
+
export interface IBaseSuperTableRegistration {
|
|
32
|
+
tableId: string;
|
|
33
|
+
tableName: string;
|
|
34
|
+
reference: ISuperTable;
|
|
46
35
|
}
|
|
47
36
|
export interface IBaseFormulaResultPatchGroup {
|
|
48
37
|
unitId: string;
|
|
@@ -54,12 +43,13 @@ export interface IBaseFormulaResultPatchGroup {
|
|
|
54
43
|
}>;
|
|
55
44
|
}
|
|
56
45
|
export declare class BaseFormulaService {
|
|
57
|
-
createSuperTableReference(table: ITableSnapshot, sheetId?: string):
|
|
58
|
-
registerSuperTable(superTableService:
|
|
46
|
+
createSuperTableReference(table: ITableSnapshot, sheetId?: string): ISuperTable;
|
|
47
|
+
registerSuperTable(superTableService: ISuperTableService, unitId: string, table: ITableSnapshot, options?: {
|
|
59
48
|
tableName?: string;
|
|
60
49
|
sheetId?: string;
|
|
61
|
-
}):
|
|
62
|
-
registerSuperTables(superTableService:
|
|
50
|
+
}): ISuperTable;
|
|
51
|
+
registerSuperTables(superTableService: ISuperTableService, snapshot: IBaseSnapshot): ISuperTable[];
|
|
52
|
+
getSuperTableRegistrations(snapshot: IBaseSnapshot, tableIds?: Iterable<string>): IBaseSuperTableRegistration[];
|
|
63
53
|
validateFormula(formula: string, table: ITableSnapshot, context?: IBaseFormulaContext): IBaseFormulaValidationResult;
|
|
64
54
|
getDependencies(formula: string, table: ITableSnapshot, context?: IBaseFormulaContext): string[];
|
|
65
55
|
getStructuredDependencies(formula: string, table: ITableSnapshot, context?: IBaseFormulaContext): IBaseFormulaDependency[];
|
|
@@ -67,5 +57,3 @@ export declare class BaseFormulaService {
|
|
|
67
57
|
export declare function createBaseFormulaCalculationDataset(snapshot: IBaseSnapshot): IBaseFormulaCalculationDataset;
|
|
68
58
|
export declare function createBaseFormulaResultPatches(snapshot: IBaseSnapshot, result: IBaseFormulaCalculationResult): IBaseFormulaResultPatchGroup[];
|
|
69
59
|
export type BaseFormulaValidationResult = IBaseFormulaValidationResult;
|
|
70
|
-
export type BaseFormulaSuperTableReference = IBaseFormulaSuperTableReference;
|
|
71
|
-
export type BaseFormulaSuperTableServiceLike = IBaseFormulaSuperTableServiceLike;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BaseViewType } from '@univerjs/core';
|
|
2
2
|
import type { IViewCorePlugin } from '../views/view-core-plugin';
|
|
3
3
|
import { Disposable, toDisposable } from '@univerjs/core';
|
|
4
4
|
export interface IBaseViewRegistryService {
|
|
5
5
|
register(plugin: IViewCorePlugin): ReturnType<typeof toDisposable>;
|
|
6
|
-
get(type:
|
|
6
|
+
get(type: BaseViewType): IViewCorePlugin;
|
|
7
7
|
getAll(): IViewCorePlugin[];
|
|
8
8
|
}
|
|
9
9
|
export declare const IBaseViewRegistryService: import("@wendellhu/redi").IdentifierDecorator<IBaseViewRegistryService>;
|
|
10
10
|
export declare class BaseViewRegistryService extends Disposable implements IBaseViewRegistryService {
|
|
11
11
|
private readonly _plugins;
|
|
12
12
|
register(plugin: IViewCorePlugin): import("@wendellhu/redi").IDisposable;
|
|
13
|
-
get(type:
|
|
13
|
+
get(type: BaseViewType): IViewCorePlugin;
|
|
14
14
|
getAll(): IViewCorePlugin[];
|
|
15
15
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { BaseViewProjection, ITableSnapshot,
|
|
1
|
+
import type { BaseViewProjection, ITableSnapshot, IValidationResult, IViewSnapshot, ViewSpecificConfig } from '@univerjs/core';
|
|
2
|
+
import { BaseViewType } from '@univerjs/core';
|
|
2
3
|
export interface IProjectionContext {
|
|
3
4
|
now: number;
|
|
4
5
|
}
|
|
@@ -7,10 +8,10 @@ export interface IViewRepairResult {
|
|
|
7
8
|
view: IViewSnapshot;
|
|
8
9
|
}
|
|
9
10
|
export interface IViewCorePlugin<TConfig extends ViewSpecificConfig = ViewSpecificConfig> {
|
|
10
|
-
type:
|
|
11
|
+
type: BaseViewType;
|
|
11
12
|
i18nKey: string;
|
|
12
13
|
createDefaultConfig(table: ITableSnapshot): TConfig;
|
|
13
|
-
validateConfig(table: ITableSnapshot, view: IViewSnapshot<TConfig>):
|
|
14
|
+
validateConfig(table: ITableSnapshot, view: IViewSnapshot<TConfig>): IValidationResult;
|
|
14
15
|
buildProjection(table: ITableSnapshot, view: IViewSnapshot<TConfig>, context: IProjectionContext): BaseViewProjection;
|
|
15
16
|
repairConfig?(table: ITableSnapshot, view: IViewSnapshot<TConfig>): IViewRepairResult;
|
|
16
17
|
}
|