@univerjs-pro/bases 1.0.0-alpha.1 → 1.0.0-alpha.3

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 (127) hide show
  1. package/README.md +8 -5
  2. package/lib/cjs/facade.js +1 -1
  3. package/lib/cjs/index.js +1 -1
  4. package/lib/cjs/locale/ar-SA.js +1 -1
  5. package/lib/cjs/locale/ca-ES.js +1 -1
  6. package/lib/cjs/locale/de-DE.js +1 -1
  7. package/lib/cjs/locale/en-US.js +1 -1
  8. package/lib/cjs/locale/es-ES.js +1 -1
  9. package/lib/cjs/locale/fa-IR.js +1 -1
  10. package/lib/cjs/locale/fr-FR.js +1 -1
  11. package/lib/cjs/locale/id-ID.js +1 -1
  12. package/lib/cjs/locale/it-IT.js +1 -1
  13. package/lib/cjs/locale/ja-JP.js +1 -1
  14. package/lib/cjs/locale/ko-KR.js +1 -1
  15. package/lib/cjs/locale/pl-PL.js +1 -1
  16. package/lib/cjs/locale/pt-BR.js +1 -1
  17. package/lib/cjs/locale/ru-RU.js +1 -1
  18. package/lib/cjs/locale/sk-SK.js +1 -1
  19. package/lib/cjs/locale/vi-VN.js +1 -1
  20. package/lib/cjs/locale/zh-CN.js +1 -1
  21. package/lib/cjs/locale/zh-HK.js +1 -1
  22. package/lib/cjs/locale/zh-TW.js +1 -1
  23. package/lib/es/facade.js +1 -1
  24. package/lib/es/index.js +1 -1
  25. package/lib/es/locale/ar-SA.js +1 -1
  26. package/lib/es/locale/ca-ES.js +1 -1
  27. package/lib/es/locale/de-DE.js +1 -1
  28. package/lib/es/locale/en-US.js +1 -1
  29. package/lib/es/locale/es-ES.js +1 -1
  30. package/lib/es/locale/fa-IR.js +1 -1
  31. package/lib/es/locale/fr-FR.js +1 -1
  32. package/lib/es/locale/id-ID.js +1 -1
  33. package/lib/es/locale/it-IT.js +1 -1
  34. package/lib/es/locale/ja-JP.js +1 -1
  35. package/lib/es/locale/ko-KR.js +1 -1
  36. package/lib/es/locale/pl-PL.js +1 -1
  37. package/lib/es/locale/pt-BR.js +1 -1
  38. package/lib/es/locale/ru-RU.js +1 -1
  39. package/lib/es/locale/sk-SK.js +1 -1
  40. package/lib/es/locale/vi-VN.js +1 -1
  41. package/lib/es/locale/zh-CN.js +1 -1
  42. package/lib/es/locale/zh-HK.js +1 -1
  43. package/lib/es/locale/zh-TW.js +1 -1
  44. package/lib/facade.js +1 -1
  45. package/lib/index.js +1 -1
  46. package/lib/locale/ar-SA.js +1 -1
  47. package/lib/locale/ca-ES.js +1 -1
  48. package/lib/locale/de-DE.js +1 -1
  49. package/lib/locale/en-US.js +1 -1
  50. package/lib/locale/es-ES.js +1 -1
  51. package/lib/locale/fa-IR.js +1 -1
  52. package/lib/locale/fr-FR.js +1 -1
  53. package/lib/locale/id-ID.js +1 -1
  54. package/lib/locale/it-IT.js +1 -1
  55. package/lib/locale/ja-JP.js +1 -1
  56. package/lib/locale/ko-KR.js +1 -1
  57. package/lib/locale/pl-PL.js +1 -1
  58. package/lib/locale/pt-BR.js +1 -1
  59. package/lib/locale/ru-RU.js +1 -1
  60. package/lib/locale/sk-SK.js +1 -1
  61. package/lib/locale/vi-VN.js +1 -1
  62. package/lib/locale/zh-CN.js +1 -1
  63. package/lib/locale/zh-HK.js +1 -1
  64. package/lib/locale/zh-TW.js +1 -1
  65. package/lib/types/commands/commands/set-base-view-filter.command.d.ts +2 -2
  66. package/lib/types/commands/commands/set-base-view-group.command.d.ts +2 -2
  67. package/lib/types/commands/commands/set-base-view-sort.command.d.ts +2 -2
  68. package/lib/types/commands/utils/base-validation.d.ts +6 -0
  69. package/lib/types/config/config.d.ts +11 -0
  70. package/lib/types/controllers/base-active-dirty.controller.d.ts +5 -6
  71. package/lib/types/controllers/base-formula-calculation.controller.d.ts +8 -14
  72. package/lib/types/embed-host-anchor.d.ts +46 -0
  73. package/lib/types/facade/f-base.d.ts +126 -577
  74. package/lib/types/facade/f-enum.d.ts +117 -89
  75. package/lib/types/facade/f-event.d.ts +255 -132
  76. package/lib/types/facade/f-field.d.ts +137 -313
  77. package/lib/types/facade/f-range.d.ts +86 -326
  78. package/lib/types/facade/f-record.d.ts +93 -216
  79. package/lib/types/facade/f-table.d.ts +473 -1317
  80. package/lib/types/facade/f-types.d.ts +1 -0
  81. package/lib/types/facade/f-univer.d.ts +27 -154
  82. package/lib/types/facade/f-view.d.ts +207 -484
  83. package/lib/types/facade/field-key.d.ts +6 -6
  84. package/lib/types/facade/index.d.ts +11 -14
  85. package/lib/types/fields/field-core-plugin.d.ts +9 -8
  86. package/lib/types/index.d.ts +17 -47
  87. package/lib/types/models/base-cell-data.d.ts +6 -6
  88. package/lib/types/models/default-table.d.ts +13 -0
  89. package/lib/types/ot/json1-adapter.d.ts +3 -3
  90. package/lib/types/ot/json1-invalidation.d.ts +2 -2
  91. package/lib/types/ot/json1-op-applier.d.ts +2 -2
  92. package/lib/types/ot/json1-op-factory.d.ts +9 -8
  93. package/lib/types/plugin.d.ts +6 -4
  94. package/lib/types/search/base-search.d.ts +4 -3
  95. package/lib/types/services/base-active-dirty.service.d.ts +2 -2
  96. package/lib/types/services/base-command.service.d.ts +16 -16
  97. package/lib/types/services/base-compression.service.d.ts +3 -3
  98. package/lib/types/services/base-field-registry.service.d.ts +5 -5
  99. package/lib/types/services/base-formula.service.d.ts +11 -20
  100. package/lib/types/services/base-view-registry.service.d.ts +3 -3
  101. package/lib/types/views/view-core-plugin.d.ts +4 -3
  102. package/lib/umd/facade.js +1 -1
  103. package/lib/umd/index.js +1 -1
  104. package/lib/umd/locale/ar-SA.js +1 -1
  105. package/lib/umd/locale/ca-ES.js +1 -1
  106. package/lib/umd/locale/de-DE.js +1 -1
  107. package/lib/umd/locale/en-US.js +1 -1
  108. package/lib/umd/locale/es-ES.js +1 -1
  109. package/lib/umd/locale/fa-IR.js +1 -1
  110. package/lib/umd/locale/fr-FR.js +1 -1
  111. package/lib/umd/locale/id-ID.js +1 -1
  112. package/lib/umd/locale/it-IT.js +1 -1
  113. package/lib/umd/locale/ja-JP.js +1 -1
  114. package/lib/umd/locale/ko-KR.js +1 -1
  115. package/lib/umd/locale/pl-PL.js +1 -1
  116. package/lib/umd/locale/pt-BR.js +1 -1
  117. package/lib/umd/locale/ru-RU.js +1 -1
  118. package/lib/umd/locale/sk-SK.js +1 -1
  119. package/lib/umd/locale/vi-VN.js +1 -1
  120. package/lib/umd/locale/zh-CN.js +1 -1
  121. package/lib/umd/locale/zh-HK.js +1 -1
  122. package/lib/umd/locale/zh-TW.js +1 -1
  123. package/package.json +7 -8
  124. package/lib/types/controllers/base-remote-formula.controller.d.ts +0 -13
  125. package/lib/types/facade/f-error.d.ts +0 -30
  126. package/lib/types/facade/f-permission.d.ts +0 -749
  127. package/lib/types/facade/transaction.d.ts +0 -19
