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 8e0d395141..840b5c35b9 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,12 +1,12 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`SpreadSheet Multi Line Text Tests PivotSheet should calc correctly row cell height if actual text lines is difference 1`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust col cell height if corner cell height > col cell height 1`] = ` Array [ Object { "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 76, + "height": 48, "multiLineActualTexts": Array [ "序号", ], @@ -14,62 +14,67 @@ Array [ "width": 80, }, Object { - "actualText": "省份", + "actualText": "province", "actualTextHeight": 16, - "actualTextWidth": 25, - "height": 76, + "actualTextWidth": 51, + "height": 48, "multiLineActualTexts": Array [ - "省份", + "province", ], - "originalText": "省份", - "width": 96, + "originalText": "province", + "width": 102.57, }, Object { - "actualText": "城市城市城市城市城市城市城市城市城市城市城市城市", - "actualTextHeight": 64, - "actualTextWidth": 292, - "height": 76, + "actualText": "城市城市", + "actualTextHeight": 32, + "actualTextWidth": 50, + "height": 48, "multiLineActualTexts": Array [ - "城市城市城市", - "城市城市城市", - "城市城市城市", - "城市城市城市", + "城市", + "城市", ], - "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", - "width": 96, + "originalText": "城市 +城市", + "width": 102.57, }, Object { - "actualText": "类别类别类别类别类别类别类别类别类别类别", - "actualTextHeight": 16, - "actualTextWidth": 241, - "height": 80, + "actualText": "类别类别", + "actualTextHeight": 32, + "actualTextWidth": 50, + "height": 48, "multiLineActualTexts": Array [ - "类别类别类别类别类别类别类别类别类别类别", + "类别", + "类别", ], - "originalText": "类别类别类别类别类别类别类别类别类别类别", - "width": 272, + "originalText": "类别 +类别", + "width": 285.14, }, Object { - "actualText": "子类别", - "actualTextHeight": 16, - "actualTextWidth": 37, - "height": 80, + "actualText": "子类别子类别子类别", + "actualTextHeight": 48, + "actualTextWidth": 111, + "height": 64, "multiLineActualTexts": Array [ "子类别", + "子类别", + "子类别", ], - "originalText": "子类别", - "width": 272, + "originalText": "子类别 +子类别 +子类别", + "width": 285.14, }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should calc correctly row cell height if actual text lines is difference 2`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust col cell height if corner cell height > col cell height 2`] = ` Array [ Object { "actualText": "1", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 80, + "height": 120, "multiLineActualTexts": Array [ "1", ], @@ -80,7 +85,7 @@ Array [ "actualText": "2", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 120, + "height": 30, "multiLineActualTexts": Array [ "2", ], @@ -91,271 +96,191 @@ Array [ "actualText": "3", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 80, + "height": 120, "multiLineActualTexts": Array [ "3", ], "originalText": "3", "width": 80, }, - Object { - "actualText": "4", - "actualTextHeight": 15, - "actualTextWidth": 7, - "height": 120, - "multiLineActualTexts": Array [ - "4", - ], - "originalText": "4", - "width": 80, - }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should calc correctly row cell height if actual text lines is difference 3`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust col cell height if corner cell height > col cell height 3`] = ` Array [ - Object { - "actualText": "纸张纸张纸张纸张纸张", - "actualTextHeight": 32, - "actualTextWidth": 122, - "height": 80, - "multiLineActualTexts": Array [ - "纸张纸张纸张", - "纸张纸张", - ], - "originalText": "纸张纸张纸张纸张纸张", - "width": 96, - }, - Object { - "actualText": "-", - "actualTextHeight": 16, - "actualTextWidth": 4, - "height": 80, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, - }, - Object { - "actualText": "数量数量数量数量数量数量数量数量数量数量数量", - "actualTextHeight": 60, - "actualTextWidth": 268, - "height": 76, - "multiLineActualTexts": Array [ - "数量数量数量", - "数量数量数量", - "数量数量数量", - "数量数量", - ], - "originalText": "数量数量数量数量数量数量数量数量数量数量数量", - "width": 96, - }, Object { "actualText": "家具", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 80, + "height": 48, "multiLineActualTexts": Array [ "家具", ], "originalText": "家具", - "width": 192, + "width": 205.14, }, Object { "actualText": "桌子", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 80, + "height": 64, "multiLineActualTexts": Array [ "桌子", ], "originalText": "桌子", - "width": 96, + "width": 102.57, }, Object { - "actualText": "数量数量数量数量数量数量数量数量数量数量数量", - "actualTextHeight": 60, - "actualTextWidth": 268, - "height": 76, + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 48, "multiLineActualTexts": Array [ - "数量数量数量", - "数量数量数量", - "数量数量数量", - "数量数量", + "数量...", ], - "originalText": "数量数量数量数量数量数量数量数量数量数量数量", - "width": 96, + "originalText": "数量 +数量 +数量 +数量", + "width": 102.57, }, Object { "actualText": "沙发", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 80, + "height": 64, "multiLineActualTexts": Array [ "沙发", ], "originalText": "沙发", - "width": 96, + "width": 102.57, }, Object { - "actualText": "数量数量数量数量数量数量数量数量数量数量数量", - "actualTextHeight": 60, - "actualTextWidth": 268, - "height": 76, + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 48, "multiLineActualTexts": Array [ - "数量数量数量", - "数量数量数量", - "数量数量数量", - "数量数量", + "数量...", ], - "originalText": "数量数量数量数量数量数量数量数量数量数量数量", - "width": 96, + "originalText": "数量 +数量 +数量 +数量", + "width": 102.57, }, Object { - "actualText": "家具家具家具家具家具家具家具家具家具家具家具家...", - "actualTextHeight": 64, - "actualTextWidth": 290, - "height": 80, + "actualText": "家具家具家具...", + "actualTextHeight": 16, + "actualTextWidth": 83, + "height": 48, "multiLineActualTexts": Array [ - "家具家具家具", - "家具家具家具", - "家具家具家具", - "家具家具家...", + "家具家具家具...", ], "originalText": "家具家具家具家具家具家具家具家具家具家具家具家具家具家具", - "width": 96, + "width": 102.57, }, Object { - "actualText": "桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌...", - "actualTextHeight": 64, - "actualTextWidth": 290, - "height": 80, + "actualText": "桌子桌子桌子...", + "actualTextHeight": 16, + "actualTextWidth": 83, + "height": 64, "multiLineActualTexts": Array [ - "桌子桌子桌子", - "桌子桌子桌子", - "桌子桌子桌子", - "桌子桌子桌...", + "桌子桌子桌子...", ], "originalText": "桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子", - "width": 96, + "width": 102.57, }, Object { - "actualText": "数量数量数量数量数量数量数量数量数量数量数量", - "actualTextHeight": 60, - "actualTextWidth": 268, - "height": 76, + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 48, "multiLineActualTexts": Array [ - "数量数量数量", - "数量数量数量", - "数量数量数量", - "数量数量", + "数量...", ], - "originalText": "数量数量数量数量数量数量数量数量数量数量数量", - "width": 96, + "originalText": "数量 +数量 +数量 +数量", + "width": 102.57, }, Object { "actualText": "办公用品", "actualTextHeight": 16, "actualTextWidth": 49, - "height": 80, + "height": 48, "multiLineActualTexts": Array [ "办公用品", ], "originalText": "办公用品", - "width": 192, + "width": 205.14, }, Object { "actualText": "笔", "actualTextHeight": 16, "actualTextWidth": 13, - "height": 80, + "height": 64, "multiLineActualTexts": Array [ "笔", ], "originalText": "笔", - "width": 96, + "width": 102.57, }, Object { - "actualText": "数量数量数量数量数量数量数量数量数量数量数量", - "actualTextHeight": 60, - "actualTextWidth": 268, - "height": 76, + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 48, "multiLineActualTexts": Array [ - "数量数量数量", - "数量数量数量", - "数量数量数量", - "数量数量", + "数量...", ], - "originalText": "数量数量数量数量数量数量数量数量数量数量数量", - "width": 96, + "originalText": "数量 +数量 +数量 +数量", + "width": 102.57, }, Object { "actualText": "纸张", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 80, + "height": 64, "multiLineActualTexts": Array [ "纸张", ], "originalText": "纸张", - "width": 96, + "width": 102.57, }, Object { - "actualText": "数量数量数量数量数量数量数量数量数量数量数量", - "actualTextHeight": 60, - "actualTextWidth": 268, - "height": 76, + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 48, "multiLineActualTexts": Array [ - "数量数量数量", - "数量数量数量", - "数量数量数量", - "数量数量", + "数量...", ], - "originalText": "数量数量数量数量数量数量数量数量数量数量数量", - "width": 96, + "originalText": "数量 +数量 +数量 +数量", + "width": 102.57, }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should calc correctly row cell height if actual text lines is difference 4`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust col cell height if corner cell height > col cell height 4`] = ` Array [ Object { - "actualText": "浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江浙...", - "actualTextHeight": 64, - "actualTextWidth": 290, - "height": 80, + "actualText": "浙江省", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 120, "multiLineActualTexts": Array [ - "浙江浙江浙江", - "浙江浙江浙江", - "浙江浙江浙江", - "浙江浙江浙...", + "浙江省", ], - "originalText": "浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江", - "width": 96, - }, - Object { - "actualText": "杭州杭州杭州杭州", - "actualTextHeight": 30, - "actualTextWidth": 98, - "height": 80, - "multiLineActualTexts": Array [ - "杭州杭州杭州", - "杭州", - ], - "originalText": "杭州杭州杭州杭州", - "width": 96, - }, - Object { - "actualText": "浙江省", - "actualTextHeight": 16, - "actualTextWidth": 37, - "height": 120, - "multiLineActualTexts": Array [ - "浙江省", - ], - "originalText": "浙江省", - "width": 96, + "originalText": "浙江省", + "width": 102.57, }, Object { "actualText": "绍兴市", @@ -366,7 +291,7 @@ Array [ "绍兴市", ], "originalText": "绍兴市", - "width": 96, + "width": 102.57, }, Object { "actualText": "宁波市", @@ -377,7 +302,7 @@ Array [ "宁波市", ], "originalText": "宁波市", - "width": 96, + "width": 102.57, }, Object { "actualText": "舟山市", @@ -388,7 +313,7 @@ Array [ "舟山市", ], "originalText": "舟山市", - "width": 96, + "width": 102.57, }, Object { "actualText": "杭州市", @@ -399,35 +324,29 @@ Array [ "杭州市", ], "originalText": "杭州市", - "width": 96, + "width": 102.57, }, Object { - "actualText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江...", - "actualTextHeight": 64, - "actualTextWidth": 290, - "height": 80, + "actualText": "浙江省浙江省...", + "actualTextHeight": 16, + "actualTextWidth": 83, + "height": 30, "multiLineActualTexts": Array [ - "浙江省浙江省", - "浙江省浙江省", - "浙江省浙江省", - "浙江省浙江...", + "浙江省浙江省...", ], "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", - "width": 96, + "width": 102.57, }, Object { - "actualText": "杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州...", - "actualTextHeight": 60, - "actualTextWidth": 290, - "height": 80, + "actualText": "杭州市杭州市...", + "actualTextHeight": 15, + "actualTextWidth": 83, + "height": 30, "multiLineActualTexts": Array [ - "杭州市杭州市", - "杭州市杭州市", - "杭州市杭州市", - "杭州市杭州...", + "杭州市杭州市...", ], "originalText": "杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市", - "width": 96, + "width": 102.57, }, Object { "actualText": "四川省", @@ -438,7 +357,7 @@ Array [ "四川省", ], "originalText": "四川省", - "width": 96, + "width": 102.57, }, Object { "actualText": "成都市", @@ -449,7 +368,7 @@ Array [ "成都市", ], "originalText": "成都市", - "width": 96, + "width": 102.57, }, Object { "actualText": "绵阳市", @@ -460,7 +379,7 @@ Array [ "绵阳市", ], "originalText": "绵阳市", - "width": 96, + "width": 102.57, }, Object { "actualText": "南充市", @@ -471,134 +390,34 @@ Array [ "南充市", ], "originalText": "南充市", - "width": 96, - }, -] -`; - -exports[`SpreadSheet Multi Line Text Tests PivotSheet should calc correctly row cell height if actual text lines is difference 5`] = ` -Array [ - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 80, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, - }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 30, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, - }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 30, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, - }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 30, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, - }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 30, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, - }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 80, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, - }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 30, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, - }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 30, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, + "width": 102.57, }, Object { - "actualText": "-", + "actualText": "乐山市", "actualTextHeight": 15, - "actualTextWidth": 4, + "actualTextWidth": 37, "height": 30, "multiLineActualTexts": Array [ - "-", + "乐山市", ], - "originalText": "-", - "width": 96, + "originalText": "乐山市", + "width": 102.57, }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust col cell height if corner cell height > col cell height 5`] = ` +Array [ Object { - "actualText": "-", + "actualText": "23672367236...", "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 80, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, - }, - Object { - "actualText": "236723672361111", - "actualTextHeight": 30, - "actualTextWidth": 99, + "actualTextWidth": 84, "height": 30, "multiLineActualTexts": Array [ - "23672367236", - "1111", + "23672367236...", ], "originalText": 236723672361111, - "width": 96, + "width": 102.57, }, Object { "actualText": "3877", @@ -609,7 +428,7 @@ Array [ "3877", ], "originalText": 3877, - "width": 96, + "width": 102.57, }, Object { "actualText": "4342", @@ -620,7 +439,7 @@ Array [ "4342", ], "originalText": 4342, - "width": 96, + "width": 102.57, }, Object { "actualText": "-", @@ -631,18 +450,18 @@ Array [ "-", ], "originalText": "-", - "width": 96, + "width": 102.57, }, Object { "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 80, + "height": 30, "multiLineActualTexts": Array [ "-", ], "originalText": "-", - "width": 96, + "width": 102.57, }, Object { "actualText": "1723", @@ -653,7 +472,7 @@ Array [ "1723", ], "originalText": 1723, - "width": 96, + "width": 102.57, }, Object { "actualText": "1822", @@ -664,7 +483,7 @@ Array [ "1822", ], "originalText": 1822, - "width": 96, + "width": 102.57, }, Object { "actualText": "1943", @@ -675,18 +494,18 @@ Array [ "1943", ], "originalText": 1943, - "width": 96, + "width": 102.57, }, Object { - "actualText": "-", + "actualText": "2330", "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 80, + "actualTextWidth": 27, + "height": 30, "multiLineActualTexts": Array [ - "-", + "2330", ], - "originalText": "-", - "width": 96, + "originalText": 2330, + "width": 102.57, }, Object { "actualText": "632", @@ -697,7 +516,7 @@ Array [ "632", ], "originalText": 632, - "width": 96, + "width": 102.57, }, Object { "actualText": "7234", @@ -708,7 +527,7 @@ Array [ "7234", ], "originalText": 7234, - "width": 96, + "width": 102.57, }, Object { "actualText": "834", @@ -719,7 +538,7 @@ Array [ "834", ], "originalText": 834, - "width": 96, + "width": 102.57, }, Object { "actualText": "5343", @@ -730,18 +549,18 @@ Array [ "5343", ], "originalText": 5343, - "width": 96, + "width": 102.57, }, Object { "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 80, + "height": 30, "multiLineActualTexts": Array [ "-", ], "originalText": "-", - "width": 96, + "width": 102.57, }, Object { "actualText": "2451", @@ -752,7 +571,7 @@ Array [ "2451", ], "originalText": 2451, - "width": 96, + "width": 102.57, }, Object { "actualText": "2244", @@ -763,7 +582,7 @@ Array [ "2244", ], "originalText": 2244, - "width": 96, + "width": 102.57, }, Object { "actualText": "2333", @@ -774,18 +593,18 @@ Array [ "2333", ], "originalText": 2333, - "width": 96, + "width": 102.57, }, Object { - "actualText": "-", + "actualText": "2445", "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 80, + "actualTextWidth": 27, + "height": 30, "multiLineActualTexts": Array [ - "-", + "2445", ], - "originalText": "-", - "width": 96, + "originalText": 2445, + "width": 102.57, }, Object { "actualText": "-", @@ -796,7 +615,7 @@ Array [ "-", ], "originalText": "-", - "width": 96, + "width": 102.57, }, Object { "actualText": "-", @@ -807,7 +626,7 @@ Array [ "-", ], "originalText": "-", - "width": 96, + "width": 102.57, }, Object { "actualText": "-", @@ -818,7 +637,7 @@ Array [ "-", ], "originalText": "-", - "width": 96, + "width": 102.57, }, Object { "actualText": "-", @@ -829,20 +648,18 @@ Array [ "-", ], "originalText": "-", - "width": 96, + "width": 102.57, }, Object { - "actualText": "7789778977897789778977897789", - "actualTextHeight": 45, - "actualTextWidth": 189, - "height": 80, + "actualText": "77897789778...", + "actualTextHeight": 15, + "actualTextWidth": 84, + "height": 30, "multiLineActualTexts": Array [ - "77897789778", - "97789778977", - "897789", + "77897789778...", ], "originalText": "7789778977897789778977897789", - "width": 96, + "width": 102.57, }, Object { "actualText": "-", @@ -853,7 +670,7 @@ Array [ "-", ], "originalText": "-", - "width": 96, + "width": 102.57, }, Object { "actualText": "-", @@ -864,7 +681,7 @@ Array [ "-", ], "originalText": "-", - "width": 96, + "width": 102.57, }, Object { "actualText": "-", @@ -875,18 +692,18 @@ Array [ "-", ], "originalText": "-", - "width": 96, + "width": 102.57, }, Object { "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 80, + "height": 30, "multiLineActualTexts": Array [ "-", ], "originalText": "-", - "width": 96, + "width": 102.57, }, Object { "actualText": "1304", @@ -897,7 +714,7 @@ Array [ "1304", ], "originalText": 1304, - "width": 96, + "width": 102.57, }, Object { "actualText": "1145", @@ -908,7 +725,7 @@ Array [ "1145", ], "originalText": 1145, - "width": 96, + "width": 102.57, }, Object { "actualText": "1432", @@ -919,7 +736,7 @@ Array [ "1432", ], "originalText": 1432, - "width": 96, + "width": 102.57, }, Object { "actualText": "945", @@ -930,18 +747,18 @@ Array [ "945", ], "originalText": 945, - "width": 96, + "width": 102.57, }, Object { "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 80, + "height": 30, "multiLineActualTexts": Array [ "-", ], "originalText": "-", - "width": 96, + "width": 102.57, }, Object { "actualText": "2335", @@ -952,7 +769,7 @@ Array [ "2335", ], "originalText": 2335, - "width": 96, + "width": 102.57, }, Object { "actualText": "245", @@ -963,7 +780,7 @@ Array [ "245", ], "originalText": 245, - "width": 96, + "width": 102.57, }, Object { "actualText": "2457", @@ -974,18 +791,18 @@ Array [ "2457", ], "originalText": 2457, - "width": 96, + "width": 102.57, }, Object { - "actualText": "-", + "actualText": "2458", "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 80, + "actualTextWidth": 27, + "height": 30, "multiLineActualTexts": Array [ - "-", + "2458", ], - "originalText": "-", - "width": 96, + "originalText": 2458, + "width": 102.57, }, Object { "actualText": "1354", @@ -996,7 +813,7 @@ Array [ "1354", ], "originalText": 1354, - "width": 96, + "width": 102.57, }, Object { "actualText": "1523", @@ -1007,7 +824,7 @@ Array [ "1523", ], "originalText": 1523, - "width": 96, + "width": 102.57, }, Object { "actualText": "1634", @@ -1018,7 +835,7 @@ Array [ "1634", ], "originalText": 1634, - "width": 96, + "width": 102.57, }, Object { "actualText": "1343", @@ -1029,18 +846,18 @@ Array [ "1343", ], "originalText": 1343, - "width": 96, + "width": 102.57, }, Object { "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 80, + "height": 30, "multiLineActualTexts": Array [ "-", ], "originalText": "-", - "width": 96, + "width": 102.57, }, Object { "actualText": "4004", @@ -1051,7 +868,7 @@ Array [ "4004", ], "originalText": 4004, - "width": 96, + "width": 102.57, }, Object { "actualText": "3077", @@ -1062,7 +879,7 @@ Array [ "3077", ], "originalText": 3077, - "width": 96, + "width": 102.57, }, Object { "actualText": "3551", @@ -1073,18 +890,29 @@ Array [ "3551", ], "originalText": 3551, - "width": 96, + "width": 102.57, + }, + Object { + "actualText": "352", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "352", + ], + "originalText": 352, + "width": 102.57, }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should default render one line text 1`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust col cell height if corner cell height > col cell height by "valueInCols: false" 1`] = ` Array [ Object { "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 30, + "height": 48, "multiLineActualTexts": Array [ "序号", ], @@ -1092,53 +920,57 @@ Array [ "width": 80, }, Object { - "actualText": "省份", + "actualText": "province", "actualTextHeight": 16, - "actualTextWidth": 25, - "height": 30, + "actualTextWidth": 51, + "height": 48, "multiLineActualTexts": Array [ - "省份", + "province", ], - "originalText": "省份", + "originalText": "province", "width": 96, }, Object { - "actualText": "城市城市城...", - "actualTextHeight": 16, - "actualTextWidth": 71, - "height": 30, + "actualText": "城市城市", + "actualTextHeight": 32, + "actualTextWidth": 50, + "height": 48, "multiLineActualTexts": Array [ - "城市城市城...", + "城市", + "城市", ], - "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", + "originalText": "城市 +城市", "width": 96, }, Object { - "actualText": "类别类别类别类别类别类别类别类别类别类别", + "actualText": "数值", "actualTextHeight": 16, - "actualTextWidth": 241, - "height": 30, + "actualTextWidth": 25, + "height": 48, "multiLineActualTexts": Array [ - "类别类别类别类别类别类别类别类别类别类别", + "数值", ], - "originalText": "类别类别类别类别类别类别类别类别类别类别", - "width": 272, + "originalText": "数值", + "width": 96, }, Object { - "actualText": "子类别", - "actualTextHeight": 16, - "actualTextWidth": 37, - "height": 30, + "actualText": "类别类别", + "actualTextHeight": 32, + "actualTextWidth": 50, + "height": 48, "multiLineActualTexts": Array [ - "子类别", + "类别", + "类别", ], - "originalText": "子类别", - "width": 272, + "originalText": "类别 +类别", + "width": 368, }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should default render one line text 2`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust col cell height if corner cell height > col cell height by "valueInCols: false" 2`] = ` Array [ Object { "actualText": "1", @@ -1176,13 +1008,13 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should default render one line text 3`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust col cell height if corner cell height > col cell height by "valueInCols: false" 3`] = ` Array [ Object { "actualText": "家具", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 30, + "height": 48, "multiLineActualTexts": Array [ "家具", ], @@ -1191,9 +1023,9 @@ Array [ }, Object { "actualText": "桌子", - "actualTextHeight": 16, + "actualTextHeight": 15, "actualTextWidth": 25, - "height": 30, + "height": 48, "multiLineActualTexts": Array [ "桌子", ], @@ -1201,156 +1033,414 @@ Array [ "width": 96, }, Object { - "actualText": "数量数量数...", + "actualText": "沙发", "actualTextHeight": 15, - "actualTextWidth": 71, - "height": 30, + "actualTextWidth": 25, + "height": 48, "multiLineActualTexts": Array [ - "数量数量数...", + "沙发", ], - "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "originalText": "沙发", "width": 96, }, Object { - "actualText": "沙发", + "actualText": "家具家具家...", "actualTextHeight": 16, - "actualTextWidth": 25, - "height": 30, + "actualTextWidth": 71, + "height": 48, "multiLineActualTexts": Array [ - "沙发", + "家具家具家...", ], - "originalText": "沙发", + "originalText": "家具家具家具家具家具家具家具家具家具家具家具家具家具家具", "width": 96, }, Object { - "actualText": "数量数量数...", + "actualText": "桌子桌子桌...", "actualTextHeight": 15, "actualTextWidth": 71, - "height": 30, + "height": 48, "multiLineActualTexts": Array [ - "数量数量数...", + "桌子桌子桌...", ], - "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "originalText": "桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子", "width": 96, }, -] -`; - -exports[`SpreadSheet Multi Line Text Tests PivotSheet should default render one line text 4`] = ` -Array [ Object { - "actualText": "浙江省", + "actualText": "办公用品", "actualTextHeight": 16, - "actualTextWidth": 37, - "height": 120, + "actualTextWidth": 49, + "height": 48, "multiLineActualTexts": Array [ - "浙江省", + "办公用品", ], - "originalText": "浙江省", - "width": 96, + "originalText": "办公用品", + "width": 192, }, Object { - "actualText": "浙江省浙江...", - "actualTextHeight": 16, - "actualTextWidth": 71, - "height": 30, + "actualText": "笔", + "actualTextHeight": 15, + "actualTextWidth": 13, + "height": 48, "multiLineActualTexts": Array [ - "浙江省浙江...", + "笔", ], - "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", + "originalText": "笔", "width": 96, }, Object { - "actualText": "四川省", - "actualTextHeight": 16, - "actualTextWidth": 37, - "height": 120, + "actualText": "纸张", + "actualTextHeight": 15, + "actualTextWidth": 25, + "height": 48, "multiLineActualTexts": Array [ - "四川省", + "纸张", ], - "originalText": "四川省", + "originalText": "纸张", "width": 96, }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should default render one line text 5`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust col cell height if corner cell height > col cell height by "valueInCols: false" 4`] = ` Array [ Object { - "actualText": "2367236723...", - "actualTextHeight": 15, - "actualTextWidth": 77, - "height": 30, + "actualText": "浙江省", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 120, "multiLineActualTexts": Array [ - "2367236723...", + "浙江省", ], - "originalText": 236723672361111, + "originalText": "浙江省", "width": 96, }, Object { - "actualText": "3877", + "actualText": "绍兴市", "actualTextHeight": 15, - "actualTextWidth": 27, + "actualTextWidth": 37, "height": 30, "multiLineActualTexts": Array [ - "3877", + "绍兴市", ], - "originalText": 3877, + "originalText": "绍兴市", "width": 96, }, Object { - "actualText": "4342", + "actualText": "数量...", "actualTextHeight": 15, - "actualTextWidth": 27, + "actualTextWidth": 35, "height": 30, "multiLineActualTexts": Array [ - "4342", + "数量...", ], - "originalText": 4342, + "originalText": "数量 +数量 +数量 +数量", "width": 96, }, Object { - "actualText": "-", + "actualText": "宁波市", "actualTextHeight": 15, - "actualTextWidth": 4, + "actualTextWidth": 37, "height": 30, "multiLineActualTexts": Array [ - "-", + "宁波市", ], - "originalText": "-", + "originalText": "宁波市", "width": 96, }, Object { - "actualText": "-", + "actualText": "数量...", "actualTextHeight": 15, - "actualTextWidth": 4, + "actualTextWidth": 35, "height": 30, "multiLineActualTexts": Array [ - "-", + "数量...", ], - "originalText": "-", + "originalText": "数量 +数量 +数量 +数量", "width": 96, }, Object { - "actualText": "1723", + "actualText": "舟山市", "actualTextHeight": 15, - "actualTextWidth": 27, + "actualTextWidth": 37, "height": 30, "multiLineActualTexts": Array [ - "1723", + "舟山市", ], - "originalText": 1723, + "originalText": "舟山市", "width": 96, }, Object { - "actualText": "1822", + "actualText": "数量...", "actualTextHeight": 15, - "actualTextWidth": 27, + "actualTextWidth": 35, "height": 30, "multiLineActualTexts": Array [ - "1822", + "数量...", ], - "originalText": 1822, + "originalText": "数量 +数量 +数量 +数量", + "width": 96, + }, + Object { + "actualText": "杭州市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "杭州市", + ], + "originalText": "杭州市", + "width": 96, + }, + Object { + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 30, + "multiLineActualTexts": Array [ + "数量...", + ], + "originalText": "数量 +数量 +数量 +数量", + "width": 96, + }, + Object { + "actualText": "浙江省浙江...", + "actualTextHeight": 16, + "actualTextWidth": 71, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省浙江...", + ], + "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", + "width": 96, + }, + Object { + "actualText": "杭州市杭州...", + "actualTextHeight": 15, + "actualTextWidth": 71, + "height": 30, + "multiLineActualTexts": Array [ + "杭州市杭州...", + ], + "originalText": "杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市", + "width": 96, + }, + Object { + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 30, + "multiLineActualTexts": Array [ + "数量...", + ], + "originalText": "数量 +数量 +数量 +数量", + "width": 96, + }, + Object { + "actualText": "四川省", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 120, + "multiLineActualTexts": Array [ + "四川省", + ], + "originalText": "四川省", + "width": 96, + }, + Object { + "actualText": "成都市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "成都市", + ], + "originalText": "成都市", + "width": 96, + }, + Object { + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 30, + "multiLineActualTexts": Array [ + "数量...", + ], + "originalText": "数量 +数量 +数量 +数量", + "width": 96, + }, + Object { + "actualText": "绵阳市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绵阳市", + ], + "originalText": "绵阳市", + "width": 96, + }, + Object { + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 30, + "multiLineActualTexts": Array [ + "数量...", + ], + "originalText": "数量 +数量 +数量 +数量", + "width": 96, + }, + Object { + "actualText": "南充市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "南充市", + ], + "originalText": "南充市", + "width": 96, + }, + Object { + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 30, + "multiLineActualTexts": Array [ + "数量...", + ], + "originalText": "数量 +数量 +数量 +数量", + "width": 96, + }, + Object { + "actualText": "乐山市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "乐山市", + ], + "originalText": "乐山市", + "width": 96, + }, + Object { + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 30, + "multiLineActualTexts": Array [ + "数量...", + ], + "originalText": "数量 +数量 +数量 +数量", + "width": 96, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust col cell height if corner cell height > col cell height by "valueInCols: false" 5`] = ` +Array [ + Object { + "actualText": "2367236723...", + "actualTextHeight": 15, + "actualTextWidth": 77, + "height": 30, + "multiLineActualTexts": Array [ + "2367236723...", + ], + "originalText": 236723672361111, + "width": 96, + }, + Object { + "actualText": "3877", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "3877", + ], + "originalText": 3877, + "width": 96, + }, + Object { + "actualText": "4342", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "4342", + ], + "originalText": 4342, + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "1723", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1723", + ], + "originalText": 1723, + "width": 96, + }, + Object { + "actualText": "1822", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1822", + ], + "originalText": 1822, "width": 96, }, Object { @@ -1474,40 +1564,3746 @@ Array [ "originalText": 2445, "width": 96, }, -] -`; - -exports[`SpreadSheet Multi Line Text Tests PivotSheet should get correctly col cell height priority if actual text not wrap 1`] = ` -Array [ Object { - "actualText": "序号", - "actualTextHeight": 16, - "actualTextWidth": 25, - "height": 20, + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, "multiLineActualTexts": Array [ - "序号", + "-", ], - "originalText": "序号", - "width": 80, + "originalText": "-", + "width": 96, }, Object { - "actualText": "province", - "actualTextHeight": 16, - "actualTextWidth": 51, - "height": 20, + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, "multiLineActualTexts": Array [ - "province", + "-", ], - "originalText": "province", - "width": 119.66, + "originalText": "-", + "width": 96, }, Object { - "actualText": "city", - "actualTextHeight": 16, - "actualTextWidth": 21, - "height": 20, - "multiLineActualTexts": Array [ - "city", + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "7789778977...", + "actualTextHeight": 15, + "actualTextWidth": 77, + "height": 30, + "multiLineActualTexts": Array [ + "7789778977...", + ], + "originalText": "7789778977897789778977897789", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "1304", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1304", + ], + "originalText": 1304, + "width": 96, + }, + Object { + "actualText": "1145", + "actualTextHeight": 15, + "actualTextWidth": 26, + "height": 30, + "multiLineActualTexts": Array [ + "1145", + ], + "originalText": 1145, + "width": 96, + }, + Object { + "actualText": "1432", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1432", + ], + "originalText": 1432, + "width": 96, + }, + Object { + "actualText": "945", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "945", + ], + "originalText": 945, + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "2335", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2335", + ], + "originalText": 2335, + "width": 96, + }, + Object { + "actualText": "245", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "245", + ], + "originalText": 245, + "width": 96, + }, + Object { + "actualText": "2457", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2457", + ], + "originalText": 2457, + "width": 96, + }, + Object { + "actualText": "2458", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2458", + ], + "originalText": 2458, + "width": 96, + }, + Object { + "actualText": "1354", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1354", + ], + "originalText": 1354, + "width": 96, + }, + Object { + "actualText": "1523", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1523", + ], + "originalText": 1523, + "width": 96, + }, + Object { + "actualText": "1634", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1634", + ], + "originalText": 1634, + "width": 96, + }, + Object { + "actualText": "1343", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1343", + ], + "originalText": 1343, + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "4004", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "4004", + ], + "originalText": 4004, + "width": 96, + }, + Object { + "actualText": "3077", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "3077", + ], + "originalText": 3077, + "width": 96, + }, + Object { + "actualText": "3551", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "3551", + ], + "originalText": 3551, + "width": 96, + }, + Object { + "actualText": "352", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "352", + ], + "originalText": 352, + "width": 96, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust col cell height if corner cell height > col cell height by tree mode 1`] = ` +Array [ + Object { + "actualText": "序号", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 80, + "multiLineActualTexts": Array [ + "序号", + ], + "originalText": "序号", + "width": 80, + }, + Object { + "actualText": "province/城市城市", + "actualTextHeight": 32, + "actualTextWidth": 103, + "height": 80, + "multiLineActualTexts": Array [ + "province/城市", + "城市", + ], + "originalText": "province/城市 +城市", + "width": 150, + }, + Object { + "actualText": "类别类别", + "actualTextHeight": 32, + "actualTextWidth": 50, + "height": 48, + "multiLineActualTexts": Array [ + "类别", + "类别", + ], + "originalText": "类别 +类别", + "width": 230, + }, + Object { + "actualText": "子类别子类别子类别", + "actualTextHeight": 48, + "actualTextWidth": 111, + "height": 64, + "multiLineActualTexts": Array [ + "子类别", + "子类别", + "子类别", + ], + "originalText": "子类别 +子类别 +子类别", + "width": 230, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust col cell height if corner cell height > col cell height by tree mode 2`] = ` +Array [ + Object { + "actualText": "1", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 150, + "multiLineActualTexts": Array [ + "1", + ], + "originalText": "1", + "width": 80, + }, + Object { + "actualText": "2", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 60, + "multiLineActualTexts": Array [ + "2", + ], + "originalText": "2", + "width": 80, + }, + Object { + "actualText": "3", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 150, + "multiLineActualTexts": Array [ + "3", + ], + "originalText": "3", + "width": 80, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust col cell height if corner cell height > col cell height by tree mode 3`] = ` +Array [ + Object { + "actualText": "家具", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 48, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 227.2, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 64, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 113.6, + }, + Object { + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 80, + "multiLineActualTexts": Array [ + "数量...", + ], + "originalText": "数量 +数量 +数量 +数量", + "width": 113.6, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 64, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 113.6, + }, + Object { + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 80, + "multiLineActualTexts": Array [ + "数量...", + ], + "originalText": "数量 +数量 +数量 +数量", + "width": 113.6, + }, + Object { + "actualText": "家具家具家具家...", + "actualTextHeight": 16, + "actualTextWidth": 95, + "height": 48, + "multiLineActualTexts": Array [ + "家具家具家具家...", + ], + "originalText": "家具家具家具家具家具家具家具家具家具家具家具家具家具家具", + "width": 113.6, + }, + Object { + "actualText": "桌子桌子桌子桌...", + "actualTextHeight": 16, + "actualTextWidth": 95, + "height": 64, + "multiLineActualTexts": Array [ + "桌子桌子桌子桌...", + ], + "originalText": "桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子", + "width": 113.6, + }, + Object { + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 80, + "multiLineActualTexts": Array [ + "数量...", + ], + "originalText": "数量 +数量 +数量 +数量", + "width": 113.6, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 16, + "actualTextWidth": 49, + "height": 48, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 227.2, + }, + Object { + "actualText": "笔", + "actualTextHeight": 16, + "actualTextWidth": 13, + "height": 64, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 113.6, + }, + Object { + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 80, + "multiLineActualTexts": Array [ + "数量...", + ], + "originalText": "数量 +数量 +数量 +数量", + "width": 113.6, + }, + Object { + "actualText": "纸张", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 64, + "multiLineActualTexts": Array [ + "纸张", + ], + "originalText": "纸张", + "width": 113.6, + }, + Object { + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 80, + "multiLineActualTexts": Array [ + "数量...", + ], + "originalText": "数量 +数量 +数量 +数量", + "width": 113.6, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust col cell height if corner cell height > col cell height by tree mode 4`] = ` +Array [ + Object { + "actualText": "浙江省", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 150, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 150, + }, + Object { + "actualText": "宁波市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "宁波市", + ], + "originalText": "宁波市", + "width": 150, + }, + Object { + "actualText": "舟山市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "舟山市", + ], + "originalText": "舟山市", + "width": 150, + }, + Object { + "actualText": "杭州市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "杭州市", + ], + "originalText": "杭州市", + "width": 150, + }, + Object { + "actualText": "浙江省浙江省浙江省...", + "actualTextHeight": 16, + "actualTextWidth": 119, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省浙江省浙江省...", + ], + "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", + "width": 150, + }, + Object { + "actualText": "杭州市杭州市杭州市...", + "actualTextHeight": 15, + "actualTextWidth": 119, + "height": 30, + "multiLineActualTexts": Array [ + "杭州市杭州市杭州市...", + ], + "originalText": "杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市", + "width": 150, + }, + Object { + "actualText": "四川省", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "四川省", + ], + "originalText": "四川省", + "width": 150, + }, + Object { + "actualText": "成都市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "成都市", + ], + "originalText": "成都市", + "width": 150, + }, + Object { + "actualText": "绵阳市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绵阳市", + ], + "originalText": "绵阳市", + "width": 150, + }, + Object { + "actualText": "南充市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "南充市", + ], + "originalText": "南充市", + "width": 150, + }, + Object { + "actualText": "乐山市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "乐山市", + ], + "originalText": "乐山市", + "width": 150, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust col cell height if corner cell height > col cell height by tree mode 5`] = ` +Array [ + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 30, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 113.6, + }, + Object { + "actualText": "2367236723611...", + "actualTextHeight": 15, + "actualTextWidth": 96, + "height": 30, + "multiLineActualTexts": Array [ + "2367236723611...", + ], + "originalText": 236723672361111, + "width": 113.6, + }, + Object { + "actualText": "3877", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "3877", + ], + "originalText": 3877, + "width": 113.6, + }, + Object { + "actualText": "4342", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "4342", + ], + "originalText": 4342, + "width": 113.6, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 113.6, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 30, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 113.6, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 113.6, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 30, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 113.6, + }, + Object { + "actualText": "1723", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1723", + ], + "originalText": 1723, + "width": 113.6, + }, + Object { + "actualText": "1822", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1822", + ], + "originalText": 1822, + "width": 113.6, + }, + Object { + "actualText": "1943", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1943", + ], + "originalText": 1943, + "width": 113.6, + }, + Object { + "actualText": "2330", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2330", + ], + "originalText": 2330, + "width": 113.6, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 30, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 113.6, + }, + Object { + "actualText": "632", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "632", + ], + "originalText": 632, + "width": 113.6, + }, + Object { + "actualText": "7234", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "7234", + ], + "originalText": 7234, + "width": 113.6, + }, + Object { + "actualText": "834", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "834", + ], + "originalText": 834, + "width": 113.6, + }, + Object { + "actualText": "5343", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "5343", + ], + "originalText": 5343, + "width": 113.6, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 30, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 113.6, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 113.6, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 30, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 113.6, + }, + Object { + "actualText": "2451", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2451", + ], + "originalText": 2451, + "width": 113.6, + }, + Object { + "actualText": "2244", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2244", + ], + "originalText": 2244, + "width": 113.6, + }, + Object { + "actualText": "2333", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2333", + ], + "originalText": 2333, + "width": 113.6, + }, + Object { + "actualText": "2445", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2445", + ], + "originalText": 2445, + "width": 113.6, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 30, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 113.6, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 113.6, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 113.6, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 113.6, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 113.6, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 30, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 113.6, + }, + Object { + "actualText": "7789778977897...", + "actualTextHeight": 15, + "actualTextWidth": 97, + "height": 30, + "multiLineActualTexts": Array [ + "7789778977897...", + ], + "originalText": "7789778977897789778977897789", + "width": 113.6, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 30, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 113.6, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 113.6, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 113.6, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 113.6, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 113.6, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 30, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 113.6, + }, + Object { + "actualText": "1304", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1304", + ], + "originalText": 1304, + "width": 113.6, + }, + Object { + "actualText": "1145", + "actualTextHeight": 15, + "actualTextWidth": 26, + "height": 30, + "multiLineActualTexts": Array [ + "1145", + ], + "originalText": 1145, + "width": 113.6, + }, + Object { + "actualText": "1432", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1432", + ], + "originalText": 1432, + "width": 113.6, + }, + Object { + "actualText": "945", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "945", + ], + "originalText": 945, + "width": 113.6, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 30, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 113.6, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 113.6, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 30, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 113.6, + }, + Object { + "actualText": "2335", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2335", + ], + "originalText": 2335, + "width": 113.6, + }, + Object { + "actualText": "245", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "245", + ], + "originalText": 245, + "width": 113.6, + }, + Object { + "actualText": "2457", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2457", + ], + "originalText": 2457, + "width": 113.6, + }, + Object { + "actualText": "2458", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2458", + ], + "originalText": 2458, + "width": 113.6, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 30, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 113.6, + }, + Object { + "actualText": "1354", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1354", + ], + "originalText": 1354, + "width": 113.6, + }, + Object { + "actualText": "1523", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1523", + ], + "originalText": 1523, + "width": 113.6, + }, + Object { + "actualText": "1634", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1634", + ], + "originalText": 1634, + "width": 113.6, + }, + Object { + "actualText": "1343", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1343", + ], + "originalText": 1343, + "width": 113.6, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 30, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 113.6, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 113.6, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 30, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 113.6, + }, + Object { + "actualText": "4004", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "4004", + ], + "originalText": 4004, + "width": 113.6, + }, + Object { + "actualText": "3077", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "3077", + ], + "originalText": 3077, + "width": 113.6, + }, + Object { + "actualText": "3551", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "3551", + ], + "originalText": 3551, + "width": 113.6, + }, + Object { + "actualText": "352", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "352", + ], + "originalText": 352, + "width": 113.6, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust corner cell max lines by custom col height 1`] = ` +Array [ + Object { + "actualText": "序号", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "序号", + ], + "originalText": "序号", + "width": 80, + }, + Object { + "actualText": "province", + "actualTextHeight": 16, + "actualTextWidth": 51, + "height": 20, + "multiLineActualTexts": Array [ + "province", + ], + "originalText": "province", + "width": 102.57, + }, + Object { + "actualText": "城市...", + "actualTextHeight": 16, + "actualTextWidth": 35, + "height": 20, + "multiLineActualTexts": Array [ + "城市...", + ], + "originalText": "城市 +城市", + "width": 102.57, + }, + Object { + "actualText": "类别...", + "actualTextHeight": 16, + "actualTextWidth": 35, + "height": 20, + "multiLineActualTexts": Array [ + "类别...", + ], + "originalText": "类别 +类别", + "width": 285.14, + }, + Object { + "actualText": "子类别...", + "actualTextHeight": 16, + "actualTextWidth": 47, + "height": 20, + "multiLineActualTexts": Array [ + "子类别...", + ], + "originalText": "子类别 +子类别 +子类别", + "width": 285.14, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust corner cell max lines by custom col height 2`] = ` +Array [ + Object { + "actualText": "1", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 120, + "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": 120, + "multiLineActualTexts": Array [ + "3", + ], + "originalText": "3", + "width": 80, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust corner cell max lines by custom col height 3`] = ` +Array [ + Object { + "actualText": "家具", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 205.14, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 102.57, + }, + Object { + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 20, + "multiLineActualTexts": Array [ + "数量...", + ], + "originalText": "数量 +数量 +数量 +数量", + "width": 102.57, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 102.57, + }, + Object { + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 20, + "multiLineActualTexts": Array [ + "数量...", + ], + "originalText": "数量 +数量 +数量 +数量", + "width": 102.57, + }, + Object { + "actualText": "家具家具家具...", + "actualTextHeight": 16, + "actualTextWidth": 83, + "height": 20, + "multiLineActualTexts": Array [ + "家具家具家具...", + ], + "originalText": "家具家具家具家具家具家具家具家具家具家具家具家具家具家具", + "width": 102.57, + }, + Object { + "actualText": "桌子桌子桌子...", + "actualTextHeight": 16, + "actualTextWidth": 83, + "height": 20, + "multiLineActualTexts": Array [ + "桌子桌子桌子...", + ], + "originalText": "桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子", + "width": 102.57, + }, + Object { + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 20, + "multiLineActualTexts": Array [ + "数量...", + ], + "originalText": "数量 +数量 +数量 +数量", + "width": 102.57, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 16, + "actualTextWidth": 49, + "height": 20, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 205.14, + }, + Object { + "actualText": "笔", + "actualTextHeight": 16, + "actualTextWidth": 13, + "height": 20, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 102.57, + }, + Object { + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 20, + "multiLineActualTexts": Array [ + "数量...", + ], + "originalText": "数量 +数量 +数量 +数量", + "width": 102.57, + }, + Object { + "actualText": "纸张", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "纸张", + ], + "originalText": "纸张", + "width": 102.57, + }, + Object { + "actualText": "数量...", + "actualTextHeight": 15, + "actualTextWidth": 35, + "height": 20, + "multiLineActualTexts": Array [ + "数量...", + ], + "originalText": "数量 +数量 +数量 +数量", + "width": 102.57, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust corner cell max lines by custom col height 4`] = ` +Array [ + Object { + "actualText": "浙江省", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 120, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 102.57, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 102.57, + }, + Object { + "actualText": "宁波市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "宁波市", + ], + "originalText": "宁波市", + "width": 102.57, + }, + Object { + "actualText": "舟山市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "舟山市", + ], + "originalText": "舟山市", + "width": 102.57, + }, + Object { + "actualText": "杭州市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "杭州市", + ], + "originalText": "杭州市", + "width": 102.57, + }, + Object { + "actualText": "浙江省浙江省...", + "actualTextHeight": 16, + "actualTextWidth": 83, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省浙江省...", + ], + "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", + "width": 102.57, + }, + Object { + "actualText": "杭州市杭州市...", + "actualTextHeight": 15, + "actualTextWidth": 83, + "height": 30, + "multiLineActualTexts": Array [ + "杭州市杭州市...", + ], + "originalText": "杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市", + "width": 102.57, + }, + Object { + "actualText": "四川省", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 120, + "multiLineActualTexts": Array [ + "四川省", + ], + "originalText": "四川省", + "width": 102.57, + }, + Object { + "actualText": "成都市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "成都市", + ], + "originalText": "成都市", + "width": 102.57, + }, + Object { + "actualText": "绵阳市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绵阳市", + ], + "originalText": "绵阳市", + "width": 102.57, + }, + Object { + "actualText": "南充市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "南充市", + ], + "originalText": "南充市", + "width": 102.57, + }, + Object { + "actualText": "乐山市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "乐山市", + ], + "originalText": "乐山市", + "width": 102.57, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should adjust corner cell max lines by custom col height 5`] = ` +Array [ + Object { + "actualText": "23672367236...", + "actualTextHeight": 15, + "actualTextWidth": 84, + "height": 30, + "multiLineActualTexts": Array [ + "23672367236...", + ], + "originalText": 236723672361111, + "width": 102.57, + }, + Object { + "actualText": "3877", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "3877", + ], + "originalText": 3877, + "width": 102.57, + }, + Object { + "actualText": "4342", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "4342", + ], + "originalText": 4342, + "width": 102.57, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 102.57, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 102.57, + }, + Object { + "actualText": "1723", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1723", + ], + "originalText": 1723, + "width": 102.57, + }, + Object { + "actualText": "1822", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1822", + ], + "originalText": 1822, + "width": 102.57, + }, + Object { + "actualText": "1943", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1943", + ], + "originalText": 1943, + "width": 102.57, + }, + Object { + "actualText": "2330", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2330", + ], + "originalText": 2330, + "width": 102.57, + }, + Object { + "actualText": "632", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "632", + ], + "originalText": 632, + "width": 102.57, + }, + Object { + "actualText": "7234", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "7234", + ], + "originalText": 7234, + "width": 102.57, + }, + Object { + "actualText": "834", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "834", + ], + "originalText": 834, + "width": 102.57, + }, + Object { + "actualText": "5343", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "5343", + ], + "originalText": 5343, + "width": 102.57, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 102.57, + }, + Object { + "actualText": "2451", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2451", + ], + "originalText": 2451, + "width": 102.57, + }, + Object { + "actualText": "2244", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2244", + ], + "originalText": 2244, + "width": 102.57, + }, + Object { + "actualText": "2333", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2333", + ], + "originalText": 2333, + "width": 102.57, + }, + Object { + "actualText": "2445", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2445", + ], + "originalText": 2445, + "width": 102.57, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 102.57, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 102.57, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 102.57, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 102.57, + }, + Object { + "actualText": "77897789778...", + "actualTextHeight": 15, + "actualTextWidth": 84, + "height": 30, + "multiLineActualTexts": Array [ + "77897789778...", + ], + "originalText": "7789778977897789778977897789", + "width": 102.57, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 102.57, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 102.57, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 102.57, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 102.57, + }, + Object { + "actualText": "1304", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1304", + ], + "originalText": 1304, + "width": 102.57, + }, + Object { + "actualText": "1145", + "actualTextHeight": 15, + "actualTextWidth": 26, + "height": 30, + "multiLineActualTexts": Array [ + "1145", + ], + "originalText": 1145, + "width": 102.57, + }, + Object { + "actualText": "1432", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1432", + ], + "originalText": 1432, + "width": 102.57, + }, + Object { + "actualText": "945", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "945", + ], + "originalText": 945, + "width": 102.57, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 102.57, + }, + Object { + "actualText": "2335", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2335", + ], + "originalText": 2335, + "width": 102.57, + }, + Object { + "actualText": "245", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "245", + ], + "originalText": 245, + "width": 102.57, + }, + Object { + "actualText": "2457", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2457", + ], + "originalText": 2457, + "width": 102.57, + }, + Object { + "actualText": "2458", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2458", + ], + "originalText": 2458, + "width": 102.57, + }, + Object { + "actualText": "1354", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1354", + ], + "originalText": 1354, + "width": 102.57, + }, + Object { + "actualText": "1523", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1523", + ], + "originalText": 1523, + "width": 102.57, + }, + Object { + "actualText": "1634", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1634", + ], + "originalText": 1634, + "width": 102.57, + }, + Object { + "actualText": "1343", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1343", + ], + "originalText": 1343, + "width": 102.57, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 102.57, + }, + Object { + "actualText": "4004", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "4004", + ], + "originalText": 4004, + "width": 102.57, + }, + Object { + "actualText": "3077", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "3077", + ], + "originalText": 3077, + "width": 102.57, + }, + Object { + "actualText": "3551", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "3551", + ], + "originalText": 3551, + "width": 102.57, + }, + Object { + "actualText": "352", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "352", + ], + "originalText": 352, + "width": 102.57, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should calc correctly row cell height if actual text lines is difference 1`] = ` +Array [ + Object { + "actualText": "序号", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 80, + "multiLineActualTexts": Array [ + "序号", + ], + "originalText": "序号", + "width": 80, + }, + Object { + "actualText": "省份", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 80, + "multiLineActualTexts": Array [ + "省份", + ], + "originalText": "省份", + "width": 96, + }, + Object { + "actualText": "城市城市城市城市城市城市城市城市城市城市城市城市", + "actualTextHeight": 64, + "actualTextWidth": 292, + "height": 80, + "multiLineActualTexts": Array [ + "城市城市城市", + "城市城市城市", + "城市城市城市", + "城市城市城市", + ], + "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", + "width": 96, + }, + Object { + "actualText": "类别类别类别类别类别类别类别类别类别类别", + "actualTextHeight": 16, + "actualTextWidth": 241, + "height": 80, + "multiLineActualTexts": Array [ + "类别类别类别类别类别类别类别类别类别类别", + ], + "originalText": "类别类别类别类别类别类别类别类别类别类别", + "width": 272, + }, + Object { + "actualText": "子类别", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 80, + "multiLineActualTexts": Array [ + "子类别", + ], + "originalText": "子类别", + "width": 272, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should calc correctly row cell height if actual text lines is difference 2`] = ` +Array [ + Object { + "actualText": "1", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 80, + "multiLineActualTexts": Array [ + "1", + ], + "originalText": "1", + "width": 80, + }, + Object { + "actualText": "2", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 120, + "multiLineActualTexts": Array [ + "2", + ], + "originalText": "2", + "width": 80, + }, + Object { + "actualText": "3", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 80, + "multiLineActualTexts": Array [ + "3", + ], + "originalText": "3", + "width": 80, + }, + Object { + "actualText": "4", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 120, + "multiLineActualTexts": Array [ + "4", + ], + "originalText": "4", + "width": 80, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should calc correctly row cell height if actual text lines is difference 3`] = ` +Array [ + Object { + "actualText": "纸张纸张纸张纸张纸张", + "actualTextHeight": 32, + "actualTextWidth": 122, + "height": 80, + "multiLineActualTexts": Array [ + "纸张纸张纸张", + "纸张纸张", + ], + "originalText": "纸张纸张纸张纸张纸张", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 16, + "actualTextWidth": 4, + "height": 80, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "数量数量数量数量数量数量数量数量数量数量数量", + "actualTextHeight": 60, + "actualTextWidth": 268, + "height": 80, + "multiLineActualTexts": Array [ + "数量数量数量", + "数量数量数量", + "数量数量数量", + "数量数量", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "width": 96, + }, + Object { + "actualText": "家具", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 80, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 192, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 80, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 96, + }, + Object { + "actualText": "数量数量数量数量数量数量数量数量数量数量数量", + "actualTextHeight": 60, + "actualTextWidth": 268, + "height": 80, + "multiLineActualTexts": Array [ + "数量数量数量", + "数量数量数量", + "数量数量数量", + "数量数量", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "width": 96, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 80, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 96, + }, + Object { + "actualText": "数量数量数量数量数量数量数量数量数量数量数量", + "actualTextHeight": 60, + "actualTextWidth": 268, + "height": 80, + "multiLineActualTexts": Array [ + "数量数量数量", + "数量数量数量", + "数量数量数量", + "数量数量", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "width": 96, + }, + Object { + "actualText": "家具家具家具家具家具家具家具家具家具家具家具家...", + "actualTextHeight": 64, + "actualTextWidth": 290, + "height": 80, + "multiLineActualTexts": Array [ + "家具家具家具", + "家具家具家具", + "家具家具家具", + "家具家具家...", + ], + "originalText": "家具家具家具家具家具家具家具家具家具家具家具家具家具家具", + "width": 96, + }, + Object { + "actualText": "桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌...", + "actualTextHeight": 64, + "actualTextWidth": 290, + "height": 80, + "multiLineActualTexts": Array [ + "桌子桌子桌子", + "桌子桌子桌子", + "桌子桌子桌子", + "桌子桌子桌...", + ], + "originalText": "桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子桌子", + "width": 96, + }, + Object { + "actualText": "数量数量数量数量数量数量数量数量数量数量数量", + "actualTextHeight": 60, + "actualTextWidth": 268, + "height": 80, + "multiLineActualTexts": Array [ + "数量数量数量", + "数量数量数量", + "数量数量数量", + "数量数量", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "width": 96, + }, + Object { + "actualText": "办公用品", + "actualTextHeight": 16, + "actualTextWidth": 49, + "height": 80, + "multiLineActualTexts": Array [ + "办公用品", + ], + "originalText": "办公用品", + "width": 192, + }, + Object { + "actualText": "笔", + "actualTextHeight": 16, + "actualTextWidth": 13, + "height": 80, + "multiLineActualTexts": Array [ + "笔", + ], + "originalText": "笔", + "width": 96, + }, + Object { + "actualText": "数量数量数量数量数量数量数量数量数量数量数量", + "actualTextHeight": 60, + "actualTextWidth": 268, + "height": 80, + "multiLineActualTexts": Array [ + "数量数量数量", + "数量数量数量", + "数量数量数量", + "数量数量", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "width": 96, + }, + Object { + "actualText": "纸张", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 80, + "multiLineActualTexts": Array [ + "纸张", + ], + "originalText": "纸张", + "width": 96, + }, + Object { + "actualText": "数量数量数量数量数量数量数量数量数量数量数量", + "actualTextHeight": 60, + "actualTextWidth": 268, + "height": 80, + "multiLineActualTexts": Array [ + "数量数量数量", + "数量数量数量", + "数量数量数量", + "数量数量", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "width": 96, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should calc correctly row cell height if actual text lines is difference 4`] = ` +Array [ + Object { + "actualText": "浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江浙...", + "actualTextHeight": 64, + "actualTextWidth": 290, + "height": 80, + "multiLineActualTexts": Array [ + "浙江浙江浙江", + "浙江浙江浙江", + "浙江浙江浙江", + "浙江浙江浙...", + ], + "originalText": "浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江浙江", + "width": 96, + }, + Object { + "actualText": "杭州杭州杭州杭州", + "actualTextHeight": 30, + "actualTextWidth": 98, + "height": 80, + "multiLineActualTexts": Array [ + "杭州杭州杭州", + "杭州", + ], + "originalText": "杭州杭州杭州杭州", + "width": 96, + }, + Object { + "actualText": "浙江省", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 120, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 96, + }, + Object { + "actualText": "绍兴市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绍兴市", + ], + "originalText": "绍兴市", + "width": 96, + }, + Object { + "actualText": "宁波市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "宁波市", + ], + "originalText": "宁波市", + "width": 96, + }, + Object { + "actualText": "舟山市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "舟山市", + ], + "originalText": "舟山市", + "width": 96, + }, + Object { + "actualText": "杭州市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "杭州市", + ], + "originalText": "杭州市", + "width": 96, + }, + Object { + "actualText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江...", + "actualTextHeight": 64, + "actualTextWidth": 290, + "height": 80, + "multiLineActualTexts": Array [ + "浙江省浙江省", + "浙江省浙江省", + "浙江省浙江省", + "浙江省浙江...", + ], + "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", + "width": 96, + }, + Object { + "actualText": "杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州...", + "actualTextHeight": 60, + "actualTextWidth": 290, + "height": 80, + "multiLineActualTexts": Array [ + "杭州市杭州市", + "杭州市杭州市", + "杭州市杭州市", + "杭州市杭州...", + ], + "originalText": "杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市", + "width": 96, + }, + Object { + "actualText": "四川省", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 120, + "multiLineActualTexts": Array [ + "四川省", + ], + "originalText": "四川省", + "width": 96, + }, + Object { + "actualText": "成都市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "成都市", + ], + "originalText": "成都市", + "width": 96, + }, + Object { + "actualText": "绵阳市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "绵阳市", + ], + "originalText": "绵阳市", + "width": 96, + }, + Object { + "actualText": "南充市", + "actualTextHeight": 15, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "南充市", + ], + "originalText": "南充市", + "width": 96, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should calc correctly row cell height if actual text lines is difference 5`] = ` +Array [ + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 80, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 80, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 80, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "236723672361111", + "actualTextHeight": 30, + "actualTextWidth": 99, + "height": 30, + "multiLineActualTexts": Array [ + "23672367236", + "1111", + ], + "originalText": 236723672361111, + "width": 96, + }, + Object { + "actualText": "3877", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "3877", + ], + "originalText": 3877, + "width": 96, + }, + Object { + "actualText": "4342", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "4342", + ], + "originalText": 4342, + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 80, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "1723", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1723", + ], + "originalText": 1723, + "width": 96, + }, + Object { + "actualText": "1822", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1822", + ], + "originalText": 1822, + "width": 96, + }, + Object { + "actualText": "1943", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1943", + ], + "originalText": 1943, + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 80, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "632", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "632", + ], + "originalText": 632, + "width": 96, + }, + Object { + "actualText": "7234", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "7234", + ], + "originalText": 7234, + "width": 96, + }, + Object { + "actualText": "834", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "834", + ], + "originalText": 834, + "width": 96, + }, + Object { + "actualText": "5343", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "5343", + ], + "originalText": 5343, + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 80, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "2451", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2451", + ], + "originalText": 2451, + "width": 96, + }, + Object { + "actualText": "2244", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2244", + ], + "originalText": 2244, + "width": 96, + }, + Object { + "actualText": "2333", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2333", + ], + "originalText": 2333, + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 80, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "7789778977897789778977897789", + "actualTextHeight": 45, + "actualTextWidth": 189, + "height": 80, + "multiLineActualTexts": Array [ + "77897789778", + "97789778977", + "897789", + ], + "originalText": "7789778977897789778977897789", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 80, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "1304", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1304", + ], + "originalText": 1304, + "width": 96, + }, + Object { + "actualText": "1145", + "actualTextHeight": 15, + "actualTextWidth": 26, + "height": 30, + "multiLineActualTexts": Array [ + "1145", + ], + "originalText": 1145, + "width": 96, + }, + Object { + "actualText": "1432", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1432", + ], + "originalText": 1432, + "width": 96, + }, + Object { + "actualText": "945", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "945", + ], + "originalText": 945, + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 80, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "2335", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2335", + ], + "originalText": 2335, + "width": 96, + }, + Object { + "actualText": "245", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "245", + ], + "originalText": 245, + "width": 96, + }, + Object { + "actualText": "2457", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2457", + ], + "originalText": 2457, + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 80, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "1354", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1354", + ], + "originalText": 1354, + "width": 96, + }, + Object { + "actualText": "1523", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1523", + ], + "originalText": 1523, + "width": 96, + }, + Object { + "actualText": "1634", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1634", + ], + "originalText": 1634, + "width": 96, + }, + Object { + "actualText": "1343", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1343", + ], + "originalText": 1343, + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 80, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "4004", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "4004", + ], + "originalText": 4004, + "width": 96, + }, + Object { + "actualText": "3077", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "3077", + ], + "originalText": 3077, + "width": 96, + }, + Object { + "actualText": "3551", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "3551", + ], + "originalText": 3551, + "width": 96, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should default render one line text 1`] = ` +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": 96, + }, + Object { + "actualText": "城市城市城...", + "actualTextHeight": 16, + "actualTextWidth": 71, + "height": 30, + "multiLineActualTexts": Array [ + "城市城市城...", + ], + "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", + "width": 96, + }, + Object { + "actualText": "类别类别类别类别类别类别类别类别类别类别", + "actualTextHeight": 16, + "actualTextWidth": 241, + "height": 30, + "multiLineActualTexts": Array [ + "类别类别类别类别类别类别类别类别类别类别", + ], + "originalText": "类别类别类别类别类别类别类别类别类别类别", + "width": 272, + }, + Object { + "actualText": "子类别", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 30, + "multiLineActualTexts": Array [ + "子类别", + ], + "originalText": "子类别", + "width": 272, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should default render one line text 2`] = ` +Array [ + Object { + "actualText": "1", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 120, + "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": 120, + "multiLineActualTexts": Array [ + "3", + ], + "originalText": "3", + "width": 80, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should default render one line text 3`] = ` +Array [ + Object { + "actualText": "家具", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 192, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 96, + }, + Object { + "actualText": "数量数量数...", + "actualTextHeight": 15, + "actualTextWidth": 71, + "height": 30, + "multiLineActualTexts": Array [ + "数量数量数...", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "width": 96, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 30, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 96, + }, + Object { + "actualText": "数量数量数...", + "actualTextHeight": 15, + "actualTextWidth": 71, + "height": 30, + "multiLineActualTexts": Array [ + "数量数量数...", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "width": 96, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should default render one line text 4`] = ` +Array [ + Object { + "actualText": "浙江省", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 120, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 96, + }, + Object { + "actualText": "浙江省浙江...", + "actualTextHeight": 16, + "actualTextWidth": 71, + "height": 30, + "multiLineActualTexts": Array [ + "浙江省浙江...", + ], + "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", + "width": 96, + }, + Object { + "actualText": "四川省", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 120, + "multiLineActualTexts": Array [ + "四川省", + ], + "originalText": "四川省", + "width": 96, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should default render one line text 5`] = ` +Array [ + Object { + "actualText": "2367236723...", + "actualTextHeight": 15, + "actualTextWidth": 77, + "height": 30, + "multiLineActualTexts": Array [ + "2367236723...", + ], + "originalText": 236723672361111, + "width": 96, + }, + Object { + "actualText": "3877", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "3877", + ], + "originalText": 3877, + "width": 96, + }, + Object { + "actualText": "4342", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "4342", + ], + "originalText": 4342, + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "1723", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1723", + ], + "originalText": 1723, + "width": 96, + }, + Object { + "actualText": "1822", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1822", + ], + "originalText": 1822, + "width": 96, + }, + Object { + "actualText": "1943", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1943", + ], + "originalText": 1943, + "width": 96, + }, + Object { + "actualText": "2330", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2330", + ], + "originalText": 2330, + "width": 96, + }, + Object { + "actualText": "632", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "632", + ], + "originalText": 632, + "width": 96, + }, + Object { + "actualText": "7234", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "7234", + ], + "originalText": 7234, + "width": 96, + }, + Object { + "actualText": "834", + "actualTextHeight": 15, + "actualTextWidth": 21, + "height": 30, + "multiLineActualTexts": Array [ + "834", + ], + "originalText": 834, + "width": 96, + }, + Object { + "actualText": "5343", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "5343", + ], + "originalText": 5343, + "width": 96, + }, + Object { + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 30, + "multiLineActualTexts": Array [ + "-", + ], + "originalText": "-", + "width": 96, + }, + Object { + "actualText": "2451", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2451", + ], + "originalText": 2451, + "width": 96, + }, + Object { + "actualText": "2244", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2244", + ], + "originalText": 2244, + "width": 96, + }, + Object { + "actualText": "2333", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2333", + ], + "originalText": 2333, + "width": 96, + }, + Object { + "actualText": "2445", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2445", + ], + "originalText": 2445, + "width": 96, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should get correctly col cell height priority if actual text not wrap 1`] = ` +Array [ + Object { + "actualText": "序号", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 20, + "multiLineActualTexts": Array [ + "序号", + ], + "originalText": "序号", + "width": 80, + }, + Object { + "actualText": "province", + "actualTextHeight": 16, + "actualTextWidth": 51, + "height": 20, + "multiLineActualTexts": Array [ + "province", + ], + "originalText": "province", + "width": 119.66, + }, + Object { + "actualText": "city", + "actualTextHeight": 16, + "actualTextWidth": 21, + "height": 20, + "multiLineActualTexts": Array [ + "city", ], "originalText": "city", "width": 119.66, @@ -2157,7 +5953,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -2168,7 +5964,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "省份", ], @@ -2179,7 +5975,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市...", "actualTextHeight": 48, "actualTextWidth": 253, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城市", @@ -2279,7 +6075,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -2303,7 +6099,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -2342,7 +6138,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -2377,7 +6173,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -2401,7 +6197,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -2484,14 +6280,12 @@ Array [ "width": 102.57, }, Object { - "actualText": "杭州市杭州市杭州市杭州市杭州市杭州市杭州...", - "actualTextHeight": 45, - "actualTextWidth": 253, + "actualText": "杭州市杭州市...", + "actualTextHeight": 15, + "actualTextWidth": 83, "height": 20, "multiLineActualTexts": Array [ - "杭州市杭州市杭", - "州市杭州市杭州", - "市杭州市杭州...", + "杭州市杭州市...", ], "originalText": "杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市杭州市", "width": 102.57, @@ -2800,14 +6594,12 @@ Array [ "width": 102.57, }, Object { - "actualText": "7789778977897789778977897789", - "actualTextHeight": 45, - "actualTextWidth": 189, + "actualText": "77897789778...", + "actualTextHeight": 15, + "actualTextWidth": 84, "height": 20, "multiLineActualTexts": Array [ - "778977897789", - "778977897789", - "7789", + "77897789778...", ], "originalText": "7789778977897789778977897789", "width": 102.57, @@ -3082,12 +6874,11 @@ Array [ "width": 96, }, Object { - "actualText": "城市城市城市城市城市城...", - "actualTextHeight": 32, - "actualTextWidth": 144, + "actualText": "城市城市城...", + "actualTextHeight": 16, + "actualTextWidth": 71, "height": 20, "multiLineActualTexts": Array [ - "城市城市城市", "城市城市城...", ], "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", @@ -3181,12 +6972,11 @@ Array [ "width": 96, }, Object { - "actualText": "数量数量数量数量数量数...", - "actualTextHeight": 30, - "actualTextWidth": 144, + "actualText": "数量数量数...", + "actualTextHeight": 15, + "actualTextWidth": 71, "height": 20, "multiLineActualTexts": Array [ - "数量数量数量", "数量数量数...", ], "originalText": "数量数量数量数量数量数量数量数量数量数量数量", @@ -3204,12 +6994,11 @@ Array [ "width": 96, }, Object { - "actualText": "数量数量数量数量数量数...", - "actualTextHeight": 30, - "actualTextWidth": 144, + "actualText": "数量数量数...", + "actualTextHeight": 15, + "actualTextWidth": 71, "height": 20, "multiLineActualTexts": Array [ - "数量数量数量", "数量数量数...", ], "originalText": "数量数量数量数量数量数量数量数量数量数量数量", @@ -3486,12 +7275,11 @@ Array [ "width": 96, }, Object { - "actualText": "城市城市城市城市城市城...", - "actualTextHeight": 32, - "actualTextWidth": 144, + "actualText": "城市城市城...", + "actualTextHeight": 16, + "actualTextWidth": 71, "height": 20, "multiLineActualTexts": Array [ - "城市城市城市", "城市城市城...", ], "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", @@ -3585,12 +7373,11 @@ Array [ "width": 96, }, Object { - "actualText": "数量数量数量数量数量数...", - "actualTextHeight": 30, - "actualTextWidth": 144, + "actualText": "数量数量数...", + "actualTextHeight": 15, + "actualTextWidth": 71, "height": 20, "multiLineActualTexts": Array [ - "数量数量数量", "数量数量数...", ], "originalText": "数量数量数量数量数量数量数量数量数量数量数量", @@ -3608,12 +7395,11 @@ Array [ "width": 96, }, Object { - "actualText": "数量数量数量数量数量数...", - "actualTextHeight": 30, - "actualTextWidth": 144, + "actualText": "数量数量数...", + "actualTextHeight": 15, + "actualTextWidth": 71, "height": 20, "multiLineActualTexts": Array [ - "数量数量数量", "数量数量数...", ], "originalText": "数量数量数量数量数量数量数量数量数量数量数量", @@ -3871,7 +7657,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 46, + "height": 48, "multiLineActualTexts": Array [ "序号", ], @@ -3882,7 +7668,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 46, + "height": 48, "multiLineActualTexts": Array [ "省份", ], @@ -3893,7 +7679,7 @@ Array [ "actualText": "城市城市城市城市城市城...", "actualTextHeight": 32, "actualTextWidth": 144, - "height": 46, + "height": 48, "multiLineActualTexts": Array [ "城市城市城市", "城市城市城...", @@ -3992,7 +7778,7 @@ Array [ "actualText": "数量数量数量数量数量数...", "actualTextHeight": 30, "actualTextWidth": 144, - "height": 46, + "height": 48, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", @@ -4015,7 +7801,7 @@ Array [ "actualText": "数量数量数量数量数量数...", "actualTextHeight": 30, "actualTextWidth": 144, - "height": 46, + "height": 48, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", @@ -4040,12 +7826,11 @@ Array [ "width": 96, }, Object { - "actualText": "浙江省浙江省浙江省浙江...", - "actualTextHeight": 32, - "actualTextWidth": 144, + "actualText": "浙江省浙江...", + "actualTextHeight": 16, + "actualTextWidth": 71, "height": 20, "multiLineActualTexts": Array [ - "浙江省浙江省", "浙江省浙江...", ], "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", @@ -4068,13 +7853,12 @@ Array [ exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style less than actual text height by dataCell.height 5`] = ` Array [ Object { - "actualText": "236723672361111", - "actualTextHeight": 30, - "actualTextWidth": 99, + "actualText": "2367236723...", + "actualTextHeight": 15, + "actualTextWidth": 77, "height": 20, "multiLineActualTexts": Array [ - "23672367236", - "1111", + "2367236723...", ], "originalText": 236723672361111, "width": 96, @@ -4269,13 +8053,13 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style less than actual text height by rowCell.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": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 46, + "height": 70, "multiLineActualTexts": Array [ "序号", ], @@ -4286,7 +8070,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 46, + "height": 70, "multiLineActualTexts": Array [ "省份", ], @@ -4294,11 +8078,12 @@ Array [ "width": 96, }, Object { - "actualText": "城市城市城市城市城市城...", - "actualTextHeight": 32, - "actualTextWidth": 144, - "height": 46, + "actualText": "城市城市城市城市城市城市城市城市城...", + "actualTextHeight": 48, + "actualTextWidth": 217, + "height": 70, "multiLineActualTexts": Array [ + "城市城市城市", "城市城市城市", "城市城市城...", ], @@ -4309,7 +8094,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 16, "actualTextWidth": 241, - "height": 48, + "height": 70, "multiLineActualTexts": Array [ "类别类别类别类别类别类别类别类别类别类别", ], @@ -4320,7 +8105,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 48, + "height": 70, "multiLineActualTexts": Array [ "子类别", ], @@ -4330,252 +8115,80 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style less than actual text height by rowCell.height 2`] = ` -Array [ - Object { - "actualText": "1", - "actualTextHeight": 15, - "actualTextWidth": 7, - "height": 80, - "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": 80, - "multiLineActualTexts": Array [ - "3", - ], - "originalText": "3", - "width": 80, - }, -] -`; - -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style less than actual text height by rowCell.height 3`] = ` +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": "家具", - "actualTextHeight": 16, - "actualTextWidth": 25, - "height": 48, - "multiLineActualTexts": Array [ - "家具", - ], - "originalText": "家具", - "width": 192, - }, - Object { - "actualText": "桌子", - "actualTextHeight": 16, - "actualTextWidth": 25, - "height": 48, - "multiLineActualTexts": Array [ - "桌子", - ], - "originalText": "桌子", - "width": 96, - }, - Object { - "actualText": "数量数量数量数量数量数...", - "actualTextHeight": 30, - "actualTextWidth": 144, - "height": 46, + "actualText": "数量数量数量数量数量数量数量数量数...", + "actualTextHeight": 45, + "actualTextWidth": 217, + "height": 70, "multiLineActualTexts": Array [ "数量数量数量", - "数量数量数...", - ], - "originalText": "数量数量数量数量数量数量数量数量数量数量数量", - "width": 96, - }, - Object { - "actualText": "沙发", - "actualTextHeight": 16, - "actualTextWidth": 25, - "height": 48, - "multiLineActualTexts": Array [ - "沙发", - ], - "originalText": "沙发", - "width": 96, - }, - Object { - "actualText": "数量数量数量数量数量数...", - "actualTextHeight": 30, - "actualTextWidth": 144, - "height": 46, - "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", ], "originalText": "数量数量数量数量数量数量数量数量数量数量数量", "width": 96, }, -] -`; - -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style less than actual text height by rowCell.height 4`] = ` -Array [ - Object { - "actualText": "浙江省", - "actualTextHeight": 16, - "actualTextWidth": 37, - "height": 80, - "multiLineActualTexts": Array [ - "浙江省", - ], - "originalText": "浙江省", - "width": 96, - }, - Object { - "actualText": "浙江省浙江省浙江省浙江...", - "actualTextHeight": 32, - "actualTextWidth": 144, - "height": 20, - "multiLineActualTexts": Array [ - "浙江省浙江省", - "浙江省浙江...", - ], - "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", - "width": 96, - }, - Object { - "actualText": "四川省", - "actualTextHeight": 16, - "actualTextWidth": 37, - "height": 80, - "multiLineActualTexts": Array [ - "四川省", - ], - "originalText": "四川省", - "width": 96, - }, -] -`; - -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style less than actual text height by rowCell.height 5`] = ` -Array [ - Object { - "actualText": "236723672361111", - "actualTextHeight": 30, - "actualTextWidth": 99, - "height": 20, - "multiLineActualTexts": Array [ - "23672367236", - "1111", - ], - "originalText": 236723672361111, - "width": 96, - }, - Object { - "actualText": "3877", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 20, - "multiLineActualTexts": Array [ - "3877", - ], - "originalText": 3877, - "width": 96, - }, - Object { - "actualText": "4342", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 20, - "multiLineActualTexts": Array [ - "4342", - ], - "originalText": 4342, - "width": 96, - }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 20, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, - }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 20, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, - }, Object { - "actualText": "1723", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 20, + "actualText": "数量数量数量数量数量数量数量数量数...", + "actualTextHeight": 45, + "actualTextWidth": 217, + "height": 70, "multiLineActualTexts": Array [ - "1723", + "数量数量数量", + "数量数量数量", + "数量数量数...", ], - "originalText": 1723, + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", "width": 96, }, +] +`; + +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 PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height 4`] = ` +Array [ Object { - "actualText": "1822", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 20, + "actualText": "236723672361111", + "actualTextHeight": 30, + "actualTextWidth": 99, + "height": 70, "multiLineActualTexts": Array [ - "1822", + "23672367236", + "1111", ], - "originalText": 1822, + "originalText": 236723672361111, "width": 96, }, Object { - "actualText": "1943", + "actualText": "3877", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 20, + "height": 70, "multiLineActualTexts": Array [ - "1943", + "3877", ], - "originalText": 1943, + "originalText": 3877, "width": 96, }, Object { - "actualText": "2330", + "actualText": "4342", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 20, + "height": 70, "multiLineActualTexts": Array [ - "2330", + "4342", ], - "originalText": 2330, + "originalText": 4342, "width": 96, }, Object { "actualText": "632", "actualTextHeight": 15, "actualTextWidth": 21, - "height": 20, + "height": 70, "multiLineActualTexts": Array [ "632", ], @@ -4586,7 +8199,7 @@ Array [ "actualText": "7234", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 20, + "height": 70, "multiLineActualTexts": Array [ "7234", ], @@ -4597,89 +8210,23 @@ Array [ "actualText": "834", "actualTextHeight": 15, "actualTextWidth": 21, - "height": 20, + "height": 70, "multiLineActualTexts": Array [ "834", ], "originalText": 834, "width": 96, }, - Object { - "actualText": "5343", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 20, - "multiLineActualTexts": Array [ - "5343", - ], - "originalText": 5343, - "width": 96, - }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 20, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, - }, - Object { - "actualText": "2451", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 20, - "multiLineActualTexts": Array [ - "2451", - ], - "originalText": 2451, - "width": 96, - }, - Object { - "actualText": "2244", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 20, - "multiLineActualTexts": Array [ - "2244", - ], - "originalText": 2244, - "width": 96, - }, - Object { - "actualText": "2333", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 20, - "multiLineActualTexts": Array [ - "2333", - ], - "originalText": 2333, - "width": 96, - }, - Object { - "actualText": "2445", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 20, - "multiLineActualTexts": Array [ - "2445", - ], - "originalText": 2445, - "width": 96, - }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style less than actual text height by rowCell.height() 1`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by colCell.heightByField 1`] = ` Array [ Object { "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 46, + "height": 120, "multiLineActualTexts": Array [ "序号", ], @@ -4690,7 +8237,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 46, + "height": 120, "multiLineActualTexts": Array [ "省份", ], @@ -4698,13 +8245,15 @@ Array [ "width": 96, }, Object { - "actualText": "城市城市城市城市城市城...", - "actualTextHeight": 32, - "actualTextWidth": 144, - "height": 46, + "actualText": "城市城市城市城市城市城市城市城市城市城市城市城市", + "actualTextHeight": 64, + "actualTextWidth": 292, + "height": 120, "multiLineActualTexts": Array [ "城市城市城市", - "城市城市城...", + "城市城市城市", + "城市城市城市", + "城市城市城市", ], "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", "width": 96, @@ -4713,7 +8262,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 16, "actualTextWidth": 241, - "height": 48, + "height": 50, "multiLineActualTexts": Array [ "类别类别类别类别类别类别类别类别类别类别", ], @@ -4724,7 +8273,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 48, + "height": 40, "multiLineActualTexts": Array [ "子类别", ], @@ -4734,13 +8283,13 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style less than actual text height by rowCell.height() 2`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by colCell.heightByField 2`] = ` Array [ Object { "actualText": "1", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 80, + "height": 120, "multiLineActualTexts": Array [ "1", ], @@ -4751,34 +8300,23 @@ Array [ "actualText": "2", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 20, + "height": 80, "multiLineActualTexts": Array [ "2", ], "originalText": "2", "width": 80, }, - Object { - "actualText": "3", - "actualTextHeight": 15, - "actualTextWidth": 7, - "height": 80, - "multiLineActualTexts": Array [ - "3", - ], - "originalText": "3", - "width": 80, - }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style less than actual text height by rowCell.height() 3`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by colCell.heightByField 3`] = ` Array [ Object { "actualText": "家具", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 48, + "height": 50, "multiLineActualTexts": Array [ "家具", ], @@ -4789,7 +8327,7 @@ Array [ "actualText": "桌子", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 48, + "height": 40, "multiLineActualTexts": Array [ "桌子", ], @@ -4797,13 +8335,15 @@ Array [ "width": 96, }, Object { - "actualText": "数量数量数量数量数量数...", - "actualTextHeight": 30, - "actualTextWidth": 144, - "height": 46, + "actualText": "数量数量数量数量数量数量数量数量数量数量数量", + "actualTextHeight": 60, + "actualTextWidth": 268, + "height": 120, "multiLineActualTexts": Array [ "数量数量数量", - "数量数量数...", + "数量数量数量", + "数量数量数量", + "数量数量", ], "originalText": "数量数量数量数量数量数量数量数量数量数量数量", "width": 96, @@ -4812,7 +8352,7 @@ Array [ "actualText": "沙发", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 48, + "height": 40, "multiLineActualTexts": Array [ "沙发", ], @@ -4820,13 +8360,15 @@ Array [ "width": 96, }, Object { - "actualText": "数量数量数量数量数量数...", - "actualTextHeight": 30, - "actualTextWidth": 144, - "height": 46, + "actualText": "数量数量数量数量数量数量数量数量数量数量数量", + "actualTextHeight": 60, + "actualTextWidth": 268, + "height": 120, "multiLineActualTexts": Array [ "数量数量数量", - "数量数量数...", + "数量数量数量", + "数量数量数量", + "数量数量", ], "originalText": "数量数量数量数量数量数量数量数量数量数量数量", "width": 96, @@ -4834,13 +8376,13 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style less than actual text height by rowCell.height() 4`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by colCell.heightByField 4`] = ` Array [ Object { "actualText": "浙江省", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 80, + "height": 120, "multiLineActualTexts": Array [ "浙江省", ], @@ -4848,38 +8390,29 @@ Array [ "width": 96, }, Object { - "actualText": "浙江省浙江省浙江省浙江...", - "actualTextHeight": 32, - "actualTextWidth": 144, - "height": 20, + "actualText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江...", + "actualTextHeight": 64, + "actualTextWidth": 290, + "height": 80, "multiLineActualTexts": Array [ + "浙江省浙江省", + "浙江省浙江省", "浙江省浙江省", "浙江省浙江...", ], "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", "width": 96, }, - Object { - "actualText": "四川省", - "actualTextHeight": 16, - "actualTextWidth": 37, - "height": 80, - "multiLineActualTexts": Array [ - "四川省", - ], - "originalText": "四川省", - "width": 96, - }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style less than actual text height by rowCell.height() 5`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by colCell.heightByField 5`] = ` Array [ Object { "actualText": "236723672361111", "actualTextHeight": 30, "actualTextWidth": 99, - "height": 20, + "height": 30, "multiLineActualTexts": Array [ "23672367236", "1111", @@ -4891,7 +8424,7 @@ Array [ "actualText": "3877", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 20, + "height": 30, "multiLineActualTexts": Array [ "3877", ], @@ -4899,87 +8432,43 @@ Array [ "width": 96, }, Object { - "actualText": "4342", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 20, - "multiLineActualTexts": Array [ - "4342", - ], - "originalText": 4342, - "width": 96, - }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 20, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, - }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 20, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, - }, - Object { - "actualText": "1723", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 20, - "multiLineActualTexts": Array [ - "1723", - ], - "originalText": 1723, - "width": 96, - }, - Object { - "actualText": "1822", + "actualText": "4342", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 20, + "height": 30, "multiLineActualTexts": Array [ - "1822", + "4342", ], - "originalText": 1822, + "originalText": 4342, "width": 96, }, Object { - "actualText": "1943", + "actualText": "-", "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 20, + "actualTextWidth": 4, + "height": 30, "multiLineActualTexts": Array [ - "1943", + "-", ], - "originalText": 1943, + "originalText": "-", "width": 96, }, Object { - "actualText": "2330", + "actualText": "-", "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 20, + "actualTextWidth": 4, + "height": 80, "multiLineActualTexts": Array [ - "2330", + "-", ], - "originalText": 2330, + "originalText": "-", "width": 96, }, Object { "actualText": "632", "actualTextHeight": 15, "actualTextWidth": 21, - "height": 20, + "height": 30, "multiLineActualTexts": Array [ "632", ], @@ -4990,7 +8479,7 @@ Array [ "actualText": "7234", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 20, + "height": 30, "multiLineActualTexts": Array [ "7234", ], @@ -5001,7 +8490,7 @@ Array [ "actualText": "834", "actualTextHeight": 15, "actualTextWidth": 21, - "height": 20, + "height": 30, "multiLineActualTexts": Array [ "834", ], @@ -5012,7 +8501,7 @@ Array [ "actualText": "5343", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 20, + "height": 30, "multiLineActualTexts": Array [ "5343", ], @@ -5023,67 +8512,23 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 20, + "height": 80, "multiLineActualTexts": Array [ "-", ], "originalText": "-", "width": 96, }, - Object { - "actualText": "2451", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 20, - "multiLineActualTexts": Array [ - "2451", - ], - "originalText": 2451, - "width": 96, - }, - Object { - "actualText": "2244", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 20, - "multiLineActualTexts": Array [ - "2244", - ], - "originalText": 2244, - "width": 96, - }, - Object { - "actualText": "2333", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 20, - "multiLineActualTexts": Array [ - "2333", - ], - "originalText": 2333, - "width": 96, - }, - Object { - "actualText": "2445", - "actualTextHeight": 15, - "actualTextWidth": 27, - "height": 20, - "multiLineActualTexts": Array [ - "2445", - ], - "originalText": 2445, - "width": 96, - }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet 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 by rowCell.heightByField 1`] = ` Array [ Object { "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 70, + "height": 48, "multiLineActualTexts": Array [ "序号", ], @@ -5094,7 +8539,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 70, + "height": 48, "multiLineActualTexts": Array [ "省份", ], @@ -5105,7 +8550,7 @@ Array [ "actualText": "城市城市城市城市城市城...", "actualTextHeight": 32, "actualTextWidth": 144, - "height": 70, + "height": 48, "multiLineActualTexts": Array [ "城市城市城市", "城市城市城...", @@ -5117,7 +8562,7 @@ Array [ "actualText": "类别类别类别类别类别类别类别类别类别类别", "actualTextHeight": 16, "actualTextWidth": 241, - "height": 70, + "height": 48, "multiLineActualTexts": Array [ "类别类别类别类别类别类别类别类别类别类别", ], @@ -5128,7 +8573,7 @@ Array [ "actualText": "子类别", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 70, + "height": 48, "multiLineActualTexts": Array [ "子类别", ], @@ -5138,78 +8583,229 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet 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 by rowCell.heightByField 2`] = ` +Array [ + Object { + "actualText": "1", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 140, + "multiLineActualTexts": Array [ + "1", + ], + "originalText": "1", + "width": 80, + }, + Object { + "actualText": "2", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 35, + "multiLineActualTexts": Array [ + "2", + ], + "originalText": "2", + "width": 80, + }, + Object { + "actualText": "3", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 155, + "multiLineActualTexts": Array [ + "3", + ], + "originalText": "3", + "width": 80, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by rowCell.heightByField 3`] = ` Array [ + Object { + "actualText": "家具", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 48, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", + "width": 192, + }, + Object { + "actualText": "桌子", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 48, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", + "width": 96, + }, Object { "actualText": "数量数量数量数量数量数...", "actualTextHeight": 30, "actualTextWidth": 144, - "height": 70, + "height": 48, + "multiLineActualTexts": Array [ + "数量数量数量", + "数量数量数...", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "width": 96, + }, + Object { + "actualText": "沙发", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 48, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", + "width": 96, + }, + Object { + "actualText": "数量数量数量数量数量数...", + "actualTextHeight": 30, + "actualTextWidth": 144, + "height": 48, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", ], - "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "width": 96, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by rowCell.heightByField 4`] = ` +Array [ + Object { + "actualText": "浙江省", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 140, + "multiLineActualTexts": Array [ + "浙江省", + ], + "originalText": "浙江省", + "width": 96, + }, + Object { + "actualText": "浙江省浙江省浙江省浙江...", + "actualTextHeight": 32, + "actualTextWidth": 144, + "height": 35, + "multiLineActualTexts": Array [ + "浙江省浙江省", + "浙江省浙江...", + ], + "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", + "width": 96, + }, + Object { + "actualText": "四川省", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 155, + "multiLineActualTexts": Array [ + "四川省", + ], + "originalText": "四川省", + "width": 96, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by rowCell.heightByField 5`] = ` +Array [ + Object { + "actualText": "2367236723...", + "actualTextHeight": 15, + "actualTextWidth": 77, + "height": 35, + "multiLineActualTexts": Array [ + "2367236723...", + ], + "originalText": 236723672361111, + "width": 96, + }, + Object { + "actualText": "3877", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 35, + "multiLineActualTexts": Array [ + "3877", + ], + "originalText": 3877, + "width": 96, + }, + Object { + "actualText": "4342", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 35, + "multiLineActualTexts": Array [ + "4342", + ], + "originalText": 4342, "width": 96, }, Object { - "actualText": "数量数量数量数量数量数...", - "actualTextHeight": 30, - "actualTextWidth": 144, - "height": 70, + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 35, "multiLineActualTexts": Array [ - "数量数量数量", - "数量数量数...", + "-", ], - "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "originalText": "-", "width": 96, }, -] -`; - -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 PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height 4`] = ` -Array [ Object { - "actualText": "236723672361111", - "actualTextHeight": 30, - "actualTextWidth": 99, - "height": 70, + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 35, "multiLineActualTexts": Array [ - "23672367236", - "1111", + "-", ], - "originalText": 236723672361111, + "originalText": "-", "width": 96, }, Object { - "actualText": "3877", + "actualText": "1723", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 70, + "height": 50, "multiLineActualTexts": Array [ - "3877", + "1723", ], - "originalText": 3877, + "originalText": 1723, "width": 96, }, Object { - "actualText": "4342", + "actualText": "1822", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 70, + "height": 35, "multiLineActualTexts": Array [ - "4342", + "1822", ], - "originalText": 4342, + "originalText": 1822, "width": 96, }, Object { "actualText": "632", "actualTextHeight": 15, "actualTextWidth": 21, - "height": 70, + "height": 35, "multiLineActualTexts": Array [ "632", ], @@ -5220,7 +8816,7 @@ Array [ "actualText": "7234", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 70, + "height": 35, "multiLineActualTexts": Array [ "7234", ], @@ -5231,80 +8827,111 @@ Array [ "actualText": "834", "actualTextHeight": 15, "actualTextWidth": 21, - "height": 70, + "height": 35, "multiLineActualTexts": Array [ "834", ], "originalText": 834, "width": 96, }, -] -`; - -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by colCell.heightByField 1`] = ` -Array [ Object { - "actualText": "序号", - "actualTextHeight": 16, - "actualTextWidth": 25, - "height": 120, + "actualText": "5343", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 35, "multiLineActualTexts": Array [ - "序号", + "5343", ], - "originalText": "序号", - "width": 80, + "originalText": 5343, + "width": 96, }, Object { - "actualText": "省份", - "actualTextHeight": 16, - "actualTextWidth": 25, - "height": 120, + "actualText": "-", + "actualTextHeight": 15, + "actualTextWidth": 4, + "height": 35, "multiLineActualTexts": Array [ - "省份", + "-", ], - "originalText": "省份", + "originalText": "-", "width": 96, }, Object { - "actualText": "城市城市城市城市城市城市城市城市城市城市城市城市", - "actualTextHeight": 64, - "actualTextWidth": 292, - "height": 120, + "actualText": "2451", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 50, "multiLineActualTexts": Array [ - "城市城市城市", - "城市城市城市", - "城市城市城市", - "城市城市城市", + "2451", ], - "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", + "originalText": 2451, "width": 96, }, Object { - "actualText": "类别类别类别类别类别类别类别类别类别类别", - "actualTextHeight": 16, - "actualTextWidth": 241, - "height": 50, + "actualText": "2244", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 35, "multiLineActualTexts": Array [ - "类别类别类别类别类别类别类别类别类别类别", + "2244", ], - "originalText": "类别类别类别类别类别类别类别类别类别类别", + "originalText": 2244, + "width": 96, + }, +] +`; + +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if hidden col cell 1`] = ` +Array [ + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 0, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 80, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 0, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 96, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 0, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 96, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 0, + "multiLineActualTexts": Array [], + "originalText": undefined, "width": 272, }, Object { - "actualText": "子类别", - "actualTextHeight": 16, - "actualTextWidth": 37, - "height": 40, - "multiLineActualTexts": Array [ - "子类别", - ], - "originalText": "子类别", + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 0, + "multiLineActualTexts": Array [], + "originalText": undefined, "width": 272, }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by colCell.heightByField 2`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if hidden col cell 2`] = ` Array [ Object { "actualText": "1", @@ -5321,83 +8948,78 @@ Array [ "actualText": "2", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 80, + "height": 30, "multiLineActualTexts": Array [ "2", ], "originalText": "2", "width": 80, }, + Object { + "actualText": "3", + "actualTextHeight": 15, + "actualTextWidth": 7, + "height": 120, + "multiLineActualTexts": Array [ + "3", + ], + "originalText": "3", + "width": 80, + }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by colCell.heightByField 3`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if hidden col cell 3`] = ` Array [ Object { - "actualText": "家具", - "actualTextHeight": 16, - "actualTextWidth": 25, - "height": 50, - "multiLineActualTexts": Array [ - "家具", - ], - "originalText": "家具", + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 0, + "multiLineActualTexts": Array [], + "originalText": undefined, "width": 192, }, Object { - "actualText": "桌子", - "actualTextHeight": 16, - "actualTextWidth": 25, - "height": 40, - "multiLineActualTexts": Array [ - "桌子", - ], - "originalText": "桌子", - "width": 96, - }, - Object { - "actualText": "数量数量数量数量数量数量数量数量数量数量数量", - "actualTextHeight": 60, - "actualTextWidth": 268, - "height": 120, - "multiLineActualTexts": Array [ - "数量数量数量", - "数量数量数量", - "数量数量数量", - "数量数量", - ], - "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 0, + "multiLineActualTexts": Array [], + "originalText": undefined, "width": 96, }, Object { - "actualText": "沙发", - "actualTextHeight": 16, - "actualTextWidth": 25, - "height": 40, - "multiLineActualTexts": Array [ - "沙发", - ], - "originalText": "沙发", + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 0, + "multiLineActualTexts": Array [], + "originalText": undefined, "width": 96, }, Object { - "actualText": "数量数量数量数量数量数量数量数量数量数量数量", - "actualTextHeight": 60, - "actualTextWidth": 268, - "height": 120, - "multiLineActualTexts": Array [ - "数量数量数量", - "数量数量数量", - "数量数量数量", - "数量数量", - ], - "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 0, + "multiLineActualTexts": Array [], + "originalText": undefined, + "width": 96, + }, + Object { + "actualText": undefined, + "actualTextHeight": 0, + "actualTextWidth": 0, + "height": 0, + "multiLineActualTexts": Array [], + "originalText": undefined, "width": 96, }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by colCell.heightByField 4`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if hidden col cell 4`] = ` Array [ Object { "actualText": "浙江省", @@ -5411,32 +9033,39 @@ Array [ "width": 96, }, Object { - "actualText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江...", - "actualTextHeight": 64, - "actualTextWidth": 290, - "height": 80, + "actualText": "浙江省浙江...", + "actualTextHeight": 16, + "actualTextWidth": 71, + "height": 30, "multiLineActualTexts": Array [ - "浙江省浙江省", - "浙江省浙江省", - "浙江省浙江省", "浙江省浙江...", ], "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", "width": 96, }, + Object { + "actualText": "四川省", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 120, + "multiLineActualTexts": Array [ + "四川省", + ], + "originalText": "四川省", + "width": 96, + }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by colCell.heightByField 5`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if hidden col cell 5`] = ` Array [ Object { - "actualText": "236723672361111", - "actualTextHeight": 30, - "actualTextWidth": 99, + "actualText": "2367236723...", + "actualTextHeight": 15, + "actualTextWidth": 77, "height": 30, "multiLineActualTexts": Array [ - "23672367236", - "1111", + "2367236723...", ], "originalText": 236723672361111, "width": 96, @@ -5478,13 +9107,57 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 80, + "height": 30, "multiLineActualTexts": Array [ "-", ], "originalText": "-", "width": 96, }, + Object { + "actualText": "1723", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1723", + ], + "originalText": 1723, + "width": 96, + }, + Object { + "actualText": "1822", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1822", + ], + "originalText": 1822, + "width": 96, + }, + Object { + "actualText": "1943", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "1943", + ], + "originalText": 1943, + "width": 96, + }, + Object { + "actualText": "2330", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2330", + ], + "originalText": 2330, + "width": 96, + }, Object { "actualText": "632", "actualTextHeight": 15, @@ -5533,23 +9206,67 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 80, + "height": 30, "multiLineActualTexts": Array [ "-", ], "originalText": "-", "width": 96, }, + Object { + "actualText": "2451", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2451", + ], + "originalText": 2451, + "width": 96, + }, + Object { + "actualText": "2244", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2244", + ], + "originalText": 2244, + "width": 96, + }, + Object { + "actualText": "2333", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2333", + ], + "originalText": 2333, + "width": 96, + }, + Object { + "actualText": "2445", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 30, + "multiLineActualTexts": Array [ + "2445", + ], + "originalText": 2445, + "width": 96, + }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by rowCell.heightByField 1`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by rowCell.height 1`] = ` Array [ Object { "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 46, + "height": 48, "multiLineActualTexts": Array [ "序号", ], @@ -5560,7 +9277,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 46, + "height": 48, "multiLineActualTexts": Array [ "省份", ], @@ -5571,7 +9288,7 @@ Array [ "actualText": "城市城市城市城市城市城...", "actualTextHeight": 32, "actualTextWidth": 144, - "height": 46, + "height": 48, "multiLineActualTexts": Array [ "城市城市城市", "城市城市城...", @@ -5604,13 +9321,13 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by rowCell.heightByField 2`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by rowCell.height 2`] = ` Array [ Object { "actualText": "1", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 140, + "height": 80, "multiLineActualTexts": Array [ "1", ], @@ -5621,7 +9338,7 @@ Array [ "actualText": "2", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 35, + "height": 20, "multiLineActualTexts": Array [ "2", ], @@ -5632,7 +9349,7 @@ Array [ "actualText": "3", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 155, + "height": 80, "multiLineActualTexts": Array [ "3", ], @@ -5642,7 +9359,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by rowCell.heightByField 3`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by rowCell.height 3`] = ` Array [ Object { "actualText": "家具", @@ -5670,7 +9387,7 @@ Array [ "actualText": "数量数量数量数量数量数...", "actualTextHeight": 30, "actualTextWidth": 144, - "height": 46, + "height": 48, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", @@ -5693,7 +9410,7 @@ Array [ "actualText": "数量数量数量数量数量数...", "actualTextHeight": 30, "actualTextWidth": 144, - "height": 46, + "height": 48, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", @@ -5704,13 +9421,13 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by rowCell.heightByField 4`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by rowCell.height 4`] = ` Array [ Object { "actualText": "浙江省", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 140, + "height": 80, "multiLineActualTexts": Array [ "浙江省", ], @@ -5718,12 +9435,11 @@ Array [ "width": 96, }, Object { - "actualText": "浙江省浙江省浙江省浙江...", - "actualTextHeight": 32, - "actualTextWidth": 144, - "height": 35, + "actualText": "浙江省浙江...", + "actualTextHeight": 16, + "actualTextWidth": 71, + "height": 20, "multiLineActualTexts": Array [ - "浙江省浙江省", "浙江省浙江...", ], "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", @@ -5733,7 +9449,7 @@ Array [ "actualText": "四川省", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 155, + "height": 80, "multiLineActualTexts": Array [ "四川省", ], @@ -5743,16 +9459,15 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if custom cell style more than actual text height by rowCell.heightByField 5`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by rowCell.height 5`] = ` Array [ Object { - "actualText": "236723672361111", - "actualTextHeight": 30, - "actualTextWidth": 99, - "height": 35, + "actualText": "2367236723...", + "actualTextHeight": 15, + "actualTextWidth": 77, + "height": 20, "multiLineActualTexts": Array [ - "23672367236", - "1111", + "2367236723...", ], "originalText": 236723672361111, "width": 96, @@ -5761,7 +9476,7 @@ Array [ "actualText": "3877", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 35, + "height": 20, "multiLineActualTexts": Array [ "3877", ], @@ -5772,7 +9487,7 @@ Array [ "actualText": "4342", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 35, + "height": 20, "multiLineActualTexts": Array [ "4342", ], @@ -5783,7 +9498,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 35, + "height": 20, "multiLineActualTexts": Array [ "-", ], @@ -5794,7 +9509,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 35, + "height": 20, "multiLineActualTexts": Array [ "-", ], @@ -5805,7 +9520,7 @@ Array [ "actualText": "1723", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 50, + "height": 20, "multiLineActualTexts": Array [ "1723", ], @@ -5816,18 +9531,40 @@ Array [ "actualText": "1822", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 35, + "height": 20, "multiLineActualTexts": Array [ "1822", ], "originalText": 1822, "width": 96, }, + Object { + "actualText": "1943", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 20, + "multiLineActualTexts": Array [ + "1943", + ], + "originalText": 1943, + "width": 96, + }, + Object { + "actualText": "2330", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 20, + "multiLineActualTexts": Array [ + "2330", + ], + "originalText": 2330, + "width": 96, + }, Object { "actualText": "632", "actualTextHeight": 15, "actualTextWidth": 21, - "height": 35, + "height": 20, "multiLineActualTexts": Array [ "632", ], @@ -5838,7 +9575,7 @@ Array [ "actualText": "7234", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 35, + "height": 20, "multiLineActualTexts": Array [ "7234", ], @@ -5849,7 +9586,7 @@ Array [ "actualText": "834", "actualTextHeight": 15, "actualTextWidth": 21, - "height": 35, + "height": 20, "multiLineActualTexts": Array [ "834", ], @@ -5860,7 +9597,7 @@ Array [ "actualText": "5343", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 35, + "height": 20, "multiLineActualTexts": Array [ "5343", ], @@ -5871,7 +9608,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 35, + "height": 20, "multiLineActualTexts": Array [ "-", ], @@ -5882,7 +9619,7 @@ Array [ "actualText": "2451", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 50, + "height": 20, "multiLineActualTexts": Array [ "2451", ], @@ -5893,73 +9630,106 @@ Array [ "actualText": "2244", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 35, + "height": 20, "multiLineActualTexts": Array [ "2244", ], "originalText": 2244, "width": 96, }, + Object { + "actualText": "2333", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 20, + "multiLineActualTexts": Array [ + "2333", + ], + "originalText": 2333, + "width": 96, + }, + Object { + "actualText": "2445", + "actualTextHeight": 15, + "actualTextWidth": 27, + "height": 20, + "multiLineActualTexts": Array [ + "2445", + ], + "originalText": 2445, + "width": 96, + }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if hidden col cell 1`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by rowCell.height() 1`] = ` Array [ Object { - "actualText": undefined, - "actualTextHeight": 0, - "actualTextWidth": 0, - "height": 0, - "multiLineActualTexts": Array [], - "originalText": undefined, + "actualText": "序号", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 48, + "multiLineActualTexts": Array [ + "序号", + ], + "originalText": "序号", "width": 80, }, Object { - "actualText": undefined, - "actualTextHeight": 0, - "actualTextWidth": 0, - "height": 0, - "multiLineActualTexts": Array [], - "originalText": undefined, + "actualText": "省份", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 48, + "multiLineActualTexts": Array [ + "省份", + ], + "originalText": "省份", "width": 96, }, Object { - "actualText": undefined, - "actualTextHeight": 0, - "actualTextWidth": 0, - "height": 0, - "multiLineActualTexts": Array [], - "originalText": undefined, + "actualText": "城市城市城市城市城市城...", + "actualTextHeight": 32, + "actualTextWidth": 144, + "height": 48, + "multiLineActualTexts": Array [ + "城市城市城市", + "城市城市城...", + ], + "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", "width": 96, }, Object { - "actualText": undefined, - "actualTextHeight": 0, - "actualTextWidth": 0, - "height": 0, - "multiLineActualTexts": Array [], - "originalText": undefined, + "actualText": "类别类别类别类别类别类别类别类别类别类别", + "actualTextHeight": 16, + "actualTextWidth": 241, + "height": 48, + "multiLineActualTexts": Array [ + "类别类别类别类别类别类别类别类别类别类别", + ], + "originalText": "类别类别类别类别类别类别类别类别类别类别", "width": 272, }, Object { - "actualText": undefined, - "actualTextHeight": 0, - "actualTextWidth": 0, - "height": 0, - "multiLineActualTexts": Array [], - "originalText": undefined, + "actualText": "子类别", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 48, + "multiLineActualTexts": Array [ + "子类别", + ], + "originalText": "子类别", "width": 272, }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if hidden col cell 2`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by rowCell.height() 2`] = ` Array [ Object { "actualText": "1", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 120, + "height": 80, "multiLineActualTexts": Array [ "1", ], @@ -5970,7 +9740,7 @@ Array [ "actualText": "2", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "2", ], @@ -5981,7 +9751,7 @@ Array [ "actualText": "3", "actualTextHeight": 15, "actualTextWidth": 7, - "height": 120, + "height": 80, "multiLineActualTexts": Array [ "3", ], @@ -5991,63 +9761,75 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if hidden col cell 3`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by rowCell.height() 3`] = ` Array [ Object { - "actualText": undefined, - "actualTextHeight": 0, - "actualTextWidth": 0, - "height": 0, - "multiLineActualTexts": Array [], - "originalText": undefined, + "actualText": "家具", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 48, + "multiLineActualTexts": Array [ + "家具", + ], + "originalText": "家具", "width": 192, }, Object { - "actualText": undefined, - "actualTextHeight": 0, - "actualTextWidth": 0, - "height": 0, - "multiLineActualTexts": Array [], - "originalText": undefined, + "actualText": "桌子", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 48, + "multiLineActualTexts": Array [ + "桌子", + ], + "originalText": "桌子", "width": 96, }, Object { - "actualText": undefined, - "actualTextHeight": 0, - "actualTextWidth": 0, - "height": 0, - "multiLineActualTexts": Array [], - "originalText": undefined, + "actualText": "数量数量数量数量数量数...", + "actualTextHeight": 30, + "actualTextWidth": 144, + "height": 48, + "multiLineActualTexts": Array [ + "数量数量数量", + "数量数量数...", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", "width": 96, }, Object { - "actualText": undefined, - "actualTextHeight": 0, - "actualTextWidth": 0, - "height": 0, - "multiLineActualTexts": Array [], - "originalText": undefined, + "actualText": "沙发", + "actualTextHeight": 16, + "actualTextWidth": 25, + "height": 48, + "multiLineActualTexts": Array [ + "沙发", + ], + "originalText": "沙发", "width": 96, }, Object { - "actualText": undefined, - "actualTextHeight": 0, - "actualTextWidth": 0, - "height": 0, - "multiLineActualTexts": Array [], - "originalText": undefined, + "actualText": "数量数量数量数量数量数...", + "actualTextHeight": 30, + "actualTextWidth": 144, + "height": 48, + "multiLineActualTexts": Array [ + "数量数量数量", + "数量数量数...", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", "width": 96, }, ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if hidden col cell 4`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by rowCell.height() 4`] = ` Array [ Object { "actualText": "浙江省", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 120, + "height": 80, "multiLineActualTexts": Array [ "浙江省", ], @@ -6058,7 +9840,7 @@ Array [ "actualText": "浙江省浙江...", "actualTextHeight": 16, "actualTextWidth": 71, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "浙江省浙江...", ], @@ -6069,7 +9851,7 @@ Array [ "actualText": "四川省", "actualTextHeight": 16, "actualTextWidth": 37, - "height": 120, + "height": 80, "multiLineActualTexts": Array [ "四川省", ], @@ -6079,13 +9861,13 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height if hidden col cell 5`] = ` +exports[`SpreadSheet Multi Line Text Tests PivotSheet should not adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by rowCell.height() 5`] = ` Array [ Object { "actualText": "2367236723...", "actualTextHeight": 15, "actualTextWidth": 77, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "2367236723...", ], @@ -6096,7 +9878,7 @@ Array [ "actualText": "3877", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "3877", ], @@ -6107,7 +9889,7 @@ Array [ "actualText": "4342", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "4342", ], @@ -6118,7 +9900,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "-", ], @@ -6129,7 +9911,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "-", ], @@ -6140,7 +9922,7 @@ Array [ "actualText": "1723", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "1723", ], @@ -6151,7 +9933,7 @@ Array [ "actualText": "1822", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "1822", ], @@ -6162,7 +9944,7 @@ Array [ "actualText": "1943", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "1943", ], @@ -6173,7 +9955,7 @@ Array [ "actualText": "2330", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "2330", ], @@ -6184,7 +9966,7 @@ Array [ "actualText": "632", "actualTextHeight": 15, "actualTextWidth": 21, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "632", ], @@ -6195,7 +9977,7 @@ Array [ "actualText": "7234", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "7234", ], @@ -6206,7 +9988,7 @@ Array [ "actualText": "834", "actualTextHeight": 15, "actualTextWidth": 21, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "834", ], @@ -6217,7 +9999,7 @@ Array [ "actualText": "5343", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "5343", ], @@ -6228,7 +10010,7 @@ Array [ "actualText": "-", "actualTextHeight": 15, "actualTextWidth": 4, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "-", ], @@ -6239,7 +10021,7 @@ Array [ "actualText": "2451", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "2451", ], @@ -6250,7 +10032,7 @@ Array [ "actualText": "2244", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "2244", ], @@ -6261,7 +10043,7 @@ Array [ "actualText": "2333", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "2333", ], @@ -6272,7 +10054,7 @@ Array [ "actualText": "2445", "actualTextHeight": 15, "actualTextWidth": 27, - "height": 30, + "height": 20, "multiLineActualTexts": Array [ "2445", ], @@ -6687,7 +10469,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "序号", ], @@ -6698,7 +10480,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "省份", ], @@ -6709,7 +10491,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市城市城市", "actualTextHeight": 64, "actualTextWidth": 292, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "城市城市城市", "城市城市城市", @@ -6757,17 +10539,6 @@ Array [ "originalText": "1", "width": 80, }, - Object { - "actualText": "2", - "actualTextHeight": 15, - "actualTextWidth": 7, - "height": 96, - "multiLineActualTexts": Array [ - "2", - ], - "originalText": "2", - "width": 80, - }, ] `; @@ -6799,7 +10570,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数量", @@ -6824,7 +10595,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数量", @@ -6850,21 +10621,6 @@ Array [ "originalText": "浙江省", "width": 96, }, - Object { - "actualText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", - "actualTextHeight": 80, - "actualTextWidth": 365, - "height": 96, - "multiLineActualTexts": Array [ - "浙江省浙江省", - "浙江省浙江省", - "浙江省浙江省", - "浙江省浙江省", - "浙江省浙江省", - ], - "originalText": "浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省浙江省", - "width": 96, - }, ] `; @@ -6915,17 +10671,6 @@ Array [ "originalText": "-", "width": 96, }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 96, - "multiLineActualTexts": Array [ - "-", - ], - "originalText": "-", - "width": 96, - }, Object { "actualText": "632", "actualTextHeight": 15, @@ -6965,20 +10710,9 @@ Array [ "actualTextWidth": 27, "height": 30, "multiLineActualTexts": Array [ - "5343", - ], - "originalText": 5343, - "width": 96, - }, - Object { - "actualText": "-", - "actualTextHeight": 15, - "actualTextWidth": 4, - "height": 96, - "multiLineActualTexts": Array [ - "-", + "5343", ], - "originalText": "-", + "originalText": 5343, "width": 96, }, ] @@ -8108,7 +11842,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "序号", ], @@ -8119,7 +11853,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "省份", ], @@ -8130,7 +11864,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市城市城市", "actualTextHeight": 64, "actualTextWidth": 292, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城市", @@ -8231,7 +11965,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -8256,7 +11990,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -8295,7 +12029,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -8331,7 +12065,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -8356,7 +12090,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -9420,7 +13154,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -9431,7 +13165,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "省份", ], @@ -9442,7 +13176,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城...", "actualTextHeight": 48, "actualTextWidth": 217, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "城市城市城市", "城市城市城市", @@ -9542,7 +13276,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数...", "actualTextHeight": 45, "actualTextWidth": 217, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数量", @@ -9566,7 +13300,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数...", "actualTextHeight": 45, "actualTextWidth": 217, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数量", @@ -9762,7 +13496,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "序号", ], @@ -9773,7 +13507,7 @@ Array [ "actualText": "省份/城市城市城市城市城市城市...", "actualTextHeight": 48, "actualTextWidth": 184, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "省份/城市城", "市城市城市", @@ -9875,7 +13609,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -9910,7 +13644,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -9934,7 +13668,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -9973,7 +13707,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -10008,7 +13742,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -10032,7 +13766,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量...", "actualTextHeight": 45, "actualTextWidth": 253, - "height": 61, + "height": 64, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -10727,7 +14461,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 46, + "height": 48, "multiLineActualTexts": Array [ "序号", ], @@ -10738,7 +14472,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 46, + "height": 48, "multiLineActualTexts": Array [ "省份", ], @@ -10749,7 +14483,7 @@ Array [ "actualText": "城市城市城市城市城市城...", "actualTextHeight": 32, "actualTextWidth": 144, - "height": 46, + "height": 48, "multiLineActualTexts": Array [ "城市城市城市", "城市城市城...", @@ -10848,7 +14582,7 @@ Array [ "actualText": "数量数量数量数量数量数...", "actualTextHeight": 30, "actualTextWidth": 144, - "height": 46, + "height": 48, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", @@ -10871,7 +14605,7 @@ Array [ "actualText": "数量数量数量数量数量数...", "actualTextHeight": 30, "actualTextWidth": 144, - "height": 46, + "height": 48, "multiLineActualTexts": Array [ "数量数量数量", "数量数量数...", @@ -11109,7 +14843,7 @@ Array [ "actualText": "序号", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "序号", ], @@ -11120,7 +14854,7 @@ Array [ "actualText": "省份", "actualTextHeight": 16, "actualTextWidth": 25, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "省份", ], @@ -11131,7 +14865,7 @@ Array [ "actualText": "城市城市城市城市城市城市城市城市城市城市城市城市", "actualTextHeight": 64, "actualTextWidth": 292, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "城市城市城市城", "市城市城市城市", @@ -11232,7 +14966,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -11257,7 +14991,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -11300,7 +15034,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -11336,7 +15070,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -11361,7 +15095,7 @@ Array [ "actualText": "数量数量数量数量数量数量数量数量数量数量数量", "actualTextHeight": 60, "actualTextWidth": 268, - "height": 76, + "height": 80, "multiLineActualTexts": Array [ "数量数量数量数", "量数量数量数量", @@ -19779,80 +23513,6 @@ Array [ ] `; -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.8, - }, - Object { - "actualText": "城市城市城市城市城市城市城...", - "actualTextHeight": 32, - "actualTextWidth": 168, - "height": 70, - "multiLineActualTexts": Array [ - "城市城市城市城", - "市城市城市城...", - ], - "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", - "width": 103.8, - }, - Object { - "actualText": "类别类别类别类别类别类别类...", - "actualTextHeight": 32, - "actualTextWidth": 168, - "height": 70, - "multiLineActualTexts": Array [ - "类别类别类别类", - "别类别类别类...", - ], - "originalText": "类别类别类别类别类别类别类别类别类别类别", - "width": 103.8, - }, - Object { - "actualText": "子类别", - "actualTextHeight": 16, - "actualTextWidth": 37, - "height": 70, - "multiLineActualTexts": Array [ - "子类别", - ], - "originalText": "子类别", - "width": 103.8, - }, - Object { - "actualText": "数量数量数量数量数量数量数...", - "actualTextHeight": 32, - "actualTextWidth": 168, - "height": 70, - "multiLineActualTexts": Array [ - "数量数量数量数", - "量数量数量数...", - ], - "originalText": "数量数量数量数量数量数量数量数量数量数量数量", - "width": 103.8, - }, -] -`; - exports[`SpreadSheet Multi Line Text Tests TableSheet should not adaptive adjust cell height if custom cell style more than actual text height by colCell.heightByField 1`] = ` Array [ Object { @@ -20001,14 +23661,13 @@ Array [ "width": 103.8, }, Object { - "actualText": "类别类别类别类别类别类别类别类别类别类别", - "actualTextHeight": 48, - "actualTextWidth": 243, + "actualText": "类别类别类别类别类别类别类...", + "actualTextHeight": 32, + "actualTextWidth": 168, "height": 50, "multiLineActualTexts": Array [ "类别类别类别类", - "别类别类别类别", - "类别类别类别", + "别类别类别类...", ], "originalText": "类别类别类别类别类别类别类别类别类别类别", "width": 103.8, @@ -20592,6 +24251,83 @@ Array [ ] `; +exports[`SpreadSheet Multi Line Text Tests TableSheet should not adaptive adjust cell height, but should adjust maxLines 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.8, + }, + Object { + "actualText": "城市城市城市城市城市城市城市城市城市城市...", + "actualTextHeight": 48, + "actualTextWidth": 253, + "height": 70, + "multiLineActualTexts": Array [ + "城市城市城市城", + "市城市城市城市", + "城市城市城市...", + ], + "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", + "width": 103.8, + }, + Object { + "actualText": "类别类别类别类别类别类别类别类别类别类别", + "actualTextHeight": 48, + "actualTextWidth": 243, + "height": 70, + "multiLineActualTexts": Array [ + "类别类别类别类", + "别类别类别类别", + "类别类别类别", + ], + "originalText": "类别类别类别类别类别类别类别类别类别类别", + "width": 103.8, + }, + Object { + "actualText": "子类别", + "actualTextHeight": 16, + "actualTextWidth": 37, + "height": 70, + "multiLineActualTexts": Array [ + "子类别", + ], + "originalText": "子类别", + "width": 103.8, + }, + Object { + "actualText": "数量数量数量数量数量数量数量数量数量数量...", + "actualTextHeight": 48, + "actualTextWidth": 253, + "height": 70, + "multiLineActualTexts": Array [ + "数量数量数量数", + "量数量数量数量", + "数量数量数量...", + ], + "originalText": "数量数量数量数量数量数量数量数量数量数量数量", + "width": 103.8, + }, +] +`; + exports[`SpreadSheet Multi Line Text Tests TableSheet should not adaptive adjust data cell height if custom cell style less than actual text height by dataCell.height 1`] = ` Array [ Object { @@ -22504,7 +26240,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests TableSheet should not force adaptive adjust cell height if custom cell style less than actual text height by colCell.height 1`] = ` +exports[`SpreadSheet Multi Line Text Tests TableSheet should not force adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by colCell.height 1`] = ` Array [ Object { "actualText": "序号", @@ -22520,7 +26256,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests TableSheet should not force adaptive adjust cell height if custom cell style less than actual text height by colCell.height 2`] = ` +exports[`SpreadSheet Multi Line Text Tests TableSheet should not force adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by colCell.height 2`] = ` Array [ Object { "actualText": "1", @@ -22646,7 +26382,7 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests TableSheet should not force adaptive adjust cell height if custom cell style less than actual text height by colCell.height 3`] = ` +exports[`SpreadSheet Multi Line Text Tests TableSheet should not force adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by colCell.height 3`] = ` Array [ Object { "actualText": "序号", @@ -22671,25 +26407,23 @@ Array [ "width": 103.8, }, Object { - "actualText": "城市城市城市城市城市城市城...", - "actualTextHeight": 32, - "actualTextWidth": 168, + "actualText": "城市城市城市...", + "actualTextHeight": 16, + "actualTextWidth": 83, "height": 20, "multiLineActualTexts": Array [ - "城市城市城市城", - "市城市城市城...", + "城市城市城市...", ], "originalText": "城市城市城市城市城市城市城市城市城市城市城市城市", "width": 103.8, }, Object { - "actualText": "类别类别类别类别类别类别类...", - "actualTextHeight": 32, - "actualTextWidth": 168, + "actualText": "类别类别类别...", + "actualTextHeight": 16, + "actualTextWidth": 83, "height": 20, "multiLineActualTexts": Array [ - "类别类别类别类", - "别类别类别类...", + "类别类别类别...", ], "originalText": "类别类别类别类别类别类别类别类别类别类别", "width": 103.8, @@ -22706,13 +26440,12 @@ Array [ "width": 103.8, }, Object { - "actualText": "数量数量数量数量数量数量数...", - "actualTextHeight": 32, - "actualTextWidth": 168, + "actualText": "数量数量数量...", + "actualTextHeight": 16, + "actualTextWidth": 83, "height": 20, "multiLineActualTexts": Array [ - "数量数量数量数", - "量数量数量数...", + "数量数量数量...", ], "originalText": "数量数量数量数量数量数量数量数量数量数量数量", "width": 103.8, @@ -22720,9 +26453,9 @@ Array [ ] `; -exports[`SpreadSheet Multi Line Text Tests TableSheet should not force adaptive adjust cell height if custom cell style less than actual text height by colCell.height 4`] = `Array []`; +exports[`SpreadSheet Multi Line Text Tests TableSheet should not force adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by colCell.height 4`] = `Array []`; -exports[`SpreadSheet Multi Line Text Tests TableSheet should not force adaptive adjust cell height if custom cell style less than actual text height by colCell.height 5`] = ` +exports[`SpreadSheet Multi Line Text Tests TableSheet should not force adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by colCell.height 5`] = ` Array [ Object { "actualText": "1", 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 7e6b1aa366..6e991f60e4 100644 --- a/packages/s2-core/__tests__/spreadsheet/multi-line-text-spec.ts +++ b/packages/s2-core/__tests__/spreadsheet/multi-line-text-spec.ts @@ -10,6 +10,7 @@ import { } from '../../src'; import type { CellTextWordWrapStyle, + Meta, S2CellType, S2Options, } from '../../src/common'; @@ -138,6 +139,13 @@ describe('SpreadSheet Multi Line Text Tests', () => { }, }; + const cornerMetaList: Meta[] = [ + { field: 'type', name: '类别\n类别' }, + { field: 'sub_type', name: '子类别\n子类别\n子类别' }, + { field: 'number', name: '数量\n数量\n数量\n数量' }, + { field: 'city', name: '城市\n城市' }, + ]; + beforeEach(async () => { s2 = new PivotSheet( getContainer(), @@ -161,7 +169,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { await s2.render(false); matchCellStyleSnapshot(); - expectColHierarchyHeight(142, 96, 46); + expectColHierarchyHeight(144, 96, 48); }); test('should render three max text lines', async () => { @@ -169,7 +177,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { await s2.render(false); matchCellStyleSnapshot(); - expectColHierarchyHeight(189, 128, 61); + expectColHierarchyHeight(192, 128, 64); }); test('should render custom text overflow text', async () => { @@ -220,7 +228,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { expectColHierarchyHeight(90); }); - test('should not adaptive adjust cell height if custom cell style less than actual text height by rowCell.height', async () => { + test('should not adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by rowCell.height', async () => { updateStyle(2); s2.setOptions({ @@ -236,7 +244,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { matchCellStyleSnapshot(); }); - test('should not adaptive adjust cell height if custom cell style less than actual text height by rowCell.height()', async () => { + test('should not adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by rowCell.height()', async () => { updateStyle(2); s2.setOptions({ @@ -337,7 +345,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { await s2.render(false); matchCellStyleSnapshot(); - expectColHierarchyHeight(142, 96, 46); + expectColHierarchyHeight(144, 96, 48); }); test('should not adaptive adjust cell height if custom cell style more than actual text height', async () => { @@ -388,7 +396,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { updateStyle(3); await s2.render(false); - expectColHierarchyHeight(173, 112, 61); + expectColHierarchyHeight(176, 112, 64); }); test('should render correctly layout if only enable grand totals', async () => { @@ -445,7 +453,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { // 省份 4行文本, 叶子节点 (城市) 3行文本, 省份应该和城市高度一致, 才能展示所有文本 (maxLines: 4) expectRowHierarchyHeight(400, 0, 80); - expectColHierarchyHeight(236, 160, 76); + expectColHierarchyHeight(240, 160, 80); }); test('should render three max text lines for tree mode', async () => { @@ -539,7 +547,10 @@ describe('SpreadSheet Multi Line Text Tests', () => { updateStyle(maxLines); s2.changeSheetSize(800, 600); - s2.setDataCfg(SimpleDataCfg); + s2.setDataCfg({ + ...SimpleDataCfg, + meta: [], + }); await s2.render(); // 不管设置了多少行的文本, 如果实际文本未换行, 高度不应该自适应, 以默认高度为准. @@ -602,6 +613,95 @@ describe('SpreadSheet Multi Line Text Tests', () => { matchCellStyleSnapshot(); }); + + test('should adjust corner cell max lines by custom col height', async () => { + s2.changeSheetSize(800, 600); + s2.setDataCfg({ + meta: cornerMetaList, + }); + s2.setOptions({ + style: { + cornerCell: { + maxLines: 10, + }, + colCell: { + height: 20, + maxLines: 2, + }, + }, + }); + await s2.render(); + + matchCellStyleSnapshot(); + expectColHierarchyHeight(60, 40, 20); + }); + + test('should adjust col cell height if corner cell height > col cell height', async () => { + s2.changeSheetSize(800, 600); + s2.setDataCfg({ + meta: cornerMetaList, + }); + s2.setOptions({ + style: { + cornerCell: { + maxLines: 10, + }, + colCell: { + maxLines: 1, + }, + }, + }); + await s2.render(); + + matchCellStyleSnapshot(); + expectColHierarchyHeight(160, 112, 48); + }); + + test('should adjust col cell height if corner cell height > col cell height by tree mode', async () => { + s2.changeSheetSize(800, 600); + s2.setDataCfg({ + meta: cornerMetaList, + }); + s2.setOptions({ + hierarchyType: 'tree', + style: { + cornerCell: { + maxLines: 10, + }, + colCell: { + maxLines: 1, + }, + }, + }); + await s2.render(); + + matchCellStyleSnapshot(); + expectColHierarchyHeight(192, 112, 80); + }); + + test('should adjust col cell height if corner cell height > col cell height by "valueInCols: false"', async () => { + s2.changeSheetSize(800, 600); + s2.setDataCfg({ + meta: cornerMetaList, + fields: { + valueInCols: false, + }, + }); + s2.setOptions({ + style: { + cornerCell: { + maxLines: 10, + }, + colCell: { + maxLines: 1, + }, + }, + }); + await s2.render(); + + matchCellStyleSnapshot(); + expectColHierarchyHeight(96, 48, 48, 2); + }); }); describe('TableSheet', () => { @@ -690,7 +790,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { }); }); - test('should not force adaptive adjust cell height if custom cell style less than actual text height by colCell.height', async () => { + test('should not force adaptive adjust cell height, but should adjust maxLines if custom cell style less than actual text height by colCell.height', async () => { s2.setOptions({ style: { colCell: { @@ -706,7 +806,7 @@ describe('SpreadSheet Multi Line Text Tests', () => { expectColHierarchyHeight(20, 0, 20, 1); }); - test('should not adaptive adjust cell height if custom cell style more than actual text height', async () => { + test('should not adaptive adjust cell height, but should adjust maxLines if custom cell style more than actual text height', async () => { const CUSTOM_CELL_HEIGHT = 70; s2.setOptions({ diff --git a/packages/s2-core/__tests__/util/helpers.ts b/packages/s2-core/__tests__/util/helpers.ts index a74cb9a577..25c4cf3f31 100644 --- a/packages/s2-core/__tests__/util/helpers.ts +++ b/packages/s2-core/__tests__/util/helpers.ts @@ -328,6 +328,7 @@ export const createMockCellInfo = ( updateByState: jest.fn(), isTextOverflowing: jest.fn(), getTextLineHeight: jest.fn(() => 16), + getMaxLinesByCustomHeight: jest.fn(() => 1), } as unknown as S2CellType; const getNode = () => mockCellViewMeta as unknown as Node; diff --git a/packages/s2-core/src/cell/base-cell.ts b/packages/s2-core/src/cell/base-cell.ts index 7749941daf..8b607b1a12 100644 --- a/packages/s2-core/src/cell/base-cell.ts +++ b/packages/s2-core/src/cell/base-cell.ts @@ -24,6 +24,7 @@ import { import { CellType, DEFAULT_FONT_COLOR, + DEFAULT_TEXT_LINE_HEIGHT, InteractionStateName, REVERSE_FONT_COLOR, SHAPE_ATTRS_MAP, @@ -302,10 +303,13 @@ export abstract class BaseCell extends Group { } /** - * 获取文本包围盒 + * 获取文本行高 */ public getTextLineHeight() { - return this.textShape?.parsedStyle?.metrics?.lineHeight; + return ( + this.textShape?.parsedStyle?.metrics?.lineHeight || + DEFAULT_TEXT_LINE_HEIGHT + ); } /** @@ -825,4 +829,35 @@ export abstract class BaseCell extends Group { backgroundColor: this.getStyle().cell.backgroundColor, }; } + + public getMaxLinesByCustomHeight(options: { + targetCell?: S2CellType; + displayHeight?: number; + isCustomHeight?: boolean; + }) { + const { + targetCell = this, + displayHeight = this.meta.height, + isCustomHeight = false, + } = options; + const cell = targetCell || this; + const cellStyle = this.spreadsheet.options.style?.[cell.cellType]; + const isEnableHeightAdaptive = + cellStyle?.maxLines! > 1 && cellStyle?.wordWrap; + + if (!isEnableHeightAdaptive || !isCustomHeight) { + return; + } + + const { cell: cellTheme } = cell?.getStyle() as DefaultCellTheme; + const padding = cellTheme!.padding!.top! + cellTheme!.padding!.bottom!; + const lineHeight = cell?.getTextLineHeight()!; + + const maxLines = Math.max( + 1, + Math.floor((displayHeight - padding) / lineHeight), + ); + + return maxLines; + } } diff --git a/packages/s2-core/src/cell/col-cell.ts b/packages/s2-core/src/cell/col-cell.ts index 16e4f09f48..e856de30d7 100644 --- a/packages/s2-core/src/cell/col-cell.ts +++ b/packages/s2-core/src/cell/col-cell.ts @@ -583,12 +583,19 @@ export class ColCell extends HeaderCell { return isNextSiblingNodeHidden && isPrevSiblingNodeHidden; } + /** + * 以下场景根据当前高度动态计算 maxLines, 保证文本展示合理性 + * 1.手动拖拽 2.预设高度 + */ protected getResizedTextMaxLines() { const { colCell } = this.spreadsheet.options.style!; return ( colCell?.maxLinesByField?.[this.meta.id] ?? - colCell?.maxLinesByField?.[this.meta.field] + colCell?.maxLinesByField?.[this.meta.field] ?? + this.getMaxLinesByCustomHeight({ + isCustomHeight: this.meta.extra?.isCustomHeight, + }) ); } } diff --git a/packages/s2-core/src/cell/corner-cell.ts b/packages/s2-core/src/cell/corner-cell.ts index bfc193d61c..2e387caf0c 100644 --- a/packages/s2-core/src/cell/corner-cell.ts +++ b/packages/s2-core/src/cell/corner-cell.ts @@ -279,7 +279,10 @@ export class CornerCell extends HeaderCell { return ( colCell?.maxLinesByField?.[this.meta.id] ?? - colCell?.maxLinesByField?.[this.meta.field] + colCell?.maxLinesByField?.[this.meta.field] ?? + this.getMaxLinesByCustomHeight({ + isCustomHeight: this.meta.extra?.isCustomHeight, + }) ); } } diff --git a/packages/s2-core/src/cell/data-cell.ts b/packages/s2-core/src/cell/data-cell.ts index 7db9a1fcae..8c45cc3710 100644 --- a/packages/s2-core/src/cell/data-cell.ts +++ b/packages/s2-core/src/cell/data-cell.ts @@ -1,6 +1,7 @@ import type { PointLike } from '@antv/g'; import { find, first, get, isEmpty, isEqual, isObject, merge } from 'lodash'; import { BaseCell } from '../cell/base-cell'; +import { DEFAULT_STYLE } from '../common'; import { EMPTY_PLACEHOLDER } from '../common/constant/basic'; import { CellType, @@ -515,7 +516,10 @@ export class DataCell extends BaseCell { // 数值和行高保持一致, 同时兼容明细表 return ( rowCell?.maxLinesByField?.[this.meta.id] ?? - rowCell?.maxLinesByField?.[this.meta.rowId!] + rowCell?.maxLinesByField?.[this.meta.rowId!] ?? + this.getMaxLinesByCustomHeight({ + isCustomHeight: this.meta.height !== DEFAULT_STYLE.dataCell?.height, + }) ); } } diff --git a/packages/s2-core/src/cell/row-cell.ts b/packages/s2-core/src/cell/row-cell.ts index 5ae2898241..1fe344d7b0 100644 --- a/packages/s2-core/src/cell/row-cell.ts +++ b/packages/s2-core/src/cell/row-cell.ts @@ -497,7 +497,10 @@ export class RowCell extends HeaderCell { return ( rowCell?.maxLinesByField?.[this.meta.id] ?? - rowCell?.maxLinesByField?.[this.meta.field] + rowCell?.maxLinesByField?.[this.meta.field] ?? + this.getMaxLinesByCustomHeight({ + isCustomHeight: this.meta.extra?.isCustomHeight, + }) ); } } diff --git a/packages/s2-core/src/cell/table-data-cell.ts b/packages/s2-core/src/cell/table-data-cell.ts index 3ad235f2bc..6e44f4aaed 100644 --- a/packages/s2-core/src/cell/table-data-cell.ts +++ b/packages/s2-core/src/cell/table-data-cell.ts @@ -8,6 +8,7 @@ import { ResizeDirectionType, } from '../common/constant'; import { CustomRect, type SimpleBBox } from '../engine'; +import type { TableFacet } from '../facet'; import type { FrozenFacet } from '../facet/frozen-facet'; import { isFrozenRow, isFrozenTrailingRow } from '../facet/utils'; import { @@ -155,4 +156,17 @@ export class TableDataCell extends DataCell { protected isDisableHover(cellMeta: CellMeta) { return cellMeta?.type === CellType.COL_CELL; } + + protected getResizedTextMaxLines() { + const { rowCell } = this.spreadsheet.options.style!; + + return ( + rowCell?.maxLinesByField?.[this.meta.id] ?? + rowCell?.maxLinesByField?.[this.meta.rowId!] ?? + this.getMaxLinesByCustomHeight({ + isCustomHeight: (this.spreadsheet.facet as TableFacet) + ?.customRowHeightStatusMap?.[this.meta.rowIndex], + }) + ); + } } diff --git a/packages/s2-core/src/common/constant/basic.ts b/packages/s2-core/src/common/constant/basic.ts index 655ea65ee6..8017fa9d86 100644 --- a/packages/s2-core/src/common/constant/basic.ts +++ b/packages/s2-core/src/common/constant/basic.ts @@ -89,3 +89,5 @@ export const getDefaultCornerText = () => i18n('指标'); // 省略号 export const ELLIPSIS_SYMBOL = '...'; + +export const DEFAULT_TEXT_LINE_HEIGHT = 16; diff --git a/packages/s2-core/src/facet/base-facet.ts b/packages/s2-core/src/facet/base-facet.ts index 730ce7e627..e1b178c79f 100644 --- a/packages/s2-core/src/facet/base-facet.ts +++ b/packages/s2-core/src/facet/base-facet.ts @@ -23,6 +23,7 @@ import { isNumber, isUndefined, last, + max, maxBy, reduce, size, @@ -67,19 +68,20 @@ import { DEBUG_VIEW_RENDER, DebuggerUtil, } from '../common/debug'; -import type { - AdjustLeafNodesParams, - CellCallbackParams, - CellCustomSize, - FrameConfig, - GridInfo, - HiddenColumnsInfo, - LayoutResult, - S2CellType, - ScrollChangeParams, - ScrollOffsetConfig, - SimpleData, - ViewMeta, +import { + CornerNodeType, + type AdjustLeafNodesParams, + type CellCallbackParams, + type CellCustomSize, + type FrameConfig, + type GridInfo, + type HiddenColumnsInfo, + type LayoutResult, + type S2CellType, + type ScrollChangeParams, + type ScrollOffsetConfig, + type SimpleData, + type ViewMeta, } from '../common/interface'; import type { CellScrollOffset, @@ -174,10 +176,18 @@ export abstract class BaseFacet { protected textWrapNodeHeightCache: Map; + protected textWrapTempCornerCell: CornerCell | null; + protected textWrapTempRowCell: RowCell | DataCell; protected textWrapTempColCell: ColCell | TableColCell; + protected abstract getCornerCellInstance( + node: Node, + spreadsheet: SpreadSheet, + config: Partial, + ): CornerCell | null; + protected abstract getRowCellInstance( node: Node | ViewMeta, spreadsheet: SpreadSheet, @@ -258,6 +268,7 @@ export abstract class BaseFacet { this.textWrapTempRowCell = this.getRowCellInstance(...args); this.textWrapTempColCell = this.getColCellInstance(...args); + this.textWrapTempCornerCell = this.getCornerCellInstance?.(...args); this.textWrapNodeHeightCache = new Map(); } @@ -322,13 +333,14 @@ export abstract class BaseFacet { } protected isCustomRowCellHeight(node: Node) { - const { dataCell } = this.spreadsheet.options.style!; + const { dataCell, rowCell } = this.spreadsheet.options.style!; const defaultDataCellHeight = DEFAULT_STYLE.dataCell?.height; + const rowHeight = this.getCellCustomSize(node, rowCell?.height); + const isCustomDefaultHeight = rowHeight + ? rowCell?.height !== defaultDataCellHeight + : dataCell?.height !== defaultDataCellHeight; - return ( - isNumber(this.getCustomRowCellHeight(node)) || - dataCell?.height !== defaultDataCellHeight - ); + return isNumber(this.getCustomRowCellHeight(node)) || isCustomDefaultHeight; } protected getCustomRowCellHeight(node: Node) { @@ -370,39 +382,86 @@ export abstract class BaseFacet { ); } - protected getColNodeHeight( - colNode: Node, - colsHierarchy: Hierarchy, - useCache: boolean = true, - ) { + protected getColNodeHeight(options: { + colNode: Node; + colsHierarchy: Hierarchy; + useCache?: boolean; + cornerNodes?: Node[]; + }) { + const { + colNode, + colsHierarchy, + useCache = true, + cornerNodes = [], + } = options; + if (!colNode) { return 0; } - const { colCell: colCellStyle } = this.spreadsheet.options.style!; + const { colCell: colCellStyle, cornerCell: cornerCellStyle } = + this.spreadsheet.options.style!; // 优先级: 列头拖拽 > 列头自定义高度 > 多行文本自适应高度 > 通用单元格高度 const height = this.getColCellDraggedHeight(colNode) ?? this.getCellCustomSize(colNode, colCellStyle?.height); if (isNumber(height) && height !== DEFAULT_STYLE.colCell?.height) { + // 标记为自定义高度, 方便计算文本 maxLines + colNode.extra.isCustomHeight = true; + return height; } - const isEnableHeightAdaptive = + const isEnableColNodeHeightAdaptive = colCellStyle?.maxLines! > 1 && colCellStyle?.wordWrap; + const isEnableCornerNodeHeightAdaptive = + cornerCellStyle?.maxLines! > 1 && cornerCellStyle?.wordWrap; const defaultHeight = this.getDefaultColNodeHeight(colNode, colsHierarchy); - if (!isEnableHeightAdaptive) { - return defaultHeight; + let colAdaptiveHeight = defaultHeight; + let cornerAdaptiveHeight = defaultHeight; + + // 1. 列头开启自动换行, 计算列头自适应高度 + if (isEnableColNodeHeightAdaptive) { + colAdaptiveHeight = this.getNodeAdaptiveHeight({ + meta: colNode, + cell: this.textWrapTempColCell, + defaultHeight, + useCache, + }); } - return this.getNodeAdaptiveHeight( - colNode, - this.textWrapTempColCell, - defaultHeight, - useCache, - ); + /** + * 2. 角头开启自动换行, 列头的高度除了自身以外, 还需要考虑当前整行对应的角头 + * 存在角头/列头同时换行, 只有角头换行, 只有列头换行等多种场景 + */ + if (isEnableCornerNodeHeightAdaptive) { + const currentCornerNodes = cornerNodes.filter((node) => { + // 兼容数值置于行/列的不同场景 + if (colNode.isLeaf) { + return node.cornerType === CornerNodeType.Row; + } + + return node.field === colNode.field; + }); + + if (!isEmpty(currentCornerNodes)) { + cornerAdaptiveHeight = max( + currentCornerNodes.map((cornerNode) => + this.getNodeAdaptiveHeight({ + meta: cornerNode, + cell: this.textWrapTempCornerCell!, + defaultHeight, + useCache: false, + }), + ), + ); + } + } + + // 两者要取最大, 保证高度自动撑高的合理性 + return Math.max(cornerAdaptiveHeight, colAdaptiveHeight, defaultHeight); } protected getDefaultColNodeHeight( @@ -430,13 +489,15 @@ export abstract class BaseFacet { return Math.max(defaultHeight, sampleMaxHeight); } - protected getNodeAdaptiveHeight( - meta: Node | ViewMeta, - cell: S2CellType, - defaultHeight: number = 0, - useCache = true, - ) { - if (!meta) { + protected getNodeAdaptiveHeight(options: { + meta: Node | ViewMeta; + cell: S2CellType; + defaultHeight?: number; + useCache?: boolean; + }) { + const { meta, cell, defaultHeight = 0, useCache = true } = options; + + if (!meta || !cell) { return defaultHeight; } @@ -477,7 +538,10 @@ export abstract class BaseFacet { /** * 将每一层级的采样节点更新为高度最大的节点 (未隐藏, 非汇总节点) */ - protected updateColsHierarchySampleMaxHeightNodes(colsHierarchy: Hierarchy) { + protected updateColsHierarchySampleMaxHeightNodes( + colsHierarchy: Hierarchy, + rowsHierarchy?: Hierarchy, + ) { const sampleMaxHeightNodesForAllLevels = colsHierarchy.sampleNodesForAllLevels.map((sampleNode) => { const maxHeightNode = maxBy( @@ -485,7 +549,10 @@ export abstract class BaseFacet { .getNodes(sampleNode.level) .filter((node) => !node.isTotals), (levelSampleNode) => { - return this.getColNodeHeight(levelSampleNode, colsHierarchy); + return this.getColNodeHeight({ + colNode: levelSampleNode, + colsHierarchy, + }); }, )!; @@ -496,11 +563,27 @@ export abstract class BaseFacet { sampleMaxHeightNodesForAllLevels, ); + const cornerNodes = rowsHierarchy + ? CornerHeader.getCornerNodes({ + position: { x: 0, y: 0 }, + width: rowsHierarchy.width, + height: colsHierarchy.height, + layoutResult: { + rowsHierarchy, + colsHierarchy, + } as LayoutResult, + seriesNumberWidth: this.getSeriesNumberWidth(), + spreadsheet: this.spreadsheet, + }) + : []; + colsHierarchy.sampleNodesForAllLevels.forEach((levelSampleNode) => { - levelSampleNode.height = this.getColNodeHeight( - levelSampleNode, + levelSampleNode.height = this.getColNodeHeight({ + colNode: levelSampleNode, colsHierarchy, - ); + cornerNodes, + }); + if (levelSampleNode.level === 0) { levelSampleNode.y = 0; } else { diff --git a/packages/s2-core/src/facet/header/corner.ts b/packages/s2-core/src/facet/header/corner.ts index b58dd2f708..d9bf259089 100644 --- a/packages/s2-core/src/facet/header/corner.ts +++ b/packages/s2-core/src/facet/header/corner.ts @@ -193,7 +193,7 @@ export class CornerHeader extends BaseHeader { cornerNode.width = rowNode.width; cornerNode.height = leafNode?.height! ?? - spreadsheet.facet.getCellCustomSize(null, colCell?.height); + spreadsheet.facet?.getCellCustomSize(null, colCell?.height); cornerNode.isPivotMode = true; cornerNode.cornerType = CornerNodeType.Row; cornerNode.spreadsheet = spreadsheet; @@ -251,7 +251,15 @@ export class CornerHeader extends BaseHeader { return; } + const colNodes = spreadsheet.facet?.getColNodes() || []; + nodes.forEach((node) => { + // 自定义列头高度时, 需要同时标记下对应的角头 (兼容自定义列头场景) + const currentColNode = colNodes?.find( + (colNode) => node?.y === colNode?.y && node?.height === colNode?.height, + ); + + node.extra.isCustomHeight = currentColNode?.extra?.isCustomHeight; const cell = this.getCellInstance(node); this.scrollGroup.appendChild(cell); diff --git a/packages/s2-core/src/facet/layout/node.ts b/packages/s2-core/src/facet/layout/node.ts index 4f4bd01592..8c25b51c20 100644 --- a/packages/s2-core/src/facet/layout/node.ts +++ b/packages/s2-core/src/facet/layout/node.ts @@ -118,11 +118,12 @@ export class Node { /** 是否不绘制 row cell 竖直 resize 热区 */ public hideRowCellVerticalResize?: boolean; - public extra?: { + public extra: { description?: string; isCustomNode?: boolean; + isCustomHeight?: boolean; [key: string]: any; - }; + } = {}; [key: string]: any; diff --git a/packages/s2-core/src/facet/pivot-facet.ts b/packages/s2-core/src/facet/pivot-facet.ts index 18a7b502b3..cad5b22972 100644 --- a/packages/s2-core/src/facet/pivot-facet.ts +++ b/packages/s2-core/src/facet/pivot-facet.ts @@ -15,7 +15,7 @@ import { size, sumBy, } from 'lodash'; -import { ColCell, RowCell, SeriesNumberCell } from '../cell'; +import { ColCell, CornerCell, RowCell, SeriesNumberCell } from '../cell'; import { DEFAULT_ROW_CELL_TREE_WIDTH, LAYOUT_SAMPLE_COUNT, @@ -27,6 +27,7 @@ import { EXTRA_FIELD, LayoutWidthType, VALUE_FIELD } from '../common/constant'; import { CellType } from '../common/constant/interaction'; import { DebuggerUtil } from '../common/debug'; import type { + CellCallback, CellCallbackParams, LayoutResult, SimpleData, @@ -43,7 +44,7 @@ import { getAllChildCells } from '../utils/get-all-child-cells'; import { floor } from '../utils/math'; import { getCellWidth } from '../utils/text'; import { FrozenFacet } from './frozen-facet'; -import { CornerHeader, Frame } from './header'; +import { CornerHeader, Frame, type CornerHeaderConfig } from './header'; import { buildHeaderHierarchy } from './layout/build-header-hierarchy'; import type { Hierarchy } from './layout/hierarchy'; import { layoutCoordinate } from './layout/layout-hooks'; @@ -54,6 +55,14 @@ export class PivotFacet extends FrozenFacet { return this.spreadsheet.theme.rowCell!.cell; } + protected override getCornerCellInstance(...args: CellCallbackParams) { + return ( + this.spreadsheet.options.cornerCell?.( + ...(args as Parameters>), + ) || new CornerCell(...args) + ); + } + protected override getRowCellInstance(...args: CellCallbackParams) { return this.spreadsheet.options.rowCell?.(...args) || new RowCell(...args); } @@ -199,14 +208,14 @@ export class PivotFacet extends FrozenFacet { } protected calculateColNodesCoordinate(layoutResult: LayoutResult) { - const { colLeafNodes, colsHierarchy } = layoutResult; + const { colLeafNodes, colsHierarchy, rowsHierarchy } = layoutResult; // 1. 计算叶子节点宽度 this.calculateColLeafNodesWidth(layoutResult); // 2. 根据叶子节点宽度计算所有父级节点宽度和 x 坐标, 便于计算自动换行后节点的真实高度 this.calculateColNodeWidthAndX(colLeafNodes); // 3. 计算每一层级的采样节点 - this.updateColsHierarchySampleMaxHeightNodes(colsHierarchy); + this.updateColsHierarchySampleMaxHeightNodes(colsHierarchy, rowsHierarchy); // 4. 计算所有节点的高度 this.calculateColNodesHeight(colsHierarchy); // 5. 如果存在自定义多级列头, 还需要更新某一层级的采样 @@ -274,11 +283,11 @@ export class PivotFacet extends FrozenFacet { } // 数值置于行头时, 列头的总计即叶子节点, 此时应该用列高: https://github.com/antvis/S2/issues/1715 - const colNodeHeight = this.getColNodeHeight( - currentNode, + const colNodeHeight = this.getColNodeHeight({ + colNode: currentNode, colsHierarchy, - false, - ); + useCache: false, + }); currentNode.height = currentNode.isGrandTotals && @@ -452,14 +461,16 @@ export class PivotFacet extends FrozenFacet { rowCellStyle?.maxLines! > 1 && rowCellStyle?.wordWrap; if (this.isCustomRowCellHeight(rowNode) || !isEnableHeightAdaptive) { + rowNode.extra.isCustomHeight = true; + return defaultHeight || 0; } - return this.getNodeAdaptiveHeight( - rowNode, - this.textWrapTempRowCell, + return this.getNodeAdaptiveHeight({ + meta: rowNode, + cell: this.textWrapTempRowCell, defaultHeight, - ); + }); } /** diff --git a/packages/s2-core/src/facet/table-facet.ts b/packages/s2-core/src/facet/table-facet.ts index fe5c658ca8..fbc799a2b9 100644 --- a/packages/s2-core/src/facet/table-facet.ts +++ b/packages/s2-core/src/facet/table-facet.ts @@ -54,6 +54,8 @@ import { Node } from './layout/node'; export class TableFacet extends FrozenFacet { public emptyPlaceholderGroup: Group; + public customRowHeightStatusMap: Record = {}; + private lastRowOffset: number; public constructor(spreadsheet: SpreadSheet) { @@ -62,6 +64,10 @@ export class TableFacet extends FrozenFacet { this.spreadsheet.on(S2Event.RANGE_FILTER, this.onFilterHandler); } + protected getCornerCellInstance() { + return null; + } + protected override getRowCellInstance(node: ViewMeta) { const { dataCell } = this.spreadsheet.options; @@ -167,16 +173,19 @@ export class TableFacet extends FrozenFacet { const rowHeight = this.getRowCellHeight(node); if (this.isCustomRowCellHeight(node)) { + // 标记当前行是否为自定义高度 + this.customRowHeightStatusMap[viewMeta?.rowIndex] = true; + return rowHeight || 0; } const defaultHeight = this.getCellHeightByRowIndex(viewMeta?.rowIndex); - return this.getNodeAdaptiveHeight( - viewMeta, - this.textWrapTempRowCell, + return this.getNodeAdaptiveHeight({ + meta: viewMeta, + cell: this.textWrapTempRowCell, defaultHeight, - ); + }); } private getCellHeightByRowIndex(rowIndex: number) { @@ -226,6 +235,7 @@ export class TableFacet extends FrozenFacet { const data = this.spreadsheet.dataSet.getDisplayDataSet(); this.textWrapNodeHeightCache.clear(); + this.customRowHeightStatusMap = {}; this.rowOffsets = [0]; this.lastRowOffset = 0; @@ -470,19 +480,18 @@ export class TableFacet extends FrozenFacet { private calculateColNodesHeight(colsHierarchy: Hierarchy) { const colNodes = colsHierarchy.getNodes(); - colNodes.forEach((currentNode) => { - if (currentNode.level === 0) { - currentNode.y = 0; + colNodes.forEach((colNode) => { + if (colNode.level === 0) { + colNode.y = 0; } else { - currentNode.y = - currentNode?.parent?.y! + currentNode?.parent?.height! || 0; + colNode.y = colNode?.parent?.y! + colNode?.parent?.height! || 0; } - currentNode.height = this.getColNodeHeight( - currentNode, + colNode.height = this.getColNodeHeight({ + colNode, colsHierarchy, - false, - ); + useCache: false, + }); }); } diff --git a/packages/s2-core/src/interaction/row-column-resize.ts b/packages/s2-core/src/interaction/row-column-resize.ts index 525d0dab55..2f9514392a 100644 --- a/packages/s2-core/src/interaction/row-column-resize.ts +++ b/packages/s2-core/src/interaction/row-column-resize.ts @@ -8,7 +8,6 @@ import { import { clone, isEmpty, throttle } from 'lodash'; import type { CellTextWordWrapStyle, - DefaultCellTheme, ResizeInteractionOptions, ResizeParams, } from '../common'; @@ -436,19 +435,16 @@ export class RowColumnResize extends BaseEvent implements BaseEventImplement { // 如果开启了换行, 高度拖拽后动态计算 maxLines 的值, 已保证展示合理性. const { cell } = this.getResizeInfo(); - const { cell: cellTheme } = cell?.getStyle() as DefaultCellTheme; - const padding = cellTheme!.padding!.top! + cellTheme!.padding!.bottom!; - const lineHeight = cell?.getTextLineHeight()!; - - const maxLines = Math.max( - 1, - Math.floor((displayHeight - padding) / lineHeight), - ); + const maxLines = cell.getMaxLinesByCustomHeight({ + targetCell: cell, + displayHeight, + isCustomHeight: true, + }); const maxLinesByField = Object.keys(heightByField || {}).reduce< Record >((result, field) => { - result![field] = maxLines; + result![field] = maxLines!; return result; }, {}); diff --git a/s2-site/docs/common/style.zh.md b/s2-site/docs/common/style.zh.md index 43fdfc59a6..e136a502de 100644 --- a/s2-site/docs/common/style.zh.md +++ b/s2-site/docs/common/style.zh.md @@ -76,5 +76,6 @@ order: 3 | 参数 | 说明 | 类型 | 默认值 | 必选 | | ------- | ------------ | ------ | ------ | ---- | | wordWrap | 文本是否自动换行(数值单元格不建议换行)。[了解更多](https://g.antv.antgroup.com/api/basic/text#wordwrap) | `boolean` | `true` | | +| maxLines | 最大行数,文本超出后将被截断,当 [**手动拖拽调整高度**](/manual/advanced/interaction/resize) 或存在 [**自定义单元格高度**](/manual/advanced/custom/cell-size) 时,为保证展示合理性,会根据当前文本行高计算出能展示的最大行数,**覆盖**默认的 `maxLines` 配置。
该配置 支持配置为 `Infinity`(数值单元格不建议换行),需要配合 `wordWrap` 和 `textOverflow` 一起使用。[了解更多](https://g.antv.antgroup.com/api/basic/text#maxlines) | `number` | `1` | | | maxLines | 最大行数,文本超出后将被截断,支持配置为 `Infinity`(数值单元格不建议换行),需要配合 `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` | | diff --git a/s2-site/docs/manual/basic/multi-line-text.zh.md b/s2-site/docs/manual/basic/multi-line-text.zh.md index 474a48f8c6..982f903209 100644 --- a/s2-site/docs/manual/basic/multi-line-text.zh.md +++ b/s2-site/docs/manual/basic/multi-line-text.zh.md @@ -80,15 +80,15 @@ const s2Options = { ```json { - province: '浙江\n浙江', - city: '杭州\n杭州\n杭州', - type: '纸张\n纸张\n纸张', - price: 2, - cost: 20, + "province": "浙江\n浙江", + "city": "杭州\n杭州\n杭州", + "type": "纸张\n纸张\n纸张", + "price": 2, + "cost": 20, } ``` -以上诉数据为例,可以根据文本中换行符的数量,指定 `maxLines` 的值. +以上诉数据为例,可以根据文本中换行符的数量,指定 `maxLines` 的值。 如果文本是动态的,则可以指定为一个**较大**的数值,如 `maxLines: 99` 或者 `maxLines: Infinity`, 从而实现高度自适应的效果。 ```ts @@ -109,8 +109,8 @@ const s2Options = { 开启文本自动换行后,默认会根据**文本实际的高度**调整对应单元格的高度。 -1. 如果配置了 [自定义单元格宽高](/manual/advanced/custom/cell-size), 则高度自适应失效,以自定义的宽高为准。 -2. 默认根据 `maxLines` 来计算单元格高度,当**手动拖拽调整高度**后, 为保证展示合理性,会根据当前文本行高计算出能展示的最大行数,**覆盖**默认的 `maxLines` 配置。 +1. 如果配置了 [自定义单元格高度](/manual/advanced/custom/cell-size), 则高度自适应失效,以自定义的宽高为准。 +2. 默认根据 `maxLines` 来计算单元格高度,当 [**手动拖拽调整高度**](/manual/advanced/interaction/resize) 或存在 [**自定义单元格高度**](/manual/advanced/custom/cell-size) 时,为保证展示合理性,会根据当前文本行高计算出能展示的最大行数,**覆盖**默认的 `maxLines` 配置。 :::