react-timelane 1.0.0 → 1.0.2
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/package.json +8 -2
- package/.storybook/main.ts +0 -11
- package/.storybook/package.json +0 -3
- package/.storybook/preview.ts +0 -14
- package/dist/components/Timelane/Timelane.stories.d.ts +0 -19
- package/dist/components/TimelaneLane/TimelaneLane.stories.d.ts +0 -9
- package/dist/components/TimelaneSettingsProvider/TimelaneSettingsProvider.stories.d.ts +0 -9
- package/dist/stories/FullExamplePage/FullExamplePage.d.ts +0 -4
- package/dist/stories/FullExamplePage/FullExamplePage.stories.d.ts +0 -19
- package/dist/stories/FullExamplePage/MyTimelane.d.ts +0 -20
- package/dist/stories/constants.d.ts +0 -7
- package/dist/stories/hooks/useLocalStorage.d.ts +0 -2
- package/dist/stories/models/Allocation.d.ts +0 -11
- package/dist/stories/models/AllocationId.d.ts +0 -1
- package/dist/stories/models/Resource.d.ts +0 -7
- package/dist/stories/models/ResourceId.d.ts +0 -1
- package/eslint.config.js +0 -28
- package/index.html +0 -13
- package/vite.config.ts +0 -32
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-timelane",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite",
|
|
@@ -48,5 +48,11 @@
|
|
|
48
48
|
"default": "./dist/react-timelane.js"
|
|
49
49
|
},
|
|
50
50
|
"./style.css": "./dist/react-timelane.css"
|
|
51
|
-
}
|
|
51
|
+
},
|
|
52
|
+
"files": [
|
|
53
|
+
"dist",
|
|
54
|
+
"!dist/stories",
|
|
55
|
+
"!**/*.stories.ts",
|
|
56
|
+
"!**/*.stories.d.ts"
|
|
57
|
+
]
|
|
52
58
|
}
|
package/.storybook/main.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { StorybookConfig } from "@storybook/react-vite";
|
|
2
|
-
|
|
3
|
-
const config: StorybookConfig = {
|
|
4
|
-
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
|
|
5
|
-
addons: ["@chromatic-com/storybook", "@storybook/addon-docs"],
|
|
6
|
-
framework: {
|
|
7
|
-
name: "@storybook/react-vite",
|
|
8
|
-
options: {},
|
|
9
|
-
},
|
|
10
|
-
};
|
|
11
|
-
export default config;
|
package/.storybook/package.json
DELETED
package/.storybook/preview.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { Timelane as TL } from './Timelane';
|
|
3
|
-
import { TimelaneHeader } from '../TimelaneHeader';
|
|
4
|
-
import { TimelaneBody } from '../TimelaneBody/TimelaneBody';
|
|
5
|
-
import { TimelaneBackground } from '../TimelaneBackground/TimelaneBackground';
|
|
6
|
-
import { TimelaneLane } from '../TimelaneLane/TimelaneLane';
|
|
7
|
-
declare const meta: {
|
|
8
|
-
component: typeof TL;
|
|
9
|
-
tags: string[];
|
|
10
|
-
subcomponents: {
|
|
11
|
-
TimelaneHeader: typeof TimelaneHeader;
|
|
12
|
-
TimelaneBody: typeof TimelaneBody;
|
|
13
|
-
TimelaneBackground: typeof TimelaneBackground;
|
|
14
|
-
TimelaneLane: typeof TimelaneLane;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export default meta;
|
|
18
|
-
type Story = StoryObj<typeof meta>;
|
|
19
|
-
export declare const Primary: Story;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { TimelaneLane } from '../TimelaneLane/TimelaneLane';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
component: typeof TimelaneLane;
|
|
5
|
-
tags: string[];
|
|
6
|
-
};
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj<typeof meta>;
|
|
9
|
-
export declare const Primary: Story;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { TimelaneSettingsProvider } from './TimelaneSettingsProvider';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
component: typeof TimelaneSettingsProvider;
|
|
5
|
-
tags: string[];
|
|
6
|
-
};
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj<typeof meta>;
|
|
9
|
-
export declare const Primary: Story;
|
|
@@ -1,19 +0,0 @@
|
|
|
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;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { MouseEvent } from '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 {};
|
|
@@ -1,7 +0,0 @@
|
|
|
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[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type AllocationId = number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type ResourceId = number;
|
package/eslint.config.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
|
|
2
|
-
import storybook from "eslint-plugin-storybook";
|
|
3
|
-
|
|
4
|
-
import js from '@eslint/js'
|
|
5
|
-
import globals from 'globals'
|
|
6
|
-
import reactHooks from 'eslint-plugin-react-hooks'
|
|
7
|
-
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
8
|
-
import tseslint from 'typescript-eslint'
|
|
9
|
-
|
|
10
|
-
export default tseslint.config({ ignores: ['dist'] }, {
|
|
11
|
-
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
|
12
|
-
files: ['**/*.{ts,tsx}'],
|
|
13
|
-
languageOptions: {
|
|
14
|
-
ecmaVersion: 2020,
|
|
15
|
-
globals: globals.browser,
|
|
16
|
-
},
|
|
17
|
-
plugins: {
|
|
18
|
-
'react-hooks': reactHooks,
|
|
19
|
-
'react-refresh': reactRefresh,
|
|
20
|
-
},
|
|
21
|
-
rules: {
|
|
22
|
-
...reactHooks.configs.recommended.rules,
|
|
23
|
-
'react-refresh/only-export-components': [
|
|
24
|
-
'warn',
|
|
25
|
-
{ allowConstantExport: true },
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
}, storybook.configs["flat/recommended"]);
|
package/index.html
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>react-timelane</title>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="root"></div>
|
|
11
|
-
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|
package/vite.config.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "vite";
|
|
2
|
-
import { resolve } from "path";
|
|
3
|
-
import react from "@vitejs/plugin-react";
|
|
4
|
-
import dts from "vite-plugin-dts";
|
|
5
|
-
// import vitePluginSass from "vite-plugin-sass";
|
|
6
|
-
|
|
7
|
-
// https://vite.dev/config/
|
|
8
|
-
export default defineConfig({
|
|
9
|
-
plugins: [
|
|
10
|
-
react(),
|
|
11
|
-
// vitePluginSass(),
|
|
12
|
-
dts({ include: ["src"], exclude: ["docs", ".github"] }),
|
|
13
|
-
],
|
|
14
|
-
build: {
|
|
15
|
-
lib: {
|
|
16
|
-
entry: resolve(__dirname, "src/index.ts"),
|
|
17
|
-
formats: ["es"],
|
|
18
|
-
},
|
|
19
|
-
rollupOptions: {
|
|
20
|
-
external: ["react", "react/jsx-runtime"],
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
// css: {
|
|
24
|
-
// preprocessorOptions: {
|
|
25
|
-
// scss: {
|
|
26
|
-
// additionalData: `
|
|
27
|
-
// @import "TimelaneV3/layout/layout.scss";
|
|
28
|
-
// `,
|
|
29
|
-
// },
|
|
30
|
-
// },
|
|
31
|
-
// },
|
|
32
|
-
});
|