@@ -1 +1 @@
1
- const _0x13ac29=_0x11de;function _0x5b53(){const _0x585e7b=['雙向關聯','81492cFBMbC','刪除記錄','102gSjSPx','修改人','333RqYZLo','更新視圖設置','269599dLxQXo','更新單元格','創建記錄','甘特視圖需要開始和結束日期字段','2997055zikYYj','日曆需要日期字段','241370UfkvUo','單元格值無效','輸入內容','複選框','電話號碼','3mZmHzm','264ixzTfp','1752450HGbvNy','589126YwSVmM','11427816qLUTXt','35okjkUf','刪除字段','字段標題不能為空','記錄\x20ID','更新時間','看板需要可分組字段','創建時間'];_0x5b53=function(){return _0x585e7b;};return _0x5b53();}(function(_0x2a432f,_0x577167){const _0x5b693a=_0x11de,_0x3f7bc0=_0x2a432f();while(!![]){try{const _0x394d08=parseInt(_0x5b693a(0x9b))/0x1*(-parseInt(_0x5b693a(0x9e))/0x2)+-parseInt(_0x5b693a(0x8c))/0x3*(-parseInt(_0x5b693a(0x8a))/0x4)+parseInt(_0x5b693a(0x94))/0x5+-parseInt(_0x5b693a(0x9d))/0x6*(parseInt(_0x5b693a(0xa0))/0x7)+parseInt(_0x5b693a(0x9f))/0x8+parseInt(_0x5b693a(0x8e))/0x9*(parseInt(_0x5b693a(0x96))/0xa)+parseInt(_0x5b693a(0x90))/0xb*(-parseInt(_0x5b693a(0x9c))/0xc);if(_0x394d08===_0x577167)break;else _0x3f7bc0['push'](_0x3f7bc0['shift']());}catch(_0x2c0d09){_0x3f7bc0['push'](_0x3f7bc0['shift']());}}}(_0x5b53,0xb2509));const e={'bases':{'fieldType':{'text':'文本','singleSelect':'單選','multiSelect':'多選','person':'人員','group':'分組','date':'日期','attachment':'附件','number':'數字','checkbox':_0x13ac29(0x99),'link':'鏈接','formula':'公式','lookup':'查找','flow':'流程','button':'按鈕','numbering':'編號','phone':_0x13ac29(0x9a),'email':'郵箱','location':'位置','barcode':'條碼','progress':'進度','currency':'貨幣','rating':'評分','twoWayLink':_0x13ac29(0x89),'recordId':_0x13ac29(0xa3),'createdBy':'創建人','updatedBy':_0x13ac29(0x8d),'createdAt':_0x13ac29(0x88),'updatedAt':_0x13ac29(0xa4),'summary':'彙總'},'fieldConfig':{'textPlaceholder':_0x13ac29(0x98),'linkPlaceholder':'輸入\x20URL(例如\x20univer.ai\x20或\x20https://univer.ai/skills)。'},'viewType':{'grid':'表格','kanban':'看板','calendar':'日曆','gantt':'甘特','gallery':'畫廊'},'error':{'fieldNameRequired':_0x13ac29(0xa2),'invalidFieldType':'字段類型無效','invalidCellValue':_0x13ac29(0x97),'invalidKanbanGroupField':_0x13ac29(0xa5),'invalidCalendarDateField':_0x13ac29(0x95),'invalidGanttDateField':_0x13ac29(0x93)},'command':{'updateCell':_0x13ac29(0x91),'createField':'創建字段','deleteField':_0x13ac29(0xa1),'createRecord':_0x13ac29(0x92),'deleteRecord':_0x13ac29(0x8b),'updateViewConfig':_0x13ac29(0x8f)}}};function _0x11de(_0x2575aa,_0xacf763){_0x2575aa=_0x2575aa-0x88;const _0x5b53a4=_0x5b53();let _0x11de04=_0x5b53a4[_0x2575aa];return _0x11de04;}export{e as default};
1
+ const _0xf8243b=_0x5ee5;(function(_0x4f2832,_0x41288b){const _0x4cf087=_0x5ee5,_0x868895=_0x4f2832();while(!![]){try{const _0x204a74=parseInt(_0x4cf087(0x182))/0x1+parseInt(_0x4cf087(0x180))/0x2+parseInt(_0x4cf087(0x189))/0x3+parseInt(_0x4cf087(0x184))/0x4*(parseInt(_0x4cf087(0x18c))/0x5)+parseInt(_0x4cf087(0x18e))/0x6+parseInt(_0x4cf087(0x177))/0x7*(-parseInt(_0x4cf087(0x175))/0x8)+-parseInt(_0x4cf087(0x18a))/0x9;if(_0x204a74===_0x41288b)break;else _0x868895['push'](_0x868895['shift']());}catch(_0x5c4a07){_0x868895['push'](_0x868895['shift']());}}}(_0x5ee2,0x26499));const e={'bases':{'fieldType':{'text':'文本','singleSelect':'單選','multiSelect':'多選','person':'人員','group':'分組','date':'日期','attachment':'附件','number':'數字','checkbox':_0xf8243b(0x185),'link':'鏈接','formula':'公式','lookup':'查找','flow':'流程','button':'按鈕','numbering':'編號','phone':_0xf8243b(0x17f),'email':'郵箱','location':'位置','barcode':'條碼','progress':'進度','currency':'貨幣','rating':'評分','twoWayLink':_0xf8243b(0x17a),'recordId':_0xf8243b(0x188),'createdBy':_0xf8243b(0x17c),'updatedBy':'修改人','createdAt':_0xf8243b(0x17d),'updatedAt':_0xf8243b(0x18d),'summary':'彙總'},'fieldConfig':{'textPlaceholder':'輸入內容','linkPlaceholder':_0xf8243b(0x176)},'viewType':{'grid':'表格','kanban':'看板','calendar':'日曆','gantt':'甘特','gallery':'畫廊'},'error':{'fieldNameRequired':_0xf8243b(0x183),'invalidFieldType':'字段類型無效','invalidCellValue':_0xf8243b(0x18b),'invalidKanbanGroupField':_0xf8243b(0x17e),'invalidCalendarDateField':_0xf8243b(0x181),'invalidGanttDateField':_0xf8243b(0x186)},'command':{'updateCell':'更新單元格','createField':_0xf8243b(0x187),'deleteField':_0xf8243b(0x179),'createRecord':_0xf8243b(0x18f),'deleteRecord':_0xf8243b(0x17b),'updateViewConfig':_0xf8243b(0x178)}}};function _0x5ee5(_0x23c42c,_0x45571f){_0x23c42c=_0x23c42c-0x175;const _0x5ee252=_0x5ee2();let _0x5ee5be=_0x5ee252[_0x23c42c];return _0x5ee5be;}export{e as default};function _0x5ee2(){const _0xc3284d=['創建人','創建時間','看板需要可分組字段','電話號碼','85924onAbuJ','日曆需要日期字段','34154HpbHvS','字段標題不能為空','7408vIWPAF','複選框','甘特視圖需要開始和結束日期字段','創建字段','記錄\x20ID','823266FLJFKN','699786BsQBIo','單元格值無效','165PcjrFS','更新時間','12924sZlIWZ','創建記錄','8CwcUmt','輸入\x20URL(例如\x20univer.ai\x20或\x20https://univer.ai/skills)。','1261603wPdgDu','更新視圖設置','刪除字段','雙向關聯','刪除記錄'];_0x5ee2=function(){return _0xc3284d;};return _0x5ee2();}
@@ -1,8 +1,8 @@
1
- import type { FilterConfig, ICommand } from '@univerjs/core';
1
+ import type { ICommand, IFilterConfig } from '@univerjs/core';
2
2
  export interface ISetBaseViewFilterCommandParams {
3
3
  unitId: string;
4
4
  tableId: string;
5
5
  viewId: string;
6
- filter: FilterConfig | null;
6
+ filter: IFilterConfig | null;
7
7
  }
