mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
commit
4ee51e2c2b
@ -48,7 +48,8 @@ To input a value in a range.
|
||||
| vertical | If true, the slider will be vertical | boolean | false | |
|
||||
| onAfterChange | Fire when onmouseup is fired | (value) => void | - | |
|
||||
| onChange | Callback function that is fired when the user changes the slider's value | (value) => void | - | |
|
||||
| trackStyle | The style of slider track | CSSProperties | - | |
|
||||
| trackStyle | The style of slider track (the active range) | CSSProperties | - | |
|
||||
| railStyle | The style of slider rail (the background) | CSSProperties | - | |
|
||||
| handleStyle | The style of slider handle | CSSProperties | - | |
|
||||
|
||||
### range
|
||||
|
@ -77,6 +77,7 @@ export interface SliderSingleProps extends SliderBaseProps {
|
||||
onAfterChange?: (value: number) => void;
|
||||
handleStyle?: React.CSSProperties;
|
||||
trackStyle?: React.CSSProperties;
|
||||
railStyle?: React.CSSProperties;
|
||||
}
|
||||
|
||||
export interface SliderRangeProps extends SliderBaseProps {
|
||||
@ -87,6 +88,7 @@ export interface SliderRangeProps extends SliderBaseProps {
|
||||
onAfterChange?: (value: [number, number]) => void;
|
||||
handleStyle?: React.CSSProperties[];
|
||||
trackStyle?: React.CSSProperties[];
|
||||
railStyle?: React.CSSProperties;
|
||||
}
|
||||
|
||||
interface SliderRange {
|
||||
|
@ -1,8 +1,7 @@
|
||||
import React, { useCallback, useRef, useState } from 'react';
|
||||
import { UploadOutlined } from '@ant-design/icons';
|
||||
import { Button, Tooltip, Upload } from 'antd';
|
||||
import type { UploadFile, UploadProps } from 'antd/es/upload/interface';
|
||||
import update from 'immutability-helper';
|
||||
import React, { useCallback, useRef, useState } from 'react';
|
||||
import { DndProvider, useDrag, useDrop } from 'react-dnd';
|
||||
import { HTML5Backend } from 'react-dnd-html5-backend';
|
||||
|
||||
@ -95,14 +94,12 @@ const App: React.FC = () => {
|
||||
const moveRow = useCallback(
|
||||
(dragIndex: number, hoverIndex: number) => {
|
||||
const dragRow = fileList[dragIndex];
|
||||
setFileList(
|
||||
update(fileList, {
|
||||
$splice: [
|
||||
[dragIndex, 1],
|
||||
[hoverIndex, 0, dragRow],
|
||||
],
|
||||
}),
|
||||
);
|
||||
setFileList((currentFileList) => {
|
||||
const newFileList = [...currentFileList];
|
||||
newFileList.splice(dragIndex, 1);
|
||||
newFileList.splice(hoverIndex, 0, dragRow);
|
||||
return newFileList;
|
||||
});
|
||||
},
|
||||
[fileList],
|
||||
);
|
||||
|
@ -225,7 +225,6 @@
|
||||
"husky": "^8.0.1",
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
"immer": "^9.0.1",
|
||||
"immutability-helper": "^3.0.0",
|
||||
"inquirer": "^9.1.2",
|
||||
"isomorphic-fetch": "^3.0.0",
|
||||
"jest": "^29.4.1",
|
||||
|
Loading…
Reference in New Issue
Block a user