chore: auto merge branches (#46656)

chore: merge master into feature
This commit is contained in:
github-actions[bot] 2023-12-27 12:31:38 +00:00 committed by GitHub
commit 98ddc029f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 161 additions and 173 deletions

View File

@ -134,10 +134,28 @@ const GlobalLayout: React.FC = () => {
const [styleCache] = React.useState(() => createCache());
useServerInsertedHTML(() => {
const styleText = extractStyle(styleCache, true);
const styleText = extractStyle(styleCache, {
plain: true,
types: 'style',
});
return <style data-type="antd-cssinjs" dangerouslySetInnerHTML={{ __html: styleText }} />;
});
useServerInsertedHTML(() => {
const styleText = extractStyle(styleCache, {
plain: true,
types: ['cssVar', 'token'],
});
return (
<style
data-type="antd-css-var"
data-rc-order="prepend"
data-rc-priority="-9999"
dangerouslySetInnerHTML={{ __html: styleText }}
/>
);
});
useServerInsertedHTML(() => (
<style
data-sandpack="true"

View File

@ -179,6 +179,15 @@ const RoutesPlugin = (api: IApi) => {
const cssFile = writeCSSFile('antd', antdStyle, antdStyle);
file.content = addLinkStyle(file.content, cssFile, true);
// Insert antd cssVar to head
const cssVarMatchRegex = /<style data-type="antd-css-var"[\S\s]+?<\/style>/;
const cssVarMatchList = file.content.match(cssVarMatchRegex) || [];
cssVarMatchList.forEach((text) => {
file.content = file.content.replace(text, '');
file.content = file.content.replace('<head>', `<head>${text}`);
});
return file;
}),
);
@ -190,20 +199,6 @@ const RoutesPlugin = (api: IApi) => {
return memo;
});
// zombieJ: Unique CSS file is large, we move to build css for each page.
// See the `modifyExportHTMLFiles` above.
// generate ssr css file
// api.onBuildHtmlComplete(() => {
// const styleCache = (global as any)?.styleCache;
// const styleText = styleCache ? extractStyle(styleCache) : '';
// const styleTextWithoutStyleTag = styleText
// .replace(/<style\s[^>]*>/g, '')
// .replace(/<\/style>/g, '');
// fs.writeFileSync(`./_site/${ssrCssFileName}`, styleTextWithoutStyleTag, 'utf8');
// });
};
export default RoutesPlugin;

View File

@ -5,44 +5,24 @@
version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
ignore:
- dependency-name: "rc-cascader"
- dependency-name: "rc-checkbox"
- dependency-name: "rc-collapse"
- dependency-name: "rc-dialog"
- dependency-name: "rc-drawer"
- dependency-name: "rc-dropdown"
- dependency-name: "rc-field-form"
- dependency-name: "rc-image"
- dependency-name: "rc-input"
- dependency-name: "rc-input-number"
- dependency-name: "rc-mentions"
- dependency-name: "rc-menu"
- dependency-name: "rc-motion"
- dependency-name: "rc-notification"
- dependency-name: "rc-pagination"
- dependency-name: "rc-picker"
- dependency-name: "rc-progress"
- dependency-name: "rc-rate"
- dependency-name: "rc-resize-observer"
- dependency-name: "rc-select"
- dependency-name: "rc-segmented"
- dependency-name: "rc-slider"
- dependency-name: "rc-steps"
- dependency-name: "rc-switch"
- dependency-name: "rc-table"
- dependency-name: "rc-tabs"
- dependency-name: "rc-textarea"
- dependency-name: "rc-tooltip"
- dependency-name: "rc-tree"
- dependency-name: "rc-tree-select"
- dependency-name: "@rc-component/trigger"
- dependency-name: "@rc-component/tour"
- dependency-name: "@rc-component/mutate-observer"
- dependency-name: "@rc-component/color-picker"
- dependency-name: "rc-upload"
- dependency-name: "rc-util"
versioning-strategy: increase
groups:
rc-component-patch:
dependency-type: "production"
patterns:
- "rc-*"
- "@rc-component*"
update-types: ["patch"]
dependencies:
dependency-type: "production"
exclude-patterns:
- "rc-*"
- "@rc-component*"
update-types: ["major", "minor"]
dev-dependencies:
dependency-type: "development"
update-types: ["major", "minor"]

