Browse Source

chore: auto merge branches (#40843)

chore: feature merge master
pull/40857/head
github-actions[bot] 2 years ago
committed by GitHub
parent
commit
6fc08687ae
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      .dumi/theme/builtins/Previewer/CodePreviewer.tsx
  2. 2
      components/rate/style/index.tsx
  3. 5
      components/timeline/TimelineItemList.tsx
  4. 15
      components/timeline/__tests__/index.test.tsx
  5. 8
      components/upload/demo/drag-sorting.tsx
  6. 1
      docs/spec/visual.en-US.md
  7. 2
      docs/spec/visual.zh-CN.md

15
.dumi/theme/builtins/Previewer/CodePreviewer.tsx

@ -305,9 +305,9 @@ const CodePreviewer: React.FC<IPreviewerProps> = (props) => {
parsedSourceCode = parsedSourceCode.replace(importReactReg, '').trim();
}
const demoJsContent = `
${importReactContent}
import './index.css';
${parsedSourceCode}
${importReactContent}
import './index.css';
${parsedSourceCode}
`.trim();
const indexCssContent = (style || '')
.trim()
@ -315,12 +315,11 @@ const CodePreviewer: React.FC<IPreviewerProps> = (props) => {
.replace('</style>', '')
.replace('<style>', '');
const indexJsContent = `
import React from 'react';
import { createRoot } from 'react-dom/client';
import Demo from './demo';
const indexJsContent = `import React from 'react';
import { createRoot } from 'react-dom/client';
import Demo from './demo';
createRoot(document.getElementById('container')).render(<Demo />);
createRoot(document.getElementById('container')).render(<Demo />);
`;
const codesandboxPackage = {

2
components/rate/style/index.tsx

@ -100,7 +100,7 @@ const genRateStyle: GenerateStyle<RateToken> = (token) => {
[`&-disabled${componentCls} ${componentCls}-star`]: {
cursor: 'default',
'&:hover': {
'> div:hover': {
transform: 'scale(1)',
},
},

5
components/timeline/TimelineItemList.tsx

@ -52,13 +52,16 @@ const TimelineItemList: React.FC<TimelineProps & { hashId: string; direction?: s
.map((item: TimelineItemProps, idx: number) => {
const pendingClass = idx === itemsCount - 2 ? lastCls : '';
const readyClass = idx === itemsCount - 1 ? lastCls : '';
const { className: itemClassName, ...itemProps } = item;
return (
<TimelineItem
{...itemProps}
className={classNames([
itemClassName,
!reverse && !!pending ? pendingClass : readyClass,
getPositionCls(item?.position ?? '', idx),
])}
{...item}
/* eslint-disable-next-line react/no-array-index-key */
key={item?.key || idx}
/>

15
components/timeline/__tests__/index.test.tsx

@ -215,6 +215,21 @@ describe('TimeLine', () => {
expect(container.querySelectorAll('li.ant-timeline-item')[0]).not.toHaveClass('timelineBox');
});
it('TimeLineItem className should correctly', () => {
const { container } = render(
<TimeLine
items={[
{
className: 'test',
children: 'foo',
},
]}
/>,
);
expect(container.querySelector('.test')).not.toBeNull();
});
describe('prop: color', () => {
const presetColors = ['blue', 'red', 'green', 'gray'];

8
components/upload/demo/drag-sorting.tsx

@ -1,6 +1,6 @@
import { UploadOutlined } from '@ant-design/icons';
import type { DragEndEvent } from '@dnd-kit/core';
import { DndContext } from '@dnd-kit/core';
import { DndContext, PointerSensor, useSensor } from '@dnd-kit/core';
import {
arrayMove,
SortableContext,
@ -79,6 +79,10 @@ const App: React.FC = () => {
},
]);
const sensor = useSensor(PointerSensor, {
activationConstraint: { distance: 10 },
});
const onDragEnd = ({ active, over }: DragEndEvent) => {
if (active.id !== over?.id) {
setFileList((prev) => {
@ -94,7 +98,7 @@ const App: React.FC = () => {
};
return (
<DndContext onDragEnd={onDragEnd}>
<DndContext sensors={[sensor]} onDragEnd={onDragEnd}>
<SortableContext items={fileList.map((i) => i.uid)} strategy={verticalListSortingStrategy}>
<Upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"

1
docs/spec/visual.en-US.md

@ -24,3 +24,4 @@ We encapsulate a set of AntV component libraries based on native JavaScript, whi
- [G6: Graph Visualization Framework](https://g6.antv.vision/en)
- [F2: Mobile Charts](https://f2.antv.vision/en)
- [L7: Geospatial Visualization Analysis](https://l7.antv.vision/en)
- [React AntV](https://charts.ant.design/en)

2
docs/spec/visual.zh-CN.md

@ -13,10 +13,10 @@ title: 可视化
- [G2 可视化引擎](https://g2.antv.vision/zh)
- [G2Plot 开箱即用的图表库](https://g2plot.antv.vision/zh) 🔥
- [G2Plot React 版](https://charts.ant.design)
- [G6 图可视化引擎](https://g6.antv.vision/zh)
- [L7 地理空间数据可视分析引擎](https://l7.antv.vision/zh)
- [F2 移动端可视化方案](https://f2.antv.vision/zh)
- [AntV React 版](https://charts.ant.design)
## 如何设计

Loading…
Cancel
Save