@univerjs/sheets-table 0.24.0 → 0.25.0-insiders.20260608-e4336f7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/lib/cjs/index.js +283 -160
  2. package/lib/cjs/locale/ar-SA.js +10 -0
  3. package/lib/cjs/locale/ca-ES.js +10 -0
  4. package/lib/cjs/locale/de-DE.js +10 -0
  5. package/lib/cjs/locale/en-US.js +25 -0
  6. package/lib/cjs/locale/es-ES.js +10 -0
  7. package/lib/cjs/locale/fa-IR.js +10 -0
  8. package/lib/cjs/locale/fr-FR.js +10 -0
  9. package/lib/cjs/locale/id-ID.js +10 -0
  10. package/lib/cjs/locale/it-IT.js +10 -0
  11. package/lib/cjs/locale/ja-JP.js +10 -0
  12. package/lib/cjs/locale/ko-KR.js +10 -0
  13. package/lib/cjs/locale/pl-PL.js +10 -0
  14. package/lib/cjs/locale/pt-BR.js +10 -0
  15. package/lib/cjs/locale/ru-RU.js +10 -0
  16. package/lib/cjs/locale/sk-SK.js +10 -0
  17. package/lib/cjs/locale/vi-VN.js +10 -0
  18. package/lib/cjs/locale/zh-CN.js +10 -0
  19. package/lib/cjs/locale/zh-HK.js +10 -0
  20. package/lib/cjs/locale/zh-TW.js +10 -0
  21. package/lib/es/index.js +283 -161
  22. package/lib/es/locale/ar-SA.js +9 -0
  23. package/lib/es/locale/ca-ES.js +9 -0
  24. package/lib/es/locale/de-DE.js +9 -0
  25. package/lib/es/locale/en-US.js +24 -0
  26. package/lib/es/locale/es-ES.js +9 -0
  27. package/lib/es/locale/fa-IR.js +9 -0
  28. package/lib/es/locale/fr-FR.js +9 -0
  29. package/lib/es/locale/id-ID.js +9 -0
  30. package/lib/es/locale/it-IT.js +9 -0
  31. package/lib/es/locale/ja-JP.js +9 -0
  32. package/lib/es/locale/ko-KR.js +9 -0
  33. package/lib/es/locale/pl-PL.js +9 -0
  34. package/lib/es/locale/pt-BR.js +9 -0
  35. package/lib/es/locale/ru-RU.js +9 -0
  36. package/lib/es/locale/sk-SK.js +9 -0
  37. package/lib/es/locale/vi-VN.js +9 -0
  38. package/lib/es/locale/zh-CN.js +9 -0
  39. package/lib/es/locale/zh-HK.js +9 -0
  40. package/lib/es/locale/zh-TW.js +9 -0
  41. package/lib/index.js +283 -161
  42. package/lib/locale/ar-SA.js +9 -0
  43. package/lib/locale/ca-ES.js +9 -0
  44. package/lib/locale/de-DE.js +9 -0
  45. package/lib/locale/en-US.js +24 -0
  46. package/lib/locale/es-ES.js +9 -0
  47. package/lib/locale/fa-IR.js +9 -0
  48. package/lib/locale/fr-FR.js +9 -0
  49. package/lib/locale/id-ID.js +9 -0
  50. package/lib/locale/it-IT.js +9 -0
  51. package/lib/locale/ja-JP.js +9 -0
  52. package/lib/locale/ko-KR.js +9 -0
  53. package/lib/locale/pl-PL.js +9 -0
  54. package/lib/locale/pt-BR.js +9 -0
  55. package/lib/locale/ru-RU.js +9 -0
  56. package/lib/locale/sk-SK.js +9 -0
  57. package/lib/locale/vi-VN.js +9 -0
  58. package/lib/locale/zh-CN.js +9 -0
  59. package/lib/locale/zh-HK.js +9 -0
  60. package/lib/locale/zh-TW.js +9 -0
  61. package/lib/types/commands/commands/set-sheet-table.command.d.ts +1 -0
  62. package/lib/types/const.d.ts +1 -0
  63. package/lib/types/controllers/sheet-table-formula.controller.d.ts +1 -1
  64. package/lib/types/controllers/sheet-table-range.controller.d.ts +1 -1
  65. package/lib/types/controllers/sheet-table-ref-range.controller.d.ts +4 -1
  66. package/lib/types/controllers/sheet-table-theme.controller.d.ts +1 -1
  67. package/lib/types/controllers/sheets-table.controller.d.ts +2 -2
  68. package/lib/types/controllers/table-filter.controller.d.ts +5 -5
  69. package/lib/types/controllers/table-theme.factory.d.ts +4 -4
  70. package/lib/types/facade/f-workbook.d.ts +8 -4
  71. package/lib/types/facade/f-worksheet.d.ts +18 -9
  72. package/lib/types/index.d.ts +2 -2
  73. package/lib/types/locale/ar-SA.d.ts +18 -0
  74. package/lib/types/locale/ca-ES.d.ts +18 -0
  75. package/lib/types/locale/de-DE.d.ts +18 -0
  76. package/lib/types/locale/en-US.d.ts +23 -0
  77. package/lib/types/locale/es-ES.d.ts +18 -0
  78. package/lib/types/locale/fa-IR.d.ts +18 -0
  79. package/lib/types/locale/fr-FR.d.ts +18 -0
  80. package/lib/types/locale/id-ID.d.ts +18 -0
  81. package/lib/types/locale/it-IT.d.ts +18 -0
  82. package/lib/types/locale/ja-JP.d.ts +18 -0
  83. package/lib/types/locale/ko-KR.d.ts +18 -0
  84. package/lib/types/locale/pl-PL.d.ts +18 -0
  85. package/lib/types/locale/pt-BR.d.ts +18 -0
  86. package/lib/types/locale/ru-RU.d.ts +18 -0
  87. package/lib/types/locale/sk-SK.d.ts +18 -0
  88. package/lib/types/locale/vi-VN.d.ts +18 -0
  89. package/lib/types/locale/zh-CN.d.ts +18 -0
  90. package/lib/types/locale/zh-HK.d.ts +18 -0
  91. package/lib/types/locale/zh-TW.d.ts +18 -0
  92. package/lib/types/services/table.service.d.ts +1 -1
  93. package/lib/types/util.d.ts +1 -1
  94. package/lib/umd/facade.js +1 -1
  95. package/lib/umd/index.js +1 -1
  96. package/lib/umd/locale/ar-SA.js +1 -0
  97. package/lib/umd/locale/ca-ES.js +1 -0
  98. package/lib/umd/locale/de-DE.js +1 -0
  99. package/lib/umd/locale/en-US.js +1 -0
  100. package/lib/umd/locale/es-ES.js +1 -0
  101. package/lib/umd/locale/fa-IR.js +1 -0
  102. package/lib/umd/locale/fr-FR.js +1 -0
  103. package/lib/umd/locale/id-ID.js +1 -0
  104. package/lib/umd/locale/it-IT.js +1 -0
  105. package/lib/umd/locale/ja-JP.js +1 -0
  106. package/lib/umd/locale/ko-KR.js +1 -0
  107. package/lib/umd/locale/pl-PL.js +1 -0
  108. package/lib/umd/locale/pt-BR.js +1 -0
  109. package/lib/umd/locale/ru-RU.js +1 -0
  110. package/lib/umd/locale/sk-SK.js +1 -0
  111. package/lib/umd/locale/vi-VN.js +1 -0
  112. package/lib/umd/locale/zh-CN.js +1 -0
  113. package/lib/umd/locale/zh-HK.js +1 -0
  114. package/lib/umd/locale/zh-TW.js +1 -0
  115. package/package.json +13 -6
  116. package/LICENSE +0 -176
  117. /package/lib/types/{model → models}/filter-util/condition.d.ts +0 -0
  118. /package/lib/types/{model → models}/filter-util/date-filter-util.d.ts +0 -0
  119. /package/lib/types/{model → models}/filter-util/number-filter-util.d.ts +0 -0
  120. /package/lib/types/{model → models}/filter-util/text-filter-util.d.ts +0 -0
  121. /package/lib/types/{model → models}/filter-util/top-n.d.ts +0 -0
  122. /package/lib/types/{model → models}/table-column.d.ts +0 -0
  123. /package/lib/types/{model → models}/table-filter.d.ts +0 -0
  124. /package/lib/types/{model → models}/table-manager.d.ts +0 -0
  125. /package/lib/types/{model → models}/table.d.ts +0 -0
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -16,7 +16,7 @@
16
16
  import type { Worksheet } from '@univerjs/core';
