diff --git a/packages/s2-core/__tests__/data/data-multi-line-text.ts b/packages/s2-core/__tests__/data/data-multi-line-text.ts index 03c5d92c67..585d10947f 100644 --- a/packages/s2-core/__tests__/data/data-multi-line-text.ts +++ b/packages/s2-core/__tests__/data/data-multi-line-text.ts @@ -1,6 +1,6 @@ import type { S2DataConfig } from '../../src'; -export const MultiLineTextDataCfg: S2DataConfig = { +export const PivotSheetMultiLineTextDataCfg: S2DataConfig = { fields: { rows: ['province', 'city'], columns: ['type', 'sub_type'], @@ -523,3 +523,10 @@ export const MultiLineTextDataCfg: S2DataConfig = { }, ], }; + +export const TableSheetMultiLineTextDataCfg = { + ...PivotSheetMultiLineTextDataCfg, + fields: { + columns: ['province', 'city', 'type', 'sub_type', 'number'], + }, +}; 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 d46cca3fa0..6e1f64174a 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 @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`SpreadSheet Multi Line Text Tests should custom three max text lines 1`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should custom three max text lines 1`] = ` Array [ Object { "actualText": "序号", @@ -62,7 +62,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should custom three max text lines 2`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should custom three max text lines 2`] = ` Array [ Object { "actualText": "1", @@ -89,7 +89,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should custom three max text lines 3`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should custom three max text lines 3`] = ` Array [ Object { "actualText": "家具", @@ -153,7 +153,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should custom three max text lines 4`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should custom three max text lines 4`] = ` Array [ Object { "actualText": "浙江省", @@ -182,7 +182,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should custom three max text lines 5`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should custom three max text lines 5`] = ` Array [ Object { "actualText": "236723672361111", @@ -298,7 +298,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should custom two max text lines 1`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should custom two max text lines 1`] = ` Array [ Object { "actualText": "序号", @@ -359,7 +359,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should custom two max text lines 2`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should custom two max text lines 2`] = ` Array [ Object { "actualText": "1", @@ -397,7 +397,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should custom two max text lines 3`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should custom two max text lines 3`] = ` Array [ Object { "actualText": "家具", @@ -459,7 +459,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should custom two max text lines 4`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should custom two max text lines 4`] = ` Array [ Object { "actualText": "浙江省", @@ -498,7 +498,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should custom two max text lines 5`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should custom two max text lines 5`] = ` Array [ Object { "actualText": "236723672361111", @@ -680,7 +680,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should default render two line text 1`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should default render one line text 1`] = ` Array [ Object { "actualText": "序号", @@ -740,7 +740,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should default render two line text 2`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should default render one line text 2`] = ` Array [ Object { "actualText": "1", @@ -778,7 +778,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should default render two line text 3`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should default render one line text 3`] = ` Array [ Object { "actualText": "家具", @@ -838,7 +838,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should default render two line text 4`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should default render one line text 4`] = ` Array [ Object { "actualText": "浙江省", @@ -876,7 +876,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should default render two line text 5`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should default render one line text 5`] = ` Array [ Object { "actualText": "2367236723...", @@ -1079,7 +1079,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should force adaptive adjust cell height if custom cell style less than actual text height 1`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should force adaptive adjust cell height if custom cell style less than actual text height 1`] = ` Array [ Object { "actualText": "序号", @@ -1140,7 +1140,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should force adaptive adjust cell height if custom cell style less than actual text height 2`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should force adaptive adjust cell height if custom cell style less than actual text height 2`] = ` Array [ Object { "actualText": "1", @@ -1178,7 +1178,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should force adaptive adjust cell height if custom cell style less than actual text height 3`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should force adaptive adjust cell height if custom cell style less than actual text height 3`] = ` Array [ Object { "actualText": "家具", @@ -1240,7 +1240,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should force adaptive adjust cell height if custom cell style less than actual text height 4`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should force adaptive adjust cell height if custom cell style less than actual text height 4`] = ` Array [ Object { "actualText": "浙江省", @@ -1279,7 +1279,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should force adaptive adjust cell height if custom cell style less than actual text height 5`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should force adaptive adjust cell height if custom cell style less than actual text height 5`] = ` Array [ Object { "actualText": "236723672361111", @@ -1461,7 +1461,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should not adaptive adjust cell height if custom cell style more than actual text height 1`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height 1`] = ` Array [ Object { "actualText": "序号", @@ -1522,7 +1522,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should not adaptive adjust cell height if custom cell style more than actual text height 2`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height 2`] = ` Array [ Object { "actualText": "数量数量数量数量数量数...", @@ -1551,9 +1551,9 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should not adaptive adjust cell height if custom cell style more than actual text height 3`] = `Array []`; +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height 3`] = `Array []`; -exports[`SpreadSheet Multi Line Text Tests should not adaptive adjust cell height if custom cell style more than actual text height 4`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height 4`] = ` Array [ Object { "actualText": "236723672361111", @@ -1625,7 +1625,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should not render word wrap text 1`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not render word wrap text 1`] = ` Array [ Object { "actualText": "序号", @@ -1685,7 +1685,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should not render word wrap text 2`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not render word wrap text 2`] = ` Array [ Object { "actualText": "1", @@ -1723,7 +1723,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should not render word wrap text 3`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not render word wrap text 3`] = ` Array [ Object { "actualText": "家具", @@ -1783,7 +1783,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should not render word wrap text 4`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not render word wrap text 4`] = ` Array [ Object { "actualText": "浙江省", @@ -1821,7 +1821,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should not render word wrap text 5`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not render word wrap text 5`] = ` Array [ Object { "actualText": "236723672361111", @@ -2024,7 +2024,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should render custom text overflow text 1`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should render custom text overflow text 1`] = ` Array [ Object { "actualText": "序号", @@ -2084,7 +2084,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should render custom text overflow text 2`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should render custom text overflow text 2`] = ` Array [ Object { "actualText": "1", @@ -2122,7 +2122,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should render custom text overflow text 3`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should render custom text overflow text 3`] = ` Array [ Object { "actualText": "家具", @@ -2182,7 +2182,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should render custom text overflow text 4`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should render custom text overflow text 4`] = ` Array [ Object { "actualText": "浙江省", @@ -2220,7 +2220,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests should render custom text overflow text 5`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should render custom text overflow text 5`] = ` Array [ Object { "actualText": "236723@@@", @@ -2422,3 +2422,4746 @@ Array [ }, ] `; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should custom three max text lines 1`] = ` +Array [ + Object { + "actualText": "序号", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 56, + "multiLineActualTexts": Array [ + "序号", + ], + "originalText": "序号", + "width": 80, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should custom three max text lines 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, + }, + Object { + "actualText": "4", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "4", + ], + "originalText": "4", + "width": 80, + }, + Object { + "actualText": "5", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "5", + ], + "originalText": "5", + "width": 80, + }, + Object { + "actualText": "6", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "6", + ], + "originalText": "6", + "width": 80, + }, + Object { + "actualText": "7", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "7", + ], + "originalText": "7", + "width": 80, + }, + Object { + "actualText": "8", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "8", + ], + "originalText": "8", + "width": 80, + }, + Object { + "actualText": "9", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "9", + ], + "originalText": "9", + "width": 80, + }, + Object { + "actualText": "10", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 30, + "multiLineActualTexts": Array [ + "10", + ], + "originalText": "10", + "width": 80, + }, + Object { + "actualText": "11", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "11", + ], + "originalText": "11", + "width": 80, + }, + Object { + "actualText": "12", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 30, + "multiLineActualTexts": Array [ + "12", + ], + "originalText": "12", + "width": 80, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should custom three max text lines 3`] = ` +Array [ + Object { + "actualText": "序号", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 56, + "multiLineActualTexts": Array [ + "序号", + ], + "originalText": "序号", + "width": 80, + }, + Object { + "actualText": "省份", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 56, + "multiLineActualTexts": Array [ + "省份", + ], + "originalText": "省份", + "width": 103, + }, + Object { + "actualText": "城市城市城市城市城市城市城市城市城市城市...", + "actualTextHeight": 48, + "actualTextWidth": 253, + "height": 56, + "multiLineActualTexts": Array [ + "城市城市城市城", + "市城市城市城市", + "城市城市城市...", + ], + "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", + "width": 103, + }, + Object { + "actualText": "类别类别类别类别类别类别类别类别类别类别", + "actualTextHeight": 48, + "actualTextWidth": 243, + "height": 56, + "multiLineActualTexts": Array [ + "类别类别类别类", + "别类别类别类别", + "类别类别类别", + ], + "originalText": "类别类别类别类别类别类别类别类别类别类别", + "width": 103, + }, + Object { + "actualText": "子类别", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 56, + "multiLineActualTexts": Array [ + "子类别", + ], + "originalText": "子类别", + "width": 103, + }, + Object { + "actualText": "数量数量数量数量数量数量数量数量数量数量...", + "actualTextHeight": 48, + "actualTextWidth": 253, + "height": 56, + "multiLineActualTexts": Array [ + "数量数量数量数", + "量数量数量数量", + "数量数量数量...", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "width": 103, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should custom three max text lines 4`] = `Array []`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should custom three max text lines 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": "4", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "4", + ], + "originalText": "4", + "width": 80, + }, + Object { + "actualText": "5", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "5", + ], + "originalText": "5", + "width": 80, + }, + Object { + "actualText": "6", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "6", + ], + "originalText": "6", + "width": 80, + }, + Object { + "actualText": "7", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "7", + ], + "originalText": "7", + "width": 80, + }, + Object { + "actualText": "8", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "8", + ], + "originalText": "8", + "width": 80, + }, + Object { + "actualText": "9", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "9", + ], + "originalText": "9", + "width": 80, + }, + Object { + "actualText": "10", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 30, + "multiLineActualTexts": Array [ + "10", + ], + "originalText": "10", + "width": 80, + }, + Object { + "actualText": "11", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "11", + ], + "originalText": "11", + "width": 80, + }, + Object { + "actualText": "12", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 30, + "multiLineActualTexts": Array [ + "12", + ], + "originalText": "12", + "width": 80, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江...", + "actualTextHeight": 45, + "actualTextWidth": 253, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省浙江省浙", + "江省浙江省浙江", + "省浙江省浙江...", + ], + "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 103, + }, + Object { + "actualText": "杭州市杭州市杭州市杭州市杭州市杭州市杭州...", + "actualTextHeight": 45, + "actualTextWidth": 253, + "height": 30, + "multiLineActualTexts": Array [ + "杭州市杭州市杭", + "州市杭州市杭州", + "市杭州市杭州...", + ], + "originalText": "杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市", + "width": 103, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 103, + }, + Object { + "actualText": "宁波市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "宁波市", + ], + "originalText": "宁波市", + "width": 103, + }, + Object { + "actualText": "舟山市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "舟山市", + ], + "originalText": "舟山市", + "width": 103, + }, + Object { + "actualText": "杭州市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "杭州市", + ], + "originalText": "杭州市", + "width": 103, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 103, + }, + Object { + "actualText": "宁波市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "宁波市", + ], + "originalText": "宁波市", + "width": 103, + }, + Object { + "actualText": "舟山市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "舟山市", + ], + "originalText": "舟山市", + "width": 103, + }, + Object { + "actualText": "杭州市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "杭州市", + ], + "originalText": "杭州市", + "width": 103, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 103, + }, + Object { + "actualText": "宁波市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "宁波市", + ], + "originalText": "宁波市", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具家具家具家具家具家具家具家具家具家具...", + "actualTextHeight": 45, + "actualTextWidth": 253, + "height": 30, + "multiLineActualTexts": Array [ + "家具家具家具家", + "具家具家具家具", + "家具家具家具...", + ], + "originalText": "家具家具家具家具家具家具家具家具家具家具家具家具家具家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 30, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 30, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 30, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 103, + }, + Object { + "actualText": "桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子...", + "actualTextHeight": 45, + "actualTextWidth": 253, + "height": 30, + "multiLineActualTexts": Array [ + "桌子桌子桌子桌", + "子桌子桌子桌子", + "桌子桌子桌子...", + ], + "originalText": "桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子", + "width": 103, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 103, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 103, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 103, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 103, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 103, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 103, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 103, + }, + Object { + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 103, + }, + Object { + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 103, + }, + Object { + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 103, + }, + Object { + "actualText": "236723672361111", + "actualTextHeight": 30, + "actualTextWidth": 100, + "height": 30, + "multiLineActualTexts": Array [ + "236723672361", + "111", + ], + "originalText": "236723672361111", + "width": 103, + }, + Object { + "actualText": "7789778977897789778977897789", + "actualTextHeight": 45, + "actualTextWidth": 189, + "height": 30, + "multiLineActualTexts": Array [ + "778977897789", + "778977897789", + "7789", + ], + "originalText": "7789778977897789778977897789", + "width": 103, + }, + Object { + "actualText": "236723672361111", + "actualTextHeight": 30, + "actualTextWidth": 100, + "height": 30, + "multiLineActualTexts": Array [ + "236723672361", + "111", + ], + "originalText": "236723672361111", + "width": 103, + }, + Object { + "actualText": "3877", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "3877", + ], + "originalText": "3877", + "width": 103, + }, + Object { + "actualText": "4342", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "4342", + ], + "originalText": "4342", + "width": 103, + }, + Object { + "actualText": "5343", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "5343", + ], + "originalText": "5343", + "width": 103, + }, + Object { + "actualText": "632", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "632", + ], + "originalText": "632", + "width": 103, + }, + Object { + "actualText": "7234", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "7234", + ], + "originalText": "7234", + "width": 103, + }, + Object { + "actualText": "834", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "834", + ], + "originalText": "834", + "width": 103, + }, + Object { + "actualText": "945", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "945", + ], + "originalText": "945", + "width": 103, + }, + Object { + "actualText": "1304", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1304", + ], + "originalText": "1304", + "width": 103, + }, + Object { + "actualText": "1145", + "actualTextHeight": 15, + "actualTextWidth": 26, + "height": 30, + "multiLineActualTexts": Array [ + "1145", + ], + "originalText": "1145", + "width": 103, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should custom two max text lines 1`] = ` +Array [ + Object { + "actualText": "序号", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 40, + "multiLineActualTexts": Array [ + "序号", + ], + "originalText": "序号", + "width": 80, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should custom two max text lines 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, + }, + Object { + "actualText": "4", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "4", + ], + "originalText": "4", + "width": 80, + }, + Object { + "actualText": "5", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "5", + ], + "originalText": "5", + "width": 80, + }, + Object { + "actualText": "6", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "6", + ], + "originalText": "6", + "width": 80, + }, + Object { + "actualText": "7", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "7", + ], + "originalText": "7", + "width": 80, + }, + Object { + "actualText": "8", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "8", + ], + "originalText": "8", + "width": 80, + }, + Object { + "actualText": "9", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "9", + ], + "originalText": "9", + "width": 80, + }, + Object { + "actualText": "10", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 30, + "multiLineActualTexts": Array [ + "10", + ], + "originalText": "10", + "width": 80, + }, + Object { + "actualText": "11", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "11", + ], + "originalText": "11", + "width": 80, + }, + Object { + "actualText": "12", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 30, + "multiLineActualTexts": Array [ + "12", + ], + "originalText": "12", + "width": 80, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should custom two max text lines 3`] = ` +Array [ + Object { + "actualText": "序号", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 40, + "multiLineActualTexts": Array [ + "序号", + ], + "originalText": "序号", + "width": 80, + }, + Object { + "actualText": "省份", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 40, + "multiLineActualTexts": Array [ + "省份", + ], + "originalText": "省份", + "width": 103, + }, + Object { + "actualText": "城市城市城市城市城市城市城...", + "actualTextHeight": 32, + "actualTextWidth": 168, + "height": 40, + "multiLineActualTexts": Array [ + "城市城市城市城", + "市城市城市城...", + ], + "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", + "width": 103, + }, + Object { + "actualText": "类别类别类别类别类别类别类...", + "actualTextHeight": 32, + "actualTextWidth": 168, + "height": 40, + "multiLineActualTexts": Array [ + "类别类别类别类", + "别类别类别类...", + ], + "originalText": "类别类别类别类别类别类别类别类别类别类别", + "width": 103, + }, + Object { + "actualText": "子类别", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 40, + "multiLineActualTexts": Array [ + "子类别", + ], + "originalText": "子类别", + "width": 103, + }, + Object { + "actualText": "数量数量数量数量数量数量数...", + "actualTextHeight": 32, + "actualTextWidth": 168, + "height": 40, + "multiLineActualTexts": Array [ + "数量数量数量数", + "量数量数量数...", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "width": 103, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should custom two max text lines 4`] = `Array []`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should custom two max text lines 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": "4", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "4", + ], + "originalText": "4", + "width": 80, + }, + Object { + "actualText": "5", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "5", + ], + "originalText": "5", + "width": 80, + }, + Object { + "actualText": "6", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "6", + ], + "originalText": "6", + "width": 80, + }, + Object { + "actualText": "7", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "7", + ], + "originalText": "7", + "width": 80, + }, + Object { + "actualText": "8", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "8", + ], + "originalText": "8", + "width": 80, + }, + Object { + "actualText": "9", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "9", + ], + "originalText": "9", + "width": 80, + }, + Object { + "actualText": "10", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 30, + "multiLineActualTexts": Array [ + "10", + ], + "originalText": "10", + "width": 80, + }, + Object { + "actualText": "11", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "11", + ], + "originalText": "11", + "width": 80, + }, + Object { + "actualText": "12", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 30, + "multiLineActualTexts": Array [ + "12", + ], + "originalText": "12", + "width": 80, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省浙江省浙江省浙江省浙...", + "actualTextHeight": 30, + "actualTextWidth": 168, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省浙江省浙", + "江省浙江省浙...", + ], + "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 103, + }, + Object { + "actualText": "杭州市杭州市杭州市杭州市杭...", + "actualTextHeight": 30, + "actualTextWidth": 168, + "height": 30, + "multiLineActualTexts": Array [ + "杭州市杭州市杭", + "州市杭州市杭...", + ], + "originalText": "杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市", + "width": 103, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 103, + }, + Object { + "actualText": "宁波市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "宁波市", + ], + "originalText": "宁波市", + "width": 103, + }, + Object { + "actualText": "舟山市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "舟山市", + ], + "originalText": "舟山市", + "width": 103, + }, + Object { + "actualText": "杭州市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "杭州市", + ], + "originalText": "杭州市", + "width": 103, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 103, + }, + Object { + "actualText": "宁波市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "宁波市", + ], + "originalText": "宁波市", + "width": 103, + }, + Object { + "actualText": "舟山市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "舟山市", + ], + "originalText": "舟山市", + "width": 103, + }, + Object { + "actualText": "杭州市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "杭州市", + ], + "originalText": "杭州市", + "width": 103, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 103, + }, + Object { + "actualText": "宁波市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "宁波市", + ], + "originalText": "宁波市", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具家具家具家具家具家具家...", + "actualTextHeight": 30, + "actualTextWidth": 168, + "height": 30, + "multiLineActualTexts": Array [ + "家具家具家具家", + "具家具家具家...", + ], + "originalText": "家具家具家具家具家具家具家具家具家具家具家具家具家具家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 30, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 30, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 30, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 103, + }, + Object { + "actualText": "桌子桌子桌子桌子桌子桌子桌...", + "actualTextHeight": 30, + "actualTextWidth": 168, + "height": 30, + "multiLineActualTexts": Array [ + "桌子桌子桌子桌", + "子桌子桌子桌...", + ], + "originalText": "桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子", + "width": 103, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 103, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 103, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 103, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 103, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 103, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 103, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 103, + }, + Object { + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 103, + }, + Object { + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 103, + }, + Object { + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 103, + }, + Object { + "actualText": "236723672361111", + "actualTextHeight": 30, + "actualTextWidth": 100, + "height": 30, + "multiLineActualTexts": Array [ + "236723672361", + "111", + ], + "originalText": "236723672361111", + "width": 103, + }, + Object { + "actualText": "77897789778977897789778...", + "actualTextHeight": 30, + "actualTextWidth": 165, + "height": 30, + "multiLineActualTexts": Array [ + "778977897789", + "77897789778...", + ], + "originalText": "7789778977897789778977897789", + "width": 103, + }, + Object { + "actualText": "236723672361111", + "actualTextHeight": 30, + "actualTextWidth": 100, + "height": 30, + "multiLineActualTexts": Array [ + "236723672361", + "111", + ], + "originalText": "236723672361111", + "width": 103, + }, + Object { + "actualText": "3877", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "3877", + ], + "originalText": "3877", + "width": 103, + }, + Object { + "actualText": "4342", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "4342", + ], + "originalText": "4342", + "width": 103, + }, + Object { + "actualText": "5343", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "5343", + ], + "originalText": "5343", + "width": 103, + }, + Object { + "actualText": "632", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "632", + ], + "originalText": "632", + "width": 103, + }, + Object { + "actualText": "7234", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "7234", + ], + "originalText": "7234", + "width": 103, + }, + Object { + "actualText": "834", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "834", + ], + "originalText": "834", + "width": 103, + }, + Object { + "actualText": "945", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "945", + ], + "originalText": "945", + "width": 103, + }, + Object { + "actualText": "1304", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1304", + ], + "originalText": "1304", + "width": 103, + }, + Object { + "actualText": "1145", + "actualTextHeight": 15, + "actualTextWidth": 26, + "height": 30, + "multiLineActualTexts": Array [ + "1145", + ], + "originalText": "1145", + "width": 103, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should default render one line text 1`] = ` +Array [ + Object { + "actualText": "序号", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "序号", + ], + "originalText": "序号", + "width": 80, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should default render one line text 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, + }, + Object { + "actualText": "4", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "4", + ], + "originalText": "4", + "width": 80, + }, + Object { + "actualText": "5", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "5", + ], + "originalText": "5", + "width": 80, + }, + Object { + "actualText": "6", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "6", + ], + "originalText": "6", + "width": 80, + }, + Object { + "actualText": "7", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "7", + ], + "originalText": "7", + "width": 80, + }, + Object { + "actualText": "8", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "8", + ], + "originalText": "8", + "width": 80, + }, + Object { + "actualText": "9", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "9", + ], + "originalText": "9", + "width": 80, + }, + Object { + "actualText": "10", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 30, + "multiLineActualTexts": Array [ + "10", + ], + "originalText": "10", + "width": 80, + }, + Object { + "actualText": "11", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "11", + ], + "originalText": "11", + "width": 80, + }, + Object { + "actualText": "12", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 30, + "multiLineActualTexts": Array [ + "12", + ], + "originalText": "12", + "width": 80, + }, + Object { + "actualText": "13", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 30, + "multiLineActualTexts": Array [ + "13", + ], + "originalText": "13", + "width": 80, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should default render one line text 3`] = ` +Array [ + Object { + "actualText": "序号", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "序号", + ], + "originalText": "序号", + "width": 80, + }, + Object { + "actualText": "省份", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "省份", + ], + "originalText": "省份", + "width": 103, + }, + Object { + "actualText": "城市城市城市...", + "actualTextHeight": 16, + "actualTextWidth": 83, + "height": 30, + "multiLineActualTexts": Array [ + "城市城市城市...", + ], + "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", + "width": 103, + }, + Object { + "actualText": "类别类别类别...", + "actualTextHeight": 16, + "actualTextWidth": 83, + "height": 30, + "multiLineActualTexts": Array [ + "类别类别类别...", + ], + "originalText": "类别类别类别类别类别类别类别类别类别类别", + "width": 103, + }, + Object { + "actualText": "子类别", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "子类别", + ], + "originalText": "子类别", + "width": 103, + }, + Object { + "actualText": "数量数量数量...", + "actualTextHeight": 16, + "actualTextWidth": 83, + "height": 30, + "multiLineActualTexts": Array [ + "数量数量数量...", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "width": 103, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should default render one line text 4`] = `Array []`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should default render one line text 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": "4", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "4", + ], + "originalText": "4", + "width": 80, + }, + Object { + "actualText": "5", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "5", + ], + "originalText": "5", + "width": 80, + }, + Object { + "actualText": "6", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "6", + ], + "originalText": "6", + "width": 80, + }, + Object { + "actualText": "7", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "7", + ], + "originalText": "7", + "width": 80, + }, + Object { + "actualText": "8", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "8", + ], + "originalText": "8", + "width": 80, + }, + Object { + "actualText": "9", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 30, + "multiLineActualTexts": Array [ + "9", + ], + "originalText": "9", + "width": 80, + }, + Object { + "actualText": "10", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 30, + "multiLineActualTexts": Array [ + "10", + ], + "originalText": "10", + "width": 80, + }, + Object { + "actualText": "11", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "11", + ], + "originalText": "11", + "width": 80, + }, + Object { + "actualText": "12", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 30, + "multiLineActualTexts": Array [ + "12", + ], + "originalText": "12", + "width": 80, + }, + Object { + "actualText": "13", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 30, + "multiLineActualTexts": Array [ + "13", + ], + "originalText": "13", + "width": 80, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省浙江省...", + "actualTextHeight": 15, + "actualTextWidth": 83, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省浙江省...", + ], + "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 103, + }, + Object { + "actualText": "杭州市杭州市...", + "actualTextHeight": 15, + "actualTextWidth": 83, + "height": 30, + "multiLineActualTexts": Array [ + "杭州市杭州市...", + ], + "originalText": "杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市", + "width": 103, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 103, + }, + Object { + "actualText": "宁波市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "宁波市", + ], + "originalText": "宁波市", + "width": 103, + }, + Object { + "actualText": "舟山市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "舟山市", + ], + "originalText": "舟山市", + "width": 103, + }, + Object { + "actualText": "杭州市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "杭州市", + ], + "originalText": "杭州市", + "width": 103, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 103, + }, + Object { + "actualText": "宁波市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "宁波市", + ], + "originalText": "宁波市", + "width": 103, + }, + Object { + "actualText": "舟山市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "舟山市", + ], + "originalText": "舟山市", + "width": 103, + }, + Object { + "actualText": "杭州市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "杭州市", + ], + "originalText": "杭州市", + "width": 103, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 103, + }, + Object { + "actualText": "宁波市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "宁波市", + ], + "originalText": "宁波市", + "width": 103, + }, + Object { + "actualText": "舟山市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "舟山市", + ], + "originalText": "舟山市", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具家具家具...", + "actualTextHeight": 15, + "actualTextWidth": 83, + "height": 30, + "multiLineActualTexts": Array [ + "家具家具家具...", + ], + "originalText": "家具家具家具家具家具家具家具家具家具家具家具家具家具家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 30, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 30, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 30, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 30, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 103, + }, + Object { + "actualText": "桌子桌子桌子...", + "actualTextHeight": 15, + "actualTextWidth": 83, + "height": 30, + "multiLineActualTexts": Array [ + "桌子桌子桌子...", + ], + "originalText": "桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子", + "width": 103, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 103, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 103, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 103, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 103, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 103, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 103, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 103, + }, + Object { + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 103, + }, + Object { + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 103, + }, + Object { + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 103, + }, + Object { + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 30, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 103, + }, + Object { + "actualText": "23672367236...", + "actualTextHeight": 15, + "actualTextWidth": 84, + "height": 30, + "multiLineActualTexts": Array [ + "23672367236...", + ], + "originalText": "236723672361111", + "width": 103, + }, + Object { + "actualText": "77897789778...", + "actualTextHeight": 15, + "actualTextWidth": 84, + "height": 30, + "multiLineActualTexts": Array [ + "77897789778...", + ], + "originalText": "7789778977897789778977897789", + "width": 103, + }, + Object { + "actualText": "23672367236...", + "actualTextHeight": 15, + "actualTextWidth": 84, + "height": 30, + "multiLineActualTexts": Array [ + "23672367236...", + ], + "originalText": "236723672361111", + "width": 103, + }, + Object { + "actualText": "3877", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "3877", + ], + "originalText": "3877", + "width": 103, + }, + Object { + "actualText": "4342", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "4342", + ], + "originalText": "4342", + "width": 103, + }, + Object { + "actualText": "5343", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "5343", + ], + "originalText": "5343", + "width": 103, + }, + Object { + "actualText": "632", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "632", + ], + "originalText": "632", + "width": 103, + }, + Object { + "actualText": "7234", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "7234", + ], + "originalText": "7234", + "width": 103, + }, + Object { + "actualText": "834", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "834", + ], + "originalText": "834", + "width": 103, + }, + Object { + "actualText": "945", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "945", + ], + "originalText": "945", + "width": 103, + }, + Object { + "actualText": "1304", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1304", + ], + "originalText": "1304", + "width": 103, + }, + Object { + "actualText": "1145", + "actualTextHeight": 15, + "actualTextWidth": 26, + "height": 30, + "multiLineActualTexts": Array [ + "1145", + ], + "originalText": "1145", + "width": 103, + }, + Object { + "actualText": "1432", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1432", + ], + "originalText": "1432", + "width": 103, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should force adaptive adjust cell height if custom cell style less than actual text height 1`] = ` +Array [ + Object { + "actualText": "序号", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 40, + "multiLineActualTexts": Array [ + "序号", + ], + "originalText": "序号", + "width": 80, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should force adaptive adjust cell height if custom cell style less than actual text height 2`] = ` +Array [ + Object { + "actualText": "1", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "1", + ], + "originalText": "1", + "width": 80, + }, + Object { + "actualText": "2", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "2", + ], + "originalText": "2", + "width": 80, + }, + Object { + "actualText": "3", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "3", + ], + "originalText": "3", + "width": 80, + }, + Object { + "actualText": "4", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "4", + ], + "originalText": "4", + "width": 80, + }, + Object { + "actualText": "5", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "5", + ], + "originalText": "5", + "width": 80, + }, + Object { + "actualText": "6", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "6", + ], + "originalText": "6", + "width": 80, + }, + Object { + "actualText": "7", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "7", + ], + "originalText": "7", + "width": 80, + }, + Object { + "actualText": "8", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "8", + ], + "originalText": "8", + "width": 80, + }, + Object { + "actualText": "9", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "9", + ], + "originalText": "9", + "width": 80, + }, + Object { + "actualText": "10", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 20, + "multiLineActualTexts": Array [ + "10", + ], + "originalText": "10", + "width": 80, + }, + Object { + "actualText": "11", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 20, + "multiLineActualTexts": Array [ + "11", + ], + "originalText": "11", + "width": 80, + }, + Object { + "actualText": "12", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 20, + "multiLineActualTexts": Array [ + "12", + ], + "originalText": "12", + "width": 80, + }, + Object { + "actualText": "13", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 20, + "multiLineActualTexts": Array [ + "13", + ], + "originalText": "13", + "width": 80, + }, + Object { + "actualText": "14", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 20, + "multiLineActualTexts": Array [ + "14", + ], + "originalText": "14", + "width": 80, + }, + Object { + "actualText": "15", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 20, + "multiLineActualTexts": Array [ + "15", + ], + "originalText": "15", + "width": 80, + }, + Object { + "actualText": "16", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 20, + "multiLineActualTexts": Array [ + "16", + ], + "originalText": "16", + "width": 80, + }, + Object { + "actualText": "17", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 20, + "multiLineActualTexts": Array [ + "17", + ], + "originalText": "17", + "width": 80, + }, + Object { + "actualText": "18", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 20, + "multiLineActualTexts": Array [ + "18", + ], + "originalText": "18", + "width": 80, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should force adaptive adjust cell height if custom cell style less than actual text height 3`] = ` +Array [ + Object { + "actualText": "序号", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 40, + "multiLineActualTexts": Array [ + "序号", + ], + "originalText": "序号", + "width": 80, + }, + Object { + "actualText": "省份", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 40, + "multiLineActualTexts": Array [ + "省份", + ], + "originalText": "省份", + "width": 103, + }, + Object { + "actualText": "城市城市城市城市城市城市城...", + "actualTextHeight": 32, + "actualTextWidth": 168, + "height": 40, + "multiLineActualTexts": Array [ + "城市城市城市城", + "市城市城市城...", + ], + "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", + "width": 103, + }, + Object { + "actualText": "类别类别类别类别类别类别类...", + "actualTextHeight": 32, + "actualTextWidth": 168, + "height": 40, + "multiLineActualTexts": Array [ + "类别类别类别类", + "别类别类别类...", + ], + "originalText": "类别类别类别类别类别类别类别类别类别类别", + "width": 103, + }, + Object { + "actualText": "子类别", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 40, + "multiLineActualTexts": Array [ + "子类别", + ], + "originalText": "子类别", + "width": 103, + }, + Object { + "actualText": "数量数量数量数量数量数量数...", + "actualTextHeight": 32, + "actualTextWidth": 168, + "height": 40, + "multiLineActualTexts": Array [ + "数量数量数量数", + "量数量数量数...", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "width": 103, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should force adaptive adjust cell height if custom cell style less than actual text height 4`] = `Array []`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should force adaptive adjust cell height if custom cell style less than actual text height 5`] = ` +Array [ + Object { + "actualText": "1", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "1", + ], + "originalText": "1", + "width": 80, + }, + Object { + "actualText": "2", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "2", + ], + "originalText": "2", + "width": 80, + }, + Object { + "actualText": "3", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "3", + ], + "originalText": "3", + "width": 80, + }, + Object { + "actualText": "4", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "4", + ], + "originalText": "4", + "width": 80, + }, + Object { + "actualText": "5", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "5", + ], + "originalText": "5", + "width": 80, + }, + Object { + "actualText": "6", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "6", + ], + "originalText": "6", + "width": 80, + }, + Object { + "actualText": "7", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "7", + ], + "originalText": "7", + "width": 80, + }, + Object { + "actualText": "8", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "8", + ], + "originalText": "8", + "width": 80, + }, + Object { + "actualText": "9", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 20, + "multiLineActualTexts": Array [ + "9", + ], + "originalText": "9", + "width": 80, + }, + Object { + "actualText": "10", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 20, + "multiLineActualTexts": Array [ + "10", + ], + "originalText": "10", + "width": 80, + }, + Object { + "actualText": "11", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 20, + "multiLineActualTexts": Array [ + "11", + ], + "originalText": "11", + "width": 80, + }, + Object { + "actualText": "12", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 20, + "multiLineActualTexts": Array [ + "12", + ], + "originalText": "12", + "width": 80, + }, + Object { + "actualText": "13", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 20, + "multiLineActualTexts": Array [ + "13", + ], + "originalText": "13", + "width": 80, + }, + Object { + "actualText": "14", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 20, + "multiLineActualTexts": Array [ + "14", + ], + "originalText": "14", + "width": 80, + }, + Object { + "actualText": "15", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 20, + "multiLineActualTexts": Array [ + "15", + ], + "originalText": "15", + "width": 80, + }, + Object { + "actualText": "16", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 20, + "multiLineActualTexts": Array [ + "16", + ], + "originalText": "16", + "width": 80, + }, + Object { + "actualText": "17", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 20, + "multiLineActualTexts": Array [ + "17", + ], + "originalText": "17", + "width": 80, + }, + Object { + "actualText": "18", + "actualTextHeight": 15, + "actualTextWidth": 14, + "height": 20, + "multiLineActualTexts": Array [ + "18", + ], + "originalText": "18", + "width": 80, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省浙江省浙江省浙江省浙...", + "actualTextHeight": 30, + "actualTextWidth": 168, + "height": 20, + "multiLineActualTexts": Array [ + "浙江省浙江省浙", + "江省浙江省浙...", + ], + "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 103, + }, + Object { + "actualText": "四川省", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "四川省", + ], + "originalText": "四川省", + "width": 103, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 103, + }, + Object { + "actualText": "杭州市杭州市杭州市杭州市杭...", + "actualTextHeight": 30, + "actualTextWidth": 168, + "height": 20, + "multiLineActualTexts": Array [ + "杭州市杭州市杭", + "州市杭州市杭...", + ], + "originalText": "杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市", + "width": 103, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 103, + }, + Object { + "actualText": "宁波市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "宁波市", + ], + "originalText": "宁波市", + "width": 103, + }, + Object { + "actualText": "舟山市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "舟山市", + ], + "originalText": "舟山市", + "width": 103, + }, + Object { + "actualText": "杭州市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "杭州市", + ], + "originalText": "杭州市", + "width": 103, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 103, + }, + Object { + "actualText": "宁波市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "宁波市", + ], + "originalText": "宁波市", + "width": 103, + }, + Object { + "actualText": "舟山市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "舟山市", + ], + "originalText": "舟山市", + "width": 103, + }, + Object { + "actualText": "杭州市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "杭州市", + ], + "originalText": "杭州市", + "width": 103, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 103, + }, + Object { + "actualText": "宁波市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "宁波市", + ], + "originalText": "宁波市", + "width": 103, + }, + Object { + "actualText": "舟山市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "舟山市", + ], + "originalText": "舟山市", + "width": 103, + }, + Object { + "actualText": "杭州市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "杭州市", + ], + "originalText": "杭州市", + "width": 103, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 103, + }, + Object { + "actualText": "宁波市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "宁波市", + ], + "originalText": "宁波市", + "width": 103, + }, + Object { + "actualText": "舟山市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "舟山市", + ], + "originalText": "舟山市", + "width": 103, + }, + Object { + "actualText": "成都市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 20, + "multiLineActualTexts": Array [ + "成都市", + ], + "originalText": "成都市", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具家具家具家具家具家具家...", + "actualTextHeight": 30, + "actualTextWidth": 168, + "height": 20, + "multiLineActualTexts": Array [ + "家具家具家具家", + "具家具家具家...", + ], + "originalText": "家具家具家具家具家具家具家具家具家具家具家具家具家具家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 20, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 20, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 20, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 20, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 20, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 20, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 20, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 15, + "actualTextWidth": 49, + "height": 20, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 103, + }, + Object { + "actualText": "家具", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 103, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 103, + }, + Object { + "actualText": "桌子桌子桌子桌子桌子桌子桌...", + "actualTextHeight": 30, + "actualTextWidth": 168, + "height": 20, + "multiLineActualTexts": Array [ + "桌子桌子桌子桌", + "子桌子桌子桌...", + ], + "originalText": "桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子", + "width": 103, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 103, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 103, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 103, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 103, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 103, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 103, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 103, + }, + Object { + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 20, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 103, + }, + Object { + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 20, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 103, + }, + Object { + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 20, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 103, + }, + Object { + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 20, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 103, + }, + Object { + "actualText": "纸张", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "纸张", + ], + "originalText": "纸张", + "width": 103, + }, + Object { + "actualText": "纸张", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "纸张", + ], + "originalText": "纸张", + "width": 103, + }, + Object { + "actualText": "纸张", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "纸张", + ], + "originalText": "纸张", + "width": 103, + }, + Object { + "actualText": "纸张", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "纸张", + ], + "originalText": "纸张", + "width": 103, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 103, + }, + Object { + "actualText": "236723672361111", + "actualTextHeight": 30, + "actualTextWidth": 100, + "height": 20, + "multiLineActualTexts": Array [ + "236723672361", + "111", + ], + "originalText": "236723672361111", + "width": 103, + }, + Object { + "actualText": "77897789778977897789778...", + "actualTextHeight": 30, + "actualTextWidth": 165, + "height": 20, + "multiLineActualTexts": Array [ + "778977897789", + "77897789778...", + ], + "originalText": "7789778977897789778977897789", + "width": 103, + }, + Object { + "actualText": "236723672361111", + "actualTextHeight": 30, + "actualTextWidth": 100, + "height": 20, + "multiLineActualTexts": Array [ + "236723672361", + "111", + ], + "originalText": "236723672361111", + "width": 103, + }, + Object { + "actualText": "3877", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 20, + "multiLineActualTexts": Array [ + "3877", + ], + "originalText": "3877", + "width": 103, + }, + Object { + "actualText": "4342", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 20, + "multiLineActualTexts": Array [ + "4342", + ], + "originalText": "4342", + "width": 103, + }, + Object { + "actualText": "5343", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 20, + "multiLineActualTexts": Array [ + "5343", + ], + "originalText": "5343", + "width": 103, + }, + Object { + "actualText": "632", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 20, + "multiLineActualTexts": Array [ + "632", + ], + "originalText": "632", + "width": 103, + }, + Object { + "actualText": "7234", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 20, + "multiLineActualTexts": Array [ + "7234", + ], + "originalText": "7234", + "width": 103, + }, + Object { + "actualText": "834", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 20, + "multiLineActualTexts": Array [ + "834", + ], + "originalText": "834", + "width": 103, + }, + Object { + "actualText": "945", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 20, + "multiLineActualTexts": Array [ + "945", + ], + "originalText": "945", + "width": 103, + }, + Object { + "actualText": "1304", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 20, + "multiLineActualTexts": Array [ + "1304", + ], + "originalText": "1304", + "width": 103, + }, + Object { + "actualText": "1145", + "actualTextHeight": 15, + "actualTextWidth": 26, + "height": 20, + "multiLineActualTexts": Array [ + "1145", + ], + "originalText": "1145", + "width": 103, + }, + Object { + "actualText": "1432", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 20, + "multiLineActualTexts": Array [ + "1432", + ], + "originalText": "1432", + "width": 103, + }, + Object { + "actualText": "1343", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 20, + "multiLineActualTexts": Array [ + "1343", + ], + "originalText": "1343", + "width": 103, + }, + Object { + "actualText": "1354", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 20, + "multiLineActualTexts": Array [ + "1354", + ], + "originalText": "1354", + "width": 103, + }, + Object { + "actualText": "1523", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 20, + "multiLineActualTexts": Array [ + "1523", + ], + "originalText": "1523", + "width": 103, + }, + Object { + "actualText": "1634", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 20, + "multiLineActualTexts": Array [ + "1634", + ], + "originalText": "1634", + "width": 103, + }, + Object { + "actualText": "1723", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 20, + "multiLineActualTexts": Array [ + "1723", + ], + "originalText": "1723", + "width": 103, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests TableSheet should not adaptive adjust cell height if custom cell style more than actual text height 1`] = ` +Array [ + Object { + "actualText": "序号", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 70, + "multiLineActualTexts": Array [ + "序号", + ], + "originalText": "序号", + "width": 80, + }, + Object { + "actualText": "省份", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 70, + "multiLineActualTexts": Array [ + "省份", + ], + "originalText": "省份", + "width": 103, + }, + Object { + "actualText": "城市城市城市城市城市城市城...", + "actualTextHeight": 32, + "actualTextWidth": 168, + "height": 70, + "multiLineActualTexts": Array [ + "城市城市城市城", + "市城市城市城...", + ], + "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", + "width": 103, + }, + Object { + "actualText": "类别类别类别类别类别类别类...", + "actualTextHeight": 32, + "actualTextWidth": 168, + "height": 70, + "multiLineActualTexts": Array [ + "类别类别类别类", + "别类别类别类...", + ], + "originalText": "类别类别类别类别类别类别类别类别类别类别", + "width": 103, + }, + Object { + "actualText": "子类别", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 70, + "multiLineActualTexts": Array [ + "子类别", + ], + "originalText": "子类别", + "width": 103, + }, + Object { + "actualText": "数量数量数量数量数量数量数...", + "actualTextHeight": 32, + "actualTextWidth": 168, + "height": 70, + "multiLineActualTexts": Array [ + "数量数量数量数", + "量数量数量数...", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "width": 103, + }, +] +`; diff --git a/packages/s2-core/__tests__/spreadsheet/custom-table-col-spec.ts b/packages/s2-core/__tests__/spreadsheet/custom-table-col-spec.ts index 3cfbb7dbb1..b637d4ac0a 100644 --- a/packages/s2-core/__tests__/spreadsheet/custom-table-col-spec.ts +++ b/packages/s2-core/__tests__/spreadsheet/custom-table-col-spec.ts @@ -62,7 +62,7 @@ describe('TableSheet Custom Tests', () => { }); afterEach(() => { - // s2.destroy(); + s2.destroy(); }); test('should render custom layout column nodes', () => { 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 926bbbc338..051971d89d 100644 --- a/packages/s2-core/__tests__/spreadsheet/multi-line-text-spec.ts +++ b/packages/s2-core/__tests__/spreadsheet/multi-line-text-spec.ts @@ -1,14 +1,11 @@ /* eslint-disable jest/expect-expect */ import { getContainer } from 'tests/util/helpers'; -import { PivotSheet, type SpreadSheet } from '../../src'; +import { PivotSheet, TableSheet, type SpreadSheet } from '../../src'; import type { DefaultCellTheme, S2CellType, S2Options } from '../../src/common'; -import { MultiLineTextDataCfg } from '../data/data-multi-line-text'; - -const s2Options: S2Options = { - width: 300, - height: 400, - showSeriesNumber: true, -}; +import { + PivotSheetMultiLineTextDataCfg, + TableSheetMultiLineTextDataCfg, +} from '../data/data-multi-line-text'; describe('SpreadSheet Multi Line Text Tests', () => { let s2: SpreadSheet; @@ -55,11 +52,14 @@ describe('SpreadSheet Multi Line Text Tests', () => { height: number, lastLevelY: number = 60, lastLevelHeight: number = 30, + sampleNodesForAllLevelsTotals = 3, ) => { const { colsHierarchy } = s2.facet.getLayoutResult(); expect(colsHierarchy.height).toEqual(height); - expect(colsHierarchy.sampleNodesForAllLevels).toHaveLength(3); + expect(colsHierarchy.sampleNodesForAllLevels).toHaveLength( + sampleNodesForAllLevelsTotals, + ); expect(colsHierarchy.sampleNodeForLastLevel?.y).toEqual(lastLevelY); expect(colsHierarchy.sampleNodeForLastLevel?.height).toEqual( lastLevelHeight, @@ -97,196 +97,303 @@ describe('SpreadSheet Multi Line Text Tests', () => { s2.facet.getDataCells(), ]; - beforeEach(async () => { - s2 = new PivotSheet(getContainer(), MultiLineTextDataCfg, s2Options); - await s2.render(); - }); - - afterEach(() => { - s2.destroy(); - }); + describe('PivotSheet', () => { + const s2Options: S2Options = { + width: 300, + height: 400, + showSeriesNumber: true, + }; - test('should default render two line text', () => { - getCells().forEach((cells) => { - expect(mapCells(cells)).toMatchSnapshot(); + beforeEach(async () => { + s2 = new PivotSheet( + getContainer(), + PivotSheetMultiLineTextDataCfg, + s2Options, + ); + await s2.render(); }); - expectHierarchyHeight(90); - }); - test('should custom two max text lines', async () => { - updateTheme(2); - await s2.render(false); + afterEach(() => { + s2.destroy(); + }); - getCells().forEach((cells) => { - expect(mapCells(cells)).toMatchSnapshot(); + test('should default render one line text', () => { + getCells().forEach((cells) => { + expect(mapCells(cells)).toMatchSnapshot(); + }); + expectHierarchyHeight(90); }); - expectHierarchyHeight(118, 80, 38); - }); - test('should custom three max text lines', async () => { - updateTheme(3); - await s2.render(false); + test('should custom two max text lines', async () => { + updateTheme(2); + await s2.render(false); - getCells().forEach((cells) => { - expect(mapCells(cells)).toMatchSnapshot(); + getCells().forEach((cells) => { + expect(mapCells(cells)).toMatchSnapshot(); + }); + expectHierarchyHeight(118, 80, 38); }); - expectHierarchyHeight(165, 112, 53); - }); + test('should custom three max text lines', async () => { + updateTheme(3); + await s2.render(false); - test('should render custom text overflow text', async () => { - const cellTheme: DefaultCellTheme = { - text: { - textOverflow: '@@@', - maxLines: 1, - }, - bolderText: { - textOverflow: '我是省略号', - maxLines: 1, - }, - measureText: { - textOverflow: '😸', - maxLines: 1, - }, - }; + getCells().forEach((cells) => { + expect(mapCells(cells)).toMatchSnapshot(); + }); - s2.setTheme({ - seriesNumberCell: cellTheme, - colCell: cellTheme, - cornerCell: cellTheme, - rowCell: cellTheme, - dataCell: cellTheme, + expectHierarchyHeight(165, 112, 53); }); - await s2.render(false); - getCells().forEach((cells) => { - expect(mapCells(cells)).toMatchSnapshot(); - }); - expectHierarchyHeight(90); - }); + test('should render custom text overflow text', async () => { + const cellTheme: DefaultCellTheme = { + text: { + textOverflow: '@@@', + maxLines: 1, + }, + bolderText: { + textOverflow: '我是省略号', + maxLines: 1, + }, + measureText: { + textOverflow: '😸', + maxLines: 1, + }, + }; - test('should not render word wrap text', async () => { - const cellTheme: DefaultCellTheme = { - text: { - wordWrap: false, - }, - bolderText: { - wordWrap: false, - }, - measureText: { - wordWrap: false, - }, - }; + s2.setTheme({ + seriesNumberCell: cellTheme, + colCell: cellTheme, + cornerCell: cellTheme, + rowCell: cellTheme, + dataCell: cellTheme, + }); + await s2.render(false); - s2.setTheme({ - seriesNumberCell: cellTheme, - colCell: cellTheme, - cornerCell: cellTheme, - rowCell: cellTheme, - dataCell: cellTheme, + getCells().forEach((cells) => { + expect(mapCells(cells)).toMatchSnapshot(); + }); + expectHierarchyHeight(90); }); - await s2.render(false); - getCells().forEach((cells) => { - expect(mapCells(cells)).toMatchSnapshot(); + test('should not render word wrap text', async () => { + const cellTheme: DefaultCellTheme = { + text: { + wordWrap: false, + }, + bolderText: { + wordWrap: false, + }, + measureText: { + wordWrap: false, + }, + }; + + s2.setTheme({ + seriesNumberCell: cellTheme, + colCell: cellTheme, + cornerCell: cellTheme, + rowCell: cellTheme, + dataCell: cellTheme, + }); + await s2.render(false); + + getCells().forEach((cells) => { + expect(mapCells(cells)).toMatchSnapshot(); - // wordWrap 关闭时, 不会渲染省略号 - cells.forEach((cell) => { - expect(cell.getActualText()).not.toContain('...'); + // wordWrap 关闭时, 不会渲染省略号 + cells.forEach((cell) => { + expect(cell.getActualText()).not.toContain('...'); + }); }); + expectHierarchyHeight(90); }); - expectHierarchyHeight(90); - }); - test('should force adaptive adjust cell height if custom cell style less than actual text height', async () => { - s2.setOptions({ - style: { - rowCell: { - height: 20, - heightByField: { - city: 10, + test('should force adaptive adjust cell height if custom cell style less than actual text height', async () => { + s2.setOptions({ + style: { + rowCell: { + height: 20, + heightByField: { + city: 10, + }, + }, + colCell: { + height: 20, + }, + dataCell: { + height: 20, }, }, - colCell: { - height: 20, - }, - dataCell: { - height: 20, + }); + + updateTheme(2); + await s2.render(false); + + getCells().forEach((cells) => { + expect(mapCells(cells)).toMatchSnapshot(); + }); + expectHierarchyHeight(118, 80, 38); + }); + + test('should not adaptive adjust cell height if custom cell style more than actual text height', async () => { + const CUSTOM_CELL_HEIGHT = 70; + + s2.setOptions({ + style: { + rowCell: { + height: CUSTOM_CELL_HEIGHT, + }, + colCell: { + height: CUSTOM_CELL_HEIGHT, + }, + dataCell: { + height: CUSTOM_CELL_HEIGHT, + }, }, - }, + }); + + updateTheme(2); + await s2.render(false); + + [ + s2.facet.getCornerCells(), + s2.facet.getColLeafCells(), + s2.facet.getRowLeafCells(), + s2.facet.getDataCells(), + ].forEach((cells) => { + expect(mapCells(cells)).toMatchSnapshot(); + + cells.forEach((cell) => { + expect(cell.getMeta().height).toEqual(CUSTOM_CELL_HEIGHT); + }); + }); + + expectHierarchyHeight(210, 140, 70); + }); + + test('should render correctly layout if enable totals', async () => { + setupTotalsOptions(); + await s2.render(false); + + expectHierarchyHeight(90, 60, 30); }); - updateTheme(2); - await s2.render(false); + test('should render correctly layout if enable totals for multiple text lines', async () => { + setupTotalsOptions(); + updateTheme(3); + await s2.render(false); - getCells().forEach((cells) => { - expect(mapCells(cells)).toMatchSnapshot(); + expectHierarchyHeight(165, 112, 53); + }); + + test('should render correctly layout if only enable grand totals', async () => { + setupTotalsOptions(true, false); + await s2.render(false); + + expectHierarchyHeight(90, 60, 30); + }); + + test('should render correctly layout if only enable sub totals', async () => { + setupTotalsOptions(false, true); + await s2.render(false); + + expectHierarchyHeight(90, 60, 30); }); - expectHierarchyHeight(118, 80, 38); }); - test('should not adaptive adjust cell height if custom cell style more than actual text height', async () => { - const CUSTOM_CELL_HEIGHT = 70; + describe('TableSheet', () => { + const s2Options: S2Options = { + width: 600, + height: 400, + showSeriesNumber: true, + }; + + beforeEach(async () => { + s2 = new TableSheet( + getContainer(), + TableSheetMultiLineTextDataCfg, + s2Options, + ); + await s2.render(); + }); - s2.setOptions({ - style: { - rowCell: { - height: CUSTOM_CELL_HEIGHT, - }, - colCell: { - height: CUSTOM_CELL_HEIGHT, - }, - dataCell: { - height: CUSTOM_CELL_HEIGHT, - }, - }, + afterEach(() => { + s2.destroy(); }); - updateTheme(2); - await s2.render(false); + test('should default render one line text', () => { + getCells().forEach((cells) => { + expect(mapCells(cells)).toMatchSnapshot(); + }); + expectHierarchyHeight(30, 0, 30, 1); + }); - [ - s2.facet.getCornerCells(), - s2.facet.getColLeafCells(), - s2.facet.getRowLeafCells(), - s2.facet.getDataCells(), - ].forEach((cells) => { - expect(mapCells(cells)).toMatchSnapshot(); + test('should custom two max text lines', async () => { + updateTheme(2); + await s2.render(false); - cells.forEach((cell) => { - expect(cell.getMeta().height).toEqual(CUSTOM_CELL_HEIGHT); + getCells().forEach((cells) => { + expect(mapCells(cells)).toMatchSnapshot(); }); + expectHierarchyHeight(40, 0, 40, 1); }); - expectHierarchyHeight(210, 140, 70); - }); + test('should custom three max text lines', async () => { + updateTheme(3); + await s2.render(false); - test('should render correctly layout if enable totals', async () => { - setupTotalsOptions(); - await s2.render(false); + getCells().forEach((cells) => { + expect(mapCells(cells)).toMatchSnapshot(); + }); - expectHierarchyHeight(90, 60, 30); - }); + expectHierarchyHeight(56, 0, 56, 1); + }); - test('should render correctly layout if enable totals for multiple text lines', async () => { - setupTotalsOptions(); - updateTheme(3); - await s2.render(false); + test('should force adaptive adjust cell height if custom cell style less than actual text height', async () => { + s2.setOptions({ + style: { + colCell: { + height: 20, + }, + dataCell: { + height: 20, + }, + }, + }); - expectHierarchyHeight(165, 112, 53); - }); + updateTheme(2); + await s2.render(false); - test('should render correctly layout if only enable grand totals', async () => { - setupTotalsOptions(true, false); - await s2.render(false); + getCells().forEach((cells) => { + expect(mapCells(cells)).toMatchSnapshot(); + }); + expectHierarchyHeight(40, 0, 40, 1); + }); - expectHierarchyHeight(90, 60, 30); - }); + test('should not adaptive adjust cell height if custom cell style more than actual text height', async () => { + const CUSTOM_CELL_HEIGHT = 70; + + s2.setOptions({ + style: { + colCell: { + height: CUSTOM_CELL_HEIGHT, + }, + }, + }); + + updateTheme(2); + await s2.render(false); - test('should render correctly layout if only enable sub totals', async () => { - setupTotalsOptions(false, true); - await s2.render(false); + [s2.facet.getColLeafCells()].forEach((cells) => { + expect(mapCells(cells)).toMatchSnapshot(); - expectHierarchyHeight(90, 60, 30); + cells.forEach((cell) => { + expect(cell.getMeta().height).toEqual(CUSTOM_CELL_HEIGHT); + }); + }); + + expectHierarchyHeight(70, 0, 70, 1); + }); }); }); diff --git a/packages/s2-core/src/facet/base-facet.ts b/packages/s2-core/src/facet/base-facet.ts index 8d96009ea4..106ff35aa5 100644 --- a/packages/s2-core/src/facet/base-facet.ts +++ b/packages/s2-core/src/facet/base-facet.ts @@ -8,6 +8,7 @@ import { interpolateArray } from 'd3-interpolate'; import { timer, type Timer } from 'd3-timer'; import { clamp, + compact, concat, debounce, each, @@ -19,6 +20,7 @@ import { isNil, isUndefined, last, + maxBy, reduce, sumBy, } from 'lodash'; @@ -176,6 +178,11 @@ export abstract class BaseFacet { colIndex: number, ): ViewMeta | null; + protected abstract getColNodeHeight( + colNode: Node, + colsHierarchy: Hierarchy, + ): number; + protected scrollFrameId: ReturnType | null = null; @@ -326,6 +333,36 @@ export abstract class BaseFacet { return textHeight >= defaultHeight ? adaptiveHeight : defaultHeight; } + /** + * 将每一层级的采样节点更新为高度最大的节点 (未隐藏, 非汇总节点) + */ + protected updateColsHierarchySampleMaxHeightNodes(colsHierarchy: Hierarchy) { + const sampleMaxHeightNodesForAllLevels = + colsHierarchy.sampleNodesForAllLevels.map((sampleNode) => { + const maxHeightNode = maxBy( + colsHierarchy + .getNodes(sampleNode.level) + .filter((node) => !node.isTotals), + (levelSampleNode) => { + return this.getColNodeHeight(levelSampleNode, colsHierarchy); + }, + )!; + + return maxHeightNode!; + }); + + colsHierarchy.sampleNodesForAllLevels = compact( + sampleMaxHeightNodesForAllLevels, + ); + colsHierarchy.sampleNodesForAllLevels.forEach((levelSampleNode) => { + levelSampleNode.height = this.getColNodeHeight( + levelSampleNode, + colsHierarchy, + ); + colsHierarchy.height += levelSampleNode.height; + }); + } + hideScrollBar = () => { this.hRowScrollBar?.setAttribute('visibility', 'hidden'); this.hScrollBar?.setAttribute('visibility', 'hidden'); diff --git a/packages/s2-core/src/facet/pivot-facet.ts b/packages/s2-core/src/facet/pivot-facet.ts index c02cd70170..39c128a9e6 100644 --- a/packages/s2-core/src/facet/pivot-facet.ts +++ b/packages/s2-core/src/facet/pivot-facet.ts @@ -1,5 +1,4 @@ import { - compact, filter, find, forEach, @@ -238,36 +237,6 @@ export class PivotFacet extends BaseFacet { } } - /** - * 将每一层级的采样节点更新为高度最大的节点 (未隐藏, 非汇总节点) - */ - private updateColsHierarchySampleMaxHeightNodes(colsHierarchy: Hierarchy) { - const sampleMaxHeightNodesForAllLevels = - colsHierarchy.sampleNodesForAllLevels.map((sampleNode) => { - const maxHeightNode = maxBy( - colsHierarchy - .getNodes(sampleNode.level) - .filter((node) => !node.isTotals), - (levelSampleNode) => { - return this.getColNodeHeight(levelSampleNode, colsHierarchy); - }, - )!; - - return maxHeightNode!; - }); - - colsHierarchy.sampleNodesForAllLevels = compact( - sampleMaxHeightNodesForAllLevels, - ); - colsHierarchy.sampleNodesForAllLevels.forEach((levelSampleNode) => { - levelSampleNode.height = this.getColNodeHeight( - levelSampleNode, - colsHierarchy, - ); - colsHierarchy.height += levelSampleNode.height; - }); - } - /** * Auto Auto Auto column no-leaf node's width and x coordinate * @param colLeafNodes @@ -421,7 +390,7 @@ export class PivotFacet extends BaseFacet { return this.getCellAdaptiveHeight(rowCell, defaultHeight); } - private getColNodeHeight(colNode: Node, colsHierarchy: Hierarchy): number { + protected getColNodeHeight(colNode: Node, colsHierarchy: Hierarchy): number { if (!colNode) { return 0; } diff --git a/packages/s2-core/src/facet/table-facet.ts b/packages/s2-core/src/facet/table-facet.ts index 62281cf337..9d3ed42d4a 100644 --- a/packages/s2-core/src/facet/table-facet.ts +++ b/packages/s2-core/src/facet/table-facet.ts @@ -1,6 +1,6 @@ import { Group, Rect, type LineStyleProps } from '@antv/g'; import { isBoolean, isNumber, keys, last, maxBy, set } from 'lodash'; -import { TableSeriesNumberCell, TableDataCell, TableColCell } from '../cell'; +import { TableColCell, TableDataCell, TableSeriesNumberCell } from '../cell'; import { FRONT_GROUND_GROUP_COL_FROZEN_Z_INDEX, KEY_GROUP_FROZEN_ROW_RESIZE_AREA, @@ -349,7 +349,7 @@ export class TableFacet extends BaseFacet { return dataCell?.width ?? 0; } - private getColNodeHeight(colNode: Node, colsHierarchy: Hierarchy) { + protected getColNodeHeight(colNode: Node, colsHierarchy: Hierarchy) { const colCell = new TableColCell(colNode, this.spreadsheet, {}); const defaultHeight = this.getDefaultColNodeHeight(colNode, colsHierarchy); @@ -360,15 +360,13 @@ export class TableFacet extends BaseFacet { colLeafNodes: Node[], colsHierarchy: Hierarchy, ) { + this.updateColsHierarchySampleMaxHeightNodes(colsHierarchy); + let preLeafNode = Node.blankNode(); - const allNodes = colsHierarchy.getNodes(); + let currentCollIndex = 0; - for (const levelSample of colsHierarchy.sampleNodesForAllLevels) { - levelSample.height = this.getColNodeHeight(levelSample, colsHierarchy); - colsHierarchy.height += levelSample.height; - } + const allNodes = colsHierarchy.getNodes(); const adaptiveColWidth = this.getAdaptiveColWidth(colLeafNodes); - let currentCollIndex = 0; for (let i = 0; i < allNodes.length; i++) { const currentNode = allNodes[i]; diff --git a/packages/s2-react/playground/config.ts b/packages/s2-react/playground/config.ts index 0e034fb7e8..e453b8f241 100644 --- a/packages/s2-react/playground/config.ts +++ b/packages/s2-react/playground/config.ts @@ -27,15 +27,15 @@ export const tableSheetSingleColumns: CustomHeaderField[] = [ export const tableSheetMultipleColumns: CustomTreeNode[] = [ { field: 'area', - title: '地区', + title: '地区地区地区地区地区地区地区地区地区', children: [ { field: 'province', - title: '省份', + title: '省份省份省份省份省份省份省份省份省份', children: [ { field: 'type', - title: '类型', + title: '类型类型类型类型类型类型类型类型类型类型', }, ], }, diff --git a/packages/s2-react/playground/index.tsx b/packages/s2-react/playground/index.tsx index 2772a1d574..6c20635510 100644 --- a/packages/s2-react/playground/index.tsx +++ b/packages/s2-react/playground/index.tsx @@ -69,6 +69,8 @@ import { MobileSheetComponent } from './components/Mobile'; import { onSheetMounted } from './utils'; import 'antd/dist/antd.min.css'; +type TableSheetColumnType = 'single' | 'multiple'; + const { TabPane } = Tabs; const CustomTooltip = () => ( @@ -107,9 +109,12 @@ function MainLayout() { const [columnOptions, setColumnOptions] = React.useState( [], ); - const [tableSheetColumnType, setTableSheetColumnType] = React.useState< - 'single' | 'multiple' - >('multiple'); + const [tableSheetColumnType, setTableSheetColumnType] = + React.useState( + (localStorage.getItem( + 'debugTableSheetColumnType', + ) as TableSheetColumnType) || 'single', + ); // ================== Refs ======================== const s2Ref = React.useRef(null); diff --git a/s2-site/docs/api/general/S2Theme.zh.md b/s2-site/docs/api/general/S2Theme.zh.md index 727d6691d9..c6b05c8169 100644 --- a/s2-site/docs/api/general/S2Theme.zh.md +++ b/s2-site/docs/api/general/S2Theme.zh.md @@ -145,14 +145,17 @@ s2.setTheme({ | 参数 | 说明 | 类型 | 默认值 | 必选 | | ------------ | ------------------------------------------------------------------------------ | ----------------------------- | ------------------------------------------------------------------------------------------------- | ---- | -| textAlign | 文本内容的对齐方式 | `left` \| `center` \| `right` | - | | -| textBaseline | 绘制文本时的基线 | `top` \| `middle` \| `bottom` | - | | +| textAlign | 文本内容的对齐方式 | `left \| center \| right` | - | | +| textBaseline | 绘制文本时的基线 | `top \| middle \| bottom` | - | | | fontFamily | 字体 | `string` | `Roboto, PingFangSC,`
`BlinkMacSystemFont,`
`Microsoft YaHei,`
`Arial, sans-serif` | | | fontSize | 字体大小 | `number` | - | | -| fontWeight | number
string: `normal`
`bold`
`bolder`
`lighter` 字体粗细 | `number` \| `string` | 粗体文本:Mobile:`520` PC: `bold`
普通文本:`normal` | | +| fontWeight | number
string: `normal`
`bold`
`bolder`
`lighter` 字体粗细 | `number \| string` | 粗体文本:Mobile:`520` PC: `bold`
普通文本:`normal` | | | fill | 字体颜色 | `string` | - | | | linkTextFill | 链接文本颜色 | `string` | - | | | opacity | 字体透明度 | `number` | 1 | | +| wordWrap | 文本是否自动换行 (数值单元格不建议换行)。[了解更多](https://g.antv.antgroup.com/api/basic/text#wordwrap) | `boolean` | `true` | | +| maxLines | 最大行数,文本超出后将被截断 (数值单元格不建议换行),需要配合 `wordWrap` 和 `textOverflow` 一起使用。[了解更多](https://g.antv.antgroup.com/api/basic/text#maxlines) | `number` | `1` | | +| textOverflow | 自定义隐藏的文本溢出内容,例如直接裁剪、追加省略号或一个自定义字符串,需要配合 `wordWrap` 和 `maxLines` 一起使用。[了解更多](https://g.antv.antgroup.com/api/basic/text#textoverflow) | `string` | `ellipsis` | | #### CellTheme