@univerjs-pro/bases 1.0.0-beta.0 → 1.0.0-beta.2
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 +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/validate-base-formula.command.d.ts +8 -0
- package/lib/types/controllers/base-formula-calculation.controller.d.ts +1 -0
- package/lib/types/facade/f-base.d.ts +21 -7
- package/lib/types/facade/f-enum.d.ts +2 -1
- package/lib/types/facade/f-table.d.ts +47 -7
- package/lib/types/index.d.ts +6 -0
- package/lib/types/models/base-table-name.d.ts +8 -0
- package/lib/types/ot/json1-op-factory.d.ts +1 -1
- package/lib/types/services/base-formula.service.d.ts +2 -23
- 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 +8 -8
package/lib/locale/zh-TW.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x255bf0=_0x13e3;function _0x13e3(_0x2bb874,_0x1bc49a){_0x2bb874=_0x2bb874-0x15d;const _0x54265a=_0x5426();let _0x13e3cb=_0x54265a[_0x2bb874];return _0x13e3cb;}(function(_0x3dfd1b,_0x4dde21){const _0x14468d=_0x13e3,_0x2dd4eb=_0x3dfd1b();while(!![]){try{const _0x1d5df0=-parseInt(_0x14468d(0x167))/0x1+-parseInt(_0x14468d(0x15f))/0x2*(-parseInt(_0x14468d(0x16a))/0x3)+parseInt(_0x14468d(0x173))/0x4*(parseInt(_0x14468d(0x174))/0x5)+-parseInt(_0x14468d(0x17a))/0x6*(parseInt(_0x14468d(0x16d))/0x7)+-parseInt(_0x14468d(0x175))/0x8+parseInt(_0x14468d(0x161))/0x9+-parseInt(_0x14468d(0x15d))/0xa*(parseInt(_0x14468d(0x177))/0xb);if(_0x1d5df0===_0x4dde21)break;else _0x2dd4eb['push'](_0x2dd4eb['shift']());}catch(_0x26f46c){_0x2dd4eb['push'](_0x2dd4eb['shift']());}}}(_0x5426,0x7fb79));const e={'bases':{'fieldType':{'text':'文字','singleSelect':'單選','multiSelect':'多選','person':'人員','group':'分組','date':'日期','attachment':'附件','number':'數字','checkbox':_0x255bf0(0x17e),'link':'連結','formula':'公式','lookup':'查詢','flow':'流程','button':'按鈕','numbering':'編號','phone':_0x255bf0(0x171),'email':_0x255bf0(0x166),'location':'位置','barcode':'條碼','progress':'進度','currency':'貨幣','rating':'評分','recordLink':_0x255bf0(0x160),'recordId':_0x255bf0(0x172),'createdBy':'建立人','updatedBy':_0x255bf0(0x16b),'createdAt':_0x255bf0(0x168),'updatedAt':_0x255bf0(0x162),'summary':'彙總'},'fieldConfig':{'textPlaceholder':_0x255bf0(0x17d),'linkPlaceholder':_0x255bf0(0x15e)},'viewType':{'grid':'表格','kanban':'看板','calendar':_0x255bf0(0x17c),'gantt':'甘特圖','gallery':'圖庫'},'error':{'fieldNameRequired':_0x255bf0(0x178),'invalidFieldType':_0x255bf0(0x179),'invalidCellValue':_0x255bf0(0x17b),'invalidKanbanGroupField':_0x255bf0(0x16e),'invalidCalendarDateField':_0x255bf0(0x16c),'invalidGanttDateField':_0x255bf0(0x164)},'command':{'updateCell':_0x255bf0(0x170),'createField':_0x255bf0(0x176),'deleteField':_0x255bf0(0x169),'createRecord':_0x255bf0(0x16f),'deleteRecord':_0x255bf0(0x163),'updateViewConfig':_0x255bf0(0x165)}}};function _0x5426(){const _0x468180=['儲存格值無效','行事曆','輸入內容','核取方塊','690490AVUWvF','輸入\x20URL(例如\x20univer.ai\x20或\x20https://univer.ai/skills)。','185854wBSMCf','關聯記錄','7090740LbcmVK','更新時間','刪除記錄','甘特圖檢視需要開始和結束日期欄位','更新檢視設定','電子郵件','736355GthQGp','建立時間','刪除欄位','21lqlJLj','更新人','行事曆需要日期欄位','1988nkuqav','看板需要可分組欄位','建立記錄','更新儲存格','電話號碼','記錄\x20ID','148kgMBFC','72845mciBAu','1208632YFkHoA','建立欄位','77iXOjFy','欄位標題不能為空','欄位類型無效','1764DqhMdZ'];_0x5426=function(){return _0x468180;};return _0x5426();}export{e as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ICommand } from '@univerjs/core';
|
|
2
|
+
import type { IBaseFormulaValidationResult } from '../../services/base-formula.service';
|
|
3
|
+
export interface IValidateBaseFormulaCommandParams {
|
|
4
|
+
unitId: string;
|
|
5
|
+
tableId: string;
|
|
6
|
+
formula: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const ValidateBaseFormulaCommand: ICommand<IValidateBaseFormulaCommandParams, IBaseFormulaValidationResult>;
|
|
@@ -17,6 +17,7 @@ export declare class BaseFormulaCalculationController extends Disposable {
|
|
|
17
17
|
private _scheduleSuperTableSync;
|
|
18
18
|
private _syncSuperTables;
|
|
19
19
|
private _removeSuperTables;
|
|
20
|
+
private _executeSuperTableMutationWhileActive;
|
|
20
21
|
private _enqueueFormulaSync;
|
|
21
22
|
private _applyFormulaResult;
|
|
22
23
|
}
|
|
@@ -4,6 +4,7 @@ import { ICommandService, Injector, IResourceLoaderService } from '@univerjs/cor
|
|
|
4
4
|
import { FBaseTable } from './f-table';
|
|
5
5
|
export interface IBaseSchemaSnapshot {
|
|
6
6
|
id: string;
|
|
7
|
+
/** Human-readable Base display name. */
|
|
7
8
|
name: string;
|
|
8
9
|
tables: IBaseTableSchemaSnapshot[];
|
|
9
10
|
}
|
|
@@ -98,8 +99,11 @@ export declare class FBase {
|
|
|
98
99
|
*/
|
|
99
100
|
getTableById(tableId: string): FBaseTable | null;
|
|
100
101
|
/**
|
|
101
|
-
* Get a table by name.
|
|
102
|
-
*
|
|
102
|
+
* Get a table by its human-readable display name.
|
|
103
|
+
*
|
|
104
|
+
* This method does not look up the stable identifier used in formulas. To author a
|
|
105
|
+
* structured reference, get the table first and call `FBaseTable.getFormulaName()`.
|
|
106
|
+
* @param {string} displayName The table display name.
|
|
103
107
|
* @returns {FBaseTable | null} The table facade, or null if the table does not exist.
|
|
104
108
|
* @example
|
|
105
109
|
* ```ts
|
|
@@ -108,21 +112,31 @@ export declare class FBase {
|
|
|
108
112
|
* console.log(fBaseTable);
|
|
109
113
|
* ```
|
|
110
114
|
*/
|
|
111
|
-
getTableByName(
|
|
115
|
+
getTableByName(displayName: string): FBaseTable | null;
|
|
112
116
|
/**
|
|
113
117
|
* Insert a new table into the Base.
|
|
114
|
-
*
|
|
118
|
+
*
|
|
119
|
+
* The display name becomes an Excel worksheet name during export. It must contain
|
|
120
|
+
* 1-31 characters, not start or end with an apostrophe, not contain `: \\ / ? * [ ]`,
|
|
121
|
+
* and be unique within the Base (case-insensitive). It may differ from the stable formula name.
|
|
122
|
+
* Use the returned table's `getFormulaName()` when authoring structured references.
|
|
123
|
+
* @param {string} displayName The human-readable table display name.
|
|
115
124
|
* @param {object} [options] Optional parameters for table creation.
|
|
116
125
|
* @param {number} [options.index] Optional insertion index in the Base table order.
|
|
117
126
|
* @param {string} [options.primaryFieldName] Optional name for the primary field of the new table.
|
|
118
127
|
* @param {Partial<ITableSnapshot>} [options.table] Optional partial table snapshot to override default values.
|
|
128
|
+
* If it includes `name`, that value is validated and used instead of `displayName`.
|
|
119
129
|
* @returns {FBaseTable} The newly created table facade.
|
|
130
|
+
* @throws {Error} If the effective display name violates the Excel worksheet-name rules.
|
|
131
|
+
* The error includes both the complete contract and the specific reason, so callers and agents
|
|
132
|
+
* can correct the input before retrying.
|
|
120
133
|
*
|
|
121
134
|
* @example
|
|
122
135
|
* ```ts
|
|
123
136
|
* const fBase = univerAPI.getActiveBase();
|
|
124
|
-
* const fBaseTable = fBase.insertTable('
|
|
125
|
-
* console.log(fBaseTable);
|
|
137
|
+
* const fBaseTable = fBase.insertTable('Risk tracker');
|
|
138
|
+
* console.log(fBaseTable.getName()); // Human-readable display name: "Risk tracker"
|
|
139
|
+
* console.log(fBaseTable.getFormulaName()); // Stable name for formulas: "Risk_tracker"
|
|
126
140
|
* ```
|
|
127
141
|
*
|
|
128
142
|
* @example Full table creation flow
|
|
@@ -164,7 +178,7 @@ export declare class FBase {
|
|
|
164
178
|
* console.log(fBaseTable.getTable());
|
|
165
179
|
* ```
|
|
166
180
|
*/
|
|
167
|
-
insertTable(
|
|
181
|
+
insertTable(displayName: string, options?: {
|
|
168
182
|
index?: number;
|
|
169
183
|
table?: Partial<Omit<ITableSnapshot, 'id'>>;
|
|
170
184
|
primaryFieldName?: string;
|
|
@@ -34,8 +34,9 @@ export interface IFBaseEnumMixin {
|
|
|
34
34
|
* table.addField('Progress', univerAPI.Enum.BaseFieldType.Progress, { field: { config: { start: 0, end: 100 } } });
|
|
35
35
|
* table.addField('Budget', univerAPI.Enum.BaseFieldType.Currency, { field: { config: { currencySymbol: '$', decimalPlaces: 2 } } });
|
|
36
36
|
* table.addField('Rating', univerAPI.Enum.BaseFieldType.Rating, { field: { config: { min: 1, max: 5 } } });
|
|
37
|
+
* const formulaTableName = table.getFormulaName();
|
|
37
38
|
* const formula = table.addField('Total', univerAPI.Enum.BaseFieldType.Formula, {
|
|
38
|
-
* field: { config: { formula:
|
|
39
|
+
* field: { config: { formula: `=SUM(${formulaTableName}[[#This Row],[Amount]],${formulaTableName}[[#This Row],[Budget]])` } },
|
|
39
40
|
* externalReferences: [], // Required; this formula only uses fields in the Host Base.
|
|
40
41
|
* });
|
|
41
42
|
* const numbering = table.addField('Sequence', univerAPI.Enum.BaseFieldType.Numbering);
|
|
@@ -40,7 +40,10 @@ export interface IQueryRecordsResult {
|
|
|
40
40
|
}
|
|
41
41
|
export interface IBaseTableSchemaSnapshot {
|
|
42
42
|
id: string;
|
|
43
|
+
/** Worksheet-compatible display name. Do not use it as a structured-reference identifier. */
|
|
43
44
|
name: string;
|
|
45
|
+
/** Stable table identifier for Excel structured references. */
|
|
46
|
+
formulaName: string;
|
|
44
47
|
primaryFieldId: string;
|
|
45
48
|
fieldIds: string[];
|
|
46
49
|
viewIds: string[];
|
|
@@ -299,8 +302,10 @@ export declare class FBaseTable {
|
|
|
299
302
|
*/
|
|
300
303
|
setHierarchyField(fieldId: string | null): boolean;
|
|
301
304
|
/**
|
|
302
|
-
* Get the table name.
|
|
303
|
-
*
|
|
305
|
+
* Get the human-readable table display name.
|
|
306
|
+
*
|
|
307
|
+
* Do not use this value in formulas. Use `getFormulaName()` for structured references.
|
|
308
|
+
* @returns {string} The human-readable table display name.
|
|
304
309
|
* @example
|
|
305
310
|
* ```ts
|
|
306
311
|
* const fBase = univerAPI.getActiveBase();
|
|
@@ -310,8 +315,40 @@ export declare class FBaseTable {
|
|
|
310
315
|
*/
|
|
311
316
|
getName(): string;
|
|
312
317
|
/**
|
|
313
|
-
*
|
|
314
|
-
*
|
|
318
|
+
* Get the stable canonical OOXML-compatible table name used in structured formula references.
|
|
319
|
+
* The name is allocated when the table is created or a historical snapshot is migrated;
|
|
320
|
+
* later display-name changes do not change formula identity. Always use the returned name; `table` is not
|
|
321
|
+
* a reserved alias unless it is the actual identifier returned by this method.
|
|
322
|
+
*
|
|
323
|
+
* Base Formula fields use Excel structured-reference scopes. Use
|
|
324
|
+
* `Table[[#This Row],[Column]]` (or `Table[@[Column]]`) for one value from the
|
|
325
|
+
* formula record's row. Use `Table[[#Data],[Column]]` (or `Table[Column]`) only
|
|
326
|
+
* when the formula intentionally consumes the complete data column. For another
|
|
327
|
+
* Base table, call that table's `getFormulaName()` instead of typing its display
|
|
328
|
+
* name or relying on a placeholder.
|
|
329
|
+
* @returns {string} The canonical normalized formula table name.
|
|
330
|
+
* @example
|
|
331
|
+
* ```ts
|
|
332
|
+
* const fBase = univerAPI.getActiveBase();
|
|
333
|
+
* const table = fBase.getTableById('table-1');
|
|
334
|
+
* const tableName = table.getFormulaName();
|
|
335
|
+
* const currentAmount = `=${tableName}[[#This Row],[Amount]]`;
|
|
336
|
+
* const allAmounts = `=SUM(${tableName}[[#Data],[Amount]])`;
|
|
337
|
+
* ```
|
|
338
|
+
*/
|
|
339
|
+
getFormulaName(): string;
|
|
340
|
+
/**
|
|
341
|
+
* Rename this table's human-readable display label. The name becomes an Excel
|
|
342
|
+
* worksheet name during export, so it must contain 1-31 characters, not start or
|
|
343
|
+
* end with an apostrophe, not contain `: \\ / ? * [ ]`, and be unique within the
|
|
344
|
+
* Base (case-insensitive).
|
|
345
|
+
*
|
|
346
|
+
* Its stable formula name does not change. Existing and new structured references
|
|
347
|
+
* must continue to use the value returned by `getFormulaName()`.
|
|
348
|
+
* @param {string} displayName The new human-readable table display name.
|
|
349
|
+
* @returns {boolean} Whether the rename command succeeded.
|
|
350
|
+
* @throws {Error} If `displayName` violates the Excel worksheet-name rules. The error includes
|
|
351
|
+
* both the complete contract and the specific reason, so callers and agents can correct it.
|
|
315
352
|
* @example
|
|
316
353
|
* ```ts
|
|
317
354
|
* const fBase = univerAPI.getActiveBase();
|
|
@@ -320,7 +357,7 @@ export declare class FBaseTable {
|
|
|
320
357
|
* console.log(success);
|
|
321
358
|
* ```
|
|
322
359
|
*/
|
|
323
|
-
setName(
|
|
360
|
+
setName(displayName: string): boolean;
|
|
324
361
|
/**
|
|
325
362
|
* Search records in this table.
|
|
326
363
|
*
|
|
@@ -506,13 +543,14 @@ export declare class FBaseTable {
|
|
|
506
543
|
* }
|
|
507
544
|
* }
|
|
508
545
|
* );
|
|
546
|
+
* const formulaTableName = fBaseTable.getFormulaName();
|
|
509
547
|
* const total = fBaseTable.addField(
|
|
510
548
|
* 'Total',
|
|
511
549
|
* univerAPI.Enum.BaseFieldType.Formula,
|
|
512
550
|
* {
|
|
513
551
|
* field: {
|
|
514
552
|
* config: {
|
|
515
|
-
* formula:
|
|
553
|
+
* formula: `=SUM(${formulaTableName}[[#This Row],[Amount]],${formulaTableName}[[#This Row],[Tax]])`
|
|
516
554
|
* }
|
|
517
555
|
* },
|
|
518
556
|
* externalReferences: [], // Required; this formula only uses fields in the Host Base.
|
|
@@ -528,6 +566,7 @@ export declare class FBaseTable {
|
|
|
528
566
|
* unitId: 'pricing-base',
|
|
529
567
|
* formulaQualifier: 'Pricing',
|
|
530
568
|
* };
|
|
569
|
+
* const formulaTableName = fBaseTable.getFormulaName();
|
|
531
570
|
* const taxAmount = univerAPI.getFormula().buildReference({
|
|
532
571
|
* hostUnitId: fBase.getId(),
|
|
533
572
|
* unit: pricingBase,
|
|
@@ -543,7 +582,7 @@ export declare class FBaseTable {
|
|
|
543
582
|
* {
|
|
544
583
|
* field: {
|
|
545
584
|
* config: {
|
|
546
|
-
* formula: `=SUM([Amount])+SUM(${taxAmount})`,
|
|
585
|
+
* formula: `=SUM(${formulaTableName}[[#This Row],[Amount]])+SUM(${taxAmount})`,
|
|
547
586
|
* numberFormat: {
|
|
548
587
|
* type: 'currency',
|
|
549
588
|
* pattern: '"$"#,##0.00'
|
|
@@ -564,6 +603,7 @@ export declare class FBaseTable {
|
|
|
564
603
|
addField(name: string, type: BaseFieldType.RecordLink, options: IBaseAddRecordLinkFieldOptions): FBaseTableField;
|
|
565
604
|
addField(name: string, type: Exclude<BaseFieldType, BaseFieldType.Formula | BaseFieldType.RecordLink>, options?: IBaseAddFieldOptions): FBaseTableField;
|
|
566
605
|
addField(name: string, type: BaseFieldType, options: IBaseAddFieldOptions | IBaseAddFormulaFieldOptions | IBaseAddRecordLinkFieldOptions): FBaseTableField;
|
|
606
|
+
private _prepareFormulaFieldReferences;
|
|
567
607
|
/**
|
|
568
608
|
* Get all records in this table, optionally filtered, sorted, and paginated.
|
|
569
609
|
* @returns {FBaseTableRecord[]} An array of record facades ordered by the table record order.
|
package/lib/types/index.d.ts
CHANGED
|
@@ -75,6 +75,8 @@ export { BaseConditionalColorRuleUpdateType, UpdateBaseViewConditionalColorRules
|
|
|
75
75
|
export type { IUpdateBaseViewConditionalColorRulesCommandParams } from './commands/commands/update-base-view-conditional-color-rules.command';
|
|
76
76
|
export { UpdateBaseViewConfigCommand } from './commands/commands/update-base-view-config.command';
|
|
77
77
|
export type { IUpdateBaseViewConfigCommandParams } from './commands/commands/update-base-view-config.command';
|
|
78
|
+
export { ValidateBaseFormulaCommand } from './commands/commands/validate-base-formula.command';
|
|
79
|
+
export type { IValidateBaseFormulaCommandParams } from './commands/commands/validate-base-formula.command';
|
|
78
80
|
export { ApplyBaseJson1Mutation } from './commands/mutations/apply-base-json1.mutation';
|
|
79
81
|
export type { IApplyBaseJson1MutationParams } from './commands/mutations/apply-base-json1.mutation';
|
|
80
82
|
export { createEmbedBasesTable, createEmbedBasesTableAddMutation, createEmbedBasesTableRemoveMutation, EMBED_BASES_TABLE_RESOURCE_KEY, } from './embed-host-anchor';
|
|
@@ -90,6 +92,8 @@ export { ensureBaseTableCellLayout, getBaseCellFormulaValue, getBaseCellValue, }
|
|
|
90
92
|
export { BASE_HIERARCHY_MAX_LEVELS, BASE_HIERARCHY_PARENT_FIELD_ID, BaseEventSource, BaseHierarchyError, BaseHierarchyErrorCode, buildBaseHierarchyIndex, createBaseHierarchyParentField, getActiveBaseHierarchyFieldIds, getBaseHierarchyDeletePromotions, getBaseHierarchyFieldId, getVisibleBaseHierarchyRows, isBaseHierarchyField, projectBaseHierarchy, resolveBaseHierarchyFieldId, validateBaseHierarchyMove, validateBaseHierarchyRecordCreations, validateBaseHierarchyRecordPatches, } from './models/base-hierarchy';
|
|
91
93
|
export type { IBaseHierarchyChange, IBaseHierarchyIndex, IBaseHierarchyRecordPatch, } from './models/base-hierarchy';
|
|
92
94
|
export { copyBaseTableSnapshot } from './models/base-table-copy';
|
|
95
|
+
export { BASE_TABLE_NAME_REQUIREMENTS, createUniqueBaseTableName, validateBaseTableName } from './models/base-table-name';
|
|
96
|
+
export type { BaseTableNameValidationError, IBaseTableNameValidationResult } from './models/base-table-name';
|
|
93
97
|
export { createDefaultBaseTableSnapshot } from './models/default-table';
|
|
94
98
|
export { findRecordLinkReferences, getRecordLinkFieldConfig, parseRecordLinkIds, serializeRecordLinkIds, validateCanonicalRecordLinkValue, validateRecordLinkField, validateRecordLinkValue, } from './models/record-link';
|
|
95
99
|
export type { IRecordLinkReference } from './models/record-link';
|
|
@@ -100,6 +104,8 @@ export { searchBaseTable } from './search/base-search';
|
|
|
100
104
|
export type { IBaseTableSearchRequest } from './search/base-search';
|
|
101
105
|
export type { IBaseTableSearchMatch, IBaseTableSearchResult, } from './search/base-search';
|
|
102
106
|
export { IBaseCommandService } from './services/base-command.service';
|
|
107
|
+
export { BaseFormulaService, getBaseFormulaTableName } from './services/base-formula.service';
|
|
108
|
+
export type { IBaseFormulaValidationResult } from './services/base-formula.service';
|
|
103
109
|
export { traceBasePerformance } from './services/base-performance.service';
|
|
104
110
|
export { IBasePermissionService } from './services/base-permission.service';
|
|
105
111
|
export type { IBaseFieldPermission, IBasePermissionSnapshot, IBaseRecordPermission, IBaseTablePermission, } from './services/base-permission.service';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { IBaseSnapshot, IValidationResult } from '@univerjs/core';
|
|
2
|
+
export declare const BASE_TABLE_NAME_REQUIREMENTS = "Base table names are exported as Excel worksheet names and must contain 1-31 characters, not start or end with an apostrophe, not contain : \\ / ? * [ ], and be unique (case-insensitive).";
|
|
3
|
+
export type BaseTableNameValidationError = 'required' | 'too-long' | 'apostrophe' | 'invalid-characters' | 'duplicate' | 'invalid';
|
|
4
|
+
export interface IBaseTableNameValidationResult extends IValidationResult {
|
|
5
|
+
error?: BaseTableNameValidationError;
|
|
6
|
+
}
|
|
7
|
+
export declare function validateBaseTableName(snapshot: IBaseSnapshot, name: string, currentTableId?: string): IBaseTableNameValidationResult;
|
|
8
|
+
export declare function createUniqueBaseTableName(snapshot: IBaseSnapshot, baseName: string): string;
|
|
@@ -57,9 +57,9 @@ export declare class BaseJson1OpFactory {
|
|
|
57
57
|
}): JSONXActions;
|
|
58
58
|
private _setViewFieldSetting;
|
|
59
59
|
private _createRecordOrderOp;
|
|
60
|
+
private _materializeFormulaTableNames;
|
|
60
61
|
private _setFormulaFieldCells;
|
|
61
62
|
private _setAttachmentResources;
|
|
62
63
|
private _deleteAttachmentResources;
|
|
63
64
|
private _replaceOptional;
|
|
64
65
|
}
|
|
65
|
-
export declare function renameBaseFormulaTableReferences(formula: string, oldName: string, newName: string): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ISetFormulaCalculationResultMutation, ISuperTable
|
|
1
|
+
import type { ISetFormulaCalculationResultMutation, ISuperTable } from '@univerjs-pro/engine-formula';
|
|
2
2
|
import type { IBaseCellData, IBaseSnapshot, ITableSnapshot } from '@univerjs/core';
|
|
3
|
-
|
|
3
|
+
export { getBaseFormulaTableName } from '@univerjs/core';
|
|
4
4
|
export interface IBaseFormulaValidationResult {
|
|
5
5
|
valid: boolean;
|
|
6
6
|
reason?: string;
|
|
@@ -12,21 +12,6 @@ export interface IBaseFormulaDependency {
|
|
|
12
12
|
export interface IBaseFormulaContext {
|
|
13
13
|
snapshot?: IBaseSnapshot;
|
|
14
14
|
}
|
|
15
|
-
export interface IBaseFormulaCalculationDataset {
|
|
16
|
-
formulaData: Record<string, Record<string, Record<number, Record<number, {
|
|
17
|
-
f: string;
|
|
18
|
-
si?: string;
|
|
19
|
-
}>>>>;
|
|
20
|
-
allUnitData: Record<string, Record<string, {
|
|
21
|
-
cellData: ObjectMatrix<IBaseCellData | null>;
|
|
22
|
-
rowCount: number;
|
|
23
|
-
columnCount: number;
|
|
24
|
-
rowData: Record<number, unknown>;
|
|
25
|
-
columnData: Record<number, unknown>;
|
|
26
|
-
}>>;
|
|
27
|
-
unitStylesData: Record<string, Record<string, unknown>>;
|
|
28
|
-
unitSheetNameMap: Record<string, Record<string, string>>;
|
|
29
|
-
}
|
|
30
15
|
export interface IBaseSuperTableRegistration {
|
|
31
16
|
tableId: string;
|
|
32
17
|
tableName: string;
|
|
@@ -43,15 +28,9 @@ export interface IBaseFormulaResultPatchGroup {
|
|
|
43
28
|
}
|
|
44
29
|
export declare class BaseFormulaService {
|
|
45
30
|
createSuperTableReference(table: ITableSnapshot, sheetId?: string): ISuperTable;
|
|
46
|
-
registerSuperTable(superTableService: ISuperTableService, unitId: string, table: ITableSnapshot, options?: {
|
|
47
|
-
tableName?: string;
|
|
48
|
-
sheetId?: string;
|
|
49
|
-
}): ISuperTable;
|
|
50
|
-
registerSuperTables(superTableService: ISuperTableService, snapshot: IBaseSnapshot): ISuperTable[];
|
|
51
31
|
getSuperTableRegistrations(snapshot: IBaseSnapshot, tableIds?: Iterable<string>): IBaseSuperTableRegistration[];
|
|
52
32
|
validateFormula(formula: string, table: ITableSnapshot, context?: IBaseFormulaContext): IBaseFormulaValidationResult;
|
|
53
33
|
getDependencies(formula: string, table: ITableSnapshot, context?: IBaseFormulaContext): string[];
|
|
54
34
|
getStructuredDependencies(formula: string, table: ITableSnapshot, context?: IBaseFormulaContext): IBaseFormulaDependency[];
|
|
55
35
|
}
|
|
56
|
-
export declare function createBaseFormulaCalculationDataset(snapshot: IBaseSnapshot): IBaseFormulaCalculationDataset;
|
|
57
36
|
export declare function createBaseFormulaResultPatches(snapshot: IBaseSnapshot, result: ISetFormulaCalculationResultMutation): IBaseFormulaResultPatchGroup[];
|