17
17
  import type { ITableFilterItem, ITableInfoWithUnitId, ITableOptions, ITableRange, TableMetaType } from '../types/type';
18
18
  import { Disposable } from '@univerjs/core';
19
- import { TableManager } from '../model/table-manager';
19
+ import { TableManager } from '../models/table-manager';
20
20
  import { TableConditionTypeEnum } from '../types/enum';
21
21
  export declare class SheetTableService extends Disposable {
22
22
  private _tableManager;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import type { ICellData, IDocumentData, IUniverInstanceService, Nullable } from '@univerjs/core';
17
17
  import type { IDefinedNamesService } from '@univerjs/engine-formula';
18
- import type { TableManager } from './model/table-manager';
18
+ import type { TableManager } from './models/table-manager';
19
19
  import type { ITableConditionFilterItem, ITableFilterItem, ITableManualFilterItem } from './types/type';
20
20
  import { SheetsTableButtonStateEnum, SheetsTableSortStateEnum } from './types/enum';
21
21
  export declare function getColumnName(columnIndex: number, columnText: string): string;
package/lib/umd/facade.js CHANGED
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(require(`@univerjs/core`),require(`@univerjs/sheets-table`),require(`@univerjs/sheets/facade`),require(`@univerjs/sheets`),require(`@univerjs/core/facade`)):typeof define==`function`&&define.amd?define([`@univerjs/core`,`@univerjs/sheets-table`,`@univerjs/sheets/facade`,`@univerjs/sheets`,`@univerjs/core/facade`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverCore,e.UniverSheetsTable,e.UniverSheetsFacade,e.UniverSheets,e.UniverCoreFacade))})(this,function(e,t,n,r,i){var a=class extends n.FWorkbook{getTableInfo(e){let n=this.getId();return this._injector.get(t.SheetTableService).getTableInfo(n,e)}getTableList(){let e=this.getId();return this._injector.get(t.SheetTableService).getTableList(e)}async addTable(n,r,i,a,o){let s=this._injector.get(t.SheetTableService),c=this._injector.get(e.LocaleService),l=this._injector.get(e.IUniverInstanceService).getCurrentUnitOfType(e.UniverInstanceType.UNIVER_SHEET),u=new Set;if(l&&l.getSheets().forEach(e=>{u.add(e.getName())}),!(0,e.customNameCharacterCheck)(r,u)){this._injector.get(e.ILogService).warn(c.t(`sheets-table.tableNameError`));return}let d={unitId:this.getId(),name:r,subUnitId:n,range:i,options:o,id:a};if(await this._commandService.executeCommand(t.AddSheetTableCommand.id,d)){var f;return(f=s.getTableList(this.getId()).find(e=>e.name===r))==null?void 0:f.id}}async removeTable(e){var n;let r=(n=this.getTableInfo(e))==null?void 0:n.subUnitId;if(!r)return!1;let i={unitId:this.getId(),subUnitId:r,tableId:e};return this._commandService.executeCommand(t.DeleteSheetTableCommand.id,i)}getTableInfoByName(e){return this.getTableList().find(t=>t.name===e)}setTableFilter(e,n,r){let i={unitId:this.getId(),tableId:e,column:n,tableFilter:r};return this._commandService.executeCommand(t.SetSheetTableFilterCommand.id,i)}};n.FWorkbook.extend(a);var o=class extends n.FWorksheet{addTable(n,r,i,a){let o=this.getSheetId(),s=this.getWorkbook(),c=s.getUnitId(),l=this._injector.get(e.LocaleService),u=new Set;if(s&&s.getSheets().forEach(e=>{u.add(e.getName())}),!(0,e.customNameCharacterCheck)(n,u))return this._injector.get(e.ILogService).warn(l.t(`sheets-table.tableNameError`)),!1;let d={unitId:c,subUnitId:o,name:n,range:r,id:i,options:a};return this._commandService.executeCommand(t.AddSheetTableCommand.id,d)}setTableFilter(e,n,r){let i={unitId:this.getWorkbook().getUnitId(),tableId:e,column:n,tableFilter:r};return this._commandService.executeCommand(t.SetSheetTableFilterCommand.id,i)}removeTable(e){let n={unitId:this._fWorkbook.getId(),subUnitId:this.getSheetId(),tableId:e};return this._commandService.executeCommand(t.DeleteSheetTableCommand.id,n)}setTableRange(e,n){let r={unitId:this.getWorkbook().getUnitId(),tableId:e,updateRange:{newRange:n}};return this._commandService.executeCommand(t.SetSheetTableCommand.id,r)}setTableName(n,r){let i=this.getWorkbook(),a=this._injector.get(e.LocaleService),o=new Set;if(i&&i.getSheets().forEach(e=>{o.add(e.getName())}),!(0,e.customNameCharacterCheck)(r,o))return this._injector.get(e.ILogService).warn(a.t(`sheets-table.tableNameError`)),!1;let s={unitId:this.getWorkbook().getUnitId(),tableId:n,name:r};return this._commandService.executeCommand(t.SetSheetTableCommand.id,s)}getSubTableInfos(){let e=this._fWorkbook.getId();return this._injector.get(t.SheetTableService).getTableList(e).filter(e=>e.subUnitId===this.getSheetId())}resetFilter(e,n){let r={unitId:this._fWorkbook.getId(),tableId:e,column:n,tableFilter:void 0};return this._commandService.executeCommand(t.SetSheetTableFilterCommand.id,r)}getTableByCell(n,r){let i=this._fWorkbook.getId(),a=this._injector.get(t.SheetTableService).getTableList(i).filter(e=>e.subUnitId===this.getSheetId()),o=(0,e.cellToRange)(n,r);return a.find(t=>{let n=t.range;return e.Rectangle.intersects(n,o)})}addTableTheme(e,n){let i=new r.RangeThemeStyle(`table-style`);return i.fromJson(n),this._commandService.executeCommand(t.AddTableThemeCommand.id,{unitId:this._fWorkbook.getId(),tableId:e,themeStyle:i})}};n.FWorksheet.extend(o);var s=class extends i.FEnum{get TableColumnFilterTypeEnum(){return t.TableColumnFilterTypeEnum}get TableConditionTypeEnum(){return t.TableConditionTypeEnum}get TableNumberCompareTypeEnum(){return t.TableNumberCompareTypeEnum}get TableStringCompareTypeEnum(){return t.TableStringCompareTypeEnum}get TableDateCompareTypeEnum(){return t.TableDateCompareTypeEnum}};i.FEnum.extend(s)});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(require("@univerjs/core"),require("@univerjs/sheets-table"),require("@univerjs/sheets/facade"),require("@univerjs/sheets"),require("@univerjs/core/facade")):typeof define==`function`&&define.amd?define([`@univerjs/core`,`@univerjs/sheets-table`,`@univerjs/sheets/facade`,`@univerjs/sheets`,`@univerjs/core/facade`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverCore,e.UniverSheetsTable,e.UniverSheetsFacade,e.UniverSheets,e.UniverCoreFacade))})(this,function(e,t,n,r,i){var a=class extends n.FWorkbook{getTableInfo(e){let n=this.getId();return this._injector.get(t.SheetTableService).getTableInfo(n,e)}getTableList(){let e=this.getId();return this._injector.get(t.SheetTableService).getTableList(e)}async addTable(n,r,i,a,o){let s=this._injector.get(t.SheetTableService),c=this._injector.get(e.LocaleService),l=this._injector.get(e.IUniverInstanceService).getCurrentUnitOfType(e.UniverInstanceType.UNIVER_SHEET),u=new Set;if(l&&l.getSheets().forEach(e=>{u.add(e.getName())}),!(0,e.customNameCharacterCheck)(r,u)){this._injector.get(e.ILogService).warn(c.t(`sheets-table.tableNameError`));return}let d={unitId:this.getId(),name:r,subUnitId:n,range:i,options:o,id:a};if(await this._commandService.executeCommand(t.AddSheetTableCommand.id,d)){var f;return(f=s.getTableList(this.getId()).find(e=>e.name===r))==null?void 0:f.id}}async removeTable(e){var n;let r=(n=this.getTableInfo(e))==null?void 0:n.subUnitId;if(!r)return!1;let i={unitId:this.getId(),subUnitId:r,tableId:e};return this._commandService.executeCommand(t.DeleteSheetTableCommand.id,i)}getTableInfoByName(e){return this.getTableList().find(t=>t.name===e)}setTableFilter(e,n,r){let i={unitId:this.getId(),tableId:e,column:n,tableFilter:r};return this._commandService.executeCommand(t.SetSheetTableFilterCommand.id,i)}};n.FWorkbook.extend(a);var o=class extends n.FWorksheet{addTable(n,r,i,a){let o=this.getSheetId(),s=this.getWorkbook(),c=s.getUnitId(),l=this._injector.get(e.LocaleService),u=new Set;if(s&&s.getSheets().forEach(e=>{u.add(e.getName())}),!(0,e.customNameCharacterCheck)(n,u))return this._injector.get(e.ILogService).warn(l.t(`sheets-table.tableNameError`)),!1;let d={unitId:c,subUnitId:o,name:n,range:r,id:i,options:a};return this._commandService.executeCommand(t.AddSheetTableCommand.id,d)}setTableFilter(e,n,r){let i={unitId:this.getWorkbook().getUnitId(),tableId:e,column:n,tableFilter:r};return this._commandService.executeCommand(t.SetSheetTableFilterCommand.id,i)}removeTable(e){let n={unitId:this._fWorkbook.getId(),subUnitId:this.getSheetId(),tableId:e};return this._commandService.executeCommand(t.DeleteSheetTableCommand.id,n)}setTableRange(e,n){let r={unitId:this.getWorkbook().getUnitId(),tableId:e,updateRange:{newRange:n}};return this._commandService.executeCommand(t.SetSheetTableCommand.id,r)}setTableName(n,r){let i=this.getWorkbook(),a=this._injector.get(e.LocaleService),o=new Set;if(i&&i.getSheets().forEach(e=>{o.add(e.getName())}),!(0,e.customNameCharacterCheck)(r,o))return this._injector.get(e.ILogService).warn(a.t(`sheets-table.tableNameError`)),!1;let s={unitId:this.getWorkbook().getUnitId(),tableId:n,name:r};return this._commandService.executeCommand(t.SetSheetTableCommand.id,s)}getSubTableInfos(){let e=this._fWorkbook.getId();return this._injector.get(t.SheetTableService).getTableList(e).filter(e=>e.subUnitId===this.getSheetId())}resetFilter(e,n){let r={unitId:this._fWorkbook.getId(),tableId:e,column:n,tableFilter:void 0};return this._commandService.executeCommand(t.SetSheetTableFilterCommand.id,r)}getTableByCell(n,r){let i=this._fWorkbook.getId(),a=this._injector.get(t.SheetTableService).getTableList(i).filter(e=>e.subUnitId===this.getSheetId()),o=(0,e.cellToRange)(n,r);return a.find(t=>{let n=t.range;return e.Rectangle.intersects(n,o)})}addTableTheme(e,n){let i=new r.RangeThemeStyle(`table-style`);return i.fromJson(n),this._commandService.executeCommand(t.AddTableThemeCommand.id,{unitId:this._fWorkbook.getId(),tableId:e,themeStyle:i})}};n.FWorksheet.extend(o);var s=class extends i.FEnum{get TableColumnFilterTypeEnum(){return t.TableColumnFilterTypeEnum}get TableConditionTypeEnum(){return t.TableConditionTypeEnum}get TableNumberCompareTypeEnum(){return t.TableNumberCompareTypeEnum}get TableStringCompareTypeEnum(){return t.TableStringCompareTypeEnum}get TableDateCompareTypeEnum(){return t.TableDateCompareTypeEnum}};i.FEnum.extend(s)});