8
8
  export declare const SetBaseViewFilterCommand: ICommand<ISetBaseViewFilterCommandParams>;
@@ -1,8 +1,8 @@
1
- import type { GroupConfig, ICommand } from '@univerjs/core';
1
+ import type { ICommand, IGroupConfig } from '@univerjs/core';
2
2
  export interface ISetBaseViewGroupCommandParams {
3
3
  unitId: string;
4
4
  tableId: string;
5
5
  viewId: string;
6
- group: GroupConfig[];
6
+ group: IGroupConfig[];
7
7
  }
8
8
  export declare const SetBaseViewGroupCommand: ICommand<ISetBaseViewGroupCommandParams>;
@@ -1,8 +1,8 @@
1
- import type { ICommand, SortConfig } from '@univerjs/core';
1
+ import type { ICommand, ISortConfig } from '@univerjs/core';
2
2
  export interface ISetBaseViewSortCommandParams {
3
3
  unitId: string;
4
4
  tableId: string;
5
5
  viewId: string;
6
- sort: SortConfig[];
6
+ sort: ISortConfig[];
7
7
  }
8
8
  export declare const SetBaseViewSortCommand: ICommand<ISetBaseViewSortCommandParams>;
@@ -0,0 +1,6 @@
1
+ import type { BaseDataModel } from '@univerjs/core';
2
+ export declare function validateBaseIds(base: BaseDataModel, tableId: string, checkIds?: {
3
+ viewIds?: string[];
4
+ fieldIds?: string[];
5
+ recordIds?: string[];
6
+ }): boolean;
@@ -0,0 +1,11 @@
1
+ export declare const BASES_PLUGIN_CONFIG_KEY = "bases.config";
2
+ export declare const configSymbol: unique symbol;
3
+ export interface IUniverBasesConfig {
4
+ embed?: Record<string, unknown>;
5
+ }
6
+ export declare const defaultPluginConfig: IUniverBasesConfig;
7
+ export declare const REMOTE_BASES_PLUGIN_CONFIG_KEY = "bases.remote.config";
8
+ export declare const configSymbolRemote: unique symbol;
9
+ export interface IUniverRemoteBasesConfig {
10
+ }
11
+ export declare const defaultRemotePluginConfig: IUniverRemoteBasesConfig;
@@ -1,16 +1,15 @@
1
- import { Disposable, Injector, IUniverInstanceService } from '@univerjs/core';
1
+ import { IActiveDirtyManagerService } from '@univerjs-pro/engine-formula';
2
+ import { Disposable, IUniverInstanceService } from '@univerjs/core';
2
3
  export declare class BaseActiveDirtyController extends Disposable {
3
- private readonly _injector;
4
+ private readonly _activeDirtyManagerService;
4
5
  private readonly _univerInstanceService;
5
- constructor(_injector: Injector, _univerInstanceService: IUniverInstanceService);
6
+ constructor(_activeDirtyManagerService: IActiveDirtyManagerService, _univerInstanceService: IUniverInstanceService);
6
7
  private _initialize;
7
- private _getActiveDirtyManagerService;
8
8
  private _getTable;
9
9
  private _getJson1DirtyData;
10
10
  private _getStructureDirtyTableIds;
11
11
  private _groupCellInvalidations;
12
12
  private _toDirtyRangePatch;
13
13
  private _getAllTableIds;
14
- private _getDirtySuperTableMap;
15
- private _getAllBaseDirtySuperTableMap;
14
+ private _getAllBaseDependencyTreeCacheMap;
16
15
  }
