@lucasols/dnd-kit-core 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +655 -12
- package/dist/index.js +2626 -7
- package/dist/index.js.map +1 -0
- package/package.json +21 -17
- package/dist/components/Accessibility/Accessibility.d.ts +0 -10
- package/dist/components/Accessibility/components/RestoreFocus.d.ts +0 -5
- package/dist/components/Accessibility/components/index.d.ts +0 -1
- package/dist/components/Accessibility/defaults.d.ts +0 -3
- package/dist/components/Accessibility/index.d.ts +0 -4
- package/dist/components/Accessibility/types.d.ts +0 -15
- package/dist/components/DndContext/DndContext.d.ts +0 -35
- package/dist/components/DndContext/defaults.d.ts +0 -13
- package/dist/components/DndContext/hooks/index.d.ts +0 -2
- package/dist/components/DndContext/hooks/useLayoutShiftScrollCompensation.d.ts +0 -14
- package/dist/components/DndContext/hooks/useMeasuringConfiguration.d.ts +0 -3
- package/dist/components/DndContext/index.d.ts +0 -3
- package/dist/components/DndContext/types.d.ts +0 -16
- package/dist/components/DndMonitor/context.d.ts +0 -3
- package/dist/components/DndMonitor/index.d.ts +0 -4
- package/dist/components/DndMonitor/types.d.ts +0 -14
- package/dist/components/DndMonitor/useDndMonitor.d.ts +0 -2
- package/dist/components/DndMonitor/useDndMonitorProvider.d.ts +0 -2
- package/dist/components/DragOverlay/DragOverlay.d.ts +0 -11
- package/dist/components/DragOverlay/components/AnimationManager/AnimationManager.d.ts +0 -8
- package/dist/components/DragOverlay/components/AnimationManager/index.d.ts +0 -2
- package/dist/components/DragOverlay/components/NullifiedContextProvider/NullifiedContextProvider.d.ts +0 -6
- package/dist/components/DragOverlay/components/NullifiedContextProvider/index.d.ts +0 -1
- package/dist/components/DragOverlay/components/PositionedOverlay/PositionedOverlay.d.ts +0 -18
- package/dist/components/DragOverlay/components/PositionedOverlay/index.d.ts +0 -2
- package/dist/components/DragOverlay/components/index.d.ts +0 -5
- package/dist/components/DragOverlay/hooks/index.d.ts +0 -3
- package/dist/components/DragOverlay/hooks/useDropAnimation.d.ts +0 -65
- package/dist/components/DragOverlay/hooks/useKey.d.ts +0 -2
- package/dist/components/DragOverlay/index.d.ts +0 -4
- package/dist/components/index.d.ts +0 -8
- package/dist/dnd-kit-core.cjs.development.js +0 -3924
- package/dist/dnd-kit-core.cjs.development.js.map +0 -1
- package/dist/dnd-kit-core.cjs.production.min.js +0 -2
- package/dist/dnd-kit-core.cjs.production.min.js.map +0 -1
- package/dist/dnd-kit-core.esm.js +0 -3903
- package/dist/dnd-kit-core.esm.js.map +0 -1
- package/dist/hooks/index.d.ts +0 -8
- package/dist/hooks/useDndContext.d.ts +0 -4
- package/dist/hooks/useDraggable.d.ts +0 -37
- package/dist/hooks/useDroppable.d.ts +0 -29
- package/dist/hooks/utilities/index.d.ts +0 -21
- package/dist/hooks/utilities/useAutoScroller.d.ts +0 -40
- package/dist/hooks/utilities/useCachedNode.d.ts +0 -3
- package/dist/hooks/utilities/useCombineActivators.d.ts +0 -3
- package/dist/hooks/utilities/useDragOverlayMeasuring.d.ts +0 -7
- package/dist/hooks/utilities/useDroppableMeasuring.d.ts +0 -27
- package/dist/hooks/utilities/useInitialRect.d.ts +0 -2
- package/dist/hooks/utilities/useInitialValue.d.ts +0 -3
- package/dist/hooks/utilities/useMutationObserver.d.ts +0 -10
- package/dist/hooks/utilities/useRect.d.ts +0 -2
- package/dist/hooks/utilities/useRectDelta.d.ts +0 -2
- package/dist/hooks/utilities/useRects.d.ts +0 -5
- package/dist/hooks/utilities/useResizeObserver.d.ts +0 -10
- package/dist/hooks/utilities/useScrollIntoViewIfNeeded.d.ts +0 -1
- package/dist/hooks/utilities/useScrollOffsets.d.ts +0 -2
- package/dist/hooks/utilities/useScrollOffsetsDelta.d.ts +0 -2
- package/dist/hooks/utilities/useScrollableAncestors.d.ts +0 -1
- package/dist/hooks/utilities/useSensorSetup.d.ts +0 -2
- package/dist/hooks/utilities/useSyntheticListeners.d.ts +0 -9
- package/dist/hooks/utilities/useWindowRect.d.ts +0 -1
- package/dist/modifiers/applyModifiers.d.ts +0 -3
- package/dist/modifiers/index.d.ts +0 -2
- package/dist/modifiers/types.d.ts +0 -17
- package/dist/sensors/events.d.ts +0 -11
- package/dist/sensors/index.d.ts +0 -11
- package/dist/sensors/keyboard/KeyboardSensor.d.ts +0 -27
- package/dist/sensors/keyboard/defaults.d.ts +0 -3
- package/dist/sensors/keyboard/index.d.ts +0 -4
- package/dist/sensors/keyboard/types.d.ts +0 -21
- package/dist/sensors/mouse/MouseSensor.d.ts +0 -13
- package/dist/sensors/mouse/index.d.ts +0 -2
- package/dist/sensors/pointer/AbstractPointerSensor.d.ts +0 -48
- package/dist/sensors/pointer/PointerSensor.d.ts +0 -13
- package/dist/sensors/pointer/index.d.ts +0 -4
- package/dist/sensors/touch/TouchSensor.d.ts +0 -14
- package/dist/sensors/touch/index.d.ts +0 -2
- package/dist/sensors/types.d.ts +0 -60
- package/dist/sensors/useSensor.d.ts +0 -2
- package/dist/sensors/useSensors.d.ts +0 -2
- package/dist/sensors/utilities/Listeners.d.ts +0 -7
- package/dist/sensors/utilities/getEventListenerTarget.d.ts +0 -1
- package/dist/sensors/utilities/hasExceededDistance.d.ts +0 -2
- package/dist/sensors/utilities/index.d.ts +0 -3
- package/dist/store/actions.d.ts +0 -36
- package/dist/store/constructors.d.ts +0 -10
- package/dist/store/context.d.ts +0 -6
- package/dist/store/index.d.ts +0 -4
- package/dist/store/reducer.d.ts +0 -4
- package/dist/store/types.d.ts +0 -98
- package/dist/types/coordinates.d.ts +0 -9
- package/dist/types/direction.d.ts +0 -4
- package/dist/types/events.d.ts +0 -21
- package/dist/types/index.d.ts +0 -6
- package/dist/types/other.d.ts +0 -1
- package/dist/types/react.d.ts +0 -3
- package/dist/types/rect.d.ts +0 -8
- package/dist/utilities/algorithms/closestCenter.d.ts +0 -6
- package/dist/utilities/algorithms/closestCorners.d.ts +0 -6
- package/dist/utilities/algorithms/helpers.d.ts +0 -24
- package/dist/utilities/algorithms/index.d.ts +0 -6
- package/dist/utilities/algorithms/pointerWithin.d.ts +0 -5
- package/dist/utilities/algorithms/rectIntersection.d.ts +0 -11
- package/dist/utilities/algorithms/types.d.ts +0 -20
- package/dist/utilities/coordinates/constants.d.ts +0 -2
- package/dist/utilities/coordinates/distanceBetweenPoints.d.ts +0 -5
- package/dist/utilities/coordinates/getRelativeTransformOrigin.d.ts +0 -2
- package/dist/utilities/coordinates/index.d.ts +0 -3
- package/dist/utilities/index.d.ts +0 -6
- package/dist/utilities/nodes/getMeasurableNode.d.ts +0 -1
- package/dist/utilities/nodes/index.d.ts +0 -1
- package/dist/utilities/other/index.d.ts +0 -1
- package/dist/utilities/other/noop.d.ts +0 -1
- package/dist/utilities/rect/Rect.d.ts +0 -11
- package/dist/utilities/rect/adjustScale.d.ts +0 -3
- package/dist/utilities/rect/getRect.d.ts +0 -25
- package/dist/utilities/rect/getRectDelta.d.ts +0 -2
- package/dist/utilities/rect/getWindowClientRect.d.ts +0 -2
- package/dist/utilities/rect/index.d.ts +0 -6
- package/dist/utilities/rect/rectAdjustment.d.ts +0 -3
- package/dist/utilities/scroll/documentScrollingElement.d.ts +0 -1
- package/dist/utilities/scroll/getScrollCoordinates.d.ts +0 -4
- package/dist/utilities/scroll/getScrollDirectionAndSpeed.d.ts +0 -17
- package/dist/utilities/scroll/getScrollElementRect.d.ts +0 -8
- package/dist/utilities/scroll/getScrollOffsets.d.ts +0 -4
- package/dist/utilities/scroll/getScrollPosition.d.ts +0 -14
- package/dist/utilities/scroll/getScrollableAncestors.d.ts +0 -2
- package/dist/utilities/scroll/getScrollableElement.d.ts +0 -1
- package/dist/utilities/scroll/index.d.ts +0 -10
- package/dist/utilities/scroll/isFixed.d.ts +0 -1
- package/dist/utilities/scroll/isScrollable.d.ts +0 -1
- package/dist/utilities/scroll/scrollIntoViewIfNeeded.d.ts +0 -2
- package/dist/utilities/transform/index.d.ts +0 -2
- package/dist/utilities/transform/inverseTransform.d.ts +0 -2
- package/dist/utilities/transform/parseTransform.d.ts +0 -2
package/dist/store/index.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { Action } from './actions';
|
|
2
|
-
export { PublicContext, InternalContext, defaultInternalContext, } from './context';
|
|
3
|
-
export { reducer, getInitialState } from './reducer';
|
|
4
|
-
export type { Active, Data, DataRef, DraggableElement, DraggableNode, DraggableNodes, DroppableContainer, DroppableContainers, PublicContextDescriptor, InternalContextDescriptor, RectMap, Over, State, } from './types';
|
package/dist/store/reducer.d.ts
DELETED
package/dist/store/types.d.ts
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import type { MutableRefObject } from 'react';
|
|
2
|
-
import type { DeepRequired } from '@lucasols/dnd-kit-utilities';
|
|
3
|
-
import type { SyntheticListeners } from '../hooks/utilities';
|
|
4
|
-
import type { Collision } from '../utilities/algorithms';
|
|
5
|
-
import type { MeasuringConfiguration } from '../components';
|
|
6
|
-
import type { Coordinates, ClientRect, UniqueIdentifier } from '../types';
|
|
7
|
-
import type { Actions } from './actions';
|
|
8
|
-
import type { DroppableContainersMap } from './constructors';
|
|
9
|
-
export interface DraggableElement {
|
|
10
|
-
node: DraggableNode;
|
|
11
|
-
id: UniqueIdentifier;
|
|
12
|
-
index: number;
|
|
13
|
-
collection: string;
|
|
14
|
-
disabled: boolean;
|
|
15
|
-
}
|
|
16
|
-
declare type AnyData = Record<string, any>;
|
|
17
|
-
export declare type Data<T = AnyData> = T & AnyData;
|
|
18
|
-
export declare type DataRef<T = AnyData> = MutableRefObject<Data<T> | undefined>;
|
|
19
|
-
export interface DroppableContainer {
|
|
20
|
-
id: UniqueIdentifier;
|
|
21
|
-
key: UniqueIdentifier;
|
|
22
|
-
data: DataRef;
|
|
23
|
-
disabled: boolean;
|
|
24
|
-
node: MutableRefObject<HTMLElement | null>;
|
|
25
|
-
rect: MutableRefObject<ClientRect | null>;
|
|
26
|
-
}
|
|
27
|
-
export interface Active {
|
|
28
|
-
id: UniqueIdentifier;
|
|
29
|
-
data: DataRef;
|
|
30
|
-
rect: MutableRefObject<{
|
|
31
|
-
initial: ClientRect | null;
|
|
32
|
-
translated: ClientRect | null;
|
|
33
|
-
}>;
|
|
34
|
-
}
|
|
35
|
-
export interface Over {
|
|
36
|
-
id: UniqueIdentifier;
|
|
37
|
-
rect: ClientRect;
|
|
38
|
-
disabled: boolean;
|
|
39
|
-
data: DataRef;
|
|
40
|
-
}
|
|
41
|
-
export declare type DraggableNode = {
|
|
42
|
-
id: UniqueIdentifier;
|
|
43
|
-
key: UniqueIdentifier;
|
|
44
|
-
node: MutableRefObject<HTMLElement | null>;
|
|
45
|
-
activatorNode: MutableRefObject<HTMLElement | null>;
|
|
46
|
-
data: DataRef;
|
|
47
|
-
};
|
|
48
|
-
export declare type DraggableNodes = Map<UniqueIdentifier, DraggableNode | undefined>;
|
|
49
|
-
export declare type DroppableContainers = DroppableContainersMap;
|
|
50
|
-
export declare type RectMap = Map<UniqueIdentifier, ClientRect>;
|
|
51
|
-
export interface State {
|
|
52
|
-
droppable: {
|
|
53
|
-
containers: DroppableContainers;
|
|
54
|
-
};
|
|
55
|
-
draggable: {
|
|
56
|
-
active: UniqueIdentifier | null;
|
|
57
|
-
initialCoordinates: Coordinates;
|
|
58
|
-
nodes: DraggableNodes;
|
|
59
|
-
translate: Coordinates;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
export interface PublicContextDescriptor {
|
|
63
|
-
activatorEvent: Event | null;
|
|
64
|
-
active: Active | null;
|
|
65
|
-
activeNode: HTMLElement | null;
|
|
66
|
-
activeNodeRect: ClientRect | null;
|
|
67
|
-
collisions: Collision[] | null;
|
|
68
|
-
containerNodeRect: ClientRect | null;
|
|
69
|
-
draggableNodes: DraggableNodes;
|
|
70
|
-
droppableContainers: DroppableContainers;
|
|
71
|
-
droppableRects: RectMap;
|
|
72
|
-
over: Over | null;
|
|
73
|
-
dragOverlay: {
|
|
74
|
-
nodeRef: MutableRefObject<HTMLElement | null>;
|
|
75
|
-
rect: ClientRect | null;
|
|
76
|
-
setRef: (element: HTMLElement | null) => void;
|
|
77
|
-
};
|
|
78
|
-
scrollableAncestors: Element[];
|
|
79
|
-
scrollableAncestorRects: ClientRect[];
|
|
80
|
-
measuringConfiguration: DeepRequired<MeasuringConfiguration>;
|
|
81
|
-
measureDroppableContainers(ids: UniqueIdentifier[]): void;
|
|
82
|
-
measuringScheduled: boolean;
|
|
83
|
-
windowRect: ClientRect | null;
|
|
84
|
-
}
|
|
85
|
-
export interface InternalContextDescriptor {
|
|
86
|
-
activatorEvent: Event | null;
|
|
87
|
-
activators: SyntheticListeners;
|
|
88
|
-
active: Active | null;
|
|
89
|
-
activeNodeRect: ClientRect | null;
|
|
90
|
-
ariaDescribedById: {
|
|
91
|
-
draggable: string;
|
|
92
|
-
};
|
|
93
|
-
dispatch: React.Dispatch<Actions>;
|
|
94
|
-
draggableNodes: DraggableNodes;
|
|
95
|
-
over: Over | null;
|
|
96
|
-
measureDroppableContainers(ids: UniqueIdentifier[]): void;
|
|
97
|
-
}
|
|
98
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Coordinates } from '@lucasols/dnd-kit-utilities';
|
|
2
|
-
export type { Coordinates };
|
|
3
|
-
export declare type DistanceMeasurement = number | Coordinates | Pick<Coordinates, 'x'> | Pick<Coordinates, 'y'>;
|
|
4
|
-
export declare type Translate = Coordinates;
|
|
5
|
-
export interface ScrollCoordinates {
|
|
6
|
-
initial: Coordinates;
|
|
7
|
-
current: Coordinates;
|
|
8
|
-
delta: Coordinates;
|
|
9
|
-
}
|
package/dist/types/events.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Active, Over } from '../store';
|
|
2
|
-
import type { Collision } from '../utilities/algorithms';
|
|
3
|
-
import type { Translate } from './coordinates';
|
|
4
|
-
interface DragEvent {
|
|
5
|
-
activatorEvent: Event;
|
|
6
|
-
active: Active;
|
|
7
|
-
collisions: Collision[] | null;
|
|
8
|
-
delta: Translate;
|
|
9
|
-
over: Over | null;
|
|
10
|
-
}
|
|
11
|
-
export interface DragStartEvent extends Pick<DragEvent, 'active'> {
|
|
12
|
-
}
|
|
13
|
-
export interface DragMoveEvent extends DragEvent {
|
|
14
|
-
}
|
|
15
|
-
export interface DragOverEvent extends DragMoveEvent {
|
|
16
|
-
}
|
|
17
|
-
export interface DragEndEvent extends DragEvent {
|
|
18
|
-
}
|
|
19
|
-
export interface DragCancelEvent extends DragEndEvent {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export type { Coordinates, DistanceMeasurement, Translate, ScrollCoordinates, } from './coordinates';
|
|
2
|
-
export { Direction } from './direction';
|
|
3
|
-
export type { DragStartEvent, DragCancelEvent, DragEndEvent, DragMoveEvent, DragOverEvent, } from './events';
|
|
4
|
-
export type { UniqueIdentifier } from './other';
|
|
5
|
-
export type { SyntheticEventName } from './react';
|
|
6
|
-
export type { ClientRect } from './rect';
|
package/dist/types/other.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare type UniqueIdentifier = string | number;
|
package/dist/types/react.d.ts
DELETED
package/dist/types/rect.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ClientRect } from '../../types';
|
|
2
|
-
import type { Collision, CollisionDescriptor } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Sort collisions from smallest to greatest value
|
|
5
|
-
*/
|
|
6
|
-
export declare function sortCollisionsAsc({ data: { value: a } }: CollisionDescriptor, { data: { value: b } }: CollisionDescriptor): number;
|
|
7
|
-
/**
|
|
8
|
-
* Sort collisions from greatest to smallest value
|
|
9
|
-
*/
|
|
10
|
-
export declare function sortCollisionsDesc({ data: { value: a } }: CollisionDescriptor, { data: { value: b } }: CollisionDescriptor): number;
|
|
11
|
-
/**
|
|
12
|
-
* Returns the coordinates of the corners of a given rectangle:
|
|
13
|
-
* [TopLeft {x, y}, TopRight {x, y}, BottomLeft {x, y}, BottomRight {x, y}]
|
|
14
|
-
*/
|
|
15
|
-
export declare function cornersOfRectangle({ left, top, height, width }: ClientRect): {
|
|
16
|
-
x: number;
|
|
17
|
-
y: number;
|
|
18
|
-
}[];
|
|
19
|
-
/**
|
|
20
|
-
* Returns the first collision, or null if there isn't one.
|
|
21
|
-
* If a property is specified, returns the specified property of the first collision.
|
|
22
|
-
*/
|
|
23
|
-
export declare function getFirstCollision(collisions: Collision[] | null | undefined): Collision | null;
|
|
24
|
-
export declare function getFirstCollision<T extends keyof Collision>(collisions: Collision[] | null | undefined, property: T): Collision[T] | null;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { closestCenter } from './closestCenter';
|
|
2
|
-
export { closestCorners } from './closestCorners';
|
|
3
|
-
export { rectIntersection } from './rectIntersection';
|
|
4
|
-
export { pointerWithin } from './pointerWithin';
|
|
5
|
-
export type { Collision, CollisionDescriptor, CollisionDetection } from './types';
|
|
6
|
-
export { getFirstCollision } from './helpers';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ClientRect } from '../../types';
|
|
2
|
-
import type { CollisionDetection } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Returns the intersecting rectangle area between two rectangles
|
|
5
|
-
*/
|
|
6
|
-
export declare function getIntersectionRatio(entry: ClientRect, target: ClientRect): number;
|
|
7
|
-
/**
|
|
8
|
-
* Returns the rectangles that has the greatest intersection area with a given
|
|
9
|
-
* rectangle in an array of rectangles.
|
|
10
|
-
*/
|
|
11
|
-
export declare const rectIntersection: CollisionDetection;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Active, Data, DroppableContainer, RectMap } from '../../store';
|
|
2
|
-
import type { Coordinates, ClientRect, UniqueIdentifier } from '../../types';
|
|
3
|
-
export interface Collision {
|
|
4
|
-
id: UniqueIdentifier;
|
|
5
|
-
data?: Data;
|
|
6
|
-
}
|
|
7
|
-
export interface CollisionDescriptor extends Collision {
|
|
8
|
-
data: {
|
|
9
|
-
droppableContainer: DroppableContainer;
|
|
10
|
-
value: number;
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export declare type CollisionDetection = (args: {
|
|
15
|
-
active: Active;
|
|
16
|
-
collisionRect: ClientRect;
|
|
17
|
-
droppableRects: RectMap;
|
|
18
|
-
droppableContainers: DroppableContainer[];
|
|
19
|
-
pointerCoordinates: Coordinates | null;
|
|
20
|
-
}) => Collision[];
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { closestCenter, closestCorners, rectIntersection, getFirstCollision, pointerWithin, } from './algorithms';
|
|
2
|
-
export type { Collision, CollisionDescriptor, CollisionDetection, } from './algorithms';
|
|
3
|
-
export { defaultCoordinates, distanceBetween, getRelativeTransformOrigin, } from './coordinates';
|
|
4
|
-
export { Rect, adjustScale, getAdjustedRect, getClientRect, getTransformAgnosticClientRect, getWindowClientRect, getRectDelta, } from './rect';
|
|
5
|
-
export { noop } from './other';
|
|
6
|
-
export { getFirstScrollableAncestor, getScrollableAncestors, getScrollableElement, getScrollCoordinates, getScrollDirectionAndSpeed, getScrollElementRect, getScrollOffsets, getScrollPosition, isDocumentScrollingElement, } from './scroll';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getMeasurableNode(node: HTMLElement | undefined | null): HTMLElement | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { getMeasurableNode } from './getMeasurableNode';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { noop } from './noop';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function noop(..._args: any): void;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ClientRect } from '../../types';
|
|
2
|
-
interface Options {
|
|
3
|
-
ignoreTransform?: boolean;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Returns the bounding client rect of an element relative to the viewport.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getClientRect(element: Element, options?: Options): {
|
|
9
|
-
top: number;
|
|
10
|
-
left: number;
|
|
11
|
-
width: number;
|
|
12
|
-
height: number;
|
|
13
|
-
bottom: number;
|
|
14
|
-
right: number;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Returns the bounding client rect of an element relative to the viewport.
|
|
18
|
-
*
|
|
19
|
-
* @remarks
|
|
20
|
-
* The ClientRect returned by this method does not take into account transforms
|
|
21
|
-
* applied to the element it measures.
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
export declare function getTransformAgnosticClientRect(element: Element): ClientRect;
|
|
25
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { adjustScale } from './adjustScale';
|
|
2
|
-
export { getRectDelta } from './getRectDelta';
|
|
3
|
-
export { getAdjustedRect } from './rectAdjustment';
|
|
4
|
-
export { getClientRect, getTransformAgnosticClientRect } from './getRect';
|
|
5
|
-
export { getWindowClientRect } from './getWindowClientRect';
|
|
6
|
-
export { Rect } from './Rect';
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { Coordinates, ClientRect } from '../../types';
|
|
2
|
-
export declare function createRectAdjustmentFn(modifier: number): (rect: ClientRect, ...adjustments: Coordinates[]) => ClientRect;
|
|
3
|
-
export declare const getAdjustedRect: (rect: ClientRect, ...adjustments: Coordinates[]) => ClientRect;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isDocumentScrollingElement(element: Element | null): boolean;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Coordinates } from '../../types';
|
|
2
|
-
export declare function getScrollXCoordinate(element: Element | typeof window): number;
|
|
3
|
-
export declare function getScrollYCoordinate(element: Element | typeof window): number;
|
|
4
|
-
export declare function getScrollCoordinates(element: Element | typeof window): Coordinates;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ClientRect } from '../../types';
|
|
2
|
-
interface PositionalCoordinates extends Pick<ClientRect, 'top' | 'left' | 'right' | 'bottom'> {
|
|
3
|
-
}
|
|
4
|
-
export declare function getScrollDirectionAndSpeed(scrollContainer: Element, scrollContainerRect: ClientRect, { top, left, right, bottom }: PositionalCoordinates, acceleration?: number, thresholdPercentage?: {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
}): {
|
|
8
|
-
direction: {
|
|
9
|
-
x: number;
|
|
10
|
-
y: number;
|
|
11
|
-
};
|
|
12
|
-
speed: {
|
|
13
|
-
x: number;
|
|
14
|
-
y: number;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Coordinates } from '../../types';
|
|
2
|
-
export declare function getScrollOffsets(scrollableAncestors: Element[]): Coordinates;
|
|
3
|
-
export declare function getScrollXOffset(scrollableAncestors: Element[]): number;
|
|
4
|
-
export declare function getScrollYOffset(scrollableAncestors: Element[]): number;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare function getScrollPosition(scrollingContainer: Element): {
|
|
2
|
-
isTop: boolean;
|
|
3
|
-
isLeft: boolean;
|
|
4
|
-
isBottom: boolean;
|
|
5
|
-
isRight: boolean;
|
|
6
|
-
maxScroll: {
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
};
|
|
10
|
-
minScroll: {
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getScrollableElement(element: EventTarget | null): (Window & typeof globalThis) | HTMLElement | null;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { getFirstScrollableAncestor, getScrollableAncestors, } from './getScrollableAncestors';
|
|
2
|
-
export { getScrollableElement } from './getScrollableElement';
|
|
3
|
-
export { getScrollCoordinates } from './getScrollCoordinates';
|
|
4
|
-
export { getScrollDirectionAndSpeed } from './getScrollDirectionAndSpeed';
|
|
5
|
-
export { getScrollElementRect } from './getScrollElementRect';
|
|
6
|
-
export { getScrollOffsets, getScrollXOffset, getScrollYOffset, } from './getScrollOffsets';
|
|
7
|
-
export { getScrollPosition } from './getScrollPosition';
|
|
8
|
-
export { isDocumentScrollingElement } from './documentScrollingElement';
|
|
9
|
-
export { isScrollable } from './isScrollable';
|
|
10
|
-
export { scrollIntoViewIfNeeded } from './scrollIntoViewIfNeeded';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isFixed(node: HTMLElement, computedStyle?: CSSStyleDeclaration): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isScrollable(element: HTMLElement, computedStyle?: CSSStyleDeclaration): boolean;
|