Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: jumper 更名为 paginationMini 组件 #1749

Merged
merged 4 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@
"dayjs": "~1.11.4",
"hoist-non-react-statics": "~3.3.2",
"lodash": "~4.17.15",
"mitt": "^3.0.0",
"raf": "~3.4.1",
"react-is": "^18.2.0",
"react-popper": "~2.3.0",
Expand Down
6 changes: 0 additions & 6 deletions site/site.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,6 @@ export default {
path: '/react/components/dropdown',
component: () => import('tdesign-react/dropdown/dropdown.md'),
},
{
title: 'Jumper 跳转',
name: 'jumper',
path: '/react/components/jumper',
component: () => import('tdesign-react/jumper/jumper.md'),
},
{
title: 'Menu 导航',
name: 'menu',
Expand Down
6 changes: 3 additions & 3 deletions src/date-picker/base/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { useLocaleReceiver } from '../../locale/LocalReceiver';
import useConfig from '../../hooks/useConfig';
import Select from '../../select';
import { TdDatePickerProps } from '../type';
import Jumper, { TdJumperProps } from '../../jumper';
import { PaginationMini, TdPaginationMiniProps } from '../../pagination';

export interface DatePickerHeaderProps extends Pick<TdDatePickerProps, 'mode'> {
year?: number;
month?: number;
onMonthChange?: Function;
onYearChange?: Function;
onJumperClick?: TdJumperProps['onChange'];
onJumperClick?: TdPaginationMiniProps['onChange'];
}

const useDatePickerLocalConfig = () => {
Expand Down Expand Up @@ -221,7 +221,7 @@ const DatePickerHeader = (props: DatePickerHeaderProps) => {
/>
</div>

<Jumper tips={labelMap[mode]} size="small" onChange={onJumperClick} />
<PaginationMini tips={labelMap[mode]} size="small" onChange={onJumperClick} />
</div>
);
};
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export * from './range-input';
export * from './watermark';
export * from './image-viewer';
export * from './space';
export * from './jumper';
export * from './timeline';
export * from './image';
export * from './rate';
Expand Down
10 changes: 0 additions & 10 deletions src/jumper/__tests__/jumper.test.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions src/jumper/_example/layout.jsx

This file was deleted.

12 changes: 0 additions & 12 deletions src/jumper/_example/size.jsx

This file was deleted.

7 changes: 0 additions & 7 deletions src/jumper/_example/tips.jsx

This file was deleted.

48 changes: 0 additions & 48 deletions src/jumper/_usage/index.jsx

This file was deleted.

63 changes: 0 additions & 63 deletions src/jumper/_usage/props.json

This file was deleted.

12 changes: 0 additions & 12 deletions src/jumper/defaultProps.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/jumper/index.ts

This file was deleted.

16 changes: 0 additions & 16 deletions src/jumper/jumper.md

This file was deleted.

1 change: 0 additions & 1 deletion src/jumper/style/css.js

This file was deleted.

1 change: 0 additions & 1 deletion src/jumper/style/index.js

This file was deleted.

49 changes: 0 additions & 49 deletions src/jumper/type.ts

This file was deleted.

24 changes: 12 additions & 12 deletions src/jumper/Jumper.tsx → src/pagination/PaginationMini.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import useConfig from '../hooks/useConfig';
import useGlobalIcon from '../hooks/useGlobalIcon';
import Button from '../button';
import { StyledProps } from '../common';
import type { TdJumperProps } from './type';
import { jumperDefaultProps } from './defaultProps';
import type { TdPaginationMiniProps } from './type';
import { paginationMiniDefaultProps } from './defaultProps';
import noop from '../_util/noop';

export interface JumperProps extends TdJumperProps, StyledProps {}
export interface PaginationMiniProps extends TdPaginationMiniProps, StyledProps {}

const Jumper = forwardRef((props: JumperProps, ref: React.Ref<HTMLDivElement>) => {
const PaginationMini = forwardRef((props: PaginationMiniProps, ref: React.Ref<HTMLDivElement>) => {
const { classPrefix } = useConfig();
const { RoundIcon, ChevronUpIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } = useGlobalIcon({
RoundIcon: TdRoundIcon,
Expand All @@ -44,8 +44,8 @@ const Jumper = forwardRef((props: JumperProps, ref: React.Ref<HTMLDivElement>) =

return (
<div
className={classNames(`${classPrefix}-jumper`, className, {
[`${classPrefix}-jumper--outline`]: variant === 'outline',
className={classNames(`${classPrefix}-pagination-mini`, className, {
[`${classPrefix}-pagination-mini--outline`]: variant === 'outline',
})}
ref={ref}
style={style}
Expand All @@ -57,7 +57,7 @@ const Jumper = forwardRef((props: JumperProps, ref: React.Ref<HTMLDivElement>) =
shape="square"
onClick={(e) => onChange({ e, trigger: 'prev' })}
icon={layout === 'horizontal' ? <ChevronLeftIcon /> : <ChevronUpIcon />}
className={`${classPrefix}-jumper__prev`}
className={`${classPrefix}-pagination-mini__prev`}
disabled={disabledConfig.prev}
/>

Expand All @@ -69,7 +69,7 @@ const Jumper = forwardRef((props: JumperProps, ref: React.Ref<HTMLDivElement>) =
shape="square"
onClick={(e) => onChange({ e, trigger: 'current' })}
icon={<RoundIcon />}
className={`${classPrefix}-jumper__current`}
className={`${classPrefix}-pagination-mini__current`}
disabled={disabledConfig.current}
/>
)}
Expand All @@ -81,14 +81,14 @@ const Jumper = forwardRef((props: JumperProps, ref: React.Ref<HTMLDivElement>) =
shape="square"
onClick={(e) => onChange({ e, trigger: 'next' })}
icon={layout === 'horizontal' ? <ChevronRightIcon /> : <ChevronDownIcon />}
className={`${classPrefix}-jumper__next`}
className={`${classPrefix}-pagination-mini__next`}
disabled={disabledConfig.next}
/>
</div>
);
});

Jumper.displayName = 'Jumper';
Jumper.defaultProps = jumperDefaultProps;
PaginationMini.displayName = 'PaginationMini';
PaginationMini.defaultProps = paginationMiniDefaultProps;

export default Jumper;
export default PaginationMini;
Loading