diff --git a/packages/s2-core/CHANGELOG.md b/packages/s2-core/CHANGELOG.md index 25260a5958..e4f6fd5801 100644 --- a/packages/s2-core/CHANGELOG.md +++ b/packages/s2-core/CHANGELOG.md @@ -1,3 +1,14 @@ +# [@antv/s2-v2.0.0-next.32](https://github.com/antvis/S2/compare/@antv/s2-v2.0.0-next.31...@antv/s2-v2.0.0-next.32) (2024-11-08) + + +### Bug Fixes + +* 修复分割线在深色背景下颜色渲染异常 & 内容宽高未包含分割线的问题 ([#2961](https://github.com/antvis/S2/issues/2961)) ([e759891](https://github.com/antvis/S2/commit/e759891865eee0940d0f5c92345d5490e10eb57c)) +* 修复开启自定义指标层级后, 角头数值文本未对齐 close [#2957](https://github.com/antvis/S2/issues/2957) ([#2966](https://github.com/antvis/S2/issues/2966)) ([6558a0d](https://github.com/antvis/S2/commit/6558a0df55dc324e1810e2f2a5d314de7389e2b1)) +* 修复文本设为左对齐时, 角头文本没有垂直对齐的问题 ([#2960](https://github.com/antvis/S2/issues/2960)) ([af8c968](https://github.com/antvis/S2/commit/af8c96809fd0e52f1da81e2a1c082a5f5b0b122a)) +* 修复明细表自定义列头时开启文本换行, 单元格高度错误的问题 close [#2955](https://github.com/antvis/S2/issues/2955) ([#2968](https://github.com/antvis/S2/issues/2968)) ([ca1f7e8](https://github.com/antvis/S2/commit/ca1f7e8a614dc5b36a6bc270df4ea8338e670444)) +* 修复表格卸载后, 高清适配逻辑还会触发的问题 ([#2965](https://github.com/antvis/S2/issues/2965)) ([c837efe](https://github.com/antvis/S2/commit/c837efe29f2ff02ea8957bcaf62be57d2467f160)), closes [L#116](https://github.com/L/issues/116) + # [@antv/s2-v2.0.0-next.31](https://github.com/antvis/S2/compare/@antv/s2-v2.0.0-next.30...@antv/s2-v2.0.0-next.31) (2024-11-01) diff --git a/packages/s2-core/__tests__/bugs/issue-2957-spec.ts b/packages/s2-core/__tests__/bugs/issue-2957-spec.ts new file mode 100644 index 0000000000..e33e8df0fb --- /dev/null +++ b/packages/s2-core/__tests__/bugs/issue-2957-spec.ts @@ -0,0 +1,53 @@ +/** + * @description spec for issue #2957 + * https://github.com/antvis/S2/issues/2957 + */ +import { PivotSheet } from '@/sheet-type'; +import type { S2Options } from '../../src'; +import { getContainer } from '../util/helpers'; + +const s2Options: S2Options = { + width: 800, + height: 600, +}; + +describe('Corner Measure Text Tests', () => { + test('should get correctly theme config with customValueOrder', async () => { + const s2 = new PivotSheet( + getContainer(), + { + data: [ + { + '4rweiwt7aneo': '上海市', + '4w8pyhsbkkjk': '①正常库存', + '4vynudxz28sg': '457', + styleKey: 1, + }, + ], + fields: { + valueInCols: true, + rows: ['4rweiwt7aneo'], + columns: ['4w8pyhsbkkjk'], + values: ['4vynudxz28sg'], + customValueOrder: 0, + }, + }, + s2Options, + ); + + s2.setTheme({ + cornerCell: { + measureText: { + fill: 'blue', + textAlign: 'center', + fontSize: 12, + }, + }, + }); + await s2.render(); + + const extraFieldText = s2.facet.getCornerCells()[1].getTextShape(); + + expect(extraFieldText.parsedStyle.textBaseline).toEqual('middle'); + }); +}); diff --git a/packages/s2-core/__tests__/data/custom-table-col-fields.ts b/packages/s2-core/__tests__/data/custom-table-col-fields.ts index a53ca96912..a7cadc1437 100644 --- a/packages/s2-core/__tests__/data/custom-table-col-fields.ts +++ b/packages/s2-core/__tests__/data/custom-table-col-fields.ts @@ -23,6 +23,29 @@ export const customColSimpleColumns: CustomTreeNode[] = [ }, ]; +export const customColSimpleMultipleTextColumns: CustomTreeNode[] = [ + { + field: 'area', + title: '地区'.repeat(50), + children: [ + { field: 'province', title: '省份' }, + { field: 'city', title: '城市' }, + ], + }, + { + field: 'type', + title: '类型', + }, + { + field: 'money', + title: '金额'.repeat(20), + children: [ + { field: 'price', title: '价格', description: '价格描述' }, + { field: 'number', title: '数量'.repeat(30) }, + ], + }, +]; + export const customColMultipleColumns: CustomTreeNode[] = [ { field: 'a-1', diff --git a/packages/s2-core/__tests__/data/data-issue-2385.json b/packages/s2-core/__tests__/data/data-issue-2385.json index e77dd0305c..4a8cb753b3 100644 --- a/packages/s2-core/__tests__/data/data-issue-2385.json +++ b/packages/s2-core/__tests__/data/data-issue-2385.json @@ -11,7 +11,7 @@ "province": "浙江", "city": "杭州", "type": "纸张", - "price": "2", + "price": "哈哈哈", "cost": "1.5" }, { @@ -153,7 +153,7 @@ "type": "圆规", "province": "吉林", "city": "白山", - "price": "111", + "price": "aa", "cost": "1.5" } ], diff --git a/packages/s2-core/__tests__/spreadsheet/__snapshots__/multi-line-text-spec.ts.snap b/packages/s2-core/__tests__/spreadsheet/__snapshots__/multi-line-text-spec.ts.snap index d3bb3a1672..97990ca974 100644 --- a/packages/s2-core/__tests__/spreadsheet/__snapshots__/multi-line-text-spec.ts.snap +++ b/packages/s2-core/__tests__/spreadsheet/__snapshots__/multi-line-text-spec.ts.snap @@ -6,7 +6,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 68, + "height": 76, "multiLineActualTexts": Array [ "序号", ], @@ -17,7 +17,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 68, + "height": 76, "multiLineActualTexts": Array [ "省份", ], @@ -28,7 +28,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市城市城市", "actualTextHeight": 64, "actualTextWidth": 292, - "height": 68, + "height": 76, "multiLineActualTexts": Array [ "城市城市城市", "城市城市城市", @@ -42,7 +42,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 16, "actualTextWidth": 241, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "类别类别类别类别类别类别类别类别类别类别", ], @@ -53,7 +53,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "子类别", ], @@ -69,7 +69,7 @@ Array [ "actualText": "1", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "1", ], @@ -91,7 +91,7 @@ Array [ "actualText": "3", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "3", ], @@ -118,7 +118,7 @@ Array [ "actualText": "纸张纸张纸张纸张纸张", "actualTextHeight": 32, "actualTextWidth": 122, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "纸张纸张纸张", "纸张纸张", @@ -130,7 +130,7 @@ Array [ "actualText": "-", "actualTextHeight": 16, "actualTextWidth": 4, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "-", ], @@ -141,7 +141,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 68, + "height": 76, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数量", @@ -155,7 +155,7 @@ Array [ "actualText": "家具", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "家具", ], @@ -166,7 +166,7 @@ Array [ "actualText": "桌子", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "桌子", ], @@ -177,7 +177,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 68, + "height": 76, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数量", @@ -191,7 +191,7 @@ Array [ "actualText": "沙发", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "沙发", ], @@ -202,7 +202,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 68, + "height": 76, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数量", @@ -216,7 +216,7 @@ Array [ "actualText": "家具家具家具家具家具家具家具家具家具家具家具家...", "actualTextHeight": 64, "actualTextWidth": 290, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "家具家具家具", "家具家具家具", @@ -230,7 +230,7 @@ Array [ "actualText": "桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌...", "actualTextHeight": 64, "actualTextWidth": 290, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "桌子桌子桌子", "桌子桌子桌子", @@ -244,7 +244,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 68, + "height": 76, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数量", @@ -258,7 +258,7 @@ Array [ "actualText": "办公用品", "actualTextHeight": 16, "actualTextWidth": 49, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "办公用品", ], @@ -269,7 +269,7 @@ Array [ "actualText": "笔", "actualTextHeight": 16, "actualTextWidth": 13, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "笔", ], @@ -280,7 +280,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 68, + "height": 76, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数量", @@ -294,7 +294,7 @@ Array [ "actualText": "纸张", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "纸张", ], @@ -305,7 +305,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 68, + "height": 76, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数量", @@ -324,7 +324,7 @@ Array [ "actualText": "浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江浙...", "actualTextHeight": 64, "actualTextWidth": 290, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "浙江浙江浙江", "浙江浙江浙江", @@ -338,7 +338,7 @@ Array [ "actualText": "杭州杭州杭州杭州", "actualTextHeight": 30, "actualTextWidth": 98, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "杭州杭州杭州", "杭州", @@ -405,7 +405,7 @@ Array [ "actualText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江...", "actualTextHeight": 64, "actualTextWidth": 290, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "浙江省浙江省", "浙江省浙江省", @@ -419,7 +419,7 @@ Array [ "actualText": "杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州...", "actualTextHeight": 60, "actualTextWidth": 290, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "杭州市杭州市", "杭州市杭州市", @@ -473,17 +473,6 @@ Array [ "originalText": "南充市", "width": 96, }, - Object { - "actualText": "乐山市", - "actualTextHeight": 15, - "actualTextWidth": 37, - "height": 30, - "multiLineActualTexts": Array [ - "乐山市", - ], - "originalText": "乐山市", - "width": 96, - }, ] `; @@ -493,7 +482,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "-", ], @@ -548,18 +537,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 72, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, - }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 30, + "height": 80, "multiLineActualTexts": Array [ "-", ], @@ -603,7 +581,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "-", ], @@ -659,7 +637,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "-", ], @@ -699,22 +677,11 @@ Array [ "originalText": 1943, "width": 96, }, - Object { - "actualText": "2330", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 30, - "multiLineActualTexts": Array [ - "2330", - ], - "originalText": 2330, - "width": 96, - }, Object { "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "-", ], @@ -769,7 +736,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "-", ], @@ -809,22 +776,11 @@ Array [ "originalText": 2333, "width": 96, }, - Object { - "actualText": "2445", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 30, - "multiLineActualTexts": Array [ - "2445", - ], - "originalText": 2445, - "width": 96, - }, Object { "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "-", ], @@ -879,7 +835,7 @@ Array [ "actualText": "7789778977897789778977897789", "actualTextHeight": 45, "actualTextWidth": 189, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "77897789778", "97789778977", @@ -925,18 +881,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 30, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, - }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "-", ], @@ -991,7 +936,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "-", ], @@ -1031,22 +976,11 @@ Array [ "originalText": 2457, "width": 96, }, - Object { - "actualText": "2458", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 30, - "multiLineActualTexts": Array [ - "2458", - ], - "originalText": 2458, - "width": 96, - }, Object { "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "-", ], @@ -1101,7 +1035,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "-", ], @@ -1141,17 +1075,6 @@ Array [ "originalText": 3551, "width": 96, }, - Object { - "actualText": "352", - "actualTextHeight": 15, - "actualTextWidth": 21, - "height": 30, - "multiLineActualTexts": Array [ - "352", - ], - "originalText": 352, - "width": 96, - }, ] `; @@ -2234,7 +2157,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "序号", ], @@ -2245,7 +2168,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "省份", ], @@ -2256,7 +2179,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城市", @@ -2269,7 +2192,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 16, "actualTextWidth": 241, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "类别类别类别类别类别类别类别类别类别类别", ], @@ -2280,7 +2203,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "子类别", ], @@ -2334,7 +2257,7 @@ Array [ "actualText": "家具", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "家具", ], @@ -2345,7 +2268,7 @@ Array [ "actualText": "桌子", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "桌子", ], @@ -2356,7 +2279,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -2369,7 +2292,7 @@ Array [ "actualText": "沙发", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "沙发", ], @@ -2380,7 +2303,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -2393,7 +2316,7 @@ Array [ "actualText": "家具家具家具家具家具家具家具家具家具家具...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "家具家具家具家", "具家具家具家具", @@ -2406,7 +2329,7 @@ Array [ "actualText": "桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "桌子桌子桌子桌", "子桌子桌子桌子", @@ -2419,7 +2342,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -2432,7 +2355,7 @@ Array [ "actualText": "办公用品", "actualTextHeight": 16, "actualTextWidth": 49, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "办公用品", ], @@ -2443,7 +2366,7 @@ Array [ "actualText": "笔", "actualTextHeight": 16, "actualTextWidth": 13, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "笔", ], @@ -2454,7 +2377,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -2467,7 +2390,7 @@ Array [ "actualText": "纸张", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "纸张", ], @@ -2478,7 +2401,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -3212,7 +3135,7 @@ Array [ "actualText": "2", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "2", ], @@ -3312,7 +3235,7 @@ Array [ "actualText": "浙江省浙江省浙江省浙江...", "actualTextHeight": 32, "actualTextWidth": 144, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "浙江省浙江省", "浙江省浙江...", @@ -3385,7 +3308,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "-", ], @@ -3484,7 +3407,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "-", ], @@ -3616,7 +3539,7 @@ Array [ "actualText": "2", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "2", ], @@ -3716,7 +3639,7 @@ Array [ "actualText": "浙江省浙江省浙江省浙江...", "actualTextHeight": 32, "actualTextWidth": 144, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "浙江省浙江省", "浙江省浙江...", @@ -3789,7 +3712,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "-", ], @@ -3888,7 +3811,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "-", ], @@ -3948,7 +3871,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "序号", ], @@ -3959,7 +3882,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "省份", ], @@ -3970,7 +3893,7 @@ Array [ "actualText": "城市城市城市城市城市城...", "actualTextHeight": 32, "actualTextWidth": 144, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "城市城市城市", "城市城市城...", @@ -3982,7 +3905,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 16, "actualTextWidth": 241, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "类别类别类别类别类别类别类别类别类别类别", ], @@ -3993,7 +3916,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "子类别", ], @@ -4047,7 +3970,7 @@ Array [ "actualText": "家具", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "家具", ], @@ -4058,7 +3981,7 @@ Array [ "actualText": "桌子", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "桌子", ], @@ -4069,7 +3992,7 @@ Array [ "actualText": "数量数量数量数量数量数...", "actualTextHeight": 30, "actualTextWidth": 144, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", @@ -4081,7 +4004,7 @@ Array [ "actualText": "沙发", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "沙发", ], @@ -4092,7 +4015,7 @@ Array [ "actualText": "数量数量数量数量数量数...", "actualTextHeight": 30, "actualTextWidth": 144, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", @@ -4352,7 +4275,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "序号", ], @@ -4363,7 +4286,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "省份", ], @@ -4374,7 +4297,7 @@ Array [ "actualText": "城市城市城市城市城市城...", "actualTextHeight": 32, "actualTextWidth": 144, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "城市城市城市", "城市城市城...", @@ -4386,7 +4309,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 16, "actualTextWidth": 241, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "类别类别类别类别类别类别类别类别类别类别", ], @@ -4397,7 +4320,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "子类别", ], @@ -4451,7 +4374,7 @@ Array [ "actualText": "家具", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "家具", ], @@ -4462,7 +4385,7 @@ Array [ "actualText": "桌子", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "桌子", ], @@ -4473,7 +4396,7 @@ Array [ "actualText": "数量数量数量数量数量数...", "actualTextHeight": 30, "actualTextWidth": 144, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", @@ -4485,7 +4408,7 @@ Array [ "actualText": "沙发", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "沙发", ], @@ -4496,7 +4419,7 @@ Array [ "actualText": "数量数量数量数量数量数...", "actualTextHeight": 30, "actualTextWidth": 144, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", @@ -4756,7 +4679,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "序号", ], @@ -4767,7 +4690,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "省份", ], @@ -4778,7 +4701,7 @@ Array [ "actualText": "城市城市城市城市城市城...", "actualTextHeight": 32, "actualTextWidth": 144, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "城市城市城市", "城市城市城...", @@ -4790,7 +4713,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 16, "actualTextWidth": 241, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "类别类别类别类别类别类别类别类别类别类别", ], @@ -4801,7 +4724,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "子类别", ], @@ -4855,7 +4778,7 @@ Array [ "actualText": "家具", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "家具", ], @@ -4866,7 +4789,7 @@ Array [ "actualText": "桌子", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "桌子", ], @@ -4877,7 +4800,7 @@ Array [ "actualText": "数量数量数量数量数量数...", "actualTextHeight": 30, "actualTextWidth": 144, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", @@ -4889,7 +4812,7 @@ Array [ "actualText": "沙发", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "沙发", ], @@ -4900,7 +4823,7 @@ Array [ "actualText": "数量数量数量数量数量数...", "actualTextHeight": 30, "actualTextWidth": 144, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", @@ -5398,7 +5321,7 @@ Array [ "actualText": "2", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "2", ], @@ -5491,7 +5414,7 @@ Array [ "actualText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江...", "actualTextHeight": 64, "actualTextWidth": 290, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "浙江省浙江省", "浙江省浙江省", @@ -5555,7 +5478,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "-", ], @@ -5610,7 +5533,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "-", ], @@ -5626,7 +5549,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "序号", ], @@ -5637,7 +5560,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "省份", ], @@ -5648,7 +5571,7 @@ Array [ "actualText": "城市城市城市城市城市城...", "actualTextHeight": 32, "actualTextWidth": 144, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "城市城市城市", "城市城市城...", @@ -5660,7 +5583,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 16, "actualTextWidth": 241, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "类别类别类别类别类别类别类别类别类别类别", ], @@ -5671,7 +5594,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "子类别", ], @@ -5725,7 +5648,7 @@ Array [ "actualText": "家具", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "家具", ], @@ -5736,7 +5659,7 @@ Array [ "actualText": "桌子", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "桌子", ], @@ -5747,7 +5670,7 @@ Array [ "actualText": "数量数量数量数量数量数...", "actualTextHeight": 30, "actualTextWidth": 144, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", @@ -5759,7 +5682,7 @@ Array [ "actualText": "沙发", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "沙发", ], @@ -5770,7 +5693,7 @@ Array [ "actualText": "数量数量数量数量数量数...", "actualTextHeight": 30, "actualTextWidth": 144, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", @@ -5900,17 +5823,6 @@ Array [ "originalText": 1822, "width": 96, }, - Object { - "actualText": "1943", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 35, - "multiLineActualTexts": Array [ - "1943", - ], - "originalText": 1943, - "width": 96, - }, Object { "actualText": "632", "actualTextHeight": 15, @@ -5988,17 +5900,6 @@ Array [ "originalText": 2244, "width": 96, }, - Object { - "actualText": "2333", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 35, - "multiLineActualTexts": Array [ - "2333", - ], - "originalText": 2333, - "width": 96, - }, ] `; @@ -7185,7 +7086,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "序号", ], @@ -7196,7 +7097,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "省份", ], @@ -7207,7 +7108,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城...", "actualTextHeight": 48, "actualTextWidth": 217, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "城市城市城市", "城市城市城市", @@ -7220,7 +7121,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 16, "actualTextWidth": 241, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "类别类别类别类别类别类别类别类别类别类别", ], @@ -7231,7 +7132,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "子类别", ], @@ -7258,7 +7159,7 @@ Array [ "actualText": "2", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "2", ], @@ -7285,7 +7186,7 @@ Array [ "actualText": "家具", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "家具", ], @@ -7296,7 +7197,7 @@ Array [ "actualText": "桌子", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "桌子", ], @@ -7307,7 +7208,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数...", "actualTextHeight": 45, "actualTextWidth": 217, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数量", @@ -7320,7 +7221,7 @@ Array [ "actualText": "沙发", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "沙发", ], @@ -7331,7 +7232,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数...", "actualTextHeight": 45, "actualTextWidth": 217, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数量", @@ -7360,7 +7261,7 @@ Array [ "actualText": "浙江省浙江省浙江省浙江省浙江省浙江...", "actualTextHeight": 48, "actualTextWidth": 217, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "浙江省浙江省", "浙江省浙江省", @@ -7434,7 +7335,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "-", ], @@ -7452,17 +7353,6 @@ Array [ "originalText": 1723, "width": 96, }, - Object { - "actualText": "1822", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 30, - "multiLineActualTexts": Array [ - "1822", - ], - "originalText": 1822, - "width": 96, - }, Object { "actualText": "632", "actualTextHeight": 15, @@ -7511,7 +7401,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "-", ], @@ -7529,17 +7419,6 @@ Array [ "originalText": 2451, "width": 96, }, - Object { - "actualText": "2244", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 30, - "multiLineActualTexts": Array [ - "2244", - ], - "originalText": 2244, - "width": 96, - }, ] `; @@ -7549,7 +7428,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "序号", ], @@ -7560,7 +7439,7 @@ Array [ "actualText": "省份/城市城市城市城市城市城市...", "actualTextHeight": 48, "actualTextWidth": 184, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "省份/城市城", "市城市城市", @@ -7573,7 +7452,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 32, "actualTextWidth": 242, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "类别类别类别类别类别类别", "类别类别类别类别", @@ -7585,7 +7464,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "子类别", ], @@ -7601,7 +7480,7 @@ Array [ "actualText": "1", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 112, + "height": 128, "multiLineActualTexts": Array [ "1", ], @@ -7623,24 +7502,13 @@ Array [ "actualText": "3", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 112, + "height": 128, "multiLineActualTexts": Array [ "3", ], "originalText": "3", "width": 80, }, - Object { - "actualText": "4", - "actualTextHeight": 15, - "actualTextWidth": 7, - "height": 150, - "multiLineActualTexts": Array [ - "4", - ], - "originalText": "4", - "width": 80, - }, ] `; @@ -7650,7 +7518,7 @@ Array [ "actualText": "纸张纸张纸张纸张纸张", "actualTextHeight": 32, "actualTextWidth": 122, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "纸张纸张纸张纸", "张纸张", @@ -7662,7 +7530,7 @@ Array [ "actualText": "-", "actualTextHeight": 16, "actualTextWidth": 4, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "-", ], @@ -7673,7 +7541,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -7686,7 +7554,7 @@ Array [ "actualText": "家具", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "家具", ], @@ -7697,7 +7565,7 @@ Array [ "actualText": "桌子", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "桌子", ], @@ -7708,7 +7576,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -7721,7 +7589,7 @@ Array [ "actualText": "沙发", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "沙发", ], @@ -7732,7 +7600,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -7745,7 +7613,7 @@ Array [ "actualText": "家具家具家具家具家具家具家具家具家具家具...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "家具家具家具家", "具家具家具家具", @@ -7758,7 +7626,7 @@ Array [ "actualText": "桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "桌子桌子桌子桌", "子桌子桌子桌子", @@ -7771,7 +7639,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -7784,7 +7652,7 @@ Array [ "actualText": "办公用品", "actualTextHeight": 16, "actualTextWidth": 49, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "办公用品", ], @@ -7795,7 +7663,7 @@ Array [ "actualText": "笔", "actualTextHeight": 16, "actualTextWidth": 13, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "笔", ], @@ -7806,7 +7674,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -7819,7 +7687,7 @@ Array [ "actualText": "纸张", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "纸张", ], @@ -7830,7 +7698,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 53, + "height": 61, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -7848,7 +7716,7 @@ Array [ "actualText": "浙江浙江浙江浙江浙江浙江浙江...", "actualTextHeight": 48, "actualTextWidth": 181, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "浙江浙江浙", "江浙江浙江", @@ -7861,7 +7729,7 @@ Array [ "actualText": "杭州杭州杭州杭州", "actualTextHeight": 30, "actualTextWidth": 98, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "杭州杭州杭", "州杭州", @@ -7928,7 +7796,7 @@ Array [ "actualText": "浙江省浙江省浙江省浙江省浙江...", "actualTextHeight": 48, "actualTextWidth": 181, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "浙江省浙江", "省浙江省浙", @@ -7941,7 +7809,7 @@ Array [ "actualText": "杭州市杭州市杭州市杭州市杭州...", "actualTextHeight": 45, "actualTextWidth": 181, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "杭州市杭州", "市杭州市杭", @@ -7950,38 +7818,16 @@ Array [ "originalText": "杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市", "width": 100, }, - Object { - "actualText": "四川省", - "actualTextHeight": 16, - "actualTextWidth": 37, - "height": 30, - "multiLineActualTexts": Array [ - "四川省", - ], - "originalText": "四川省", - "width": 100, - }, - Object { - "actualText": "成都市", - "actualTextHeight": 15, - "actualTextWidth": 37, - "height": 30, - "multiLineActualTexts": Array [ - "成都市", - ], - "originalText": "成都市", - "width": 100, - }, -] -`; - -exports[`SpreadSheet Multi Line Text Tests PivotSheet should render three max text lines for tree mode 5`] = ` -Array [ +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should render three max text lines for tree mode 5`] = ` +Array [ Object { "actualText": undefined, "actualTextHeight": 0, "actualTextWidth": 0, - "height": 56, + "height": 64, "multiLineActualTexts": Array [], "originalText": undefined, "width": 103, @@ -7990,7 +7836,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "-", ], @@ -8054,27 +7900,7 @@ Array [ "actualText": undefined, "actualTextHeight": 0, "actualTextWidth": 0, - "height": 56, - "multiLineActualTexts": Array [], - "originalText": undefined, - "width": 103, - }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 56, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 103, - }, - Object { - "actualText": undefined, - "actualTextHeight": 0, - "actualTextWidth": 0, - "height": 30, + "height": 64, "multiLineActualTexts": Array [], "originalText": undefined, "width": 103, @@ -8083,7 +7909,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 30, + "height": 64, "multiLineActualTexts": Array [ "-", ], @@ -8094,7 +7920,7 @@ Array [ "actualText": undefined, "actualTextHeight": 0, "actualTextWidth": 0, - "height": 56, + "height": 64, "multiLineActualTexts": Array [], "originalText": undefined, "width": 103, @@ -8103,7 +7929,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "-", ], @@ -8168,7 +7994,7 @@ Array [ "actualText": undefined, "actualTextHeight": 0, "actualTextWidth": 0, - "height": 56, + "height": 64, "multiLineActualTexts": Array [], "originalText": undefined, "width": 103, @@ -8177,7 +8003,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "-", ], @@ -8188,27 +8014,7 @@ Array [ "actualText": undefined, "actualTextHeight": 0, "actualTextWidth": 0, - "height": 30, - "multiLineActualTexts": Array [], - "originalText": undefined, - "width": 103, - }, - Object { - "actualText": "1723", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 30, - "multiLineActualTexts": Array [ - "1723", - ], - "originalText": 1723, - "width": 103, - }, - Object { - "actualText": undefined, - "actualTextHeight": 0, - "actualTextWidth": 0, - "height": 56, + "height": 64, "multiLineActualTexts": Array [], "originalText": undefined, "width": 103, @@ -8217,7 +8023,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "-", ], @@ -8281,7 +8087,7 @@ Array [ "actualText": undefined, "actualTextHeight": 0, "actualTextWidth": 0, - "height": 56, + "height": 64, "multiLineActualTexts": Array [], "originalText": undefined, "width": 103, @@ -8290,7 +8096,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "-", ], @@ -8301,27 +8107,7 @@ Array [ "actualText": undefined, "actualTextHeight": 0, "actualTextWidth": 0, - "height": 30, - "multiLineActualTexts": Array [], - "originalText": undefined, - "width": 103, - }, - Object { - "actualText": "2451", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 30, - "multiLineActualTexts": Array [ - "2451", - ], - "originalText": 2451, - "width": 103, - }, - Object { - "actualText": undefined, - "actualTextHeight": 0, - "actualTextWidth": 0, - "height": 56, + "height": 64, "multiLineActualTexts": Array [], "originalText": undefined, "width": 103, @@ -8330,7 +8116,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "-", ], @@ -8394,7 +8180,7 @@ Array [ "actualText": undefined, "actualTextHeight": 0, "actualTextWidth": 0, - "height": 56, + "height": 64, "multiLineActualTexts": Array [], "originalText": undefined, "width": 103, @@ -8403,7 +8189,7 @@ Array [ "actualText": "7789778977897789778977897789", "actualTextHeight": 45, "actualTextWidth": 189, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "7789778977897", "7897789778977", @@ -8416,27 +8202,7 @@ Array [ "actualText": undefined, "actualTextHeight": 0, "actualTextWidth": 0, - "height": 30, - "multiLineActualTexts": Array [], - "originalText": undefined, - "width": 103, - }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 30, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 103, - }, - Object { - "actualText": undefined, - "actualTextHeight": 0, - "actualTextWidth": 0, - "height": 56, + "height": 64, "multiLineActualTexts": Array [], "originalText": undefined, "width": 103, @@ -8445,7 +8211,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "-", ], @@ -8509,7 +8275,7 @@ Array [ "actualText": undefined, "actualTextHeight": 0, "actualTextWidth": 0, - "height": 56, + "height": 64, "multiLineActualTexts": Array [], "originalText": undefined, "width": 103, @@ -8518,7 +8284,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "-", ], @@ -8529,27 +8295,7 @@ Array [ "actualText": undefined, "actualTextHeight": 0, "actualTextWidth": 0, - "height": 30, - "multiLineActualTexts": Array [], - "originalText": undefined, - "width": 103, - }, - Object { - "actualText": "2335", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 30, - "multiLineActualTexts": Array [ - "2335", - ], - "originalText": 2335, - "width": 103, - }, - Object { - "actualText": undefined, - "actualTextHeight": 0, - "actualTextWidth": 0, - "height": 56, + "height": 64, "multiLineActualTexts": Array [], "originalText": undefined, "width": 103, @@ -8558,7 +8304,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "-", ], @@ -8622,7 +8368,7 @@ Array [ "actualText": undefined, "actualTextHeight": 0, "actualTextWidth": 0, - "height": 56, + "height": 64, "multiLineActualTexts": Array [], "originalText": undefined, "width": 103, @@ -8631,33 +8377,13 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "-", ], "originalText": "-", "width": 103, }, - Object { - "actualText": undefined, - "actualTextHeight": 0, - "actualTextWidth": 0, - "height": 30, - "multiLineActualTexts": Array [], - "originalText": undefined, - "width": 103, - }, - Object { - "actualText": "4004", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 30, - "multiLineActualTexts": Array [ - "4004", - ], - "originalText": 4004, - "width": 103, - }, ] `; @@ -8667,7 +8393,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "序号", ], @@ -8678,7 +8404,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "省份", ], @@ -8689,7 +8415,7 @@ Array [ "actualText": "城市城市城市城市城市城...", "actualTextHeight": 32, "actualTextWidth": 144, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "城市城市城市", "城市城市城...", @@ -8701,7 +8427,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 16, "actualTextWidth": 241, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "类别类别类别类别类别类别类别类别类别类别", ], @@ -8712,7 +8438,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "子类别", ], @@ -8739,7 +8465,7 @@ Array [ "actualText": "2", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "2", ], @@ -8766,7 +8492,7 @@ Array [ "actualText": "家具", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "家具", ], @@ -8777,7 +8503,7 @@ Array [ "actualText": "桌子", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "桌子", ], @@ -8788,7 +8514,7 @@ Array [ "actualText": "数量数量数量数量数量数...", "actualTextHeight": 30, "actualTextWidth": 144, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", @@ -8800,7 +8526,7 @@ Array [ "actualText": "沙发", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "沙发", ], @@ -8811,7 +8537,7 @@ Array [ "actualText": "数量数量数量数量数量数...", "actualTextHeight": 30, "actualTextWidth": 144, - "height": 38, + "height": 46, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", @@ -8839,7 +8565,7 @@ Array [ "actualText": "浙江省浙江省浙江省浙江...", "actualTextHeight": 32, "actualTextWidth": 144, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "浙江省浙江省", "浙江省浙江...", @@ -8912,7 +8638,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "-", ], @@ -8952,17 +8678,6 @@ Array [ "originalText": 1943, "width": 96, }, - Object { - "actualText": "2330", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 30, - "multiLineActualTexts": Array [ - "2330", - ], - "originalText": 2330, - "width": 96, - }, Object { "actualText": "632", "actualTextHeight": 15, @@ -9011,7 +8726,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "-", ], @@ -9051,17 +8766,6 @@ Array [ "originalText": 2333, "width": 96, }, - Object { - "actualText": "2445", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 30, - "multiLineActualTexts": Array [ - "2445", - ], - "originalText": 2445, - "width": 96, - }, ] `; @@ -9071,7 +8775,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 68, + "height": 76, "multiLineActualTexts": Array [ "序号", ], @@ -9082,7 +8786,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 68, + "height": 76, "multiLineActualTexts": Array [ "省份", ], @@ -9093,7 +8797,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市城市城市", "actualTextHeight": 64, "actualTextWidth": 292, - "height": 68, + "height": 76, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城市", @@ -9107,7 +8811,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 16, "actualTextWidth": 241, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "类别类别类别类别类别类别类别类别类别类别", ], @@ -9118,7 +8822,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 88, + "height": 96, "multiLineActualTexts": Array [ "子类别", ], @@ -9145,7 +8849,7 @@ Array [ "actualText": "2", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 88, + "height": 96, "multiLineActualTexts": Array [ "2", ], @@ -9172,7 +8876,7 @@ Array [ "actualText": "家具", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "家具", ], @@ -9183,7 +8887,7 @@ Array [ "actualText": "桌子", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 88, + "height": 96, "multiLineActualTexts": Array [ "桌子", ], @@ -9194,7 +8898,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 68, + "height": 76, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -9208,7 +8912,7 @@ Array [ "actualText": "沙发", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 88, + "height": 96, "multiLineActualTexts": Array [ "沙发", ], @@ -9219,7 +8923,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 68, + "height": 76, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -9233,7 +8937,7 @@ Array [ "actualText": "家具家具家具家具家具家具家具家具家具家具家具家具家具家具", "actualTextHeight": 64, "actualTextWidth": 340, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "家具家具家具家", "具家具家具家具", @@ -9247,7 +8951,7 @@ Array [ "actualText": "桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子", "actualTextHeight": 80, "actualTextWidth": 365, - "height": 88, + "height": 96, "multiLineActualTexts": Array [ "桌子桌子桌子桌", "子桌子桌子桌子", @@ -9262,7 +8966,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 68, + "height": 76, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -9276,7 +8980,7 @@ Array [ "actualText": "办公用品", "actualTextHeight": 16, "actualTextWidth": 49, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "办公用品", ], @@ -9287,7 +8991,7 @@ Array [ "actualText": "笔", "actualTextHeight": 16, "actualTextWidth": 13, - "height": 88, + "height": 96, "multiLineActualTexts": Array [ "笔", ], @@ -9298,7 +9002,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 68, + "height": 76, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -9312,7 +9016,7 @@ Array [ "actualText": "纸张", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 88, + "height": 96, "multiLineActualTexts": Array [ "纸张", ], @@ -9323,7 +9027,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 68, + "height": 76, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -9397,7 +9101,7 @@ Array [ "actualText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", "actualTextHeight": 80, "actualTextWidth": 365, - "height": 88, + "height": 96, "multiLineActualTexts": Array [ "浙江省浙江省浙", "江省浙江省浙江", @@ -9412,7 +9116,7 @@ Array [ "actualText": "杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市", "actualTextHeight": 75, "actualTextWidth": 365, - "height": 88, + "height": 96, "multiLineActualTexts": Array [ "杭州市杭州市杭", "州市杭州市杭州", @@ -9532,7 +9236,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 88, + "height": 96, "multiLineActualTexts": Array [ "-", ], @@ -9631,7 +9335,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 88, + "height": 96, "multiLineActualTexts": Array [ "-", ], @@ -9730,7 +9434,7 @@ Array [ "actualText": "7789778977897789778977897789", "actualTextHeight": 45, "actualTextWidth": 189, - "height": 88, + "height": 96, "multiLineActualTexts": Array [ "778977897789", "778977897789", @@ -9831,7 +9535,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 88, + "height": 96, "multiLineActualTexts": Array [ "-", ], @@ -9930,7 +9634,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 88, + "height": 96, "multiLineActualTexts": Array [ "-", ], @@ -9990,7 +9694,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "序号", ], @@ -10090,17 +9794,6 @@ Array [ "originalText": 8, "width": 80, }, - Object { - "actualText": "9", - "actualTextHeight": 15, - "actualTextWidth": 7, - "height": 30, - "multiLineActualTexts": Array [ - "9", - ], - "originalText": 9, - "width": 80, - }, ] `; @@ -10110,7 +9803,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "序号", ], @@ -10121,7 +9814,7 @@ Array [ "actualText": "省份省份省份省份省份省份省份省份省份省份省份省份省份省...", "actualTextHeight": 64, "actualTextWidth": 338, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "省份省份省份省", "份省份省份省份", @@ -10135,7 +9828,7 @@ Array [ "actualText": "city", "actualTextHeight": 16, "actualTextWidth": 21, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "city", ], @@ -10146,7 +9839,7 @@ Array [ "actualText": "type", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "type", ], @@ -10157,7 +9850,7 @@ Array [ "actualText": "sub_type", "actualTextHeight": 16, "actualTextWidth": 53, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "sub_type", ], @@ -10168,7 +9861,7 @@ Array [ "actualText": "number", "actualTextHeight": 16, "actualTextWidth": 45, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "number", ], @@ -10270,17 +9963,6 @@ Array [ "originalText": 8, "width": 80, }, - Object { - "actualText": "9", - "actualTextHeight": 15, - "actualTextWidth": 7, - "height": 30, - "multiLineActualTexts": Array [ - "9", - ], - "originalText": 9, - "width": 80, - }, Object { "actualText": "浙江省", "actualTextHeight": 15, @@ -10372,17 +10054,6 @@ Array [ "originalText": "浙江省", "width": 103.8, }, - Object { - "actualText": "浙江省", - "actualTextHeight": 15, - "actualTextWidth": 37, - "height": 30, - "multiLineActualTexts": Array [ - "浙江省", - ], - "originalText": "浙江省", - "width": 103.8, - }, Object { "actualText": "绍兴市", "actualTextHeight": 15, @@ -10474,17 +10145,6 @@ Array [ "originalText": "宁波市", "width": 103.8, }, - Object { - "actualText": "舟山市", - "actualTextHeight": 15, - "actualTextWidth": 37, - "height": 30, - "multiLineActualTexts": Array [ - "舟山市", - ], - "originalText": "舟山市", - "width": 103.8, - }, Object { "actualText": "家具", "actualTextHeight": 15, @@ -10576,17 +10236,6 @@ Array [ "originalText": "家具", "width": 103.8, }, - Object { - "actualText": "家具", - "actualTextHeight": 15, - "actualTextWidth": 25, - "height": 30, - "multiLineActualTexts": Array [ - "家具", - ], - "originalText": "家具", - "width": 103.8, - }, Object { "actualText": "桌子", "actualTextHeight": 15, @@ -10678,17 +10327,6 @@ Array [ "originalText": "沙发", "width": 103.8, }, - Object { - "actualText": "沙发", - "actualTextHeight": 15, - "actualTextWidth": 25, - "height": 30, - "multiLineActualTexts": Array [ - "沙发", - ], - "originalText": "沙发", - "width": 103.8, - }, Object { "actualText": "236723672361111", "actualTextHeight": 30, @@ -10781,17 +10419,6 @@ Array [ "originalText": 7234, "width": 103.8, }, - Object { - "actualText": "834", - "actualTextHeight": 15, - "actualTextWidth": 21, - "height": 30, - "multiLineActualTexts": Array [ - "834", - ], - "originalText": 834, - "width": 103.8, - }, ] `; @@ -10801,7 +10428,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "序号", ], @@ -10901,17 +10528,6 @@ Array [ "originalText": 8, "width": 80, }, - Object { - "actualText": "9", - "actualTextHeight": 15, - "actualTextWidth": 7, - "height": 30, - "multiLineActualTexts": Array [ - "9", - ], - "originalText": 9, - "width": 80, - }, ] `; @@ -10921,7 +10537,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "序号", ], @@ -10932,7 +10548,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "省份", ], @@ -10943,7 +10559,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市城市城市", "actualTextHeight": 64, "actualTextWidth": 292, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城市", @@ -10957,7 +10573,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 48, "actualTextWidth": 243, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "类别类别类别类", "别类别类别类别", @@ -10970,7 +10586,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "子类别", ], @@ -10981,7 +10597,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 64, "actualTextWidth": 268, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -11086,17 +10702,6 @@ Array [ "originalText": 8, "width": 80, }, - Object { - "actualText": "9", - "actualTextHeight": 15, - "actualTextWidth": 7, - "height": 30, - "multiLineActualTexts": Array [ - "9", - ], - "originalText": 9, - "width": 80, - }, Object { "actualText": "浙江省", "actualTextHeight": 15, @@ -11188,17 +10793,6 @@ Array [ "originalText": "浙江省", "width": 103.8, }, - Object { - "actualText": "浙江省", - "actualTextHeight": 15, - "actualTextWidth": 37, - "height": 30, - "multiLineActualTexts": Array [ - "浙江省", - ], - "originalText": "浙江省", - "width": 103.8, - }, Object { "actualText": "绍兴市", "actualTextHeight": 15, @@ -11290,17 +10884,6 @@ Array [ "originalText": "宁波市", "width": 103.8, }, - Object { - "actualText": "舟山市", - "actualTextHeight": 15, - "actualTextWidth": 37, - "height": 30, - "multiLineActualTexts": Array [ - "舟山市", - ], - "originalText": "舟山市", - "width": 103.8, - }, Object { "actualText": "家具", "actualTextHeight": 15, @@ -11392,17 +10975,6 @@ Array [ "originalText": "家具", "width": 103.8, }, - Object { - "actualText": "家具", - "actualTextHeight": 15, - "actualTextWidth": 25, - "height": 30, - "multiLineActualTexts": Array [ - "家具", - ], - "originalText": "家具", - "width": 103.8, - }, Object { "actualText": "桌子", "actualTextHeight": 15, @@ -11494,17 +11066,6 @@ Array [ "originalText": "沙发", "width": 103.8, }, - Object { - "actualText": "沙发", - "actualTextHeight": 15, - "actualTextWidth": 25, - "height": 30, - "multiLineActualTexts": Array [ - "沙发", - ], - "originalText": "沙发", - "width": 103.8, - }, Object { "actualText": "236723672361111", "actualTextHeight": 30, @@ -11597,17 +11158,6 @@ Array [ "originalText": 7234, "width": 103.8, }, - Object { - "actualText": "834", - "actualTextHeight": 15, - "actualTextWidth": 21, - "height": 30, - "multiLineActualTexts": Array [ - "834", - ], - "originalText": 834, - "width": 103.8, - }, ] `; @@ -11617,7 +11167,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "序号", ], @@ -11649,7 +11199,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "序号", ], @@ -11660,7 +11210,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "省份", ], @@ -11671,7 +11221,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市城市城市", "actualTextHeight": 64, "actualTextWidth": 292, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城市", @@ -11685,7 +11235,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 48, "actualTextWidth": 243, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "类别类别类别类", "别类别类别类别", @@ -11698,7 +11248,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "子类别", ], @@ -11709,7 +11259,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 64, "actualTextWidth": 268, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -11841,7 +11391,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "序号", ], @@ -11884,7 +11434,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "序号", ], @@ -11895,7 +11445,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "省份", ], @@ -11906,7 +11456,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市城市城市", "actualTextHeight": 64, "actualTextWidth": 292, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城市", @@ -11920,7 +11470,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 48, "actualTextWidth": 243, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "类别类别类别类", "别类别类别类别", @@ -11933,7 +11483,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "子类别", ], @@ -11944,7 +11494,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 64, "actualTextWidth": 268, - "height": 72, + "height": 80, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -12156,7 +11706,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -12364,7 +11914,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -12375,7 +11925,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "省份", ], @@ -12386,7 +11936,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市城市城市", "actualTextHeight": 48, "actualTextWidth": 291, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "城市城市城市城市城市", "城市城市城市城市城市", @@ -12399,7 +11949,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 32, "actualTextWidth": 242, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "类别类别类别类别类别", "类别类别类别类别类别", @@ -12411,7 +11961,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "子类别", ], @@ -12422,7 +11972,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 48, "actualTextWidth": 267, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数量数量", "数量数量数量数量数量", @@ -14679,7 +14229,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -14790,17 +14340,6 @@ Array [ "originalText": 9, "width": 80, }, - Object { - "actualText": "10", - "actualTextHeight": 15, - "actualTextWidth": 14, - "height": 30, - "multiLineActualTexts": Array [ - "10", - ], - "originalText": 10, - "width": 80, - }, ] `; @@ -14810,7 +14349,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -14821,7 +14360,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "省份", ], @@ -14832,7 +14371,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城市", @@ -14845,7 +14384,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 48, "actualTextWidth": 243, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "类别类别类别类", "别类别类别类别", @@ -14858,7 +14397,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "子类别", ], @@ -14869,7 +14408,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -14984,17 +14523,6 @@ Array [ "originalText": 9, "width": 80, }, - Object { - "actualText": "10", - "actualTextHeight": 15, - "actualTextWidth": 14, - "height": 30, - "multiLineActualTexts": Array [ - "10", - ], - "originalText": 10, - "width": 80, - }, Object { "actualText": "浙江省", "actualTextHeight": 15, @@ -15096,17 +14624,6 @@ Array [ "originalText": "浙江省", "width": 103.8, }, - Object { - "actualText": "浙江省", - "actualTextHeight": 15, - "actualTextWidth": 37, - "height": 30, - "multiLineActualTexts": Array [ - "浙江省", - ], - "originalText": "浙江省", - "width": 103.8, - }, Object { "actualText": "绍兴市", "actualTextHeight": 15, @@ -15208,17 +14725,6 @@ Array [ "originalText": "舟山市", "width": 103.8, }, - Object { - "actualText": "杭州市", - "actualTextHeight": 15, - "actualTextWidth": 37, - "height": 30, - "multiLineActualTexts": Array [ - "杭州市", - ], - "originalText": "杭州市", - "width": 103.8, - }, Object { "actualText": "家具", "actualTextHeight": 15, @@ -15320,17 +14826,6 @@ Array [ "originalText": "家具", "width": 103.8, }, - Object { - "actualText": "办公用品", - "actualTextHeight": 15, - "actualTextWidth": 49, - "height": 30, - "multiLineActualTexts": Array [ - "办公用品", - ], - "originalText": "办公用品", - "width": 103.8, - }, Object { "actualText": "桌子", "actualTextHeight": 15, @@ -15432,17 +14927,6 @@ Array [ "originalText": "沙发", "width": 103.8, }, - Object { - "actualText": "笔", - "actualTextHeight": 15, - "actualTextWidth": 13, - "height": 30, - "multiLineActualTexts": Array [ - "笔", - ], - "originalText": "笔", - "width": 103.8, - }, Object { "actualText": "236723672361111", "actualTextHeight": 30, @@ -15546,17 +15030,6 @@ Array [ "originalText": 834, "width": 103.8, }, - Object { - "actualText": "945", - "actualTextHeight": 15, - "actualTextWidth": 21, - "height": 30, - "multiLineActualTexts": Array [ - "945", - ], - "originalText": 945, - "width": 103.8, - }, ] `; @@ -15566,7 +15039,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -15677,17 +15150,6 @@ Array [ "originalText": 9, "width": 80, }, - Object { - "actualText": "10", - "actualTextHeight": 15, - "actualTextWidth": 14, - "height": 30, - "multiLineActualTexts": Array [ - "10", - ], - "originalText": 10, - "width": 80, - }, ] `; @@ -15697,7 +15159,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -15708,7 +15170,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "省份", ], @@ -15719,7 +15181,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城市", @@ -15732,7 +15194,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 48, "actualTextWidth": 243, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "类别类别类别类", "别类别类别类别", @@ -15745,7 +15207,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "子类别", ], @@ -15756,7 +15218,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -15871,17 +15333,6 @@ Array [ "originalText": 9, "width": 80, }, - Object { - "actualText": "10", - "actualTextHeight": 15, - "actualTextWidth": 14, - "height": 30, - "multiLineActualTexts": Array [ - "10", - ], - "originalText": 10, - "width": 80, - }, Object { "actualText": "浙江省", "actualTextHeight": 15, @@ -15983,17 +15434,6 @@ Array [ "originalText": "浙江省", "width": 103.8, }, - Object { - "actualText": "浙江省", - "actualTextHeight": 15, - "actualTextWidth": 37, - "height": 30, - "multiLineActualTexts": Array [ - "浙江省", - ], - "originalText": "浙江省", - "width": 103.8, - }, Object { "actualText": "绍兴市", "actualTextHeight": 15, @@ -16095,17 +15535,6 @@ Array [ "originalText": "舟山市", "width": 103.8, }, - Object { - "actualText": "杭州市", - "actualTextHeight": 15, - "actualTextWidth": 37, - "height": 30, - "multiLineActualTexts": Array [ - "杭州市", - ], - "originalText": "杭州市", - "width": 103.8, - }, Object { "actualText": "家具", "actualTextHeight": 15, @@ -16207,17 +15636,6 @@ Array [ "originalText": "家具", "width": 103.8, }, - Object { - "actualText": "办公用品", - "actualTextHeight": 15, - "actualTextWidth": 49, - "height": 30, - "multiLineActualTexts": Array [ - "办公用品", - ], - "originalText": "办公用品", - "width": 103.8, - }, Object { "actualText": "桌子", "actualTextHeight": 15, @@ -16320,21 +15738,10 @@ Array [ "width": 103.8, }, Object { - "actualText": "笔", - "actualTextHeight": 15, - "actualTextWidth": 13, - "height": 30, - "multiLineActualTexts": Array [ - "笔", - ], - "originalText": "笔", - "width": 103.8, - }, - Object { - "actualText": "236723672361111", - "actualTextHeight": 30, - "actualTextWidth": 100, - "height": 46, + "actualText": "236723672361111", + "actualTextHeight": 30, + "actualTextWidth": 100, + "height": 46, "multiLineActualTexts": Array [ "2367236723611", "11", @@ -16433,17 +15840,6 @@ Array [ "originalText": 834, "width": 103.8, }, - Object { - "actualText": "945", - "actualTextHeight": 15, - "actualTextWidth": 21, - "height": 30, - "multiLineActualTexts": Array [ - "945", - ], - "originalText": 945, - "width": 103.8, - }, ] `; @@ -18868,7 +18264,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "序号", ], @@ -19087,7 +18483,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "序号", ], @@ -19098,7 +18494,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "省份", ], @@ -19109,7 +18505,7 @@ Array [ "actualText": "城市城市城市城市城市城市城...", "actualTextHeight": 32, "actualTextWidth": 168, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城...", @@ -19121,7 +18517,7 @@ Array [ "actualText": "类别类别类别类别类别类别类...", "actualTextHeight": 32, "actualTextWidth": 168, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "类别类别类别类", "别类别类别类...", @@ -19133,7 +18529,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "子类别", ], @@ -19144,7 +18540,7 @@ Array [ "actualText": "数量数量数量数量数量数量数...", "actualTextHeight": 32, "actualTextWidth": 168, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数...", @@ -20363,7 +19759,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "序号", ], @@ -20428,7 +19824,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "序号", ], @@ -20439,7 +19835,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "省份", ], @@ -20450,7 +19846,7 @@ Array [ "actualText": "城市城市城市城市城市城市城...", "actualTextHeight": 32, "actualTextWidth": 168, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城...", @@ -20462,7 +19858,7 @@ Array [ "actualText": "类别类别类别类别类别类别类...", "actualTextHeight": 32, "actualTextWidth": 168, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "类别类别类别类", "别类别类别类...", @@ -20474,7 +19870,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "子类别", ], @@ -20485,7 +19881,7 @@ Array [ "actualText": "数量数量数量数量数量数量数...", "actualTextHeight": 32, "actualTextWidth": 168, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数...", @@ -21736,7 +21132,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -21944,7 +21340,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -21955,7 +21351,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "省份", ], @@ -21966,7 +21362,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城市", @@ -21979,7 +21375,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 48, "actualTextWidth": 243, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "类别类别类别类", "别类别类别类别", @@ -21992,7 +21388,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "子类别", ], @@ -22003,7 +21399,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -23162,7 +22558,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -23262,17 +22658,6 @@ Array [ "originalText": 8, "width": 80, }, - Object { - "actualText": "9", - "actualTextHeight": 15, - "actualTextWidth": 7, - "height": 30, - "multiLineActualTexts": Array [ - "9", - ], - "originalText": 9, - "width": 80, - }, ] `; @@ -23282,7 +22667,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -23293,7 +22678,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "省份", ], @@ -23304,7 +22689,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城市", @@ -23317,7 +22702,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 48, "actualTextWidth": 243, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "类别类别类别类", "别类别类别类别", @@ -23330,7 +22715,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "子类别", ], @@ -23341,7 +22726,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -23445,17 +22830,6 @@ Array [ "originalText": 8, "width": 80, }, - Object { - "actualText": "9", - "actualTextHeight": 15, - "actualTextWidth": 7, - "height": 30, - "multiLineActualTexts": Array [ - "9", - ], - "originalText": 9, - "width": 80, - }, Object { "actualText": "浙江省", "actualTextHeight": 15, @@ -23546,17 +22920,6 @@ Array [ "originalText": "浙江省", "width": 103.8, }, - Object { - "actualText": "浙江省", - "actualTextHeight": 15, - "actualTextWidth": 37, - "height": 30, - "multiLineActualTexts": Array [ - "浙江省", - ], - "originalText": "浙江省", - "width": 103.8, - }, Object { "actualText": "绍兴市", "actualTextHeight": 15, @@ -23647,17 +23010,6 @@ Array [ "originalText": "宁波市", "width": 103.8, }, - Object { - "actualText": "舟山市", - "actualTextHeight": 15, - "actualTextWidth": 37, - "height": 30, - "multiLineActualTexts": Array [ - "舟山市", - ], - "originalText": "舟山市", - "width": 103.8, - }, Object { "actualText": "家具", "actualTextHeight": 15, @@ -23748,17 +23100,6 @@ Array [ "originalText": "家具", "width": 103.8, }, - Object { - "actualText": "家具", - "actualTextHeight": 15, - "actualTextWidth": 25, - "height": 30, - "multiLineActualTexts": Array [ - "家具", - ], - "originalText": "家具", - "width": 103.8, - }, Object { "actualText": "桌子", "actualTextHeight": 15, @@ -23849,17 +23190,6 @@ Array [ "originalText": "沙发", "width": 103.8, }, - Object { - "actualText": "沙发", - "actualTextHeight": 15, - "actualTextWidth": 25, - "height": 30, - "multiLineActualTexts": Array [ - "沙发", - ], - "originalText": "沙发", - "width": 103.8, - }, Object { "actualText": "236723672361111", "actualTextHeight": 30, @@ -23952,17 +23282,6 @@ Array [ "originalText": 7234, "width": 103.8, }, - Object { - "actualText": "834", - "actualTextHeight": 15, - "actualTextWidth": 21, - "height": 30, - "multiLineActualTexts": Array [ - "834", - ], - "originalText": 834, - "width": 103.8, - }, ] `; @@ -23972,7 +23291,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -24037,7 +23356,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -24048,7 +23367,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "省份", ], @@ -24059,7 +23378,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城市", @@ -24072,7 +23391,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 48, "actualTextWidth": 243, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "类别类别类别类", "别类别类别类别", @@ -24085,7 +23404,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "子类别", ], @@ -24096,7 +23415,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -24397,7 +23716,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -24484,7 +23803,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -24495,7 +23814,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "省份", ], @@ -24506,7 +23825,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城市", @@ -24519,7 +23838,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 48, "actualTextWidth": 243, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "类别类别类别类", "别类别类别类别", @@ -24532,7 +23851,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "子类别", ], @@ -24543,7 +23862,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -27176,7 +26495,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -27287,17 +26606,6 @@ Array [ "originalText": 9, "width": 80, }, - Object { - "actualText": "10", - "actualTextHeight": 15, - "actualTextWidth": 14, - "height": 30, - "multiLineActualTexts": Array [ - "10", - ], - "originalText": 10, - "width": 80, - }, ] `; @@ -27307,7 +26615,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -27318,7 +26626,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "省份", ], @@ -27329,7 +26637,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城市", @@ -27342,7 +26650,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 48, "actualTextWidth": 243, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "类别类别类别类", "别类别类别类别", @@ -27355,7 +26663,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "子类别", ], @@ -27366,7 +26674,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -27481,17 +26789,6 @@ Array [ "originalText": 9, "width": 80, }, - Object { - "actualText": "10", - "actualTextHeight": 15, - "actualTextWidth": 14, - "height": 30, - "multiLineActualTexts": Array [ - "10", - ], - "originalText": 10, - "width": 80, - }, Object { "actualText": "浙江省", "actualTextHeight": 15, @@ -27593,17 +26890,6 @@ Array [ "originalText": "浙江省", "width": 103.8, }, - Object { - "actualText": "浙江省", - "actualTextHeight": 15, - "actualTextWidth": 37, - "height": 30, - "multiLineActualTexts": Array [ - "浙江省", - ], - "originalText": "浙江省", - "width": 103.8, - }, Object { "actualText": "绍兴市", "actualTextHeight": 15, @@ -27705,17 +26991,6 @@ Array [ "originalText": "舟山市", "width": 103.8, }, - Object { - "actualText": "杭州市", - "actualTextHeight": 15, - "actualTextWidth": 37, - "height": 30, - "multiLineActualTexts": Array [ - "杭州市", - ], - "originalText": "杭州市", - "width": 103.8, - }, Object { "actualText": "家具", "actualTextHeight": 15, @@ -27817,17 +27092,6 @@ Array [ "originalText": "家具", "width": 103.8, }, - Object { - "actualText": "办公用品", - "actualTextHeight": 15, - "actualTextWidth": 49, - "height": 30, - "multiLineActualTexts": Array [ - "办公用品", - ], - "originalText": "办公用品", - "width": 103.8, - }, Object { "actualText": "桌子", "actualTextHeight": 15, @@ -27929,17 +27193,6 @@ Array [ "originalText": "沙发", "width": 103.8, }, - Object { - "actualText": "笔", - "actualTextHeight": 15, - "actualTextWidth": 13, - "height": 30, - "multiLineActualTexts": Array [ - "笔", - ], - "originalText": "笔", - "width": 103.8, - }, Object { "actualText": "236723672361111", "actualTextHeight": 30, @@ -28043,17 +27296,6 @@ Array [ "originalText": 834, "width": 103.8, }, - Object { - "actualText": "945", - "actualTextHeight": 15, - "actualTextWidth": 21, - "height": 30, - "multiLineActualTexts": Array [ - "945", - ], - "originalText": 945, - "width": 103.8, - }, ] `; @@ -28063,7 +27305,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "序号", ], @@ -28185,17 +27427,6 @@ Array [ "originalText": 10, "width": 80, }, - Object { - "actualText": "11", - "actualTextHeight": 15, - "actualTextWidth": 13, - "height": 30, - "multiLineActualTexts": Array [ - "11", - ], - "originalText": 11, - "width": 80, - }, ] `; @@ -28205,7 +27436,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "序号", ], @@ -28216,7 +27447,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "省份", ], @@ -28227,7 +27458,7 @@ Array [ "actualText": "城市城市城市城市城市城市城...", "actualTextHeight": 32, "actualTextWidth": 168, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城...", @@ -28239,7 +27470,7 @@ Array [ "actualText": "类别类别类别类别类别类别类...", "actualTextHeight": 32, "actualTextWidth": 168, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "类别类别类别类", "别类别类别类...", @@ -28251,7 +27482,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "子类别", ], @@ -28262,7 +27493,7 @@ Array [ "actualText": "数量数量数量数量数量数量数...", "actualTextHeight": 32, "actualTextWidth": 168, - "height": 40, + "height": 48, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数...", @@ -28387,17 +27618,6 @@ Array [ "originalText": 10, "width": 80, }, - Object { - "actualText": "11", - "actualTextHeight": 15, - "actualTextWidth": 13, - "height": 30, - "multiLineActualTexts": Array [ - "11", - ], - "originalText": 11, - "width": 80, - }, Object { "actualText": "浙江省", "actualTextHeight": 15, @@ -28509,17 +27729,6 @@ Array [ "originalText": "浙江省", "width": 103.8, }, - Object { - "actualText": "浙江省", - "actualTextHeight": 15, - "actualTextWidth": 37, - "height": 30, - "multiLineActualTexts": Array [ - "浙江省", - ], - "originalText": "浙江省", - "width": 103.8, - }, Object { "actualText": "绍兴市", "actualTextHeight": 15, @@ -28631,17 +27840,6 @@ Array [ "originalText": "杭州市", "width": 103.8, }, - Object { - "actualText": "绍兴市", - "actualTextHeight": 15, - "actualTextWidth": 37, - "height": 30, - "multiLineActualTexts": Array [ - "绍兴市", - ], - "originalText": "绍兴市", - "width": 103.8, - }, Object { "actualText": "家具", "actualTextHeight": 15, @@ -28753,17 +27951,6 @@ Array [ "originalText": "办公用品", "width": 103.8, }, - Object { - "actualText": "办公用品", - "actualTextHeight": 15, - "actualTextWidth": 49, - "height": 30, - "multiLineActualTexts": Array [ - "办公用品", - ], - "originalText": "办公用品", - "width": 103.8, - }, Object { "actualText": "桌子", "actualTextHeight": 15, @@ -28875,17 +28062,6 @@ Array [ "originalText": "笔", "width": 103.8, }, - Object { - "actualText": "笔", - "actualTextHeight": 15, - "actualTextWidth": 13, - "height": 30, - "multiLineActualTexts": Array [ - "笔", - ], - "originalText": "笔", - "width": 103.8, - }, Object { "actualText": "236723672361111", "actualTextHeight": 30, @@ -28999,17 +28175,6 @@ Array [ "originalText": 945, "width": 103.8, }, - Object { - "actualText": "1304", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 30, - "multiLineActualTexts": Array [ - "1304", - ], - "originalText": 1304, - "width": 103.8, - }, ] `; @@ -29019,7 +28184,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -29227,7 +28392,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -29238,7 +28403,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "省份", ], @@ -29249,7 +28414,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市城市城市", "actualTextHeight": 48, "actualTextWidth": 291, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "城市城市城市城市城市", "城市城市城市城市城市", @@ -29262,7 +28427,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 32, "actualTextWidth": 242, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "类别类别类别类别类别", "类别类别类别类别类别", @@ -29274,7 +28439,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "子类别", ], @@ -29285,7 +28450,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 48, "actualTextWidth": 267, - "height": 56, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数量数量", "数量数量数量数量数量", @@ -30434,3 +29599,374 @@ Array [ }, ] `; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should use actual text height for large max line by custom col group 1`] = ` +Array [ + Object { + "actualText": "序号", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 112, + "multiLineActualTexts": Array [ + "序号", + ], + "originalText": "序号", + "width": 80, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 96, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 0, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should use actual text height for large max line by custom col group 2`] = ` +Array [ + Object { + "actualText": "1", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "1", + ], + "originalText": 1, + "width": 80, + }, + Object { + "actualText": "2", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "2", + ], + "originalText": 2, + "width": 80, + }, + Object { + "actualText": "3", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "3", + ], + "originalText": 3, + "width": 80, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should use actual text height for large max line by custom col group 3`] = ` +Array [ + Object { + "actualText": "序号", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 208, + "multiLineActualTexts": Array [ + "序号", + ], + "originalText": "序号", + "width": 80, + }, + Object { + "actualText": "地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区", + "actualTextHeight": 80, + "actualTextWidth": 1205, + "height": 96, + "multiLineActualTexts": Array [ + "地区地区地区地区地区地区地区地区地区地区地区", + "地区地区地区地区地区地区地区地区地区地区地区", + "地区地区地区地区地区地区地区地区地区地区地区", + "地区地区地区地区地区地区地区地区地区地区地区", + "地区地区地区地区地区地区", + ], + "originalText": "地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区地区", + "width": 287.6, + }, + Object { + "actualText": "省份", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 112, + "multiLineActualTexts": Array [ + "省份", + ], + "originalText": "省份", + "width": 143.8, + }, + Object { + "actualText": "城市", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 112, + "multiLineActualTexts": Array [ + "城市", + ], + "originalText": "城市", + "width": 143.8, + }, + Object { + "actualText": "类型", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 208, + "multiLineActualTexts": Array [ + "类型", + ], + "originalText": "类型", + "width": 143.8, + }, + Object { + "actualText": "金额金额金额金额金额金额金额金额金额金额金额金额金额金额金额金额金额金额金额金额", + "actualTextHeight": 32, + "actualTextWidth": 482, + "height": 96, + "multiLineActualTexts": Array [ + "金额金额金额金额金额金额金额金额金额金额金额", + "金额金额金额金额金额金额金额金额金额", + ], + "originalText": "金额金额金额金额金额金额金额金额金额金额金额金额金额金额金额金额金额金额金额金额", + "width": 287.6, + }, + Object { + "actualText": "价格", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 112, + "multiLineActualTexts": Array [ + "价格", + ], + "originalText": "价格", + "width": 143.8, + }, + Object { + "actualText": "数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量", + "actualTextHeight": 96, + "actualTextWidth": 726, + "height": 112, + "multiLineActualTexts": Array [ + "数量数量数量数量数量", + "数量数量数量数量数量", + "数量数量数量数量数量", + "数量数量数量数量数量", + "数量数量数量数量数量", + "数量数量数量数量数量", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量数量", + "width": 143.8, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should use actual text height for large max line by custom col group 4`] = `Array []`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should use actual text height for large max line by custom col group 5`] = ` +Array [ + Object { + "actualText": "1", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "1", + ], + "originalText": 1, + "width": 80, + }, + Object { + "actualText": "2", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "2", + ], + "originalText": 2, + "width": 80, + }, + Object { + "actualText": "3", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "3", + ], + "originalText": 3, + "width": 80, + }, + Object { + "actualText": "浙江", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "浙江", + ], + "originalText": "浙江", + "width": 143.8, + }, + Object { + "actualText": "浙江", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "浙江", + ], + "originalText": "浙江", + "width": 143.8, + }, + Object { + "actualText": "浙江", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "浙江", + ], + "originalText": "浙江", + "width": 143.8, + }, + Object { + "actualText": "义乌", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "义乌", + ], + "originalText": "义乌", + "width": 143.8, + }, + Object { + "actualText": "义乌", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "义乌", + ], + "originalText": "义乌", + "width": 143.8, + }, + Object { + "actualText": "杭州", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "杭州", + ], + "originalText": "杭州", + "width": 143.8, + }, + Object { + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 143.8, + }, + Object { + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 143.8, + }, + Object { + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 143.8, + }, + Object { + "actualText": "1", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "1", + ], + "originalText": 1, + "width": 143.8, + }, + Object { + "actualText": "1", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "1", + ], + "originalText": 1, + "width": 143.8, + }, + Object { + "actualText": "1", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "1", + ], + "originalText": 1, + "width": 143.8, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 143.8, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 143.8, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 143.8, + }, +] +`; diff --git a/packages/s2-core/__tests__/spreadsheet/__snapshots__/theme-spec.ts.snap b/packages/s2-core/__tests__/spreadsheet/__snapshots__/theme-spec.ts.snap index 281de69170..a7087fa63a 100644 --- a/packages/s2-core/__tests__/spreadsheet/__snapshots__/theme-spec.ts.snap +++ b/packages/s2-core/__tests__/spreadsheet/__snapshots__/theme-spec.ts.snap @@ -53,10 +53,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#5286FA", "verticalBorderColorOpacity": 1, @@ -139,10 +139,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#5286FA", "verticalBorderColorOpacity": 1, @@ -156,6 +156,15 @@ Object { }, "size": 10, }, + "measureText": Object { + "fill": "#FFFFFF", + "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", + "fontSize": 12, + "fontWeight": 700, + "opacity": 1, + "textAlign": "left", + "textBaseline": "middle", + }, "text": Object { "fill": "#FFFFFF", "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", @@ -502,10 +511,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#E1EAFE", "verticalBorderColorOpacity": 1, @@ -632,10 +641,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#0647b1", "verticalBorderColorOpacity": 1, @@ -718,10 +727,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#0647b1", "verticalBorderColorOpacity": 1, @@ -735,6 +744,15 @@ Object { }, "size": 10, }, + "measureText": Object { + "fill": "#ffffff", + "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", + "fontSize": 12, + "fontWeight": 700, + "opacity": 1, + "textAlign": "left", + "textBaseline": "middle", + }, "text": Object { "fill": "#ffffff", "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", @@ -1081,10 +1099,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#1e2436", "verticalBorderColorOpacity": 1, @@ -1211,10 +1229,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#CCDBFC", "verticalBorderColorOpacity": 1, @@ -1297,10 +1315,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#CCDBFC", "verticalBorderColorOpacity": 1, @@ -1314,6 +1332,15 @@ Object { }, "size": 10, }, + "measureText": Object { + "fill": "#000000", + "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", + "fontSize": 12, + "fontWeight": 700, + "opacity": 1, + "textAlign": "left", + "textBaseline": "middle", + }, "text": Object { "fill": "#000000", "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", @@ -1660,10 +1687,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#E0E9FD", "verticalBorderColorOpacity": 1, @@ -1790,10 +1817,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#E7E9ED", "verticalBorderColorOpacity": 1, @@ -1876,10 +1903,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#E7E9ED", "verticalBorderColorOpacity": 1, @@ -1893,6 +1920,15 @@ Object { }, "size": 10, }, + "measureText": Object { + "fill": "#000000", + "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", + "fontSize": 12, + "fontWeight": 700, + "opacity": 1, + "textAlign": "left", + "textBaseline": "middle", + }, "text": Object { "fill": "#000000", "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", @@ -2239,10 +2275,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#F0F2F4", "verticalBorderColorOpacity": 1, @@ -2369,10 +2405,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#CCDBFC", "verticalBorderColorOpacity": 1, @@ -2455,10 +2491,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#CCDBFC", "verticalBorderColorOpacity": 1, @@ -2472,6 +2508,15 @@ Object { }, "size": 10, }, + "measureText": Object { + "fill": "#000000", + "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", + "fontSize": 12, + "fontWeight": 700, + "opacity": 1, + "textAlign": "left", + "textBaseline": "middle", + }, "text": Object { "fill": "#000000", "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", @@ -2818,10 +2863,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#E0E9FD", "verticalBorderColorOpacity": 1, @@ -2948,10 +2993,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#CCDBFC", "verticalBorderColorOpacity": 1, @@ -3034,10 +3079,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#CCDBFC", "verticalBorderColorOpacity": 1, @@ -3051,6 +3096,15 @@ Object { }, "size": 10, }, + "measureText": Object { + "fill": "#000000", + "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", + "fontSize": 12, + "fontWeight": 700, + "opacity": 1, + "textAlign": "left", + "textBaseline": "middle", + }, "text": Object { "fill": "#000000", "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", @@ -3397,10 +3451,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#E0E9FD", "verticalBorderColorOpacity": 1, diff --git a/packages/s2-core/__tests__/spreadsheet/compare-layout-spec.ts b/packages/s2-core/__tests__/spreadsheet/compare-layout-spec.ts index a6c65ffbe7..7980c50b89 100644 --- a/packages/s2-core/__tests__/spreadsheet/compare-layout-spec.ts +++ b/packages/s2-core/__tests__/spreadsheet/compare-layout-spec.ts @@ -43,25 +43,57 @@ describe('Compare Layout Tests', () => { test.each([ { showDefaultHeaderActionIcon: true }, { showDefaultHeaderActionIcon: false }, + ])( + 'should get max col width for pivot sheet and same font size by %o', + async (options) => { + const s2 = new PivotSheet(getContainer(), mockDataConfig, { + ...s2Options, + ...options, + }); + + await s2.render(); + + const colLeafNodes = s2.facet.getColLeafNodes(); + + expect(Math.floor(colLeafNodes[0].width)).toBeCloseTo(133); + expect(Math.floor(colLeafNodes[1].width)).toEqual( + options.showDefaultHeaderActionIcon ? 71 : 66, + ); + expectTextOverflowing(s2); + }, + ); + + // 覆盖 (数值/中文) 等场景 + test.each([ + { showDefaultHeaderActionIcon: true, fontSize: 20 }, + { showDefaultHeaderActionIcon: true, fontSize: 12 }, + { showDefaultHeaderActionIcon: false, fontSize: 20 }, + { showDefaultHeaderActionIcon: false, fontSize: 12 }, ])('should get max col width for pivot sheet by %o', async (options) => { const s2 = new PivotSheet(getContainer(), mockDataConfig, { ...s2Options, - ...options, + showDefaultHeaderActionIcon: options.showDefaultHeaderActionIcon, }); s2.setTheme({ dataCell: { text: { - fontSize: 20, + fontSize: options.fontSize, }, }, }); await s2.render(); + const expectWidth = options.showDefaultHeaderActionIcon ? 71 : 66; + const isLargeFontSize = options.fontSize === 20; const colLeafNodes = s2.facet.getColLeafNodes(); - expect(Math.floor(colLeafNodes[0].width)).toBeCloseTo(191); - expect(Math.floor(colLeafNodes[1].width)).toEqual(92); + expect(Math.floor(colLeafNodes[0].width)).toBeCloseTo( + isLargeFontSize ? 209 : 133, + ); + expect(Math.floor(colLeafNodes[1].width)).toEqual( + isLargeFontSize ? 97 : expectWidth, + ); expectTextOverflowing(s2); }); @@ -90,13 +122,15 @@ describe('Compare Layout Tests', () => { await s2.render(); const colLeafNodes = s2.facet.getColLeafNodes(); - - expect(Math.floor(colLeafNodes[0].width)).toBeCloseTo(183); - expectTextOverflowing(s2); const { dataCellWidthList, colLeafNodeWidthList } = mapWidthList(s2); + const expectWidth = 207; - expect(dataCellWidthList.every((width) => width === 183)).toBeTruthy(); - expect(colLeafNodeWidthList).toEqual([183]); + expect(Math.floor(colLeafNodes[0].width)).toBeCloseTo(expectWidth); + expect( + dataCellWidthList.every((width) => width === expectWidth), + ).toBeTruthy(); + expect(colLeafNodeWidthList).toEqual([expectWidth]); + expectTextOverflowing(s2); }); test.each([ @@ -137,12 +171,13 @@ describe('Compare Layout Tests', () => { expect(dataCellWidthList).toEqual( options.showDefaultHeaderActionIcon - ? [209, 209, 209, 209, 110, 110, 110, 110, 85, 85, 85, 85] - : [209, 209, 209, 209, 110, 110, 110, 110, 69, 69, 69, 69], + ? [227, 227, 227, 227, 115, 115, 115, 115, 93, 93, 93, 93] + : [227, 227, 227, 227, 115, 115, 115, 115, 71, 71, 71, 71], ); expect(colLeafNodeWidthList).toEqual( - options.showDefaultHeaderActionIcon ? [209, 110, 85] : [209, 110, 69], + options.showDefaultHeaderActionIcon ? [227, 115, 93] : [227, 115, 71], ); + expectTextOverflowing(s2); }, ); }); diff --git a/packages/s2-core/__tests__/spreadsheet/interaction-brush-selection-scroll-spec.ts b/packages/s2-core/__tests__/spreadsheet/interaction-brush-selection-scroll-spec.ts index 5b9ac2814b..742ac65dd0 100644 --- a/packages/s2-core/__tests__/spreadsheet/interaction-brush-selection-scroll-spec.ts +++ b/packages/s2-core/__tests__/spreadsheet/interaction-brush-selection-scroll-spec.ts @@ -161,7 +161,7 @@ const expectScrollBrush = async ( expect(dataCellBrushSelectionFn).toHaveBeenCalledTimes(1); }; -describe('TableSheet Brush Selection Scroll Tests', () => { +describe.skip('TableSheet Brush Selection Scroll Tests', () => { test('should scroll when mouse outside table data cell', async () => { const s2 = new TableSheet(getContainer(), dataCfg, options); @@ -188,7 +188,7 @@ describe('TableSheet Brush Selection Scroll Tests', () => { }); }); -describe('PivotSheet Brush Selection Scroll Tests', () => { +describe.skip('PivotSheet Brush Selection Scroll Tests', () => { test('should scroll when mouse outside data cell', async () => { const s2 = createPivotSheet( { diff --git a/packages/s2-core/__tests__/spreadsheet/multi-line-text-spec.ts b/packages/s2-core/__tests__/spreadsheet/multi-line-text-spec.ts index d631b8a822..c6b2593755 100644 --- a/packages/s2-core/__tests__/spreadsheet/multi-line-text-spec.ts +++ b/packages/s2-core/__tests__/spreadsheet/multi-line-text-spec.ts @@ -13,6 +13,7 @@ import type { S2CellType, S2Options, } from '../../src/common'; +import { customColSimpleMultipleTextColumns } from '../data/custom-table-col-fields'; import { PivotSheetMultiLineTextDataCfg, TableSheetMultiLineTextDataCfg, @@ -160,7 +161,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { await s2.render(false); matchCellStyleSnapshot(); - expectColHierarchyHeight(118, 80, 38); + expectColHierarchyHeight(142, 96, 46); }); test('should render three max text lines', async () => { @@ -168,7 +169,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { await s2.render(false); matchCellStyleSnapshot(); - expectColHierarchyHeight(165, 112, 53); + expectColHierarchyHeight(189, 128, 61); }); test('should render custom text overflow text', async () => { @@ -213,6 +214,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { // wordWrap 关闭时, 不会渲染省略号 cells.forEach((cell) => { expect(cell.getActualText()).not.toContain('...'); + expect(cell.isTextOverflowing()).toBeFalsy(); }); }); expectColHierarchyHeight(90); @@ -335,7 +337,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { await s2.render(false); matchCellStyleSnapshot(); - expectColHierarchyHeight(118, 80, 38); + expectColHierarchyHeight(142, 96, 46); }); test('should not adaptive adjust cell height if custom cell style more than actual text height', async () => { @@ -386,7 +388,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { updateStyle(3); await s2.render(false); - expectColHierarchyHeight(149, 96, 53); + expectColHierarchyHeight(173, 112, 61); }); test('should render correctly layout if only enable grand totals', async () => { @@ -442,8 +444,8 @@ describe('SpreadSheet Multi Line Text Tests', () => { matchCellStyleSnapshot(); // 省份 4行文本, 叶子节点 (城市) 3行文本, 省份应该和城市高度一致, 才能展示所有文本 (maxLines: 4) - expectRowHierarchyHeight(384, 0, 72); - expectColHierarchyHeight(212, 144, 68); + expectRowHierarchyHeight(400, 0, 80); + expectColHierarchyHeight(236, 160, 76); }); test('should render three max text lines for tree mode', async () => { @@ -473,7 +475,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { await s2.render(); matchCellStyleSnapshot(); - expect(s2.facet.getLayoutResult().rowsHierarchy.height).toEqual(524); + expect(s2.facet.getLayoutResult().rowsHierarchy.height).toEqual(556); }); // https://github.com/antvis/S2/issues/2678 @@ -528,7 +530,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { await s2.render(); matchCellStyleSnapshot(); - expect(s2.facet.getLayoutResult().rowsHierarchy.height).toEqual(328); + expect(s2.facet.getLayoutResult().rowsHierarchy.height).toEqual(336); }); test.each(range(1, 11))( @@ -579,7 +581,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { await s2.render(false); matchCellStyleSnapshot(); - expectColHierarchyHeight(40, 0, 40, 1); + expectColHierarchyHeight(48, 0, 48, 1); }); test('should render three max text lines', async () => { @@ -588,7 +590,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { matchCellStyleSnapshot(); - expectColHierarchyHeight(56, 0, 56, 1); + expectColHierarchyHeight(64, 0, 64, 1); }); test('should render custom text overflow text', async () => { @@ -628,6 +630,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { // wordWrap 关闭时, 不会渲染省略号 cells.forEach((cell) => { expect(cell.getActualText()).not.toContain('...'); + expect(cell.isTextOverflowing()).toBeFalsy(); }); }); }); @@ -687,7 +690,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { await s2.render(); matchCellStyleSnapshot(); - expectColHierarchyHeight(72, 0, 72, 1); + expectColHierarchyHeight(80, 0, 80, 1); }); // https://github.com/antvis/S2/issues/2594 @@ -971,7 +974,30 @@ describe('SpreadSheet Multi Line Text Tests', () => { await s2.render(); matchCellStyleSnapshot(); - expect(s2.facet.getLayoutResult().colsHierarchy.height).toEqual(56); + expect(s2.facet.getLayoutResult().colsHierarchy.height).toEqual(64); + }); + + // https://github.com/antvis/S2/issues/2955 + test('should use actual text height for large max line by custom col group', async () => { + updateStyle(20); + + s2.setDataCfg( + { + ...SimpleDataCfg, + fields: { + rows: [], + columns: customColSimpleMultipleTextColumns, + values: [], + }, + }, + true, + ); + + s2.changeSheetSize(800, 600); + await s2.render(); + + matchCellStyleSnapshot(); + expect(s2.facet.getLayoutResult().colsHierarchy.height).toEqual(208); }); test.each(range(1, 11))( diff --git a/packages/s2-core/__tests__/spreadsheet/scroll-spec.ts b/packages/s2-core/__tests__/spreadsheet/scroll-spec.ts index 27f53b9155..8671d61c67 100644 --- a/packages/s2-core/__tests__/spreadsheet/scroll-spec.ts +++ b/packages/s2-core/__tests__/spreadsheet/scroll-spec.ts @@ -462,7 +462,7 @@ describe('Scroll Tests', () => { expect((sheet.facet as any).emitScrollEvent).not.toHaveBeenCalled(); }); - test('should render correct scroll position', async () => { + test('should render correct scroll position for compact mode', async () => { s2.setOptions({ interaction: { scrollbarPosition: ScrollbarPositionType.CONTENT, @@ -480,7 +480,7 @@ describe('Scroll Tests', () => { s2.changeSheetSize(1000, 150); // 纵向滚动条 await s2.render(false); - expect(Math.floor(s2.facet.vScrollBar.getBBox().x)).toEqual(201); + expect(Math.floor(s2.facet.vScrollBar.getBBox().x)).toEqual(213); s2.setOptions({ interaction: { diff --git a/packages/s2-core/__tests__/unit/facet/layout/col-node-width-spec.ts b/packages/s2-core/__tests__/unit/facet/layout/col-node-width-spec.ts index 975dbb3a47..3dc217914d 100644 --- a/packages/s2-core/__tests__/unit/facet/layout/col-node-width-spec.ts +++ b/packages/s2-core/__tests__/unit/facet/layout/col-node-width-spec.ts @@ -138,7 +138,7 @@ describe('Col width Test', () => { const colLeafNodes = s2.facet.getColLeafNodes(); // price 列,列头标签比表身数据更长 - expect(Math.round(colLeafNodes[0].width)).toBe(47); + expect(Math.round(colLeafNodes[0].width)).toBe(52); // cost 列,表身数据比列头更长(格式化) expect(Math.round(colLeafNodes[1].width)).toBe(168); }); diff --git a/packages/s2-core/__tests__/unit/facet/pivot-facet-spec.ts b/packages/s2-core/__tests__/unit/facet/pivot-facet-spec.ts index 06878d82d3..799b2e54cf 100644 --- a/packages/s2-core/__tests__/unit/facet/pivot-facet-spec.ts +++ b/packages/s2-core/__tests__/unit/facet/pivot-facet-spec.ts @@ -88,6 +88,7 @@ jest.mock('@/sheet-type', () => { getCellRange: jest.fn().mockReturnValue({ start: 0, end: 100 }), cornerBBox: {}, getHeaderNodes: jest.fn().mockReturnValue([]), + measureTextWidth: jest.fn(), }, getCanvasElement: () => container.getContextService().getDomElement() as HTMLCanvasElement, @@ -98,6 +99,8 @@ jest.mock('@/sheet-type', () => { }, measureTextWidth: jest.fn() as unknown as SpreadSheet['measureTextWidth'], + measureTextWidthRoughly: + jest.fn() as unknown as SpreadSheet['measureTextWidthRoughly'], getSeriesNumberText: jest.fn(() => getDefaultSeriesNumberText()), }; }), diff --git a/packages/s2-core/__tests__/unit/facet/table-facet-spec.ts b/packages/s2-core/__tests__/unit/facet/table-facet-spec.ts index daefde8c6d..224dbf6c6d 100644 --- a/packages/s2-core/__tests__/unit/facet/table-facet-spec.ts +++ b/packages/s2-core/__tests__/unit/facet/table-facet-spec.ts @@ -61,6 +61,7 @@ jest.mock('@/sheet-type', () => { getColNodeHeight: jest.fn(), getHeaderNodes: jest.fn().mockReturnValue([]), getCellMeta: jest.fn().mockRejectedValue({}), + measureTextWidth: jest.fn(), }, dataSet: { isEmpty: jest.fn(), diff --git a/packages/s2-core/__tests__/unit/sheet-type/pivot-sheet-spec.ts b/packages/s2-core/__tests__/unit/sheet-type/pivot-sheet-spec.ts index 743030fc75..80cfd60646 100644 --- a/packages/s2-core/__tests__/unit/sheet-type/pivot-sheet-spec.ts +++ b/packages/s2-core/__tests__/unit/sheet-type/pivot-sheet-spec.ts @@ -773,7 +773,7 @@ describe('PivotSheet Tests', () => { test('should rebuild hidden columns detail by status', async () => { // 重新更新, 但是没有隐藏列信息 - await s2.render({ reloadData: false, reBuildHiddenColumnsDetail: true }); + await s2.render({ reloadData: false, rebuildHiddenColumnsDetail: true }); expect(mockHideColumnsByThunkGroup).toHaveBeenCalledTimes(0); @@ -781,16 +781,16 @@ describe('PivotSheet Tests', () => { null, ] as unknown as HiddenColumnsInfo[]); - // 重新更新, 有隐藏列信息, 但是 reBuildHiddenColumnsDetail 为 false + // 重新更新, 有隐藏列信息, 但是 rebuildHiddenColumnsDetail 为 false await s2.render({ reloadData: false, - reBuildHiddenColumnsDetail: false, + rebuildHiddenColumnsDetail: false, }); expect(mockHideColumnsByThunkGroup).toHaveBeenCalledTimes(0); - // 重新更新, 有隐藏列信息, 且 reBuildHiddenColumnsDetail 为 true - await s2.render({ reloadData: false, reBuildHiddenColumnsDetail: true }); + // 重新更新, 有隐藏列信息, 且 rebuildHiddenColumnsDetail 为 true + await s2.render({ reloadData: false, rebuildHiddenColumnsDetail: true }); expect(mockHideColumnsByThunkGroup).toHaveBeenCalledTimes(1); }); diff --git a/packages/s2-core/__tests__/unit/utils/__snapshots__/merge-spec.ts.snap b/packages/s2-core/__tests__/unit/utils/__snapshots__/merge-spec.ts.snap index 05806f3497..3218784a8a 100644 --- a/packages/s2-core/__tests__/unit/utils/__snapshots__/merge-spec.ts.snap +++ b/packages/s2-core/__tests__/unit/utils/__snapshots__/merge-spec.ts.snap @@ -121,7 +121,7 @@ Object { } `; -exports[`merge test should setup correctly compact layout width type style 1`] = ` +exports[`merge test should not setup correctly compact layout width type style 1`] = ` Object { "colCell": Object { "height": 30, @@ -141,7 +141,7 @@ Object { "maxLines": 1, "textOverflow": "ellipsis", "width": 96, - "wordWrap": false, + "wordWrap": true, }, "layoutWidthType": "compact", "rowCell": Object { diff --git a/packages/s2-core/__tests__/unit/utils/merge-spec.ts b/packages/s2-core/__tests__/unit/utils/merge-spec.ts index 867c685beb..4ef0de9306 100644 --- a/packages/s2-core/__tests__/unit/utils/merge-spec.ts +++ b/packages/s2-core/__tests__/unit/utils/merge-spec.ts @@ -175,7 +175,7 @@ describe('merge test', () => { expect(setupOptions(null)).toMatchSnapshot(); }); - test('should setup correctly compact layout width type style', () => { + test('should not setup correctly compact layout width type style', () => { expect( setupOptions({ style: { diff --git a/packages/s2-core/__tests__/util/helpers.ts b/packages/s2-core/__tests__/util/helpers.ts index a61f7b3a7d..bca47a2757 100644 --- a/packages/s2-core/__tests__/util/helpers.ts +++ b/packages/s2-core/__tests__/util/helpers.ts @@ -231,6 +231,7 @@ export const createFakeSpreadSheet = (config?: { s2.getTotalsConfig = jest.fn(); s2.getLayoutWidthType = jest.fn(); s2.measureTextWidth = jest.fn(); + s2.measureTextWidthRoughly = jest.fn(); s2.isFrozenRowHeader = jest.fn(); s2.getSeriesNumberText = jest.fn(() => getDefaultSeriesNumberText()); s2.theme = getTheme({ diff --git a/packages/s2-core/package.json b/packages/s2-core/package.json index a6008a167b..f72aa946f6 100644 --- a/packages/s2-core/package.json +++ b/packages/s2-core/package.json @@ -1,6 +1,6 @@ { "name": "@antv/s2", - "version": "2.0.0-next.31", + "version": "2.0.0-next.32", "private": false, "description": "effective spreadsheet render core lib", "keywords": [ diff --git a/packages/s2-core/src/common/constant/theme.ts b/packages/s2-core/src/common/constant/theme.ts index 7d3fc453ac..12d307d31d 100644 --- a/packages/s2-core/src/common/constant/theme.ts +++ b/packages/s2-core/src/common/constant/theme.ts @@ -5,7 +5,6 @@ import { paletteGray } from '../../theme/palette/gray'; import type { ThemeName } from '../interface'; import { S2_PREFIX_CLS } from './classnames'; -// Map of the theme export const PALETTE_MAP = { default: paletteDefault, colorful: paletteColorful, @@ -39,3 +38,5 @@ export const G2_THEME_TYPE: Record = { gray: 'light', dark: 'dark', }; + +export const CELL_PADDING = 8; diff --git a/packages/s2-core/src/common/interface/s2Options.ts b/packages/s2-core/src/common/interface/s2Options.ts index d8ece16a92..8639a59e2e 100644 --- a/packages/s2-core/src/common/interface/s2Options.ts +++ b/packages/s2-core/src/common/interface/s2Options.ts @@ -386,5 +386,5 @@ export interface S2RenderOptions { /** * 是否重新生成列头隐藏信息 */ - reBuildHiddenColumnsDetail?: boolean; + rebuildHiddenColumnsDetail?: boolean; } diff --git a/packages/s2-core/src/facet/base-facet.ts b/packages/s2-core/src/facet/base-facet.ts index 3730fbd036..abddc61349 100644 --- a/packages/s2-core/src/facet/base-facet.ts +++ b/packages/s2-core/src/facet/base-facet.ts @@ -456,6 +456,7 @@ export abstract class BaseFacet { const { padding } = cell.getStyle().cell; const textHeight = cell.getActualTextHeight(); const adaptiveHeight = textHeight + padding.top + padding.bottom; + const height = cell.isMultiLineText() && textHeight >= defaultHeight ? adaptiveHeight @@ -827,14 +828,14 @@ export abstract class BaseFacet { const child = children[i]; if (child instanceof Group) { - child.removeChildren(); + child.destroyChildren(); } else { - children[i].remove(); + child.destroy(); } } - this.foregroundGroup.removeChildren(); - this.backgroundGroup.removeChildren(); + this.foregroundGroup.destroyChildren(); + this.backgroundGroup.destroyChildren(); } scrollWithAnimation = ( @@ -1526,7 +1527,7 @@ export abstract class BaseFacet { (cell) => cell.name === `${i}-${j}`, ); - mountedDataCell?.remove(); + mountedDataCell?.destroy(); }); DebuggerUtil.getInstance().logger( @@ -2294,12 +2295,25 @@ export abstract class BaseFacet { /** * @tip 和 this.spreadsheet.measureTextWidth() 的区别在于: * 1. 额外添加一像素余量,防止 maxLabel 有多个同样长度情况下,一些 label 不能展示完全, 出现省略号 - * 2. 测量时, 文本宽度向上取整, 避免子像素的不一致性 + * 2. 测量时, 文本宽度取整, 避免子像素的不一致性 + * 3. TODO: 由于 G 测量文本是一个一个字符进行计算, 在数字/英文等场景会有较大误差, 这里为了防止紧凑模式出现省略号, 暂时保持一样的策略 */ - protected measureTextWidth(text: SimpleData, font: unknown): number { + protected measureTextWidth( + text: SimpleData, + font: unknown, + roughly = true, + ): number { const EXTRA_PIXEL = 1; - const defaultWidth = this.spreadsheet.measureTextWidth(text, font); - return Math.ceil(defaultWidth) + EXTRA_PIXEL; + if (roughly) { + return ( + Math.ceil(this.spreadsheet.measureTextWidthRoughly(text, font)) + + EXTRA_PIXEL + ); + } + + return ( + Math.ceil(this.spreadsheet.measureTextWidth(text, font)) + EXTRA_PIXEL + ); } } diff --git a/packages/s2-core/src/facet/pivot-facet.ts b/packages/s2-core/src/facet/pivot-facet.ts index f9d169dc68..1960a57af9 100644 --- a/packages/s2-core/src/facet/pivot-facet.ts +++ b/packages/s2-core/src/facet/pivot-facet.ts @@ -806,7 +806,7 @@ export class PivotFacet extends FrozenFacet { * 额外增加 1,当内容和容器宽度恰好相等时会出现换行 */ const maxLabelWidth = - this.measureTextWidth(treeHeaderLabel, cornerCellTextStyle) + + this.measureTextWidth(treeHeaderLabel, cornerCellTextStyle, false) + cornerIconStyle.size * 2 + cornerIconStyle.margin?.left + cornerIconStyle.margin?.right + diff --git a/packages/s2-core/src/facet/table-facet.ts b/packages/s2-core/src/facet/table-facet.ts index 3008e1bb5d..d62c326d5a 100644 --- a/packages/s2-core/src/facet/table-facet.ts +++ b/packages/s2-core/src/facet/table-facet.ts @@ -117,7 +117,7 @@ export class TableFacet extends FrozenFacet { const iconX = viewportWidth / 2 - icon.width / 2; const iconY = height / 2 + maxY - icon.height / 2 + icon.margin.top; const text = empty?.description ?? i18n('暂无数据'); - const descWidth = this.measureTextWidth(text, description); + const descWidth = this.measureTextWidth(text, description, false); const descX = viewportWidth / 2 - descWidth / 2; const descY = iconY + icon.height + icon.margin.bottom; @@ -486,10 +486,11 @@ export class TableFacet extends FrozenFacet { colLeafNodes: Node[], colsHierarchy: Hierarchy, ) { + // 先计算宽度, 再计算高度, 确保计算多行文本时能获取到正确的最大文本宽度 this.calculateColLeafNodesWidth(colLeafNodes, colsHierarchy); + this.calculateColNodeWidthAndX(colLeafNodes); this.updateColsHierarchySampleMaxHeightNodes(colsHierarchy); this.calculateColNodesHeight(colsHierarchy); - this.calculateColNodeWidthAndX(colLeafNodes); this.updateCustomFieldsSampleNodes(colsHierarchy); this.adjustCustomColLeafNodesHeight({ leafNodes: colLeafNodes, diff --git a/packages/s2-core/src/sheet-type/spread-sheet.ts b/packages/s2-core/src/sheet-type/spread-sheet.ts index 1e5d311ea5..28b888d1d1 100644 --- a/packages/s2-core/src/sheet-type/spread-sheet.ts +++ b/packages/s2-core/src/sheet-type/spread-sheet.ts @@ -98,7 +98,7 @@ export abstract class SpreadSheet extends EE { /** * 表格是否已销毁 */ - private destroyed = false; + public destroyed = false; protected abstract bindEvents(): void; @@ -423,7 +423,7 @@ export abstract class SpreadSheet extends EE { const { reloadData = true, rebuildDataSet = false, - reBuildHiddenColumnsDetail = true, + rebuildHiddenColumnsDetail = true, } = options || {}; this.emit(S2Event.LAYOUT_BEFORE_RENDER); @@ -439,7 +439,7 @@ export abstract class SpreadSheet extends EE { this.buildFacet(); - if (reBuildHiddenColumnsDetail) { + if (rebuildHiddenColumnsDetail) { await this.initHiddenColumnsDetail(); } @@ -456,7 +456,7 @@ export abstract class SpreadSheet extends EE { s2.render({ reloadData: true; rebuildDataSet: true; - reBuildHiddenColumnsDetail: true; + rebuildHiddenColumnsDetail: true; }) */ public async render(options?: S2RenderOptions | boolean): Promise { @@ -818,7 +818,10 @@ export abstract class SpreadSheet extends EE { * @param font 文本 css 样式 * @returns 文本宽度 */ - public measureTextWidthRoughly = (text: any, font: any = {}): number => { + public measureTextWidthRoughly = ( + text: SimpleData, + font: unknown, + ): number => { const alphaWidth = this.measureTextWidth('a', font); const chineseWidth = this.measureTextWidth('蚂', font); @@ -829,7 +832,7 @@ export abstract class SpreadSheet extends EE { } // eslint-disable-next-line no-restricted-syntax - for (const char of text) { + for (const char of String(text)) { const code = char.charCodeAt(0); // /[\u0000-\u00ff]/ diff --git a/packages/s2-core/src/theme/index.ts b/packages/s2-core/src/theme/index.ts index 124303bda9..a76f7f0d00 100644 --- a/packages/s2-core/src/theme/index.ts +++ b/packages/s2-core/src/theme/index.ts @@ -1,6 +1,15 @@ /* eslint-disable max-lines-per-function */ -import { FONT_FAMILY, INTERVAL_BAR_HEIGHT } from '../common/constant'; -import type { DefaultCellTheme, S2Theme, ThemeCfg } from '../common/interface'; +import { + CELL_PADDING, + FONT_FAMILY, + INTERVAL_BAR_HEIGHT, +} from '../common/constant'; +import type { + DefaultCellTheme, + Padding, + S2Theme, + ThemeCfg, +} from '../common/interface'; import type { SpreadSheet } from '../sheet-type'; import { isMobile, isWindows } from '../utils/is-mobile'; import { getPalette } from '../utils/theme'; @@ -20,6 +29,12 @@ export const getTheme = ( const isTable = themeCfg?.spreadsheet?.isTableMode(); const boldTextDefaultFontWeight = isWindows() ? 'bold' : 700; + const cellPadding: Padding = { + top: CELL_PADDING, + right: CELL_PADDING, + bottom: CELL_PADDING, + left: CELL_PADDING, + }; const getDataCell = (): DefaultCellTheme => ({ bolderText: { @@ -56,12 +71,7 @@ export const getTheme = ( horizontalBorderWidth: 1, verticalBorderWidth: 1, // -------------- layout ----------------- - padding: { - top: 8, - right: 8, - bottom: 8, - left: 8, - }, + padding: cellPadding, /* ---------- interaction state ----------- */ interactionState: { @@ -185,6 +195,15 @@ export const getTheme = ( textAlign: isTable ? 'center' : 'right', textBaseline: 'middle', }, + measureText: { + fontFamily: FONT_FAMILY, + fontSize: 12, + fontWeight: boldTextDefaultFontWeight, + fill: basicColors[0], + opacity: 1, + textAlign: 'left', + textBaseline: 'middle', + }, cell: { // ----------- background color ----------- backgroundColor: basicColors[3], @@ -200,12 +219,7 @@ export const getTheme = ( // -------------- border dash ----------------- borderDash: [], // -------------- layout ----------------- - padding: { - top: 4, - right: 8, - bottom: 4, - left: 8, - }, + padding: cellPadding, /* ---------- interaction state ----------- */ interactionState: { @@ -309,12 +323,7 @@ export const getTheme = ( // -------------- border dash ----------------- borderDash: [], // -------------- layout ----------------- - padding: { - top: 4, - right: 8, - bottom: 4, - left: 8, - }, + padding: cellPadding, /* ---------- interaction state ----------- */ interactionState: { @@ -409,12 +418,7 @@ export const getTheme = ( // -------------- border dash ----------------- borderDash: [], // -------------- layout ----------------- - padding: { - top: 4, - right: 8, - bottom: 4, - left: 8, - }, + padding: cellPadding, /* ---------- interaction state ----------- */ interactionState: { diff --git a/packages/s2-core/src/ui/hd-adapter/index.ts b/packages/s2-core/src/ui/hd-adapter/index.ts index 9d326b9bbb..9bb2dac7b1 100644 --- a/packages/s2-core/src/ui/hd-adapter/index.ts +++ b/packages/s2-core/src/ui/hd-adapter/index.ts @@ -110,6 +110,10 @@ export class HdAdapter { private renderByDevicePixelRatio = async ( ratio = window.devicePixelRatio, ) => { + if (this.spreadsheet.destroyed) { + return; + } + const { container, options: { width, height }, @@ -130,6 +134,10 @@ export class HdAdapter { }; private renderByZoomScale = debounce(async (event: Event) => { + if (this.spreadsheet.destroyed) { + return; + } + const target = event.target as VisualViewport; const ratio = Math.ceil(target?.scale); diff --git a/packages/s2-core/src/utils/hide-columns.ts b/packages/s2-core/src/utils/hide-columns.ts index 2c71b16ea7..9c59de0128 100644 --- a/packages/s2-core/src/utils/hide-columns.ts +++ b/packages/s2-core/src/utils/hide-columns.ts @@ -131,7 +131,7 @@ export const hideColumns = async ( spreadsheet.store.set('hiddenColumnsDetail', hiddenColumnsDetail); await spreadsheet.render({ reloadData: false, - reBuildHiddenColumnsDetail: false, + rebuildHiddenColumnsDetail: false, }); }; diff --git a/packages/s2-core/src/utils/merge.ts b/packages/s2-core/src/utils/merge.ts index 173a84607d..ad42bae6ff 100644 --- a/packages/s2-core/src/utils/merge.ts +++ b/packages/s2-core/src/utils/merge.ts @@ -1,6 +1,6 @@ import { isArray, isEmpty, isEqual, isString, mergeWith, uniq } from 'lodash'; import { DEFAULT_DATA_CONFIG } from '../common/constant/dataConfig'; -import { DEFAULT_OPTIONS, LayoutWidthType } from '../common/constant/options'; +import { DEFAULT_OPTIONS } from '../common/constant/options'; import type { CustomHeaderFields, Fields, @@ -68,14 +68,5 @@ export const setupDataConfig = ( export const setupOptions = ( options: Partial | null | undefined, ): S2Options => { - const mergedOptions = customMerge(DEFAULT_OPTIONS, options); - - if ( - mergedOptions.style?.layoutWidthType === LayoutWidthType.Compact && - mergedOptions.style?.dataCell!.maxLines! <= 1 - ) { - mergedOptions.style.dataCell!.wordWrap = false; - } - - return mergedOptions; + return customMerge(DEFAULT_OPTIONS, options); }; diff --git a/packages/s2-react-components/CHANGELOG.md b/packages/s2-react-components/CHANGELOG.md index ee9f3b8c91..729637871d 100644 --- a/packages/s2-react-components/CHANGELOG.md +++ b/packages/s2-react-components/CHANGELOG.md @@ -1,3 +1,11 @@ +# [@antv/s2-react-components-v2.0.0-next.1](https://github.com/antvis/S2/compare/@antv/s2-react-components-v1.0.1-next.1...@antv/s2-react-components-v2.0.0-next.1) (2024-11-08) + + +### Bug Fixes + +* 修复分割线在深色背景下颜色渲染异常 & 内容宽高未包含分割线的问题 ([#2961](https://github.com/antvis/S2/issues/2961)) ([e759891](https://github.com/antvis/S2/commit/e759891865eee0940d0f5c92345d5490e10eb57c)) +* 修复开启自定义指标层级后, 角头数值文本未对齐 close [#2957](https://github.com/antvis/S2/issues/2957) ([#2966](https://github.com/antvis/S2/issues/2966)) ([6558a0d](https://github.com/antvis/S2/commit/6558a0df55dc324e1810e2f2a5d314de7389e2b1)) + # [@antv/s2-react-components-v1.0.1-next.1](https://github.com/antvis/S2/compare/@antv/s2-react-components-v1.0.0...@antv/s2-react-components-v1.0.1-next.1) (2024-10-12) diff --git a/packages/s2-react-components/__tests__/unit/components/theme-panel/__snapshots__/utils-spec.ts.snap b/packages/s2-react-components/__tests__/unit/components/theme-panel/__snapshots__/utils-spec.ts.snap index 092d142832..f4aa62d4b6 100644 --- a/packages/s2-react-components/__tests__/unit/components/theme-panel/__snapshots__/utils-spec.ts.snap +++ b/packages/s2-react-components/__tests__/unit/components/theme-panel/__snapshots__/utils-spec.ts.snap @@ -53,10 +53,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#E0E9FD", "verticalBorderColorOpacity": 1, @@ -139,10 +139,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#E0E9FD", "verticalBorderColorOpacity": 1, @@ -156,6 +156,15 @@ Object { }, "size": 10, }, + "measureText": Object { + "fill": "#000000", + "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", + "fontSize": 12, + "fontWeight": 700, + "opacity": 1, + "textAlign": "left", + "textBaseline": "middle", + }, "text": Object { "fill": "#000000", "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", @@ -502,10 +511,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#E0E9FD", "verticalBorderColorOpacity": 1, @@ -632,10 +641,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#5184F6", "verticalBorderColorOpacity": 1, @@ -718,10 +727,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#5184F6", "verticalBorderColorOpacity": 1, @@ -735,6 +744,15 @@ Object { }, "size": 10, }, + "measureText": Object { + "fill": "#FFFFFF", + "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", + "fontSize": 12, + "fontWeight": 700, + "opacity": 1, + "textAlign": "left", + "textBaseline": "middle", + }, "text": Object { "fill": "#FFFFFF", "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", @@ -1081,10 +1099,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#E0E9FD", "verticalBorderColorOpacity": 1, @@ -1211,10 +1229,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#52A87D", "verticalBorderColorOpacity": 1, @@ -1297,10 +1315,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#52A87D", "verticalBorderColorOpacity": 1, @@ -1314,6 +1332,15 @@ Object { }, "size": 10, }, + "measureText": Object { + "fill": "#FFFFFF", + "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", + "fontSize": 12, + "fontWeight": 700, + "opacity": 1, + "textAlign": "left", + "textBaseline": "middle", + }, "text": Object { "fill": "#FFFFFF", "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", @@ -1660,10 +1687,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#E0F0E8", "verticalBorderColorOpacity": 1, @@ -1790,10 +1817,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#CCDBFC", "verticalBorderColorOpacity": 1, @@ -1876,10 +1903,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#CCDBFC", "verticalBorderColorOpacity": 1, @@ -1893,6 +1920,15 @@ Object { }, "size": 10, }, + "measureText": Object { + "fill": "#000000", + "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", + "fontSize": 12, + "fontWeight": 700, + "opacity": 1, + "textAlign": "left", + "textBaseline": "middle", + }, "text": Object { "fill": "#000000", "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", @@ -2239,10 +2275,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#E0E9FD", "verticalBorderColorOpacity": 1, @@ -2369,10 +2405,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#5184F6", "verticalBorderColorOpacity": 1, @@ -2455,10 +2491,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#5184F6", "verticalBorderColorOpacity": 1, @@ -2472,6 +2508,15 @@ Object { }, "size": 10, }, + "measureText": Object { + "fill": "#FFFFFF", + "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", + "fontSize": 12, + "fontWeight": 700, + "opacity": 1, + "textAlign": "left", + "textBaseline": "middle", + }, "text": Object { "fill": "#FFFFFF", "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", @@ -2818,10 +2863,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#E0E9FD", "verticalBorderColorOpacity": 1, @@ -2948,10 +2993,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#B6C0D7", "verticalBorderColorOpacity": 1, @@ -3034,10 +3079,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#B6C0D7", "verticalBorderColorOpacity": 1, @@ -3051,6 +3096,15 @@ Object { }, "size": 10, }, + "measureText": Object { + "fill": "#000000", + "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", + "fontSize": 12, + "fontWeight": 700, + "opacity": 1, + "textAlign": "left", + "textBaseline": "middle", + }, "text": Object { "fill": "#000000", "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", @@ -3397,10 +3451,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#B6C0D7", "verticalBorderColorOpacity": 1, @@ -3527,10 +3581,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#5184F6", "verticalBorderColorOpacity": 1, @@ -3613,10 +3667,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#5184F6", "verticalBorderColorOpacity": 1, @@ -3630,6 +3684,15 @@ Object { }, "size": 10, }, + "measureText": Object { + "fill": "#FFFFFF", + "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", + "fontSize": 12, + "fontWeight": 700, + "opacity": 1, + "textAlign": "left", + "textBaseline": "middle", + }, "text": Object { "fill": "#FFFFFF", "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", @@ -3977,10 +4040,10 @@ Object { }, }, "padding": Object { - "bottom": 4, + "bottom": 8, "left": 8, "right": 8, - "top": 4, + "top": 8, }, "verticalBorderColor": "#E0E9FD", "verticalBorderColorOpacity": 1, diff --git a/packages/s2-react-components/package.json b/packages/s2-react-components/package.json index 48eebb7b3c..b99b7f1506 100644 --- a/packages/s2-react-components/package.json +++ b/packages/s2-react-components/package.json @@ -1,6 +1,6 @@ { "name": "@antv/s2-react-components", - "version": "1.0.1-next.1", + "version": "2.0.0-next.1", "private": false, "description": "React components for S2", "keywords": [ diff --git a/packages/s2-react/__tests__/unit/hooks/useSpreadSheet-spec.ts b/packages/s2-react/__tests__/unit/hooks/useSpreadSheet-spec.ts index 4298be5316..273070cbc7 100644 --- a/packages/s2-react/__tests__/unit/hooks/useSpreadSheet-spec.ts +++ b/packages/s2-react/__tests__/unit/hooks/useSpreadSheet-spec.ts @@ -23,6 +23,7 @@ describe('useSpreadSheet tests', () => { fields: S2DataConfig['fields'] = mockDataConfig.fields, ): SheetComponentProps => { return { + sheetType: 'pivot' as const, spreadsheet: () => new PivotSheet(getContainer(), mockDataConfig, s2Options as S2Options), options: s2Options, @@ -35,9 +36,7 @@ describe('useSpreadSheet tests', () => { test('should build spreadSheet', async () => { const props = getConfig(); - const { result } = renderHook(() => - useSpreadSheet({ ...props, sheetType: 'pivot' }), - ); + const { result } = renderHook(() => useSpreadSheet({ ...props })); await waitFor(() => { expect(result.current.s2Ref).toBeDefined(); @@ -47,7 +46,6 @@ describe('useSpreadSheet tests', () => { test('should cannot change table size when width or height updated and disable adaptive', async () => { const props = { ...getConfig(), - sheetType: 'pivot' as const, adaptive: false, }; const { result } = renderHook(() => useSpreadSheet(props)); @@ -126,7 +124,6 @@ describe('useSpreadSheet tests', () => { const props = { ...getConfig(), - sheetType: 'pivot' as const, onDestroy: onDestroyFromProps, }; const { result, unmount } = renderHook(() => useSpreadSheet(props)); @@ -160,7 +157,6 @@ describe('useSpreadSheet tests', () => { const props = { ...getConfig(), - sheetType: 'pivot' as const, onMounted, }; const { result } = renderHook(() => useSpreadSheet(props)); @@ -173,40 +169,67 @@ describe('useSpreadSheet tests', () => { }); }); - test('should call onUpdate and onUpdateAfterRender when sheet updated', async () => { - const onUpdate = jest.fn(); - const onUpdateAfterRender = jest.fn(); - - const props = { - ...getConfig(), - sheetType: 'pivot' as const, - onUpdate, - onUpdateAfterRender, - }; - const { rerender } = renderHook( - (innerProps) => useSpreadSheet(innerProps), - { - initialProps: props, + test.each([ + { + updatedProps: { + options: { width: 200 }, }, - ); - - await waitFor(() => { - expect(onUpdate).toHaveBeenCalledTimes(0); - expect(onUpdateAfterRender).toHaveBeenCalledTimes(0); - }); - - act(() => { - rerender({ ...props, options: { width: 200 } }); - }); - - await waitFor(() => { - expect(onUpdate).toHaveBeenCalledWith({ + updateOptions: { rebuildDataSet: false, reloadData: false, + }, + }, + { + updatedProps: { + themeCfg: { name: 'dark' }, + }, + updateOptions: { + rebuildDataSet: false, + reloadData: false, + }, + }, + { + updatedProps: { + dataCfg: { fields: ['test'] }, + }, + updateOptions: { + rebuildDataSet: false, + reloadData: true, + }, + }, + ])( + 'should call onUpdate and onUpdateAfterRender when sheet %o updated', + async ({ updatedProps, updateOptions }) => { + const onUpdate = jest.fn(); + const onUpdateAfterRender = jest.fn(); + + const props = { + ...getConfig(), + onUpdate, + onUpdateAfterRender, + }; + const { rerender } = renderHook( + (innerProps) => useSpreadSheet(innerProps), + { + initialProps: props, + }, + ); + + await waitFor(() => { + expect(onUpdate).toHaveBeenCalledTimes(0); + expect(onUpdateAfterRender).toHaveBeenCalledTimes(0); }); - expect(onUpdateAfterRender).toHaveBeenCalledTimes(1); - }); - }); + + act(() => { + rerender({ ...props, ...updatedProps }); + }); + + await waitFor(() => { + expect(onUpdate).toHaveBeenCalledWith(updateOptions); + expect(onUpdateAfterRender).toHaveBeenCalledTimes(1); + }); + }, + ); test('should use custom render mode by onUpdate', async () => { const onUpdate = jest.fn((options) => ({ ...options, reloadData: true })); @@ -214,7 +237,6 @@ describe('useSpreadSheet tests', () => { const props = { ...getConfig(), - sheetType: 'pivot' as const, onUpdate, onUpdateAfterRender, }; @@ -226,7 +248,7 @@ describe('useSpreadSheet tests', () => { ); act(() => { - rerender({ ...props, options: { width: 200 } }); + rerender({ ...props, options: { width: 300 } }); }); await waitFor(() => { diff --git a/packages/s2-react/src/hooks/useSpreadSheet.ts b/packages/s2-react/src/hooks/useSpreadSheet.ts index 52f40748fd..fe4bcd732e 100644 --- a/packages/s2-react/src/hooks/useSpreadSheet.ts +++ b/packages/s2-react/src/hooks/useSpreadSheet.ts @@ -7,7 +7,7 @@ import type { } from '@antv/s2'; import { PivotSheet, SpreadSheet, TableSheet } from '@antv/s2'; import { useUpdate, useUpdateEffect } from 'ahooks'; -import { identity } from 'lodash'; +import { identity, isEqual } from 'lodash'; import React from 'react'; import type { SheetComponentOptions, SheetComponentProps } from '../components'; import { getSheetComponentOptions } from '../utils'; @@ -118,6 +118,7 @@ export function useSpreadSheet(props: SheetComponentProps) { updatePrevDepsRef.current = [dataCfg, options!, themeCfg!]; + let rerender = false; let reloadData = false; let rebuildDataSet = false; @@ -131,24 +132,33 @@ export function useSpreadSheet(props: SheetComponentProps) { } reloadData = true; + rerender = true; s2Ref.current?.setDataCfg(dataCfg); } - if (!Object.is(prevOptions, options)) { - if (!Object.is(prevOptions?.hierarchyType, options?.hierarchyType)) { + if (!isEqual(prevOptions, options)) { + if (prevOptions?.hierarchyType !== options?.hierarchyType) { rebuildDataSet = true; reloadData = true; s2Ref.current?.setDataCfg(dataCfg); } + rerender = true; s2Ref.current?.setOptions(options as S2Options); s2Ref.current?.changeSheetSize(options!.width, options!.height); } - if (!Object.is(prevThemeCfg, themeCfg)) { + if (!isEqual(prevThemeCfg, themeCfg)) { + rerender = true; s2Ref.current?.setThemeCfg(themeCfg); } + if (!rerender) { + setLoading(false); + + return; + } + /** * onUpdate 交出控制权 * 由传入方决定最终的 render 模式 diff --git a/s2-site/docs/api/basic-class/base-cell.zh.md b/s2-site/docs/api/basic-class/base-cell.zh.md index 1444b0eca0..d92c0d86f5 100644 --- a/s2-site/docs/api/basic-class/base-cell.zh.md +++ b/s2-site/docs/api/basic-class/base-cell.zh.md @@ -14,8 +14,8 @@ cell.getActualText() | --- | --- | --- | | getMeta | 获取单元格元数据 | () => [`ViewMeta`](#viewmeta) | | setMeta | 设置单元格元数据 | (vieMeta: [`Partial`](#viewmeta)) => void | -| getIconStyle | 获取单元格图标样式 | () => [`IconTheme`](/docs/api/general/s2-theme#icontheme) | -| getStyle | 获取单元格样式 | (name?: string) => [`DefaultCellTheme`](/docs/api/general/s2-theme#defaultcelltheme) | +| getIconStyle | 获取单元格图标样式 | () => [`IconTheme`](/api/general/s2-theme#icontheme) | +| getStyle | 获取单元格样式 | (name?: string) => [`DefaultCellTheme`](/api/general/s2-theme#defaultcelltheme) | | getTextAndIconPosition | 获取单元格文本和图标的位置 | (iconCount: `number`) => [`TextAndIconPosition`](#textandiconposition) | | cellType | 单元格类型 | [`CellType`](#celltype) | | initCell | 初始化单元格 | `() => void` | diff --git a/s2-site/docs/api/basic-class/base-data-set.zh.md b/s2-site/docs/api/basic-class/base-data-set.zh.md index 367325b48f..98f5ed3175 100644 --- a/s2-site/docs/api/basic-class/base-data-set.zh.md +++ b/s2-site/docs/api/basic-class/base-data-set.zh.md @@ -12,22 +12,22 @@ s2.dataSet.getFieldName('type') | 参数 | 说明 | 类型 | 版本 | | -------------------------------------- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- | -| fields | 字段信息 | [Fields](/docs/api/general/s2-data-config#fields) | | -| meta | 字段元信息,包含有字段名、格式化等 | [Meta[]](/docs/api/general/s2-data-config#meta) | | +| fields | 字段信息 | [Fields](/api/general/s2-data-config#fields) | | +| meta | 字段元信息,包含有字段名、格式化等 | [Meta[]](/api/general/s2-data-config#meta) | | | originData | 原始数据 | [RawData](#rawdata)[](#rawdata) | | | indexesData | 多维索引数据 | Record | | -| sortParams | 排序配置 | [SortParams](/docs/api/general/s2-data-config#sortparams) | | +| sortParams | 排序配置 | [SortParams](/api/general/s2-data-config#sortparams) | | | filterParams | 筛选配置 | [FilterParam](#filterparam)[] | | | displayData | 展示数据 | [RawData](#rawdata)[] | | -| spreadsheet | 表格实例 | [SpreadSheet](/docs/api/basic-class/spreadsheet) | | -| getField | 获取字段 | (field: [CustomHeaderField](#customheaderfield)) => [Meta](/docs/api/general/s2-data-config#meta) | | -| getFieldMeta | 获取字段元数据信息 | (field: [CustomHeaderField](#customheaderfield), meta?: [Meta[]](/docs/api/general/s2-data-config#meta)) => [Meta](/docs/api/general/s2-data-config#meta) | +| spreadsheet | 表格实例 | [SpreadSheet](/api/basic-class/spreadsheet) | | +| getField | 获取字段 | (field: [CustomHeaderField](#customheaderfield)) => [Meta](/api/general/s2-data-config#meta) | | +| getFieldMeta | 获取字段元数据信息 | (field: [CustomHeaderField](#customheaderfield), meta?: [Meta[]](/api/general/s2-data-config#meta)) => [Meta](/api/general/s2-data-config#meta) | | getFieldName | 获取字段名 | (field: [CustomHeaderField](#customheaderfield), defaultValue?: string) => `string` | | | getCustomRowFieldName | 获取自定义单元格字段名称 | (cell: S2CellType<[`ViewMeta`](#viewmeta) \| [`Node`](/api/basic-class/node)>) => `string` | | | getCustomFieldDescription | 获取自定义单元格字段描述 | (cell: S2CellType<[`ViewMeta`](#viewmeta) \| [`Node`](/api/basic-class/node)>) => `string` | | | getFieldFormatter | 获取字段格式化函数 | (field: [CustomHeaderField](#customheaderfield)) => [Formatter](#formatter) | | | getFieldDescription | 获取字段描述 | (field: [CustomHeaderField](#customheaderfield)) => [Formatter](#formatter) | | -| setDataCfg | 设置数据配置 | `(dataCfg: T extends true ?` [`S2DataConfig`](/docs/api/general/s2-data-config) `: Partial<`[`S2DataConfig`](/docs/api/general/s2-data-config)`>, reset?: T) => void` | `reset` 参数需在 `@antv/s2^1.34.0`版本使用 | +| setDataCfg | 设置数据配置 | `(dataCfg: T extends true ?` [`S2DataConfig`](/api/general/s2-data-config) `: Partial<`[`S2DataConfig`](/api/general/s2-data-config)`>, reset?: T) => void` | `reset` 参数需在 `@antv/s2^1.34.0`版本使用 | | getDisplayDataSet | 获取当前显示的数据集 | () => [DataType[]](#datatype) | | | getDimensionValues | 获取维值 | (filed: string, query?: [DataType](#datatype) ) => string[] | | | getCellData | 获取单个的单元格数据 | (params: [GetCellDataParams](#getcelldataparams)) => [DataType[]](#datatype) | | diff --git a/s2-site/docs/api/basic-class/base-facet.zh.md b/s2-site/docs/api/basic-class/base-facet.zh.md index f998e41ea1..f4c019e354 100644 --- a/s2-site/docs/api/basic-class/base-facet.zh.md +++ b/s2-site/docs/api/basic-class/base-facet.zh.md @@ -12,9 +12,9 @@ s2.facet.getRealWidth() | 参数 | 说明 | 类型 | 版本 | | --- | --- | --- | --- | -| spreadsheet | 表格实例 | [SpreadSheet](/docs/api/basic-class/spreadsheet) | -| cornerBBox | 角头区域包围盒 | [BBox](/docs/api/basic-class/base-bbox) | -| panelBBox | 数值区域包围盒 | [BBox](/docs/api/basic-class/base-bbox) | +| spreadsheet | 表格实例 | [SpreadSheet](/api/basic-class/spreadsheet) | +| cornerBBox | 角头区域包围盒 | [BBox](/api/basic-class/base-bbox) | +| panelBBox | 数值区域包围盒 | [BBox](/api/basic-class/base-bbox) | | backgroundGroup | 背景区域 | [Group](https://g.antv.antgroup.com/api/basic/group) | | panelGroup | 数值区域 | [Group](https://g.antv.antgroup.com/api/basic/group) | | foregroundGroup | 前景区域 | [Group](https://g.antv.antgroup.com/api/basic/group) | @@ -30,7 +30,7 @@ s2.facet.getRealWidth() | centerFrame | 框架 | [Group](https://g.antv.antgroup.com/api/basic/group) | | gridInfo | 网格信息 | [GridInfo](#gridinfo) | | getViewCellHeights | 获取单元格高度信息 | () => [ViewCellHeights](#viewcellheights) | -| scrollBarTheme | 滚动条主题 | [ScrollBarTheme](/docs/api/general/s2-theme/#scrollbartheme) | +| scrollBarTheme | 滚动条主题 | [ScrollBarTheme](/api/general/s2-theme/#scrollbartheme) | | scrollBarSize | 滚动条大小 | `number` | | hideScrollBar | 隐藏滚动条 | () => void | | delayHideScrollBar | 延迟隐藏滚动条 (1s 后) | () => void | @@ -68,7 +68,7 @@ s2.facet.getRealWidth() | isScrollOverTheViewport | 是否在数值单元格区域滚动 | (cellScrollOffset: [CellScrollOffset](#cellscrolloffset)) => boolean | | cancelScrollFrame | 取消当前滚动帧 | () => void | | clearScrollFrameIdOnMobile | 取消当前滚动帧 (移动端) | () => void | -| addCell | 添加单元格 | (cell: [BaseCell](/docs/api/basic-class/base-cell)) => void | +| addCell | 添加单元格 | (cell: [BaseCell](/api/basic-class/base-cell)) => void | | drawGrid | 绘制网格 | () => void | | getCanvasSize | 获取画布宽高 | `{width: number, height: number}` | | backgroundGroup | 背景颜色区域 group | [Group](https://g.antv.antgroup.com/api/basic/group) | | @@ -81,41 +81,41 @@ s2.facet.getRealWidth() | frozenTrailingColGroup | 列头底部冻结区域 group | [Group](https://g.antv.antgroup.com/api/basic/group) | | | frozenTopGroup | 顶部冻结区域 group | [Group](https://g.antv.antgroup.com/api/basic/group) | | | frozenBottomGroup | 底部冻结区域 group | [Group](https://g.antv.antgroup.com/api/basic/group) | | -| getHiddenColumnsInfo | 匹配当前节点是否是隐藏节点,如果是,则返回该节点隐藏信息 | (node: [Node](/docs/api/basic-class/node)) => [HiddenColumnsInfo](/docs/api/basic-class/store#hiddencolumnsinfo) \| `null` | | -| getHeaderNodes | 获取表头节点 (角头,序号,行头,列头) (含可视区域) | (ids?: string[]) => [Node](/docs/api/basic-class/node)[] | | -| getSeriesNumberNodes | 获取序号节点 | () => [Node](/docs/api/basic-class/node)[] | | -| getCornerNodes | 获取角头节点 | () => [Node](/docs/api/basic-class/node)[] | `1.40.0` | -| getRowNodes | 获取行头节点 | (level?: number) => [Node](/docs/api/basic-class/node)[] | | -| getRowNodeById | 根据 id 获取单个行头节点 | (id: string) => [Node](/docs/api/basic-class/node) | | -| getRowNodeByIndex | 根据行头索引获取指定列头节点 | (rowIndex: number) => [Node](/docs/api/basic-class/node) | | -| getRowNodesByField | 根据 field 获取行头节点 | (field: string) => [Node](/docs/api/basic-class/node)[] | | -| getRowLeafNodes | 获取行头单元格叶子节点 | () => [Node](/docs/api/basic-class/node)[] | | -| getRowLeafNodeByIndex | 根据行头索引获取指定列头叶子节点 | () => [Node](/docs/api/basic-class/node)[] | | -| getRowTotalsNodes | 获取行头汇总单元格节点 | (level?; number) => [Node](/docs/api/basic-class/node)[] | | -| getRowSubTotalsNodes | 获取行头小计单元格节点 | (level?; number) => [Node](/docs/api/basic-class/node)[] | | -| getRowGrandTotalsNodes | 获取行头总计单元格节点 | (level?: number) => [Node](/docs/api/basic-class/node)[] | | -| getColNodes | 获取列头节点 | (level?: number) => [Node](/docs/api/basic-class/node)[] | | -| getColNodeById | 根据 id 获取单个列头节点 | (id: string) => [Node](/docs/api/basic-class/node) | | -| getColNodeByIndex | 根据行头索引获取指定列头节点 | (colIndex: number) => [Node](/docs/api/basic-class/node) | | -| getColNodesByField | 根据 field 获取列节点 | (field: string) => [Node](/docs/api/basic-class/node)[] | | -| getColLeafNodes | 获取列头单元格叶子节点 | () => [Node](/docs/api/basic-class/node)[] | | -| getColLeafNodeByIndex | 根据列头索引获取指定列头叶子节点 | () => [Node](/docs/api/basic-class/node)[] | | -| getColTotalsNodes | 获取列头汇总单元格节点 | (level?; number) => [Node](/docs/api/basic-class/node)[] | | -| getColSubTotalsNodes | 获取列头小计单元格节点 | (level?; number) => [Node](/docs/api/basic-class/node)[] | | -| getColGrandTotalsNodes | 获取列头总计单元格节点 | (level?: number) => [Node](/docs/api/basic-class/node)[] | | -| getDataCells | 获取数值单元格 (不含可视区域) | () => [DataCell](/docs/api/basic-class/base-cell)[] | | -| getRowCells | 获取行头单元格 (不含可视区域) | () => [RowCell](/docs/api/basic-class/base-cell)[] | | -| getRowLeafCells | 获取行头叶子节点单元格 (不含可视区域) | () => [RowCell](/docs/api/basic-class/base-cell)[] | | -| getColCells | 获取列头单元格 (不含可视区域) | () => [ColCell](/docs/api/basic-class/base-cell)[] | | -| getColCells | 获取列头叶子节点单元格 (不含可视区域) | () => [ColCell](/docs/api/basic-class/base-cell)[] | | -| getMergedCells | 获取合并单元格 (不含可视区域) | () => [MergedCell](/docs/api/basic-class/base-cell)[] | | -| getCornerCells | 获取角头单元格 (不含可视区域) | () => [CornerCell](/docs/api/basic-class/base-cell)[] | | -| getSeriesNumberCells | 获取序号单元格 (不含可视区域) | () => [SeriesNumberCell](/docs/api/basic-class/base-cell)[] | | -| getHeaderCells | 获取表头单元格 (序号,角头,行头,列头) (不含可视区域) | (cellIds?: string[]) => [S2CellType](/docs/api/basic-class/base-cell)[] | | -| getCellById | 根据单元格 id 获取指定单元格 (不含可视区域) | (id: string) => [S2CellType](/docs/api/basic-class/base-cell)[] | | -| getCellsByField | 根据单元格 field 获取指定单元格 (不含可视区域) | (field: string) => [S2CellType](/docs/api/basic-class/base-cell)[] | | -| getCells | 获取所有单元格 (角头,行头,列头,数值) (不含可视区域) | (ids: string[]) => [S2CellType](/docs/api/basic-class/base-cell)[] | | -| getInitColLeafNodes | 获取初始化时的记录的列头叶子节点 | () => [Node](/docs/api/basic-class/node)[] | | +| getHiddenColumnsInfo | 匹配当前节点是否是隐藏节点,如果是,则返回该节点隐藏信息 | (node: [Node](/api/basic-class/node)) => [HiddenColumnsInfo](/api/basic-class/store#hiddencolumnsinfo) \| `null` | | +| getHeaderNodes | 获取表头节点 (角头,序号,行头,列头) (含可视区域) | (ids?: string[]) => [Node](/api/basic-class/node)[] | | +| getSeriesNumberNodes | 获取序号节点 | () => [Node](/api/basic-class/node)[] | | +| getCornerNodes | 获取角头节点 | () => [Node](/api/basic-class/node)[] | `1.40.0` | +| getRowNodes | 获取行头节点 | (level?: number) => [Node](/api/basic-class/node)[] | | +| getRowNodeById | 根据 id 获取单个行头节点 | (id: string) => [Node](/api/basic-class/node) | | +| getRowNodeByIndex | 根据行头索引获取指定列头节点 | (rowIndex: number) => [Node](/api/basic-class/node) | | +| getRowNodesByField | 根据 field 获取行头节点 | (field: string) => [Node](/api/basic-class/node)[] | | +| getRowLeafNodes | 获取行头单元格叶子节点 | () => [Node](/api/basic-class/node)[] | | +| getRowLeafNodeByIndex | 根据行头索引获取指定列头叶子节点 | () => [Node](/api/basic-class/node)[] | | +| getRowTotalsNodes | 获取行头汇总单元格节点 | (level?; number) => [Node](/api/basic-class/node)[] | | +| getRowSubTotalsNodes | 获取行头小计单元格节点 | (level?; number) => [Node](/api/basic-class/node)[] | | +| getRowGrandTotalsNodes | 获取行头总计单元格节点 | (level?: number) => [Node](/api/basic-class/node)[] | | +| getColNodes | 获取列头节点 | (level?: number) => [Node](/api/basic-class/node)[] | | +| getColNodeById | 根据 id 获取单个列头节点 | (id: string) => [Node](/api/basic-class/node) | | +| getColNodeByIndex | 根据行头索引获取指定列头节点 | (colIndex: number) => [Node](/api/basic-class/node) | | +| getColNodesByField | 根据 field 获取列节点 | (field: string) => [Node](/api/basic-class/node)[] | | +| getColLeafNodes | 获取列头单元格叶子节点 | () => [Node](/api/basic-class/node)[] | | +| getColLeafNodeByIndex | 根据列头索引获取指定列头叶子节点 | () => [Node](/api/basic-class/node)[] | | +| getColTotalsNodes | 获取列头汇总单元格节点 | (level?; number) => [Node](/api/basic-class/node)[] | | +| getColSubTotalsNodes | 获取列头小计单元格节点 | (level?; number) => [Node](/api/basic-class/node)[] | | +| getColGrandTotalsNodes | 获取列头总计单元格节点 | (level?: number) => [Node](/api/basic-class/node)[] | | +| getDataCells | 获取数值单元格 (不含可视区域) | () => [DataCell](/api/basic-class/base-cell)[] | | +| getRowCells | 获取行头单元格 (不含可视区域) | () => [RowCell](/api/basic-class/base-cell)[] | | +| getRowLeafCells | 获取行头叶子节点单元格 (不含可视区域) | () => [RowCell](/api/basic-class/base-cell)[] | | +| getColCells | 获取列头单元格 (不含可视区域) | () => [ColCell](/api/basic-class/base-cell)[] | | +| getColCells | 获取列头叶子节点单元格 (不含可视区域) | () => [ColCell](/api/basic-class/base-cell)[] | | +| getMergedCells | 获取合并单元格 (不含可视区域) | () => [MergedCell](/api/basic-class/base-cell)[] | | +| getCornerCells | 获取角头单元格 (不含可视区域) | () => [CornerCell](/api/basic-class/base-cell)[] | | +| getSeriesNumberCells | 获取序号单元格 (不含可视区域) | () => [SeriesNumberCell](/api/basic-class/base-cell)[] | | +| getHeaderCells | 获取表头单元格 (序号,角头,行头,列头) (不含可视区域) | (cellIds?: string[]) => [S2CellType](/api/basic-class/base-cell)[] | | +| getCellById | 根据单元格 id 获取指定单元格 (不含可视区域) | (id: string) => [S2CellType](/api/basic-class/base-cell)[] | | +| getCellsByField | 根据单元格 field 获取指定单元格 (不含可视区域) | (field: string) => [S2CellType](/api/basic-class/base-cell)[] | | +| getCells | 获取所有单元格 (角头,行头,列头,数值) (不含可视区域) | (ids: string[]) => [S2CellType](/api/basic-class/base-cell)[] | | +| getInitColLeafNodes | 获取初始化时的记录的列头叶子节点 | () => [Node](/api/basic-class/node)[] | | | clearInitColLeafNodes | 清楚初始化时的记录的列头叶子节点 | () => void | | | getCellMeta | 根据行列索引获取数值单元格信息 | (rowIndex: `number`, colIndex: `number`) => [ViewMeta](#viewmeta) | | diff --git a/s2-site/docs/api/basic-class/base-tooltip.zh.md b/s2-site/docs/api/basic-class/base-tooltip.zh.md index 9d67b67386..6637deed22 100644 --- a/s2-site/docs/api/basic-class/base-tooltip.zh.md +++ b/s2-site/docs/api/basic-class/base-tooltip.zh.md @@ -17,7 +17,7 @@ s2.tooltip.show({ | 参数 | 说明 | 类型 | | --- | --- | --- | -| `spreadsheet` | 表格实例 | () => [SpreadSheet](/docs/api/basic-class/spreadsheet) | +| `spreadsheet` | 表格实例 | () => [SpreadSheet](/api/basic-class/spreadsheet) | | `container` | tooltip 挂载容器 | [HTMLElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement) | | `options` | tooltip 配置 | [TooltipShowOptions](#tooltipshowoptions) | | `position` | 坐标 | `{ x: number, y: number }` | diff --git a/s2-site/docs/api/basic-class/hierarchy.zh.md b/s2-site/docs/api/basic-class/hierarchy.zh.md index 0a1f336670..22588c0374 100644 --- a/s2-site/docs/api/basic-class/hierarchy.zh.md +++ b/s2-site/docs/api/basic-class/hierarchy.zh.md @@ -16,13 +16,13 @@ hierarchy.sampleNodesForAllLevels | width | 层级宽度 | `number` | | height | 层级高度 | `number` | | maxLevel | 层级最大层级 | `number` | -| sampleNodesForAllLevels | 所有层级的采样节点 | [Node](/docs/api/basic-class/node)[] | -| sampleNodeForLastLevel | 最大层级的采样节点 | [Node](/docs/api/basic-class/node) | -| allNodesWithoutRoot | 除根节点的所有节点 | [Node](/docs/api/basic-class/node)[] | -| indexNode | 索引节点 | [Node](/docs/api/basic-class/node)[] | -| getLeaves | 获取所有叶子节点 | () => [Node](/docs/api/basic-class/node)[] | -| getNodes | 获取节点 | (level?: number) => [Node](/docs/api/basic-class/node)[] | -| getNodesLessThanLevel | 获取小于指定层级的节点 | (lessThanLevel: number) => [Node](/docs/api/basic-class/node)[] | -| pushNode | 添加节点 | (node: [Node](/docs/api/basic-class/node), insetIndex: number) => void | -| pushIndexNode | 添加索引节点 | (node: [Node](/docs/api/basic-class/node)) => void | -| getIndexNodes | 获取索引节点 | () => [Node](/docs/api/basic-class/node)[] | +| sampleNodesForAllLevels | 所有层级的采样节点 | [Node](/api/basic-class/node)[] | +| sampleNodeForLastLevel | 最大层级的采样节点 | [Node](/api/basic-class/node) | +| allNodesWithoutRoot | 除根节点的所有节点 | [Node](/api/basic-class/node)[] | +| indexNode | 索引节点 | [Node](/api/basic-class/node)[] | +| getLeaves | 获取所有叶子节点 | () => [Node](/api/basic-class/node)[] | +| getNodes | 获取节点 | (level?: number) => [Node](/api/basic-class/node)[] | +| getNodesLessThanLevel | 获取小于指定层级的节点 | (lessThanLevel: number) => [Node](/api/basic-class/node)[] | +| pushNode | 添加节点 | (node: [Node](/api/basic-class/node), insetIndex: number) => void | +| pushIndexNode | 添加索引节点 | (node: [Node](/api/basic-class/node)) => void | +| getIndexNodes | 获取索引节点 | () => [Node](/api/basic-class/node)[] | diff --git a/s2-site/docs/api/basic-class/interaction.zh.md b/s2-site/docs/api/basic-class/interaction.zh.md index 82b4bd1c47..6c6353ad8a 100644 --- a/s2-site/docs/api/basic-class/interaction.zh.md +++ b/s2-site/docs/api/basic-class/interaction.zh.md @@ -12,7 +12,7 @@ s2.interaction.reset() | 参数 | 说明 | 类型 | | --- |--------------------------------------------------| --- | -| spreadsheet | 表格实例 | [SpreadSheet](/docs/api/basic-class/spreadsheet) | +| spreadsheet | 表格实例 | [SpreadSheet](/api/basic-class/spreadsheet) | | interactions | 当前已注册的交互 | `Map` | | intercepts | 当前拦截的交互,防止不同交互之间冲突 ([查看示例](/examples/interaction/advanced/#intercepts)) | `Set` | | eventController | 事件控制器 | [EventController](#eventcontroller) | @@ -51,9 +51,9 @@ s2.interaction.reset() | addIntercepts | 新增交互拦截 | (interceptTypes: [InterceptType](#intercepttype)[]) => void | | hasIntercepts | 是否有指定拦截的交互 | (interceptTypes: [InterceptType](#intercepttype)[]) => boolean | | removeIntercepts | 移除指定交互拦截 | (interceptTypes: [InterceptType](#intercepttype)[]) => void | -| highlightNodes | 高亮节点对应的单元格 | (nodes: [Node](/docs/api/basic-class/node)[]) => void | +| highlightNodes | 高亮节点对应的单元格 | (nodes: [Node](/api/basic-class/node)[]) => void | | scrollTo | 滚动至指定位置 | (offsetConfig: [ScrollOffsetConfig](#offsetconfig)) => void | | -| scrollToNode | 滚动至指定单元格节点 | (node: [Node](/docs/api/basic-class/node), options?: [CellScrollToOptions](#cellscrolltooptions)) => void | | +| scrollToNode | 滚动至指定单元格节点 | (node: [Node](/api/basic-class/node), options?: [CellScrollToOptions](#cellscrolltooptions)) => void | | | scrollToCell | 滚动至指定单元格 | (cell: [S2CellType](#s2celltype), options?: [CellScrollToOptions](#cellscrolltooptions)) => void | | | scrollToCellById | 滚动至指定单元格 id 对应的位置,如果不在可视化范围内,则会自动滚动 | (id: string, options?: [CellScrollToOptions](#cellscrolltooptions)) => void | | | scrollToTop | 滚动至顶部 | (options?: [CellScrollToOptions](#cellscrolltooptions)) => void | | @@ -253,7 +253,7 @@ interface InteractionStateInfo { | 参数 | 说明 | 类型 | | --- |--------| --- | -| spreadsheet | 表格实例 | [SpreadSheet](/docs/api/basic-class/spreadsheet) | +| spreadsheet | 表格实例 | [SpreadSheet](/api/basic-class/spreadsheet) | | canvasEventHandlers | 当前已注册的交互 | [EventHandler](#eventhandler)[] | | s2EventHandlers | 当前已注册的交互 | [S2EventHandler](#s2eventhandler)[] | | domEventListeners | 当前已注册的交互 | [EventHandler](#eventhandler)[] | diff --git a/s2-site/docs/api/basic-class/node.zh.md b/s2-site/docs/api/basic-class/node.zh.md index 93d5a46515..b75d67286e 100644 --- a/s2-site/docs/api/basic-class/node.zh.md +++ b/s2-site/docs/api/basic-class/node.zh.md @@ -17,18 +17,18 @@ node.isTotals // false | level | 节点等级 | `number` | | rowIndex | 行头索引 | `number` | | colIndex | 列头索引 | `number` | -| parent | 父节点 | [Node](/docs/api/basic-class/node) | +| parent | 父节点 | [Node](/api/basic-class/node) | | isTotals | 是否是汇总 | `boolean` | | isSubTotals | 是否是小计 | `boolean` | | isGrandTotals | 是否是总计 | `boolean` | | isCollapsed | 是否展开 | `boolean` | -| hierarchy | 层级结构 | [Hierarchy](/docs/api/basic-class/hierarchy) | +| hierarchy | 层级结构 | [Hierarchy](/api/basic-class/hierarchy) | | isPivotMode | 是否是透视表 | `boolean` | | seriesNumberWidth | 序号宽度 | `number` | | field | dataCfg 对应的 field | `string` | -| spreadsheet | 表格实例 | [SpreadSheet](/docs/api/basic-class/spreadsheet) | +| spreadsheet | 表格实例 | [SpreadSheet](/api/basic-class/spreadsheet) | | query | 当前节点对应的查询条件 [详情](/manual/advanced/get-cell-data) | `Record` | -| belongsCell | 当前节点对应的单元格 | [S2CellType](/docs/api/basic-class/base-cell) | +| belongsCell | 当前节点对应的单元格 | [S2CellType](/api/basic-class/base-cell) | | isTotalMeasure | 是否是数值小计 | `boolean` | | isCollapseNode | 是否展开的节点 | `boolean` | | isSeriesNumberNode | 是否是序号列节点 | () => `boolean` | @@ -38,6 +38,6 @@ node.isTotals // false | width | 宽度 | `number` | | height | 高度 | `number` | | padding | 间距 | `number` | -| children | 子节点 | [Node[]](/docs/api/basic-class/node) | +| children | 子节点 | [Node[]](/api/basic-class/node) | | extra | 节点额外信息 | `Record` | -| relatedNode | 给序号列单元格用,标识该序号单元格对应了行头节点,有了关联关系后,就可以在行头冻结时做区分 | [Node[]](/docs/api/basic-class/node) | +| relatedNode | 给序号列单元格用,标识该序号单元格对应了行头节点,有了关联关系后,就可以在行头冻结时做区分 | [Node[]](/api/basic-class/node) | diff --git a/s2-site/docs/api/basic-class/spreadsheet.zh.md b/s2-site/docs/api/basic-class/spreadsheet.zh.md index 7b7393d049..e7e3286393 100644 --- a/s2-site/docs/api/basic-class/spreadsheet.zh.md +++ b/s2-site/docs/api/basic-class/spreadsheet.zh.md @@ -14,56 +14,60 @@ s2.isPivotMode() | 参数 | 说明 | 类型 | 版本 | | --- |------------------------------------------------------------------------------------------------------------------------| --- |----| -| dom | 挂载的容器节点 | `string` \| `HTMLElement` | | -| theme | 主题配置 | [S2Theme](/docs/api/general/s2-theme) | | -| store | 存储的一些信息 | [Store](/docs/api/basic-class/store) | | -| dataCfg | 数据配置 | [S2DataConfig](/docs/api/general/s2-data-config) | | -| options | 表格配置 | [S2Options](/docs/api/general/s2-options) | | -| dataSet | 表格数据集 (字段,数据,排序) | [BaseDataSet](/docs/api/basic-class/base-data-set) | | -| facet | 当前可视渲染区域 | [BaseFacet](/docs/api/basic-class/base-facet) | | -| tooltip | 提示信息 | [BaseTooltip](/docs/api/basic-class/base-tooltip) | | +| themeName | 主题名 | [ThemeName](/api/general/s2-theme#themename) | | +| theme | 主题配置 | [S2Theme](/api/general/s2-theme) | | +| store | 存储的一些信息 | [Store](/api/basic-class/store) | | +| dataCfg | 数据配置 | [S2DataConfig](/api/general/s2-data-config) | | +| options | 表格配置 | [S2Options](/api/general/s2-options) | | +| dataSet | 表格数据集 (字段,数据,排序) | [BaseDataSet](/api/basic-class/base-data-set) | | +| facet | 当前可视渲染区域 | [BaseFacet](/api/basic-class/base-facet) | | +| tooltip | 提示信息 | [BaseTooltip](/api/basic-class/base-tooltip) | | | container | g-canvas 实例 | [Canvas](https://g.antv.antgroup.com/api/renderer/canvas) | | | interaction | 交互 | [Interaction](/zh/docs/api/basic-class/interaction) | | -| hd | 开启高清适配 | [HdAdapter](https://github.com/antvis/S2/blob/next/packages/s2-core/src/ui/hd-adapter/index.ts) | | -| on | 事件订阅 | (event: [S2Event](/docs/manual/advanced/interaction/basic), listener: () => void) => void | | -| emit | 事件发布 | (event: [S2Event](/docs/manual/advanced/interaction/basic), ...args: any[]) => void | | -| getDataSet | 获取数据集 | (options: [S2Options](/docs/api/general/s2-options)) => [BaseDataSet](/docs/api/basic-class/base-data-set) | | +| hdAdapter | 高清适配器 | [HdAdapter](https://github.com/antvis/S2/blob/next/packages/s2-core/src/ui/hd-adapter/index.ts) | | +| destroyed | 表格是否已销毁 | `boolean` | | +| on | 事件订阅 | (event: [S2Event](/manual/advanced/interaction/basic), listener: () => void) => void | | +| emit | 事件发布 | (event: [S2Event](/manual/advanced/interaction/basic), ...args: any[]) => void | | +| getDataSet | 获取数据集 | (options: [S2Options](/api/general/s2-options)) => [BaseDataSet](/api/basic-class/base-data-set) | | | isPivotMode | 是否是透视表 | `() => boolean` | | +| isCustomRowFields | 是否是自定义行头维值 | `() => boolean` | | +| isCustomColumnFields | 是否是自定义列头维值 | `() => boolean` | | +| isCustomHeaderFields | 是否是自定义表头维值 | `() => boolean` | | | isHierarchyTreeType | 是否是树状结构 | `() => boolean` | | | isFrozenRowHeader | 是否是冻结行头状态 | `() => boolean` | | | isTableMode | 是否是明细表 | `() => boolean` | | | isValueInCols | 是否是数值置于行头 | `() => boolean` | | | clearDrillDownData | 清除下钻数据 | (rowNodeId?: `string`) => `Promise` | | -| showTooltip | 显示 tooltip (别名 `tooltip.show` | (showOptions: [TooltipShowOptions](/docs/api/common/custom-tooltip)) => void | | -| showTooltipWithInfo | 显示 tooltip, 并且展示一些默认信息 | (event: [FederatedPointerEvent](https://g.antv.antgroup.com/api/event/event-object) \| MouseEvent, data: [TooltipData[]](/docs/api/common/custom-tooltip), options?: [TooltipOptions](/docs/api/common/custom-tooltip)) => void | +| showTooltip | 显示 tooltip (别名 `tooltip.show` | (showOptions: [TooltipShowOptions](/api/common/custom-tooltip)) => void | | +| showTooltipWithInfo | 显示 tooltip, 并且展示一些默认信息 | (event: [FederatedPointerEvent](https://g.antv.antgroup.com/api/event/event-object) \| MouseEvent, data: [TooltipData[]](/api/common/custom-tooltip), options?: [TooltipOptions](/api/common/custom-tooltip)) => void | | hideTooltip | 隐藏 tooltip (别名:`tooltip.hide` | `() => void` | | | destroyTooltip | 销毁 tooltip (别名 `tooltip.destroy` | `() => void` | | | registerIcons | 注册 自定义 svg 图标 (根据 `options.customSVGIcons` | `() => void` | | -| setDataCfg | 更新表格数据 | `(dataCfg: T extends true ?` [`S2DataConfig`](/docs/api/general/s2-data-config) `: Partial<`[`S2DataConfig`](/docs/api/general/s2-data-config)`>, reset?: T) => void` | `reset` 参数需在 `@antv/s2^1.34.0`版本使用 | -| setOptions | 更新表格配置 | (options: [S2Options](/docs/api/general/s2-options), reset?: boolean) => void | `reset` 参数需在 `@antv/s2^1.34.0`版本使用 | +| setDataCfg | 更新表格数据 | `(dataCfg: T extends true ?` [`S2DataConfig`](/api/general/s2-data-config) `: Partial<`[`S2DataConfig`](/api/general/s2-data-config)`>, reset?: T) => void` | `reset` 参数需在 `@antv/s2^1.34.0`版本使用 | +| setOptions | 更新表格配置 | (options: [S2Options](/api/general/s2-options), reset?: boolean) => void | `reset` 参数需在 `@antv/s2^1.34.0`版本使用 | | resetDataCfg | 重置表格数据 | () => void | | | resetOptions | 重置表格配置 | () => void | | -| render | 重新渲染表格,如果 `reloadData` = true, 则会重新计算数据,`rebuildDataSet` = true, 重新构建数据集,`reBuildHiddenColumnsDetail` = true 重新构建隐藏列信息 | `(reloadData?: boolean \| { reloadData?: boolean, rebuildDataSet?: boolean; reBuildHiddenColumnsDetail?: boolean }) => Promise` | | +| render | 重新渲染表格,如果 `reloadData` = true, 则会重新计算数据,`rebuildDataSet` = true, 重新构建数据集,`rebuildHiddenColumnsDetail` = true 重新构建隐藏列信息 | `(reloadData?: boolean \| { reloadData?: boolean, rebuildDataSet?: boolean; rebuildHiddenColumnsDetail?: boolean }) => Promise` | | | destroy | 销毁表格 | `() => void` | | -| setThemeCfg | 更新主题配置 (含主题 schema, 色板,主题名) | (themeCfg: [ThemeCfg](/docs/api/general/s2-theme/#themecfg)) => void | | -| setTheme | 更新主题 (只包含主题 scheme) | (theme: [S2Theme](/docs/api/general/s2-theme/#s2theme)) => void | | -| getTheme | 获取主题 (只包含主题 scheme) | ( ) => [S2Theme](/docs/api/general/s2-theme/#s2theme) | | -| getThemeName | 获取主题名 | ( ) => `default \| colorful \| gray \| dark` | | -| updatePagination | 更新分页 | (pagination: [Pagination](/docs/api/general/s2-options#pagination)) => void | | +| setThemeCfg | 更新主题配置 (含主题 schema, 色板,主题名) | (themeCfg: [ThemeCfg](/api/general/s2-theme/#themecfg)) => void | | +| setTheme | 更新主题 (只包含主题 scheme) | (theme: [S2Theme](/api/general/s2-theme/#s2theme)) => void | | +| getTheme | 获取主题 (只包含主题 scheme) | ( ) => [S2Theme](/api/general/s2-theme/#s2theme) | | +| getThemeName | 获取主题名 | () => [ThemeName](/api/general/s2-theme#themename) | | +| updatePagination | 更新分页 | (pagination: [Pagination](/api/general/s2-options#pagination)) => void | | | changeSheetSize | 修改表格画布大小,不用重新加载数据 | `(width?: number, height?: number) => void` | | | getLayoutWidthType | 获取单元格宽度布局类型(LayoutWidthType: `adaptive(自适应)` \| `colAdaptive(列自适应)` \| `compact(紧凑)`) | () => `LayoutWidthType`| | -| getCell | 根据 event.target 获取当前 单元格 | (target: [EventTarget](https://developer.mozilla.org/zh-CN/docs/Web/API/Event/target)) => [S2CellType](/docs/api/basic-class/base-cell#s2celltype) | | -| getCellType | 根据 event.target 获取当前 单元格类型 | (target: [EventTarget](https://developer.mozilla.org/zh-CN/docs/Web/API/Event/target)) => [CellType](/docs/api/basic-class/base-cell#celltypes) | | -| getTotalsConfig | 获取总计小计配置 | (dimension: string) => [Total](/docs/api/general/s2-options#totals) | | +| getCell | 根据 event.target 获取当前 单元格 | (target: [EventTarget](https://developer.mozilla.org/zh-CN/docs/Web/API/Event/target)) => [S2CellType](/api/basic-class/base-cell#s2celltype) | | +| getCellType | 根据 event.target 获取当前 单元格类型 | (target: [EventTarget](https://developer.mozilla.org/zh-CN/docs/Web/API/Event/target)) => [CellType](/api/basic-class/base-cell#celltypes) | | +| getTotalsConfig | 获取总计小计配置 | (dimension: string) => [Total](/api/general/s2-options#totals) | | | getCanvasElement | 获取表格对应的 `` HTML 元素 | () => [HTMLCanvasElement](https://developer.mozilla.org/zh-CN/docs/Web/API/HTMLCanvasElement) | | | getCanvas | 获取 G Canvas 实例 | () => [Canvas](https://g.antv.antgroup.com/api/renderer/canvas) | | | getCanvasConfig | 获取 G Canvas 配置 | () => Partial<[CanvasConfig](https://g.antv.antgroup.com/api/canvas/options)> | | | updateSortMethodMap | 更新存储在 store 中的节点排序方式 map, replace 为是否覆盖上一次的值 | (nodeId: string, sortMethod: string, replace?: boolean) => void | | | getMenuDefaultSelectedKeys | 获取 tooltip 中选中的菜单项 key 值 | `(nodeId: string) => string[]` | | -| measureText | 获取文本在画布中的测量信息 | (text: `string`, font: [TextTheme](/docs/api/general/s2-theme#texttheme)) => [TextMetrics](https://developer.mozilla.org/zh-CN/docs/Web/API/TextMetrics) \| `null` | | -| measureTextWidth | 获取文本在画布中的测量宽度 | (text: `string`, font: [TextTheme](/docs/api/general/s2-theme#texttheme)) => `number` \| `null` | | -| measureTextHeight | 获取文本在画布中的测量高度 | (text:`string`, font: [TextTheme](/docs/api/general/s2-theme#texttheme)) => `number` \| `null` | | -| groupSortByMethod | 组内排序(透视表有效) | (sortMethod: `'asc' \| 'desc'`, meta: [Node](/docs/api/basic-class/node)) => `Promise \| void` | | +| measureText | 获取文本在画布中的测量信息 | (text: `string`, font: [TextTheme](/api/general/s2-theme#texttheme)) => [TextMetrics](https://developer.mozilla.org/zh-CN/docs/Web/API/TextMetrics) \| `null` | | +| measureTextWidth | 获取文本在画布中的测量宽度 | (text: `string`, font: [TextTheme](/api/general/s2-theme#texttheme)) => `number` \| `null` | | +| measureTextHeight | 获取文本在画布中的测量高度 | (text:`string`, font: [TextTheme](/api/general/s2-theme#texttheme)) => `number` \| `null` | | +| groupSortByMethod | 组内排序(透视表有效) | (sortMethod: `'asc' \| 'desc'`, meta: [Node](/api/basic-class/node)) => `Promise \| void` | | | getSeriesNumberText | 获取序号文本(根据 `s2Options.series.text` 配置,默认 "序号") | () => string | | ### S2MountContainer @@ -109,7 +113,7 @@ export enum CellType { ### BBox -功能描述:盒模型。[详情](/docs/api/basic-class/base-bbox) +功能描述:盒模型。[详情](/api/basic-class/base-bbox) ```ts type BBox = { diff --git a/s2-site/docs/api/basic-class/store.zh.md b/s2-site/docs/api/basic-class/store.zh.md index 19c8a4f3a8..bd2783895c 100644 --- a/s2-site/docs/api/basic-class/store.zh.md +++ b/s2-site/docs/api/basic-class/store.zh.md @@ -15,17 +15,17 @@ s2.store.set('key', value) // 存储 | scrollX | 水平滚动偏移 | `number` | | scrollY | 垂直滚动偏移 | `number` | | rowHeaderScrollX | 行头水平滚动偏移 | `number` | -| sortParam | 列头排序配置 | [SortParam](/docs/api/components/sheet-component/#sortparams) | +| sortParam | 列头排序配置 | [SortParam](/api/components/sheet-component/#sortparams) | | drillDownIdPathMap | 下钻节点 id 和对应生成的 path 寻址路径 | `Map` | -| drillDownNode | 当前下钻节点 | [Node](/docs/api/basic-class/node) | +| drillDownNode | 当前下钻节点 | [Node](/api/basic-class/node) | | drillItemsNum | 下钻数据的个数控制 | `number` | | interactionStateInfo | 当前交互状态信息 | `number` | | drillDownFieldInLevel | 下钻节点层级信息 | [PartDrillDownInfo[]](#partdrilldowninfo) | -| originalDataCfg | 原始数据配置 | [S2DataConfig](/docs/api/general/s2-data-config)| -| panelBBox | 可视区域包裹盒模型 | [BBox](/docs/api/basic-class/base-bbox) | +| originalDataCfg | 原始数据配置 | [S2DataConfig](/api/general/s2-data-config)| +| panelBBox | 可视区域包裹盒模型 | [BBox](/api/basic-class/base-bbox) | | activeResizeArea | 当前调整大小区域 group | [Group](https://g.antv.antgroup.com/api/basic/group) | | valueRanges | 条件格式值区间 | [ValueRanges](#valueranges) | -| initColLeafNodes | 初次渲染时的列头叶子节点 | [Node[]](/docs/api/basic-class/node)| +| initColLeafNodes | 初次渲染时的列头叶子节点 | [Node[]](/api/basic-class/node)| | hiddenColumnsDetail | 隐藏的列头详情 | [HiddenColumnsInfo[]](#hiddencolumnsinfo) | | lastRenderedColumnFields | 上一次渲染的列头配置 | `string[]` | | resized | 是否手动调整过宽高 | `boolean` | diff --git a/s2-site/docs/api/components/advanced-sort.zh.md b/s2-site/docs/api/components/advanced-sort.zh.md index 5dd804b17e..324f26d733 100644 --- a/s2-site/docs/api/components/advanced-sort.zh.md +++ b/s2-site/docs/api/components/advanced-sort.zh.md @@ -19,16 +19,16 @@ import '@antv/s2-react-components/dist/s2-react-components.min.css' | 参数 | 说明 | 类型 | 必选 | 默认值 | | -- | -- | -- | -- | -- | -| sheetInstance | 表格实例 | [SpreadSheet](/docs/api/basic-class/spreadsheet) | ✓ | | +| sheetInstance | 表格实例 | [SpreadSheet](/api/basic-class/spreadsheet) | ✓ | | | className | class 类名称 | `string` | | | | icon | 排序按钮图标 | `React.ReactNode` | | | | text | 排序按钮名称 | `string` | | | | ruleText | 规则描述 | `string` | | | | dimensions | 可选字段列表 | [Dimension](#dimension)[] | | | | ruleOptions | 规则配置列表 | [RuleOption](#ruleoption)[] | | | -| sortParams | 默认已有 sort 规则 | [SortParams](/docs/api/general/s2-data-config#sortparams) | | | +| sortParams | 默认已有 sort 规则 | [SortParams](/api/general/s2-data-config#sortparams) | | | | onSortOpen | 打开排序弹窗的回调 | `() => void` | | | -| onSortConfirm | 关闭弹窗后处理排序结果的回调 | `(ruleValues:`[RuleValue](#rulevalue)[]`, sortParams:`[SortParams](/docs/api/general/s2-data-config#sortparams)`) => void` | | | +| onSortConfirm | 关闭弹窗后处理排序结果的回调 | `(ruleValues:`[RuleValue](#rulevalue)[]`, sortParams:`[SortParams](/api/general/s2-data-config#sortparams)`) => void` | | | ### AdvancedSortCfgProps @@ -42,9 +42,9 @@ import '@antv/s2-react-components/dist/s2-react-components.min.css' | ruleText | 规则描述 | `string` | | | | dimensions | 可选字段列表 | [Dimension](#dimension)[] | | | | ruleOptions | 规则配置列表 | [RuleOption](#ruleoption)[] | | | -| sortParams | 默认已有 sort 规则 | [SortParams](/docs/api/general/s2-data-config#sortparams) | | | +| sortParams | 默认已有 sort 规则 | [SortParams](/api/general/s2-data-config#sortparams) | | | | onSortOpen | 打开排序弹窗的回调 | `() => void` | | | -| onSortConfirm | 关闭弹窗后处理排序结果的回调 | `(ruleValues:`[RuleValue](#rulevalue)[]`, sortParams:`[SortParams](/docs/api/general/s2-data-config#sortparams)`) => void` | | | +| onSortConfirm | 关闭弹窗后处理排序结果的回调 | `(ruleValues:`[RuleValue](#rulevalue)[]`, sortParams:`[SortParams](/api/general/s2-data-config#sortparams)`) => void` | | | ### Dimension diff --git a/s2-site/docs/api/components/sheet-component.zh.md b/s2-site/docs/api/components/sheet-component.zh.md index 564d3ae0dc..c229b26dd4 100644 --- a/s2-site/docs/api/components/sheet-component.zh.md +++ b/s2-site/docs/api/components/sheet-component.zh.md @@ -22,14 +22,14 @@ import '@antv/s2-react/dist/s2-react.min.css'; | 参数 | 说明 | 类型 | 默认值 | 必选 | | -- | -- | -- | -- | --- | | sheetType | 表格类型:
1. `pivot`: 透视表
2. `table`: 明细表
3. `gridAnalysis`: 网格分析表
4. `strategy`: 趋势分析表 | `pivot \| table \| gridAnalysis \| strategy` | `pivot` | | -| spreadsheet | 自定义表 | (container: `HTMLElement \| string`, dataCfg: [S2DataConfig](/docs/api/general/s2-data-config), options: [SheetComponentOptions](#sheetcomponentoptions)) => [SpreadSheet](/docs/api/basic-class/spreadsheet) | | | -| dataCfg | 透视表数据映射相关配置项 | [S2DataConfig](/docs/api/general/s2-data-config) | | ✓ | +| spreadsheet | 自定义表 | (container: `HTMLElement \| string`, dataCfg: [S2DataConfig](/api/general/s2-data-config), options: [SheetComponentOptions](#sheetcomponentoptions)) => [SpreadSheet](/api/basic-class/spreadsheet) | | | +| dataCfg | 透视表数据映射相关配置项 | [S2DataConfig](/api/general/s2-data-config) | | ✓ | | options | 透视表属性配置项 | [SheetComponentOptions](#sheetcomponentoptions) | | ✓ | -| partDrillDown | 维度下钻相关属性 | [PartDrillDown](/docs/api/components/drill-down) | | | +| partDrillDown | 维度下钻相关属性 | [PartDrillDown](/api/components/drill-down) | | | | adaptive | 是否根据窗口大小自适应 | `boolean \| { width?: boolean, height?: boolean, getContainer: () => HTMLElement }` | `false` | | -| themeCfg | 自定义透视表主题样式 | [ThemeCfg](/docs/api/general/s2-theme) | | | +| themeCfg | 自定义透视表主题样式 | [ThemeCfg](/api/general/s2-theme) | | | | loading | 控制表格的加载状态 | `boolean` | | | -| header | 表头配置项 | [HeaderCfgProps](/docs/api/components/header) | | | +| header | 表头配置项 | [HeaderCfgProps](/api/components/header) | | | | onRangeSort | 组内排序时触发回调事件 | (params: [SortParam[]](#sortparam) ) => void; | | | | onRowCellHover | 行头鼠标悬停事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onRowCellClick | 行头鼠标单击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | @@ -38,11 +38,11 @@ import '@antv/s2-react/dist/s2-react.min.css'; | onRowCellMouseDown | 行头鼠标按下事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onRowCellMouseUp | 行头鼠标放开事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onRowCellMouseMove | 行头鼠标移动事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | -| onRowCellCollapsed | 节点展开/收起事件回调 | ({ isCollapsed: `boolean`, collapseFields: `Record`, node: [Node](/docs/api/basic-class/node) }) => void; | | | +| onRowCellCollapsed | 节点展开/收起事件回调 | ({ isCollapsed: `boolean`, collapseFields: `Record`, node: [Node](/api/basic-class/node) }) => void; | | | | onRowCellAllCollapsed | 节点全部展开/收起的事件回调 | (isCollapsed: boolean ) => void; | | | | onRowCellScroll | 行头单元格滚动事件 | ({position: [CellScrollPosition](#cellscrollposition)} ) => void; | | | -| onRowCellRender | 行头单元格渲染事件 | ( cell: [Cell](/docs/api/basic-class/base-cell) ) => void | | | -| onRowCellSelected | 行头单元格选中事件 | ( cells: [Cell](/docs/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | +| onRowCellRender | 行头单元格渲染事件 | ( cell: [Cell](/api/basic-class/base-cell) ) => void | | | +| onRowCellSelected | 行头单元格选中事件 | ( cells: [Cell](/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | | onColCellHover | 列头鼠标悬停事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onColCellClick | 列头鼠标单击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onColCellDoubleClick | 列头鼠标双击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | @@ -50,10 +50,10 @@ import '@antv/s2-react/dist/s2-react.min.css'; | onColCellMouseDown | 列头鼠标按下事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onColCellMouseUp | 列头鼠标松开事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onColCellMouseMove | 列头鼠标移动事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | -| onColCellExpanded | 开启隐藏列头(tooltip.operation.hiddenColumns = true)后,列头展开的事件回调 | (expandedNode: [Node](/docs/api/basic-class/node)) => void; | | | +| onColCellExpanded | 开启隐藏列头(tooltip.operation.hiddenColumns = true)后,列头展开的事件回调 | (expandedNode: [Node](/api/basic-class/node)) => void; | | | | onColCellHidden | 开启隐藏列头(tooltip.operation.hiddenColumns = true)后,列头隐藏的事件回调 | ( data: { currentHiddenColumnsInfo:[HiddenColumnsInfo](#hiddencolumnsinfo); hiddenColumnsDetail:[HiddenColumnsInfo](#hiddencolumnsinfo)[]} ) => void; | | | -| onColCellRender | 列头单元格渲染事件 | ( cell: [Cell](/docs/api/basic-class/base-cell) ) => void | | | -| onColCellSelected | 列头单元格选中事件 | ( cells: [Cell](/docs/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | +| onColCellRender | 列头单元格渲染事件 | ( cell: [Cell](/api/basic-class/base-cell) ) => void | | | +| onColCellSelected | 列头单元格选中事件 | ( cells: [Cell](/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | | onDataCellHover | 数值单元格鼠标悬停事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onDataCellClick | 数值单元格鼠标点击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onDataCellDoubleClick | 数值单元格双击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | @@ -61,12 +61,12 @@ import '@antv/s2-react/dist/s2-react.min.css'; | onDataCellMouseDown | 数值单元格鼠标按下事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onDataCellMouseUp | 数值单元格鼠标松开事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onDataCellMouseMove | 数值单元格鼠标移动事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | -| onDataCellBrushSelection | 数值单元格刷选事件 | ( dataCells: [DataCell](/docs/api/basic-class/base-cell)[] ) => void | | | +| onDataCellBrushSelection | 数值单元格刷选事件 | ( dataCells: [DataCell](/api/basic-class/base-cell)[] ) => void | | | | onDataCellSelectMove | 数值单元格键盘方向键移动事件 | (metas: CellMeta[]) => void | | | -| onDataCellEditStart | 数值单元格编辑开始(暂只支持编辑表) | (meta: [ViewMeta](/docs/api/basic-class/node), cell: [S2CellType](/docs/api/basic-class/base-cell)) => void | | | -| onDataCellEditEnd | 数值单元格编辑完成(暂只支持编辑表) | (meta: [ViewMeta](/docs/api/basic-class/node), cell: [S2CellType](/docs/api/basic-class/base-cell)) => void | | | -| onDataCellRender | 数值单元格渲染事件 | ( cell: [Cell](/docs/api/basic-class/base-cell) ) => void | | | -| onDataCellSelected | 数值单元格选中事件 | ( cells: [Cell](/docs/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | +| onDataCellEditStart | 数值单元格编辑开始(暂只支持编辑表) | (meta: [ViewMeta](/api/basic-class/node), cell: [S2CellType](/api/basic-class/base-cell)) => void | | | +| onDataCellEditEnd | 数值单元格编辑完成(暂只支持编辑表) | (meta: [ViewMeta](/api/basic-class/node), cell: [S2CellType](/api/basic-class/base-cell)) => void | | | +| onDataCellRender | 数值单元格渲染事件 | ( cell: [Cell](/api/basic-class/base-cell) ) => void | | | +| onDataCellSelected | 数值单元格选中事件 | ( cells: [Cell](/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | | onCornerCellHover | 角头鼠标悬停事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onCornerCellClick | 角头鼠标单击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onCornerCellDoubleClick | 角头鼠标双击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | @@ -74,8 +74,8 @@ import '@antv/s2-react/dist/s2-react.min.css'; | onCornerCellMouseUp | 角头鼠标按下事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onCornerCellMouseUp | 角头鼠标松开事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onCornerCellMouseMove | 角头鼠标移动事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | -| onCornerCellRender | 角头单元格渲染事件 | ( cell: [Cell](/docs/api/basic-class/base-cell) ) => void | | | -| onCornerCellSelected | 角头单元格选中事件 | ( cells: [Cell](/docs/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | +| onCornerCellRender | 角头单元格渲染事件 | ( cell: [Cell](/api/basic-class/base-cell) ) => void | | | +| onCornerCellSelected | 角头单元格选中事件 | ( cells: [Cell](/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | | onMergedCellsHover | 合并单元格鼠标悬停事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onMergedCellsClick | 合并单元格鼠标点击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onMergedCellsDoubleClick | 合并单元格鼠标双击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | @@ -83,20 +83,20 @@ import '@antv/s2-react/dist/s2-react.min.css'; | onMergedCellsMouseDown | 合并单元格按下事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onMergedCellsMouseUp | 合并单元格松开事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | onMergedCellsMouseMove | 合并单元格移动事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | -| onMergedCellsRender | 合并单元格渲染事件 | ( cell: [Cell](/docs/api/basic-class/base-cell) ) => void | | | -| onSeriesNumberCellRender | 序号单元格渲染事件 | ( cell: [Cell](/docs/api/basic-class/base-cell) ) => void | | | +| onMergedCellsRender | 合并单元格渲染事件 | ( cell: [Cell](/api/basic-class/base-cell) ) => void | | | +| onSeriesNumberCellRender | 序号单元格渲染事件 | ( cell: [Cell](/api/basic-class/base-cell) ) => void | | | | onRangeSort | 组内排序时触发回调事件(暂只支持透视表) | (params: [SortParam[]](#sortparam) ) => void; | | | | onRangeSorted | 组内排序结束触发回调事件(暂只支持透视表) | (event: [FederatedPointerEvent](https://g.antv.antgroup.com/api/event/event-object) ) => void; | | | | onRangeFilter | 筛选时触发回调事件 | (data: { filterKey: string; filteredValues: string[] } ) => void; | | | | onRangeFiltered | 筛选结束触发回调事件 | (data: DataType[] ) => void; | | | -| onLayoutCellRender | 单个单元格布局渲染完成事件 | cell: [S2CellType](/docs/api/basic-class/base-cell) | | | +| onLayoutCellRender | 单个单元格布局渲染完成事件 | cell: [S2CellType](/api/basic-class/base-cell) | | | | onLayoutAfterHeaderLayout | 表头布局结构准备完成事件 | (layoutResult: [LayoutResult](/zh/docs/api/general/s2-options/#layoutresult) ) => void; | | | | onLayoutPagination | 分页事件 | ({ pageSize: number; pageCount: number; total: number; current: number;} ) => void; | | | | onLayoutCellScroll | 单元格滚动事件 (**已废弃,请使用 `onScroll` 代替**) | ({position: [CellScrollPosition](#cellscrollposition)} ) => void; | | | -| onLayoutAfterCollapseRows | 树状模式下收起行头后的事件回调 | ({ collapseFields: `Record`, meta: [Node](/docs/api/basic-class/node) }) => void; | | | +| onLayoutAfterCollapseRows | 树状模式下收起行头后的事件回调 | ({ collapseFields: `Record`, meta: [Node](/api/basic-class/node) }) => void; | | | | onBeforeRender | 开始 render 前的事件 | () => void; | | | | onAfterRender | render 完成的事件 | () => void; | | | -| onMounted | 组件层表格挂载完成事件,可拿到表实例 [详情](/docs/manual/advanced/get-instance) | (spreadsheet: [SpreadSheet](/docs/api/basic-class/spreadsheet)) => void; | | | +| onMounted | 组件层表格挂载完成事件,可拿到表实例 [详情](/manual/advanced/get-instance) | (spreadsheet: [SpreadSheet](/api/basic-class/spreadsheet)) => void; | | | | onUpdate | 组件层表格更新事件,当 `数据 (S2DataConfig)` 或 `配置 (S2Options)` 更新时触发,可手动控制更新时的 [渲染模式](#s2renderoptions) | (renderOptions: [S2RenderOptions](#s2renderoptions)) => [S2RenderOptions](#s2renderoptions) \| void | | | | onUpdateAfterRender | 组件层表格更新事件,当 `数据 (S2DataConfig)` 或 `配置 (S2Options)` 更新时,并且在重渲染 `s2.render()` 完成后触发 | (renderOptions: [S2RenderOptions](#s2renderoptions)) => void | | | | onLoading | 组件层加载状态变更事件 | (loading: boolean) => void | | | @@ -119,18 +119,18 @@ import '@antv/s2-react/dist/s2-react.min.css'; | onContextMenu | 右键单元格单击事件 ([禁用右键菜单不生效?](/manual/faq#%E7%A6%81%E7%94%A8%E5%8F%B3%E9%94%AE%E8%8F%9C%E5%8D%95%E4%B8%8D%E7%94%9F%E6%95%88)) | (event: [FederatedPointerEvent](https://g.antv.antgroup.com/api/event/event-object)) => void | | | | onMouseHover | 表格鼠标悬停事件 | (event: [FederatedPointerEvent](https://g.antv.antgroup.com/api/event/event-object)) => void | | | | onMouseUp | 表格鼠标松开事件 | (event: [FederatedPointerEvent](https://g.antv.antgroup.com/api/event/event-object)) => void | | | -| onSelected | 单元格选中事件 | (cells: [Cell](/docs/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | +| onSelected | 单元格选中事件 | (cells: [Cell](/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | | onReset | 交互状态重置事件 | (event: KeyboardEvent) => void | | | -| onLinkFieldJump | 链接字段跳转事件 | (data: { field: string; meta: [Node](/docs/api/basic-class/node) \| [ViewMeta](#viewmeta); record: [Data](/docs/api/general/s2-data-config#data) }) => void | | | +| onLinkFieldJump | 链接字段跳转事件 | (data: { field: string; meta: [Node](/api/basic-class/node) \| [ViewMeta](#viewmeta); record: [Data](/api/general/s2-data-config#data) }) => void | | | | onScroll | 单元格滚动事件 (含行头和数值单元格) | ({position: [CellScrollPosition](#cellscrollposition)} ) => void | | | -| onColCellBrushSelection | 批量选中刷选范围内的列头单元格,刷选过程中,显示刷选范围提示蒙层,刷选完成后,弹出 tooltip, 展示被刷选单元格信息 | (cells: [ColCell](/docs/api/basic-class/base-cell)[]) => void; | | | -| onRowCellBrushSelection | 批量选中刷选范围内的行头单元格,刷选过程中,显示刷选范围提示蒙层,刷选完成后,弹出 tooltip, 展示被刷选单元格信息(仅支持透视表) | (cells: [RowCell](/docs/api/basic-class/base-cell)[]) => void; | | | +| onColCellBrushSelection | 批量选中刷选范围内的列头单元格,刷选过程中,显示刷选范围提示蒙层,刷选完成后,弹出 tooltip, 展示被刷选单元格信息 | (cells: [ColCell](/api/basic-class/base-cell)[]) => void; | | | +| onRowCellBrushSelection | 批量选中刷选范围内的行头单元格,刷选过程中,显示刷选范围提示蒙层,刷选完成后,弹出 tooltip, 展示被刷选单元格信息(仅支持透视表) | (cells: [RowCell](/api/basic-class/base-cell)[]) => void; | | | ### SheetComponentOptions :::warning{title="注意"} -`@antv/s2-react` 组件的 `options` 继承于 [S2Options](/docs/api/general/s2-options) , 有两点不同: +`@antv/s2-react` 组件的 `options` 继承于 [S2Options](/api/general/s2-options) , 有两点不同: - 类型由 `S2Options` 变更为 `SheetComponentOptions`. - tooltip 的 content 从 `Element | string` 变为了 `ReactNode`, 即可以是任意的 `jsx` 元素。 @@ -156,11 +156,11 @@ type SheetComponentOptions = S2Options | 参数 | 说明 | 类型 | 默认值 | 必选 | | -- | -- | -- | -- | --- | | sheetType | 表格类型:
1. `pivot`: 透视表
2. `table`: 明细表 | `pivot \| table` | `pivot` | | -| dataCfg | 透视表数据映射配置项 | [S2DataConfig](/docs/api/general/s2-data-config) | | ✓ | +| dataCfg | 透视表数据映射配置项 | [S2DataConfig](/api/general/s2-data-config) | | ✓ | | options | 透视表属性配置项 | [SheetComponentOptions](#sheetcomponentoptions-1) | | ✓ | | adaptive | 是否根据窗口大小自适应 | `boolean \| { width?: boolean, height?: boolean, getContainer: () => HTMLElement }` | `false` | | | showPagination | 是否显示默认分页
(只有在 `options` 配置过 `pagination` 属性才会生效) | `boolean` \| \{
onShowSizeChange?: (pageSize: number) => void,
onChange?: (current: number) => void
} | `false` | | -| themeCfg | 自定义表格主题样式 | [ThemeCfg](/docs/api/general/s2-theme) | | | +| themeCfg | 自定义表格主题样式 | [ThemeCfg](/api/general/s2-theme) | | | | loading | 控制表格的加载状态 | `boolean` | | | ### events @@ -169,7 +169,7 @@ type SheetComponentOptions = S2Options | 参数 | 说明 | 类型 | 默认值 | 必选 | | -- | -- | -- | -- | --- | -| spreadsheet | 自定义表 | (container: `HTMLElement \| string`, dataCfg: [S2DataConfig](/docs/api/general/s2-data-config), options: [SheetComponentOptions](#sheetcomponentoptions-1)) => [SpreadSheet](/docs/api/basic-class/spreadsheet) | | | +| spreadsheet | 自定义表 | (container: `HTMLElement \| string`, dataCfg: [S2DataConfig](/api/general/s2-data-config), options: [SheetComponentOptions](#sheetcomponentoptions-1)) => [SpreadSheet](/api/basic-class/spreadsheet) | | | | rangeSort | 组内排序时触发回调事件 | (params: [SortParam[]](#sortparam) ) => void; | | | | rowCellClick | 行头鼠标单击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | rowCellHover | 行头鼠标悬停事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | @@ -179,12 +179,12 @@ type SheetComponentOptions = S2Options | rowCellMouseDown | 行头鼠标按下事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | rowCellMouseUp | 行头鼠标放开事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | rowCellMouseMove | 行头鼠标移动事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | -| rowCellCollapseTreeRows | 树状结构下点击行头收起展开按钮 | (params: { id: `number`; isCollapsed: `boolean`; node: [Node](/docs/api/basic-class/node) }) => void | | | +| rowCellCollapseTreeRows | 树状结构下点击行头收起展开按钮 | (params: { id: `number`; isCollapsed: `boolean`; node: [Node](/api/basic-class/node) }) => void | | | | rowCellScroll | 行头单元格滚动事件 | ({position: [CellScrollPosition](#cellscrollposition)} ) => void; | | | -| rowCellCollapsed | 节点展开/收起事件回调 | ({ isCollapsed: `boolean`, collapseFields: `Record`, node: [Node](/docs/api/basic-class/node) }) => void; | | | +| rowCellCollapsed | 节点展开/收起事件回调 | ({ isCollapsed: `boolean`, collapseFields: `Record`, node: [Node](/api/basic-class/node) }) => void; | | | | rowCellAllCollapsed | 节点全部展开/收起的事件回调 | (isCollapsed: boolean ) => void; | | | -| rowCellRender | 行头单元格渲染事件 | ( cell: [Cell](/docs/api/basic-class/base-cell) ) => void | | | -| rowCellSelected | 行头单元格选中事件 | ( cells: [Cell](/docs/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | +| rowCellRender | 行头单元格渲染事件 | ( cell: [Cell](/api/basic-class/base-cell) ) => void | | | +| rowCellSelected | 行头单元格选中事件 | ( cells: [Cell](/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | | colCellHover | 列头鼠标悬停事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | colCellClick | 列头鼠标单击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | colCellDoubleClick | 列头鼠标双击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | @@ -192,10 +192,10 @@ type SheetComponentOptions = S2Options | colCellMouseDown | 列头鼠标按下事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | colCellMouseUp | 列头鼠标松开事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | colCellMouseMove | 列头鼠标移动事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | -| colCellExpanded | 开启隐藏列头(tooltip.operation.hiddenColumns = true)后,列头展开的事件回调 | (expandedNode: [Node](/docs/api/basic-class/node)) => void | | | +| colCellExpanded | 开启隐藏列头(tooltip.operation.hiddenColumns = true)后,列头展开的事件回调 | (expandedNode: [Node](/api/basic-class/node)) => void | | | | colCellHidden | 开启隐藏列头(tooltip.operation.hiddenColumns = true)后,列头隐藏的事件回调 | (data: { currentHiddenColumnsInfo:[HiddenColumnsInfo](#hiddencolumnsinfo); hiddenColumnsDetail:[HiddenColumnsInfo](#hiddencolumnsinfo)[] } ) => void; | | | -| colCellRender | 列头单元格渲染事件 | ( cell: [Cell](/docs/api/basic-class/base-cell) ) => void | | | -| colCellSelected | 列头单元格选中事件 | ( cells: [Cell](/docs/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | +| colCellRender | 列头单元格渲染事件 | ( cell: [Cell](/api/basic-class/base-cell) ) => void | | | +| colCellSelected | 列头单元格选中事件 | ( cells: [Cell](/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | | dataCellHover | 数值单元格鼠标悬停事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | dataCellClick | 数值单元格鼠标点击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | dataCellDoubleClick | 数值单元格双击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | @@ -203,9 +203,9 @@ type SheetComponentOptions = S2Options | dataCellMouseDown | 数值单元格鼠标按下事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | dataCellMouseUp | 数值单元格鼠标松开事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | dataCellMouseMove | 数值单元格鼠标移动事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | -| dataCellBrushSelection | 数值单元格刷选事件 | (brushRangeDataCells: [DataCell](/docs/api/basic-class/base-cell)[] ) => void | | | +| dataCellBrushSelection | 数值单元格刷选事件 | (brushRangeDataCells: [DataCell](/api/basic-class/base-cell)[] ) => void | | | | dataCellScroll | 数值单元格滚动事件 | ({position: [CellScrollPosition](#cellscrollposition)} ) => void; | | | -| dataCellSelected | 数值单元格选中事件 | ( cells: [Cell](/docs/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | +| dataCellSelected | 数值单元格选中事件 | ( cells: [Cell](/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | | cornerCellHover | 角头鼠标悬停事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | cornerCellClick | 角头鼠标单击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | cornerCellDoubleClick | 角头鼠标双击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | @@ -213,8 +213,8 @@ type SheetComponentOptions = S2Options | cornerCellMouseUp | 角头鼠标按下事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | cornerCellMouseUp | 角头鼠标松开事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | cornerCellMouseMove | 角头鼠标移动事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | -| cornerCellRender | 角头单元格渲染事件 | ( cell: [Cell](/docs/api/basic-class/base-cell) ) => void | | | -| cornerCellSelected | 角头单元格选中事件 | ( cells: [Cell](/docs/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | +| cornerCellRender | 角头单元格渲染事件 | ( cell: [Cell](/api/basic-class/base-cell) ) => void | | | +| cornerCellSelected | 角头单元格选中事件 | ( cells: [Cell](/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | | mergedCellsHover | 合并单元格鼠标悬停事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | mergedCellsClick | 合并单元格鼠标点击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | mergedCellsDoubleClick | 合并单元格鼠标双击事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | @@ -222,18 +222,18 @@ type SheetComponentOptions = S2Options | mergedCellsMouseDown | 合并单元格按下事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | mergedCellsMouseUp | 合并单元格松开事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | | mergedCellsMouseMove | 合并单元格移动事件 | (data: [TargetCellInfo](#targetcellinfo)) => void | | | -| mergedCellsRender | 合并单元格渲染事件 | ( cell: [Cell](/docs/api/basic-class/base-cell) ) => void | | | -| seriesNumberCellRender | 序号单元格渲染事件 | ( cell: [Cell](/docs/api/basic-class/base-cell) ) => void | | | +| mergedCellsRender | 合并单元格渲染事件 | ( cell: [Cell](/api/basic-class/base-cell) ) => void | | | +| seriesNumberCellRender | 序号单元格渲染事件 | ( cell: [Cell](/api/basic-class/base-cell) ) => void | | | | rangeSort | 组内排序时触发回调事件(暂只支持透视表) | (params: [SortParam[]](#sortparam) ) => void; | | | | rangeSorted | 组内排序结束触发回调事件(暂只支持透视表) | (event: [FederatedPointerEvent](https://g.antv.antgroup.com/api/event/event-object) ) => void; | | | | rangeFilter | 筛选时触发回调事件 | (data: { filterKey: string; filteredValues: string[] } ) => void; | | | | rangeFiltered | 筛选结束触发回调事件 | (data: DataType[] ) => void; | | | -| layoutAfterHeaderLayout | 表头布局结构准备完成事件 | (layoutResult: [LayoutResult](/docs/api/general/s2-options/#layoutresult) ) => void; | | | +| layoutAfterHeaderLayout | 表头布局结构准备完成事件 | (layoutResult: [LayoutResult](/api/general/s2-options/#layoutresult) ) => void; | | | | layoutPagination | 分页事件 | ({ pageSize: number; pageCount: number; total: number; current: number;} ) => void; | | | | layoutCellScroll | 单元格滚动事件 (**已废弃,请使用 `onScroll` 代替**) | ({position: [CellScrollPosition](#cellscrollposition)} ) => void; | | | | beforeRender | 开始 render 前的事件 | () => void; | | | | afterRender | render 完成的事件 | () => void; | | | -| mounted | 表格加载完成事件,可拿到表实例 [详情](/docs/manual/advanced/get-instance) | (spreadsheet: [SpreadSheet](/docs/api/basic-class/spreadsheet)) => void; | | | +| mounted | 表格加载完成事件,可拿到表实例 [详情](/manual/advanced/get-instance) | (spreadsheet: [SpreadSheet](/api/basic-class/spreadsheet)) => void; | | | | update | 组件层表格更新事件,当 `数据 (S2DataConfig)` 或 `配置 (S2Options)` 更新时触发,可手动控制更新时的 [渲染模式](#s2renderoptions) | (renderOptions: [S2RenderOptions](#s2renderoptions)) => [S2RenderOptions](#s2renderoptions) \| void | | | | updateAfterRender | 组件层表格更新事件,当 `数据 (S2DataConfig)` 或 `配置 (S2Options)` 更新时,并且在重渲染 `s2.render()` 完成后触发 | (renderOptions: [S2RenderOptions](#s2renderoptions)) => void | | | | destroy | 表格销毁事件 | () => void; | | | @@ -255,9 +255,9 @@ type SheetComponentOptions = S2Options | contextMenu | 右键单元格单击事件 ([禁用右键菜单不生效?](/manual/faq#%E7%A6%81%E7%94%A8%E5%8F%B3%E9%94%AE%E8%8F%9C%E5%8D%95%E4%B8%8D%E7%94%9F%E6%95%88)) | (event: [FederatedPointerEvent](https://g.antv.antgroup.com/api/event/event-object)) => void | | | | mouseHover | 表格鼠标悬停事件 | (event: [FederatedPointerEvent](https://g.antv.antgroup.com/api/event/event-object)) => void | | | | mouseUp | 表格鼠标松开事件 | (event: [FederatedPointerEvent](https://g.antv.antgroup.com/api/event/event-object)) => void | | | -| selected | 单元格选中事件 | (cells: [Cell](/docs/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | +| selected | 单元格选中事件 | (cells: [Cell](/api/basic-class/base-cell)[], detail: [CellSelectedDetail](#cellselecteddetail) ) => void | | | | reset | 交互状态重置事件 | (event: KeyboardEvent) => void | | | -| linkFieldJump | 链接字段跳转事件 | (data: { field: string; meta: [Node](/docs/api/basic-class/node) \| [ViewMeta](#viewmeta); record: [Data](/docs/api/general/s2-data-config#data) }) => void | | | +| linkFieldJump | 链接字段跳转事件 | (data: { field: string; meta: [Node](/api/basic-class/node) \| [ViewMeta](#viewmeta); record: [Data](/api/general/s2-data-config#data) }) => void | | | | scroll | 单元格滚动事件 (含行头和数值单元格) | ({position: [CellScrollPosition](#cellscrollposition)} ) => void; | | | | colCellBrushSelection | 批量选中刷选范围内的列头单元格,刷选过程中,显示刷选范围提示蒙层,刷选完成后,弹出 tooltip, 展示被刷选单元格信息 | (cells: ColCell[]) => void; | | | | rowCellBrushSelection | 批量选中刷选范围内的行头单元格,刷选过程中,显示刷选范围提示蒙层,刷选完成后,弹出 tooltip, 展示被刷选单元格信息(仅支持透视表) | (cells: RowCell[]) => void; | | | @@ -266,7 +266,7 @@ type SheetComponentOptions = S2Options :::warning{title="注意"} -`@antv/s2-vue` 组件 的 `options` 继承于 [S2Options](/docs/api/general/s2-options) , 有两点不同: +`@antv/s2-vue` 组件 的 `options` 继承于 [S2Options](/api/general/s2-options) , 有两点不同: - 类型由 `S2Options` 变更为 `SheetComponentOptions`. - 分页配置从 S2 的分页配置 **变为了 `antd-design-vue` 的分页配置**,即支持对 `antd-vue` 分页组件 的 api 透传。 @@ -297,9 +297,9 @@ type SheetComponentOptions = S2Options< | 参数 | 说明 | 类型 | 默认值 | 必选 | | -- | -- | -- | -- | --- | -| target | 交互作用对象 | [S2CellType](/docs/api/basic-class/base-cell) | | | +| target | 交互作用对象 | [S2CellType](/api/basic-class/base-cell) | | | | event | AntV/G Event 事件 | [FederatedPointerEvent](https://g.antv.antgroup.com/api/event/event-object) | | | -| viewMeta | 当前节点信息 | [Node](/docs/api/basic-class/node) | | | +| viewMeta | 当前节点信息 | [Node](/api/basic-class/node) | | | @@ -314,12 +314,12 @@ type SheetComponentOptions = S2Options< ### HiddenColumnsInfo -功能描述:开启 [隐藏列头](/docs/manual/advanced/interaction/hide-columns) 后,隐藏列头的节点信息 +功能描述:开启 [隐藏列头](/manual/advanced/interaction/hide-columns) 后,隐藏列头的节点信息 | 参数 | 说明 | 类型 | 默认值 | 必选 | | -- | -- | -- | -- | --- | -| hideColumnNodes | 当前隐藏的节点信息 | [Node](/docs/api/basic-class/node)[] | | | -| displaySiblingNode | 展示的相邻节点信息 | { prev:[Node](/docs/api/basic-class/node);next: [Node](/docs/api/basic-class/node) } | | | +| hideColumnNodes | 当前隐藏的节点信息 | [Node](/api/basic-class/node)[] | | | +| displaySiblingNode | 展示的相邻节点信息 | { prev:[Node](/api/basic-class/node);next: [Node](/api/basic-class/node) } | | | ### ResizeParams @@ -328,7 +328,7 @@ type SheetComponentOptions = S2Options< | 参数 | 说明 | 类型 | 默认值 | 必选 | | -- | -- | -- | -- | --- | | info | resize 配置信息 | [ResizeInfo](#resizeinfo) | | | -| style | options 中样式相关配置 | [style](/docs/api/general/s2-options#style) | | | +| style | options 中样式相关配置 | [style](/api/general/s2-options#style) | | | ### ResizeInfo @@ -336,7 +336,7 @@ type SheetComponentOptions = S2Options< | 参数 | 说明 | 类型 | 默认值 | 必选 | | -- | -- | -- | -- | --- | -| theme | resize 热区配置 | [ResizeArea](/docs/api/general/s2-theme#resizearea) | | | +| theme | resize 热区配置 | [ResizeArea](/api/general/s2-theme#resizearea) | | | | type | resize 方向 | `Horizontal` \| `Vertical` | | | | offsetX | 横向偏移量 | `number` | | | | offsetY | 纵向偏移量 | `number` | | | @@ -346,7 +346,7 @@ type SheetComponentOptions = S2Options< | effect | 拖拽更改影响的区域 | `Field` \| `Cell` \| `Tree` \| `Series` | | | | isResizeArea | 是否属于 resize 热区 | `boolean` | | | | id | 字段 id | `string` | | | -| meta | resize 热区对应单元格节点信息 | [Node](/docs/api/basic-class/node) | | | +| meta | resize 热区对应单元格节点信息 | [Node](/api/basic-class/node) | | | | resizedWidth | 拖拽后的宽度 | `number` | | | | resizedHeight | 拖拽后的高度 | `number` | | | @@ -358,7 +358,7 @@ type SheetComponentOptions = S2Options< | -- | -- | -- | -- | --- | | reloadData | 是否重新加载数据 | `boolean` | | | | rebuildDataSet | 是否重新生成数据集 | `boolean` | | | -| reBuildHiddenColumnsDetail | 是否重新生成列头隐藏信息 | `boolean` | | | +| rebuildHiddenColumnsDetail | 是否重新生成列头隐藏信息 | `boolean` | | | diff --git a/s2-site/docs/api/general/s2-event.zh.md b/s2-site/docs/api/general/s2-event.zh.md index 07fe12c1be..2c8634090d 100644 --- a/s2-site/docs/api/general/s2-event.zh.md +++ b/s2-site/docs/api/general/s2-event.zh.md @@ -7,7 +7,7 @@ tag: Updated 表格事件列表,可以根据实际需要,监听所需事件,实现自定义业务。[查看全部事件定义](https://github.com/antvis/S2/blob/next/packages/s2-core/src/common/constant/events/basic.ts), [文档](/manual/advanced/interaction/basic) 和 [示例](/examples/interaction/basic/#event) :::info{title="提示"} -如果使用的是 `s2-react` 或 `s2-vue` 表组件,则已对事件进行封装,无需额外监听,使用其回调函数即可。 [详情](/docs/api/components/sheet-component) +如果使用的是 `s2-react` 或 `s2-vue` 表组件,则已对事件进行封装,无需额外监听,使用其回调函数即可。 [详情](/api/components/sheet-component) ```tsx | pure diff --git a/s2-site/docs/api/general/s2-options.zh.md b/s2-site/docs/api/general/s2-options.zh.md index ab16aeb761..76ed30942c 100644 --- a/s2-site/docs/api/general/s2-options.zh.md +++ b/s2-site/docs/api/general/s2-options.zh.md @@ -90,8 +90,8 @@ CellCallback = (node: Node, spreadsheet: SpreadSheet, ...restOptions: unknown[]) | 参数 | 说明 | 类型 | 默认值 | 必选 | | ----------- | ------------------------ | ------------------------------------------------ | ------ | ---- | -| node | 当前渲染的 node 节点 | [Node](/docs/api/basic-class/node) | - | ✓ | -| spreadsheet | 表格实例 | [SpreadSheet](/docs/api/basic-class/spreadsheet) | - | ✓ | +| node | 当前渲染的 node 节点 | [Node](/api/basic-class/node) | - | ✓ | +| spreadsheet | 表格实例 | [SpreadSheet](/api/basic-class/spreadsheet) | - | ✓ | | restOptions | 不定参数,传递额外的信息 | `unknown[]` | - | | ## MergedCellCallback @@ -113,7 +113,7 @@ CornerHeaderCallback = (parent: S2CellType, spreadsheet: SpreadSheet, ...restOpt | 参数 | 说明 | 类型 | 默认值 | 必选 | | ----------- | ------------------------ | ------------------------------------------------ | ------ | ---- | | parent | 父级单元格 | [S2CellType](#s2celltype) | - | ✓ | -| spreadsheet | 表格实例 | [SpreadSheet](/docs/api/basic-class/spreadsheet) | - | ✓ | +| spreadsheet | 表格实例 | [SpreadSheet](/api/basic-class/spreadsheet) | - | ✓ | | restOptions | 不定参数,传递额外的信息 | `unknown[]` | - | | @@ -146,14 +146,14 @@ CornerHeaderCallback = (parent: S2CellType, spreadsheet: SpreadSheet, ...restOpt | 参数 | 说明 | 类型 | 默认值 | 必选 | | ----------------- | ------------------------------------------------ | ------------------------------------ | ------ | ---- | -| colNodes | 列头节点,对应 ColCell (含可视范围外) | [Node[]](/docs/api/basic-class/node) | | | -| colLeafNodes | 列头叶子节点,对应 ColCell (含可视范围外) | [Node[]](/docs/api/basic-class/node) | | | +| colNodes | 列头节点,对应 ColCell (含可视范围外) | [Node[]](/api/basic-class/node) | | | +| colLeafNodes | 列头叶子节点,对应 ColCell (含可视范围外) | [Node[]](/api/basic-class/node) | | | | colsHierarchy | 列头节点层级结构 (含可视范围外) | [Hierarchy](#hierarchy) | | | | rowNodes | 行头节点,对应 RowCell (含可视范围外) | [Node[]](#node) | | | -| rowLeafNodes | 行头叶子节点,对应 RowCell (含可视范围外) | [Node[]](/docs/api/basic-class/node) | | | +| rowLeafNodes | 行头叶子节点,对应 RowCell (含可视范围外) | [Node[]](/api/basic-class/node) | | | | rowsHierarchy | 行头节点层级结构 (含可视范围外) | [Hierarchy](#hierarchy) | | ✓ | -| seriesNumberNodes | 序号节点,对应 SeriesNumberCell (含可视范围外) | [Node[]](/docs/api/basic-class/node) | | | -| cornerNodes | 角头节点,对应 CornerCell (含可视范围外) | [Node[]](/docs/api/basic-class/node) | | | +| seriesNumberNodes | 序号节点,对应 SeriesNumberCell (含可视范围外) | [Node[]](/api/basic-class/node) | | | +| cornerNodes | 角头节点,对应 CornerCell (含可视范围外) | [Node[]](/api/basic-class/node) | | | ## DataSet diff --git a/s2-site/docs/api/general/s2-theme.zh.md b/s2-site/docs/api/general/s2-theme.zh.md index cbc521f7b5..4a6f9eaa9a 100644 --- a/s2-site/docs/api/general/s2-theme.zh.md +++ b/s2-site/docs/api/general/s2-theme.zh.md @@ -28,17 +28,28 @@ s2.setTheme({ 功能描述:表格主题配置项。查看 [文档](/manual/basic/theme) 和 [示例](/examples/theme/default/#colorful) -| 参数 | 参数 | 类型 | 默认值 | 必选 | +| 参数 | 说明 | 类型 | 默认值 | 必选 | | ------- | ----------- | --------------------------------- | --------- | ---- | | theme | 主题 schema | [S2Theme](#s2theme) | - | | | palette | 色板 | [Palette](#palette) | - | | -| name | 主题名 | `default` \| `colorful` \| `gray` | `default` | | +| name | 主题名 | [ThemeName](#themename) | `default` | | + +### ThemeName + +功能描述:表格主题名称。查看 [文档](/manual/basic/theme) 和 [示例](/examples/theme/default/#colorful) + +| 参数 | 说明 | 类型 | 默认值 | 必选 | +| ---- | -------------- | ---------------------- | ------ | ---- | +| default | 默认 | `string` | - | | +| colorful | 多彩蓝 | `string` | - | | +| gray | 简约灰 | `string` | - | | +| dark | 暗黑 | `string` | - | | ### Palette 功能描述:表主题色板。查看 [文档](/manual/basic/theme) 和 [示例](/examples/theme/custom/#custom-palette) -| 参数 | 参数 | 类型 | 默认值 | 必选 | +| 参数 | 说明 | 类型 | 默认值 | 必选 | | ------------------- | --------------------------------------------------- | ---------------------------------------------------------------- | ------ | ---- | | brandColor | 色板主题色 | `string` | - | ✓ | | basicColors | 基础颜色 | `string[]` | - | ✓ | @@ -50,7 +61,7 @@ s2.setTheme({ 功能描述:表格主题 `Schema`. 查看 [文档](/manual/basic/theme#%E4%B8%BB%E9%A2%98-schema) 和 [示例](/examples/theme/custom/#custom-palette) -| 参数 | 参数 | 类型 | 默认值 | 必选 | +| 参数 | 说明 | 类型 | 默认值 | 必选 | | ----------------- | -------------------------------------- | ----------------------------------------------- | ------ | ---- | | cornerCell | 角头单元格主题 | [DefaultCellTheme](#defaultcelltheme) | | | | rowCell | 行头单元格主题 | [DefaultCellTheme](#defaultcelltheme) | | | @@ -73,7 +84,7 @@ s2.setTheme({ | bolderText | 加粗文本样式(如:总计,小计,行列头非叶子节点文本)[了解更多](/manual/advanced/custom/cell-align#%E8%A1%8C%E5%A4%B4%E5%AF%B9%E9%BD%90%E6%96%B9%E5%BC%8F) | [TextTheme](#texttheme) | - | | | text | 文本样式(如:数值,行列头叶子节点文本)[了解更多](/manual/advanced/custom/cell-align#%E6%95%B0%E6%8D%AE%E5%8D%95%E5%85%83%E6%A0%BC%E5%AF%B9%E9%BD%90%E6%96%B9%E5%BC%8F) | [TextTheme](#texttheme) | - | | | seriesText | 序号文本样式 | [TextTheme](#texttheme) | - | | -| measureText | 度量值文本样式(如:数值挂行/列头时,行列头所对应的虚拟数值单元格文本)[了解更多](/manual/advanced/custom/cell-align#%E5%88%97%E5%A4%B4%E5%AF%B9%E9%BD%90%E6%96%B9%E5%BC%8F) | [TextTheme](#texttheme) | - | | +| measureText | 度量值文本样式(如:数值挂行/列头时,行头/列头/角头所对应的虚拟数值单元格文本)[了解更多](/manual/advanced/custom/cell-align#%E5%88%97%E5%A4%B4%E5%AF%B9%E9%BD%90%E6%96%B9%E5%BC%8F) | [TextTheme](#texttheme) | - | | | cell | 单元格样式 | [CellTheme](#celltheme) | - | | | icon | 图标样式 | [IconTheme](#icontheme) | - | | | seriesNumberWidth | 序号列宽 | `number` | 80 | | diff --git a/s2-site/docs/common/copy-export.zh.md b/s2-site/docs/common/copy-export.zh.md index 2deada76e3..1c30991fa3 100644 --- a/s2-site/docs/common/copy-export.zh.md +++ b/s2-site/docs/common/copy-export.zh.md @@ -259,7 +259,7 @@ download(data, 'filename') // filename.csv | 参数 | 说明 | 类型 | 默认值 | 必选 | | ------------|-----------------|---------------|---------------| --- | -| sheetInstance | s2 实例 | [SpreadSheet](/docs/api/basic-class/spreadsheet) | | ✓ | +| sheetInstance | s2 实例 | [SpreadSheet](/api/basic-class/spreadsheet) | | ✓ | | split | 分隔符 | `string` | | ✓ | | formatOptions | 是否使用 [S2DataConfig.Meta](/api/general/s2-data-config#meta) 进行格式化,可以分别对数据单元格和行列头进行格式化,传 `boolean` 会同时对单元格和行列头生效。 | `boolean \| { formatHeader?: boolean, formatData?: boolean }`| `true` | | | customTransformer | 导出时支持自定义 (transformer) 数据导出格式化方法 | (transformer: `Transformer`) => [`Partial`](#transformer) | | | diff --git a/s2-site/docs/common/custom-tooltip.zh.md b/s2-site/docs/common/custom-tooltip.zh.md index b3e2ed666a..82ac6ce4d1 100644 --- a/s2-site/docs/common/custom-tooltip.zh.md +++ b/s2-site/docs/common/custom-tooltip.zh.md @@ -110,5 +110,5 @@ order: 5 | label | `ReactNode \| string` | | | 名称 | | icon | `ReactNode \| Element \| string` | | | 自定义图标 | | visible | `boolean \| (cell: S2CellType) => boolean` | | `true` | 操作项是否显示,可传入一个函数根据当前单元格信息动态显示 | -| onClick | (`info`: `{ key: string, [key: string]: unknown; }` , `cell`: [S2CellType](/docs/api/basic-class/base-cell)) => void | | | 点击事件回调 (`info` 为当前点击的菜单项,`cell` 为当前 tooltip 对应的单元格) | +| onClick | (`info`: `{ key: string, [key: string]: unknown; }` , `cell`: [S2CellType](/api/basic-class/base-cell)) => void | | | 点击事件回调 (`info` 为当前点击的菜单项,`cell` 为当前 tooltip 对应的单元格) | | children | [TooltipOperatorMenuItem[]](#tooltipoperatormenuitem) | | | 子菜单列表 | diff --git a/s2-site/docs/common/custom/layoutArrange.zh.md b/s2-site/docs/common/custom/layoutArrange.zh.md index ad589bde74..0e9fb99bcf 100644 --- a/s2-site/docs/common/custom/layoutArrange.zh.md +++ b/s2-site/docs/common/custom/layoutArrange.zh.md @@ -13,7 +13,7 @@ LayoutArrange = (spreadsheet: SpreadSheet, parent: Node, field: string, fieldVal | 参数 | 类型 | 必选 | 默认值 | 功能描述 | | --- | --- | --- | --- | --- | -| spreadsheet | [SpreadSheet](/docs/api/basic-class/spreadsheet) | ✓ | | 表格实例 | -| node | [Node](/docs/api/basic-class/node) | ✓ | | 当前渲染的 node 节点 | +| spreadsheet | [SpreadSheet](/api/basic-class/spreadsheet) | ✓ | | 表格实例 | +| node | [Node](/api/basic-class/node) | ✓ | | 当前渲染的 node 节点 | | field | `string` | ✓ | | 当前的字段名 | | fieldValues | `string[]` | ✓ | | 当前字段值 | diff --git a/s2-site/docs/common/custom/layoutCoordinate.zh.md b/s2-site/docs/common/custom/layoutCoordinate.zh.md index a9271e52dc..be15550e39 100644 --- a/s2-site/docs/common/custom/layoutCoordinate.zh.md +++ b/s2-site/docs/common/custom/layoutCoordinate.zh.md @@ -12,6 +12,6 @@ LayoutCoordinate = (spreadsheet: SpreadSheet, rowNode: Node, colNode: Node) => v | 参数 | 类型 | 必选 | 默认值 | 功能描述 | | --- | --- | --- | --- | --- | -| spreadsheet | [SpreadSheet](/docs/api/basic-class/spreadsheet) | ✓ | | 表格实例 | -| rowNode | [Node](/docs/api/basic-class/node) | ✓ | | 行头节点 | -| colNode | [Node](/docs/api/basic-class/node) | ✓ | | 列头节点 | +| spreadsheet | [SpreadSheet](/api/basic-class/spreadsheet) | ✓ | | 表格实例 | +| rowNode | [Node](/api/basic-class/node) | ✓ | | 行头节点 | +| colNode | [Node](/api/basic-class/node) | ✓ | | 列头节点 | diff --git a/s2-site/docs/common/custom/layoutHierarchy.zh.md b/s2-site/docs/common/custom/layoutHierarchy.zh.md index 61628eb580..d893cdb9ef 100644 --- a/s2-site/docs/common/custom/layoutHierarchy.zh.md +++ b/s2-site/docs/common/custom/layoutHierarchy.zh.md @@ -13,8 +13,8 @@ LayoutHierarchy = (spreadsheet: SpreadSheet, node: Node) => LayoutHierarchyRetur | 参数 | 类型 | 必选 | 默认值 | 功能描述 | | --- | --- | --- | --- | --- | -| spreadsheet | [SpreadSheet](/docs/api/basic-class/spreadsheet) | ✓ | | 表格实例 | -| node | [Node](/docs/api/basic-class/node) | ✓ | | 当前渲染的 node 节点 | +| spreadsheet | [SpreadSheet](/api/basic-class/spreadsheet) | ✓ | | 表格实例 | +| node | [Node](/api/basic-class/node) | ✓ | | 当前渲染的 node 节点 | ```ts interface LayoutHierarchyReturnType { diff --git a/s2-site/docs/common/custom/layoutSeriesNumberNodes.zh.md b/s2-site/docs/common/custom/layoutSeriesNumberNodes.zh.md index a2d8cdaf35..6c97557d67 100644 --- a/s2-site/docs/common/custom/layoutSeriesNumberNodes.zh.md +++ b/s2-site/docs/common/custom/layoutSeriesNumberNodes.zh.md @@ -15,6 +15,6 @@ LayoutSeriesNumberNodes = (rowsHierarchy: Hierarchy, seriesNumberWidth: number, | 参数 | 类型 | 必选 | 默认值 | 功能描述 | | --- | --- | --- | --- | --- | -| rowsHierarchy | [Hierarchy](/docs/api/basic-class/hierarchy) | | | 行头层级结构 | +| rowsHierarchy | [Hierarchy](/api/basic-class/hierarchy) | | | 行头层级结构 | | seriesNumberWidth | `number` | | | 表格实例 | -| spreadsheet | [SpreadSheet](/docs/api/basic-class/spreadsheet) | | | 表格实例 | +| spreadsheet | [SpreadSheet](/api/basic-class/spreadsheet) | | | 表格实例 | diff --git a/s2-site/docs/common/interaction.zh.md b/s2-site/docs/common/interaction.zh.md index ababbd986b..5f88a0ec5f 100644 --- a/s2-site/docs/common/interaction.zh.md +++ b/s2-site/docs/common/interaction.zh.md @@ -9,13 +9,13 @@ order: 5 | 参数 | 说明 | 类型 | 默认值 | 必选 | | -------- |---------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------| -------- | ---------------- | -| linkFields | 标记字段为链接样式,用于外链跳转 | `string[]` \| (meta: [Node](/docs/api/basic-class/node) \| [ViewMeta](#viewmeta)) => boolean | | | +| linkFields | 标记字段为链接样式,用于外链跳转 | `string[]` \| (meta: [Node](/api/basic-class/node) \| [ViewMeta](#viewmeta)) => boolean | | | | selectedCellsSpotlight | 是否开启选中高亮聚光灯效果 | `boolean` | `false` | | | hoverHighlight | 鼠标悬停时高亮当前单元格,以及所对应的行头,列头 | `boolean` | `true` | | | hoverFocus | 鼠标悬停在当前单元格超过默认 800ms 后,保持当前高亮,显示 tooltip,悬停时间通过设置 `duration` 来控制 | `boolean \| {duration: number}` | `true` | | | hiddenColumnFields | 用于配置默认隐藏的列,透视表需要配置列头唯一 id, 明细表配置列头 field 字段即可 | `string[]` | | | | copy | 单元格复制配置 | [Copy](#copy) | | | -| customInteractions | 自定义交互 [详情](/docs/manual/advanced/interaction/custom) | [CustomInteraction[]](#custominteraction) | | | +| customInteractions | 自定义交互 [详情](/manual/advanced/interaction/custom) | [CustomInteraction[]](#custominteraction) | | | | scrollSpeedRatio | 用于控制滚动速率,分水平和垂直两个方向,默认为 1 | [ScrollSpeedRatio](#scrollspeedratio) | | | | autoResetSheetStyle | 用于控制点击表格外区域和按下 `ESC` 键时是否重置交互状态和关闭 Tooltip, 支持根据 event 动态判断 | `boolean \| (event: Event \| FederatedPointerEvent, spreadsheet: SpreadSheet) => boolean` | `true` | | | resize | 用于控制 resize 热区是否显示 | `boolean` \| [ResizeInteractionOptions](#resizeinteractionoptions) | `true` | | @@ -25,7 +25,7 @@ order: 5 | scrollbarPosition | 用于控制滚动条展示在内容区边缘还是画布边缘 | `content \| canvas` | `content` | | | eventListenerOptions | 事件监听函数 `addEventListener` 的 [可选项配置](https://developer.mozilla.org/zh-CN/docs/Web/API/EventTarget/addEventListener), 可控制事件从冒泡阶段还是捕获阶段触发 | `false` | | | selectedCellHighlight | 选中数值单元格后的行列高亮联动
rowHeader:选中数值单元格后高亮对应行头
colHeader:选中数值单元格后高亮对应列头
currentRow:选中数值单元格后高亮整行
currentCol:选中数值单元格后高亮整列
true:同 { rowHeader: true, colHeader: true, currentRow: true, currentCol: true } | `boolean \| { rowHeader?: boolean, colHeader?: boolean, currentRow?: boolean, currentCol?: boolean }` | `false` | | -| overscrollBehavior | 控制滚动至边界的行为,可禁用浏览器的默认滚动行为。[详情](/docs/manual/advanced/interaction/basic/#修改滚动至边界行为) | `auto \| contain \| none \| null` | `auto` | +| overscrollBehavior | 控制滚动至边界的行为,可禁用浏览器的默认滚动行为。[详情](/manual/advanced/interaction/basic/#修改滚动至边界行为) | `auto \| contain \| none \| null` | `auto` | ### Copy @@ -36,16 +36,16 @@ order: 5 | enable | 是否允许复制 | `boolean` | `true` | | | withFormat | 是否使用 [s2DataConfig](/api/general/s2-data-config#meta) 的 `formatter` 格式复制数据 | `boolean` | `true` | | | withHeader | 复制数据是否带表头信息 | `boolean` | `false` | | -| customTransformer | 复制时支持自定义 (transformer) 数据格式化方法 | (transformer: [Transformer](/docs/api/components/export#transformer)) => `Partial` | `transformer` | | +| customTransformer | 复制时支持自定义 (transformer) 数据格式化方法 | (transformer: [Transformer](/api/components/export#transformer)) => `Partial` | `transformer` | | ### CustomInteraction -功能描述:自定义交互,继承 BaseEvent: [查看示例](/docs/manual/advanced/interaction/custom) +功能描述:自定义交互,继承 BaseEvent: [查看示例](/manual/advanced/interaction/custom) | 参数 | 说明 | 类型 | 默认值 | 必选 | | ----------- | -------------- | ------------------------------------------------- | ------ | --- | | key | 交互的唯一标识 | `string` | | ✓ | -| interaction | 交互实例 | [InteractionConstructor](/docs/api/basic-class/interaction#interactionconstructor) | | ✓ | +| interaction | 交互实例 | [InteractionConstructor](/api/basic-class/interaction#interactionconstructor) | | ✓ | ### ScrollSpeedRatio @@ -70,8 +70,8 @@ interface ScrollSpeedRatio { | colCellVertical | 是否开启列头垂直方向 resize 热区 (列头隐藏时该配置无效) | `boolean` | true | | | rowResizeType | 用于控制行高 resize 时的生效范围
1. `all`: 对所有单元格生效(会覆盖默认的行高配置),2. `current`: 对当前单元格生效,3. `selected`: 对当前单元格生效,如果单元格是多选状态,调整任意选中单元格,对所有选中的生效。| `all`\| `current` \| `selected` | `current` | | | colResizeType | 用于控制列宽 resize 时的生效范围
1. `all`: 对所有单元格生效(会覆盖默认的列宽配置),2. `current`: 对当前单元格生效,3. `selected`: 对当前单元格生效,如果单元格是多选状态,调整任意选中单元格,对所有选中的生效。| `all`\| `current` \| `selected` | `current` | | -| disable | 用于控制行高 resize 是否生效。[查看示例](/examples/interaction/advanced/#resize-disable) | (resizeInfo: [S2CellType](/docs/api/components/sheet-component#resizeinfo)) => boolean | | | -| visible | 自定义当前单元格是否显示 resize 热区 | (cell: [S2CellType](/docs/api/basic-class/base-cell)) => boolean | | | +| disable | 用于控制行高 resize 是否生效。[查看示例](/examples/interaction/advanced/#resize-disable) | (resizeInfo: [S2CellType](/api/components/sheet-component#resizeinfo)) => boolean | | | +| visible | 自定义当前单元格是否显示 resize 热区 | (cell: [S2CellType](/api/basic-class/base-cell)) => boolean | | | | minCellWidth | 单元格可拖拽最小宽度 | `number`| 40 | | | minCellHeight | 单元格可拖拽最小高度 | `number` | 20 | | @@ -92,7 +92,7 @@ interface ScrollSpeedRatio { | 参数 | 说明 | 类型 | 默认值 | 必选 | | -- | -- | -- | -- | --- | | interactionName | 触发选中的交互名 | [InteractionName](#interactionname) | | | -| targetCell | 触发选中的单元格 | [S2CellType](/docs/api/basic-class/base-cell) | | | +| targetCell | 触发选中的单元格 | [S2CellType](/api/basic-class/base-cell) | | | ### InterceptType diff --git a/s2-site/docs/common/style.zh.md b/s2-site/docs/common/style.zh.md index a1181baa65..ecbac52838 100644 --- a/s2-site/docs/common/style.zh.md +++ b/s2-site/docs/common/style.zh.md @@ -37,8 +37,8 @@ order: 3 | --- | --- | --- | --- | --- | | width | 单元格宽度,可根据当前列头节点动态设置 (叶子节点有效) | `number \| (colNode: Node) => number` | 96 | | | height | 单元格高度,可根据当前列头节点动态设置 (叶子节点有效) | `number \| (colNode: Node) => number` | 30 | | -| widthByField | 根据度量值设置宽度(拖拽或者预设宽度场景), `field` 对应 `s2DataConfig.fields.columns` 中的 `field` 或 列头 id (优先级大于 `width`) [查看详情](/docs/manual/advanced/custom/cell-size#%E8%B0%83%E6%95%B4%E8%A1%8C%E5%A4%B4%E5%8D%95%E5%85%83%E6%A0%BC%E5%AE%BD%E9%AB%98) | `Record` | - | | -| heightByField | 根据度量值设置高度(拖拽或者预设高度场景), `field` 对应 `s2DataConfig.fields.columns` 中的 `field` 或 列头 id (优先级大于 `height`) [查看详情](/docs/manual/advanced/custom/cell-size#%E8%B0%83%E6%95%B4%E8%A1%8C%E5%A4%B4%E5%8D%95%E5%85%83%E6%A0%BC%E5%AE%BD%E9%AB%98) | `Record` | - | | +| widthByField | 根据度量值设置宽度(拖拽或者预设宽度场景), `field` 对应 `s2DataConfig.fields.columns` 中的 `field` 或 列头 id (优先级大于 `width`) [查看详情](/manual/advanced/custom/cell-size#%E8%B0%83%E6%95%B4%E8%A1%8C%E5%A4%B4%E5%8D%95%E5%85%83%E6%A0%BC%E5%AE%BD%E9%AB%98) | `Record` | - | | +| heightByField | 根据度量值设置高度(拖拽或者预设高度场景), `field` 对应 `s2DataConfig.fields.columns` 中的 `field` 或 列头 id (优先级大于 `height`) [查看详情](/manual/advanced/custom/cell-size#%E8%B0%83%E6%95%B4%E8%A1%8C%E5%A4%B4%E5%8D%95%E5%85%83%E6%A0%BC%E5%AE%BD%E9%AB%98) | `Record` | - | | | hideValue | 默认数值挂列头,会同时显示列头和数值,隐藏数值,使其更美观。(即 `s2DataConfig.fields.values` 且仅在单数值时有效,多数值时推荐使用 [隐藏列头](https://s2.antv.vision/manual/advanced/interaction/hide-columns#2-%E9%80%8F%E8%A7%86%E8%A1%A8)) | `boolean` | false | | ### RowCell @@ -53,8 +53,8 @@ order: 3 | collapseAll | 在树状结构模式下行头是否默认收起全部。 | `boolean` | `false` | | | expandDepth | 在树状结构模式下行头默认展开展开的层级(层级从 0 开始), 设置为 `null` 时优先级最低 | `number` | | | | showTreeLeafNodeAlignDot | 树状模式下行头叶子节点是否显示层级占位点 | `boolean` | `false` | | -| withByField | 根据 `field` 设置每行的宽度。`field` 对应 `s2DataConfig.fields.rows` 中的 `field` 或 列头 id (优先级大于 `width`) [查看详情](/docs/manual/advanced/custom/cell-size#%E8%B0%83%E6%95%B4%E8%A1%8C%E5%A4%B4%E5%8D%95%E5%85%83%E6%A0%BC%E5%AE%BD%E9%AB%98) | `Record` | - | | -| heightByField | 根据 `field` 设置每行的高度。
1. 透视表:`field` 对应 `s2DataConfig.fields.rows` 中的 `field` 或 列头 id.
2. 明细表:`field` 对应 行序号,从 `1` 开始。(优先级大于 `height`) [查看详情](/docs/manual/advanced/custom/cell-size#%E8%B0%83%E6%95%B4%E8%A1%8C%E5%A4%B4%E5%8D%95%E5%85%83%E6%A0%BC%E5%AE%BD%E9%AB%98) | `Record` | - | | +| withByField | 根据 `field` 设置每行的宽度。`field` 对应 `s2DataConfig.fields.rows` 中的 `field` 或 列头 id (优先级大于 `width`) [查看详情](/manual/advanced/custom/cell-size#%E8%B0%83%E6%95%B4%E8%A1%8C%E5%A4%B4%E5%8D%95%E5%85%83%E6%A0%BC%E5%AE%BD%E9%AB%98) | `Record` | - | | +| heightByField | 根据 `field` 设置每行的高度。
1. 透视表:`field` 对应 `s2DataConfig.fields.rows` 中的 `field` 或 列头 id.
2. 明细表:`field` 对应 行序号,从 `1` 开始。(优先级大于 `height`) [查看详情](/manual/advanced/custom/cell-size#%E8%B0%83%E6%95%B4%E8%A1%8C%E5%A4%B4%E5%8D%95%E5%85%83%E6%A0%BC%E5%AE%BD%E9%AB%98) | `Record` | - | | ### CornerCell diff --git a/s2-site/docs/manual/advanced/analysis/advanced.zh.md b/s2-site/docs/manual/advanced/analysis/advanced.zh.md index 10ce8b8525..68819faf67 100644 --- a/s2-site/docs/manual/advanced/analysis/advanced.zh.md +++ b/s2-site/docs/manual/advanced/analysis/advanced.zh.md @@ -16,7 +16,7 @@ tag: Updated ## 使用 -结合 `@antv/s2-react` 的 `SheetComponent` 组件使用,配置具体信息可查看 [AdvancedSortCfgProps](/docs/api/components/advanced-sort#advancedsortcfgprops) +结合 `@antv/s2-react` 的 `SheetComponent` 组件使用,配置具体信息可查看 [AdvancedSortCfgProps](/api/components/advanced-sort#advancedsortcfgprops) ```tsx import React from 'react'; diff --git a/s2-site/docs/manual/advanced/analysis/switcher.zh.md b/s2-site/docs/manual/advanced/analysis/switcher.zh.md index 5315291484..f29b51d127 100644 --- a/s2-site/docs/manual/advanced/analysis/switcher.zh.md +++ b/s2-site/docs/manual/advanced/analysis/switcher.zh.md @@ -56,7 +56,7 @@ const App = () => { ### 维度配置 :::info{title="提示"} -Switcher 可接收三种类型的维度配置,分别是 `rows`,`columns` 和 `values`, 它们的类型皆为 [SwitcherField](/docs/api/components/switcher#switcherfield)。 +Switcher 可接收三种类型的维度配置,分别是 `rows`,`columns` 和 `values`, 它们的类型皆为 [SwitcherField](/api/components/switcher#switcherfield)。 其中 `rows` 和 `columns` 两个维度可以相互拖拽到彼此的配置框中,而 `values` 只能在自己的配置框中更改字段顺序。 @@ -133,7 +133,7 @@ const field = { ### 提交修改 -`Switcher` 组件在弹窗关闭后会触发 `onSubmit` 回调,且此回调会接收一个 [SwitcherResult](/docs/api/components/switcher#switcherresult) 类型的参数,你可以通过该回调拿到修改后的结果。 +`Switcher` 组件在弹窗关闭后会触发 `onSubmit` 回调,且此回调会接收一个 [SwitcherResult](/api/components/switcher#switcherresult) 类型的参数,你可以通过该回调拿到修改后的结果。 所有结果会**按维度**分组,并且每一组字段会**扁平化后**按按顺序排序,你可以通过以下示例查看详细的结果数据类型。 @@ -169,7 +169,7 @@ import { SwapOutlined } from '@ant-design/icons'; ``` -🎨 `Switcher` 组件详细的配置参考 [Switcher Props](/docs/api/components/switcher) 文档。 +🎨 `Switcher` 组件详细的配置参考 [Switcher Props](/api/components/switcher) 文档。 ## 示例 diff --git a/s2-site/docs/manual/advanced/custom/cell-align.zh.md b/s2-site/docs/manual/advanced/custom/cell-align.zh.md index fcfa36072c..76870769f8 100644 --- a/s2-site/docs/manual/advanced/custom/cell-align.zh.md +++ b/s2-site/docs/manual/advanced/custom/cell-align.zh.md @@ -6,7 +6,7 @@ tag: Updated --- :::warning{title='提示'} -在阅读本节内容前,请确保你已经阅读 [主题配置](/docs/manual/basic/theme) 文档 +在阅读本节内容前,请确保你已经阅读 [主题配置](/manual/basic/theme) 文档 ::: 为方便用户查看数据,S2 交叉表会在滑动过程中,保证行头和列头的最大可见性。因此,S2 在行头、列头对齐方式所对应的的范围是当前格子的可视区域,而角头,数据单元格所对应的范围是当前格子的实际尺寸区域。 @@ -15,8 +15,8 @@ tag: Updated ## 角头对齐方式 -* 行头单元格(红色部分)对齐方式受 [text](/docs/api/general/s2-theme#defaultcelltheme) 控制 -* 列头单元格(蓝色部分)对齐方式受 [bolderText](/docs/api/general/s2-theme#defaultcelltheme) 控制 +* 行头单元格(红色部分)对齐方式受 [text](/api/general/s2-theme#defaultcelltheme) 控制 +* 列头单元格(蓝色部分)对齐方式受 [bolderText](/api/general/s2-theme#defaultcelltheme) 控制 ![img](https://gw.alipayobjects.com/zos/antfincdn/6wPCHImDZ/b36ca38e-aa8e-4ef6-a903-b9d605204de0.png) @@ -90,10 +90,10 @@ cornerCell: { ## 行头对齐方式 -* 非叶子节点和小计总计单元格(红色部分)对齐方式受 [bolderText](/docs/api/general/s2-theme#defaultcelltheme) 控制 -* 叶子节点单元格(蓝色部分)对齐方式受 [text](/docs/api/general/s2-theme#defaultcelltheme) 控制 -* 序号单元格(黄色部分)可单独控制,默认和行头对齐,对齐方式受 [seriesText](/docs/api/general/s2-theme#defaultcelltheme) 控制 -* 数值单元格(当数值置于行头时)可单独控制,默认和行头对齐,对齐方式受 [measureText](/docs/api/general/s2-theme#defaultcelltheme) 控制 +* 非叶子节点和小计总计单元格(红色部分)对齐方式受 [bolderText](/api/general/s2-theme#defaultcelltheme) 控制 +* 叶子节点单元格(蓝色部分)对齐方式受 [text](/api/general/s2-theme#defaultcelltheme) 控制 +* 序号单元格(黄色部分)可单独控制,默认和行头对齐,对齐方式受 [seriesText](/api/general/s2-theme#defaultcelltheme) 控制 +* 数值单元格(当数值置于行头时)可单独控制,默认和行头对齐,对齐方式受 [measureText](/api/general/s2-theme#defaultcelltheme) 控制 ![img](https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*JgZxT7sNnTgAAAAAAAAAAAAADmJ7AQ/original) @@ -159,9 +159,9 @@ rowCell: { ## 列头对齐方式 -* 其他非叶子维度单元格(红色部分)对齐方式受 [bolderText](/docs/api/general/s2-theme#defaultcelltheme) 控制 (默认和数据单元格对齐) -* 数值单元格(蓝色部分,当数值置于列头时)对齐方式受 [measureText](/docs/api/general/s2-theme#defaultcelltheme) 控制 -* 叶子维度单元格(黄色部分,当数值置于行头时,或者在列头但隐藏数值列时的最后一个维度)对齐方式受 [text](/docs/api/general/s2-theme#defaultcelltheme) 控制 +* 其他非叶子维度单元格(红色部分)对齐方式受 [bolderText](/api/general/s2-theme#defaultcelltheme) 控制 (默认和数据单元格对齐) +* 数值单元格(蓝色部分,当数值置于列头时)对齐方式受 [measureText](/api/general/s2-theme#defaultcelltheme) 控制 +* 叶子维度单元格(黄色部分,当数值置于行头时,或者在列头但隐藏数值列时的最后一个维度)对齐方式受 [text](/api/general/s2-theme#defaultcelltheme) 控制 > 列头的滚动对齐只针对于非叶子维度节点,叶子维度节点对齐对应的范围是当前格子的实际尺寸区域。 @@ -230,8 +230,8 @@ colCell: { ## 数据单元格对齐方式 -* 小计总计单元格(红色部分)对齐方式受 [bolderText](/docs/api/general/s2-theme#defaultcelltheme) 控制 -* 其他节点单元格(蓝色部分)对齐方式受 [text](/docs/api/general/s2-theme#defaultcelltheme) 控制 +* 小计总计单元格(红色部分)对齐方式受 [bolderText](/api/general/s2-theme#defaultcelltheme) 控制 +* 其他节点单元格(蓝色部分)对齐方式受 [text](/api/general/s2-theme#defaultcelltheme) 控制 ![img](https://gw.alipayobjects.com/zos/antfincdn/WHa%26eKOrP/00951ab0-b25c-4512-a056-541efff7c9dc.png) diff --git a/s2-site/docs/manual/advanced/custom/cell-size.zh.md b/s2-site/docs/manual/advanced/custom/cell-size.zh.md index c64f22c929..22382076e4 100644 --- a/s2-site/docs/manual/advanced/custom/cell-size.zh.md +++ b/s2-site/docs/manual/advanced/custom/cell-size.zh.md @@ -6,7 +6,7 @@ tag: Updated S2 可以手动拖拽动态改变单元格的宽高,同时内置了 `行列等宽`, `列等宽` 和 `行列紧凑布局` 三种布局 ([查看示例](/examples/layout/basic/#compact)) -我们可以通过 [主题](/docs/manual/basic/theme/) 修改单元格的背景色,字体大小等配置,如果想自定义单元格的宽高,可以通过 `s2Options` 的 [style](/docs/api/general/s2-options#style) 配置来实现 +我们可以通过 [主题](/manual/basic/theme/) 修改单元格的背景色,字体大小等配置,如果想自定义单元格的宽高,可以通过 `s2Options` 的 [style](/api/general/s2-options#style) 配置来实现 @@ -94,7 +94,7 @@ const s2Options = { 如果想给特定某一行/列设置不同的宽高,可以通过 `rowCell` 的 `widthByField` 和 `heightByField` 预设高度来实现,支持两种类型的配置: -- **fieldId** (例:`root[&]浙江省[&]杭州市`): 行列交叉后每一个行头节点对应的唯一 ID, 适用于宽高精确到具体的单元格 [(如何获取 ID)](/docs/manual/advanced/get-cell-data#%E8%8E%B7%E5%8F%96%E6%8C%87%E5%AE%9A%E5%8C%BA%E5%9F%9F%E5%8D%95%E5%85%83%E6%A0%BC) +- **fieldId** (例:`root[&]浙江省[&]杭州市`): 行列交叉后每一个行头节点对应的唯一 ID, 适用于宽高精确到具体的单元格 [(如何获取 ID)](/manual/advanced/get-cell-data#%E8%8E%B7%E5%8F%96%E6%8C%87%E5%AE%9A%E5%8C%BA%E5%9F%9F%E5%8D%95%E5%85%83%E6%A0%BC) - **field** (例:`city`): 对应 `s2DataConfig.fields.rows` 中配置的 `field`, 适用于精确到某一类维值的单元格 ::: @@ -190,7 +190,7 @@ const s2Options = { 如果想给特定某一列设置不同的宽高,可以通过 `colCell` 的 `widthByField` 和 `heightByField` 预设宽高来实现,支持两种类型的配置: -- **fieldId** (例:`root[&]家具[&]沙发[&]number`): 行列交叉后每一个列头节点对应的唯一 ID, 适用于宽高精确到具体的单元格 [(如何获取 ID)](/docs/manual/advanced/get-cell-data#%E8%8E%B7%E5%8F%96%E6%8C%87%E5%AE%9A%E5%8C%BA%E5%9F%9F%E5%8D%95%E5%85%83%E6%A0%BC) +- **fieldId** (例:`root[&]家具[&]沙发[&]number`): 行列交叉后每一个列头节点对应的唯一 ID, 适用于宽高精确到具体的单元格 [(如何获取 ID)](/manual/advanced/get-cell-data#%E8%8E%B7%E5%8F%96%E6%8C%87%E5%AE%9A%E5%8C%BA%E5%9F%9F%E5%8D%95%E5%85%83%E6%A0%BC) - **field** (例:`city`): 对应 `s2DataConfig.fields.columns` 中配置的 `field`, 适用于精确到某一类维值的单元格 ::: diff --git a/s2-site/docs/manual/advanced/custom/custom-header.zh.md b/s2-site/docs/manual/advanced/custom/custom-header.zh.md index 406370125b..3ff8545542 100644 --- a/s2-site/docs/manual/advanced/custom/custom-header.zh.md +++ b/s2-site/docs/manual/advanced/custom/custom-header.zh.md @@ -261,4 +261,4 @@ const s2DataConfig: S2DataConfig = { ## 4. 更多应用 -基于自定义行列头,我们可以衍生出更多的使用场景,比如基于 `自定义行头` + `树状模式`, 我们可以自定义出一个 [趋势分析表分析组件](/docs/manual/basic/analysis/strategy/). +基于自定义行列头,我们可以衍生出更多的使用场景,比如基于 `自定义行头` + `树状模式`, 我们可以自定义出一个 [趋势分析表分析组件](/manual/basic/analysis/strategy/). diff --git a/s2-site/docs/manual/advanced/custom/custom-icon.zh.md b/s2-site/docs/manual/advanced/custom/custom-icon.zh.md index ea4f596817..d495b3d7c6 100644 --- a/s2-site/docs/manual/advanced/custom/custom-icon.zh.md +++ b/s2-site/docs/manual/advanced/custom/custom-icon.zh.md @@ -57,7 +57,7 @@ const s2Options = { #### 3. 使用自定义 icon -如果内置 `icon` 不满足诉求,可以配置 `customSVGIcons` 来额外注册自己的 `icon`, 自定义 `icon` 同时适用于**主题配置**,意味着你也可以调整它的大小,颜色(在线链接不支持),具体请查看 [主题配置](/docs/manual/basic/theme) 章节。 +如果内置 `icon` 不满足诉求,可以配置 `customSVGIcons` 来额外注册自己的 `icon`, 自定义 `icon` 同时适用于**主题配置**,意味着你也可以调整它的大小,颜色(在线链接不支持),具体请查看 [主题配置](/manual/basic/theme) 章节。 支持三种方式: @@ -144,7 +144,7 @@ const s2Options = { ### 自定义数值单元格 icon :::info{title="提示"} -对于数值单元格,我们可以使用通用的 `字段标记` 能力来进行自定义 icon 的展示,详情请查看 [字段标记](/docs/manual/basic/conditions) 章节。 +对于数值单元格,我们可以使用通用的 `字段标记` 能力来进行自定义 icon 的展示,详情请查看 [字段标记](/manual/basic/conditions) 章节。 ::: ```ts | pure | {17} diff --git a/s2-site/docs/manual/advanced/get-cell-data.zh.md b/s2-site/docs/manual/advanced/get-cell-data.zh.md index f9cbbe002c..726186be00 100644 --- a/s2-site/docs/manual/advanced/get-cell-data.zh.md +++ b/s2-site/docs/manual/advanced/get-cell-data.zh.md @@ -15,15 +15,15 @@ tag: Updated - 点击数据单元格,获取当前单元格数据,或者整行数据。 - 自定义 `tooltip` 内容,需要根据当前单元格信息来渲染不同的操作项,或者显示不同的提示信息。 -`S2` 的表格使用 `Canvas` 绘制,所以只会有一个 `dom` 元素,所有单元格对应的一组**数据结构**,里面存储了每个单元格的坐标,文本信息,交互状态等 [信息](/docs/api/basic-class/base-cell) +`S2` 的表格使用 `Canvas` 绘制,所以只会有一个 `dom` 元素,所有单元格对应的一组**数据结构**,里面存储了每个单元格的坐标,文本信息,交互状态等 [信息](/api/basic-class/base-cell) -`S2` 提供了一系列获取数据的 [API](/docs/api/basic-class/spreadsheet), 下面介绍一些常用的场景: +`S2` 提供了一系列获取数据的 [API](/api/basic-class/spreadsheet), 下面介绍一些常用的场景: ### 获取指定区域单元格节点 -在渲染完成后,访问 `s2.facet.getLayoutResult()` 获取到当前所有(**含不在可视范围的**)[单元格节点](/docs/api/basic-class/node)。 +在渲染完成后,访问 `s2.facet.getLayoutResult()` 获取到当前所有(**含不在可视范围的**)[单元格节点](/api/basic-class/node)。 一个节点 (Node) 对应一个 单元格 (Cell), 当节点在可视范围内时,会被实例化为单元格 (Cell), 可通过 `node.belongsCell` 获取 @@ -59,7 +59,7 @@ s2.on(S2Event.LAYOUT_AFTER_RENDER, () => { ::: -[查看更多](/docs/api/basic-class/base-facet) +[查看更多](/api/basic-class/base-facet) :::warning{title="注意"} 由于虚拟滚动的特性,获取到为不含可视区域外的单元格。 @@ -99,7 +99,7 @@ s2.facet.getSeriesNumberCells() ### 获取数值单元格 -更多请查看 [interaction API](/docs/api/basic-class/interaction) +更多请查看 [interaction API](/api/basic-class/interaction) ```ts // 当前可视范围内的数值单元格 @@ -175,7 +175,7 @@ s2.on(S2Event.GLOBAL_SELECTED, (cells) => { preview -也可以调用 [交互方法](/docs/manual/advanced/interaction/basic#%E8%B0%83%E7%94%A8%E4%BA%A4%E4%BA%92%E6%96%B9%E6%B3%95), 手动的获取 +也可以调用 [交互方法](/manual/advanced/interaction/basic#%E8%B0%83%E7%94%A8%E4%BA%A4%E4%BA%92%E6%96%B9%E6%B3%95), 手动的获取 ```ts // 获取所有激活的单元格 (包含不在可视范围内的) @@ -250,9 +250,9 @@ s2.dataSet.getCellMultiData({ ### 获取行/列数据 -表格初始化时,会将用户声明的数据配置 (s2DataConfig) 转换成内部所需要的数据集 (dataSet), 具体请查看 [数据流处理](/docs/manual/advanced/data-process/pivot) +表格初始化时,会将用户声明的数据配置 (s2DataConfig) 转换成内部所需要的数据集 (dataSet), 具体请查看 [数据流处理](/manual/advanced/data-process/pivot) -数据集的 [实例](/docs/api/basic-class/base-data-set) 挂载在 `s2.dataSet` 命名空间下,可访问它获取你需要的: +数据集的 [实例](/api/basic-class/base-data-set) 挂载在 `s2.dataSet` 命名空间下,可访问它获取你需要的: - 原生数据 - 汇总数据 @@ -391,4 +391,4 @@ s2.facet.getCellMeta(rowIndex, colIndex) ### 获取隐藏列数据 -[查看隐藏列头章节](/docs/manual/advanced/interaction/hide-columns/#%E8%8E%B7%E5%8F%96%E9%9A%90%E8%97%8F%E5%88%97%E5%A4%B4%E6%95%B0%E6%8D%AE) +[查看隐藏列头章节](/manual/advanced/interaction/hide-columns/#%E8%8E%B7%E5%8F%96%E9%9A%90%E8%97%8F%E5%88%97%E5%A4%B4%E6%95%B0%E6%8D%AE) diff --git a/s2-site/docs/manual/advanced/get-instance.zh.md b/s2-site/docs/manual/advanced/get-instance.zh.md index f5e05041d5..25fe08351b 100644 --- a/s2-site/docs/manual/advanced/get-instance.zh.md +++ b/s2-site/docs/manual/advanced/get-instance.zh.md @@ -7,7 +7,7 @@ order: 8 ## React 版本 -对于使用 `React` 组件 `SheetComponent` 这一类场景,如果需要获取到 [表格实例](/docs/api/basic-class/spreadsheet),进行一些进阶操作时,可以使用 `React.useRef` 和 `onMounted` 进行获取。 +对于使用 `React` 组件 `SheetComponent` 这一类场景,如果需要获取到 [表格实例](/api/basic-class/spreadsheet),进行一些进阶操作时,可以使用 `React.useRef` 和 `onMounted` 进行获取。 ### 使用 diff --git a/s2-site/docs/manual/advanced/interaction/basic.zh.md b/s2-site/docs/manual/advanced/interaction/basic.zh.md index 5192acb49f..3a3b83550b 100644 --- a/s2-site/docs/manual/advanced/interaction/basic.zh.md +++ b/s2-site/docs/manual/advanced/interaction/basic.zh.md @@ -30,7 +30,7 @@ tag: Updated | 行头刷选 | `S2Event.ROW_CELL_BRUSH_SELECTION` `S2Event.GLOBAL_SELECTED` | 批量选中刷选范围内的行头单元格,刷选过程中,显示刷选范围提示蒙层,刷选完成后,弹出 tooltip, 展示被刷选单元格信息(仅支持透视表) | | 列头刷选 | `S2Event.COL_CELL_BRUSH_SELECTION` `S2Event.GLOBAL_SELECTED` | 批量选中刷选范围内的列头单元格,刷选过程中,显示刷选范围提示蒙层,刷选完成后,弹出 tooltip, 展示被刷选单元格信息 | | 区间快捷多选 | `S2Event.GLOBAL_SELECTED` | 单选单元格 (start), 然后按住 `Shift` 再次选中一个单元格 (end), 选中两个单元格区间所有单元格 | -| 悬停 | `S2Event.GLOBAL_HOVER` | 鼠标悬停时,对应单元格高亮展示,如果是数值单元格,则默认 [十字高亮](/docs/manual/advanced/interaction/basic#行列联动高亮),可设置 `hoverHighlight: false` 关闭 | +| 悬停 | `S2Event.GLOBAL_HOVER` | 鼠标悬停时,对应单元格高亮展示,如果是数值单元格,则默认 [十字高亮](/manual/advanced/interaction/basic#行列联动高亮),可设置 `hoverHighlight: false` 关闭 | | 复制 | `S2Event.GLOBAL_COPIED` | 复制选中的单元格数据 | | 隐藏列头 | `S2Event.COL_CELL_EXPANDED` `S2Event.COL_CELL_HIDDEN` | 隐藏/展开 列头 | | 链接跳转 | `S2Event.GLOBAL_LINK_FIELD_JUMP` | 行头/列头/数值 链接跳转 | @@ -39,7 +39,7 @@ tag: Updated ## 交互事件 -[查看完整事件列表](/docs/api/general/s2-event) +[查看完整事件列表](/api/general/s2-event) - `global:xx`: 全局图表事件 - `layout:xx`: 布局改变事件 @@ -74,7 +74,7 @@ s2.on(S2Event.GLOBAL_KEYBOARD_DOWN, (event) => { }) ``` -如果使用的是 `@antv/s2-react` 或 `@antv/s2-vue`, 可以拿到 [S2 表格实例](/docs/manual/advanced/get-instance/) 后对所需事件进行监听,和 `@antv/s2` **使用方式完全一致** . +如果使用的是 `@antv/s2-react` 或 `@antv/s2-vue`, 可以拿到 [S2 表格实例](/manual/advanced/get-instance/) 后对所需事件进行监听,和 `@antv/s2` **使用方式完全一致** . ```ts import { S2Event, SpreadSheet } from '@antv/s2' @@ -94,7 +94,7 @@ function App() { ``` -同时 `React`, `Vue3` 版本提供了事件的隐射,也可以方便的使用更符合使用习惯的 `onDataCellClick`, `@dataCellClick` 的方式 ([查看所有 API](/docs/api/components/sheet-component)) +同时 `React`, `Vue3` 版本提供了事件的隐射,也可以方便的使用更符合使用习惯的 `onDataCellClick`, `@dataCellClick` 的方式 ([查看所有 API](/api/components/sheet-component)) > React @@ -137,7 +137,7 @@ window.addEventListener('mouseup', () => {}, true) ## 交互相关配置 -[查看具体 API 配置详情](/docs/api/basic-class/interaction#interaction) +[查看具体 API 配置详情](/api/basic-class/interaction#interaction) ```ts const s2Options = { @@ -149,7 +149,7 @@ const s2Options = { ## 内置交互 -> 如何修改交互默认样式?请查看 [主题配置](/docs/manual/basic/theme) 章节 +> 如何修改交互默认样式?请查看 [主题配置](/manual/basic/theme) 章节 ### 单选高亮 @@ -349,7 +349,7 @@ const s2Options = { preview -同时支持透视表,和明细表,点击叶子节点的列头后,显示隐藏列头按钮,点击隐藏后,会在紧邻的兄弟单元格显示一个展示按钮,和一个隐藏提示线,鼠标单击即可展开,可配置 `hiddenColumns` 实现 `默认隐藏` 和 `交互式隐藏`. 查看 [详情](/docs/manual/advanced/interaction/hide-columns/) 或 [示例](/examples/interaction/advanced#pivot-hide-columns) +同时支持透视表,和明细表,点击叶子节点的列头后,显示隐藏列头按钮,点击隐藏后,会在紧邻的兄弟单元格显示一个展示按钮,和一个隐藏提示线,鼠标单击即可展开,可配置 `hiddenColumns` 实现 `默认隐藏` 和 `交互式隐藏`. 查看 [详情](/manual/advanced/interaction/hide-columns/) 或 [示例](/examples/interaction/advanced#pivot-hide-columns) ```ts const s2DataConfig = { @@ -378,27 +378,27 @@ const s2Options = { preview -查看 [文档](/docs/manual/advanced/interaction/resize) 和 [示例](/examples/interaction/advanced#merge-cell) +查看 [文档](/manual/advanced/interaction/resize) 和 [示例](/examples/interaction/advanced#merge-cell) ### 合并单元格 preview -查看 [文档](/docs/manual/advanced/interaction/merge-cell) 和 [示例](/examples/interaction/advanced#merge-cell) +查看 [文档](/manual/advanced/interaction/merge-cell) 和 [示例](/examples/interaction/advanced#merge-cell) ### 链接跳转 preview -查看 [文档](/docs/manual/advanced/interaction/link-jump) 和 [示例](/examples/interaction/advanced#pivot-link-jump) +查看 [文档](/manual/advanced/interaction/link-jump) 和 [示例](/examples/interaction/advanced#pivot-link-jump) ### 滚动 -查看 [文档](/docs/manual/advanced/interaction/scroll) +查看 [文档](/manual/advanced/interaction/scroll) ### 复制与导出 -查看 [文档](/docs/manual/advanced/interaction/copy) +查看 [文档](/manual/advanced/interaction/copy) ### 重置交互 @@ -474,7 +474,7 @@ s2.interaction.removeIntercepts([InterceptType.HOVER, InterceptType.CLICK]); ## 调用 API -`S2` 内置了一些交互相关的 `API`,统一挂载在 `s2.interaction` 命名空间下,你可以在拿到 [SpreadSheet 实例](/docs/api/basic-class/spreadsheet) 后调用它们来实现你的效果,比如 `选中所有单元格`, `获取列头单元格` 等常用方法,具体请查看 [Interaction 实例类](/docs/api/basic-class/interaction) 和 [示例](/examples/interaction/basic/#event) +`S2` 内置了一些交互相关的 `API`,统一挂载在 `s2.interaction` 命名空间下,你可以在拿到 [SpreadSheet 实例](/api/basic-class/spreadsheet) 后调用它们来实现你的效果,比如 `选中所有单元格`, `获取列头单元格` 等常用方法,具体请查看 [Interaction 实例类](/api/basic-class/interaction) 和 [示例](/examples/interaction/basic/#event) ```ts const s2 = new PivotSheet() diff --git a/s2-site/docs/manual/advanced/interaction/custom.zh.md b/s2-site/docs/manual/advanced/interaction/custom.zh.md index 0f5ce9e0e8..bf9238deba 100644 --- a/s2-site/docs/manual/advanced/interaction/custom.zh.md +++ b/s2-site/docs/manual/advanced/interaction/custom.zh.md @@ -9,7 +9,7 @@ order: 1 这是一个自定义交互类的基本格式: -继承 `BaseEvent` 拿到当前表格实例 `this.spreadsheet`, 实现 `bindEvents` 方法,结合 `this.spreadsheet` 提供的 [一系列方法](/docs/api/basic-class/spreadsheet),自定义交互,最后表格初始化时会注册默认交互,和自定义交互。 +继承 `BaseEvent` 拿到当前表格实例 `this.spreadsheet`, 实现 `bindEvents` 方法,结合 `this.spreadsheet` 提供的 [一系列方法](/api/basic-class/spreadsheet),自定义交互,最后表格初始化时会注册默认交互,和自定义交互。 ```ts import { BaseEvent } from '@antv/s2'; diff --git a/s2-site/docs/manual/advanced/interaction/hide-columns.zh.md b/s2-site/docs/manual/advanced/interaction/hide-columns.zh.md index 12f9a7df16..bb41106c36 100644 --- a/s2-site/docs/manual/advanced/interaction/hide-columns.zh.md +++ b/s2-site/docs/manual/advanced/interaction/hide-columns.zh.md @@ -88,7 +88,7 @@ const s2Options = { ### 2. 透视表 -透视表存在多列头,需要指定列头对应的 [节点 id](/docs/api/basic-class/node), 如果是 [自定义列头](/manual/advanced/custom/custom-header#12-%E8%87%AA%E5%AE%9A%E4%B9%89%E5%88%97%E5%A4%B4) , 那么和明细表相同,指定 `field` 字段即可,这里不再赘述。 +透视表存在多列头,需要指定列头对应的 [节点 id](/api/basic-class/node), 如果是 [自定义列头](/manual/advanced/custom/custom-header#12-%E8%87%AA%E5%AE%9A%E4%B9%89%E5%88%97%E5%A4%B4) , 那么和明细表相同,指定 `field` 字段即可,这里不再赘述。
如何获取列头 ID? @@ -149,13 +149,13 @@ const s2Options = { ![preview](https://gw.alipayobjects.com/zos/antfincdn/LYrMG8bf5/660aa34c-5fce-4f62-b422-ee6d3b5478d1.png) -还可以集成分析组件,通过改变配置的方式,实现动态隐藏列头,具体请查看 [分析组件](/docs/manual/basic/analysis/switcher/) +还可以集成分析组件,通过改变配置的方式,实现动态隐藏列头,具体请查看 [分析组件](/manual/basic/analysis/switcher/) preview ## 3. 手动隐藏 - 通过实例方法 -[查看所有 API](/docs/api/basic-class/interaction) +[查看所有 API](/api/basic-class/interaction) ```ts const s2 = new PivotSheet(...) @@ -185,7 +185,7 @@ s2.on( ); ``` -也可以访问存储在 [`store`](/docs/api/basic-class/store) 的 `hiddenColumnsDetail` 主动获取 +也可以访问存储在 [`store`](/api/basic-class/store) 的 `hiddenColumnsDetail` 主动获取 ```ts const hiddenColumnsDetail = s2.store.get('hiddenColumnsDetail') diff --git a/s2-site/docs/manual/advanced/interaction/scroll.zh.md b/s2-site/docs/manual/advanced/interaction/scroll.zh.md index 50b5d83b7c..dfc5eeb5b0 100644 --- a/s2-site/docs/manual/advanced/interaction/scroll.zh.md +++ b/s2-site/docs/manual/advanced/interaction/scroll.zh.md @@ -77,7 +77,7 @@ const s2Options = { - `S2Event.GLOBAL_SCROLL`: 单元格滚动,数值/行头单元格滚动时都会触发 - `S2Event.ROW_CELL_SCROLL`: 行头单元格滚动 -同时:对于 `s2-react` 和 `s2-vue` 版本,也提供了事件的隐射,具体请查看 [API 文档](/docs/api/components/sheet-component) +同时:对于 `s2-react` 和 `s2-vue` 版本,也提供了事件的隐射,具体请查看 [API 文档](/api/components/sheet-component) 需要注意的是:行头单元格只会在**固定行头时**才会显示滚动条,且只会有**水平滚动条**, 所以拿到的 `scrollY` 永远都是 `0` diff --git a/s2-site/docs/manual/advanced/sheet/strategy.zh.md b/s2-site/docs/manual/advanced/sheet/strategy.zh.md index f0b8dc3e5c..2b904c6b8b 100644 --- a/s2-site/docs/manual/advanced/sheet/strategy.zh.md +++ b/s2-site/docs/manual/advanced/sheet/strategy.zh.md @@ -8,7 +8,7 @@ tag: Updated 为了满足更多的分析场景,S2 提供开箱即用的场景表组件 —— 趋势分析表。借助它,你可以非常方便的实现单元格内展示多指标的场景表格。 -如图所示,该类表格的表形态特点在于可以在**同一个数据单元格**和**列头单元格内**展示多个指标数据,用于需要**关注时间趋势下的数据指标**,**查看同环比**等场景。行头可以 [自定义层级结构](/docs/manual/advanced/custom/custom-tree)。因此有此类分析需求时,可以直接使用该组件。 +如图所示,该类表格的表形态特点在于可以在**同一个数据单元格**和**列头单元格内**展示多个指标数据,用于需要**关注时间趋势下的数据指标**,**查看同环比**等场景。行头可以 [自定义层级结构](/manual/advanced/custom/custom-tree)。因此有此类分析需求时,可以直接使用该组件。 preview @@ -16,9 +16,9 @@ tag: Updated **趋势分析表组件**使用了 S2 提供的各种能力进行融合,所以建议在阅读本章前,请确保你已经阅读过以下章节: -- [基本概念](/docs/manual/basic/base-concept) -- [字段标记](/docs/manual/basic/conditions/) -- [自定义行列头](/docs/manual/advanced/custom/custom-tree) +- [基本概念](/manual/basic/base-concept) +- [字段标记](/manual/basic/conditions/) +- [自定义行列头](/manual/advanced/custom/custom-tree) ::: @@ -184,7 +184,7 @@ const s2DataConfig = { :::info{title="提示"} -趋势分析表的 `Tooltip`, 使用 `S2` 提供的 [自定义能力](/docs/manual/basic/tooltip#%E8%87%AA%E5%AE%9A%E4%B9%89-tooltip-%E5%86%85%E5%AE%B9) 分别对 `行头 (rowCell)`, `列头 (colCell)`, `数值 (dataCell)` 进行了 [定制](https://github.com/antvis/S2/blob/f35ff01400384cd2f3d84705e9daf75fc11b0149/packages/s2-react/src/components/sheets/strategy-sheet/index.tsx#L105). +趋势分析表的 `Tooltip`, 使用 `S2` 提供的 [自定义能力](/manual/basic/tooltip#%E8%87%AA%E5%AE%9A%E4%B9%89-tooltip-%E5%86%85%E5%AE%B9) 分别对 `行头 (rowCell)`, `列头 (colCell)`, `数值 (dataCell)` 进行了 [定制](https://github.com/antvis/S2/blob/f35ff01400384cd2f3d84705e9daf75fc11b0149/packages/s2-react/src/components/sheets/strategy-sheet/index.tsx#L105). ::: diff --git a/s2-site/docs/manual/basic/sort/basic.zh.md b/s2-site/docs/manual/basic/sort/basic.zh.md index 53da331934..dac137ee3d 100644 --- a/s2-site/docs/manual/basic/sort/basic.zh.md +++ b/s2-site/docs/manual/basic/sort/basic.zh.md @@ -10,7 +10,7 @@ S2 支持对表格数据进行多种形式的排序,如行/列头维值根据 ## 使用 -通过在 [s2DataConfig](/docs/api/general/s2-data-config) 中传入 [sortParams](/docs/api/general/s2-data-config#sortparams) 启用排序 +通过在 [s2DataConfig](/api/general/s2-data-config) 中传入 [sortParams](/api/general/s2-data-config#sortparams) 启用排序 ### sortParams @@ -92,7 +92,7 @@ const s2DataConfig = { > 在 S2 中怎么开启总计/小计? > > 1. 使用 data 数据中的聚合数据。 -> 2. 使用 S2 中提供的聚合计算。​📊 查看文档 [小计总计配置](/docs/api/general/s2-options#totals) +> 2. 使用 S2 中提供的聚合计算。​📊 查看文档 [小计总计配置](/api/general/s2-options#totals) - `sortByMeasure` 取 `TOTAL_VALUE` - `sortFieldId` 可以取任意维度字段(非末级的 `province` 或末级的 `city`) diff --git a/s2-site/docs/manual/basic/theme.zh.md b/s2-site/docs/manual/basic/theme.zh.md index 6ced5064c5..9897261e77 100644 --- a/s2-site/docs/manual/basic/theme.zh.md +++ b/s2-site/docs/manual/basic/theme.zh.md @@ -29,7 +29,7 @@ S2 中内置了 **4** 套开箱即用的主题配置,也提供了强大的主 ### 色板 Palette -色板的定义为 [Palette](/docs/api/general/s2-theme#palette),当生成主题 schema 时会从中取用颜色,而它的颜色则来自于标准色板中,Palette 的关键属性有: +色板的定义为 [Palette](/api/general/s2-theme#palette),当生成主题 schema 时会从中取用颜色,而它的颜色则来自于标准色板中,Palette 的关键属性有: - `basicColors`:基础颜色,共 15 个色彩位,本质上确定了表格的配色方案,生成主题 schema 时会从 basicColors 固定索引上取色,如行头背景颜色固定会取 `basicColors[1]` 的颜色 - `basicColorRelations`:basicColors 与标准色板的对应关系,如内置的 colorful 主题中,行头背景色 `basicColors[1]` 是取用标准色板中的索引 0 的颜色 @@ -38,7 +38,7 @@ S2 中内置了 **4** 套开箱即用的主题配置,也提供了强大的主 ### 主题 Schema -主题 schema 的定义为 [S2Theme](/docs/api/general/s2-theme#s2theme),其详尽地描述了单元格、交互等主题样式,属性包含颜色、线条粗细、文字大小、文字对齐方式等。整个 schema 中,所有的颜色会从 [Palette](/docs/api/general/s2-theme#palette) 中取用: +主题 schema 的定义为 [S2Theme](/api/general/s2-theme#s2theme),其详尽地描述了单元格、交互等主题样式,属性包含颜色、线条粗细、文字大小、文字对齐方式等。整个 schema 中,所有的颜色会从 [Palette](/api/general/s2-theme#palette) 中取用: - `basicColors`:基础颜色,如角/列/行头背景,字体/icon 颜色。 - `semanticColors`:语义颜色,如红色、绿色、黄色指代的色值。 @@ -134,7 +134,7 @@ S2 内置 `4` 套主题效果: 如果内置的主题不满意你的要求,那么你可以通过自定义 `schema` 的方式重写特定的配置。 -此时你可以调用 `s2.setTheme` 或者 `s2.setThemeCfg()` 配置 `theme` 对象。[查看完整 Schema 配置](/docs/api/general/s2-theme#s2theme): +此时你可以调用 `s2.setTheme` 或者 `s2.setThemeCfg()` 配置 `theme` 对象。[查看完整 Schema 配置](/api/general/s2-theme#s2theme): ```js const s2 = new PivotSheet(container, s2DataConfig, s2Options); @@ -216,7 +216,7 @@ s2.setTheme({ ### 自定义色板 -自定义 `schema` 虽然灵活,但是心智负担比较重,需要对 `schema` 的结构有比较详细的了解。因此我们还提供了自定义色板功能,此时你需要为 `setThemeCfg` 配置`palette`对象。[查看完整色板配置](/docs/api/general/s2-theme#palette): +自定义 `schema` 虽然灵活,但是心智负担比较重,需要对 `schema` 的结构有比较详细的了解。因此我们还提供了自定义色板功能,此时你需要为 `setThemeCfg` 配置`palette`对象。[查看完整色板配置](/api/general/s2-theme#palette): #### 自选色板颜色 diff --git a/s2-site/docs/manual/basic/tooltip.zh.md b/s2-site/docs/manual/basic/tooltip.zh.md index 7e43161b70..be3f927358 100644 --- a/s2-site/docs/manual/basic/tooltip.zh.md +++ b/s2-site/docs/manual/basic/tooltip.zh.md @@ -42,7 +42,7 @@ import "@antv/s2-vue/dist/s2-vue.min.css"; ## 使用 -在 `s2Options` 中配置 [tooltip](/docs/api/general/s2-options#tooltip) 字段,默认作用于**所有**单元格。 +在 `s2Options` 中配置 [tooltip](/api/general/s2-options#tooltip) 字段,默认作用于**所有**单元格。 ```ts const s2Options = { @@ -201,7 +201,7 @@ const s2Options = { }; ``` -同时 `content` 还支持回调的方式,可以根据 [当前单元格信息](/docs/api/basic-class/interaction) 和 默认 `tooltip` 的详细信息,灵活的自定义内容 +同时 `content` 还支持回调的方式,可以根据 [当前单元格信息](/api/basic-class/interaction) 和 默认 `tooltip` 的详细信息,灵活的自定义内容 ```ts const TooltipContent = (props) =>
...
@@ -291,7 +291,7 @@ s2.showTooltip({ #### 自定义 Tooltip 操作项 @antv/s2-react @antv/s2-vue 除了默认提供的操作项,还可以配置 `operation.menu` 自定义操作项,支持嵌套,也可以监听各自的 `onClick` 点击事件,可以拿到当前 `tooltip` -对应的菜单项信息以及 [单元格信息](/docs/api/basic-class/base-cell). +对应的菜单项信息以及 [单元格信息](/api/basic-class/base-cell). :::info{title="注意"} 在 `@antv/s2-react` 中,默认提供菜单配置 (props), 需要通过 `render` 显示的指定操作项菜单组件,如:Ant Design [Menu 组件](https://ant-design.antgroup.com/components/menu-cn#api), 可以根据项目中实际使用的 `antd@v4` 或 `antd@v5` 不同版本,对使用方式进行调整。 @@ -363,7 +363,7 @@ const s2Options = { }; ``` -还可以通过 `visible` 参数控制当前操作项是否显示,支持传入一个回调,可以根据当前 [单元格信息](/docs/api/basic-class/base-cell) 动态显示 +还可以通过 `visible` 参数控制当前操作项是否显示,支持传入一个回调,可以根据当前 [单元格信息](/api/basic-class/base-cell) 动态显示 ```ts const s2Options = { @@ -546,8 +546,8 @@ const s2Options = { - 行列头**点击**时显示 `tooltip`, 单元格文字**被省略**时悬停显示 `tooltip` - 数值单元格悬停超过 **800ms** 显示 `tooltip` -比如想自定义成鼠标悬停行头时显示 `tooltip`, 可通过自定义交互 [详情](/docs/manual/advanced/interaction/custom), -监听行头单元格的 [交互事件](/docs/manual/advanced/interaction/basic#%E4%BA%A4%E4%BA%92%E4%BA%8B%E4%BB%B6) `S2Event.ROW_CELL_HOVER` +比如想自定义成鼠标悬停行头时显示 `tooltip`, 可通过自定义交互 [详情](/manual/advanced/interaction/custom), +监听行头单元格的 [交互事件](/manual/advanced/interaction/basic#%E4%BA%A4%E4%BA%92%E4%BA%8B%E4%BB%B6) `S2Event.ROW_CELL_HOVER` . [示例](/examples/interaction/custom#row-col-hover-tooltip) ```ts @@ -580,7 +580,7 @@ const s2Options = { ``` -如果使用的是 `React` 组件,也可以使用 [单元格回调函数](/docs/api/components/sheet-component) +如果使用的是 `React` 组件,也可以使用 [单元格回调函数](/api/components/sheet-component) 来进行自定义。[示例](/examples/react-component/tooltip#custom-hover-show-tooltip) ```tsx diff --git a/s2-site/docs/manual/basic/totals.zh.md b/s2-site/docs/manual/basic/totals.zh.md index f442582154..1431636291 100644 --- a/s2-site/docs/manual/basic/totals.zh.md +++ b/s2-site/docs/manual/basic/totals.zh.md @@ -79,7 +79,7 @@ order: 5 ### 1. 显示配置 -配置 [S2Options](/docs/api/general/s2-options#total) 的 `totals` 属性来实现是否展示行列小计总计以及显示位置,类型如下: +配置 [S2Options](/api/general/s2-options#total) 的 `totals` 属性来实现是否展示行列小计总计以及显示位置,类型如下: diff --git a/s2-site/docs/manual/extended-reading/layout/table.zh.md b/s2-site/docs/manual/extended-reading/layout/table.zh.md index 8735797c2a..1f103b178e 100644 --- a/s2-site/docs/manual/extended-reading/layout/table.zh.md +++ b/s2-site/docs/manual/extended-reading/layout/table.zh.md @@ -15,7 +15,7 @@ order: 2 s2-table-group -明细表的[列头布局算法](/docs/manual/advanced/layout/pivot#%E5%B1%82%E7%BA%A7%E7%BB%93%E6%9E%84)、内容区域的[按需渲染](/docs/manual/advanced/layout/pivot#按需渲染)和透视表保持一致,在此不再赘述。 +明细表的[列头布局算法](/manual/advanced/layout/pivot#%E5%B1%82%E7%BA%A7%E7%BB%93%E6%9E%84)、内容区域的[按需渲染](/manual/advanced/layout/pivot#按需渲染)和透视表保持一致,在此不再赘述。 ## 序列号 diff --git a/s2-site/docs/manual/extended-reading/performance.zh.md b/s2-site/docs/manual/extended-reading/performance.zh.md index 8af090db0a..19614c6a27 100644 --- a/s2-site/docs/manual/extended-reading/performance.zh.md +++ b/s2-site/docs/manual/extended-reading/performance.zh.md @@ -10,7 +10,7 @@ tag: Updated `S2` 可以用于实现明细表,也可以实现透视表,还可以实现趋势分析表等。 -为了更好的理解本文,在阅读本文前,希望你能熟悉 `S2` 的使用,对 [基本概念](/docs/manual/basic/base-concept) 有初步认知。 +为了更好的理解本文,在阅读本文前,希望你能熟悉 `S2` 的使用,对 [基本概念](/manual/basic/base-concept) 有初步认知。 ## 性能解读 @@ -21,7 +21,7 @@ tag: Updated * 通过配置信息将原始数据处理,转换为以 行、列 纬度值为 `path` 的多维数组 * 在此之后,通过 `hierarchy` 来改变自动生成的层级结构。然后通过 `layout` 更改任意行、列、单元格的坐标信息 * 最后由 `layoutResult` 来确定行、列的笛卡尔交集的 `dataCell` 数据信息 - + 如下图所示: ![s2-data-process](https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*TFcyS6P0IPsAAAAAAAAAAAAADmJ7AQ/original) diff --git a/s2-site/docs/manual/faq.zh.md b/s2-site/docs/manual/faq.zh.md index 99eac51900..1aad5d1e37 100644 --- a/s2-site/docs/manual/faq.zh.md +++ b/s2-site/docs/manual/faq.zh.md @@ -61,35 +61,35 @@ await s2.render(false) const pivotSheet = new PivotSheet(document.getElementById('container'), dataCfg, options); ``` -更新 options: [可选项](/docs/api/general/s2-options),会与上次的数据进行合并 +更新 options: [可选项](/api/general/s2-options),会与上次的数据进行合并 ```ts pivotSheet.setOptions({ ... }) await pivotSheet.render(false) // 重新渲染,不更新数据 ``` -重置 options: [可选项](/docs/api/general/s2-options),直接使用传入的 option,不会与上次的数据进行合并 +重置 options: [可选项](/api/general/s2-options),直接使用传入的 option,不会与上次的数据进行合并 ```ts pivotSheet.setOptions({ ... }, true) await pivotSheet.render(false) // 重新渲染,不更新数据 ``` -更新 dataCfg: [可选项](/docs/api/general/s2-data-config),会与上次的数据进行合并 +更新 dataCfg: [可选项](/api/general/s2-data-config),会与上次的数据进行合并 ```ts pivotSheet.setDataCfg({ ... }) await pivotSheet.render(true) // 重新渲染,且更新数据 ``` -重置 dataCfg: [可选项](/docs/api/general/s2-data-config),直接使用传入的 dataCfg,不会与上次的数据进行合并 +重置 dataCfg: [可选项](/api/general/s2-data-config),直接使用传入的 dataCfg,不会与上次的数据进行合并 ```ts pivotSheet.setDataCfg({ ... }, true) await pivotSheet.render(true) // 重新渲染,且更新数据 ``` -更新 theme: [可选项](/docs/api/general/s2-theme) +更新 theme: [可选项](/api/general/s2-theme) ```ts pivotSheet.setThemeCfg({ ... }) @@ -128,19 +128,19 @@ await s2.render(false) ### 表格可以根据外部容器的宽高自动撑满吗? -可以,请查看 [这篇文章](/docs/manual/advanced/adaptive) +可以,请查看 [这篇文章](/manual/advanced/adaptive) ### 如何获取单元格数据? -请查看 [这篇文章](/docs/manual/advanced/get-cell-data) 和 [示例](/examples/analysis/get-data/#get-cell-data) +请查看 [这篇文章](/manual/advanced/get-cell-data) 和 [示例](/examples/analysis/get-data/#get-cell-data) ### 为什么 Tooltip 在 `@antv/s2` 中不显示,在 `@antv/s2-react` `@antv/s2-vue` 中可以正常显示? -请查看 [Tooltip 注意事项](/docs/manual/basic/tooltip#%E7%AE%80%E4%BB%8B) +请查看 [Tooltip 注意事项](/manual/basic/tooltip#%E7%AE%80%E4%BB%8B) ### 如果在 `@antv/s2` 中使用 tooltip ? -请查看 [Tooltip 文档](/docs/manual/basic/tooltip) 和 [示例](/examples/react-component/tooltip/#custom-content-base) +请查看 [Tooltip 文档](/manual/basic/tooltip) 和 [示例](/examples/react-component/tooltip/#custom-content-base) ### 如何在点击或悬停单元格的时候自定义 Tooltip? @@ -202,11 +202,11 @@ s2.showTooltip({ ... }) ### 如何在 Vue 中自定义 Tooltip? -可直接使用 S2 的 Vue3 版本 `@antv/s2-vue`, 或查看 [在 Vue3 中自定义](/docs/manual/basic/tooltip/#在-vue3-中自定义) +可直接使用 S2 的 Vue3 版本 `@antv/s2-vue`, 或查看 [在 Vue3 中自定义](/manual/basic/tooltip/#在-vue3-中自定义) ### 表格支持导出 `Excel` 吗? -支持,请查看 [这篇文章](/docs/manual/basic/analysis/export), 或者 [示例](/examples/react-component/export#export) +支持,请查看 [这篇文章](/manual/basic/analysis/export), 或者 [示例](/examples/react-component/export#export) ### 表格导出乱码怎么办? @@ -228,11 +228,11 @@ s2.showTooltip({ ... }) ### 如何自定义文字的大小和对齐方式? -可以配置自定义主题,查看 [使用文档](/docs/manual/basic/theme) 和 [示例](/examples/theme/custom#custom-manual-palette) +可以配置自定义主题,查看 [使用文档](/manual/basic/theme) 和 [示例](/examples/theme/custom#custom-manual-palette) ### 如何自定义单元格宽高? -请查看 [使用文档](/docs/manual/advanced/custom/cell-size#%E8%B0%83%E6%95%B4%E5%88%97%E5%A4%B4%E5%8D%95%E5%85%83%E6%A0%BC%E5%AE%BD%E9%AB%98) 和 [示例](/examples/gallery#category-%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A1%8C%E5%88%97%E5%AE%BD%E9%AB%98) +请查看 [使用文档](/manual/advanced/custom/cell-size#%E8%B0%83%E6%95%B4%E5%88%97%E5%A4%B4%E5%8D%95%E5%85%83%E6%A0%BC%E5%AE%BD%E9%AB%98) 和 [示例](/examples/gallery#category-%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A1%8C%E5%88%97%E5%AE%BD%E9%AB%98) ### 如何关闭 hover 单元格出现的黑色边框? @@ -430,11 +430,11 @@ class CustomColCell extends ColCell { -配套的 [分析组件](/docs/manual/basic/analysis/editable-mode),目前还没有 `@antv/s2-angular` 的开发计划,欢迎社区一起建设 👏🏻. +配套的 [分析组件](/manual/basic/analysis/editable-mode),目前还没有 `@antv/s2-angular` 的开发计划,欢迎社区一起建设 👏🏻. ### 如何贡献代码? -请查看 [贡献指南](/docs/manual/contribution) +请查看 [贡献指南](/manual/contribution) ### 为什么在小程序上面表格无法显示? @@ -466,7 +466,7 @@ class CustomColCell extends ColCell { - 尽量抹去一些带有你自己业务语义的一些名词和描述 -在提出问题前,请确保你已经阅读过 [官方文档](/docs/manual/introduction) 和 [常见问题](/docs/manual/faq), 并且已经搜索查阅过相关 [Issues 列表](https://github.com/antvis/S2/issues?q=is%3Aissue+is%3Aclosed). +在提出问题前,请确保你已经阅读过 [官方文档](/manual/introduction) 和 [常见问题](/manual/faq), 并且已经搜索查阅过相关 [Issues 列表](https://github.com/antvis/S2/issues?q=is%3Aissue+is%3Aclosed). 强烈建议阅读: diff --git a/s2-site/docs/manual/migration-v2.zh.md b/s2-site/docs/manual/migration-v2.zh.md index 3e792564fc..11fcc46280 100644 --- a/s2-site/docs/manual/migration-v2.zh.md +++ b/s2-site/docs/manual/migration-v2.zh.md @@ -651,17 +651,20 @@ render 函数的参数从 `boolean` 扩展为 `boolean | object`, 当为 `boolea + s2.render({ reloadData: false }) // 等价于 s2.render(false) + s2.render({ + reloadData: false, -+ reBuildHiddenColumnsDetail: false, ++ rebuildHiddenColumnsDetail: false, + }); ``` `reBuildDataSet` 重命名为 `rebuildDataSet`: +`reBuildHiddenColumnsDetail` 重命名为 `rebuildHiddenColumnsDetail`: ```diff -+ s2.render({ -- reBuildDataSet: false, -+ rebuildDataSet: false, -+ }); +s2.render({ +- reBuildDataSet: false, ++ rebuildDataSet: false, +- reBuildHiddenColumnsDetail: false, ++ rebuildHiddenColumnsDetail: false, +}); ``` #### 小计总计配置参数变更 @@ -1000,6 +1003,19 @@ splitLine: { } ``` +#### 单元格默认 padding 变更 + +`paddingTop` 和 `paddingBottom` 调整为 `8px`. + +```diff +{ +- top: 4, ++ top: 8, +- bottom: 4, ++ bottom: 8 +} +``` + ### 组件层 (s2-react) @antv/s2-react #### 移除 Ant Design 组件库依赖 diff --git a/s2-site/examples/custom/custom-icon/demo/custom-header-action-icon.ts b/s2-site/examples/custom/custom-icon/demo/custom-header-action-icon.ts index 3e4c729c9e..ba90a9b577 100644 --- a/s2-site/examples/custom/custom-icon/demo/custom-header-action-icon.ts +++ b/s2-site/examples/custom/custom-icon/demo/custom-header-action-icon.ts @@ -26,9 +26,9 @@ fetch( displayCondition: (meta) => meta.level > 0, onClick: (options) => { console.log(options); - const { meta, event } = options; - - meta.spreadsheet.handleGroupSort(event, meta); + }, + onHover: (options) => { + console.log(options); }, }, { @@ -38,7 +38,7 @@ fetch( onClick: (options) => { const { meta, event } = options; - meta.spreadsheet.tooltip.show({ + meta.spreadsheet.showTooltip({ position: { x: event.clientX, y: event.clientY }, content: `
ColTooltip
`, }); @@ -51,7 +51,7 @@ fetch( onClick: (options) => { const { meta, event } = options; - meta.spreadsheet.tooltip.show({ + meta.spreadsheet.showTooltip({ position: { x: event.clientX, y: event.clientY }, content: `
CornerTooltip
`, }); @@ -66,7 +66,7 @@ fetch( onClick: (options) => { const { meta, event } = options; - meta.spreadsheet.tooltip.show({ + meta.spreadsheet.showTooltip({ position: { x: event.clientX, y: event.clientY }, content: `
RowTooltip
`, }); @@ -83,7 +83,7 @@ fetch( content.innerHTML = '我是 RowTooltip 自定义内容'; - meta.spreadsheet.tooltip.show({ + meta.spreadsheet.showTooltip({ position: { x: event.clientX, y: event.clientY }, content, });