diff --git a/.gitignore b/.gitignore index 1cbe6e171f..16c86a873c 100644 --- a/.gitignore +++ b/.gitignore @@ -47,7 +47,7 @@ server/ # Docs templates scripts/previewEditor/index.html -components/version/version.tsx +components/version/version.ts components/version/token.json components/version/token-meta.json .dumi/tmp diff --git a/components/index.tsx b/components/index.ts similarity index 100% rename from components/index.tsx rename to components/index.ts diff --git a/components/style/compact-item-vertical.tsx b/components/style/compact-item-vertical.ts similarity index 100% rename from components/style/compact-item-vertical.tsx rename to components/style/compact-item-vertical.ts diff --git a/components/style/compact-item.tsx b/components/style/compact-item.ts similarity index 100% rename from components/style/compact-item.tsx rename to components/style/compact-item.ts diff --git a/components/style/index.tsx b/components/style/index.ts similarity index 100% rename from components/style/index.tsx rename to components/style/index.ts diff --git a/components/style/motion/collapse.tsx b/components/style/motion/collapse.ts similarity index 100% rename from components/style/motion/collapse.tsx rename to components/style/motion/collapse.ts diff --git a/components/style/motion/fade.tsx b/components/style/motion/fade.ts similarity index 100% rename from components/style/motion/fade.tsx rename to components/style/motion/fade.ts diff --git a/components/style/motion/motion.tsx b/components/style/motion/motion.ts similarity index 100% rename from components/style/motion/motion.tsx rename to components/style/motion/motion.ts diff --git a/components/style/motion/move.tsx b/components/style/motion/move.ts similarity index 100% rename from components/style/motion/move.tsx rename to components/style/motion/move.ts diff --git a/components/style/motion/slide.tsx b/components/style/motion/slide.ts similarity index 100% rename from components/style/motion/slide.tsx rename to components/style/motion/slide.ts diff --git a/components/style/motion/zoom.tsx b/components/style/motion/zoom.ts similarity index 100% rename from components/style/motion/zoom.tsx rename to components/style/motion/zoom.ts diff --git a/components/style/operationUnit.tsx b/components/style/operationUnit.ts similarity index 100% rename from components/style/operationUnit.tsx rename to components/style/operationUnit.ts diff --git a/components/style/placementArrow.tsx b/components/style/placementArrow.ts similarity index 100% rename from components/style/placementArrow.tsx rename to components/style/placementArrow.ts diff --git a/components/style/roundedArrow.tsx b/components/style/roundedArrow.ts similarity index 100% rename from components/style/roundedArrow.tsx rename to components/style/roundedArrow.ts diff --git a/components/switch/style/index.tsx b/components/switch/style/index.ts similarity index 100% rename from components/switch/style/index.tsx rename to components/switch/style/index.ts diff --git a/components/table/Column.tsx b/components/table/Column.ts similarity index 100% rename from components/table/Column.tsx rename to components/table/Column.ts diff --git a/components/table/ColumnGroup.tsx b/components/table/ColumnGroup.ts similarity index 100% rename from components/table/ColumnGroup.tsx rename to components/table/ColumnGroup.ts diff --git a/components/table/__tests__/Table.test.tsx b/components/table/__tests__/Table.test.tsx index fdaf21d394..8227e67532 100644 --- a/components/table/__tests__/Table.test.tsx +++ b/components/table/__tests__/Table.test.tsx @@ -1,3 +1,4 @@ +import { ConfigProvider } from 'antd'; import React from 'react'; import type { TableProps } from '..'; import Table from '..'; @@ -360,4 +361,14 @@ describe('Table', () => { expect(container.querySelector('table')?.getAttribute('aria-label')).toBe('label'); expect(container.querySelector('.ant-table')?.getAttribute('data-number')).toBe('123'); }); + + it('support wireframe', () => { + const columns = [{ title: 'Name', key: 'name', dataIndex: 'name' }]; + const { container } = render( + + + , + ); + expect(container.firstChild).toMatchSnapshot(); + }); }); diff --git a/components/table/__tests__/__snapshots__/Table.test.tsx.snap b/components/table/__tests__/__snapshots__/Table.test.tsx.snap index f2857d7792..93c6920242 100644 --- a/components/table/__tests__/__snapshots__/Table.test.tsx.snap +++ b/components/table/__tests__/__snapshots__/Table.test.tsx.snap @@ -632,6 +632,107 @@ exports[`Table should render title 1`] = ` `; +exports[`Table support wireframe 1`] = ` +
+
+
+
+
+
+
+ + + + + + + + + + + +
+ Name +
+
+
+ + + + + + + + + +
+
+ No data +
+
+
+ + + + + + +`; + exports[`Table title should support ReactNode 1`] = ` = (token) => { `&-placement-rightBottom`, ].join(',')]: { [`${componentCls}-inner`]: { - borderRadius: - tooltipBorderRadius > MAX_VERTICAL_CONTENT_RADIUS - ? MAX_VERTICAL_CONTENT_RADIUS - : tooltipBorderRadius, + borderRadius: Math.min(tooltipBorderRadius, MAX_VERTICAL_CONTENT_RADIUS), }, }, diff --git a/components/tour/style/index.tsx b/components/tour/style/index.ts similarity index 97% rename from components/tour/style/index.tsx rename to components/tour/style/index.ts index a1d585f262..29eadff0cb 100644 --- a/components/tour/style/index.tsx +++ b/components/tour/style/index.ts @@ -222,10 +222,7 @@ const genBaseStyle: GenerateStyle = (token) => { '&-placement-rightBottom', ].join(',')]: { [`${componentCls}-inner`]: { - borderRadius: - tourBorderRadius > MAX_VERTICAL_CONTENT_RADIUS - ? MAX_VERTICAL_CONTENT_RADIUS - : tourBorderRadius, + borderRadius: Math.min(tourBorderRadius, MAX_VERTICAL_CONTENT_RADIUS), }, }, }, diff --git a/components/transfer/style/index.tsx b/components/transfer/style/index.ts similarity index 100% rename from components/transfer/style/index.tsx rename to components/transfer/style/index.ts diff --git a/components/tree-select/style/index.tsx b/components/tree-select/style/index.ts similarity index 100% rename from components/tree-select/style/index.tsx rename to components/tree-select/style/index.ts diff --git a/components/tree/index.tsx b/components/tree/index.ts similarity index 100% rename from components/tree/index.tsx rename to components/tree/index.ts diff --git a/components/tree/style/index.tsx b/components/tree/style/index.ts similarity index 100% rename from components/tree/style/index.tsx rename to components/tree/style/index.ts diff --git a/components/typography/index.tsx b/components/typography/index.ts similarity index 100% rename from components/typography/index.tsx rename to components/typography/index.ts diff --git a/components/typography/style/index.tsx b/components/typography/style/index.ts similarity index 100% rename from components/typography/style/index.tsx rename to components/typography/style/index.ts diff --git a/components/typography/style/mixins.tsx b/components/typography/style/mixins.ts similarity index 100% rename from components/typography/style/mixins.tsx rename to components/typography/style/mixins.ts diff --git a/scripts/generate-version.js b/scripts/generate-version.js index 0370a17df8..42e79cb3f9 100644 --- a/scripts/generate-version.js +++ b/scripts/generate-version.js @@ -4,7 +4,7 @@ const path = require('path'); const { version } = require('../package.json'); fs.writeFileSync( - path.join(__dirname, '..', 'components', 'version', 'version.tsx'), - `export default '${version}'`, + path.join(__dirname, '..', 'components', 'version', 'version.ts'), + `export default '${version}';`, 'utf8', ); diff --git a/tsconfig.json b/tsconfig.json index 98908c88a3..aadc26e8e4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "baseUrl": "./", "paths": { - "antd": ["components/index.tsx"], + "antd": ["components/index.ts"], "antd/es/*": ["components/*"], "antd/lib/*": ["components/*"], "antd/locale/*": ["components/locale/*"]