react-timelane 0.0.0 → 0.0.1
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/TimelineAside.d.ts +13 -0
- package/dist/components/TimelineBackground.d.ts +5 -0
- package/dist/components/TimelineBody.d.ts +13 -0
- package/dist/components/TimelineHeader/DaysHeader.d.ts +15 -0
- package/dist/components/TimelineHeader/MonthsHeader.d.ts +15 -0
- package/dist/components/TimelineHeader/TimelineHeader.d.ts +24 -0
- package/dist/components/TimelineHeader/WeeksHeader.d.ts +15 -0
- package/dist/components/TimelineHeader/index.d.ts +5 -0
- package/dist/components/TimelineHeader/renderingUtils.d.ts +4 -0
- package/dist/components/TimelineSelectionLayer.d.ts +6 -0
- package/dist/components/TimelineSettingsContext.d.ts +7 -0
- package/dist/components/TimelineSettingsProvider.d.ts +7 -0
- package/dist/components/TimelineWrapper.d.ts +17 -0
- package/dist/components/core/CoreItem/CoreItemComponent.d.ts +14 -0
- package/dist/components/core/CoreItem/DragResizeComponent.d.ts +20 -0
- package/dist/components/core/CoreSwimlane/AvailableSpaceIndicator.d.ts +21 -0
- package/dist/components/core/CoreSwimlane/CoreSwimlane.d.ts +16 -0
- package/dist/components/core/CoreSwimlane/DropPreview.d.ts +9 -0
- package/dist/components/core/CoreSwimlane/DropTarget.d.ts +11 -0
- package/dist/components/core/CoreSwimlane/OverlapIndicator.d.ts +6 -0
- package/dist/components/core/CoreSwimlane/utils.d.ts +13 -0
- package/dist/components/core/utils.d.ts +15 -0
- package/dist/components/layout/TimelineLayout.d.ts +23 -0
- package/dist/hooks/useScroll.d.ts +10 -0
- package/dist/hooks/useTimelineContext.d.ts +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/react-timelane.css +1 -0
- package/dist/react-timelane.js +4744 -0
- package/dist/types/AvailableSpace.d.ts +6 -0
- package/dist/types/CoreItem.d.ts +12 -0
- package/dist/types/DateBounds.d.ts +4 -0
- package/dist/types/Dimensions.d.ts +4 -0
- package/dist/types/GrabInfo.d.ts +5 -0
- package/dist/types/Grid.d.ts +6 -0
- package/dist/types/OffsetBounds.d.ts +4 -0
- package/dist/types/Pixels.d.ts +4 -0
- package/{src/types/Position.ts → dist/types/Position.d.ts} +2 -2
- package/dist/types/Rectangle.d.ts +6 -0
- package/dist/types/SwimlaneT.d.ts +5 -0
- package/dist/types/TimeRange.d.ts +4 -0
- package/dist/types/TimelineSettings.d.ts +11 -0
- package/dist/types/index.d.ts +15 -0
- package/package.json +1 -1
- package/vite.config.ts +1 -1
- package/.github/workflows/static.yml +0 -55
- package/docs/README.md +0 -54
- package/docs/eslint.config.js +0 -28
- package/docs/index.html +0 -12
- package/docs/package-lock.json +0 -5101
- package/docs/package.json +0 -35
- package/docs/src/App.css +0 -5
- package/docs/src/App.tsx +0 -59
- package/docs/src/assets/react.svg +0 -1
- package/docs/src/components/AllocationComponent.tsx +0 -82
- package/docs/src/components/Timeline.tsx +0 -183
- package/docs/src/constants.ts +0 -42
- package/docs/src/hooks/useLocalStorage.ts +0 -21
- package/docs/src/main.tsx +0 -9
- package/docs/src/models/Allocation.ts +0 -11
- package/docs/src/models/AllocationId.ts +0 -1
- package/docs/src/models/Resource.ts +0 -8
- package/docs/src/models/ResourceId.ts +0 -1
- package/docs/src/vite-env.d.ts +0 -1
- package/docs/tsconfig.json +0 -27
- package/docs/vite.config.ts +0 -8
- package/src/components/Timeline.scss +0 -297
- package/src/components/TimelineAside.tsx +0 -81
- package/src/components/TimelineBackground.tsx +0 -53
- package/src/components/TimelineBody.tsx +0 -54
- package/src/components/TimelineHeader/DaysHeader.tsx +0 -44
- package/src/components/TimelineHeader/MonthsHeader.tsx +0 -62
- package/src/components/TimelineHeader/TimelineHeader.tsx +0 -64
- package/src/components/TimelineHeader/WeeksHeader.tsx +0 -63
- package/src/components/TimelineHeader/index.ts +0 -9
- package/src/components/TimelineHeader/renderingUtils.tsx +0 -57
- package/src/components/TimelineSelectionLayer.tsx +0 -179
- package/src/components/TimelineSettingsContext.tsx +0 -27
- package/src/components/TimelineSettingsProvider.tsx +0 -24
- package/src/components/TimelineWrapper.tsx +0 -51
- package/src/components/core/CoreItem/CoreItemComponent.tsx +0 -69
- package/src/components/core/CoreItem/DragResizeComponent.tsx +0 -180
- package/src/components/core/CoreSwimlane/AvailableSpaceIndicator.tsx +0 -156
- package/src/components/core/CoreSwimlane/CoreSwimlane.tsx +0 -245
- package/src/components/core/CoreSwimlane/DropPreview.tsx +0 -30
- package/src/components/core/CoreSwimlane/DropTarget.tsx +0 -83
- package/src/components/core/CoreSwimlane/OverlapIndicator.tsx +0 -22
- package/src/components/core/CoreSwimlane/utils.ts +0 -375
- package/src/components/core/utils.ts +0 -154
- package/src/components/layout/TimelineLayout.tsx +0 -93
- package/src/components/layout/layout.scss +0 -107
- package/src/global.d.ts +0 -9
- package/src/hooks/useScroll.tsx +0 -71
- package/src/hooks/useTimelineContext.tsx +0 -6
- package/src/index.ts +0 -15
- package/src/types/AvailableSpace.ts +0 -6
- package/src/types/CoreItem.ts +0 -23
- package/src/types/DateBounds.ts +0 -4
- package/src/types/Dimensions.ts +0 -4
- package/src/types/GrabInfo.ts +0 -6
- package/src/types/Grid.ts +0 -6
- package/src/types/OffsetBounds.ts +0 -4
- package/src/types/Pixels.ts +0 -4
- package/src/types/Rectangle.ts +0 -6
- package/src/types/SwimlaneT.ts +0 -6
- package/src/types/TimeRange.ts +0 -4
- package/src/types/TimelineSettings.ts +0 -11
- package/src/types/index.ts +0 -15
- package/tsconfig.json +0 -32
- /package/{src/types/ItemId.ts → dist/types/ItemId.d.ts} +0 -0
- /package/{src/types/SwimlaneId.ts → dist/types/SwimlaneId.d.ts} +0 -0
package/src/global.d.ts
DELETED
package/src/hooks/useScroll.tsx
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { ItemId, SwimlaneId } from "../types";
|
|
2
|
-
import { useTimelineContext } from "./useTimelineContext";
|
|
3
|
-
import { dateToPixel } from "../components/core/utils";
|
|
4
|
-
|
|
5
|
-
export const useScroll = () => {
|
|
6
|
-
const { settings } = useTimelineContext();
|
|
7
|
-
|
|
8
|
-
function scrollTo(destination: { horz?: Date; vert?: SwimlaneId } | ItemId) {
|
|
9
|
-
if (destination instanceof Object) {
|
|
10
|
-
if (destination.horz !== undefined) {
|
|
11
|
-
scrollToDate(destination.horz);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (destination.vert !== undefined) {
|
|
15
|
-
scrollToLane(destination.vert);
|
|
16
|
-
}
|
|
17
|
-
} else {
|
|
18
|
-
scrollToItem(destination);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function scrollToDate(date: Date) {
|
|
23
|
-
window.requestAnimationFrame(() => {
|
|
24
|
-
const el: HTMLElement | null = document.getElementById(
|
|
25
|
-
"timeline-background-date-anchor"
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
if (el) {
|
|
29
|
-
const offsetLeft: number = dateToPixel(date, settings.start, settings);
|
|
30
|
-
|
|
31
|
-
el.style.setProperty("left", `${offsetLeft}px`);
|
|
32
|
-
|
|
33
|
-
el.scrollIntoView({
|
|
34
|
-
block: "nearest",
|
|
35
|
-
inline: "center",
|
|
36
|
-
behavior: "smooth",
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function scrollToLane(laneId: SwimlaneId) {
|
|
43
|
-
window.requestAnimationFrame(() => {
|
|
44
|
-
const el: HTMLElement | null = document.getElementById(
|
|
45
|
-
`timeline-swimlane-${laneId}`
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
if (el) {
|
|
49
|
-
el.scrollIntoView({ block: "center", behavior: "smooth" });
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function scrollToItem(itemId: ItemId) {
|
|
55
|
-
window.requestAnimationFrame(() => {
|
|
56
|
-
const el: HTMLElement | null = document.getElementById(
|
|
57
|
-
`timeline-item-${itemId}`
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
if (el) {
|
|
61
|
-
el.scrollIntoView({
|
|
62
|
-
block: "center",
|
|
63
|
-
inline: "center",
|
|
64
|
-
behavior: "smooth",
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return { scrollTo, scrollToDate, scrollToItem, scrollToLane };
|
|
71
|
-
};
|
package/src/index.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { default as TimelineLayout } from "./components/layout/TimelineLayout";
|
|
2
|
-
export { default as TimelineAside } from "./components/TimelineAside";
|
|
3
|
-
export { default as TimelineBackground } from "./components/TimelineBackground";
|
|
4
|
-
export * from "./components/TimelineHeader";
|
|
5
|
-
export { default as TimelineWrapper } from "./components/TimelineWrapper";
|
|
6
|
-
export { default as CoreSwimlane } from "./components/core/CoreSwimlane/CoreSwimlane";
|
|
7
|
-
export { TimelineBody } from "./components/TimelineBody";
|
|
8
|
-
export { TimelineSelectionLayer } from "./components/TimelineSelectionLayer";
|
|
9
|
-
|
|
10
|
-
export * from "./types";
|
|
11
|
-
export * from "./components/core/utils";
|
|
12
|
-
export * from "./components/core/CoreSwimlane/utils";
|
|
13
|
-
|
|
14
|
-
export { useScroll } from "./hooks/useScroll";
|
|
15
|
-
export { useTimelineContext } from "./hooks/useTimelineContext";
|
package/src/types/CoreItem.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ItemId } from "./ItemId";
|
|
2
|
-
import { SwimlaneId } from "./SwimlaneId";
|
|
3
|
-
|
|
4
|
-
export type CoreItem<T = void> = {
|
|
5
|
-
id: ItemId;
|
|
6
|
-
swimlaneId: SwimlaneId;
|
|
7
|
-
start: Date;
|
|
8
|
-
end: Date;
|
|
9
|
-
size: number;
|
|
10
|
-
offset: number;
|
|
11
|
-
payload: T;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export function isCoreItem(a: object): a is CoreItem {
|
|
15
|
-
return (
|
|
16
|
-
"id" in a &&
|
|
17
|
-
"swimlaneId" in a &&
|
|
18
|
-
"start" in a &&
|
|
19
|
-
"end" in a &&
|
|
20
|
-
"size" in a &&
|
|
21
|
-
"offset" in a
|
|
22
|
-
);
|
|
23
|
-
}
|
package/src/types/DateBounds.ts
DELETED
package/src/types/Dimensions.ts
DELETED
package/src/types/GrabInfo.ts
DELETED
package/src/types/Grid.ts
DELETED
package/src/types/Pixels.ts
DELETED
package/src/types/Rectangle.ts
DELETED
package/src/types/SwimlaneT.ts
DELETED
package/src/types/TimeRange.ts
DELETED
package/src/types/index.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { type TimeRange } from "./TimeRange";
|
|
2
|
-
export { type Pixels } from "./Pixels";
|
|
3
|
-
export { type Rectangle } from "./Rectangle";
|
|
4
|
-
export { type Position } from "./Position";
|
|
5
|
-
export { type Grid } from "./Grid";
|
|
6
|
-
export { type ItemId } from "./ItemId";
|
|
7
|
-
export { type AvailableSpace } from "./AvailableSpace";
|
|
8
|
-
export { type CoreItem, isCoreItem } from "./CoreItem";
|
|
9
|
-
export { type Dimensions } from "./Dimensions";
|
|
10
|
-
export { type GrabInfo } from "./GrabInfo";
|
|
11
|
-
export { type SwimlaneId } from "./SwimlaneId";
|
|
12
|
-
export { type SwimlaneT } from "./SwimlaneT";
|
|
13
|
-
export { type DateBounds } from "./DateBounds";
|
|
14
|
-
export { type OffsetBounds } from "./OffsetBounds";
|
|
15
|
-
export { type TimelineSettings } from "./TimelineSettings";
|
package/tsconfig.json
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
-
"target": "ES2020",
|
|
5
|
-
"useDefineForClassFields": true,
|
|
6
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
7
|
-
"module": "ESNext",
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
|
|
10
|
-
/* Bundler mode */
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"allowImportingTsExtensions": true,
|
|
13
|
-
"verbatimModuleSyntax": false,
|
|
14
|
-
"moduleDetection": "force",
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
"jsx": "react-jsx",
|
|
17
|
-
"allowSyntheticDefaultImports": true,
|
|
18
|
-
"allowArbitraryExtensions": true,
|
|
19
|
-
"allowJs": true,
|
|
20
|
-
"isolatedModules": true,
|
|
21
|
-
|
|
22
|
-
/* Linting */
|
|
23
|
-
"strict": true,
|
|
24
|
-
"noUnusedLocals": true,
|
|
25
|
-
"noUnusedParameters": false,
|
|
26
|
-
"erasableSyntaxOnly": true,
|
|
27
|
-
"noFallthroughCasesInSwitch": true,
|
|
28
|
-
"noUncheckedSideEffectImports": true
|
|
29
|
-
},
|
|
30
|
-
"include": ["src"],
|
|
31
|
-
"exclude": ["docs"]
|
|
32
|
-
}
|
|
File without changes
|
|
File without changes
|