Skip to content

Commit

Permalink
Merge branch 'feature' into feat-select-maxCount
Browse files Browse the repository at this point in the history
  • Loading branch information
li-jia-nan committed Jan 2, 2024
2 parents c593317 + bfda8ce commit cd957a8
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 38 deletions.
14 changes: 6 additions & 8 deletions components/calendar/__tests__/select.test.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import Dayjs from 'dayjs';

import 'dayjs/locale/zh-cn';
import MockDate from 'mockdate';
import { resetWarned } from 'rc-util/lib/warning';

import React from 'react';
import { resetWarned } from 'rc-util/lib/warning';

import Calendar from '..';
import { fireEvent, render, waitFakeTimer } from '../../../tests/utils';

describe('Calendar.onSelect', () => {
beforeAll(() => {
MockDate.set(Dayjs('2000-01-01').valueOf());
});

beforeEach(() => {
resetWarned();
jest.useFakeTimers();
jest.clearAllTimers();
jest.useFakeTimers().setSystemTime(new Date('2000-02-01'));
});

afterEach(() => {
jest.clearAllTimers();
jest.useRealTimers();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1645,7 +1645,7 @@ exports[`renders components/layout/demo/fixed.tsx extend context correctly 1`] =
class="ant-layout-footer"
style="text-align: center;"
>
Ant Design ©2023 Created by Ant UED
Ant Design ©2016 Created by Ant UED
</footer>
</div>
`;
Expand Down Expand Up @@ -2436,7 +2436,7 @@ exports[`renders components/layout/demo/fixed-sider.tsx extend context correctly
class="ant-layout-footer"
style="text-align: center;"
>
Ant Design ©2023 Created by Ant UED
Ant Design ©2016 Created by Ant UED
</footer>
</div>
</div>
Expand Down Expand Up @@ -2796,7 +2796,7 @@ exports[`renders components/layout/demo/responsive.tsx extend context correctly
class="ant-layout-footer"
style="text-align: center;"
>
Ant Design ©2023 Created by Ant UED
Ant Design ©2016 Created by Ant UED
</footer>
</div>
</div>
Expand Down Expand Up @@ -3448,7 +3448,7 @@ exports[`renders components/layout/demo/side.tsx extend context correctly 1`] =
class="ant-layout-footer"
style="text-align: center;"
>
Ant Design ©2023 Created by Ant UED
Ant Design ©2016 Created by Ant UED
</footer>
</div>
</div>
Expand Down Expand Up @@ -4280,7 +4280,7 @@ exports[`renders components/layout/demo/top.tsx extend context correctly 1`] = `
class="ant-layout-footer"
style="text-align: center;"
>
Ant Design ©2023 Created by Ant UED
Ant Design ©2016 Created by Ant UED
</footer>
</div>
`;
Expand Down Expand Up @@ -5443,7 +5443,7 @@ exports[`renders components/layout/demo/top-side.tsx extend context correctly 1`
class="ant-layout-footer"
style="text-align: center;"
>
Ant Design ©2023 Created by Ant UED
Ant Design ©2016 Created by Ant UED
</footer>
</div>
`;
Expand Down
36 changes: 30 additions & 6 deletions components/layout/__tests__/__snapshots__/demo.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,11 @@ exports[`renders components/layout/demo/fixed.tsx correctly 1`] = `
class="ant-layout-footer"
style="text-align:center"
>
Ant Design ©2023 Created by Ant UED
Ant Design ©
<!-- -->
2016
<!-- -->
Created by Ant UED
</footer>
</div>
`;
Expand Down Expand Up @@ -1236,7 +1240,11 @@ exports[`renders components/layout/demo/fixed-sider.tsx correctly 1`] = `
class="ant-layout-footer"
style="text-align:center"
>
Ant Design ©2023 Created by Ant UED
Ant Design ©
<!-- -->
2016
<!-- -->
Created by Ant UED
</footer>
</div>
</div>
Expand Down Expand Up @@ -1414,7 +1422,11 @@ exports[`renders components/layout/demo/responsive.tsx correctly 1`] = `
class="ant-layout-footer"
style="text-align:center"
>
Ant Design ©2023 Created by Ant UED
Ant Design ©
<!-- -->
2016
<!-- -->
Created by Ant UED
</footer>
</div>
</div>
Expand Down Expand Up @@ -1695,7 +1707,11 @@ exports[`renders components/layout/demo/side.tsx correctly 1`] = `
class="ant-layout-footer"
style="text-align:center"
>
Ant Design ©2023 Created by Ant UED
Ant Design ©
<!-- -->
2016
<!-- -->
Created by Ant UED
</footer>
</div>
</div>
Expand Down Expand Up @@ -1996,7 +2012,11 @@ exports[`renders components/layout/demo/top.tsx correctly 1`] = `
class="ant-layout-footer"
style="text-align:center"
>
Ant Design ©2023 Created by Ant UED
Ant Design ©
<!-- -->
2016
<!-- -->
Created by Ant UED
</footer>
</div>
`;
Expand Down Expand Up @@ -2356,7 +2376,11 @@ exports[`renders components/layout/demo/top-side.tsx correctly 1`] = `
class="ant-layout-footer"
style="text-align:center"
>
Ant Design ©2023 Created by Ant UED
Ant Design ©
<!-- -->
2016
<!-- -->
Created by Ant UED
</footer>
</div>
`;
Expand Down
13 changes: 4 additions & 9 deletions components/layout/demo/fixed-sider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,7 @@ const App: React.FC = () => {
return (
<Layout hasSider>
<Sider
style={{
overflow: 'auto',
height: '100vh',
position: 'fixed',
left: 0,
top: 0,
bottom: 0,
}}
style={{ overflow: 'auto', height: '100vh', position: 'fixed', left: 0, top: 0, bottom: 0 }}
>
<div className="demo-logo-vertical" />
<Menu theme="dark" mode="inline" defaultSelectedKeys={['4']} items={items} />
Expand Down Expand Up @@ -72,7 +65,9 @@ const App: React.FC = () => {
}
</div>
</Content>
<Footer style={{ textAlign: 'center' }}>Ant Design ©2023 Created by Ant UED</Footer>
<Footer style={{ textAlign: 'center' }}>
Ant Design ©{new Date().getFullYear()} Created by Ant UED
</Footer>
</Layout>
</Layout>
);
Expand Down
4 changes: 3 additions & 1 deletion components/layout/demo/fixed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ const App: React.FC = () => {
Content
</div>
</Content>
<Footer style={{ textAlign: 'center' }}>Ant Design ©2023 Created by Ant UED</Footer>
<Footer style={{ textAlign: 'center' }}>
Ant Design ©{new Date().getFullYear()} Created by Ant UED
</Footer>
</Layout>
);
};
Expand Down
4 changes: 3 additions & 1 deletion components/layout/demo/responsive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ const App: React.FC = () => {
content
</div>
</Content>
<Footer style={{ textAlign: 'center' }}>Ant Design ©2023 Created by Ant UED</Footer>
<Footer style={{ textAlign: 'center' }}>
Ant Design ©{new Date().getFullYear()} Created by Ant UED
</Footer>
</Layout>
</Layout>
);
Expand Down
4 changes: 3 additions & 1 deletion components/layout/demo/side.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ const App: React.FC = () => {
Bill is a cat.
</div>
</Content>
<Footer style={{ textAlign: 'center' }}>Ant Design ©2023 Created by Ant UED</Footer>
<Footer style={{ textAlign: 'center' }}>
Ant Design ©{new Date().getFullYear()} Created by Ant UED
</Footer>
</Layout>
</Layout>
);
Expand Down
4 changes: 3 additions & 1 deletion components/layout/demo/top-side.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ const App: React.FC = () => {
<Content style={{ padding: '0 24px', minHeight: 280 }}>Content</Content>
</Layout>
</Content>
<Footer style={{ textAlign: 'center' }}>Ant Design ©2023 Created by Ant UED</Footer>
<Footer style={{ textAlign: 'center' }}>
Ant Design ©{new Date().getFullYear()} Created by Ant UED
</Footer>
</Layout>
);
};
Expand Down
4 changes: 3 additions & 1 deletion components/layout/demo/top.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ const App: React.FC = () => {
Content
</div>
</Content>
<Footer style={{ textAlign: 'center' }}>Ant Design ©2023 Created by Ant UED</Footer>
<Footer style={{ textAlign: 'center' }}>
Ant Design ©{new Date().getFullYear()} Created by Ant UED
</Footer>
</Layout>
);
};
Expand Down
4 changes: 2 additions & 2 deletions components/watermark/useWatermark.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const BaseSize = 2;
export const FontGap = 3;

// Prevent external hidden elements from adding accent styles
const EmphasizedStyles = {
const emphasizedStyle = {
visibility: 'visible !important',
};

Expand Down Expand Up @@ -44,7 +44,7 @@ export default function useWatermark(
...markStyle,
backgroundImage: `url('${base64Url}')`,
backgroundSize: `${Math.floor(markWidth)}px`,
...(EmphasizedStyles as React.CSSProperties),
...(emphasizedStyle as React.CSSProperties),
}),
);
// Prevents using the browser `Hide Element` to hide watermarks
Expand Down
4 changes: 2 additions & 2 deletions components/watermark/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export function getPixelRatio() {
}

/** Whether to re-render the watermark */
export const reRendering = (mutation: MutationRecord, isWatermarkEle: (ele: any) => boolean) => {
export const reRendering = (mutation: MutationRecord, isWatermarkEle: (ele: Node) => boolean) => {
let flag = false;
// Whether to delete the watermark node
if (mutation.removedNodes.length) {
flag = Array.from(mutation.removedNodes).some((node) => isWatermarkEle(node));
flag = Array.from<Node>(mutation.removedNodes).some((node) => isWatermarkEle(node));
}
// Whether the watermark dom property value has been modified
if (mutation.type === 'attributes' && isWatermarkEle(mutation.target)) {
Expand Down

0 comments on commit cd957a8

Please sign in to comment.