@univerjs-pro/bases 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.
Files changed (157) hide show
  1. package/README.md +42 -0
  2. package/lib/cjs/facade.js +1 -0
  3. package/lib/cjs/index.js +1 -0
  4. package/lib/cjs/locale/ar-SA.js +1 -0
  5. package/lib/cjs/locale/ca-ES.js +1 -0
  6. package/lib/cjs/locale/de-DE.js +1 -0
  7. package/lib/cjs/locale/en-US.js +1 -0
  8. package/lib/cjs/locale/es-ES.js +1 -0
  9. package/lib/cjs/locale/fa-IR.js +1 -0
  10. package/lib/cjs/locale/fr-FR.js +1 -0
  11. package/lib/cjs/locale/id-ID.js +1 -0
  12. package/lib/cjs/locale/it-IT.js +1 -0
  13. package/lib/cjs/locale/ja-JP.js +1 -0
  14. package/lib/cjs/locale/ko-KR.js +1 -0
  15. package/lib/cjs/locale/pl-PL.js +1 -0
  16. package/lib/cjs/locale/pt-BR.js +1 -0
  17. package/lib/cjs/locale/ru-RU.js +1 -0
  18. package/lib/cjs/locale/sk-SK.js +1 -0
  19. package/lib/cjs/locale/vi-VN.js +1 -0
  20. package/lib/cjs/locale/zh-CN.js +1 -0
  21. package/lib/cjs/locale/zh-HK.js +1 -0
  22. package/lib/cjs/locale/zh-TW.js +1 -0
  23. package/lib/es/facade.js +1 -0
  24. package/lib/es/index.js +1 -0
  25. package/lib/es/locale/ar-SA.js +1 -0
  26. package/lib/es/locale/ca-ES.js +1 -0
  27. package/lib/es/locale/de-DE.js +1 -0
  28. package/lib/es/locale/en-US.js +1 -0
  29. package/lib/es/locale/es-ES.js +1 -0
  30. package/lib/es/locale/fa-IR.js +1 -0
  31. package/lib/es/locale/fr-FR.js +1 -0
  32. package/lib/es/locale/id-ID.js +1 -0
  33. package/lib/es/locale/it-IT.js +1 -0
  34. package/lib/es/locale/ja-JP.js +1 -0
  35. package/lib/es/locale/ko-KR.js +1 -0
  36. package/lib/es/locale/pl-PL.js +1 -0
  37. package/lib/es/locale/pt-BR.js +1 -0
  38. package/lib/es/locale/ru-RU.js +1 -0
  39. package/lib/es/locale/sk-SK.js +1 -0
  40. package/lib/es/locale/vi-VN.js +1 -0
  41. package/lib/es/locale/zh-CN.js +1 -0
  42. package/lib/es/locale/zh-HK.js +1 -0
  43. package/lib/es/locale/zh-TW.js +1 -0
  44. package/lib/facade.js +1 -0
  45. package/lib/index.js +1 -0
  46. package/lib/locale/ar-SA.js +1 -0
  47. package/lib/locale/ca-ES.js +1 -0
  48. package/lib/locale/de-DE.js +1 -0
  49. package/lib/locale/en-US.js +1 -0
  50. package/lib/locale/es-ES.js +1 -0
  51. package/lib/locale/fa-IR.js +1 -0
  52. package/lib/locale/fr-FR.js +1 -0
  53. package/lib/locale/id-ID.js +1 -0
  54. package/lib/locale/it-IT.js +1 -0
  55. package/lib/locale/ja-JP.js +1 -0
  56. package/lib/locale/ko-KR.js +1 -0
  57. package/lib/locale/pl-PL.js +1 -0
  58. package/lib/locale/pt-BR.js +1 -0
  59. package/lib/locale/ru-RU.js +1 -0
  60. package/lib/locale/sk-SK.js +1 -0
  61. package/lib/locale/vi-VN.js +1 -0
  62. package/lib/locale/zh-CN.js +1 -0
  63. package/lib/locale/zh-HK.js +1 -0
  64. package/lib/locale/zh-TW.js +1 -0
  65. package/lib/types/commands/cell.command.d.ts +32 -0
  66. package/lib/types/commands/field.command.d.ts +53 -0
  67. package/lib/types/commands/record.command.d.ts +39 -0
  68. package/lib/types/commands/table.command.d.ts +18 -0
  69. package/lib/types/commands/undo-redo.d.ts +2 -0
  70. package/lib/types/commands/view.command.d.ts +107 -0
  71. package/lib/types/controllers/base-active-dirty.controller.d.ts +16 -0
  72. package/lib/types/controllers/base-formula-calculation.controller.d.ts +23 -0
  73. package/lib/types/controllers/base-formula-optional-identifier.d.ts +1 -0
  74. package/lib/types/controllers/base-remote-formula.controller.d.ts +13 -0
  75. package/lib/types/facade/f-base.d.ts +362 -0
  76. package/lib/types/facade/f-event.d.ts +61 -0
  77. package/lib/types/facade/f-field.d.ts +191 -0
  78. package/lib/types/facade/f-permission.d.ts +299 -0
  79. package/lib/types/facade/f-range.d.ts +179 -0
  80. package/lib/types/facade/f-record.d.ts +137 -0
  81. package/lib/types/facade/f-table.d.ts +769 -0
  82. package/lib/types/facade/f-univer.d.ts +148 -0
  83. package/lib/types/facade/f-view.d.ts +275 -0
  84. package/lib/types/facade/index.d.ts +10 -0
  85. package/lib/types/fields/date-format.d.ts +6 -0
  86. package/lib/types/fields/field-core-plugin.d.ts +21 -0
  87. package/lib/types/fields/number-format.d.ts +15 -0
  88. package/lib/types/index.d.ts +48 -0
  89. package/lib/types/locale/ar-SA.d.ts +3 -0
  90. package/lib/types/locale/ca-ES.d.ts +3 -0
  91. package/lib/types/locale/de-DE.d.ts +3 -0
  92. package/lib/types/locale/en-US.d.ts +59 -0
  93. package/lib/types/locale/es-ES.d.ts +3 -0
  94. package/lib/types/locale/fa-IR.d.ts +3 -0
  95. package/lib/types/locale/fr-FR.d.ts +3 -0
  96. package/lib/types/locale/id-ID.d.ts +3 -0
  97. package/lib/types/locale/it-IT.d.ts +3 -0
  98. package/lib/types/locale/ja-JP.d.ts +3 -0
  99. package/lib/types/locale/ko-KR.d.ts +3 -0
  100. package/lib/types/locale/pl-PL.d.ts +3 -0
  101. package/lib/types/locale/pt-BR.d.ts +3 -0
  102. package/lib/types/locale/ru-RU.d.ts +3 -0
  103. package/lib/types/locale/sk-SK.d.ts +3 -0
  104. package/lib/types/locale/vi-VN.d.ts +3 -0
  105. package/lib/types/locale/zh-CN.d.ts +3 -0
  106. package/lib/types/locale/zh-HK.d.ts +3 -0
  107. package/lib/types/locale/zh-TW.d.ts +3 -0
  108. package/lib/types/models/base-cell-data.d.ts +14 -0
  109. package/lib/types/models/base-snapshot.d.ts +1 -0
  110. package/lib/types/models/default-table.d.ts +12 -0
  111. package/lib/types/models/field-snapshot.d.ts +1 -0
  112. package/lib/types/models/record-snapshot.d.ts +1 -0
  113. package/lib/types/models/table-snapshot.d.ts +1 -0
  114. package/lib/types/models/value.d.ts +1 -0
  115. package/lib/types/models/view-snapshot.d.ts +1 -0
  116. package/lib/types/mutations/json1.mutation.d.ts +7 -0
  117. package/lib/types/mutations/utils.d.ts +2 -0
  118. package/lib/types/ot/json1-adapter.d.ts +103 -0
  119. package/lib/types/ot/json1-invalidation.d.ts +2 -0
  120. package/lib/types/ot/json1-op-applier.d.ts +6 -0
  121. package/lib/types/ot/json1-op-factory.d.ts +64 -0
  122. package/lib/types/ot/json1-path.d.ts +13 -0
  123. package/lib/types/plugin.d.ts +35 -0
  124. package/lib/types/search/base-search.d.ts +24 -0
  125. package/lib/types/services/base-active-dirty.service.d.ts +24 -0
  126. package/lib/types/services/base-command.service.d.ts +122 -0
  127. package/lib/types/services/base-compression.service.d.ts +46 -0
  128. package/lib/types/services/base-field-registry.service.d.ts +17 -0
  129. package/lib/types/services/base-formula.service.d.ts +71 -0
  130. package/lib/types/services/base-performance.service.d.ts +5 -0
  131. package/lib/types/services/base-permission.service.d.ts +76 -0
  132. package/lib/types/services/base-projection.service.d.ts +97 -0
  133. package/lib/types/services/base-resource.service.d.ts +15 -0
  134. package/lib/types/services/base-view-registry.service.d.ts +15 -0
  135. package/lib/types/views/view-core-plugin.d.ts +21 -0
  136. package/lib/umd/facade.js +1 -0
  137. package/lib/umd/index.js +1 -0
  138. package/lib/umd/locale/ar-SA.js +1 -0
  139. package/lib/umd/locale/ca-ES.js +1 -0
  140. package/lib/umd/locale/de-DE.js +1 -0
  141. package/lib/umd/locale/en-US.js +1 -0
  142. package/lib/umd/locale/es-ES.js +1 -0
  143. package/lib/umd/locale/fa-IR.js +1 -0
  144. package/lib/umd/locale/fr-FR.js +1 -0
  145. package/lib/umd/locale/id-ID.js +1 -0
  146. package/lib/umd/locale/it-IT.js +1 -0
  147. package/lib/umd/locale/ja-JP.js +1 -0
  148. package/lib/umd/locale/ko-KR.js +1 -0
  149. package/lib/umd/locale/pl-PL.js +1 -0
  150. package/lib/umd/locale/pt-BR.js +1 -0
  151. package/lib/umd/locale/ru-RU.js +1 -0
  152. package/lib/umd/locale/sk-SK.js +1 -0
  153. package/lib/umd/locale/vi-VN.js +1 -0
  154. package/lib/umd/locale/zh-CN.js +1 -0
  155. package/lib/umd/locale/zh-HK.js +1 -0
  156. package/lib/umd/locale/zh-TW.js +1 -0
  157. package/package.json +86 -0
