react-timelane 0.0.1 → 0.0.3
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/components/Timelane.d.ts +17 -0
- package/dist/components/TimelaneAside.d.ts +13 -0
- package/dist/components/TimelaneBackground.d.ts +5 -0
- package/dist/components/TimelaneBody.d.ts +6 -0
- package/dist/components/TimelaneBodyInner.d.ts +16 -0
- package/dist/components/{TimelineHeader/TimelineHeader.d.ts → TimelaneHeader/TimelaneHeader.d.ts} +2 -2
- package/dist/components/{TimelineHeader → TimelaneHeader}/index.d.ts +1 -1
- package/dist/components/{core/CoreItem → TimelaneItem}/DragResizeComponent.d.ts +2 -2
- package/dist/components/TimelaneItem/TimelaneItem.d.ts +14 -0
- package/dist/components/{core/CoreSwimlane → TimelaneLane}/AvailableSpaceIndicator.d.ts +3 -3
- package/dist/components/{core/CoreSwimlane → TimelaneLane}/DropTarget.d.ts +1 -1
- package/dist/components/{core/CoreSwimlane → TimelaneLane}/OverlapIndicator.d.ts +1 -1
- package/dist/components/{core/CoreSwimlane/CoreSwimlane.d.ts → TimelaneLane/TimelaneLane.d.ts} +7 -7
- package/dist/components/TimelaneLayout/TimelaneLayout.d.ts +23 -0
- package/dist/components/TimelaneSelectionLayer.d.ts +6 -0
- package/dist/components/TimelaneSettingsContext.d.ts +7 -0
- package/dist/components/TimelaneSettingsProvider.d.ts +7 -0
- package/dist/components/{TimelineWrapper.d.ts → TimelaneWrapper.d.ts} +7 -4
- package/dist/components/utils.d.ts +27 -0
- package/dist/hooks/useScroll.d.ts +3 -3
- package/dist/hooks/useTimelaneContext.d.ts +1 -0
- package/dist/index.d.ts +10 -11
- package/dist/react-timelane.css +1 -1
- package/dist/react-timelane.js +1122 -1169
- package/dist/types/Item.d.ts +12 -0
- package/dist/types/Lane.d.ts +5 -0
- package/dist/types/LaneId.d.ts +1 -0
- package/dist/types/{TimelineSettings.d.ts → TimelaneSettings.d.ts} +1 -1
- package/dist/types/index.d.ts +4 -4
- package/package.json +1 -1
- package/vite.config.ts +1 -1
- package/dist/components/TimelineAside.d.ts +0 -13
- package/dist/components/TimelineBackground.d.ts +0 -5
- package/dist/components/TimelineBody.d.ts +0 -13
- package/dist/components/TimelineSelectionLayer.d.ts +0 -6
- package/dist/components/TimelineSettingsContext.d.ts +0 -7
- package/dist/components/TimelineSettingsProvider.d.ts +0 -7
- package/dist/components/core/CoreItem/CoreItemComponent.d.ts +0 -14
- package/dist/components/core/CoreSwimlane/utils.d.ts +0 -13
- package/dist/components/core/utils.d.ts +0 -15
- package/dist/components/layout/TimelineLayout.d.ts +0 -23
- package/dist/hooks/useTimelineContext.d.ts +0 -1
- package/dist/types/CoreItem.d.ts +0 -12
- package/dist/types/SwimlaneId.d.ts +0 -1
- package/dist/types/SwimlaneT.d.ts +0 -5
- /package/dist/components/{TimelineHeader → TimelaneHeader}/DaysHeader.d.ts +0 -0
- /package/dist/components/{TimelineHeader → TimelaneHeader}/MonthsHeader.d.ts +0 -0
- /package/dist/components/{TimelineHeader → TimelaneHeader}/WeeksHeader.d.ts +0 -0
- /package/dist/components/{TimelineHeader → TimelaneHeader}/renderingUtils.d.ts +0 -0
- /package/dist/components/{core/CoreSwimlane → TimelaneLane}/DropPreview.d.ts +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ItemId } from './ItemId';
|
|
2
|
+
import { LaneId } from './LaneId';
|
|
3
|
+
export type Item<T = void> = {
|
|
4
|
+
id: ItemId;
|
|
5
|
+
swimlaneId: LaneId;
|
|
6
|
+
start: Date;
|
|
7
|
+
end: Date;
|
|
8
|
+
size: number;
|
|
9
|
+
offset: number;
|
|
10
|
+
payload: T;
|
|
11
|
+
};
|
|
12
|
+
export declare function isItem(a: object): a is Item;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type LaneId = number;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,11 +5,11 @@ export { type Position } from './Position';
|
|
|
5
5
|
export { type Grid } from './Grid';
|
|
6
6
|
export { type ItemId } from './ItemId';
|
|
7
7
|
export { type AvailableSpace } from './AvailableSpace';
|
|
8
|
-
export { type
|
|
8
|
+
export { type Item, isItem } from './Item';
|
|
9
9
|
export { type Dimensions } from './Dimensions';
|
|
10
10
|
export { type GrabInfo } from './GrabInfo';
|
|
11
|
-
export { type
|
|
12
|
-
export { type
|
|
11
|
+
export { type LaneId } from './LaneId';
|
|
12
|
+
export { type Lane } from './Lane';
|
|
13
13
|
export { type DateBounds } from './DateBounds';
|
|
14
14
|
export { type OffsetBounds } from './OffsetBounds';
|
|
15
|
-
export { type
|
|
15
|
+
export { type TimelaneSettings } from './TimelaneSettings';
|
package/package.json
CHANGED
package/vite.config.ts
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { MouseEvent, ReactElement } from 'react';
|
|
2
|
-
import { SwimlaneT } from '../types';
|
|
3
|
-
interface TimelineAsideProps {
|
|
4
|
-
swimlanes: SwimlaneT[];
|
|
5
|
-
focusedSwimlane?: SwimlaneT | null;
|
|
6
|
-
setFocusedSwimlane?: (lane: SwimlaneT | null) => void;
|
|
7
|
-
onSwimlaneHeaderClick?: (lane: SwimlaneT, e: MouseEvent) => void;
|
|
8
|
-
onSwimlaneHeaderDoubleClick?: (lane: SwimlaneT, e: MouseEvent) => void;
|
|
9
|
-
onSwimlaneHeaderContextMenu?: (lane: SwimlaneT, e: MouseEvent) => void;
|
|
10
|
-
renderSwimlaneHeader?: (lane: SwimlaneT) => ReactElement;
|
|
11
|
-
}
|
|
12
|
-
export default function TimelineAside({ swimlanes, focusedSwimlane, setFocusedSwimlane, onSwimlaneHeaderClick, onSwimlaneHeaderDoubleClick, onSwimlaneHeaderContextMenu, renderSwimlaneHeader, }: TimelineAsideProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { MouseEvent, ReactElement } from 'react';
|
|
2
|
-
import { AvailableSpace, CoreItem, SwimlaneT } from '../types';
|
|
3
|
-
interface TimelineBodyProps<T> {
|
|
4
|
-
lanes: SwimlaneT[];
|
|
5
|
-
items: CoreItem<T>[];
|
|
6
|
-
renderItem?: (item: CoreItem<T>, isDragged: boolean) => ReactElement;
|
|
7
|
-
onItemUpdate?: (item: CoreItem<T>) => void;
|
|
8
|
-
onLaneClick?: (lane: SwimlaneT, when: Date, availableSpace: AvailableSpace | null, e: MouseEvent) => void;
|
|
9
|
-
onLaneDoubleClick?: (lane: SwimlaneT, when: Date, availableSpace: AvailableSpace | null, e: MouseEvent) => void;
|
|
10
|
-
onLaneContextMenu?: (lane: SwimlaneT, when: Date, e: MouseEvent) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare function TimelineBody<T>({ lanes, items, renderItem, onItemUpdate, onLaneClick, onLaneDoubleClick, onLaneContextMenu, }: TimelineBodyProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
interface TimelineSelectionLayerProps {
|
|
3
|
-
onSelect: (selection: number[]) => void;
|
|
4
|
-
}
|
|
5
|
-
export declare function TimelineSelectionLayer({ children, onSelect, }: PropsWithChildren<TimelineSelectionLayerProps>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import { TimelineSettings } from '../types/TimelineSettings';
|
|
3
|
-
export interface TimelineContextOuter {
|
|
4
|
-
settings: TimelineSettings;
|
|
5
|
-
setSettings: Dispatch<SetStateAction<TimelineSettings>>;
|
|
6
|
-
}
|
|
7
|
-
export declare const TimelineSettingsContext: import('react').Context<TimelineContextOuter>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { TimelineSettings } from '../types/TimelineSettings';
|
|
3
|
-
interface TimelineSettingsProviderProps {
|
|
4
|
-
settings: TimelineSettings;
|
|
5
|
-
}
|
|
6
|
-
export declare const TimelineSettingsProvider: ({ settings: _settings, children, }: PropsWithChildren<TimelineSettingsProviderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { CoreItem, Position, SwimlaneT, TimelineSettings } from '../../../types';
|
|
3
|
-
interface CoreItemComponentProps<T> {
|
|
4
|
-
item: CoreItem<T>;
|
|
5
|
-
swimlane: SwimlaneT;
|
|
6
|
-
settings: TimelineSettings;
|
|
7
|
-
onDragStart: (grabPosition: Position, relativeGrabPosition: Position) => void;
|
|
8
|
-
onDrop: () => void;
|
|
9
|
-
onDrag: () => void;
|
|
10
|
-
onUpdate: (updatedItem: CoreItem<T>) => void;
|
|
11
|
-
onResizeStart: () => void;
|
|
12
|
-
}
|
|
13
|
-
export default function CoreItemComponent<T>({ swimlane, item, settings, children, onDragStart, onDrag, onDrop, onUpdate, onResizeStart, }: PropsWithChildren<CoreItemComponentProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AvailableSpace, CoreItem, Dimensions, GrabInfo, Grid, Pixels, Position, Rectangle, SwimlaneT, TimeRange } from '../../../types';
|
|
2
|
-
export declare function getDropPreviewRectangle<S, T>(swimlane: SwimlaneT, items: CoreItem<T>[], item: CoreItem<S>, mousePosition: Position | null, grabInfo: GrabInfo, pixels: Pixels, grid: Grid, range: TimeRange, allowOverlaps: boolean): Rectangle | null;
|
|
3
|
-
/**
|
|
4
|
-
* Returns true if two rectangles (l1, r1) and (l2, r2) overlap
|
|
5
|
-
* @param el1
|
|
6
|
-
* @param el2
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
|
-
export declare function doOverlap(el1: Rectangle, el2: Rectangle): boolean;
|
|
10
|
-
export declare function getOverlap(rect1: Rectangle, rect2: Rectangle): Rectangle | null;
|
|
11
|
-
export declare function itemsDoOverlap<T>(a: CoreItem<T>, b: CoreItem<T>): boolean;
|
|
12
|
-
export declare function isWithinTargetDimensions(item: Rectangle, targetDimensions: Dimensions): boolean;
|
|
13
|
-
export declare function getAvailableSpace<T>(clickedDate: Date, clickedOffset: number, swimlane: SwimlaneT, items: CoreItem<T>[], range: TimeRange): AvailableSpace | null;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DragLocationHistory, ElementDragPayload } from '@atlaskit/pragmatic-drag-and-drop/dist/types/internal-types';
|
|
2
|
-
import { CoreItem, Dimensions, Pixels, Position, Rectangle, SwimlaneT, TimeRange } from '../../types';
|
|
3
|
-
export declare function getDropTargetDimensions(swimlane: SwimlaneT, pixels: Pixels, range: TimeRange): Dimensions;
|
|
4
|
-
export declare function getDropTargetHeight(swimlane: SwimlaneT, pixels: Pixels): number;
|
|
5
|
-
export declare function getDropTargetWidth(swimlane: SwimlaneT, pixels: Pixels, range: TimeRange): number;
|
|
6
|
-
export declare function getItemRectangle<T>(item: CoreItem<T>, swimlane: SwimlaneT, range: TimeRange, pixels: Pixels): Rectangle;
|
|
7
|
-
export declare function getItemDimensions<T>(item: CoreItem<T>, swimlane: SwimlaneT, pixels: Pixels): Dimensions;
|
|
8
|
-
export declare function dateToPixel(date: Date, start: Date, pixels: Pixels): number;
|
|
9
|
-
export declare function offsetToPixel(offset: number, capacity: number, pixels: Pixels): number;
|
|
10
|
-
export declare function getItemPosition<T>(item: CoreItem<T>, swimlane: SwimlaneT, start: Date, pixels: Pixels): Position;
|
|
11
|
-
export declare function getGrabPosition(source: ElementDragPayload, location: DragLocationHistory): {
|
|
12
|
-
absolute: Position;
|
|
13
|
-
relative: Position;
|
|
14
|
-
};
|
|
15
|
-
export declare function getUpdatedItem<T>(oldItem: CoreItem<T>, swimlane: SwimlaneT, dropPreviewRect: Rectangle, pixels: Pixels, range: TimeRange): CoreItem<T>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
declare function TimelineLayout({ children }: PropsWithChildren<{}>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare namespace TimelineLayout {
|
|
4
|
-
var Header: typeof TimelineLayoutHeader;
|
|
5
|
-
var Body: typeof TimelineLayoutBody;
|
|
6
|
-
var Background: typeof TimelineLayoutBackground;
|
|
7
|
-
var Footer: typeof TimelineLayoutFooter;
|
|
8
|
-
var Aside: typeof TimelineLayoutAside;
|
|
9
|
-
var Corner: typeof TimelineLayoutCorner;
|
|
10
|
-
}
|
|
11
|
-
declare function TimelineLayoutHeader({ children }: PropsWithChildren<{}>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
declare function TimelineLayoutBackground({ children }: PropsWithChildren<{}>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
declare function TimelineLayoutBody({ children }: PropsWithChildren<{}>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
declare function TimelineLayoutFooter({ children }: PropsWithChildren<{}>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
interface TimelineLayoutAsideProps {
|
|
16
|
-
side?: "left" | "right";
|
|
17
|
-
}
|
|
18
|
-
declare function TimelineLayoutAside({ side, children, }: PropsWithChildren<TimelineLayoutAsideProps>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
interface TimelineLayoutCornerProps {
|
|
20
|
-
corner?: "top left" | "top right" | "bottom left" | "bottom right";
|
|
21
|
-
}
|
|
22
|
-
declare function TimelineLayoutCorner({ corner, children, }: PropsWithChildren<TimelineLayoutCornerProps>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export default TimelineLayout;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useTimelineContext: () => import('../components/TimelineSettingsContext').TimelineContextOuter;
|
package/dist/types/CoreItem.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ItemId } from './ItemId';
|
|
2
|
-
import { SwimlaneId } from './SwimlaneId';
|
|
3
|
-
export type CoreItem<T = void> = {
|
|
4
|
-
id: ItemId;
|
|
5
|
-
swimlaneId: SwimlaneId;
|
|
6
|
-
start: Date;
|
|
7
|
-
end: Date;
|
|
8
|
-
size: number;
|
|
9
|
-
offset: number;
|
|
10
|
-
payload: T;
|
|
11
|
-
};
|
|
12
|
-
export declare function isCoreItem(a: object): a is CoreItem;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type SwimlaneId = number;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|