@univerjs-pro/bases 1.0.0-alpha.2 → 1.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) 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-name.command.d.ts +6 -0
  66. package/lib/types/commands/commands/set-base-view-filter.command.d.ts +2 -2
  67. package/lib/types/commands/commands/set-base-view-group.command.d.ts +2 -2
  68. package/lib/types/commands/commands/set-base-view-sort.command.d.ts +2 -2
  69. package/lib/types/commands/utils/base-validation.d.ts +6 -0
  70. package/lib/types/config/config.d.ts +1 -0
  71. package/lib/types/controllers/base-active-dirty.controller.d.ts +5 -6
  72. package/lib/types/controllers/base-formula-calculation.controller.d.ts +8 -14
  73. package/lib/types/embed-host-anchor.d.ts +46 -0
  74. package/lib/types/facade/f-base.d.ts +126 -577
  75. package/lib/types/facade/f-enum.d.ts +117 -89
  76. package/lib/types/facade/f-event.d.ts +240 -132
  77. package/lib/types/facade/f-field.d.ts +137 -313
  78. package/lib/types/facade/f-range.d.ts +86 -326
  79. package/lib/types/facade/f-record.d.ts +93 -216
  80. package/lib/types/facade/f-table.d.ts +473 -1317
  81. package/lib/types/facade/f-types.d.ts +1 -0
  82. package/lib/types/facade/f-univer.d.ts +27 -154
  83. package/lib/types/facade/f-view.d.ts +207 -484
  84. package/lib/types/facade/field-key.d.ts +6 -6
  85. package/lib/types/facade/index.d.ts +10 -20
  86. package/lib/types/fields/field-core-plugin.d.ts +9 -8
  87. package/lib/types/index.d.ts +12 -8
  88. package/lib/types/models/base-cell-data.d.ts +6 -6
  89. package/lib/types/models/default-table.d.ts +13 -0
  90. package/lib/types/ot/json1-adapter.d.ts +3 -3
  91. package/lib/types/ot/json1-invalidation.d.ts +2 -2
  92. package/lib/types/ot/json1-op-applier.d.ts +2 -2
  93. package/lib/types/ot/json1-op-factory.d.ts +11 -8
  94. package/lib/types/plugin.d.ts +0 -1
  95. package/lib/types/search/base-search.d.ts +4 -3
  96. package/lib/types/services/base-active-dirty.service.d.ts +2 -2
  97. package/lib/types/services/base-command.service.d.ts +16 -16
  98. package/lib/types/services/base-compression.service.d.ts +3 -3
  99. package/lib/types/services/base-field-registry.service.d.ts +5 -5
  100. package/lib/types/services/base-formula.service.d.ts +11 -23
  101. package/lib/types/services/base-view-registry.service.d.ts +3 -3
  102. package/lib/types/views/view-core-plugin.d.ts +4 -3
  103. package/lib/umd/facade.js +1 -1
  104. package/lib/umd/index.js +1 -1
  105. package/lib/umd/locale/ar-SA.js +1 -1
  106. package/lib/umd/locale/ca-ES.js +1 -1
  107. package/lib/umd/locale/de-DE.js +1 -1
  108. package/lib/umd/locale/en-US.js +1 -1
  109. package/lib/umd/locale/es-ES.js +1 -1
  110. package/lib/umd/locale/fa-IR.js +1 -1
  111. package/lib/umd/locale/fr-FR.js +1 -1
  112. package/lib/umd/locale/id-ID.js +1 -1
  113. package/lib/umd/locale/it-IT.js +1 -1
  114. package/lib/umd/locale/ja-JP.js +1 -1
  115. package/lib/umd/locale/ko-KR.js +1 -1
  116. package/lib/umd/locale/pl-PL.js +1 -1
  117. package/lib/umd/locale/pt-BR.js +1 -1
  118. package/lib/umd/locale/ru-RU.js +1 -1
  119. package/lib/umd/locale/sk-SK.js +1 -1
  120. package/lib/umd/locale/vi-VN.js +1 -1
  121. package/lib/umd/locale/zh-CN.js +1 -1
  122. package/lib/umd/locale/zh-HK.js +1 -1
  123. package/lib/umd/locale/zh-TW.js +1 -1
  124. package/package.json +7 -8
  125. package/lib/types/controllers/base-remote-formula.controller.d.ts +0 -13
  126. package/lib/types/facade/f-error.d.ts +0 -30
  127. package/lib/types/facade/f-permission.d.ts +0 -749
  128. package/lib/types/facade/transaction.d.ts +0 -19