@@ -1,23 +1,17 @@
1
- import { Disposable, ICommandService, Injector, IUniverInstanceService } from '@univerjs/core';
1
+ import { FormulaCalculationTriggerService } from '@univerjs-pro/engine-formula';
2
+ import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
2
3
  export declare class BaseFormulaCalculationController extends Disposable {
3
- private readonly _injector;
4
4
  private readonly _commandService;
5
5
  private readonly _univerInstanceService;
6
6
  private readonly _formulaService;
7
+ private readonly _registeredSuperTableNames;
8
+ private _formulaSyncQueue;
7
9
  private _applyingFormulaResults;
8
- constructor(_injector: Injector, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService);
10
+ constructor(_commandService: ICommandService, _univerInstanceService: IUniverInstanceService, formulaCalculationTriggerService: FormulaCalculationTriggerService);
9
11
  private _initialize;
10
12
  private _onCommandExecuted;
11
- private _shouldSyncFormulaData;
12
- private _registerSuperTables;
13
- private _requestCalculation;
14
- private _syncFormulaData;
13
+ private _syncSuperTables;
14
+ private _removeSuperTables;
15
+ private _enqueueFormulaSync;
15
16
  private _applyFormulaResult;
16
- private _getSuperTableService;
17
- private _createDirtyData;
18
- private _createJson1DirtyData;
19
- private _getStructureDirtyTableIds;
20
- private _groupCellInvalidations;
21
- private _toDirtyRangePatch;
22
- private _createStructureDirtyData;
23
17
  }
