mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
chore: sync feature into next
This commit is contained in:
4
.github/workflows/preview-deploy.yml
vendored
4
.github/workflows/preview-deploy.yml
vendored
@@ -61,7 +61,7 @@ jobs:
|
||||
steps:
|
||||
# We need get PR id first
|
||||
- name: download pr artifact
|
||||
uses: dawidd6/action-download-artifact@v10
|
||||
uses: dawidd6/action-download-artifact@v11
|
||||
with:
|
||||
workflow: ${{ github.event.workflow_run.workflow_id }}
|
||||
run_id: ${{ github.event.workflow_run.id }}
|
||||
@@ -81,7 +81,7 @@ jobs:
|
||||
# Download site artifact
|
||||
- name: download site artifact
|
||||
if: ${{ fromJSON(needs.upstream-workflow-summary.outputs.build-success) }}
|
||||
uses: dawidd6/action-download-artifact@v10
|
||||
uses: dawidd6/action-download-artifact@v11
|
||||
with:
|
||||
workflow: ${{ github.event.workflow_run.workflow_id }}
|
||||
run_id: ${{ github.event.workflow_run.id }}
|
||||
|
||||
2
.github/workflows/site-deploy.yml
vendored
2
.github/workflows/site-deploy.yml
vendored
@@ -117,7 +117,7 @@ jobs:
|
||||
cd ..
|
||||
|
||||
- name: Upload to Release
|
||||
uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
|
||||
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
|
||||
with:
|
||||
fail_on_unmatched_files: true
|
||||
files: website.tar.gz
|
||||
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
|
||||
# We need get persist-index first
|
||||
- name: download image snapshot artifact
|
||||
uses: dawidd6/action-download-artifact@v10
|
||||
uses: dawidd6/action-download-artifact@v11
|
||||
with:
|
||||
workflow: ${{ github.event.workflow_run.workflow_id }}
|
||||
run_id: ${{ github.event.workflow_run.id }}
|
||||
@@ -90,7 +90,7 @@ jobs:
|
||||
- name: download report artifact
|
||||
id: download_report
|
||||
if: ${{ needs.upstream-workflow-summary.outputs.build-status == 'success' || needs.upstream-workflow-summary.outputs.build-status == 'failure' }}
|
||||
uses: dawidd6/action-download-artifact@v10
|
||||
uses: dawidd6/action-download-artifact@v11
|
||||
with:
|
||||
workflow: ${{ github.event.workflow_run.workflow_id }}
|
||||
run_id: ${{ github.event.workflow_run.id }}
|
||||
|
||||
@@ -65,7 +65,7 @@ jobs:
|
||||
|
||||
# We need get persist key first
|
||||
- name: Download Visual Regression Ref
|
||||
uses: dawidd6/action-download-artifact@v10
|
||||
uses: dawidd6/action-download-artifact@v11
|
||||
with:
|
||||
workflow: ${{ github.event.workflow_run.workflow_id }}
|
||||
run_id: ${{ github.event.workflow_run.id }}
|
||||
@@ -79,7 +79,7 @@ jobs:
|
||||
|
||||
- name: Download Visual-Regression Artifact
|
||||
if: ${{ fromJSON(needs.upstream-workflow-summary.outputs.build-success) }}
|
||||
uses: dawidd6/action-download-artifact@v10
|
||||
uses: dawidd6/action-download-artifact@v11
|
||||
with:
|
||||
workflow: ${{ github.event.workflow_run.workflow_id }}
|
||||
run_id: ${{ github.event.workflow_run.id }}
|
||||
|
||||
@@ -710,7 +710,7 @@ exports[`renders components/cascader/demo/custom-render.tsx extend context corre
|
||||
<div
|
||||
class="ant-cascader-menu-item-content"
|
||||
>
|
||||
Zhejiang
|
||||
Zhejiang (zhejiang)
|
||||
</div>
|
||||
<div
|
||||
class="ant-cascader-menu-item-expand-icon"
|
||||
@@ -746,7 +746,7 @@ exports[`renders components/cascader/demo/custom-render.tsx extend context corre
|
||||
<div
|
||||
class="ant-cascader-menu-item-content"
|
||||
>
|
||||
Jiangsu
|
||||
Jiangsu (jiangsu)
|
||||
</div>
|
||||
<div
|
||||
class="ant-cascader-menu-item-expand-icon"
|
||||
|
||||
@@ -76,6 +76,12 @@ const App: React.FC = () => (
|
||||
defaultValue={['zhejiang', 'hangzhou', 'xihu']}
|
||||
displayRender={displayRender}
|
||||
style={{ width: '100%' }}
|
||||
// `optionRender` is supported since 5.16.0
|
||||
optionRender={(option) => (
|
||||
<>
|
||||
{option.label} ({option.value})
|
||||
</>
|
||||
)}
|
||||
/>
|
||||
);
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import React from 'react';
|
||||
import { DownOutlined } from '@ant-design/icons';
|
||||
import { DatePicker, Dropdown, Space } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
|
||||
const App: React.FC = () => {
|
||||
const DatePickerDemo: React.FC = () => {
|
||||
const [visible, setVisible] = React.useState(false);
|
||||
const [panelVisible, setPanelVisible] = React.useState(false);
|
||||
|
||||
const [date, setDate] = React.useState(dayjs());
|
||||
const [date, setDate] = React.useState<Dayjs | null>(dayjs());
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
@@ -43,7 +43,7 @@ const App: React.FC = () => {
|
||||
key: 'custom-date',
|
||||
label: (
|
||||
<div
|
||||
style={{ position: 'relative' }}
|
||||
style={{ position: 'relative', overflow: 'hidden' }}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
setPanelVisible(true);
|
||||
@@ -54,17 +54,18 @@ const App: React.FC = () => {
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
}}
|
||||
style={{
|
||||
height: 0,
|
||||
width: 0,
|
||||
overflow: 'hidden',
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
insetInlineStart: 0,
|
||||
}}
|
||||
>
|
||||
<DatePicker
|
||||
open={panelVisible}
|
||||
styles={{
|
||||
root: {
|
||||
pointerEvents: 'none',
|
||||
opacity: 0,
|
||||
position: 'absolute',
|
||||
bottom: -12,
|
||||
insetInlineStart: 0,
|
||||
},
|
||||
}}
|
||||
onChange={(date) => {
|
||||
setDate(date);
|
||||
setVisible(false);
|
||||
@@ -79,11 +80,119 @@ const App: React.FC = () => {
|
||||
}}
|
||||
>
|
||||
<Space>
|
||||
<span>{date.format('YYYY-MM-DD')}</span>
|
||||
<span>{date?.format('YYYY-MM-DD')}</span>
|
||||
<DownOutlined />
|
||||
</Space>
|
||||
</Dropdown>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
const RangePickerDemo: React.FC = () => {
|
||||
const [visible, setVisible] = React.useState(false);
|
||||
const [panelVisible, setPanelVisible] = React.useState(false);
|
||||
|
||||
const [dates, setDates] = React.useState<[Dayjs, Dayjs] | null>([dayjs(), dayjs().add(1, 'day')]);
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
arrow
|
||||
open={visible}
|
||||
trigger={['click']}
|
||||
destroyOnHidden
|
||||
onOpenChange={(open) => {
|
||||
setVisible(open);
|
||||
if (!open) {
|
||||
setPanelVisible(false);
|
||||
}
|
||||
}}
|
||||
menu={{
|
||||
items: [
|
||||
{
|
||||
key: '7',
|
||||
label: '7 days',
|
||||
onClick() {
|
||||
setDates([dayjs(), dayjs().add(7, 'day')]);
|
||||
setVisible(false);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: '30',
|
||||
label: '30 days',
|
||||
onClick() {
|
||||
setDates([dayjs(), dayjs().add(30, 'day')]);
|
||||
setVisible(false);
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'custom-date',
|
||||
label: (
|
||||
<div
|
||||
style={{ position: 'relative', overflow: 'hidden' }}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
setPanelVisible(true);
|
||||
}}
|
||||
>
|
||||
<div>Customize</div>
|
||||
<div
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
}}
|
||||
>
|
||||
<DatePicker.RangePicker
|
||||
open={panelVisible}
|
||||
styles={{
|
||||
root: {
|
||||
pointerEvents: 'none',
|
||||
opacity: 0,
|
||||
position: 'absolute',
|
||||
bottom: 0, // RangePicker use this style
|
||||
insetInlineStart: 0,
|
||||
},
|
||||
}}
|
||||
onChange={(ranges) => {
|
||||
if (ranges?.[0] && ranges?.[1]) {
|
||||
setDates([ranges[0], ranges[1]]);
|
||||
} else {
|
||||
setDates(null);
|
||||
}
|
||||
setVisible(false);
|
||||
setPanelVisible(false);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
],
|
||||
}}
|
||||
>
|
||||
<Space>
|
||||
<span>
|
||||
{dates
|
||||
? `${dates[0].format('YYYY-MM-DD')} ~ ${dates[1].format('YYYY-MM-DD')}`
|
||||
: 'Select range'}
|
||||
</span>
|
||||
<DownOutlined />
|
||||
</Space>
|
||||
</Dropdown>
|
||||
);
|
||||
};
|
||||
|
||||
const Demo = () => {
|
||||
return (
|
||||
<div style={{ display: 'flex', gap: '20%' }}>
|
||||
<div>
|
||||
<div style={{ marginBottom: 12 }}>DatePicker</div>
|
||||
<DatePickerDemo />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div style={{ marginBottom: 12 }}>RangePicker</div>
|
||||
<RangePickerDemo />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Demo;
|
||||
|
||||
@@ -3,7 +3,11 @@ import type {
|
||||
PickerProps as RcPickerProps,
|
||||
RangePickerProps as RcRangePickerProps,
|
||||
} from '@rc-component/picker';
|
||||
import type { Locale as RcPickerLocale } from '@rc-component/picker/lib/interface';
|
||||
import type {
|
||||
PanelSemanticName as PopupSemantic,
|
||||
Locale as RcPickerLocale,
|
||||
SemanticName,
|
||||
} from '@rc-component/picker/lib/interface';
|
||||
|
||||
import type { InputStatus } from '../../_util/statusUtils';
|
||||
import type { AnyObject } from '../../_util/type';
|
||||
@@ -61,6 +65,15 @@ export type PickerClassNames = Omit<NonNullable<RcPickerProps['classNames']>, 'p
|
||||
popup?: string | NonNullable<RcPickerProps['classNames']>['popup'];
|
||||
};
|
||||
|
||||
export type RequiredSemanticPicker = readonly [
|
||||
classNames: Required<Record<SemanticName, string>> & {
|
||||
popup: Required<Record<PopupSemantic, string>>;
|
||||
},
|
||||
styles: Required<Record<SemanticName, React.CSSProperties>> & {
|
||||
popup: Required<Record<PopupSemantic, React.CSSProperties>>;
|
||||
},
|
||||
];
|
||||
|
||||
type InjectDefaultProps<Props> = Omit<
|
||||
Props,
|
||||
'locale' | 'generateConfig' | 'hideHeader' | 'classNames'
|
||||
|
||||
@@ -4,11 +4,10 @@ import cls from 'classnames';
|
||||
|
||||
import useMergeSemantic from '../../_util/hooks/useMergeSemantic';
|
||||
import { useComponentConfig } from '../../config-provider/context';
|
||||
import type { PickerClassNames } from '../generatePicker/interface';
|
||||
|
||||
import type { RequiredSemanticPicker } from '../generatePicker/interface';
|
||||
const useMergedPickerSemantic = (
|
||||
pickerType: 'timePicker' | 'datePicker',
|
||||
classNames?: PickerClassNames,
|
||||
classNames?: PickerProps['classNames'],
|
||||
styles?: PickerProps['styles'],
|
||||
popupClassName?: string,
|
||||
popupStyle?: React.CSSProperties,
|
||||
@@ -48,7 +47,7 @@ const useMergedPickerSemantic = (
|
||||
};
|
||||
|
||||
// Return
|
||||
return [filledClassNames, filledStyles] as const;
|
||||
return [filledClassNames, filledStyles] as RequiredSemanticPicker;
|
||||
}, [mergedClassNames, mergedStyles, popupClassName, popupStyle]);
|
||||
};
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
"Alexey Yakovlev",
|
||||
"Alfred Qiu",
|
||||
"Ali Zhdanov",
|
||||
"AliReza Kamkar",
|
||||
"AliRezaBeigy",
|
||||
"Aliaksandr",
|
||||
"Alina Andrieieva",
|
||||
@@ -67,6 +68,7 @@
|
||||
"Andre Zyczkowski",
|
||||
"Andrea Blanco",
|
||||
"Andrew Blakey",
|
||||
"Andrew Hong",
|
||||
"Andrew Horn",
|
||||
"Andrew Murray",
|
||||
"Andrew Shearer",
|
||||
@@ -146,7 +148,6 @@
|
||||
"Carlos Coves Prieto",
|
||||
"Carter Feldman",
|
||||
"Caspian Chen",
|
||||
"Cat-XHS",
|
||||
"Catalin Miron",
|
||||
"Cedong.Lee",
|
||||
"Cee Cirno",
|
||||
@@ -462,6 +463,7 @@
|
||||
"Jiahao",
|
||||
"Jiajun Chen",
|
||||
"Jialei",
|
||||
"Jianan Li",
|
||||
"Jiawei Huang",
|
||||
"Jichao Zhong",
|
||||
"Jiehui",
|
||||
@@ -494,7 +496,6 @@
|
||||
"Jonathan Gabaut",
|
||||
"Jonathan Lee",
|
||||
"Jonny Buchanan",
|
||||
"Jony J",
|
||||
"Joo Wu",
|
||||
"Jordan Hornblow",
|
||||
"Jorge Luis Moreno Moller",
|
||||
@@ -796,6 +797,7 @@
|
||||
"QingLance",
|
||||
"Qingrong Ke",
|
||||
"QoVoQ",
|
||||
"QuentinHsu",
|
||||
"Radomir Skrzepij",
|
||||
"Rafael Carvalho",
|
||||
"Rafael Cosman",
|
||||
@@ -804,6 +806,7 @@
|
||||
"Rain120",
|
||||
"Rainey",
|
||||
"Rainy",
|
||||
"Rajan Konar",
|
||||
"Rajasekhar Gandavarapu",
|
||||
"Rajil Bajracharya",
|
||||
"Rallets",
|
||||
@@ -886,6 +889,7 @@
|
||||
"Shengnan",
|
||||
"Sheralijon",
|
||||
"ShiTengFei",
|
||||
"Shinji-Li",
|
||||
"ShuYu Wang",
|
||||
"Shubham Kanodia",
|
||||
"Shun",
|
||||
@@ -1124,6 +1128,7 @@
|
||||
"alexchen",
|
||||
"amedora",
|
||||
"anilpixel",
|
||||
"aojunhao123",
|
||||
"aoxiang78",
|
||||
"appleshell",
|
||||
"arange",
|
||||
@@ -1153,6 +1158,7 @@
|
||||
"byuanama",
|
||||
"byzyk",
|
||||
"bzone",
|
||||
"caijf",
|
||||
"caoyi",
|
||||
"capdiem",
|
||||
"carrie-tanminyi",
|
||||
@@ -1206,6 +1212,7 @@
|
||||
"digz6666",
|
||||
"dingkang",
|
||||
"djorkaeff",
|
||||
"doandevhere",
|
||||
"dolfje",
|
||||
"dongfang",
|
||||
"douxc",
|
||||
@@ -1230,6 +1237,7 @@
|
||||
"flashback313",
|
||||
"flyerH",
|
||||
"flyflydogdog",
|
||||
"fnoopv",
|
||||
"frezc",
|
||||
"fubd",
|
||||
"gaokaifeis",
|
||||
@@ -1327,7 +1335,7 @@
|
||||
"kermolaev",
|
||||
"killa",
|
||||
"kily zhou",
|
||||
"kiner-tang",
|
||||
"kiner-tang(星河)",
|
||||
"klouskingsley",
|
||||
"ko",
|
||||
"konakona",
|
||||
|
||||
@@ -141,7 +141,7 @@ export default App;
|
||||
| --- | --- | --- |
|
||||
| `@btn-font-weight` | `fontWeight` | - |
|
||||
| `@btn-border-radius-base` | `borderRadius` | Global Token |
|
||||
| `@btn-border-radius-sm` | `borderRadisuSM` | Global Token |
|
||||
| `@btn-border-radius-sm` | `borderRadiusSM` | Global Token |
|
||||
| `@btn-border-width` | `lineWidth` | Global Token |
|
||||
| `@btn-border-style` | `lineStyle` | Global Token |
|
||||
| `@btn-shadow` | `defaultShadow` | - |
|
||||
@@ -606,8 +606,8 @@ export default App;
|
||||
| `@radio-button-hover-color` | `colorPrimaryHover` | Global Token |
|
||||
| `@radio-button-active-color` | `colorPrimaryActive` | Global Token |
|
||||
| `@radio-button-padding-horizontal` | `buttonPaddingInline` | - |
|
||||
| `@radio-disabled-button-checked-bg` | `buttonCheckdBgDisabled` | - |
|
||||
| `@radio-disabled-button-checked-color` | `buttonCheckdColorDisabled` | - |
|
||||
| `@radio-disabled-button-checked-bg` | `buttonCheckedBgDisabled` | - |
|
||||
| `@radio-disabled-button-checked-color` | `buttonCheckedColorDisabled` | - |
|
||||
| `@radio-wrapper-margin-right` | `wrapperMarginInlineEnd` | - |
|
||||
|
||||
### Rate
|
||||
|
||||
@@ -141,7 +141,7 @@ export default App;
|
||||
| --- | --- | --- |
|
||||
| `@btn-font-weight` | `fontWeight` | - |
|
||||
| `@btn-border-radius-base` | `borderRadius` | 全局 Token |
|
||||
| `@btn-border-radius-sm` | `borderRadisuSM` | 全局 Token |
|
||||
| `@btn-border-radius-sm` | `borderRadiusSM` | 全局 Token |
|
||||
| `@btn-border-width` | `lineWidth` | 全局 Token |
|
||||
| `@btn-border-style` | `lineStyle` | 全局 Token |
|
||||
| `@btn-shadow` | `defaultShadow` | - |
|
||||
@@ -605,8 +605,8 @@ Mentions 提及
|
||||
| `@radio-button-hover-color` | `colorPrimaryHover` | 全局 Token |
|
||||
| `@radio-button-active-color` | `colorPrimaryActive` | 全局 Token |
|
||||
| `@radio-button-padding-horizontal` | `buttonPaddingInline` | - |
|
||||
| `@radio-disabled-button-checked-bg` | `buttonCheckdBgDisabled` | - |
|
||||
| `@radio-disabled-button-checked-color` | `buttonCheckdColorDisabled` | - |
|
||||
| `@radio-disabled-button-checked-bg` | `buttonCheckedBgDisabled` | - |
|
||||
| `@radio-disabled-button-checked-color` | `buttonCheckedColorDisabled` | - |
|
||||
| `@radio-wrapper-margin-right` | `wrapperMarginInlineEnd` | - |
|
||||
|
||||
### Rate 评分
|
||||
|
||||
@@ -259,11 +259,11 @@
|
||||
"immer": "^10.1.1",
|
||||
"is-ci": "^4.0.0",
|
||||
"isomorphic-fetch": "^3.0.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest": "^30.0.0",
|
||||
"jest-axe": "^10.0.0",
|
||||
"jest-canvas-mock": "^2.5.2",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
"jest-environment-node": "^29.7.0",
|
||||
"jest-environment-node": "^30.0.0",
|
||||
"jest-image-snapshot": "^6.4.0",
|
||||
"jest-puppeteer": "^11.0.0",
|
||||
"jquery": "^3.7.1",
|
||||
@@ -325,7 +325,7 @@
|
||||
"tar": "^7.4.3",
|
||||
"tar-fs": "^3.0.6",
|
||||
"terser": "^5.36.0",
|
||||
"tsx": "~4.19.2",
|
||||
"tsx": "~4.20.3",
|
||||
"typedoc": "^0.28.0",
|
||||
"typescript": "~5.8.2",
|
||||
"vanilla-jsoneditor": "^3.0.0",
|
||||
@@ -355,16 +355,13 @@
|
||||
},
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"brace-expansion": "2.0.1",
|
||||
"nwsapi": "2.2.20"
|
||||
}
|
||||
},
|
||||
"overrides": {
|
||||
"brace-expansion": "2.0.1",
|
||||
"nwsapi": "2.2.20"
|
||||
},
|
||||
"resolutions": {
|
||||
"brace-expansion": "2.0.1",
|
||||
"nwsapi": "2.2.20"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user