react-timelane 0.0.4 → 0.0.6
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/.storybook/main.ts +11 -0
- package/.storybook/package.json +3 -0
- package/.storybook/preview.ts +14 -0
- package/LICENSE +21 -0
- package/README.md +5 -16
- package/dist/components/Timelane/Timelane.d.ts +38 -0
- package/dist/components/Timelane/Timelane.stories.d.ts +19 -0
- package/dist/components/TimelaneAllocation/TimelaneAllocation.d.ts +10 -0
- package/dist/components/{TimelaneAside.d.ts → TimelaneAside/TimelaneAside.d.ts} +2 -3
- package/dist/components/{TimelaneBackground.d.ts → TimelaneBackground/TimelaneBackground.d.ts} +1 -2
- package/dist/components/{TimelaneBody.d.ts → TimelaneBody/TimelaneBody.d.ts} +1 -2
- package/dist/components/{TimelaneBodyInner.d.ts → TimelaneBody/TimelaneBodyInner.d.ts} +1 -1
- package/dist/components/TimelaneHeader/DaysHeader.d.ts +1 -2
- package/dist/components/TimelaneHeader/MonthsHeader.d.ts +1 -2
- package/dist/components/TimelaneHeader/TimelaneHeader.d.ts +1 -2
- package/dist/components/TimelaneHeader/WeeksHeader.d.ts +1 -2
- package/dist/components/TimelaneHeader/index.d.ts +4 -4
- package/dist/components/TimelaneLane/TimelaneLane.d.ts +1 -2
- package/dist/components/TimelaneLane/TimelaneLane.stories.d.ts +9 -0
- package/dist/components/{TimelaneSettingsContext.d.ts → TimelaneSettingsProvider/TimelaneSettingsContext.d.ts} +1 -1
- package/dist/components/TimelaneSettingsProvider/TimelaneSettingsProvider.d.ts +11 -0
- package/dist/components/TimelaneSettingsProvider/TimelaneSettingsProvider.stories.d.ts +9 -0
- package/dist/hooks/useTimelaneContext.d.ts +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/react-timelane.css +1 -1
- package/dist/react-timelane.js +3465 -3406
- package/dist/stories/FullExamplePage/FullExamplePage.d.ts +4 -0
- package/dist/stories/FullExamplePage/FullExamplePage.stories.d.ts +19 -0
- package/dist/stories/FullExamplePage/MyTimelane.d.ts +20 -0
- package/dist/stories/constants.d.ts +7 -0
- package/dist/stories/hooks/useLocalStorage.d.ts +2 -0
- package/dist/stories/models/Allocation.d.ts +11 -0
- package/dist/stories/models/AllocationId.d.ts +1 -0
- package/dist/stories/models/Resource.d.ts +7 -0
- package/dist/stories/models/ResourceId.d.ts +1 -0
- package/dist/types/EnableResizing.d.ts +6 -0
- package/dist/types/Pixels.d.ts +1 -1
- package/dist/types/TimelaneSettings.d.ts +4 -1
- package/dist/types/index.d.ts +1 -0
- package/eslint.config.js +21 -21
- package/package.json +11 -2
- package/storybook-static/addon-visual-tests-assets/visual-test-illustration.mp4 +0 -0
- package/storybook-static/assets/Color-AVL7NMMY-B90CyoR2.js +1 -0
- package/storybook-static/assets/DocsRenderer-PQXLIZUC-Bq83urOe.js +2 -0
- package/storybook-static/assets/FullExamplePage-DfmTY2HY.css +1 -0
- package/storybook-static/assets/FullExamplePage.stories-2F7rFo1o.js +18 -0
- package/storybook-static/assets/Timelane-Dz9QoO0k.css +1 -0
- package/storybook-static/assets/Timelane-S9mAxniK.js +177 -0
- package/storybook-static/assets/Timelane.stories-eJTFFqOc.js +15 -0
- package/storybook-static/assets/TimelaneLane.stories-D-gkVkkl.js +37 -0
- package/storybook-static/assets/TimelaneSettingsProvider.stories-Ca_yRNCX.js +28 -0
- package/storybook-static/assets/blocks-Cs-T3qmo.js +658 -0
- package/storybook-static/assets/iframe-CoOaxin5.js +1124 -0
- package/storybook-static/assets/index-BFqcmZp8.js +9 -0
- package/storybook-static/assets/index-CKqcs_aQ.js +9 -0
- package/storybook-static/assets/index-Dn1Kba0m.js +1 -0
- package/storybook-static/assets/react-18-CSTqcdyU.js +25 -0
- package/storybook-static/components/Timelane/Timelane.d.ts +38 -0
- package/storybook-static/components/Timelane/Timelane.stories.d.ts +19 -0
- package/storybook-static/components/TimelaneAllocation/TimelaneAllocation.d.ts +10 -0
- package/storybook-static/components/TimelaneAside/TimelaneAside.d.ts +12 -0
- package/storybook-static/components/TimelaneBackground/TimelaneBackground.d.ts +4 -0
- package/storybook-static/components/TimelaneBody/TimelaneBody.d.ts +5 -0
- package/storybook-static/components/TimelaneBody/TimelaneBodyInner.d.ts +16 -0
- package/storybook-static/components/TimelaneBody/TimelaneSelectionLayer.d.ts +6 -0
- package/storybook-static/components/TimelaneHeader/DaysHeader.d.ts +14 -0
- package/storybook-static/components/TimelaneHeader/MonthsHeader.d.ts +14 -0
- package/storybook-static/components/TimelaneHeader/TimelaneHeader.d.ts +23 -0
- package/storybook-static/components/TimelaneHeader/WeeksHeader.d.ts +14 -0
- package/storybook-static/components/TimelaneHeader/index.d.ts +5 -0
- package/storybook-static/components/TimelaneHeader/renderingUtils.d.ts +4 -0
- package/storybook-static/components/TimelaneItem/DragResizeComponent.d.ts +20 -0
- package/storybook-static/components/TimelaneItem/TimelaneItem.d.ts +14 -0
- package/storybook-static/components/TimelaneLane/AvailableSpaceIndicator.d.ts +21 -0
- package/storybook-static/components/TimelaneLane/DropPreview.d.ts +9 -0
- package/storybook-static/components/TimelaneLane/DropTarget.d.ts +11 -0
- package/storybook-static/components/TimelaneLane/OverlapIndicator.d.ts +6 -0
- package/storybook-static/components/TimelaneLane/TimelaneLane.d.ts +15 -0
- package/storybook-static/components/TimelaneLane/TimelaneLane.stories.d.ts +9 -0
- package/storybook-static/components/TimelaneLayout/TimelaneLayout.d.ts +23 -0
- package/storybook-static/components/TimelaneSettingsProvider/TimelaneSettingsContext.d.ts +7 -0
- package/storybook-static/components/TimelaneSettingsProvider/TimelaneSettingsProvider.d.ts +11 -0
- package/storybook-static/components/TimelaneSettingsProvider/TimelaneSettingsProvider.stories.d.ts +9 -0
- package/storybook-static/components/utils.d.ts +27 -0
- package/storybook-static/favicon.svg +1 -0
- package/storybook-static/hooks/useScroll.d.ts +10 -0
- package/storybook-static/hooks/useTimelaneContext.d.ts +1 -0
- package/storybook-static/iframe.html +685 -0
- package/storybook-static/index.d.ts +12 -0
- package/storybook-static/index.html +152 -0
- package/storybook-static/index.json +1 -0
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-1/manager-bundle.js +356 -0
- package/storybook-static/sb-addons/chromatic-com-storybook-1/manager-bundle.js.LEGAL.txt +40 -0
- package/storybook-static/sb-addons/docs-2/manager-bundle.js +151 -0
- package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +188 -0
- package/storybook-static/sb-common-assets/favicon.svg +1 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +797 -0
- package/storybook-static/sb-manager/globals-runtime.js +72136 -0
- package/storybook-static/sb-manager/globals.js +34 -0
- package/storybook-static/sb-manager/runtime.js +13002 -0
- package/storybook-static/stories/FullExamplePage/FullExamplePage.d.ts +4 -0
- package/storybook-static/stories/FullExamplePage/FullExamplePage.stories.d.ts +19 -0
- package/storybook-static/stories/FullExamplePage/MyTimelane.d.ts +20 -0
- package/storybook-static/stories/constants.d.ts +7 -0
- package/storybook-static/stories/hooks/useLocalStorage.d.ts +2 -0
- package/storybook-static/stories/models/Allocation.d.ts +11 -0
- package/storybook-static/stories/models/AllocationId.d.ts +1 -0
- package/storybook-static/stories/models/Resource.d.ts +7 -0
- package/storybook-static/stories/models/ResourceId.d.ts +1 -0
- package/storybook-static/types/AvailableSpace.d.ts +6 -0
- package/storybook-static/types/DateBounds.d.ts +4 -0
- package/storybook-static/types/Dimensions.d.ts +4 -0
- package/storybook-static/types/EnableResizing.d.ts +6 -0
- package/storybook-static/types/GrabInfo.d.ts +5 -0
- package/storybook-static/types/Grid.d.ts +6 -0
- package/storybook-static/types/Item.d.ts +12 -0
- package/storybook-static/types/ItemId.d.ts +1 -0
- package/storybook-static/types/Lane.d.ts +5 -0
- package/storybook-static/types/LaneId.d.ts +1 -0
- package/storybook-static/types/OffsetBounds.d.ts +4 -0
- package/storybook-static/types/Pixels.d.ts +4 -0
- package/storybook-static/types/Position.d.ts +4 -0
- package/storybook-static/types/Rectangle.d.ts +6 -0
- package/storybook-static/types/TimeRange.d.ts +4 -0
- package/storybook-static/types/TimelaneSettings.d.ts +14 -0
- package/storybook-static/types/index.d.ts +16 -0
- package/dist/components/Timelane.d.ts +0 -17
- package/dist/components/TimelaneSettingsProvider.d.ts +0 -7
- package/dist/components/TimelaneWrapper.d.ts +0 -20
- /package/dist/components/{TimelaneSelectionLayer.d.ts → TimelaneBody/TimelaneSelectionLayer.d.ts} +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { FullExamplePage } from './FullExamplePage';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof FullExamplePage;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
argTypes: {
|
|
10
|
+
showDays: {
|
|
11
|
+
control: {
|
|
12
|
+
type: "boolean";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
export declare const Example: Story;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MouseEvent } from '../../../node_modules/react';
|
|
2
|
+
import { default as Allocation } from '../models/Allocation';
|
|
3
|
+
import { default as Resource } from '../models/Resource';
|
|
4
|
+
import { TimelaneProps } from '../../components/Timelane/Timelane';
|
|
5
|
+
interface MyTimelaneProps {
|
|
6
|
+
resources: Resource[];
|
|
7
|
+
allocations: Allocation[];
|
|
8
|
+
focusedDay?: Date | null;
|
|
9
|
+
timelaneParameters: TimelaneProps;
|
|
10
|
+
setFocusedResource?: (resource: Resource | null) => void;
|
|
11
|
+
setFocusedDay?: (day: Date | null) => void;
|
|
12
|
+
onAllocationCreate?: (allocation: Allocation) => void;
|
|
13
|
+
onAllocationUpdate?: (allocation: Allocation) => void;
|
|
14
|
+
onAllocationDelete?: (allocation: Allocation) => void;
|
|
15
|
+
onAllocationClick?: (allocation: Allocation, e: MouseEvent | null) => void;
|
|
16
|
+
onAllocationContextMenu?: (allocation: Allocation, e: MouseEvent) => void;
|
|
17
|
+
onAreaClick?: (area: Resource, e: MouseEvent) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function MyTimelane({ resources, allocations, focusedDay, timelaneParameters, setFocusedDay, onAllocationCreate, onAllocationUpdate, }: MyTimelaneProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as Allocation } from './models/Allocation';
|
|
2
|
+
import { default as Resource } from './models/Resource';
|
|
3
|
+
export declare const DEFAULT_ALLOCATION_COLOR = "#A7C7E7";
|
|
4
|
+
export declare const DEFAULT_ALLOCATION_DESCRIPTION = "empty description";
|
|
5
|
+
export declare const DEFAULT_ALLOCATION_NAME = "New Allocation";
|
|
6
|
+
export declare const DEFAULT_RESOURCES: Resource[];
|
|
7
|
+
export declare const DEFAULT_ALLOCATIONS: Allocation[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type AllocationId = number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ResourceId = number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ItemId } from './ItemId';
|
|
2
|
+
import { LaneId } from './LaneId';
|
|
3
|
+
export type Item<T = void> = {
|
|
4
|
+
id: ItemId;
|
|
5
|
+
laneId: 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 ItemId = number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type LaneId = number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EnableResizing } from './EnableResizing';
|
|
2
|
+
export interface TimelaneSettings {
|
|
3
|
+
start: Date;
|
|
4
|
+
end: Date;
|
|
5
|
+
pixelsPerDay: number;
|
|
6
|
+
pixelsPerLane: number;
|
|
7
|
+
showMonths: boolean;
|
|
8
|
+
showWeeks: boolean;
|
|
9
|
+
showDays: boolean;
|
|
10
|
+
allowOverlaps: boolean;
|
|
11
|
+
focusedDate: Date | null;
|
|
12
|
+
enableItemResizing: boolean | EnableResizing;
|
|
13
|
+
enableItemDragging: boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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 Item, isItem } from './Item';
|
|
9
|
+
export { type Dimensions } from './Dimensions';
|
|
10
|
+
export { type GrabInfo } from './GrabInfo';
|
|
11
|
+
export { type LaneId } from './LaneId';
|
|
12
|
+
export { type Lane } from './Lane';
|
|
13
|
+
export { type DateBounds } from './DateBounds';
|
|
14
|
+
export { type OffsetBounds } from './OffsetBounds';
|
|
15
|
+
export { type TimelaneSettings } from './TimelaneSettings';
|
|
16
|
+
export { type EnableResizing } from './EnableResizing';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { TimelaneLane } from './TimelaneLane/TimelaneLane';
|
|
3
|
-
import { TimelaneBody } from './TimelaneBody';
|
|
4
|
-
import { TimelaneLayout } from './TimelaneLayout/TimelaneLayout';
|
|
5
|
-
import { TimelaneHeader } from './TimelaneHeader/TimelaneHeader';
|
|
6
|
-
import { TimelaneBackground } from './TimelaneBackground';
|
|
7
|
-
import { TimelaneAside } from './TimelaneAside';
|
|
8
|
-
export declare function Timelane({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare namespace Timelane {
|
|
10
|
-
var Container: typeof Timelane;
|
|
11
|
-
var Header: typeof TimelaneHeader;
|
|
12
|
-
var Body: typeof TimelaneBody;
|
|
13
|
-
var Background: typeof TimelaneBackground;
|
|
14
|
-
var Aside: typeof TimelaneAside;
|
|
15
|
-
var Lane: typeof TimelaneLane;
|
|
16
|
-
var Layout: typeof TimelaneLayout;
|
|
17
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { TimelaneSettings } from '../types/TimelaneSettings';
|
|
3
|
-
interface TimelaneSettingsProviderProps {
|
|
4
|
-
settings: TimelaneSettings;
|
|
5
|
-
}
|
|
6
|
-
export declare const TimelaneSettingsProvider: ({ settings: _settings, children, }: PropsWithChildren<TimelaneSettingsProviderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { Lane } from '../types';
|
|
3
|
-
interface TimelaneWrapperProps {
|
|
4
|
-
focusedDay?: Date | null;
|
|
5
|
-
focusedLane?: Lane | null;
|
|
6
|
-
start?: Date;
|
|
7
|
-
end?: Date;
|
|
8
|
-
pixelsPerDay?: number;
|
|
9
|
-
pixelsPerResource?: number;
|
|
10
|
-
showMonths?: boolean;
|
|
11
|
-
showWeeks?: boolean;
|
|
12
|
-
showDays?: boolean;
|
|
13
|
-
allowOverlaps?: boolean;
|
|
14
|
-
focusedDate?: Date | null;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated The component should not be used
|
|
18
|
-
*/
|
|
19
|
-
export default function TimelaneWrapper({ children, start, end, pixelsPerDay, pixelsPerResource, showMonths, showWeeks, showDays, allowOverlaps, focusedDate, }: PropsWithChildren<TimelaneWrapperProps>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export {};
|
/package/dist/components/{TimelaneSelectionLayer.d.ts → TimelaneBody/TimelaneSelectionLayer.d.ts}
RENAMED
|
File without changes
|