@@ -0,0 +1,46 @@
1
+ import type { BaseDataModel, IBaseSnapshot, IMutationInfo, ITableSnapshot, UniverInstanceType } from '@univerjs/core';
2
+ import type { IApplyBaseJson1MutationParams } from './commands/mutations/apply-base-json1.mutation';
3
+ interface IEmbedDescriptor {
4
+ embedId: string;
5
+ hostAnchorId: string;
6
+ childUnitId?: string;
7
+ childType?: UniverInstanceType;
8
+ }
9
+ export declare const EMBED_BASES_TABLE_RESOURCE_KEY = "UNIVER_EMBED_BASES_TABLE";
10
+ export interface IEmbedBasesTableCustomData {
11
+ version: 1;
12
+ embedId: string;
13
+ hostAnchorId: string;
14
+ childUnitId?: string;
15
+ childType?: UniverInstanceType;
16
+ }
17
+ export interface IEmbedBasesTableParams {
18
+ embedId: string;
19
+ hostAnchorId: string;
20
+ name?: string;
21
+ childUnitId?: string;
22
+ childType?: UniverInstanceType;
23
+ }
24
+ export declare function createEmbedBasesTable(params: IEmbedBasesTableParams): ITableSnapshot;
25
+ export declare function createEmbedBasesTableFromDescriptor(descriptor: IEmbedDescriptor, name?: string): ITableSnapshot;
26
+ export declare function createEmbedBasesTableAddMutation(params: {
27
+ unitId: string;
28
+ snapshot: IBaseSnapshot;
29
+ table: ITableSnapshot;
30
+ index?: number;
31
+ }): IMutationInfo<IApplyBaseJson1MutationParams>;
32
+ export declare function createEmbedBasesTableRemoveMutation(params: {
33
+ unitId: string;
34
+ snapshot: IBaseSnapshot;
35
+ tableId: string;
36
+ }): IMutationInfo<IApplyBaseJson1MutationParams> | undefined;
37
+ export declare function getEmbedBasesTableCustomData(table: Pick<ITableSnapshot, 'resources'>): IEmbedBasesTableCustomData | undefined;
38
+ export declare function isEmbedBasesTable(table: Pick<ITableSnapshot, 'resources'>): boolean;
39
+ export declare function getBaseSnapshot(base: Pick<BaseDataModel, 'getSnapshot'> | undefined): IBaseSnapshot | undefined;
40
+ export declare function createEmbedBasesTableCustomData(params: {
41
+ embedId: string;
42
+ hostAnchorId: string;
43
+ childUnitId?: string;
44
+ childType?: UniverInstanceType;
45
+ }): IEmbedBasesTableCustomData;
46
+ export {};