@@ -0,0 +1,148 @@
1
+ import type { IBaseSnapshot } from '@univerjs/core';
2
+ import { FUniver } from '@univerjs/core/facade';
3
+ import { FBase } from './f-base';
4
+ export interface IFUniverBaseMixin {
5
+ createBase(snapshot: Partial<IBaseSnapshot>): FBase;
6
+ getActiveBase(): FBase | null;
7
+ getBase(baseId: string): FBase | null;
8
+ getBases(): FBase[];
9
+ }
10
+ /**
11
+ * Facade API mixin for creating and retrieving Univer Base units.
12
+ *
13
+ * Import `@univerjs-pro/bases/facade` once before creating the facade API so the
14
+ * Base methods are mixed into `FUniver`.
15
+ *
16
+ * @example Run the complete quick-start spec in this repository
17
+ * ```sh
18
+ * cd /Users/lilin/Documents/GitHub/univer-pro-2 \
19
+ * && pnpm --filter @univerjs-pro/bases test -- src/facade/__tests__/quick-start.spec.ts
20
+ * ```
21
+ * @example Create a Base facade and save the snapshot
22
+ * ```ts
23
+ * import { Univer } from '@univerjs/core';
24
+ * import { FUniver } from '@univerjs/core/facade';
25
+ * import { UniverBasesPlugin } from '@univerjs-pro/bases';
26
+ * import { BaseEventName } from '@univerjs-pro/bases/facade';
27
+ *
28
+ * const univer = new Univer();
29
+ * univer.registerPlugin(UniverBasesPlugin);
30
+ *
31
+ * const univerAPI = FUniver.newAPI(univer);
32
+ * const base = univerAPI.createBase({
33
+ * id: 'base-demo',
34
+ * name: 'Agent Work Queue',
35
+ * schemaVersion: 1,
36
+ * createdAt: Date.now(),
37
+ * updatedAt: Date.now(),
38
+ * tables: {},
39
+ * tableOrder: [],
40
+ * });
41
+ * const table = await base.createTable({ id: 'tasks', name: 'Tasks', primaryFieldName: 'Title' });
42
+ * const status = await table.addField({
43
+ * id: 'status',
44
+ * name: 'Status',
45
+ * type: 'singleSelect',
46
+ * config: { options: [{ id: 'todo', name: 'Todo', color: 'blue' }, { id: 'done', name: 'Done', color: 'green' }] },
47
+ * defaultValue: 'todo',
48
+ * });
49
+ * const record = await table.addRecord({
50
+ * id: 'task-1',
51
+ * values: { [table.getPrimaryFieldId()]: 'Write docs', [status.getId()]: 'todo' },
52
+ * });
53
+ * await record.setValue(status.getId(), 'done');
54
+ *
55
+ * const disposable = base.addEvent(BaseEventName.RecordChanged, (event) => {
56
+ * console.log(event.type, event.recordIds);
57
+ * });
58
+ * disposable.dispose();
59
+ * console.log(JSON.stringify(base.save(), null, 2));
60
+ * univer.dispose();
61
+ * ```
62
+ */
63
+ export declare class FUniverBaseMixin extends FUniver implements IFUniverBaseMixin {
64
+ /**
65
+ * Create a `UNIVER_BASE` unit and return its facade API object.
66
+ *
67
+ * Use this method for both new empty Bases and server-loaded Bases. The
68
+ * snapshot is the persisted model shape; the returned `FBase` is the
69
+ * runtime facade used for command execution, events, permissions, undo/redo,
70
+ * and saving back to a snapshot.
71
+ *
72
+ * @param snapshot Partial Base snapshot used to initialize the Base.
73
+ * Provide `id`, `schemaVersion`, `tables`, and `tableOrder` when loading a
74
+ * persisted server snapshot. For a new empty Base, pass `tables: {}` and
75
+ * `tableOrder: []`. Missing optional fields are normalized by the Base data
76
+ * model.
77
+ * @returns The created Base facade. Call `base.save()` or
78
+ * `base.getSnapshot()` to get the persisted snapshot after runtime edits.
79
+ * @example
80
+ * ```ts
81
+ * const base = univerAPI.createBase({
82
+ * id: 'base-1',
83
+ * name: 'Roadmap',
84
+ * schemaVersion: 1,
85
+ * createdAt: Date.now(),
86
+ * updatedAt: Date.now(),
87
+ * tables: {},
88
+ * tableOrder: [],
89
+ * });
90
+ * const snapshotForServer = base.save();
91
+ * ```
92
+ */
93
+ createBase(snapshot: Partial<IBaseSnapshot>): FBase;
94
+ /**
95
+ * Get the currently active Base unit.
96
+ *
97
+ * The active Base is the most recent current unit of type
98
+ * `UNIVER_BASE` in the Univer instance service. It is useful for shell
99
+ * integrations that should operate on the user's current Base without
100
+ * passing ids around.
101
+ *
102
+ * @returns The active Base facade, or `null` when no Base unit exists or no
103
+ * Base is active.
104
+ * @example
105
+ * ```ts
106
+ * const base = univerAPI.getActiveBase();
107
+ * if (base) {
108
+ * console.log(base.getId(), base.getName());
109
+ * }
110
+ * ```
111
+ */
112
+ getActiveBase(): FBase | null;
113
+ /**
114
+ * Get a Base unit by id.
115
+ *
116
+ * Use this after loading a known server unit id or when routing a facade
117
+ * operation from an external protocol request.
118
+ *
119
+ * @param baseId The persisted Base unit id.
120
+ * @returns The Base facade, or `null` if the id is missing or the unit is
121
+ * not a Base unit.
122
+ * @example
123
+ * ```ts
124
+ * const base = univerAPI.getBase('base-1');
125
+ * if (!base) throw new Error('Base was not loaded.');
126
+ * ```
127
+ */
128
+ getBase(baseId: string): FBase | null;
129
+ /**
130
+ * Get all Base units in the current Univer instance.
131
+ *
132
+ * This is useful for dashboards, server-side snapshot export, or agent
133
+ * tools that need to inspect every loaded Base.
134
+ *
135
+ * @returns All Base facades in instance-service order.
136
+ * @example
137
+ * ```ts
138
+ * const bases = univerAPI.getBases();
139
+ * const snapshots = bases.map((base) => base.save());
140
+ * ```
141
+ */
142
+ getBases(): FBase[];
143
+ private _wrap;
144
+ }
145
+ declare module '@univerjs/core/facade' {
146
+ interface FUniver extends IFUniverBaseMixin {
147
+ }
148
+ }
@@ -0,0 +1,275 @@
1
+ import type { BaseDataModel, FilterConfig, GroupConfig, ICommandService, IViewSnapshot, SortConfig, ViewFieldSetting, ViewSpecificConfig, ViewType } from '@univerjs/core';
2
+ import type { IBaseProjectionService } from '../services/base-projection.service';
3
+ import { FField } from './f-field';
4
+ /**
5
+ * Facade API object bound to a Base view.
6
+ *
7
+ * A view stores table projection settings such as filter, sort, group, field visibility, and view-specific config.
8
+ * The facade writes those settings through commands so projections, events, and
9
+ * collaboration invalidations stay in sync.
10
+ *
11
+ * @example Configure a grid projection
12
+ * ```ts
13
+ * const grid = await table.createView({ id: 'grid-main', name: 'Main Grid', type: 'grid' });
14
+ * await grid.updateConfig({ frozenFieldCount: 1 });
15
+ * await grid.setFilter({
16
+ * conjunction: 'and',
17
+ * conditions: [{ fieldId: 'status', operator: 'is', operand: 'done' }],
18
+ * });
19
+ * await grid.setSort([{ fieldId: 'progress', direction: 'desc' }]);
20
+ * await grid.setFieldVisible('internalNotes', false);
21
+ * const projection = grid.getProjection();
22
+ * ```
23
+ */
24
+ export declare class FView {
25
+ private readonly _base;
26
+ private readonly _tableId;
27
+ private readonly _viewId;
28
+ private readonly _commandService;
29
+ private readonly _projectionService;
30
+ constructor(_base: BaseDataModel, _tableId: string, _viewId: string, _commandService: ICommandService, _projectionService: IBaseProjectionService);
31
+ /**
32
+ * Get the view id.
33
+ * @returns The view id.
34
+ * @example
35
+ * ```ts
36
+ * console.log(view.getId());
37
+ * ```
38
+ */
39
+ getId(): string;
40
+ /**
41
+ * Get the view snapshot.
42
+ * @returns The view snapshot.
43
+ * @example
44
+ * ```ts
45
+ * const rawView = view.getView();
46
+ * ```
47
+ */
48
+ getView(): IViewSnapshot;
49
+ /**
50
+ * Get the view snapshot.
51
+ * @returns The view snapshot.
52
+ * @example
53
+ * ```ts
54
+ * const snapshot = view.getSnapshot();
55
+ * ```
56
+ */
57
+ getSnapshot(): IViewSnapshot;
58
+ /**
59
+ * Get the view name.
60
+ * @returns The view name.
61
+ * @example
62
+ * ```ts
63
+ * console.log(view.getName());
64
+ * ```
65
+ */
66
+ getName(): string;
67
+ /**
68
+ * Get the view type.
69
+ * @returns The view type.
70
+ * @example
71
+ * ```ts
72
+ * console.log(view.getType());
73
+ * ```
74
+ */
75
+ getType(): ViewType;
76
+ /**
77
+ * Rename this view.
78
+ * @param name The new view name.
79
+ * @example
80
+ * ```ts
81
+ * await view.setName('Release view');
82
+ * ```
83
+ */
84
+ setName(name: string): Promise<void>;
85
+ /**
86
+ * Get the view-specific config.
87
+ * @returns The view config.
88
+ * @example
89
+ * ```ts
90
+ * const config = view.getConfig();
91
+ * ```
92
+ */
93
+ getConfig<T extends ViewSpecificConfig>(): T;
94
+ /**
95
+ * Update the view-specific config.
96
+ *
97
+ * Use this for config fields that belong to the view type, for example
98
+ * frozen field counts for grid, date field ids for calendar, and timeline
99
+ * field ids for gantt.
100
+ *
101
+ * @param patch Partial config to merge into the existing view config.
102
+ * @example
103
+ * ```ts
104
+ * await view.updateConfig({ frozenFieldCount: 2 });
105
+ * ```
106
+ */
107
+ updateConfig<T extends ViewSpecificConfig>(patch: Partial<T>): Promise<void>;
108
+ /**
109
+ * Get the view filter.
110
+ * @returns The filter config, or null when no filter is set.
111
+ * @example
112
+ * ```ts
113
+ * const filter = view.getFilter();
114
+ * ```
115
+ */
116
+ getFilter(): FilterConfig | null;
117
+ /**
118
+ * Set the view filter.
119
+ *
120
+ * The filter affects view projection and methods that read through the view,
121
+ * such as `table.getRecords({ viewId })` and `base.searchTable(..., { viewId })`.
122
+ *
123
+ * @param filter The filter config, or `null` to clear it.
124
+ * @example
125
+ * ```ts
126
+ * await view.setFilter({
127
+ * conjunction: 'and',
128
+ * conditions: [{ fieldId: 'status', operator: 'is', operand: 'done' }],
129
+ * });
130
+ * ```
131
+ */
132
+ setFilter(filter: FilterConfig | null): Promise<void>;
133
+ /**
134
+ * Get the view sort rules.
135
+ * @returns Sort rules.
136
+ * @example
137
+ * ```ts
138
+ * const sort = view.getSort();
139
+ * ```
140
+ */
141
+ getSort(): SortConfig[];
142
+ /**
143
+ * Set the view sort rules.
144
+ *
145
+ * Sort rules are applied in array order. Each rule references a field id,
146
+ * not a display name.
147
+ *
148
+ * @param sort Sort rules. Pass `[]` to clear sorting.
149
+ * @example
150
+ * ```ts
151
+ * await view.setSort([{ fieldId: 'priority', direction: 'asc' }]);
152
+ * ```
153
+ */
154
+ setSort(sort: SortConfig[]): Promise<void>;
155
+ /**
156
+ * Get the view group rules.
157
+ * @returns Group rules.
158
+ * @example
159
+ * ```ts
160
+ * const group = view.getGroup();
161
+ * ```
162
+ */
163
+ getGroup(): GroupConfig[];
164
+ /**
165
+ * Set the view group rules.
166
+ *
167
+ * Group rules are view projection metadata. They do not mutate record
168
+ * values or field definitions.
169
+ *
170
+ * @param group Group rules. Pass `[]` to clear grouping.
171
+ * @example
172
+ * ```ts
173
+ * await view.setGroup([{ fieldId: 'status' }]);
174
+ * ```
175
+ */
176
+ setGroup(group: GroupConfig[]): Promise<void>;
177
+ /**
178
+ * Get settings for a field in this view.
179
+ * @param fieldId The field id whose view-local settings should be read.
180
+ * @returns The field settings in this view.
181
+ * @example
182
+ * ```ts
183
+ * const settings = view.getFieldSettings('status');
184
+ * ```
185
+ */
186
+ getFieldSettings(fieldId: string): ViewFieldSetting;
187
+ /**
188
+ * Get visible fields in this view.
189
+ * @returns Visible field facades in view order.
190
+ * @example
191
+ * ```ts
192
+ * const fields = view.getVisibleFields();
193
+ * ```
194
+ */
195
+ getVisibleFields(): FField[];
196
+ /**
197
+ * Show or hide a field in this view.
198
+ *
199
+ * This changes only the view-local field setting. The table field remains
200
+ * present and other views are not affected.
201
+ *
202
+ * @param fieldId The field id.
203
+ * @param visible Whether the field should be visible in this view.
204
+ * @example
205
+ * ```ts
206
+ * await view.setFieldVisible('progress', true);
207
+ * ```
208
+ */
209
+ setFieldVisible(fieldId: string, visible: boolean): Promise<void>;
210
+ /**
211
+ * Set a field width in this view.
212
+ * @param fieldId The field id.
213
+ * @param width The width in pixels for this view. Use a positive integer
214
+ * that matches the UI's column width constraints.
215
+ * @example
216
+ * ```ts
217
+ * await view.setFieldWidth('title', 240);
218
+ * ```
219
+ */
220
+ setFieldWidth(fieldId: string, width: number): Promise<void>;
221
+ /**
222
+ * Move a field in this view.
223
+ * @param fieldId The field id.
224
+ * @param target Target position descriptor. Pass exactly one of
225
+ * `beforeFieldId` or `afterFieldId`.
226
+ * @param target.beforeFieldId Optional field id to move this field before.
227
+ * @param target.afterFieldId Optional field id to move this field after.
228
+ * @example
229
+ * ```ts
230
+ * await view.moveField('status', { afterFieldId: 'title' });
231
+ * ```
232
+ */
233
+ moveField(fieldId: string, target: {
234
+ beforeFieldId?: string;
235
+ afterFieldId?: string;
236
+ }): Promise<void>;
237
+ /**
238
+ * Move this view relative to another view.
239
+ * @param target Target position descriptor. Pass exactly one of
240
+ * `beforeViewId` or `afterViewId`.
241
+ * @param target.beforeViewId Optional view id to move this view before.
242
+ * @param target.afterViewId Optional view id to move this view after.
243
+ * @example
244
+ * ```ts
245
+ * await view.move({ beforeViewId: 'grid' });
246
+ * ```
247
+ */
248
+ move(target: {
249
+ beforeViewId?: string;
250
+ afterViewId?: string;
251
+ }): Promise<void>;
252
+ /**
253
+ * Delete this view.
254
+ * @example
255
+ * ```ts
256
+ * await view.delete();
257
+ * ```
258
+ */
259
+ delete(): Promise<void>;
260
+ /**
261
+ * Get the projected rows and fields for this view.
262
+ *
263
+ * The projection is computed from the current table snapshot plus this
264
+ * view's filter, sort, group, field order, visibility, and type-specific
265
+ * config.
266
+ *
267
+ * @returns The view projection.
268
+ * @example
269
+ * ```ts
270
+ * const projection = view.getProjection();
271
+ * ```
272
+ */
273
+ getProjection(): ReturnType<IBaseProjectionService['getProjection']>;
274
+ private _getView;
275
+ }
@@ -0,0 +1,10 @@
1
+ export { type IBaseSchemaSnapshot, type ICopyTableInput, type ICreateTableInput, FBase, type ISearchTableInput } from './f-base';
2
+ export { BaseEventName } from './f-event';
3
+ export type { IBaseEventMap, IBaseCellValueChangedEvent, IBaseFieldChangedEvent, IBaseRecordChangedEvent, IBaseTableChangedEvent, IBaseViewChangedEvent } from './f-event';
4
+ export { FField } from './f-field';
5
+ export { FBasePermission, FTablePermission } from './f-permission';
6
+ export { FBaseRange, type BaseRangeValues } from './f-range';
7
+ export { FRecord } from './f-record';
8
+ export { type IAddFieldInput, type IAddRecordInput, type IBaseRecordFilter, type IBaseTableSchemaSnapshot, type ICreateViewInput, FTable, type IListRecordOptions, type IQueryRecordsResult } from './f-table';
9
+ export { FUniverBaseMixin, type IFUniverBaseMixin } from './f-univer';
10
+ export { FView } from './f-view';
@@ -0,0 +1,6 @@
1
+ import type { FieldConfig } from '@univerjs/core';
2
+ export declare function dateToExcelSerial(value: number | Date): number;
3
+ export declare function excelSerialToDateMs(value: number): number;
4
+ export declare function normalizeBaseDateSerial(value: unknown): number | null;
5
+ export declare function baseDateSerialToDateMs(value: unknown): number | null;
6
+ export declare function formatBaseDateValue(value: unknown, config?: FieldConfig | Record<string, unknown>): string;
@@ -0,0 +1,21 @@
1
+ import type { BaseCellValue as CellValue, FieldCapabilities, FieldConfig, FieldType, FilterOperator, IFieldSnapshot, ValidationResult } from '@univerjs/core';
2
+ export interface IFieldTypePlugin {
3
+ type: FieldType;
4
+ enabled: boolean;
5
+ visibleInCreateMenu: boolean;
6
+ }
7
+ export interface IFieldCorePlugin<TValue extends CellValue = CellValue, TConfig = FieldConfig> extends IFieldTypePlugin {
8
+ i18nKey: string;
9
+ createDefaultConfig(): TConfig;
10
+ createDefaultValue(field: IFieldSnapshot): TValue | null;
11
+ normalize(input: unknown, field: IFieldSnapshot): TValue | null;
12
+ validate(value: unknown, field: IFieldSnapshot): ValidationResult;
13
+ compare(a: TValue | null, b: TValue | null, field: IFieldSnapshot): number;
14
+ filter(value: TValue | null, operator: FilterOperator | string, operand: unknown, field: IFieldSnapshot): boolean;
15
+ toPlainText(value: TValue | null, field: IFieldSnapshot): string;
16
+ fromPlainText(text: string, field: IFieldSnapshot): TValue | null;
17
+ getCapabilities(field: IFieldSnapshot): FieldCapabilities;
18
+ }
19
+ export declare function createCoreFieldPlugins(): IFieldCorePlugin[];
20
+ export type FieldTypePlugin = IFieldTypePlugin;
21
+ export type FieldCorePlugin<TValue extends CellValue = CellValue, TConfig = FieldConfig> = IFieldCorePlugin<TValue, TConfig>;
@@ -0,0 +1,15 @@
1
+ export type BaseSeparatorStyle = 'local' | 'commaPeriod' | 'periodComma' | 'spaceComma' | 'spacePeriod';
2
+ export type BaseNumberAbbreviation = 'none' | 'K' | 'M' | 'B';
3
+ export interface IBaseNumberFormatConfig {
4
+ decimalPlaces?: number;
5
+ separatorStyle?: BaseSeparatorStyle | string;
6
+ locale?: string;
7
+ useThousands?: boolean;
8
+ abbreviation?: BaseNumberAbbreviation | string;
9
+ allowNegative?: boolean;
10
+ currencySymbol?: string;
11
+ }
12
+ export declare function buildBaseNumberFormatPattern(config: IBaseNumberFormatConfig): string;
13
+ export declare function formatBaseNumberValue(value: number, config: IBaseNumberFormatConfig): string;
14
+ export declare function inferBaseSeparatorStyle(locale?: string): Exclude<BaseSeparatorStyle, 'local'>;
15
+ export type BaseNumberFormatConfig = IBaseNumberFormatConfig;
@@ -0,0 +1,48 @@
1
+ export { type ISetBaseRangeValuesCommandParams, type ISetBaseRecordValuesCommandParams, type IUpdateBaseCellCommandParams, SetBaseRangeValuesCommand, SetBaseRecordValuesCommand, UpdateBaseCellCommand, } from './commands/cell.command';
2
+ export { ChangeBaseFieldTypeCommand, CreateBaseFieldCommand, DeleteBaseFieldCommand, DuplicateBaseFieldCommand, type IChangeBaseFieldTypeCommandParams, type ICreateBaseFieldCommandParams, type IDeleteBaseFieldCommandParams, type IDuplicateBaseFieldCommandParams, type IMoveBaseFieldCommandParams, type IUpdateBaseFieldCommandParams, type IUpdateBaseFieldDescriptionCommandParams, MoveBaseFieldCommand, UpdateBaseFieldCommand, UpdateBaseFieldDescriptionCommand, } from './commands/field.command';
3
+ export { BatchCreateBaseRecordsCommand, BatchDeleteBaseRecordsCommand, CreateBaseRecordCommand, DeleteBaseRecordCommand, DuplicateBaseRecordCommand, type IBatchCreateBaseRecordsCommandParams, type IBatchDeleteBaseRecordsCommandParams, type ICreateBaseRecordCommandParams, type IDeleteBaseRecordCommandParams, type IDuplicateBaseRecordCommandParams, type IUpdateBaseRecordOrderCommandParams, UpdateBaseRecordOrderCommand, } from './commands/record.command';
4
+ export { CreateBaseTableCommand, DeleteBaseTableCommand, type ICreateBaseTableCommandParams, type IDeleteBaseTableCommandParams, type IRenameBaseTableCommandParams, RenameBaseTableCommand, } from './commands/table.command';
5
+ export { CreateBaseViewCommand, DeleteBaseViewCommand, EnsureBaseTemporalViewDateFieldsCommand, type ICreateBaseViewCommandParams, type IDeleteBaseViewCommandParams, type IEnsureBaseTemporalViewDateFieldsCommandParams, type IMoveBaseViewCommandParams, type IRenameBaseViewCommandParams, type ISetBaseKanbanGroupFieldCommandParams, type ISetBaseViewFieldOrderCommandParams, type ISetBaseViewFieldVisibleCommandParams, type ISetBaseViewFieldWidthCommandParams, type ISetBaseViewFilterCommandParams, type ISetBaseViewGroupCommandParams, type ISetBaseViewSortCommandParams, type IUpdateBaseKanbanConfigCommandParams, type IUpdateBaseViewConfigCommandParams, MoveBaseViewCommand, RenameBaseViewCommand, SetBaseKanbanGroupFieldCommand, SetBaseViewFieldOrderCommand, SetBaseViewFieldVisibleCommand, SetBaseViewFieldWidthCommand, SetBaseViewFilterCommand, SetBaseViewGroupCommand, SetBaseViewSortCommand, UpdateBaseKanbanConfigCommand, UpdateBaseViewConfigCommand, } from './commands/view.command';
6
+ export { BaseActiveDirtyController } from './controllers/base-active-dirty.controller';
7
+ export { BaseFormulaCalculationController } from './controllers/base-formula-calculation.controller';
8
+ export { baseDateSerialToDateMs, dateToExcelSerial, excelSerialToDateMs, formatBaseDateValue, normalizeBaseDateSerial } from './fields/date-format';
9
+ export { createCoreFieldPlugins } from './fields/field-core-plugin';
10
+ export type { IFieldCorePlugin, IFieldTypePlugin } from './fields/field-core-plugin';
11
+ export type { FieldCorePlugin, FieldTypePlugin } from './fields/field-core-plugin';
12
+ export { buildBaseNumberFormatPattern, formatBaseNumberValue, type IBaseNumberFormatConfig, inferBaseSeparatorStyle } from './fields/number-format';
13
+ export type { BaseNumberFormatConfig } from './fields/number-format';
14
+ export { ensureBaseTableCellLayout, fromBaseCellData, getBaseAttachmentResourceKey, getBaseCell, getBaseCellFormulaValue, getBaseCellValue, normalizeAttachmentValue, readAttachmentResources, setBaseCell, toBaseCellData, toBaseRecordValue, writeAttachmentResources } from './models/base-cell-data';
15
+ export { createDefaultBaseTableSnapshot, type ICreateDefaultBaseTableSnapshotOptions } from './models/default-table';
16
+ export type { CreateDefaultBaseTableSnapshotOptions } from './models/default-table';
17
+ export { ApplyBaseJson1Mutation, type IApplyBaseJson1MutationParams } from './mutations/json1.mutation';
18
+ export { BaseJson1Adapter } from './ot/json1-adapter';
19
+ export type { BaseJson1Command, IBaseCollaborativeOp, IBaseJson1Adapter } from './ot/json1-adapter';
20
+ export type { BaseCollaborativeOp } from './ot/json1-adapter';
21
+ export { getBaseInvalidationsFromJson1 } from './ot/json1-invalidation';
22
+ export { BaseJson1OpApplier } from './ot/json1-op-applier';
23
+ export { BaseJson1OpFactory, type ICreateFieldOpInput, type ISetRangeValuesPatch, type ISetRecordValuesPatch } from './ot/json1-op-factory';
24
+ export type { CreateFieldOpInput, SetRangeValuesPatch, SetRecordValuesPatch } from './ot/json1-op-factory';
25
+ export { baseJson1Path } from './ot/json1-path';
26
+ export { BASE_SYNC_MUTATIONS, BASES_PLUGIN_NAME, UniverBasesPlugin, UniverRemoteBasesPlugin } from './plugin';
27
+ export { type IBaseTableSearchMatch, type IBaseTableSearchRequest, type IBaseTableSearchResult, searchBaseTable } from './search/base-search';
28
+ export type { BaseTableSearchMatch, BaseTableSearchRequest, BaseTableSearchResult } from './search/base-search';
29
+ export { type BaseFormulaDirtySuperTableMap, createBaseStructureDirtySuperTableMap, type IBaseFormulaDirtyRange, type IBaseRangeValueDirtyParams, setBaseRangeValuesToDirtyRanges } from './services/base-active-dirty.service';
30
+ export type { BaseFormulaDirtyRange } from './services/base-active-dirty.service';
31
+ export { BaseCommandService, type IBaseCommandRuntimeContext, IBaseCommandService, type IBaseCommandService as IBaseCommandServiceType } from './services/base-command.service';
32
+ export type { BaseCommandRuntimeContext } from './services/base-command.service';
33
+ export { compressBaseRangeValuesPayload, compressBaseSnapshot, type CompressedBaseRangeValue, decompressBaseRangeValuesPayload, decompressBaseSnapshot, type IBaseRangeValuesPayload, type ICompressedBaseCellData, type ICompressedBaseRangeValuesPayload, type ICompressedBaseSnapshot, type ICompressedBaseTableSnapshot, isCompressedBaseRangeValuesPayload, isCompressedBaseSnapshot } from './services/base-compression.service';
34
+ export type { BaseRangeValuesPayload, CompressedBaseCellData, CompressedBaseRangeValuesPayload, CompressedBaseSnapshot, CompressedBaseTableSnapshot } from './services/base-compression.service';
35
+ export { BaseFieldRegistryService, IBaseFieldRegistryService, type IBaseFieldRegistryService as IBaseFieldRegistryServiceType } from './services/base-field-registry.service';
36
+ export { BaseFormulaService, createBaseFormulaCalculationDataset, createBaseFormulaResultPatches, type IBaseFormulaCalculationDataset, type IBaseFormulaCalculationResult, type IBaseFormulaDependency, type IBaseFormulaResultPatchGroup, type IBaseFormulaSuperTableReference, type IBaseFormulaSuperTableServiceLike, type IBaseFormulaValidationResult } from './services/base-formula.service';
37
+ export type { BaseFormulaSuperTableReference, BaseFormulaSuperTableServiceLike, BaseFormulaValidationResult } from './services/base-formula.service';
38
+ export { type BasePerformanceDetails, isBasePerformanceTracingEnabled, logBasePerformance, traceBasePerformance, traceBasePerformanceAsync } from './services/base-performance.service';
39
+ export { BasePermissionService, IBasePermissionService, type IBasePermissionService as IBasePermissionServiceType } from './services/base-permission.service';
40
+ export type { BaseFieldPermission, BasePermissionSnapshot, BaseRecordPermission, BaseTablePermission } from './services/base-permission.service';
41
+ export { BaseProjectionService, IBaseProjectionService, type IBaseProjectionService as IBaseProjectionServiceType } from './services/base-projection.service';
42
+ export { BaseResourceService, IBaseResourceService, type IBaseResourceService as IBaseResourceServiceType } from './services/base-resource.service';
43
+ export { BaseViewRegistryService, IBaseViewRegistryService, type IBaseViewRegistryService as IBaseViewRegistryServiceType } from './services/base-view-registry.service';
44
+ export { createCoreViewPlugins } from './views/view-core-plugin';
45
+ export type { IProjectionContext, IViewCorePlugin, IViewRepairResult } from './views/view-core-plugin';
46
+ export type { ProjectionContext, ViewCorePlugin, ViewRepairResult } from './views/view-core-plugin';
47
+ export { BaseDataModel } from '@univerjs/core';
48
+ export type { BaseHitTestResult, BaseId, BaseInvalidation, BaseSelection, BaseViewProjection, CalendarProjection, CalendarViewConfig, CardLayoutConfig, BaseCellValue as CellValue, FieldCapabilities, FieldConfig, FieldId, FieldType, FilterCondition, FilterConfig, FilterOperator, GalleryCardSelection, GalleryProjection, GalleryViewConfig, GanttBarSelection, GanttCellSelection, GanttProjection, GanttTimeColumn, GanttViewConfig, GridCellSelection, GridFieldSelection, GridProjection, GridRecordSelection, GridViewConfig, GroupConfig, IBaseSnapshot, IFieldSnapshot, InvalidViewProjection, IRecordSnapshot, ITableSnapshot, IViewSnapshot, KanbanCardSelection, KanbanProjection, KanbanViewConfig, BasePrimitiveCellValue as PrimitiveCellValue, ProjectedField, ProjectedGroup, ProjectedRow, RecordId, Rect, SortConfig, TableId, ValidationResult, ViewFieldSetting, ViewId, Viewport, ViewProjection, ViewSpecificConfig, ViewType, } from '@univerjs/core';
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,59 @@
1
+ declare const locale: {
2
+ bases: {
3
+ fieldType: {
4
+ text: string;
5
+ singleSelect: string;
6
+ multiSelect: string;
7
+ person: string;
8
+ group: string;
9
+ date: string;
10
+ attachment: string;
11
+ number: string;
12
+ checkbox: string;
13
+ link: string;
14
+ formula: string;
15
+ lookup: string;
16
+ flow: string;
17
+ button: string;
18
+ numbering: string;
19
+ phone: string;
20
+ email: string;
21
+ location: string;
22
+ barcode: string;
23
+ progress: string;
24
+ currency: string;
25
+ rating: string;
26
+ twoWayLink: string;
27
+ recordId: string;
28
+ createdBy: string;
29
+ updatedBy: string;
30
+ createdAt: string;
31
+ updatedAt: string;
32
+ summary: string;
33
+ };
34
+ viewType: {
35
+ grid: string;
36
+ kanban: string;
37
+ calendar: string;
38
+ gantt: string;
39
+ gallery: string;
40
+ };
41
+ error: {
42
+ fieldNameRequired: string;
43
+ invalidFieldType: string;
44
+ invalidCellValue: string;
45
+ invalidKanbanGroupField: string;
46
+ invalidCalendarDateField: string;
47
+ invalidGanttDateField: string;
48
+ };
49
+ command: {
50
+ updateCell: string;
51
+ createField: string;
52
+ deleteField: string;
53
+ createRecord: string;
54
+ deleteRecord: string;
55
+ updateViewConfig: string;
56
+ };
57
+ };
58
+ };
59
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import type enUS from './en-US';
2
+ declare const locale: typeof enUS;
3
+ export default locale;