View File

@ -52,7 +52,7 @@ describe('Avatar Render', () => {
it('should handle onError correctly', () => {
const LOAD_FAILURE_SRC = 'http://error.url/';
const LOAD_SUCCESS_SRC = 'https://xsgames.co/randomusers/avatar.php?g=pixel';
const LOAD_SUCCESS_SRC = 'https://api.dicebear.com/7.x/pixel-art/svg';
const Foo: React.FC = () => {
const [avatarSrc, setAvatarSrc] = useState<typeof LOAD_FAILURE_SRC | typeof LOAD_SUCCESS_SRC>(
LOAD_FAILURE_SRC,
@ -74,7 +74,7 @@ describe('Avatar Render', () => {
it('should show image on success after a failure state', () => {
const LOAD_FAILURE_SRC = 'http://error.url';
const LOAD_SUCCESS_SRC = 'https://xsgames.co/randomusers/avatar.php?g=pixel';
const LOAD_SUCCESS_SRC = 'https://api.dicebear.com/7.x/pixel-art/svg';
const div = global.document.createElement('div');
global.document.body.appendChild(div);
@ -166,7 +166,7 @@ describe('Avatar Render', () => {
});
it('should exist crossorigin attribute', () => {
const LOAD_SUCCESS_SRC = 'https://xsgames.co/randomusers/avatar.php?g=pixel';
const LOAD_SUCCESS_SRC = 'https://api.dicebear.com/7.x/pixel-art/svg';
const crossOrigin = 'anonymous';
const { container } = render(
<Avatar src={LOAD_SUCCESS_SRC} crossOrigin={crossOrigin}>
@ -178,7 +178,7 @@ describe('Avatar Render', () => {
});
it('should not exist crossorigin attribute', () => {
const LOAD_SUCCESS_SRC = 'https://xsgames.co/randomusers/avatar.php?g=pixel';
const LOAD_SUCCESS_SRC = 'https://api.dicebear.com/7.x/pixel-art/svg';
const { container } = render(<Avatar src={LOAD_SUCCESS_SRC}>crossorigin</Avatar>);
expect(container.querySelector('img')?.crossOrigin).toBeFalsy();
expect(container.querySelector('img')?.crossOrigin).toEqual('');

View File

@ -140,7 +140,7 @@ exports[`Avatar Render should handle onError correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel"
src="https://api.dicebear.com/7.x/pixel-art/svg"
/>
</span>
`;
@ -163,7 +163,7 @@ exports[`Avatar Render should show image on success after a failure state 2`] =
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel"
src="https://api.dicebear.com/7.x/pixel-art/svg"
/>
</span>
`;

View File

@ -370,7 +370,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=2"
/>
</span>
<span
@ -656,7 +656,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=1"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=1"
/>
</span>
<a
@ -753,7 +753,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=2"
/>
</span>
<span
@ -879,7 +879,7 @@ Array [
class="ant-avatar ant-avatar-lg ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=3"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=3"
/>
</span>
<span

View File

@ -366,7 +366,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=2"
/>
</span>
<span
@ -557,7 +557,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=1"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=1"
/>
</span>
<a
@ -635,7 +635,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=2"
/>
</span>
<span
@ -672,7 +672,7 @@ Array [
class="ant-avatar ant-avatar-lg ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=3"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=3"
/>
</span>
<span

View File

@ -29,7 +29,7 @@ const App: React.FC = () => (
</Space>
<Space>
<Avatar.Group maxCount={2} maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }}>
<Avatar src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2" />
<Avatar src="https://api.dicebear.com/7.x/miniavs/svg?seed=2" />
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
<Tooltip title="Ant User" placement="top">
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />

View File

@ -5,7 +5,7 @@ import { Avatar, Divider, Tooltip } from 'antd';
const App: React.FC = () => (
<>
<Avatar.Group>
<Avatar src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=1" />
<Avatar src="https://api.dicebear.com/7.x/miniavs/svg?seed=1" />
<a href="https://ant.design">
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
</a>
@ -16,7 +16,7 @@ const App: React.FC = () => (
</Avatar.Group>
<Divider />
<Avatar.Group maxCount={2} maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }}>
<Avatar src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2" />
<Avatar src="https://api.dicebear.com/7.x/miniavs/svg?seed=2" />
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
<Tooltip title="Ant User" placement="top">
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
@ -29,7 +29,7 @@ const App: React.FC = () => (
size="large"
maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }}
>
<Avatar src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=3" />
<Avatar src="https://api.dicebear.com/7.x/miniavs/svg?seed=3" />
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
<Tooltip title="Ant User" placement="top">
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />

View File

@ -16,7 +16,7 @@ const App: React.FC = () => {
<Switch checked={!loading} onChange={onChange} />
<Card style={{ width: 300, marginTop: 16 }} loading={loading}>
<Meta
avatar={<Avatar src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=1" />}
avatar={<Avatar src="https://api.dicebear.com/7.x/miniavs/svg?seed=1" />}
title="Card title"
description="This is the description"
/>
@ -31,7 +31,7 @@ const App: React.FC = () => {
>
<Skeleton loading={loading} avatar active>
<Meta
avatar={<Avatar src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2" />}
avatar={<Avatar src="https://api.dicebear.com/7.x/miniavs/svg?seed=2" />}
title="Card title"
description="This is the description"
/>

View File

@ -117,7 +117,7 @@ const Sider = React.forwardRef<HTMLDivElement, SiderProps>((props, ref) => {
if (typeof window !== 'undefined') {
const { matchMedia } = window;
if (matchMedia! && breakpoint && breakpoint in dimensionMaxMap) {
mql = matchMedia(`(max-width: ${dimensionMaxMap[breakpoint]})`);
mql = matchMedia(`screen and (max-width: ${dimensionMaxMap[breakpoint]})`);
try {
mql.addEventListener('change', responsiveHandler);
} catch (error) {

View File

@ -26,7 +26,7 @@ exports[`renders components/list/demo/basic.tsx extend context correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=0"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=0"
/>
</span>
</div>
@ -63,7 +63,7 @@ exports[`renders components/list/demo/basic.tsx extend context correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=1"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=1"
/>
</span>
</div>
@ -100,7 +100,7 @@ exports[`renders components/list/demo/basic.tsx extend context correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=2"
/>
</span>
</div>
@ -137,7 +137,7 @@ exports[`renders components/list/demo/basic.tsx extend context correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=3"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=3"
/>
</span>
</div>
@ -436,7 +436,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=0"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=0"
/>
</span>
</div>
@ -473,7 +473,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=1"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=1"
/>
</span>
</div>
@ -510,7 +510,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=2"
/>
</span>
</div>
@ -547,7 +547,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=3"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=3"
/>
</span>
</div>
@ -610,7 +610,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=0"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=0"
/>
</span>
</div>
@ -647,7 +647,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=1"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=1"
/>
</span>
</div>
@ -684,7 +684,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=2"
/>
</span>
</div>
@ -721,7 +721,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=3"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=3"
/>
</span>
</div>
@ -2023,7 +2023,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=0"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=0"
/>
</span>
</div>
@ -2060,7 +2060,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=1"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=1"
/>
</span>
</div>
@ -2097,7 +2097,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=2"
/>
</span>
</div>
@ -2134,7 +2134,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=3"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=3"
/>
</span>
</div>
@ -2748,7 +2748,7 @@ exports[`renders components/list/demo/vertical.tsx extend context correctly 1`]
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=0"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=0"
/>
</span>
</div>
@ -2911,7 +2911,7 @@ exports[`renders components/list/demo/vertical.tsx extend context correctly 1`]
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=1"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=1"
/>
</span>
</div>
@ -3074,7 +3074,7 @@ exports[`renders components/list/demo/vertical.tsx extend context correctly 1`]
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=2"
/>
</span>
</div>

View File

@ -26,7 +26,7 @@ exports[`renders components/list/demo/basic.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=0"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=0"
/>
</span>
</div>
@ -63,7 +63,7 @@ exports[`renders components/list/demo/basic.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=1"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=1"
/>
</span>
</div>
@ -100,7 +100,7 @@ exports[`renders components/list/demo/basic.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=2"
/>
</span>
</div>
@ -137,7 +137,7 @@ exports[`renders components/list/demo/basic.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=3"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=3"
/>
</span>
</div>
@ -439,7 +439,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=0"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=0"
/>
</span>
</div>
@ -476,7 +476,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=1"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=1"
/>
</span>
</div>
@ -513,7 +513,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=2"
/>
</span>
</div>
@ -550,7 +550,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=3"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=3"
/>
</span>
</div>
@ -613,7 +613,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=0"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=0"
/>
</span>
</div>
@ -650,7 +650,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=1"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=1"
/>
</span>
</div>
@ -687,7 +687,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=2"
/>
</span>
</div>
@ -724,7 +724,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=3"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=3"
/>
</span>
</div>
@ -2016,7 +2016,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=0"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=0"
/>
</span>
</div>
@ -2053,7 +2053,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=1"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=1"
/>
</span>
</div>
@ -2090,7 +2090,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=2"
/>
</span>
</div>
@ -2127,7 +2127,7 @@ Array [
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=3"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=3"
/>
</span>
</div>
@ -2728,7 +2728,7 @@ exports[`renders components/list/demo/vertical.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=0"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=0"
/>
</span>
</div>
@ -2891,7 +2891,7 @@ exports[`renders components/list/demo/vertical.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=1"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=1"
/>
</span>
</div>
@ -3054,7 +3054,7 @@ exports[`renders components/list/demo/vertical.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=2"
/>
</span>
</div>

View File

@ -23,7 +23,7 @@ const App: React.FC = () => (
renderItem={(item, index) => (
<List.Item>
<List.Item.Meta
avatar={<Avatar src={`https://xsgames.co/randomusers/avatar.php?g=pixel&key=${index}`} />}
avatar={<Avatar src={`https://api.dicebear.com/7.x/miniavs/svg?seed=${index}`} />}
title={<a href="https://ant.design">{item.title}</a>}
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
/>

View File

@ -80,9 +80,7 @@ const App: React.FC = () => (
renderItem={(item, index) => (
<List.Item>
<List.Item.Meta
avatar={
<Avatar src={`https://xsgames.co/randomusers/avatar.php?g=pixel&key=${index}`} />
}
avatar={<Avatar src={`https://api.dicebear.com/7.x/miniavs/svg?seed=${index}`} />}
title={<a href="https://ant.design">{item.title}</a>}
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
/>
@ -96,9 +94,7 @@ const App: React.FC = () => (
renderItem={(item, index) => (
<List.Item>
<List.Item.Meta
avatar={
<Avatar src={`https://xsgames.co/randomusers/avatar.php?g=pixel&key=${index}`} />
}
avatar={<Avatar src={`https://api.dicebear.com/7.x/miniavs/svg?seed=${index}`} />}
title={<a href="https://ant.design">{item.title}</a>}
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
/>

View File

@ -70,9 +70,7 @@ const App: React.FC = () => {
renderItem={(item, index) => (
<List.Item>
<List.Item.Meta
avatar={
<Avatar src={`https://xsgames.co/randomusers/avatar.php?g=pixel&key=${index}`} />
}
avatar={<Avatar src={`https://api.dicebear.com/7.x/miniavs/svg?seed=${index}`} />}
title={<a href="https://ant.design">{item.title}</a>}
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
/>

View File

@ -5,7 +5,7 @@ import { Avatar, List, Space } from 'antd';
const data = Array.from({ length: 23 }).map((_, i) => ({
href: 'https://ant.design',
title: `ant design part ${i}`,
avatar: `https://xsgames.co/randomusers/avatar.php?g=pixel&key=${i}`,
avatar: `https://api.dicebear.com/7.x/miniavs/svg?seed=${i}`,
description:
'Ant Design, a design language for background applications, is refined by Ant UED Team.',
content:

View File

@ -113,6 +113,9 @@ const InternalSelect = <
style,
allowClear,
variant: customizeVariant,
dropdownStyle,
transitionName,
tagRender,
...rest
} = props;
@ -153,6 +156,7 @@ const InternalSelect = <
}, [props.mode]);
const isMultiple = mode === 'multiple' || mode === 'tags';
const showSuffixIcon = useShowArrow(props.suffixIcon, props.showArrow);
const mergedPopupMatchSelectWidth =
@ -190,10 +194,7 @@ const InternalSelect = <
const mergedAllowClear = allowClear === true ? { clearIcon } : allowClear;
const selectProps = omit(rest as typeof rest & { itemIcon: React.ReactNode }, [
'suffixIcon',
'itemIcon',
]);
const selectProps = omit(rest, ['suffixIcon', 'itemIcon' as any]);
const mergedPopupClassName = classNames(
popupClassName || dropdownClassName,
@ -262,7 +263,7 @@ const InternalSelect = <
}
// ====================== zIndex =========================
const [zIndex] = useZIndex('SelectLike', props.dropdownStyle?.zIndex as number);
const [zIndex] = useZIndex('SelectLike', dropdownStyle?.zIndex as number);
// ====================== Render =======================
return wrapCSSVar(
@ -274,7 +275,7 @@ const InternalSelect = <
style={{ ...select?.style, ...style }}
dropdownMatchSelectWidth={mergedPopupMatchSelectWidth}
builtinPlacements={mergedBuiltinPlacements}
transitionName={getTransitionName(rootPrefixCls, 'slide-up', props.transitionName)}
transitionName={getTransitionName(rootPrefixCls, 'slide-up', transitionName)}
listHeight={listHeight}
listItemHeight={listItemHeight}
mode={mode}
@ -290,10 +291,8 @@ const InternalSelect = <
getPopupContainer={getPopupContainer || getContextPopupContainer}
dropdownClassName={mergedPopupClassName}
disabled={mergedDisabled}
dropdownStyle={{
...props?.dropdownStyle,
zIndex,
}}
dropdownStyle={{ ...dropdownStyle, zIndex }}
tagRender={tagRender}
/>,
);
};

View File

@ -131,6 +131,16 @@ const genSingleStyle: GenerateStyle<SelectToken> = (token) => {
[`${selectItemCls}-option-state`]: {
color: token.colorPrimary,
},
[`&:has(+ ${selectItemCls}-option-selected:not(${selectItemCls}-option-disabled))`]: {
borderEndStartRadius: 0,
borderEndEndRadius: 0,
[`& + ${selectItemCls}-option-selected:not(${selectItemCls}-option-disabled)`]: {
borderStartStartRadius: 0,
borderStartEndRadius: 0,
},
},
},
'&-disabled': {
[`&${selectItemCls}-option-selected`]: {

View File

@ -11,7 +11,7 @@ interface IconTextProps {
const listData = Array.from({ length: 3 }).map((_, i) => ({
href: 'https://ant.design',
title: `ant design part ${i + 1}`,
avatar: `https://xsgames.co/randomusers/avatar.php?g=pixel&key=${i}`,
avatar: `https://api.dicebear.com/7.x/miniavs/svg?seed=${i}`,
description:
'Ant Design, a design language for background applications, is refined by Ant UED Team.',
content:

View File

@ -1573,7 +1573,7 @@ exports[`renders components/steps/demo/inline.tsx extend context correctly 1`] =
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=0"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=0"
/>
</span>
</div>
@ -1780,7 +1780,7 @@ exports[`renders components/steps/demo/inline.tsx extend context correctly 1`] =
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=1"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=1"
/>
</span>
</div>
@ -1987,7 +1987,7 @@ exports[`renders components/steps/demo/inline.tsx extend context correctly 1`] =
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=2"
/>
</span>
</div>
@ -2194,7 +2194,7 @@ exports[`renders components/steps/demo/inline.tsx extend context correctly 1`] =
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=3"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=3"
/>
</span>
</div>

View File

@ -1463,7 +1463,7 @@ exports[`renders components/steps/demo/inline.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=0"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=0"
/>
</span>
</div>
@ -1613,7 +1613,7 @@ exports[`renders components/steps/demo/inline.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=1"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=1"
/>
</span>
</div>
@ -1763,7 +1763,7 @@ exports[`renders components/steps/demo/inline.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=2"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=2"
/>
</span>
</div>
@ -1913,7 +1913,7 @@ exports[`renders components/steps/demo/inline.tsx correctly 1`] = `
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://xsgames.co/randomusers/avatar.php?g=pixel&key=3"
src="https://api.dicebear.com/7.x/miniavs/svg?seed=3"
/>
</span>
</div>

View File

@ -45,9 +45,7 @@ const App: React.FC = () => (
renderItem={(item, index) => (
<List.Item>
<List.Item.Meta
avatar={
<Avatar src={`https://xsgames.co/randomusers/avatar.php?g=pixel&key=${index}`} />
}
avatar={<Avatar src={`https://api.dicebear.com/7.x/miniavs/svg?seed=${index}`} />}
title={<a href="https://ant.design">{item.title}</a>}
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
/>

View File

@ -6,7 +6,7 @@
对某一列数据进行排序,通过指定列的 `sorter` 函数即可启动排序按钮。`sorter: function(rowA, rowB) { ... }` rowA、rowB 为比较的两个行数据。
`sortDirections: ['ascend' | 'descend']`改变每列可用的排序方式,切换排序时按数组内容依次切换,设置在 table props 上时对所有列生效。你可以通过设置 `['ascend', 'descend', 'ascend']` 禁止排序恢复到默认状态。
`sortDirections: ['ascend', 'descend']` 改变每列可用的排序方式,切换排序时按数组内容依次切换,设置在 table props 上时对所有列生效。你可以通过设置 `['ascend', 'descend', 'ascend']` 禁止排序恢复到默认状态。
使用 `defaultSortOrder` 属性,设置列的默认排序顺序。
@ -20,7 +20,7 @@ Use `defaultFilteredValue` to make a column filtered by default.
Use `sorter` to make a column sortable. `sorter` can be a function of the type `sorter: function(rowA, rowB) { ... }` for sorting data locally.
`sortDirections: ['ascend' | 'descend']` defines available sort methods for each columns, effective for all columns when set on table props. You can set as `['ascend', 'descend', 'ascend']` to prevent sorter back to default status.
`sortDirections: ['ascend', 'descend']` defines available sort methods for each columns, effective for all columns when set on table props. You can set as `['ascend', 'descend', 'ascend']` to prevent sorter back to default status.
Use `defaultSortOrder` to make a column sorted by default.

View File

@ -70,6 +70,8 @@ const genFixedStyle: GenerateStyle<TableToken, CSSObject> = (token) => {
},
[`${componentCls}-container`]: {
position: 'relative',
'&::before, &::after': {
position: 'absolute',
top: 0,
@ -91,12 +93,8 @@ const genFixedStyle: GenerateStyle<TableToken, CSSObject> = (token) => {
},
[`${componentCls}-ping-left`]: {
[`&:not(${componentCls}-has-fix-left) ${componentCls}-container`]: {
position: 'relative',
'&::before': {
boxShadow: `inset 10px 0 8px -8px ${shadowColor}`,
},
[`&:not(${componentCls}-has-fix-left) ${componentCls}-container::before`]: {
boxShadow: `inset 10px 0 8px -8px ${shadowColor}`,
},
[`
@ -112,12 +110,8 @@ const genFixedStyle: GenerateStyle<TableToken, CSSObject> = (token) => {
},
[`${componentCls}-ping-right`]: {
[`&:not(${componentCls}-has-fix-right) ${componentCls}-container`]: {
position: 'relative',
'&::after': {
boxShadow: `inset -10px 0 8px -8px ${shadowColor}`,
},
[`&:not(${componentCls}-has-fix-right) ${componentCls}-container::after`]: {
boxShadow: `inset -10px 0 8px -8px ${shadowColor}`,
},
[`

View File

@ -117,6 +117,8 @@ const InternalTreeSelect = <
popupMatchSelectWidth,
allowClear,
variant: customVariant,
dropdownStyle,
tagRender,
...props
}: TreeSelectProps<ValueType, OptionType>,
ref: React.Ref<BaseSelectRef>,
@ -220,12 +222,12 @@ const InternalTreeSelect = <
}
// ==================== Render =====================
const selectProps = omit(props as typeof props & { itemIcon: any; switcherIcon: any }, [
const selectProps = omit(props, [
'suffixIcon',
'itemIcon',
'removeIcon',
'clearIcon',
'switcherIcon',
'itemIcon' as any,
'switcherIcon' as any,
]);
// ===================== Placement =====================
@ -273,7 +275,7 @@ const InternalTreeSelect = <
);
// ============================ zIndex ============================
const [zIndex] = useZIndex('SelectLike', props.dropdownStyle?.zIndex as number);
const [zIndex] = useZIndex('SelectLike', dropdownStyle?.zIndex as number);
const returnNode = (
<RcTreeSelect
@ -302,13 +304,11 @@ const InternalTreeSelect = <
getPopupContainer={getPopupContainer || getContextPopupContainer}
treeMotion={null}
dropdownClassName={mergedDropdownClassName}
dropdownStyle={{
...props.dropdownStyle,
zIndex,
}}
dropdownStyle={{ ...dropdownStyle, zIndex }}
choiceTransitionName={getTransitionName(rootPrefixCls, '', choiceTransitionName)}
transitionName={getTransitionName(rootPrefixCls, 'slide-up', transitionName)}
treeExpandAction={treeExpandAction}
tagRender={tagRender}
/>
);

View File

@ -117,15 +117,15 @@
"@ant-design/cssinjs": "^1.18.2",
"@ant-design/icons": "^5.2.6",
"@ant-design/react-slick": "~1.0.2",
"@babel/runtime": "^7.23.4",
"@babel/runtime": "^7.23.6",
"@ctrl/tinycolor": "^3.6.1",
"@rc-component/color-picker": "~1.4.1",
"@rc-component/mutate-observer": "^1.1.0",
"@rc-component/tour": "~1.12.0",
"@rc-component/trigger": "^1.18.2",
"classnames": "^2.3.2",
"classnames": "^2.4.0",
"copy-to-clipboard": "^3.3.3",
"dayjs": "^1.11.1",
"dayjs": "^1.11.10",
"qrcode.react": "^3.1.0",
"rc-cascader": "~3.20.0",
"rc-checkbox": "~3.1.0",
@ -345,11 +345,11 @@
"size-limit": [
{
"path": "./dist/antd.min.js",
"limit": "330 KiB"
"limit": "331 KiB"
},
{
"path": "./dist/antd-with-locales.min.js",
"limit": "376 KiB"
"limit": "377 KiB"
}
],
"title": "Ant Design",