@univerjs/sheets-table 1.3.0 → 1.4.0
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/README.md +23 -0
- package/lib/cjs/facade.js +3 -7
- package/lib/cjs/index.js +45 -4960
- package/lib/cjs/locale/ar-SA.js +1 -2
- package/lib/cjs/locale/ca-ES.js +1 -2
- package/lib/cjs/locale/de-DE.js +1 -2
- package/lib/cjs/locale/en-US.js +1 -2
- package/lib/cjs/locale/es-ES.js +1 -2
- package/lib/cjs/locale/fa-IR.js +1 -2
- package/lib/cjs/locale/fr-FR.js +1 -2
- package/lib/cjs/locale/id-ID.js +1 -2
- package/lib/cjs/locale/it-IT.js +1 -2
- package/lib/cjs/locale/ja-JP.js +1 -2
- package/lib/cjs/locale/ko-KR.js +1 -2
- package/lib/cjs/locale/pl-PL.js +1 -2
- package/lib/cjs/locale/pt-BR.js +1 -2
- package/lib/cjs/locale/ru-RU.js +1 -2
- package/lib/cjs/locale/sk-SK.js +1 -2
- package/lib/cjs/locale/vi-VN.js +1 -2
- package/lib/cjs/locale/zh-CN.js +1 -2
- package/lib/cjs/locale/zh-HK.js +1 -2
- package/lib/cjs/locale/zh-TW.js +1 -2
- package/lib/cjs/plugin-D9zM3t0a.js +5296 -0
- package/lib/cjs/worker.js +9 -0
- package/lib/es/facade.js +3 -6
- package/lib/es/index.js +1 -4916
- package/lib/es/locale/ar-SA.js +1 -2
- package/lib/es/locale/ca-ES.js +1 -2
- package/lib/es/locale/de-DE.js +1 -2
- package/lib/es/locale/en-US.js +1 -2
- package/lib/es/locale/es-ES.js +1 -2
- package/lib/es/locale/fa-IR.js +1 -2
- package/lib/es/locale/fr-FR.js +1 -2
- package/lib/es/locale/id-ID.js +1 -2
- package/lib/es/locale/it-IT.js +1 -2
- package/lib/es/locale/ja-JP.js +1 -2
- package/lib/es/locale/ko-KR.js +1 -2
- package/lib/es/locale/pl-PL.js +1 -2
- package/lib/es/locale/pt-BR.js +1 -2
- package/lib/es/locale/ru-RU.js +1 -2
- package/lib/es/locale/sk-SK.js +1 -2
- package/lib/es/locale/vi-VN.js +1 -2
- package/lib/es/locale/zh-CN.js +1 -2
- package/lib/es/locale/zh-HK.js +1 -2
- package/lib/es/locale/zh-TW.js +1 -2
- package/lib/es/plugin-D3R6dh5q.js +5039 -0
- package/lib/es/worker.js +3 -0
- package/lib/facade.js +3 -6
- package/lib/index.js +1 -4916
- package/lib/locale/ar-SA.js +1 -2
- package/lib/locale/ca-ES.js +1 -2
- package/lib/locale/de-DE.js +1 -2
- package/lib/locale/en-US.js +1 -2
- package/lib/locale/es-ES.js +1 -2
- package/lib/locale/fa-IR.js +1 -2
- package/lib/locale/fr-FR.js +1 -2
- package/lib/locale/id-ID.js +1 -2
- package/lib/locale/it-IT.js +1 -2
- package/lib/locale/ja-JP.js +1 -2
- package/lib/locale/ko-KR.js +1 -2
- package/lib/locale/pl-PL.js +1 -2
- package/lib/locale/pt-BR.js +1 -2
- package/lib/locale/ru-RU.js +1 -2
- package/lib/locale/sk-SK.js +1 -2
- package/lib/locale/vi-VN.js +1 -2
- package/lib/locale/zh-CN.js +1 -2
- package/lib/locale/zh-HK.js +1 -2
- package/lib/locale/zh-TW.js +1 -2
- package/lib/plugin-D3R6dh5q.js +5039 -0
- package/lib/types/commands/mutations/add-sheet-table.mutation.d.ts +2 -1
- package/lib/types/controllers/sheets-table.controller.d.ts +1 -0
- package/lib/types/controllers/table-theme.factory.d.ts +25 -25
- package/lib/types/models/filter-util/condition.d.ts +1 -1
- package/lib/types/models/filter-util/date-filter-util.d.ts +1 -1
- package/lib/types/models/table-dxf.d.ts +25 -0
- package/lib/types/models/table-manager.d.ts +2 -2
- package/lib/types/models/table.d.ts +4 -4
- package/lib/types/services/table.service.d.ts +2 -2
- package/lib/types/worker.d.ts +16 -0
- package/lib/umd/index.js +1 -1
- package/lib/worker.js +3 -0
- package/package.json +16 -11
package/README.md
CHANGED
|
@@ -48,3 +48,26 @@ Use this package with `@univerjs/sheets-table-ui` when users need table controls
|
|
|
48
48
|
- [Documentation](https://docs.univer.ai)
|
|
49
49
|
- [NPM package](https://npmjs.com/package/@univerjs/sheets-table)
|
|
50
50
|
- [GitHub repository](https://github.com/dream-num/univer)
|
|
51
|
+
|
|
52
|
+
## Table differential formats
|
|
53
|
+
|
|
54
|
+
Imported XLSX table themes and direct differential formats are separate. Table themes remain in the existing range-theme resource; direct formats remain in Table and TableColumn metadata. This support requires the matching Sheets and Sheets Numfmt implementations and a matching Office native importer/exporter. No new resource version field, column `style` mapping, Facade method or style editor is introduced.
|
|
55
|
+
|
|
56
|
+
| Location | Format keys |
|
|
57
|
+
| --- | --- |
|
|
58
|
+
| `table.meta._xlsx.options` | `dataDxfStyle`, `headerRowDxfStyle`, `totalsRowDxfStyle`, `tableBorderDxfStyle`, `headerRowBorderDxfStyle`, `totalsRowBorderDxfStyle` |
|
|
59
|
+
| `column.meta._xlsx` | `dataDxfStyle`, `headerRowDxfStyle`, `totalsRowDxfStyle` |
|
|
60
|
+
|
|
61
|
+
Each format contains supported `IStyleData` properties. Fields beginning with an underscore preserve exchange information and are not rendered. The runtime applies the matching table region, then the matching column region by property, on top of the table theme. Explicit cell formats retain precedence; existing conditional-format processing remains separate. Border attributes are projected onto the current region boundary. Inside-horizontal and inside-vertical OOXML borders are not represented by the current frontend border model.
|
|
62
|
+
|
|
63
|
+
The Sheets package exports its existing `RangeThemeInterceptorId`; table direct formats use the same identifier so reads that explicitly exclude inherited range formatting also exclude these formats. `InterceptCellContentPriority.TABLE_STYLE` places the metadata resolver before number formatting.
|
|
64
|
+
|
|
65
|
+
Sheets Table writes matching direct formats to the existing runtime `themeStyle`; the theme and number-format interceptors consume that value according to their existing interceptor order without adding JSON or snapshot fields. Without a matching dxf, theme assignment and number-format lookup retain their previous behavior. The dxf number-format fallback is enabled only when the current high-priority Table interceptor has supplied `themeStyle.n`.
|
|
66
|
+
|
|
67
|
+
Formats follow the current table range and column identities, including inserted rows and table moves. For tables with dxf metadata, table and column metadata are retained when copying worksheets and undoing table deletion, and column shifts preserve column objects. Tables without dxf continue to use their original structural and restoration paths. An imported table that has direct formats but originally no theme does not receive the default table theme. Ordinary default-theme behavior for other tables is unchanged. Direct formats are import-only: no UI, Facade setter or dedicated editing command is provided.
|
|
68
|
+
|
|
69
|
+
For internal creation and restoration, `AddSheetTableMutation` accepts optional `meta`; `TableManager.addTable` and `SheetTableService.addTable` accept the same metadata as an optional final argument. Metadata is installed before the table-added event. Existing calls remain valid and do not add empty table metadata when the argument is omitted. The manager restores supplied column metadata only for tables with dxf; ordinary column initialization retains its previous behavior.
|
|
70
|
+
|
|
71
|
+
The matching exporter treats an existing metadata container as authoritative: deleting a dxf key clears that direct format instead of reviving a stale native field or raw XML attribute. If the container is absent, legacy native fields remain readable. Raw dxf XML matching the current supported properties is retained; edits use the supported encoder and may lose unsupported extensions. These export consistency rules do not expose frontend dxf editing; mutating a metadata object directly is not a supported undoable formatting operation.
|
|
72
|
+
|
|
73
|
+
New importers no longer materialize direct table formats into cell styles or use the old empty `rust-direct-dxf-*` theme. Older runtimes do not dynamically consume the new import result even if they save its metadata. Older bindings do not guarantee the new metadata edit/clear semantics. Upgrade the runtime and native exchange components together. Historical materialized snapshots are not automatically rewritten; re-import the original XLSX when possible. Published package combinations and Excel rendering require separate consumer validation.
|
package/lib/cjs/facade.js
CHANGED
|
@@ -4,7 +4,7 @@ let _univerjs_sheets_facade = require("@univerjs/sheets/facade");
|
|
|
4
4
|
let _univerjs_sheets = require("@univerjs/sheets");
|
|
5
5
|
let _univerjs_core_facade = require("@univerjs/core/facade");
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/facade/f-workbook.ts
|
|
8
8
|
var FWorkbookSheetsTableMixin = class extends _univerjs_sheets_facade.FWorkbook {
|
|
9
9
|
getTableInfo(tableId) {
|
|
10
10
|
const unitId = this.getId();
|
|
@@ -61,8 +61,7 @@ var FWorkbookSheetsTableMixin = class extends _univerjs_sheets_facade.FWorkbook
|
|
|
61
61
|
};
|
|
62
62
|
_univerjs_sheets_facade.FWorkbook.extend(FWorkbookSheetsTableMixin);
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
//#region src/facade/f-worksheet.ts
|
|
64
|
+
// src/facade/f-worksheet.ts
|
|
66
65
|
var FWorksheetTableMixin = class extends _univerjs_sheets_facade.FWorksheet {
|
|
67
66
|
setTableColumnFormula(tableId, columnId, formula) {
|
|
68
67
|
const unitId = this.getWorkbook().getUnitId();
|
|
@@ -179,8 +178,7 @@ var FWorksheetTableMixin = class extends _univerjs_sheets_facade.FWorksheet {
|
|
|
179
178
|
};
|
|
180
179
|
_univerjs_sheets_facade.FWorksheet.extend(FWorksheetTableMixin);
|
|
181
180
|
|
|
182
|
-
|
|
183
|
-
//#region src/facade/f-enum.ts
|
|
181
|
+
// src/facade/f-enum.ts
|
|
184
182
|
/**
|
|
185
183
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
186
184
|
*
|
|
@@ -214,5 +212,3 @@ var FSheetsTableEnumMixin = class extends _univerjs_core_facade.FEnum {
|
|
|
214
212
|
}
|
|
215
213
|
};
|
|
216
214
|
_univerjs_core_facade.FEnum.extend(FSheetsTableEnumMixin);
|
|
217
|
-
|
|
218
|
-
//#endregion
|