react-reorder-list
Advanced tools
Comparing version 0.6.5 to 0.6.6
@@ -1,9 +0,6 @@ | ||
export declare function useDraggable(initValue?: boolean): { | ||
draggable: boolean; | ||
draggableProps: { | ||
onMouseEnter: () => void; | ||
onMouseLeave: () => void; | ||
onTouchStart: () => void; | ||
onTouchEnd: () => void; | ||
}; | ||
}; | ||
export declare function useDraggable(initValue?: boolean): readonly [boolean, { | ||
onMouseEnter: () => void; | ||
onMouseLeave: () => void; | ||
onTouchStart: () => void; | ||
onTouchEnd: () => void; | ||
}]; |
@@ -7,3 +7,3 @@ import { useState } from "react"; | ||
const draggableProps = { onMouseEnter: enableDragging, onMouseLeave: disableDragging, onTouchStart: enableDragging, onTouchEnd: disableDragging }; | ||
return { draggable, draggableProps }; | ||
return [draggable, draggableProps]; | ||
} |
@@ -1,2 +0,2 @@ | ||
import React, { DetailedHTMLProps, HTMLAttributes, ReactNode } from "react"; | ||
import React, { CSSProperties, DetailedHTMLProps, DragEventHandler, HTMLAttributes, ReactNode, TouchEventHandler } from "react"; | ||
export type Props = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>; | ||
@@ -21,4 +21,16 @@ export type PositionChangeHandler = (params?: { | ||
}; | ||
export type DivDragEventHandler = DragEventHandler<HTMLDivElement>; | ||
export type DivTouchEventHandler = TouchEventHandler<HTMLDivElement>; | ||
export type ReorderItemProps = { | ||
useOnlyIconToDrag: boolean; | ||
style: CSSProperties; | ||
onDragStart?: DivDragEventHandler; | ||
onDragEnter: DivDragEventHandler; | ||
onDragEnd: DivDragEventHandler; | ||
onTouchMove: DivTouchEventHandler; | ||
onTouchEnd: DivTouchEventHandler; | ||
children: ReactNode; | ||
}; | ||
export type { IconProps } from "./icons.js"; | ||
export default function ReorderList({ useOnlyIconToDrag, selectedItemOpacity, animationDuration, watchChildrenUpdates, preserveOrder, onPositionChange, disabled, props, children }: ReorderListProps): React.JSX.Element; | ||
export declare function ReorderIcon({ children, style, ...props }: Props): React.JSX.Element; |
@@ -111,3 +111,3 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
var { useOnlyIconToDrag, onTouchEnd: propOnTouchEnd, children } = _a, props = __rest(_a, ["useOnlyIconToDrag", "onTouchEnd", "children"]); | ||
const _b = useDraggable(), { draggable } = _b, _c = _b.draggableProps, { onTouchEnd: draggableOnTouchEnd } = _c, draggableProps = __rest(_c, ["onTouchEnd"]); | ||
const [draggable, _b] = useDraggable(), { onTouchEnd: draggableOnTouchEnd } = _b, draggableProps = __rest(_b, ["onTouchEnd"]); | ||
if (!draggable) | ||
@@ -114,0 +114,0 @@ props.onDragStart = undefined; |
{ | ||
"name": "react-reorder-list", | ||
"version": "0.6.5", | ||
"version": "0.6.6", | ||
"description": "A simple react component that facilitates the reordering of JSX/HTML elements through drag-and-drop functionality, allowing for easy position changes.", | ||
@@ -29,3 +29,3 @@ "type": "module", | ||
"peerDependencies": { | ||
"react": ">=16.0.0" | ||
"react": ">=17.0.0" | ||
}, | ||
@@ -32,0 +32,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21440
238