@@ -1 +1 @@
1
- const _0x1127b3=_0x285e;(function(_0x484160,_0x1fb1b3){const _0x256d74=_0x285e,_0xc94d43=_0x484160();while(!![]){try{const _0xc57e1f=parseInt(_0x256d74(0xdd))/0x1*(parseInt(_0x256d74(0xcd))/0x2)+-parseInt(_0x256d74(0xd3))/0x3*(-parseInt(_0x256d74(0xc3))/0x4)+parseInt(_0x256d74(0xcf))/0x5+-parseInt(_0x256d74(0xd7))/0x6+parseInt(_0x256d74(0xda))/0x7+-parseInt(_0x256d74(0xc4))/0x8*(parseInt(_0x256d74(0xd2))/0x9)+parseInt(_0x256d74(0xc8))/0xa*(-parseInt(_0x256d74(0xc9))/0xb);if(_0xc57e1f===_0x1fb1b3)break;else _0xc94d43['push'](_0xc94d43['shift']());}catch(_0x5b343a){_0xc94d43['push'](_0xc94d43['shift']());}}}(_0x4797,0xaecf1));const e={'bases':{'fieldType':{'text':'文本','singleSelect':'單選','multiSelect':'多選','person':'人員','group':'分組','date':'日期','attachment':'附件','number':'數字','checkbox':_0x1127b3(0xcb),'link':'鏈接','formula':'公式','lookup':'查找','flow':'流程','button':'按鈕','numbering':'編號','phone':_0x1127b3(0xc7),'email':'郵箱','location':'位置','barcode':'條碼','progress':'進度','currency':'貨幣','rating':'評分','twoWayLink':_0x1127b3(0xdb),'recordId':'記錄\x20ID','createdBy':_0x1127b3(0xd5),'updatedBy':_0x1127b3(0xca),'createdAt':_0x1127b3(0xd8),'updatedAt':_0x1127b3(0xcc),'summary':'彙總'},'fieldConfig':{'textPlaceholder':_0x1127b3(0xc1),'linkPlaceholder':_0x1127b3(0xce)},'viewType':{'grid':'表格','kanban':'看板','calendar':'日曆','gantt':'甘特','gallery':'畫廊'},'error':{'fieldNameRequired':_0x1127b3(0xd1),'invalidFieldType':'字段類型無效','invalidCellValue':_0x1127b3(0xd0),'invalidKanbanGroupField':_0x1127b3(0xd6),'invalidCalendarDateField':'日曆需要日期字段','invalidGanttDateField':_0x1127b3(0xc2)},'command':{'updateCell':_0x1127b3(0xd4),'createField':_0x1127b3(0xdc),'deleteField':_0x1127b3(0xc5),'createRecord':_0x1127b3(0xc6),'deleteRecord':_0x1127b3(0xd9),'updateViewConfig':'更新視圖設置'}}};export{e as default};function _0x285e(_0x41e156,_0x2bb5b5){_0x41e156=_0x41e156-0xc1;const _0x47972d=_0x4797();let _0x285eeb=_0x47972d[_0x41e156];return _0x285eeb;}function _0x4797(){const _0x562184=['刪除記錄','1425487lAgHjt','雙向關聯','創建字段','241xjQuBO','輸入內容','甘特視圖需要開始和結束日期字段','10572qVnLaq','301056xDdEcb','刪除字段','創建記錄','電話號碼','270FDdWzN','428989Nabxlv','修改人','複選框','更新時間','10814YezNAp','輸入\x20URL(例如\x20univer.ai\x20或\x20https://univer.ai/skills)。','3821055irGqnk','單元格值無效','字段標題不能為空','189tKwqEb','960nGMFfK','更新單元格','創建人','看板需要可分組字段','3344622UNJgQb','創建時間'];_0x4797=function(){return _0x562184;};return _0x4797();}
1
+ const _0x376668=_0x10f5;(function(_0x930897,_0x30ffdf){const _0x14348d=_0x10f5,_0x36bbb0=_0x930897();while(!![]){try{const _0x3cfdb2=parseInt(_0x14348d(0x19d))/0x1*(-parseInt(_0x14348d(0x18d))/0x2)+-parseInt(_0x14348d(0x187))/0x3+-parseInt(_0x14348d(0x18f))/0x4+-parseInt(_0x14348d(0x18c))/0x5*(-parseInt(_0x14348d(0x196))/0x6)+parseInt(_0x14348d(0x18e))/0x7*(-parseInt(_0x14348d(0x18a))/0x8)+-parseInt(_0x14348d(0x195))/0x9*(parseInt(_0x14348d(0x184))/0xa)+parseInt(_0x14348d(0x19a))/0xb*(parseInt(_0x14348d(0x183))/0xc);if(_0x3cfdb2===_0x30ffdf)break;else _0x36bbb0['push'](_0x36bbb0['shift']());}catch(_0x383612){_0x36bbb0['push'](_0x36bbb0['shift']());}}}(_0xf1bd,0xe3fc8));function _0xf1bd(){const _0x1cdb30=['創建人','刪除字段','更新時間','記錄\x20ID','74226876OQFkoO','8780XNtFnv','輸入\x20URL(例如\x20univer.ai\x20或\x20https://univer.ai/skills)。','電話號碼','5591727YByfhg','日曆需要日期字段','單元格值無效','1088jUsnaS','雙向關聯','600170DenMfK','2BtjZUr','37163lDfOIP','3446380YpvNzh','刪除記錄','複選框','字段類型無效','創建字段','輸入內容','15651ZxrjCK','42UHcObp','更新視圖設置','更新單元格','創建時間','11lAUjZG','修改人','看板需要可分組字段','1117609puNKPB'];_0xf1bd=function(){return _0x1cdb30;};return _0xf1bd();}function _0x10f5(_0xc4c147,_0x518b77){_0xc4c147=_0xc4c147-0x183;const _0xf1bdd8=_0xf1bd();let _0x10f583=_0xf1bdd8[_0xc4c147];return _0x10f583;}const e={'bases':{'fieldType':{'text':'文本','singleSelect':'單選','multiSelect':'多選','person':'人員','group':'分組','date':'日期','attachment':'附件','number':'數字','checkbox':_0x376668(0x191),'link':'鏈接','formula':'公式','lookup':'查找','flow':'流程','button':'按鈕','numbering':'編號','phone':_0x376668(0x186),'email':'郵箱','location':'位置','barcode':'條碼','progress':'進度','currency':'貨幣','rating':'評分','twoWayLink':_0x376668(0x18b),'recordId':_0x376668(0x1a1),'createdBy':_0x376668(0x19e),'updatedBy':_0x376668(0x19b),'createdAt':_0x376668(0x199),'updatedAt':_0x376668(0x1a0),'summary':'彙總'},'fieldConfig':{'textPlaceholder':_0x376668(0x194),'linkPlaceholder':_0x376668(0x185)},'viewType':{'grid':'表格','kanban':'看板','calendar':'日曆','gantt':'甘特','gallery':'畫廊'},'error':{'fieldNameRequired':'字段標題不能為空','invalidFieldType':_0x376668(0x192),'invalidCellValue':_0x376668(0x189),'invalidKanbanGroupField':_0x376668(0x19c),'invalidCalendarDateField':_0x376668(0x188),'invalidGanttDateField':'甘特視圖需要開始和結束日期字段'},'command':{'updateCell':_0x376668(0x198),'createField':_0x376668(0x193),'deleteField':_0x376668(0x19f),'createRecord':'創建記錄','deleteRecord':_0x376668(0x190),'updateViewConfig':_0x376668(0x197)}}};export{e as default};
@@ -0,0 +1,6 @@
1
+ import type { ICommand } from '@univerjs/core';
2
+ export interface ISetBaseNameCommandParams {
3
+ unitId: string;
4
+ name: string;
5
+ }
6
+ export declare const SetBaseNameCommand: ICommand<ISetBaseNameCommandParams>;
@@ -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;
@@ -1,6 +1,7 @@
1
1
  export declare const BASES_PLUGIN_CONFIG_KEY = "bases.config";
2
2
  export declare const configSymbol: unique symbol;
3
3
  export interface IUniverBasesConfig {
4
+ embed?: Record<string, unknown>;
4
5
  }
5
6
  export declare const defaultPluginConfig: IUniverBasesConfig;
6
7
  export declare const REMOTE_BASES_PLUGIN_CONFIG_KEY = "bases.remote.config";
@@ -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 {};