diff --git a/packages/s2-core/__tests__/spreadsheet/__snapshots__/theme-spec.ts.snap b/packages/s2-core/__tests__/spreadsheet/__snapshots__/theme-spec.ts.snap index 56914d000d..309bd54147 100644 --- a/packages/s2-core/__tests__/spreadsheet/__snapshots__/theme-spec.ts.snap +++ b/packages/s2-core/__tests__/spreadsheet/__snapshots__/theme-spec.ts.snap @@ -12,9 +12,12 @@ Object { "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": 700, + "maxLines": 1, "opacity": 1, "textAlign": "center", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#3471F9", @@ -75,18 +78,24 @@ Object { "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": "normal", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "text": Object { "fill": "#FFFFFF", "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": "normal", + "maxLines": 1, "opacity": 1, "textAlign": "center", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "cornerCell": Object { @@ -95,9 +104,12 @@ Object { "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": 700, + "maxLines": 1, "opacity": 1, "textAlign": "left", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#3471F9", @@ -128,9 +140,12 @@ Object { "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": 700, + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "dataCell": Object { @@ -140,9 +155,12 @@ Object { "fontSize": 12, "fontWeight": 700, "linkTextFill": "#2C60D4", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#FFFFFF", @@ -252,9 +270,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#2C60D4", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "mergedCell": Object { @@ -264,9 +285,12 @@ Object { "fontSize": 12, "fontWeight": 700, "linkTextFill": "#2C60D4", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#FFFFFF", @@ -376,9 +400,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#2C60D4", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "prepareSelectMask": Object { @@ -400,6 +427,8 @@ Object { "backgroundOpacity": 1, }, }, + "minCellHeight": 40, + "minCellWidth": 42, "size": 3, }, "rowCell": Object { @@ -409,9 +438,12 @@ Object { "fontSize": 12, "fontWeight": 700, "linkTextFill": "#2C60D4", + "maxLines": 1, "opacity": 1, "textAlign": "left", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#F5F8FF", @@ -471,9 +503,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#2C60D4", + "maxLines": 1, "opacity": 1, "textAlign": "left", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "seriesNumberWidth": 80, "seriesText": Object { @@ -482,9 +517,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#2C60D4", + "maxLines": 1, "opacity": 1, "textAlign": "center", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "text": Object { "fill": "#000000", @@ -492,9 +530,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#2C60D4", + "maxLines": 1, "opacity": 1, "textAlign": "left", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "scrollBar": Object { @@ -536,9 +577,12 @@ Object { "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": 700, + "maxLines": 1, "opacity": 1, "textAlign": "center", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#133aad", @@ -599,18 +643,24 @@ Object { "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": "normal", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "text": Object { "fill": "#ffffff", "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": "normal", + "maxLines": 1, "opacity": 1, "textAlign": "center", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "cornerCell": Object { @@ -619,9 +669,12 @@ Object { "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": 700, + "maxLines": 1, "opacity": 1, "textAlign": "left", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#133aad", @@ -652,9 +705,12 @@ Object { "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": 700, + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "dataCell": Object { @@ -664,9 +720,12 @@ Object { "fontSize": 12, "fontWeight": 700, "linkTextFill": "#4b91ff", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#191919", @@ -776,9 +835,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#4b91ff", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "mergedCell": Object { @@ -788,9 +850,12 @@ Object { "fontSize": 12, "fontWeight": 700, "linkTextFill": "#4b91ff", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#191919", @@ -900,9 +965,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#4b91ff", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "prepareSelectMask": Object { @@ -924,6 +992,8 @@ Object { "backgroundOpacity": 1, }, }, + "minCellHeight": 40, + "minCellWidth": 42, "size": 3, }, "rowCell": Object { @@ -933,9 +1003,12 @@ Object { "fontSize": 12, "fontWeight": 700, "linkTextFill": "#4b91ff", + "maxLines": 1, "opacity": 1, "textAlign": "left", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#151a27", @@ -995,9 +1068,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#4b91ff", + "maxLines": 1, "opacity": 1, "textAlign": "left", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "seriesNumberWidth": 80, "seriesText": Object { @@ -1006,9 +1082,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#4b91ff", + "maxLines": 1, "opacity": 1, "textAlign": "center", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "text": Object { "fill": "#dcdcdc", @@ -1016,9 +1095,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#4b91ff", + "maxLines": 1, "opacity": 1, "textAlign": "left", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "scrollBar": Object { @@ -1625,9 +1707,12 @@ Object { "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": 700, + "maxLines": 1, "opacity": 1, "textAlign": "center", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#E0E9FD", @@ -1688,18 +1773,24 @@ Object { "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": "normal", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "text": Object { "fill": "#000000", "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": "normal", + "maxLines": 1, "opacity": 1, "textAlign": "center", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "cornerCell": Object { @@ -1708,9 +1799,12 @@ Object { "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": 700, + "maxLines": 1, "opacity": 1, "textAlign": "left", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#E0E9FD", @@ -1741,9 +1835,12 @@ Object { "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": 700, + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "dataCell": Object { @@ -1753,9 +1850,12 @@ Object { "fontSize": 12, "fontWeight": 700, "linkTextFill": "#326EF4", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#FFFFFF", @@ -1865,9 +1965,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#326EF4", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "mergedCell": Object { @@ -1877,9 +1980,12 @@ Object { "fontSize": 12, "fontWeight": 700, "linkTextFill": "#326EF4", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#FFFFFF", @@ -1989,9 +2095,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#326EF4", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "prepareSelectMask": Object { @@ -2013,6 +2122,8 @@ Object { "backgroundOpacity": 1, }, }, + "minCellHeight": 40, + "minCellWidth": 42, "size": 3, }, "rowCell": Object { @@ -2022,9 +2133,12 @@ Object { "fontSize": 12, "fontWeight": 700, "linkTextFill": "#326EF4", + "maxLines": 1, "opacity": 1, "textAlign": "left", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#F5F8FE", @@ -2084,9 +2198,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#326EF4", + "maxLines": 1, "opacity": 1, "textAlign": "left", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "seriesNumberWidth": 80, "seriesText": Object { @@ -2095,9 +2212,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#326EF4", + "maxLines": 1, "opacity": 1, "textAlign": "center", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "text": Object { "fill": "#000000", @@ -2105,9 +2225,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#326EF4", + "maxLines": 1, "opacity": 1, "textAlign": "left", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "scrollBar": Object { @@ -2149,9 +2272,12 @@ Object { "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": 700, + "maxLines": 1, "opacity": 1, "textAlign": "center", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#F0F2F4", @@ -2212,18 +2338,24 @@ Object { "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": "normal", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "text": Object { "fill": "#000000", "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": "normal", + "maxLines": 1, "opacity": 1, "textAlign": "center", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "cornerCell": Object { @@ -2232,9 +2364,12 @@ Object { "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": 700, + "maxLines": 1, "opacity": 1, "textAlign": "left", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#F0F2F4", @@ -2265,9 +2400,12 @@ Object { "fontFamily": "Roboto, PingFangSC, Microsoft YaHei, Arial, sans-serif", "fontSize": 12, "fontWeight": 700, + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "dataCell": Object { @@ -2277,9 +2415,12 @@ Object { "fontSize": 12, "fontWeight": 700, "linkTextFill": "#565C64", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#FFFFFF", @@ -2389,9 +2530,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#565C64", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "mergedCell": Object { @@ -2401,9 +2545,12 @@ Object { "fontSize": 12, "fontWeight": 700, "linkTextFill": "#565C64", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#FFFFFF", @@ -2513,9 +2660,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#565C64", + "maxLines": 1, "opacity": 1, "textAlign": "right", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "prepareSelectMask": Object { @@ -2537,6 +2687,8 @@ Object { "backgroundOpacity": 1, }, }, + "minCellHeight": 40, + "minCellWidth": 42, "size": 3, }, "rowCell": Object { @@ -2546,9 +2698,12 @@ Object { "fontSize": 12, "fontWeight": 700, "linkTextFill": "#565C64", + "maxLines": 1, "opacity": 1, "textAlign": "left", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "cell": Object { "backgroundColor": "#FAFBFB", @@ -2608,9 +2763,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#565C64", + "maxLines": 1, "opacity": 1, "textAlign": "left", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "seriesNumberWidth": 80, "seriesText": Object { @@ -2619,9 +2777,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#565C64", + "maxLines": 1, "opacity": 1, "textAlign": "center", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, "text": Object { "fill": "#000000", @@ -2629,9 +2790,12 @@ Object { "fontSize": 12, "fontWeight": "normal", "linkTextFill": "#565C64", + "maxLines": 1, "opacity": 1, "textAlign": "left", "textBaseline": "middle", + "textOverflow": "ellipsis", + "wordWrap": true, }, }, "scrollBar": Object { diff --git a/packages/s2-react/__tests__/unit/utils/drill-down-spec.ts b/packages/s2-react/__tests__/unit/utils/drill-down-spec.ts index d6be9e9c3f..fe23b0b2ca 100644 --- a/packages/s2-react/__tests__/unit/utils/drill-down-spec.ts +++ b/packages/s2-react/__tests__/unit/utils/drill-down-spec.ts @@ -105,7 +105,7 @@ describe('Drill Down Test', () => { cityNode.spreadsheet = mockInstance; }); - test('should set correct drillDownNum', () => { + test('should set correct drilldownNum', () => { const getDrillDownParams = (drillItemsNum?: number) => ({ rows: mockDataCfg.fields.rows, diff --git a/packages/s2-react/playground/components/ResizeConfig.tsx b/packages/s2-react/playground/components/ResizeConfig.tsx index ace50c46af..ce65b13ac7 100644 --- a/packages/s2-react/playground/components/ResizeConfig.tsx +++ b/packages/s2-react/playground/components/ResizeConfig.tsx @@ -13,6 +13,7 @@ import { Switch, Tooltip, type RadioChangeEvent, + Divider, } from 'antd'; import type { CheckboxValueType } from 'antd/lib/checkbox/Group'; import React from 'react'; @@ -119,7 +120,11 @@ export const ResizeConfig: React.FC<{ return ( <> - + + + 热区配置 + + - - + + + 换行配置 + + {Array.from({ length: 6 }).map((_, i) => { diff --git a/packages/s2-react/playground/index.tsx b/packages/s2-react/playground/index.tsx index 329495b371..9110b7d261 100644 --- a/packages/s2-react/playground/index.tsx +++ b/packages/s2-react/playground/index.tsx @@ -70,7 +70,6 @@ import { } from './config'; import { partDrillDown } from './drill-down'; import { onSheetMounted } from './utils'; -import 'antd/dist/antd.min.css'; type TableSheetColumnType = 'single' | 'multiple'; @@ -99,7 +98,7 @@ function MainLayout() { const [showPagination, setShowPagination] = React.useState(false); const [showTotals, setShowTotals] = React.useState(false); const [themeCfg, setThemeCfg] = React.useState({ - name: 'dark', + name: 'default', }); const [themeColor, setThemeColor] = React.useState('#FFF'); const [showCustomTooltip, setShowCustomTooltip] = React.useState(false);