@univerjs/core 0.24.0 → 0.25.0-insiders.20260608-e4336f7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +39 -9
- package/lib/cjs/index.js +2916 -2279
- package/lib/es/facade.js +39 -9
- package/lib/es/index.js +2904 -2280
- package/lib/facade.js +39 -9
- package/lib/index.js +2904 -2280
- package/lib/types/base/base-data-model.d.ts +33 -0
- package/lib/types/{shared/coder.d.ts → base/base-performance.d.ts} +4 -2
- package/lib/types/base/index.d.ts +17 -0
- package/lib/types/base/typedef.d.ts +642 -0
- package/lib/types/common/url.d.ts +1 -0
- package/lib/types/docs/data-model/text-x/apply-utils/common.d.ts +3 -1
- package/lib/types/docs/data-model/text-x/build-utils/drawings.d.ts +0 -1
- package/lib/types/docs/data-model/text-x/utils.d.ts +5 -2
- package/lib/types/docs/data-model/types.d.ts +3 -0
- package/lib/types/facade/f-univer.d.ts +29 -3
- package/lib/types/index.d.ts +3 -2
- package/lib/types/services/resource-manager/resource-manager.service.d.ts +4 -3
- package/lib/types/services/resource-manager/type.d.ts +3 -2
- package/lib/types/shared/index.d.ts +1 -1
- package/lib/types/shared/numfmt.d.ts +2 -1
- package/lib/types/shared/tools.d.ts +5 -0
- package/lib/types/sheets/typedef.d.ts +20 -5
- package/lib/types/types/const/const.d.ts +3 -0
- package/lib/types/types/const/page-size.d.ts +7 -0
- package/lib/types/types/enum/locale-type.d.ts +8 -1
- package/lib/types/types/interfaces/i-document-data.d.ts +50 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +10 -9
- package/package.json +6 -6
- package/LICENSE +0 -176
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { Observable } from 'rxjs';
|
|
17
|
+
import type { IBaseSnapshot } from './typedef';
|
|
18
|
+
import { UnitModel, UniverInstanceType } from '../common/unit';
|
|
19
|
+
export declare class BaseDataModel extends UnitModel<IBaseSnapshot, UniverInstanceType.UNIVER_BASE> {
|
|
20
|
+
readonly type: UniverInstanceType.UNIVER_BASE;
|
|
21
|
+
private readonly _name$;
|
|
22
|
+
readonly name$: Observable<string>;
|
|
23
|
+
private _snapshot;
|
|
24
|
+
constructor(snapshot?: Partial<IBaseSnapshot>);
|
|
25
|
+
getUnitId(): string;
|
|
26
|
+
setName(name: string): void;
|
|
27
|
+
getSnapshot(): IBaseSnapshot;
|
|
28
|
+
setSnapshot(snapshot: IBaseSnapshot): void;
|
|
29
|
+
getRev(): number;
|
|
30
|
+
incrementRev(): void;
|
|
31
|
+
setRev(rev: number): void;
|
|
32
|
+
dispose(): void;
|
|
33
|
+
}
|
|
@@ -13,5 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
17
|
-
export declare function
|
|
16
|
+
export type BasePerformanceDetails = Record<string, unknown>;
|
|
17
|
+
export declare function isBasePerformanceTracingEnabled(): boolean;
|
|
18
|
+
export declare function traceBasePerformance<T>(label: string, fn: () => T, details?: BasePerformanceDetails): T;
|
|
19
|
+
export declare function logBasePerformance(label: string, duration: number, details?: BasePerformanceDetails): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { BaseDataModel } from './base-data-model';
|
|
17
|
+
export type { BaseCellData, BaseCellMatrix, BaseCellPrimitiveValue, CellValue as BaseCellValue, BaseCellValueType, BaseHitTestResult, BaseId, BaseInvalidation, PrimitiveCellValue as BasePrimitiveCellValue, BaseResources, BaseSelection, BaseSnapshot, BaseViewColorCondition, BaseViewProjection, CalendarEventResizeSelection, CalendarEventSelection, CalendarProjection, CalendarViewConfig, CardLayoutConfig, FieldCapabilities, FieldConfig, FieldId, FieldSnapshot, FieldType, FilterCondition, FilterConfig, FilterOperator, GalleryCardSelection, GalleryProjection, GalleryViewConfig, GanttBarSelection, GanttCellSelection, GanttProjection, GanttTimeColumn, GanttViewConfig, GridCellSelection, GridFieldSelection, GridGroupSelection, GridProjection, GridRecordSelection, GridViewConfig, GroupConfig, IBaseCellData, IBaseInvalidation, IBaseResources, IBaseSnapshot, IBaseViewColorCondition, ICalendarEventResizeSelection, ICalendarEventSelection, ICalendarProjection, ICalendarViewConfig, ICardLayoutConfig, IFieldCapabilities, IFieldSnapshot, IFilterCondition, IFilterConfig, IGalleryCardSelection, IGalleryProjection, IGalleryViewConfig, IGanttBarSelection, IGanttCellSelection, IGanttProjection, IGanttTimeColumn, IGanttViewConfig, IGridCellSelection, IGridFieldSelection, IGridGroupSelection, IGridProjection, IGridRecordSelection, IGridViewConfig, IGroupConfig, IInvalidViewProjection, IKanbanCardSelection, IKanbanColumnSetting, IKanbanFieldCardSetting, IKanbanProjection, IKanbanViewConfig, InvalidViewProjection, IProjectedField, IProjectedGroup, IProjectedRow, IRecordSnapshot, IRect, ISortConfig, ITableSnapshot, IValidationResult, IViewFieldSetting, IViewport, IViewProjection, IViewSnapshot, KanbanCardLayoutMode, KanbanCardSelection, KanbanColumnSetting, KanbanFieldCardSetting, KanbanProjection, KanbanViewConfig, ProjectedField, ProjectedGroup, ProjectedRow, RecordId, RecordSnapshot, Rect, SortConfig, TableId, TableSnapshot, ValidationResult, ViewFieldSetting, ViewId, Viewport, ViewProjection, ViewSnapshot, ViewSpecificConfig, ViewType, } from './typedef';
|
|
@@ -0,0 +1,642 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { CellValueType } from '../types/enum';
|
|
17
|
+
import type { IDocumentData } from '../types/interfaces';
|
|
18
|
+
export type BaseId = string;
|
|
19
|
+
export type TableId = string;
|
|
20
|
+
export type FieldId = string;
|
|
21
|
+
export type RecordId = string;
|
|
22
|
+
export type ViewId = string;
|
|
23
|
+
export type PrimitiveCellValue = string | number | boolean;
|
|
24
|
+
export type CellValue = PrimitiveCellValue | PrimitiveCellValue[] | Record<string, unknown> | Record<string, unknown>[] | null;
|
|
25
|
+
export type BaseCellPrimitiveValue = string | number | boolean | null;
|
|
26
|
+
export type BaseCellValueType = CellValueType;
|
|
27
|
+
export interface IBaseCellData {
|
|
28
|
+
v?: BaseCellPrimitiveValue;
|
|
29
|
+
t?: BaseCellValueType | null;
|
|
30
|
+
p?: IDocumentData | null;
|
|
31
|
+
f?: string | null;
|
|
32
|
+
si?: string | null;
|
|
33
|
+
}
|
|
34
|
+
export type BaseCellMatrix = Record<number, Record<number, IBaseCellData>>;
|
|
35
|
+
export interface IBaseResources {
|
|
36
|
+
multiValueSets?: Record<string, string[]>;
|
|
37
|
+
memberSets?: Record<string, string[]>;
|
|
38
|
+
attachmentSets?: Record<string, string[]>;
|
|
39
|
+
attachments?: Record<string, Record<string, unknown>>;
|
|
40
|
+
}
|
|
41
|
+
export type FieldType = 'text' | 'singleSelect' | 'multiSelect' | 'person' | 'group' | 'date' | 'attachment' | 'number' | 'checkbox' | 'link' | 'formula' | 'lookup' | 'flow' | 'button' | 'numbering' | 'phone' | 'email' | 'location' | 'barcode' | 'progress' | 'currency' | 'rating' | 'twoWayLink' | 'recordId' | 'createdBy' | 'updatedBy' | 'createdAt' | 'updatedAt' | 'summary';
|
|
42
|
+
export type ViewType = 'grid' | 'kanban' | 'calendar' | 'gantt' | 'gallery';
|
|
43
|
+
export type FieldConfig = Record<string, unknown>;
|
|
44
|
+
export type ViewSpecificConfig = IGridViewConfig | IKanbanViewConfig | ICalendarViewConfig | IGanttViewConfig | IGalleryViewConfig | Record<string, unknown>;
|
|
45
|
+
export interface IBaseSnapshot {
|
|
46
|
+
id: BaseId;
|
|
47
|
+
name: string;
|
|
48
|
+
schemaVersion: number;
|
|
49
|
+
tables: Record<TableId, ITableSnapshot>;
|
|
50
|
+
tableOrder: TableId[];
|
|
51
|
+
createdAt: number;
|
|
52
|
+
updatedAt: number;
|
|
53
|
+
createdBy?: string;
|
|
54
|
+
rev?: number;
|
|
55
|
+
}
|
|
56
|
+
export interface ITableSnapshot {
|
|
57
|
+
id: TableId;
|
|
58
|
+
name: string;
|
|
59
|
+
fields: Record<FieldId, IFieldSnapshot>;
|
|
60
|
+
fieldOrder: FieldId[];
|
|
61
|
+
records: Record<RecordId, IRecordSnapshot>;
|
|
62
|
+
recordOrder?: RecordId[];
|
|
63
|
+
rowIndex?: Record<RecordId, number>;
|
|
64
|
+
rowId?: Record<number, RecordId>;
|
|
65
|
+
colIndex?: Record<FieldId, number>;
|
|
66
|
+
colId?: Record<number, FieldId>;
|
|
67
|
+
cellData?: BaseCellMatrix;
|
|
68
|
+
resources?: IBaseResources;
|
|
69
|
+
views: Record<ViewId, IViewSnapshot>;
|
|
70
|
+
viewOrder: ViewId[];
|
|
71
|
+
primaryFieldId: FieldId;
|
|
72
|
+
deleted?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface IRecordSnapshot {
|
|
75
|
+
id: RecordId;
|
|
76
|
+
values: Record<FieldId, CellValue>;
|
|
77
|
+
orderKey: string;
|
|
78
|
+
createdAt: number;
|
|
79
|
+
updatedAt: number;
|
|
80
|
+
createdBy?: string;
|
|
81
|
+
updatedBy?: string;
|
|
82
|
+
deleted?: boolean;
|
|
83
|
+
}
|
|
84
|
+
export interface IFieldSnapshot {
|
|
85
|
+
id: FieldId;
|
|
86
|
+
name: string;
|
|
87
|
+
description?: string;
|
|
88
|
+
type: FieldType;
|
|
89
|
+
config: FieldConfig;
|
|
90
|
+
defaultValue?: CellValue;
|
|
91
|
+
system?: boolean;
|
|
92
|
+
readonly?: boolean;
|
|
93
|
+
deleted?: boolean;
|
|
94
|
+
}
|
|
95
|
+
export interface IViewSnapshot<TConfig extends ViewSpecificConfig = ViewSpecificConfig> {
|
|
96
|
+
id: ViewId;
|
|
97
|
+
tableId: TableId;
|
|
98
|
+
name: string;
|
|
99
|
+
type: ViewType;
|
|
100
|
+
fieldOrder?: FieldId[];
|
|
101
|
+
fieldSettings?: Record<FieldId, IViewFieldSetting>;
|
|
102
|
+
filter?: IFilterConfig | null;
|
|
103
|
+
sort?: ISortConfig[];
|
|
104
|
+
group?: IGroupConfig[];
|
|
105
|
+
config: TConfig;
|
|
106
|
+
deleted?: boolean;
|
|
107
|
+
}
|
|
108
|
+
export type BaseSnapshot = IBaseSnapshot;
|
|
109
|
+
export type TableSnapshot = ITableSnapshot;
|
|
110
|
+
export type RecordSnapshot = IRecordSnapshot;
|
|
111
|
+
export type FieldSnapshot = IFieldSnapshot;
|
|
112
|
+
export type ViewSnapshot<TConfig extends ViewSpecificConfig = ViewSpecificConfig> = IViewSnapshot<TConfig>;
|
|
113
|
+
export interface IViewFieldSetting {
|
|
114
|
+
hidden?: boolean;
|
|
115
|
+
width?: number;
|
|
116
|
+
showInCard?: boolean;
|
|
117
|
+
}
|
|
118
|
+
export interface IFieldCapabilities {
|
|
119
|
+
editable: boolean;
|
|
120
|
+
sortable: boolean;
|
|
121
|
+
filterable: boolean;
|
|
122
|
+
groupable: boolean;
|
|
123
|
+
usableAsKanbanGroup: boolean;
|
|
124
|
+
usableAsCalendarDate: boolean;
|
|
125
|
+
usableAsGanttStart: boolean;
|
|
126
|
+
usableAsGanttEnd: boolean;
|
|
127
|
+
usableAsGanttProgress: boolean;
|
|
128
|
+
usableAsCardCover: boolean;
|
|
129
|
+
usableAsTitle: boolean;
|
|
130
|
+
supportsMultipleValues?: boolean;
|
|
131
|
+
supportsOptions?: boolean;
|
|
132
|
+
supportsRelation?: boolean;
|
|
133
|
+
}
|
|
134
|
+
export interface IValidationResult {
|
|
135
|
+
valid: boolean;
|
|
136
|
+
reason?: string;
|
|
137
|
+
}
|
|
138
|
+
export type FilterOperator = 'is' | 'isNot' | 'contains' | 'notContains' | 'isEmpty' | 'isNotEmpty' | 'greaterThan' | 'greaterThanOrEqual' | 'lessThan' | 'lessThanOrEqual';
|
|
139
|
+
export interface IFilterConfig {
|
|
140
|
+
conjunction: 'and' | 'or';
|
|
141
|
+
conditions: IFilterCondition[];
|
|
142
|
+
}
|
|
143
|
+
export interface IFilterCondition {
|
|
144
|
+
fieldId: FieldId;
|
|
145
|
+
operator: string;
|
|
146
|
+
operand?: unknown;
|
|
147
|
+
}
|
|
148
|
+
export interface ISortConfig {
|
|
149
|
+
fieldId: FieldId;
|
|
150
|
+
direction: 'asc' | 'desc';
|
|
151
|
+
}
|
|
152
|
+
export interface IGroupConfig {
|
|
153
|
+
fieldId: FieldId;
|
|
154
|
+
direction?: 'asc' | 'desc';
|
|
155
|
+
hideEmptyGroup?: boolean;
|
|
156
|
+
}
|
|
157
|
+
export interface IGridViewConfig {
|
|
158
|
+
frozenFieldCount?: number;
|
|
159
|
+
showRecordIndex?: boolean;
|
|
160
|
+
rowHeight?: 'short' | 'medium' | 'tall' | 'extraTall';
|
|
161
|
+
}
|
|
162
|
+
export interface ICardLayoutConfig {
|
|
163
|
+
titleFieldId?: FieldId;
|
|
164
|
+
coverFieldId?: FieldId | null;
|
|
165
|
+
fieldIds: FieldId[];
|
|
166
|
+
}
|
|
167
|
+
export type KanbanCardLayoutMode = 'normal' | 'compose';
|
|
168
|
+
export interface IKanbanFieldCardSetting {
|
|
169
|
+
hidden?: boolean;
|
|
170
|
+
order?: number;
|
|
171
|
+
}
|
|
172
|
+
export interface IKanbanColumnSetting {
|
|
173
|
+
title?: string;
|
|
174
|
+
color?: string;
|
|
175
|
+
collapsed?: boolean;
|
|
176
|
+
}
|
|
177
|
+
export interface IKanbanViewConfig {
|
|
178
|
+
groupFieldId: FieldId;
|
|
179
|
+
coverFieldId?: FieldId | null;
|
|
180
|
+
cardLayout?: KanbanCardLayoutMode;
|
|
181
|
+
showFieldNames?: boolean;
|
|
182
|
+
fieldSettings?: Record<FieldId, IKanbanFieldCardSetting>;
|
|
183
|
+
columnSettings?: Record<string, IKanbanColumnSetting>;
|
|
184
|
+
card?: ICardLayoutConfig;
|
|
185
|
+
}
|
|
186
|
+
export interface ICalendarViewConfig {
|
|
187
|
+
startDateFieldId: FieldId;
|
|
188
|
+
endDateFieldId?: FieldId;
|
|
189
|
+
titleFieldId?: FieldId;
|
|
190
|
+
colorFieldId?: FieldId;
|
|
191
|
+
mode: 'month' | 'week' | 'day';
|
|
192
|
+
timeslotSize?: 'short' | 'medium' | 'long';
|
|
193
|
+
timeZone?: 'local' | string;
|
|
194
|
+
displayColor?: {
|
|
195
|
+
type: 'custom';
|
|
196
|
+
color: string;
|
|
197
|
+
} | {
|
|
198
|
+
type: 'selectField';
|
|
199
|
+
fieldId: FieldId;
|
|
200
|
+
};
|
|
201
|
+
fieldSettings?: Record<FieldId, {
|
|
202
|
+
hidden?: boolean;
|
|
203
|
+
order?: number;
|
|
204
|
+
}>;
|
|
205
|
+
}
|
|
206
|
+
export interface IBaseViewColorCondition {
|
|
207
|
+
id: string;
|
|
208
|
+
color: string;
|
|
209
|
+
target?: 'cell' | 'row' | 'column';
|
|
210
|
+
fieldId: FieldId;
|
|
211
|
+
operator: 'is' | 'isNot' | 'contains' | 'notContains' | 'isEmpty' | 'isNotEmpty' | 'greaterThan' | 'lessThan' | 'before' | 'after';
|
|
212
|
+
operand?: unknown;
|
|
213
|
+
dateMode?: 'exact' | 'today' | 'tomorrow' | 'yesterday' | 'thisWeek' | 'lastWeek' | 'thisMonth' | 'lastMonth' | 'past7' | 'next7' | 'past30' | 'next30';
|
|
214
|
+
}
|
|
215
|
+
export interface IGanttViewConfig {
|
|
216
|
+
startDateFieldId: FieldId;
|
|
217
|
+
endDateFieldId: FieldId;
|
|
218
|
+
titleFieldId?: FieldId;
|
|
219
|
+
progressFieldId?: FieldId;
|
|
220
|
+
dependencyFieldId?: FieldId;
|
|
221
|
+
scale: 'week' | 'month' | 'quarter' | 'year';
|
|
222
|
+
leftPaneWidth?: number;
|
|
223
|
+
leftPaneCollapsed?: boolean;
|
|
224
|
+
showTodayLine?: boolean;
|
|
225
|
+
showWeekend?: boolean;
|
|
226
|
+
displayColor?: {
|
|
227
|
+
type: 'custom';
|
|
228
|
+
color: string;
|
|
229
|
+
} | {
|
|
230
|
+
type: 'selectField';
|
|
231
|
+
fieldId: FieldId;
|
|
232
|
+
} | {
|
|
233
|
+
type: 'conditional';
|
|
234
|
+
rules: IBaseViewColorCondition[];
|
|
235
|
+
};
|
|
236
|
+
fieldSettings?: Record<FieldId, {
|
|
237
|
+
hidden?: boolean;
|
|
238
|
+
order?: number;
|
|
239
|
+
}>;
|
|
240
|
+
workingDaysOnly?: boolean;
|
|
241
|
+
workingDays?: {
|
|
242
|
+
weekdays: Array<1 | 2 | 3 | 4 | 5 | 6 | 7>;
|
|
243
|
+
exceptions: Array<{
|
|
244
|
+
id: string;
|
|
245
|
+
date: number;
|
|
246
|
+
name: string;
|
|
247
|
+
type: 'off' | 'working';
|
|
248
|
+
}>;
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
export interface IGalleryViewConfig {
|
|
252
|
+
card: ICardLayoutConfig;
|
|
253
|
+
coverFieldId?: FieldId | null;
|
|
254
|
+
cardLayout?: KanbanCardLayoutMode;
|
|
255
|
+
showFieldNames?: boolean;
|
|
256
|
+
fieldSettings?: Record<FieldId, IKanbanFieldCardSetting>;
|
|
257
|
+
cardSize?: 'small' | 'medium' | 'large';
|
|
258
|
+
}
|
|
259
|
+
export interface IProjectedField {
|
|
260
|
+
id: FieldId;
|
|
261
|
+
name: string;
|
|
262
|
+
description?: string;
|
|
263
|
+
type: FieldType;
|
|
264
|
+
config?: FieldConfig;
|
|
265
|
+
width?: number;
|
|
266
|
+
setting: IViewFieldSetting;
|
|
267
|
+
}
|
|
268
|
+
export interface IViewProjection {
|
|
269
|
+
type: ViewType;
|
|
270
|
+
fields: IProjectedField[];
|
|
271
|
+
rows: IProjectedRow[];
|
|
272
|
+
groups?: IProjectedGroup[];
|
|
273
|
+
}
|
|
274
|
+
export interface IProjectedRow {
|
|
275
|
+
recordId: RecordId;
|
|
276
|
+
values: Record<FieldId, CellValue>;
|
|
277
|
+
}
|
|
278
|
+
export interface IProjectedGroup {
|
|
279
|
+
key: string;
|
|
280
|
+
path?: string;
|
|
281
|
+
label: string;
|
|
282
|
+
recordIds: RecordId[];
|
|
283
|
+
fieldId?: FieldId;
|
|
284
|
+
level?: number;
|
|
285
|
+
children?: IProjectedGroup[];
|
|
286
|
+
}
|
|
287
|
+
export interface IGridProjection extends IViewProjection {
|
|
288
|
+
type: 'grid';
|
|
289
|
+
frozenFieldCount?: number;
|
|
290
|
+
}
|
|
291
|
+
export interface IKanbanProjection extends IViewProjection {
|
|
292
|
+
type: 'kanban';
|
|
293
|
+
groupFieldId: FieldId;
|
|
294
|
+
coverFieldId?: FieldId | null;
|
|
295
|
+
cardLayout: KanbanCardLayoutMode;
|
|
296
|
+
showFieldNames: boolean;
|
|
297
|
+
visibleCardFieldIds: FieldId[];
|
|
298
|
+
lanes: Array<{
|
|
299
|
+
key: string;
|
|
300
|
+
title: string;
|
|
301
|
+
color?: string;
|
|
302
|
+
recordIds: RecordId[];
|
|
303
|
+
}>;
|
|
304
|
+
}
|
|
305
|
+
export interface ICalendarProjection extends IViewProjection {
|
|
306
|
+
type: 'calendar';
|
|
307
|
+
config: ICalendarViewConfig;
|
|
308
|
+
events: Array<{
|
|
309
|
+
recordId: RecordId;
|
|
310
|
+
title: string;
|
|
311
|
+
start: number;
|
|
312
|
+
end?: number;
|
|
313
|
+
color?: string;
|
|
314
|
+
startMs: number;
|
|
315
|
+
endMs?: number;
|
|
316
|
+
allDay: boolean;
|
|
317
|
+
fieldValues: Record<FieldId, CellValue>;
|
|
318
|
+
}>;
|
|
319
|
+
}
|
|
320
|
+
export interface IGanttTimeColumn {
|
|
321
|
+
id: string;
|
|
322
|
+
label: string;
|
|
323
|
+
majorLabel?: string;
|
|
324
|
+
start: number;
|
|
325
|
+
end: number;
|
|
326
|
+
nonWorking?: boolean;
|
|
327
|
+
}
|
|
328
|
+
export interface IGanttProjection extends IViewProjection {
|
|
329
|
+
type: 'gantt';
|
|
330
|
+
config: IGanttViewConfig;
|
|
331
|
+
dateRangeAllDay?: boolean;
|
|
332
|
+
timeline: {
|
|
333
|
+
scale: 'week' | 'month' | 'quarter' | 'year';
|
|
334
|
+
start: number;
|
|
335
|
+
end: number;
|
|
336
|
+
unitWidth: number;
|
|
337
|
+
majorHeaders: Array<{
|
|
338
|
+
id: string;
|
|
339
|
+
label: string;
|
|
340
|
+
start: number;
|
|
341
|
+
end: number;
|
|
342
|
+
}>;
|
|
343
|
+
columns: IGanttTimeColumn[];
|
|
344
|
+
};
|
|
345
|
+
bars: Array<{
|
|
346
|
+
recordId: RecordId;
|
|
347
|
+
title: string;
|
|
348
|
+
start: number;
|
|
349
|
+
end: number;
|
|
350
|
+
color: string;
|
|
351
|
+
progress?: number;
|
|
352
|
+
workingDayCount?: number;
|
|
353
|
+
dependencyRecordIds?: RecordId[];
|
|
354
|
+
}>;
|
|
355
|
+
}
|
|
356
|
+
export interface IGalleryProjection extends IViewProjection {
|
|
357
|
+
type: 'gallery';
|
|
358
|
+
coverFieldId?: FieldId | null;
|
|
359
|
+
cardLayout: KanbanCardLayoutMode;
|
|
360
|
+
showFieldNames: boolean;
|
|
361
|
+
visibleCardFieldIds: FieldId[];
|
|
362
|
+
cardSize: 'small' | 'medium' | 'large';
|
|
363
|
+
cards: Array<{
|
|
364
|
+
recordId: RecordId;
|
|
365
|
+
title: string;
|
|
366
|
+
values: Record<FieldId, CellValue>;
|
|
367
|
+
}>;
|
|
368
|
+
}
|
|
369
|
+
export interface IInvalidViewProjection {
|
|
370
|
+
type: 'invalid';
|
|
371
|
+
viewType: ViewType;
|
|
372
|
+
reason: 'missingField' | 'invalidGroupField' | 'invalidDateField' | 'invalidGanttStartField' | 'invalidGanttEndField';
|
|
373
|
+
fieldId?: FieldId;
|
|
374
|
+
}
|
|
375
|
+
export type BaseViewProjection = IGridProjection | IKanbanProjection | ICalendarProjection | IGanttProjection | IGalleryProjection | IInvalidViewProjection;
|
|
376
|
+
export interface IViewport {
|
|
377
|
+
x: number;
|
|
378
|
+
y: number;
|
|
379
|
+
width: number;
|
|
380
|
+
height: number;
|
|
381
|
+
}
|
|
382
|
+
export interface IRect extends IViewport {
|
|
383
|
+
}
|
|
384
|
+
export type BaseSelection = IGridCellSelection | IGridGroupSelection | IGridRecordSelection | IGridFieldSelection | IKanbanCardSelection | ICalendarEventSelection | IGanttCellSelection | IGanttBarSelection | IGalleryCardSelection;
|
|
385
|
+
export interface IGridCellSelection {
|
|
386
|
+
type: 'grid-cell';
|
|
387
|
+
tableId: TableId;
|
|
388
|
+
viewId: ViewId;
|
|
389
|
+
recordId: RecordId;
|
|
390
|
+
fieldId: FieldId;
|
|
391
|
+
}
|
|
392
|
+
export interface IGridGroupSelection {
|
|
393
|
+
type: 'grid-group';
|
|
394
|
+
tableId: TableId;
|
|
395
|
+
viewId: ViewId;
|
|
396
|
+
fieldId: FieldId;
|
|
397
|
+
groupKey: string;
|
|
398
|
+
groupPath: string;
|
|
399
|
+
level: number;
|
|
400
|
+
collapsed: boolean;
|
|
401
|
+
}
|
|
402
|
+
export interface IGridRecordSelection {
|
|
403
|
+
type: 'grid-record';
|
|
404
|
+
tableId: TableId;
|
|
405
|
+
viewId: ViewId;
|
|
406
|
+
recordId: RecordId;
|
|
407
|
+
}
|
|
408
|
+
export interface IGridFieldSelection {
|
|
409
|
+
type: 'grid-field';
|
|
410
|
+
tableId: TableId;
|
|
411
|
+
viewId: ViewId;
|
|
412
|
+
fieldId: FieldId;
|
|
413
|
+
}
|
|
414
|
+
export interface IKanbanCardSelection {
|
|
415
|
+
type: 'kanban-card';
|
|
416
|
+
tableId: TableId;
|
|
417
|
+
viewId: ViewId;
|
|
418
|
+
recordId: RecordId;
|
|
419
|
+
groupKey?: string;
|
|
420
|
+
}
|
|
421
|
+
export interface ICalendarEventSelection {
|
|
422
|
+
type: 'calendar-event';
|
|
423
|
+
tableId: TableId;
|
|
424
|
+
viewId: ViewId;
|
|
425
|
+
recordId: RecordId;
|
|
426
|
+
allDay?: boolean;
|
|
427
|
+
x?: number;
|
|
428
|
+
y?: number;
|
|
429
|
+
width?: number;
|
|
430
|
+
height?: number;
|
|
431
|
+
}
|
|
432
|
+
export interface ICalendarEventResizeSelection {
|
|
433
|
+
type: 'calendar-event-resize';
|
|
434
|
+
tableId: TableId;
|
|
435
|
+
viewId: ViewId;
|
|
436
|
+
recordId: RecordId;
|
|
437
|
+
edge: 'start' | 'end';
|
|
438
|
+
x?: number;
|
|
439
|
+
y?: number;
|
|
440
|
+
width?: number;
|
|
441
|
+
height?: number;
|
|
442
|
+
}
|
|
443
|
+
export interface IGanttCellSelection {
|
|
444
|
+
type: 'gantt-cell';
|
|
445
|
+
tableId: TableId;
|
|
446
|
+
viewId: ViewId;
|
|
447
|
+
recordId: RecordId;
|
|
448
|
+
fieldId: FieldId;
|
|
449
|
+
}
|
|
450
|
+
export interface IGanttBarSelection {
|
|
451
|
+
type: 'gantt-bar';
|
|
452
|
+
tableId: TableId;
|
|
453
|
+
viewId: ViewId;
|
|
454
|
+
recordId: RecordId;
|
|
455
|
+
}
|
|
456
|
+
export interface IGalleryCardSelection {
|
|
457
|
+
type: 'gallery-card';
|
|
458
|
+
tableId: TableId;
|
|
459
|
+
viewId: ViewId;
|
|
460
|
+
recordId: RecordId;
|
|
461
|
+
}
|
|
462
|
+
export type BaseHitTestResult = {
|
|
463
|
+
type: 'empty';
|
|
464
|
+
x: number;
|
|
465
|
+
y: number;
|
|
466
|
+
} | {
|
|
467
|
+
type: 'grid-fill-handle';
|
|
468
|
+
tableId: TableId;
|
|
469
|
+
viewId: ViewId;
|
|
470
|
+
recordId: RecordId;
|
|
471
|
+
fieldId: FieldId;
|
|
472
|
+
} | {
|
|
473
|
+
type: 'grid-freeze-handle';
|
|
474
|
+
tableId: TableId;
|
|
475
|
+
viewId: ViewId;
|
|
476
|
+
frozenFieldCount: number;
|
|
477
|
+
x: number;
|
|
478
|
+
} | {
|
|
479
|
+
type: 'grid-stat';
|
|
480
|
+
tableId: TableId;
|
|
481
|
+
viewId: ViewId;
|
|
482
|
+
fieldId: FieldId;
|
|
483
|
+
fieldIndex: number;
|
|
484
|
+
} | {
|
|
485
|
+
type: 'grid-record-open';
|
|
486
|
+
tableId: TableId;
|
|
487
|
+
viewId: ViewId;
|
|
488
|
+
recordId: RecordId;
|
|
489
|
+
} | {
|
|
490
|
+
type: 'kanban-add-record';
|
|
491
|
+
tableId: TableId;
|
|
492
|
+
viewId: ViewId;
|
|
493
|
+
groupFieldId: FieldId;
|
|
494
|
+
groupKey: string;
|
|
495
|
+
} | {
|
|
496
|
+
type: 'kanban-add-group';
|
|
497
|
+
tableId: TableId;
|
|
498
|
+
viewId: ViewId;
|
|
499
|
+
groupFieldId: FieldId;
|
|
500
|
+
x: number;
|
|
501
|
+
y: number;
|
|
502
|
+
width: number;
|
|
503
|
+
height: number;
|
|
504
|
+
} | {
|
|
505
|
+
type: 'kanban-column';
|
|
506
|
+
tableId: TableId;
|
|
507
|
+
viewId: ViewId;
|
|
508
|
+
groupFieldId: FieldId;
|
|
509
|
+
groupKey: string;
|
|
510
|
+
x: number;
|
|
511
|
+
y: number;
|
|
512
|
+
width: number;
|
|
513
|
+
height: number;
|
|
514
|
+
} | {
|
|
515
|
+
type: 'kanban-column-title';
|
|
516
|
+
tableId: TableId;
|
|
517
|
+
viewId: ViewId;
|
|
518
|
+
groupFieldId: FieldId;
|
|
519
|
+
groupKey: string;
|
|
520
|
+
title: string;
|
|
521
|
+
x: number;
|
|
522
|
+
y: number;
|
|
523
|
+
width: number;
|
|
524
|
+
height: number;
|
|
525
|
+
} | {
|
|
526
|
+
type: 'kanban-column-color';
|
|
527
|
+
tableId: TableId;
|
|
528
|
+
viewId: ViewId;
|
|
529
|
+
groupFieldId: FieldId;
|
|
530
|
+
groupKey: string;
|
|
531
|
+
x: number;
|
|
532
|
+
y: number;
|
|
533
|
+
width: number;
|
|
534
|
+
height: number;
|
|
535
|
+
} | {
|
|
536
|
+
type: 'kanban-card-checkbox';
|
|
537
|
+
tableId: TableId;
|
|
538
|
+
viewId: ViewId;
|
|
539
|
+
recordId: RecordId;
|
|
540
|
+
fieldId: FieldId;
|
|
541
|
+
groupKey?: string;
|
|
542
|
+
} | {
|
|
543
|
+
type: 'kanban-lane-scrollbar-edge' | 'kanban-lane-scrollbar-thumb';
|
|
544
|
+
tableId: TableId;
|
|
545
|
+
viewId: ViewId;
|
|
546
|
+
groupKey: string;
|
|
547
|
+
x: number;
|
|
548
|
+
y: number;
|
|
549
|
+
width: number;
|
|
550
|
+
height: number;
|
|
551
|
+
trackY: number;
|
|
552
|
+
trackHeight: number;
|
|
553
|
+
thumbHeight: number;
|
|
554
|
+
maxScroll: number;
|
|
555
|
+
} | {
|
|
556
|
+
type: 'calendar-mode-tab';
|
|
557
|
+
tableId: TableId;
|
|
558
|
+
viewId: ViewId;
|
|
559
|
+
mode: 'day' | 'week' | 'month';
|
|
560
|
+
} | {
|
|
561
|
+
type: 'calendar-today';
|
|
562
|
+
tableId: TableId;
|
|
563
|
+
viewId: ViewId;
|
|
564
|
+
} | {
|
|
565
|
+
type: 'calendar-navigate';
|
|
566
|
+
tableId: TableId;
|
|
567
|
+
viewId: ViewId;
|
|
568
|
+
direction: 'prev' | 'next';
|
|
569
|
+
} | {
|
|
570
|
+
type: 'calendar-day-cell';
|
|
571
|
+
tableId: TableId;
|
|
572
|
+
viewId: ViewId;
|
|
573
|
+
dateMs: number;
|
|
574
|
+
} | {
|
|
575
|
+
type: 'calendar-more-events';
|
|
576
|
+
tableId: TableId;
|
|
577
|
+
viewId: ViewId;
|
|
578
|
+
dateMs: number;
|
|
579
|
+
count: number;
|
|
580
|
+
} | {
|
|
581
|
+
type: 'gantt-offscreen-record';
|
|
582
|
+
tableId: TableId;
|
|
583
|
+
viewId: ViewId;
|
|
584
|
+
recordId: RecordId;
|
|
585
|
+
direction: 'prev' | 'next';
|
|
586
|
+
} | {
|
|
587
|
+
type: 'gantt-row';
|
|
588
|
+
tableId: TableId;
|
|
589
|
+
viewId: ViewId;
|
|
590
|
+
recordId: RecordId;
|
|
591
|
+
} | ICalendarEventResizeSelection | BaseSelection;
|
|
592
|
+
export interface IBaseInvalidation {
|
|
593
|
+
tableId: TableId;
|
|
594
|
+
viewId?: ViewId;
|
|
595
|
+
recordId?: RecordId;
|
|
596
|
+
fieldId?: FieldId;
|
|
597
|
+
row?: number;
|
|
598
|
+
column?: number;
|
|
599
|
+
reason: 'cell' | 'field' | 'record' | 'view' | 'table' | 'unknown';
|
|
600
|
+
}
|
|
601
|
+
export type BaseCellData = IBaseCellData;
|
|
602
|
+
export type BaseResources = IBaseResources;
|
|
603
|
+
export type ViewFieldSetting = IViewFieldSetting;
|
|
604
|
+
export type FieldCapabilities = IFieldCapabilities;
|
|
605
|
+
export type ValidationResult = IValidationResult;
|
|
606
|
+
export type FilterConfig = IFilterConfig;
|
|
607
|
+
export type FilterCondition = IFilterCondition;
|
|
608
|
+
export type SortConfig = ISortConfig;
|
|
609
|
+
export type GroupConfig = IGroupConfig;
|
|
610
|
+
export type GridViewConfig = IGridViewConfig;
|
|
611
|
+
export type CardLayoutConfig = ICardLayoutConfig;
|
|
612
|
+
export type KanbanFieldCardSetting = IKanbanFieldCardSetting;
|
|
613
|
+
export type KanbanColumnSetting = IKanbanColumnSetting;
|
|
614
|
+
export type KanbanViewConfig = IKanbanViewConfig;
|
|
615
|
+
export type CalendarViewConfig = ICalendarViewConfig;
|
|
616
|
+
export type BaseViewColorCondition = IBaseViewColorCondition;
|
|
617
|
+
export type GanttViewConfig = IGanttViewConfig;
|
|
618
|
+
export type GalleryViewConfig = IGalleryViewConfig;
|
|
619
|
+
export type ProjectedField = IProjectedField;
|
|
620
|
+
export type ViewProjection = IViewProjection;
|
|
621
|
+
export type ProjectedRow = IProjectedRow;
|
|
622
|
+
export type ProjectedGroup = IProjectedGroup;
|
|
623
|
+
export type GridProjection = IGridProjection;
|
|
624
|
+
export type KanbanProjection = IKanbanProjection;
|
|
625
|
+
export type CalendarProjection = ICalendarProjection;
|
|
626
|
+
export type GanttTimeColumn = IGanttTimeColumn;
|
|
627
|
+
export type GanttProjection = IGanttProjection;
|
|
628
|
+
export type GalleryProjection = IGalleryProjection;
|
|
629
|
+
export type InvalidViewProjection = IInvalidViewProjection;
|
|
630
|
+
export type Viewport = IViewport;
|
|
631
|
+
export type Rect = IRect;
|
|
632
|
+
export type GridCellSelection = IGridCellSelection;
|
|
633
|
+
export type GridGroupSelection = IGridGroupSelection;
|
|
634
|
+
export type GridRecordSelection = IGridRecordSelection;
|
|
635
|
+
export type GridFieldSelection = IGridFieldSelection;
|
|
636
|
+
export type KanbanCardSelection = IKanbanCardSelection;
|
|
637
|
+
export type CalendarEventSelection = ICalendarEventSelection;
|
|
638
|
+
export type CalendarEventResizeSelection = ICalendarEventResizeSelection;
|
|
639
|
+
export type GanttCellSelection = IGanttCellSelection;
|
|
640
|
+
export type GanttBarSelection = IGanttBarSelection;
|
|
641
|
+
export type GalleryCardSelection = IGalleryCardSelection;
|
|
642
|
+
export type BaseInvalidation = IBaseInvalidation;
|