├── .eslintignore
├── .npmignore
├── .browserslistrc
├── .prettierrc
├── images
└── vue-dj-gantt-example1.png
├── .storybook
├── preview-head.html
├── preview.js
└── main.js
├── dev
├── serve.js
└── serve.vue
├── babel.config.js
├── .gitignore
├── .gitattributes
├── LICENSE
├── .eslintrc.js
├── src
├── stories
│ ├── assets
│ │ ├── direction.svg
│ │ ├── flow.svg
│ │ ├── code-brackets.svg
│ │ ├── comments.svg
│ │ ├── repo.svg
│ │ ├── plugin.svg
│ │ ├── stackalt.svg
│ │ └── colors.svg
│ ├── 02_LanguagesSupport.stories.js
│ └── 01_Basic.stories.js
├── entry.js
└── VueDjGantt.vue
├── README.md
└── package.json
/.eslintignore:
--------------------------------------------------------------------------------
1 | dist
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | node_modules
--------------------------------------------------------------------------------
/.browserslistrc:
--------------------------------------------------------------------------------
1 | current node
2 | last 2 versions and > 2%
3 | ie > 10
4 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "semi": true,
3 | "arrowParens": "always"
4 | }
5 |
--------------------------------------------------------------------------------
/images/vue-dj-gantt-example1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdoleczek/vue-dj-gantt/HEAD/images/vue-dj-gantt-example1.png
--------------------------------------------------------------------------------
/.storybook/preview-head.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/dev/serve.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import Dev from './serve.vue';
3 |
4 | Vue.config.productionTip = false;
5 |
6 | new Vue({
7 | render: (h) => h(Dev),
8 | }).$mount('#app');
9 |
--------------------------------------------------------------------------------
/.storybook/preview.js:
--------------------------------------------------------------------------------
1 |
2 | export const parameters = {
3 | actions: { argTypesRegex: "^on[A-Z].*" },
4 | options: {
5 | storySort: {
6 | order: ['01_Basic', '02_LanguagesSupport'],
7 | },
8 | },
9 | }
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | const devPresets = ['@vue/babel-preset-app'];
2 | const buildPresets = ['@babel/preset-env'];
3 | module.exports = {
4 | presets: (process.env.NODE_ENV === 'development' ? devPresets : buildPresets),
5 | };
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | cypress/videos
4 | cypress/screenshots
5 | /coverage.data
6 | /coverage/
7 | storybook-static
8 |
9 | # /dist
10 | coverage
11 | *.tgz
12 | tgz
13 |
14 | /dist-app
15 | /dist
16 | dist
17 | dist-app
18 |
19 | # local env files
20 | .env.local
21 | .env.*.local
22 |
23 | # Log files
24 | npm-debug.log*
25 | yarn-debug.log*
26 | yarn-error.log*
27 |
28 | # Editor directories and files
29 | .idea
30 | .vscode
31 | *.suo
32 | *.ntvs*
33 | *.njsproj
34 | *.sln
35 | *.sw?
36 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Handle line endings automatically for files detected as text
2 | # and leave all files detected as binary untouched.
3 | * text=auto
4 |
5 | # Never modify line endings of our bash scripts
6 | *.sh -crlf
7 |
8 | #
9 | # The above will handle all files NOT found below
10 | #
11 | # These files are text and should be normalized (Convert crlf => lf)
12 | *.css text
13 | *.html text
14 | *.java text
15 | *.js text
16 | *.json text
17 | *.properties text
18 | *.txt text
19 | *.xml text
20 | *.vue text
21 | *.scss text
22 |
23 | # These files are binary and should be left untouched
24 | # (binary is macro for -text -diff)
25 | *.class binary
26 | *.jar binary
27 | *.gif binary
28 | *.jpg binary
29 | *.png binary
30 |
--------------------------------------------------------------------------------
/.storybook/main.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 |
3 | module.exports = {
4 | "stories": [
5 | "../src/**/*.stories.mdx",
6 | "../src/**/*.stories.@(js|jsx|ts|tsx)"
7 | ],
8 | "addons": [
9 | "@storybook/addon-links",
10 | "@storybook/addon-essentials"
11 | ],
12 | webpackFinal: async (config, { configType }) => {
13 | // `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
14 | // You can change the configuration based on that.
15 | // 'PRODUCTION' is used when building the static version of storybook.
16 |
17 | // Make whatever fine-grained changes you need
18 | config.module.rules.push({
19 | test: /\.scss$/,
20 | use: ['style-loader', 'css-loader', 'sass-loader'],
21 | include: path.resolve(__dirname, '../'),
22 | });
23 |
24 | // Return the altered config
25 | return config;
26 | },
27 | }
28 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Petar Mitev
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | node: true,
5 | jest: true,
6 | },
7 | plugins: ["prettier"],
8 | extends: [
9 | "plugin:vue/recommended",
10 | // "airbnb-base",
11 | // "plugin:prettier/recommended",
12 | // "eslint:recommended",
13 | ],
14 | rules: {
15 | // "import/no-extraneous-dependencies": "off",
16 | // "no-console": "off",
17 | // "no-undef": "warn",
18 | // "no-unused-vars": "warn",
19 | // "no-underscore-dangle": "warn",
20 | // "prettier/prettier": "warn",
21 | // "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
22 | // "vue/singleline-html-element-content-newline": "off",
23 | "vue/require-default-prop": "off",
24 | "vue/order-in-components": "off",
25 | // "vue/html-closing-bracket-spacing": "off",
26 | "vue/max-attributes-per-line": [
27 | "error",
28 | {
29 | singleline: 5,
30 | multiline: {
31 | max: 5,
32 | allowFirstLine: true,
33 | },
34 | },
35 | ],
36 | },
37 | parserOptions: {
38 | parser: "babel-eslint",
39 | sourceType: "module",
40 | },
41 | };
42 |
--------------------------------------------------------------------------------
/src/stories/assets/direction.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/entry.js:
--------------------------------------------------------------------------------
1 | // Import vue component
2 | import component from '@/VueDjGantt.vue';
3 |
4 | // install function executed by Vue.use()
5 | const install = function installVueDjGantt(Vue) {
6 | if (install.installed) return;
7 | install.installed = true;
8 | Vue.component('VueDjGantt', component);
9 | };
10 |
11 | // Create module definition for Vue.use()
12 | const plugin = {
13 | install,
14 | };
15 |
16 | // To auto-install on non-es builds, when vue is found
17 | // eslint-disable-next-line no-redeclare
18 | /* global window, global */
19 | if ('false' === process.env.ES_BUILD) {
20 | let GlobalVue = null;
21 | if (typeof window !== 'undefined') {
22 | GlobalVue = window.Vue;
23 | } else if (typeof global !== 'undefined') {
24 | GlobalVue = global.Vue;
25 | }
26 | if (GlobalVue) {
27 | GlobalVue.use(plugin);
28 | }
29 | }
30 |
31 | // Inject install function into component - allows component
32 | // to be registered via Vue.use() as well as Vue.component()
33 | component.install = install;
34 |
35 | // Export component by default
36 | export default component;
37 |
38 | // It's possible to expose named exports when writing components that can
39 | // also be used as directives, etc. - eg. import { RollupDemoDirective } from 'rollup-demo';
40 | // export const RollupDemoDirective = component;
41 |
--------------------------------------------------------------------------------
/src/stories/assets/flow.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/stories/assets/code-brackets.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/stories/assets/comments.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/stories/assets/repo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/stories/assets/plugin.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/stories/assets/stackalt.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/dev/serve.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Basic usage
5 |
10 |
11 | No parameters
12 |
14 |
15 | Custom dates
16 |
24 |
25 | Play with height
26 |
34 |
35 |
36 |
37 |
38 |
107 |
108 |
118 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # vue-dj-gantt
6 |
7 | Simple Gantt diagram component for Vue.
8 |
9 | [Live demo](https://jdoleczek.github.io/vue-dj-gantt/) - with Storybook ( https://storybook.js.org/ )
10 |
11 | Inspired by: https://www.npmjs.com/package/gantt-vue \
12 | Created with: https://www.npmjs.com/package/vue-sfc-rollup
13 |
14 | ## Features
15 |
16 | - zoom ( CTRL + scroll ),
17 | - resize,
18 | - drag (only in row).
19 |
20 | ## Install
21 |
22 | ```
23 | npm i vue-dj-gantt
24 | ```
25 |
26 | ## Basic usage
27 |
28 | 
29 |
30 | ```xml
31 |
32 |
46 |
47 | ```
48 |
49 | ```javascript
50 |
119 | ```
120 |
121 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vue-dj-gantt",
3 | "version": "2.4.0",
4 | "description": "Simple Gantt diagram component for Vue.",
5 | "main": "dist/VueDjGantt.ssr.js",
6 | "browser": "dist/VueDjGantt.esm.js",
7 | "module": "dist/VueDjGantt.esm.js",
8 | "unpkg": "dist/VueDjGantt.min.js",
9 | "files": [
10 | "dist/*",
11 | "src/**/*.vue"
12 | ],
13 | "scripts": {
14 | "dev": "vue-cli-service serve dev/serve.js",
15 | "build": "cross-env NODE_ENV=production rollup --config build/rollup.config.js",
16 | "build:ssr": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format cjs",
17 | "build:es": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format es",
18 | "build:unpkg": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format iife",
19 | "storybook": "start-storybook -p 6006",
20 | "build-storybook": "build-storybook",
21 | "deploy-storybook": "storybook-to-ghpages"
22 | },
23 | "dependencies": {
24 | "moment": "^2.27.0"
25 | },
26 | "devDependencies": {
27 | "@babel/core": "^7.9.0",
28 | "@babel/preset-env": "^7.9.5",
29 | "@rollup/plugin-alias": "^2.2.0",
30 | "@rollup/plugin-commonjs": "^11.1.0",
31 | "@rollup/plugin-replace": "^2.3.2",
32 | "@storybook/addon-actions": "^6.0.21",
33 | "@storybook/addon-essentials": "^6.0.21",
34 | "@storybook/addon-links": "^6.0.21",
35 | "@storybook/storybook-deployer": "^2.8.6",
36 | "@storybook/vue": "^6.0.21",
37 | "@vue/cli-plugin-babel": "^4.3.1",
38 | "@vue/cli-service": "^5.0.8",
39 | "babel-loader": "^8.1.0",
40 | "cross-env": "^7.0.2",
41 | "minimist": "^1.2.5",
42 | "node-sass": "^4.14.1",
43 | "react-is": "^16.13.1",
44 | "rollup": "^2.7.3",
45 | "rollup-plugin-babel": "^4.4.0",
46 | "rollup-plugin-scss": "^2.6.0",
47 | "rollup-plugin-terser": "^5.3.0",
48 | "rollup-plugin-vue": "^6.0.0",
49 | "sass-loader": "^10.0.1",
50 | "vue": "^2.6.11",
51 | "vue-template-compiler": "^2.6.11"
52 | },
53 | "peerDependencies": {
54 | "vue": "^2.6.11"
55 | },
56 | "engines": {
57 | "node": ">=10"
58 | },
59 | "repository": {
60 | "type": "git",
61 | "url": "git+https://github.com/jdoleczek/vue-dj-gantt.git"
62 | },
63 | "keywords": [
64 | "gantt",
65 | "gantt js",
66 | "gantt chart",
67 | "javascript gantt",
68 | "javascript gantt chart",
69 | "vue gantt",
70 | "js gantt",
71 | "gantt-chart",
72 | "responsive",
73 | "vue",
74 | "vue-gantt",
75 | "project gantt",
76 | "responsive gantt",
77 | "gantt component",
78 | "vue gantt component",
79 | "vue dj"
80 | ],
81 | "author": "Jan Doleczek (https://doleczek.pl)",
82 | "license": "MIT",
83 | "bugs": {
84 | "url": "https://github.com/jdoleczek/vue-dj-gantt/issues"
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/src/stories/02_LanguagesSupport.stories.js:
--------------------------------------------------------------------------------
1 | import VueDjGantt from '../VueDjGantt.vue';
2 | import moment from "moment";
3 |
4 | const rows = ['First', 'Second', 'Third', 'Forth'].map((v, k) => ({
5 | id: k + 1,
6 | internalId: `#${k + 1}`,
7 | name: v,
8 | }));
9 |
10 | const momentLocales = [
11 | 'af',
12 | 'ar-dz',
13 | 'ar-kw',
14 | 'ar-ly',
15 | 'ar-ma',
16 | 'ar-sa',
17 | 'ar-tn',
18 | 'ar',
19 | 'az',
20 | 'be',
21 | 'bg',
22 | 'bm',
23 | 'bn',
24 | 'bo',
25 | 'br',
26 | 'bs',
27 | 'ca',
28 | 'cs',
29 | 'cv',
30 | 'cy',
31 | 'da',
32 | 'de-at',
33 | 'de-ch',
34 | 'de',
35 | 'dv',
36 | 'el',
37 | 'en-au',
38 | 'en-ca',
39 | 'en-gb',
40 | 'en-ie',
41 | 'en-nz',
42 | 'eo',
43 | 'es-do',
44 | 'es-us',
45 | 'es',
46 | 'et',
47 | 'eu',
48 | 'fa',
49 | 'fi',
50 | 'fo',
51 | 'fr-ca',
52 | 'fr-ch',
53 | 'fr',
54 | 'fy',
55 | 'gd',
56 | 'gl',
57 | 'gom-latn',
58 | 'gu',
59 | 'he',
60 | 'hi',
61 | 'hr',
62 | 'hu',
63 | 'hy-am',
64 | 'id',
65 | 'is',
66 | 'it',
67 | 'ja',
68 | 'jv',
69 | 'ka',
70 | 'kk',
71 | 'km',
72 | 'kn',
73 | 'ko',
74 | 'ky',
75 | 'lb',
76 | 'lo',
77 | 'lt',
78 | 'lv',
79 | 'me',
80 | 'mi',
81 | 'mk',
82 | 'ml',
83 | 'mr',
84 | 'ms-my',
85 | 'ms',
86 | 'mt',
87 | 'my',
88 | 'nb',
89 | 'ne',
90 | 'nl-be',
91 | 'nl',
92 | 'nn',
93 | 'pa-in',
94 | 'pl',
95 | 'pt-br',
96 | 'pt',
97 | 'ro',
98 | 'ru',
99 | 'sd',
100 | 'se',
101 | 'si',
102 | 'sk',
103 | 'sl',
104 | 'sq',
105 | 'sr-cyrl',
106 | 'sr',
107 | 'ss',
108 | 'sv',
109 | 'sw',
110 | 'ta',
111 | 'te',
112 | 'tet',
113 | 'th',
114 | 'tl-ph',
115 | 'tlh',
116 | 'tr',
117 | 'tzl',
118 | 'tzm-latn',
119 | 'tzm',
120 | 'uk',
121 | 'ur',
122 | 'uz-latn',
123 | 'uz',
124 | 'vi',
125 | 'x-pseudo',
126 | 'yo',
127 | 'zh-cn',
128 | 'zh-hk',
129 | 'zh-tw',
130 | ];
131 |
132 | export default {
133 | title: 'VueDjGantt/Languages support',
134 | component: VueDjGantt,
135 | argTypes: {
136 | locale: {
137 | description: 'language support (optional, default: en)',
138 | control: { type: 'select', options: momentLocales }
139 | },
140 |
141 | row: {
142 | description: 'triggered when row label is clicked',
143 | action: '@row',
144 | },
145 |
146 | item: {
147 | description: 'triggered when item is clicked',
148 | action: '@item',
149 | },
150 |
151 | cell: {
152 | description: 'triggered when cell is clicked',
153 | action: '@cell',
154 | },
155 |
156 | zoom: {
157 | description: 'triggered when zoom is changed',
158 | action: '@zoom',
159 | },
160 |
161 | scrollX: {
162 | description: 'triggered when x is scrolled',
163 | action: '@scrollX',
164 | },
165 |
166 | scrollY: {
167 | description: 'triggered when y is scrolled',
168 | action: '@scrollY',
169 | },
170 |
171 | timeSlot: {
172 | description: 'triggered when timeslot is clicked',
173 | action: '@timeslot',
174 | },
175 |
176 | resized: {
177 | description: 'triggered when item is resized',
178 | action: '@resized',
179 | },
180 |
181 | moved: {
182 | description: 'triggered when item is moved',
183 | action: '@moved',
184 | },
185 | },
186 | };
187 |
188 | const Template = (args, { argTypes }) => ({
189 | props: Object.keys(argTypes),
190 | data () {
191 | return {
192 | selectedLocale: 'pl',
193 | momentLocales,
194 | }
195 | },
196 | components: { VueDjGantt },
197 | template: `
198 |
199 |
200 |
201 |
209 |
210 |
219 |
220 | `,
221 | });
222 |
223 | export const BasicUsage = Template.bind({});
224 | BasicUsage.storyName = 'Just display items'
225 | BasicUsage.args = {
226 | list: [
227 | {
228 | id: "internalId",
229 | width: 80,
230 | header: {
231 | content: "# ID"
232 | }
233 | },
234 | {
235 | id: "name",
236 | width: 200,
237 | header: {
238 | content: "Resurce name"
239 | }
240 | },
241 | ],
242 |
243 | from: (+ +new Date()) - (3 * 24 * 60 * 60 * 1000),
244 | to: moment().startOf('day').add(1, 'months'),
245 |
246 | rows: rows,
247 |
248 | items: [
249 | {
250 | rowId: 1,
251 | label: `Some task`,
252 | style: {background: '#24abf2'},
253 | time: {
254 | start: (+ +new Date()) - (1.2 * 24 * 60 * 60 * 1000),
255 | end: (+ +new Date()) + (1 * 24 * 60 * 60 * 1000),
256 | },
257 | },
258 | {
259 | rowId: 2,
260 | label: `Other task`,
261 | style: {background: '#abf224'},
262 | time: {
263 | start: moment().add(12, 'hours'),
264 | end: moment().add(2, 'days').add(4, 'hours'),
265 | },
266 | },
267 | ],
268 |
269 | height: 0,
270 | };
271 |
--------------------------------------------------------------------------------
/src/stories/01_Basic.stories.js:
--------------------------------------------------------------------------------
1 | import VueDjGantt from '../VueDjGantt.vue';
2 | import moment from "moment";
3 |
4 | const rows = ['First', 'Second', 'Third', 'Forth'].map((v, k) => ({
5 | id: k + 1,
6 | internalId: `#${k + 1}`,
7 | name: v,
8 | }))
9 |
10 | export default {
11 | title: 'VueDjGantt/Basic usage',
12 | component: VueDjGantt,
13 | argTypes: {
14 | locale: {
15 | description: 'language support (optional, default: en)',
16 | control: { type: 'select', options: ['pl', 'en', 'es'] }
17 | },
18 |
19 | row: {
20 | description: 'triggered when row label is clicked',
21 | action: '@row',
22 | },
23 |
24 | item: {
25 | description: 'triggered when item is clicked',
26 | action: '@item',
27 | },
28 |
29 | cell: {
30 | description: 'triggered when cell is clicked',
31 | action: '@cell',
32 | },
33 |
34 | zoom: {
35 | description: 'triggered when zoom is changed',
36 | action: '@zoom',
37 | },
38 |
39 | scrollX: {
40 | description: 'triggered when x is scrolled',
41 | action: '@scrollX',
42 | },
43 |
44 | scrollY: {
45 | description: 'triggered when y is scrolled',
46 | action: '@scrollY',
47 | },
48 |
49 | timeSlot: {
50 | description: 'triggered when timeslot is clicked',
51 | action: '@timeslot',
52 | },
53 |
54 | resized: {
55 | description: 'triggered when item is resized',
56 | action: '@resized',
57 | },
58 |
59 | moved: {
60 | description: 'triggered when item is moved',
61 | action: '@moved',
62 | },
63 | },
64 | };
65 |
66 | const Template = (args, { argTypes }) => ({
67 | props: Object.keys(argTypes),
68 | components: { VueDjGantt },
69 | template: `
70 | `,
82 | });
83 |
84 | export const BasicUsage = Template.bind({});
85 | BasicUsage.storyName = 'Just display items'
86 | BasicUsage.args = {
87 | list: [
88 | {
89 | id: "internalId",
90 | width: 80,
91 | header: {
92 | content: "# ID"
93 | }
94 | },
95 | {
96 | id: "name",
97 | width: 200,
98 | header: {
99 | content: "Resurce name"
100 | }
101 | },
102 | ],
103 |
104 | from: (+ +new Date()) - (3 * 24 * 60 * 60 * 1000),
105 | to: moment().startOf('day').add(1, 'months'),
106 |
107 | rows: rows,
108 |
109 | items: [
110 | {
111 | rowId: 1,
112 | label: `Some task`,
113 | style: {background: '#24abf2'},
114 | time: {
115 | start: (+ +new Date()) - (1.2 * 24 * 60 * 60 * 1000),
116 | end: (+ +new Date()) + (1 * 24 * 60 * 60 * 1000),
117 | },
118 | },
119 | {
120 | rowId: 2,
121 | label: `Other task`,
122 | style: {background: '#abf224'},
123 | time: {
124 | start: moment().add(12, 'hours'),
125 | end: moment().add(2, 'days').add(4, 'hours'),
126 | },
127 | },
128 | ],
129 |
130 | locale: 'pl',
131 | height: 0,
132 | };
133 |
134 | export const FixedHeight = Template.bind({});
135 | FixedHeight.storyName = 'Fixed height'
136 | FixedHeight.args = {
137 | list: [
138 | {
139 | id: "internalId",
140 | width: 80,
141 | header: {
142 | content: "# ID"
143 | }
144 | },
145 | {
146 | id: "name",
147 | width: 200,
148 | header: {
149 | content: "Resurce name"
150 | }
151 | },
152 | ],
153 |
154 | from: (+ +new Date()) - (3 * 24 * 60 * 60 * 1000),
155 | to: moment().startOf('day').add(1, 'months'),
156 |
157 | rows: rows,
158 |
159 | items: [
160 | {
161 | rowId: 1,
162 | label: `Some task`,
163 | style: {background: '#24abf2'},
164 | time: {
165 | start: (+ +new Date()) - (1.2 * 24 * 60 * 60 * 1000),
166 | end: (+ +new Date()) + (1 * 24 * 60 * 60 * 1000),
167 | },
168 | },
169 | {
170 | rowId: 2,
171 | label: `Other task`,
172 | style: {background: '#abf224'},
173 | time: {
174 | start: moment().add(12, 'hours'),
175 | end: moment().add(2, 'days').add(4, 'hours'),
176 | },
177 | },
178 | ],
179 |
180 | locale: 'pl',
181 | height: 160,
182 | };
183 |
184 | export const MoveableAndResizable = Template.bind({});
185 | MoveableAndResizable.storyName = 'Move and resize'
186 | MoveableAndResizable.args = {
187 | list: [
188 | {
189 | id: "internalId",
190 | width: 80,
191 | header: {
192 | content: "# ID"
193 | }
194 | },
195 | {
196 | id: "name",
197 | width: 200,
198 | header: {
199 | content: "Resurce name"
200 | }
201 | },
202 | ],
203 |
204 | from: (+ +new Date()) - (3 * 24 * 60 * 60 * 1000),
205 | to: moment().startOf('day').add(1, 'months'),
206 |
207 | rows: rows,
208 |
209 | items: [
210 | {
211 | rowId: 1,
212 | label: `Some task`,
213 | style: {background: '#24abf2'},
214 | time: {
215 | start: (+ +new Date()) - (1.2 * 24 * 60 * 60 * 1000),
216 | end: (+ +new Date()) + (1 * 24 * 60 * 60 * 1000),
217 | },
218 | moveable: true,
219 | },
220 | {
221 | rowId: 2,
222 | label: `Other task`,
223 | style: {background: '#abf224'},
224 | time: {
225 | start: moment().add(12, 'hours'),
226 | end: moment().add(2, 'days').add(4, 'hours'),
227 | },
228 | moveable: true,
229 | resizable: true,
230 | },
231 | ],
232 |
233 | locale: 'pl',
234 | height: 0,
235 | };
236 |
--------------------------------------------------------------------------------
/src/stories/assets/colors.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/VueDjGantt.vue:
--------------------------------------------------------------------------------
1 |
2 |
207 |
208 |
209 |
838 |
839 |
1049 |
--------------------------------------------------------------------------------