@worktile/gantt 11.0.2 → 12.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/.all-contributorsrc +53 -0
- package/.angulardoc.json +4 -0
- package/.circleci/config.yml +17 -0
- package/.coveralls.yml +1 -0
- package/.docgenirc.js +64 -0
- package/.editorconfig +22 -0
- package/.prettierrc +24 -0
- package/.travis.yml +23 -0
- package/CHANGELOG.md +564 -0
- package/Dockerfile +4 -0
- package/LICENSE +21 -0
- package/README.md +116 -13
- package/angular.json +136 -0
- package/docs/guides/basic/components.md +54 -0
- package/docs/guides/basic/event.md +70 -0
- package/docs/guides/basic/index.md +4 -0
- package/docs/guides/basic/style.md +68 -0
- package/docs/guides/basic/type.md +70 -0
- package/docs/guides/basic/usage.md +189 -0
- package/docs/guides/index.md +5 -0
- package/docs/guides/intro/getting-started.md +79 -0
- package/docs/guides/intro/index.md +51 -0
- package/docs/index.md +0 -0
- package/example/browserslist +12 -0
- package/example/src/app/app-routing.module.ts +26 -0
- package/example/src/app/app.component.html +2 -0
- package/example/src/app/app.component.ts +11 -0
- package/example/src/app/app.module.ts +57 -0
- package/example/src/app/components/components.component.html +6 -0
- package/example/src/app/components/components.component.ts +33 -0
- package/example/src/app/configuration/parameters/api/zh-cn.js +350 -0
- package/example/src/app/configuration/parameters/doc/zh-cn.md +5 -0
- package/example/src/app/gantt/gantt.component.html +51 -0
- package/example/src/app/gantt/gantt.component.ts +119 -0
- package/example/src/app/gantt-advanced/component/flat.component.html +30 -0
- package/example/src/app/gantt-advanced/component/flat.component.ts +72 -0
- package/example/src/app/gantt-advanced/component/flat.scss +31 -0
- package/example/src/app/gantt-advanced/gantt-advanced.component.html +32 -0
- package/example/src/app/gantt-advanced/gantt-advanced.component.ts +34 -0
- package/example/src/app/gantt-advanced/mocks.ts +158 -0
- package/example/src/app/gantt-groups/gantt-groups.component.html +42 -0
- package/example/src/app/gantt-groups/gantt-groups.component.ts +62 -0
- package/example/src/app/gantt-range/gantt-range.component.html +66 -0
- package/example/src/app/gantt-range/gantt-range.component.ts +67 -0
- package/example/src/app/gantt-range/mocks.ts +150 -0
- package/example/src/app/helper.ts +38 -0
- package/example/src/assets/.gitkeep +0 -0
- package/example/src/environments/environment.prod.ts +3 -0
- package/example/src/environments/environment.ts +16 -0
- package/example/src/favicon.ico +0 -0
- package/example/src/index.html +13 -0
- package/example/src/main.ts +12 -0
- package/example/src/polyfills.ts +63 -0
- package/example/src/styles.scss +56 -0
- package/example/tsconfig.app.json +18 -0
- package/nginx.conf +17 -0
- package/package.json +113 -17
- package/packages/gantt/README.md +24 -0
- package/packages/gantt/karma.conf.js +46 -0
- package/packages/gantt/ng-package.json +7 -0
- package/packages/gantt/ng-package.prod.json +7 -0
- package/packages/gantt/package.json +16 -0
- package/packages/gantt/src/class/date-point.ts +14 -0
- package/{class/event.d.ts → packages/gantt/src/class/event.ts} +12 -6
- package/packages/gantt/src/class/group.ts +36 -0
- package/{class/index.d.ts → packages/gantt/src/class/index.ts} +0 -0
- package/packages/gantt/src/class/item.ts +129 -0
- package/packages/gantt/src/class/test/group.spec.ts +21 -0
- package/packages/gantt/src/class/test/item.spec.ts +102 -0
- package/packages/gantt/src/class/view-type.ts +7 -0
- package/packages/gantt/src/components/bar/bar-drag.ts +298 -0
- package/packages/gantt/src/components/bar/bar.component.html +17 -0
- package/packages/gantt/src/components/bar/bar.component.scss +169 -0
- package/packages/gantt/src/components/bar/bar.component.ts +109 -0
- package/packages/gantt/src/components/bar/test/bar.component.spec.ts +54 -0
- package/packages/gantt/src/components/bar/test/bar.drag.spec.ts +196 -0
- package/packages/gantt/src/components/calendar/calendar.component.html +52 -0
- package/packages/gantt/src/components/calendar/calendar.component.scss +77 -0
- package/packages/gantt/src/components/calendar/calendar.component.ts +100 -0
- package/packages/gantt/src/components/drag-backdrop/drag-backdrop.component.html +6 -0
- package/packages/gantt/src/components/drag-backdrop/drag-backdrop.component.scss +48 -0
- package/packages/gantt/src/components/drag-backdrop/drag-backdrop.component.ts +13 -0
- package/packages/gantt/src/components/icon/icon.component.scss +13 -0
- package/packages/gantt/src/components/icon/icon.component.ts +28 -0
- package/packages/gantt/src/components/icon/icons.ts +86 -0
- package/packages/gantt/src/components/links/links.component.html +19 -0
- package/packages/gantt/src/components/links/links.component.scss +27 -0
- package/packages/gantt/src/components/links/links.component.ts +263 -0
- package/packages/gantt/src/components/main/gantt-main.component.html +35 -0
- package/packages/gantt/src/components/main/gantt-main.component.ts +35 -0
- package/packages/gantt/src/components/range/range.component.html +8 -0
- package/packages/gantt/src/components/range/range.component.scss +35 -0
- package/packages/gantt/src/components/range/range.component.ts +27 -0
- package/packages/gantt/src/components/range/test/range.component.spec.ts +80 -0
- package/packages/gantt/src/components/table/gantt-table.component.html +105 -0
- package/packages/gantt/src/components/table/gantt-table.component.scss +144 -0
- package/packages/gantt/src/components/table/gantt-table.component.ts +166 -0
- package/packages/gantt/src/components/table/test/table.spec.ts +129 -0
- package/packages/gantt/src/gantt-abstract.ts +14 -0
- package/packages/gantt/src/gantt-dom.service.ts +134 -0
- package/packages/gantt/src/gantt-drag-container.ts +73 -0
- package/packages/gantt/src/gantt-item-upper.ts +50 -0
- package/packages/gantt/src/gantt-print.service.ts +104 -0
- package/packages/gantt/src/gantt-upper.ts +289 -0
- package/packages/gantt/src/gantt.component.html +18 -0
- package/packages/gantt/src/gantt.component.scss +77 -0
- package/packages/gantt/src/gantt.component.ts +134 -0
- package/packages/gantt/src/gantt.module.ts +47 -0
- package/packages/gantt/src/gantt.pipe.ts +31 -0
- package/packages/gantt/src/gantt.styles.ts +28 -0
- package/{public-api.d.ts → packages/gantt/src/public-api.ts} +6 -0
- package/packages/gantt/src/root.component.html +12 -0
- package/packages/gantt/src/root.component.ts +121 -0
- package/packages/gantt/src/styles/index.scss +9 -0
- package/packages/gantt/src/styles/variables.scss +46 -0
- package/packages/gantt/src/table/gantt-column.component.ts +25 -0
- package/packages/gantt/src/table/gantt-table.component.ts +14 -0
- package/packages/gantt/src/table/test/table.spec.ts +56 -0
- package/packages/gantt/src/test/gantt.component.spec.ts +404 -0
- package/packages/gantt/src/test/mocks/data.ts +303 -0
- package/packages/gantt/src/test.ts +21 -0
- package/packages/gantt/src/utils/date.ts +276 -0
- package/packages/gantt/src/utils/helpers.ts +66 -0
- package/packages/gantt/src/utils/test/date.spec.ts +105 -0
- package/packages/gantt/src/utils/test/helpers.spec.ts +73 -0
- package/packages/gantt/src/utils/testing.ts +64 -0
- package/packages/gantt/src/views/day.ts +74 -0
- package/packages/gantt/src/views/factory.ts +25 -0
- package/packages/gantt/src/views/month.ts +66 -0
- package/packages/gantt/src/views/quarter.ts +68 -0
- package/packages/gantt/src/views/test/day.spec.ts +45 -0
- package/packages/gantt/src/views/test/factory.spec.ts +41 -0
- package/packages/gantt/src/views/test/mock.ts +14 -0
- package/packages/gantt/src/views/test/month.spec.ts +45 -0
- package/packages/gantt/src/views/test/quarter.spec.ts +45 -0
- package/packages/gantt/src/views/test/view.spec.ts +144 -0
- package/packages/gantt/src/views/test/week.spec.ts +45 -0
- package/packages/gantt/src/views/test/year.spec.ts +45 -0
- package/packages/gantt/src/views/view.ts +186 -0
- package/packages/gantt/src/views/week.ts +66 -0
- package/packages/gantt/src/views/year.ts +62 -0
- package/packages/gantt/tsconfig.lib.json +20 -0
- package/packages/gantt/tsconfig.lib.prod.json +9 -0
- package/packages/gantt/tsconfig.schematics.json +25 -0
- package/packages/gantt/tsconfig.spec.json +17 -0
- package/packages/gantt/tslint.json +18 -0
- package/scss-bundle.config.json +7 -0
- package/tsconfig.json +26 -0
- package/tslint.json +51 -0
- package/bundles/worktile-gantt.umd.js +0 -3129
- package/bundles/worktile-gantt.umd.js.map +0 -1
- package/bundles/worktile-gantt.umd.min.js +0 -16
- package/bundles/worktile-gantt.umd.min.js.map +0 -1
- package/class/date-point.d.ts +0 -15
- package/class/group.d.ts +0 -22
- package/class/item.d.ts +0 -70
- package/class/view-type.d.ts +0 -7
- package/components/bar/bar-drag.d.ts +0 -34
- package/components/bar/bar.component.d.ts +0 -23
- package/components/calendar/calendar.component.d.ts +0 -25
- package/components/drag-backdrop/drag-backdrop.component.d.ts +0 -6
- package/components/icon/icon.component.d.ts +0 -10
- package/components/icon/icons.d.ts +0 -8
- package/components/links/links.component.d.ts +0 -44
- package/components/main/gantt-main.component.d.ts +0 -18
- package/components/range/range.component.d.ts +0 -10
- package/components/table/gantt-table.component.d.ts +0 -31
- package/esm2015/class/date-point.js +0 -10
- package/esm2015/class/event.js +0 -13
- package/esm2015/class/group.js +0 -17
- package/esm2015/class/index.js +0 -6
- package/esm2015/class/item.js +0 -78
- package/esm2015/class/view-type.js +0 -9
- package/esm2015/components/bar/bar-drag.js +0 -266
- package/esm2015/components/bar/bar.component.js +0 -91
- package/esm2015/components/calendar/calendar.component.js +0 -82
- package/esm2015/components/drag-backdrop/drag-backdrop.component.js +0 -18
- package/esm2015/components/icon/icon.component.js +0 -36
- package/esm2015/components/icon/icons.js +0 -87
- package/esm2015/components/links/links.component.js +0 -207
- package/esm2015/components/main/gantt-main.component.js +0 -35
- package/esm2015/components/range/range.component.js +0 -32
- package/esm2015/components/table/gantt-table.component.js +0 -128
- package/esm2015/gantt-dom.service.js +0 -101
- package/esm2015/gantt-drag-container.js +0 -57
- package/esm2015/gantt-item-upper.js +0 -55
- package/esm2015/gantt-print.service.js +0 -92
- package/esm2015/gantt-upper.js +0 -231
- package/esm2015/gantt.component.js +0 -105
- package/esm2015/gantt.module.js +0 -43
- package/esm2015/gantt.pipe.js +0 -33
- package/esm2015/gantt.styles.js +0 -15
- package/esm2015/public-api.js +0 -16
- package/esm2015/root.component.js +0 -111
- package/esm2015/table/gantt-column.component.js +0 -28
- package/esm2015/table/gantt-table.component.js +0 -18
- package/esm2015/utils/date.js +0 -160
- package/esm2015/utils/helpers.js +0 -45
- package/esm2015/views/day.js +0 -54
- package/esm2015/views/factory.js +0 -23
- package/esm2015/views/month.js +0 -48
- package/esm2015/views/quarter.js +0 -51
- package/esm2015/views/view.js +0 -121
- package/esm2015/views/week.js +0 -49
- package/esm2015/views/year.js +0 -50
- package/esm2015/worktile-gantt.js +0 -16
- package/fesm2015/worktile-gantt.js +0 -2491
- package/fesm2015/worktile-gantt.js.map +0 -1
- package/gantt-dom.service.d.ts +0 -29
- package/gantt-drag-container.d.ts +0 -20
- package/gantt-item-upper.d.ts +0 -17
- package/gantt-print.service.d.ts +0 -10
- package/gantt-upper.d.ts +0 -62
- package/gantt.component.d.ts +0 -28
- package/gantt.module.d.ts +0 -2
- package/gantt.pipe.d.ts +0 -11
- package/gantt.styles.d.ts +0 -15
- package/root.component.d.ts +0 -25
- package/style.scss +0 -645
- package/table/gantt-column.component.d.ts +0 -12
- package/table/gantt-table.component.d.ts +0 -7
- package/utils/date.d.ts +0 -59
- package/utils/helpers.d.ts +0 -11
- package/views/day.d.ts +0 -14
- package/views/factory.d.ts +0 -8
- package/views/month.d.ts +0 -12
- package/views/quarter.d.ts +0 -12
- package/views/view.d.ts +0 -56
- package/views/week.d.ts +0 -12
- package/views/year.d.ts +0 -12
- package/worktile-gantt.d.ts +0 -15
- package/worktile-gantt.metadata.json +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { enableProdMode } from '@angular/core';
|
|
2
|
+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
3
|
+
|
|
4
|
+
import { AppModule } from './app/app.module';
|
|
5
|
+
import { environment } from './environments/environment';
|
|
6
|
+
|
|
7
|
+
if (environment.production) {
|
|
8
|
+
enableProdMode();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
platformBrowserDynamic().bootstrapModule(AppModule)
|
|
12
|
+
.catch(err => console.error(err));
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file includes polyfills needed by Angular and is loaded before the app.
|
|
3
|
+
* You can add your own extra polyfills to this file.
|
|
4
|
+
*
|
|
5
|
+
* This file is divided into 2 sections:
|
|
6
|
+
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
|
|
7
|
+
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
|
|
8
|
+
* file.
|
|
9
|
+
*
|
|
10
|
+
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
|
|
11
|
+
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
|
|
12
|
+
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
|
|
13
|
+
*
|
|
14
|
+
* Learn more in https://angular.io/guide/browser-support
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/***************************************************************************************************
|
|
18
|
+
* BROWSER POLYFILLS
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
|
|
22
|
+
// import 'classlist.js'; // Run `npm install --save classlist.js`.
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Web Animations `@angular/platform-browser/animations`
|
|
26
|
+
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
|
|
27
|
+
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
|
|
28
|
+
*/
|
|
29
|
+
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* By default, zone.js will patch all possible macroTask and DomEvents
|
|
33
|
+
* user can disable parts of macroTask/DomEvents patch by setting following flags
|
|
34
|
+
* because those flags need to be set before `zone.js` being loaded, and webpack
|
|
35
|
+
* will put import in the top of bundle, so user need to create a separate file
|
|
36
|
+
* in this directory (for example: zone-flags.ts), and put the following flags
|
|
37
|
+
* into that file, and then add the following code before importing zone.js.
|
|
38
|
+
* import './zone-flags.ts';
|
|
39
|
+
*
|
|
40
|
+
* The flags allowed in zone-flags.ts are listed here.
|
|
41
|
+
*
|
|
42
|
+
* The following flags will work for all browsers.
|
|
43
|
+
*
|
|
44
|
+
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
|
|
45
|
+
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
|
|
46
|
+
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
|
|
47
|
+
*
|
|
48
|
+
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
|
|
49
|
+
* with the following flag, it will bypass `zone.js` patch for IE/Edge
|
|
50
|
+
*
|
|
51
|
+
* (window as any).__Zone_enable_cross_context_check = true;
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
/***************************************************************************************************
|
|
56
|
+
* Zone JS is required by default for Angular itself.
|
|
57
|
+
*/
|
|
58
|
+
import 'zone.js'; // Included with Angular CLI.
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
/***************************************************************************************************
|
|
62
|
+
* APPLICATION IMPORTS
|
|
63
|
+
*/
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* You can add global styles to this file, and also import other style files */
|
|
2
|
+
|
|
3
|
+
// docgeni
|
|
4
|
+
|
|
5
|
+
$primary:#348fe4;
|
|
6
|
+
|
|
7
|
+
@import '../../packages/gantt/src/styles/index.scss';
|
|
8
|
+
@import '~@docgeni/template/styles/index.scss';
|
|
9
|
+
@import "~ngx-tethys/styles/main.bundle.scss";
|
|
10
|
+
|
|
11
|
+
.gantt-demo {
|
|
12
|
+
height: 100%;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
background: #eee;
|
|
16
|
+
padding: 20px;
|
|
17
|
+
|
|
18
|
+
.gantt-demo-header {
|
|
19
|
+
height: 50px;
|
|
20
|
+
background: #fff;
|
|
21
|
+
padding: 0px 20px;
|
|
22
|
+
margin-bottom: 15px;
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
|
|
26
|
+
.header-section {
|
|
27
|
+
margin-right: 20px;
|
|
28
|
+
|
|
29
|
+
&-title {
|
|
30
|
+
font-weight: bold;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.gantt-demo-content {
|
|
36
|
+
flex: 1;
|
|
37
|
+
height: 1px;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.gantt-example-content {
|
|
42
|
+
margin-left: 300px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.gantt-example-component {
|
|
46
|
+
display: block;
|
|
47
|
+
margin: 20px;
|
|
48
|
+
border: 1px solid #eee;
|
|
49
|
+
height: calc(100vh - 95px);
|
|
50
|
+
|
|
51
|
+
.thy-layout-header {
|
|
52
|
+
.layout-header-title {
|
|
53
|
+
display: none;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "../../out-tsc/app",
|
|
5
|
+
"types": []
|
|
6
|
+
},
|
|
7
|
+
"files": [
|
|
8
|
+
"src/main.ts",
|
|
9
|
+
"src/polyfills.ts"
|
|
10
|
+
],
|
|
11
|
+
"include": [
|
|
12
|
+
"src/**/*.d.ts"
|
|
13
|
+
],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"src/test.ts",
|
|
16
|
+
"src/**/*.spec.ts"
|
|
17
|
+
]
|
|
18
|
+
}
|
package/nginx.conf
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
server {
|
|
2
|
+
listen 8080;
|
|
3
|
+
|
|
4
|
+
location / {
|
|
5
|
+
|
|
6
|
+
if ($request_filename ~ .*\.(htm|html)$) {
|
|
7
|
+
add_header Cache-Control no-cache;
|
|
8
|
+
}
|
|
9
|
+
try_files $uri $uri/ /index.html;
|
|
10
|
+
port_in_redirect off;
|
|
11
|
+
proxy_redirect off;
|
|
12
|
+
proxy_set_header Host $host;
|
|
13
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
14
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
15
|
+
proxy_set_header X-Forwarded-Proto http;
|
|
16
|
+
}
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,20 +1,116 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@worktile/gantt",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
"version": "12.0.1",
|
|
4
|
+
"description": "A modern and powerful gantt chart component for Angular",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"gantt",
|
|
7
|
+
"angular gantt",
|
|
8
|
+
"ngx gantt"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"ng": "ng",
|
|
12
|
+
"start": "docgeni serve",
|
|
13
|
+
"build:docs": "docgeni build",
|
|
14
|
+
"build": "npm run build:lib && npm run build:lib:scss",
|
|
15
|
+
"build:lib": "ng build gantt --configuration production",
|
|
16
|
+
"build:lib:scss": "scss-bundle -c scss-bundle.config.json",
|
|
17
|
+
"test": "ng test",
|
|
18
|
+
"lint": "ng lint",
|
|
19
|
+
"e2e": "ng e2e",
|
|
20
|
+
"release": "standard-version",
|
|
21
|
+
"pub-only": "cd dist/gantt && npm publish --access=public",
|
|
22
|
+
"pub": "npm run build && npm run pub-only",
|
|
23
|
+
"report-coverage": "cat ./coverage/gantt/lcov.info | coveralls",
|
|
24
|
+
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --pkg ./packages/gantt/package.json",
|
|
25
|
+
"contributors:init": "all-contributors init",
|
|
26
|
+
"contributors:add": "all-contributors add",
|
|
27
|
+
"contributors:generate": "all-contributors generate"
|
|
28
|
+
},
|
|
17
29
|
"dependencies": {
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
30
|
+
"@angular/animations": "~12.1.2",
|
|
31
|
+
"@angular/cdk": "~11.2.12",
|
|
32
|
+
"@angular/common": "~12.1.2",
|
|
33
|
+
"@angular/compiler": "~12.1.2",
|
|
34
|
+
"@angular/core": "~12.1.2",
|
|
35
|
+
"@angular/forms": "~12.1.2",
|
|
36
|
+
"@angular/platform-browser": "~12.1.2",
|
|
37
|
+
"@angular/platform-browser-dynamic": "~12.1.2",
|
|
38
|
+
"@angular/router": "~12.1.2",
|
|
39
|
+
"@types/es6-promise": "^3.3.0",
|
|
40
|
+
"date-fns": "^2.14.0",
|
|
41
|
+
"html2canvas": "1.0.0-rc.7",
|
|
42
|
+
"ngx-tethys": "^11.0.4",
|
|
43
|
+
"rxjs": "~6.6.3",
|
|
44
|
+
"tslib": "^2.0.0",
|
|
45
|
+
"zone.js": "~0.11.4"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@angular-devkit/build-angular": "~12.1.2",
|
|
49
|
+
"@angular/cli": "~12.1.2",
|
|
50
|
+
"@angular/compiler-cli": "~12.1.2",
|
|
51
|
+
"@angular/language-service": "~12.1.2",
|
|
52
|
+
"@commitlint/cli": "^7.5.2",
|
|
53
|
+
"@commitlint/config-conventional": "^7.5.0",
|
|
54
|
+
"@docgeni/cli": "1.0.7",
|
|
55
|
+
"@docgeni/template": "1.0.7",
|
|
56
|
+
"@types/jasmine": "~3.6.0",
|
|
57
|
+
"@types/jasminewd2": "~2.0.3",
|
|
58
|
+
"@types/node": "^12.11.1",
|
|
59
|
+
"codelyzer": "^6.0.0",
|
|
60
|
+
"concurrently": "^5.2.0",
|
|
61
|
+
"conventional-changelog-cli": "^2.0.12",
|
|
62
|
+
"coveralls": "^3.0.6",
|
|
63
|
+
"fs-extra": "^9.0.0",
|
|
64
|
+
"jasmine-core": "~3.6.0",
|
|
65
|
+
"jasmine-spec-reporter": "~5.0.0",
|
|
66
|
+
"karma": "~6.3.4",
|
|
67
|
+
"karma-chrome-launcher": "~3.1.0",
|
|
68
|
+
"karma-coverage": "~2.0.3",
|
|
69
|
+
"karma-jasmine": "~4.0.0",
|
|
70
|
+
"karma-jasmine-html-reporter": "^1.5.0",
|
|
71
|
+
"all-contributors-cli": "^6.6.0",
|
|
72
|
+
"ng-packagr": "^12.1.2",
|
|
73
|
+
"path": "^0.12.7",
|
|
74
|
+
"pretty-quick": "^1.10.0",
|
|
75
|
+
"protractor": "~7.0.0",
|
|
76
|
+
"scss-bundle": "^3.1.2",
|
|
77
|
+
"standard-version": "^8.0.1",
|
|
78
|
+
"ts-node": "~8.3.0",
|
|
79
|
+
"tslint": "~6.1.3",
|
|
80
|
+
"typescript": "~4.3.5"
|
|
81
|
+
},
|
|
82
|
+
"husky": {
|
|
83
|
+
"hooks": {
|
|
84
|
+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
|
|
85
|
+
"pre-commit": "pretty-quick --staged"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"standard-version": {
|
|
89
|
+
"bumpFiles": [
|
|
90
|
+
"package.json",
|
|
91
|
+
"package-lock.json",
|
|
92
|
+
"packages/gantt/package.json"
|
|
93
|
+
],
|
|
94
|
+
"header": "Changelog\nAll notable changes to ngx-gantt will be documented in this file.\n",
|
|
95
|
+
"tagPrefix": "",
|
|
96
|
+
"skip": {
|
|
97
|
+
"tag": true,
|
|
98
|
+
"commit": true
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"main": ".docgenirc.js",
|
|
102
|
+
"directories": {
|
|
103
|
+
"doc": "docs",
|
|
104
|
+
"example": "example"
|
|
105
|
+
},
|
|
106
|
+
"repository": {
|
|
107
|
+
"type": "git",
|
|
108
|
+
"url": "git+https://github.com/worktile/ngx-gantt.git"
|
|
109
|
+
},
|
|
110
|
+
"author": "walkerkay001",
|
|
111
|
+
"license": "ISC",
|
|
112
|
+
"bugs": {
|
|
113
|
+
"url": "https://github.com/worktile/ngx-gantt/issues"
|
|
114
|
+
},
|
|
115
|
+
"homepage": "https://github.com/worktile/ngx-gantt#readme"
|
|
116
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Gantt
|
|
2
|
+
|
|
3
|
+
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.14.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Run `ng generate component component-name --project gantt` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project gantt`.
|
|
8
|
+
> Note: Don't forget to add `--project gantt` or else it will be added to the default project in your `angular.json` file.
|
|
9
|
+
|
|
10
|
+
## Build
|
|
11
|
+
|
|
12
|
+
Run `ng build gantt` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
13
|
+
|
|
14
|
+
## Publishing
|
|
15
|
+
|
|
16
|
+
After building your library with `ng build gantt`, go to the dist folder `cd dist/gantt` and run `npm publish`.
|
|
17
|
+
|
|
18
|
+
## Running unit tests
|
|
19
|
+
|
|
20
|
+
Run `ng test gantt` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
21
|
+
|
|
22
|
+
## Further help
|
|
23
|
+
|
|
24
|
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Karma configuration file, see link for more information
|
|
2
|
+
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
3
|
+
|
|
4
|
+
module.exports = function (config) {
|
|
5
|
+
config.set({
|
|
6
|
+
basePath: '',
|
|
7
|
+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
|
8
|
+
plugins: [
|
|
9
|
+
require('karma-jasmine'),
|
|
10
|
+
require('karma-chrome-launcher'),
|
|
11
|
+
require('karma-jasmine-html-reporter'),
|
|
12
|
+
require('karma-coverage'),
|
|
13
|
+
require('@angular-devkit/build-angular/plugins/karma')
|
|
14
|
+
],
|
|
15
|
+
client: {
|
|
16
|
+
jasmine: {
|
|
17
|
+
// you can add configuration options for Jasmine here
|
|
18
|
+
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
|
19
|
+
// for example, you can disable the random execution with `random: false`
|
|
20
|
+
// or set a specific seed with `seed: 4321`
|
|
21
|
+
random: false
|
|
22
|
+
},
|
|
23
|
+
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
24
|
+
},
|
|
25
|
+
coverageReporter: {
|
|
26
|
+
dir: require('path').join(__dirname, '../../coverage/gantt'),
|
|
27
|
+
subdir: '.',
|
|
28
|
+
fixWebpackSourcePaths: true,
|
|
29
|
+
reporters: [{ type: 'html' }, { type: 'lcovonly' }, { type: 'text-summary' }]
|
|
30
|
+
},
|
|
31
|
+
reporters: ['progress', 'kjhtml'],
|
|
32
|
+
port: 9876,
|
|
33
|
+
colors: true,
|
|
34
|
+
logLevel: config.LOG_INFO,
|
|
35
|
+
autoWatch: true,
|
|
36
|
+
browsers: ['Chrome'],
|
|
37
|
+
singleRun: false,
|
|
38
|
+
restartOnFileChange: true,
|
|
39
|
+
customLaunchers: {
|
|
40
|
+
ChromeHeadlessCI: {
|
|
41
|
+
base: 'ChromeHeadless',
|
|
42
|
+
flags: ['--no-sandbox']
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@worktile/gantt",
|
|
3
|
+
"version": "12.0.1",
|
|
4
|
+
"schematics": "./schematics/collection.json",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "../../node_modules/.bin/tsc -p tsconfig.schematics.json",
|
|
7
|
+
"copy:schemas": "cp --parents schematics/*/schema.json ../../dist/gantt/",
|
|
8
|
+
"copy:files": "cp --parents -p schematics/*/files/** ../../dist/gantt/",
|
|
9
|
+
"copy:collection": "cp schematics/collection.json ../../dist/gantt/schematics/collection.json",
|
|
10
|
+
"postbuild": "npm run copy:schemas && npm run copy:files && npm run copy:collection"
|
|
11
|
+
},
|
|
12
|
+
"peerDependencies": {
|
|
13
|
+
"@angular/common": "^12.0.0",
|
|
14
|
+
"@angular/core": "^12.0.0"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GanttDate } from '../utils/date';
|
|
2
|
+
|
|
3
|
+
export class GanttDatePoint {
|
|
4
|
+
constructor(
|
|
5
|
+
public start: GanttDate,
|
|
6
|
+
public text: string,
|
|
7
|
+
public x: number,
|
|
8
|
+
public y: number,
|
|
9
|
+
public additions?: {
|
|
10
|
+
isWeekend: boolean;
|
|
11
|
+
isToday: boolean;
|
|
12
|
+
}
|
|
13
|
+
) {}
|
|
14
|
+
}
|
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
import { QueryList } from '@angular/core';
|
|
2
2
|
import { NgxGanttTableColumnComponent } from '../table/gantt-column.component';
|
|
3
3
|
import { GanttItem } from './item';
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
export class GanttDragEvent<T = unknown> {
|
|
5
6
|
item: GanttItem<T>;
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
export class GanttTableEvent {
|
|
8
10
|
columns: QueryList<NgxGanttTableColumnComponent>;
|
|
9
11
|
}
|
|
10
|
-
|
|
12
|
+
|
|
13
|
+
export class GanttLinkDragEvent<T = unknown> {
|
|
11
14
|
source: GanttItem<T>;
|
|
12
15
|
target?: GanttItem<T>;
|
|
13
16
|
}
|
|
14
|
-
|
|
17
|
+
|
|
18
|
+
export class GanttLoadOnScrollEvent {
|
|
15
19
|
start: number;
|
|
16
20
|
end: number;
|
|
17
21
|
}
|
|
18
|
-
|
|
22
|
+
|
|
23
|
+
export class GanttLineClickEvent<T = unknown> {
|
|
19
24
|
event: MouseEvent;
|
|
20
25
|
source: GanttItem<T>;
|
|
21
26
|
target: GanttItem<T>;
|
|
22
27
|
}
|
|
23
|
-
|
|
28
|
+
|
|
29
|
+
export class GanttBarClickEvent<T = unknown> {
|
|
24
30
|
event: Event;
|
|
25
31
|
item: GanttItem<T>;
|
|
26
32
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { GanttItemInternal } from './item';
|
|
2
|
+
|
|
3
|
+
export interface GanttGroup<T = unknown> {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
expanded?: boolean;
|
|
7
|
+
origin?: T;
|
|
8
|
+
class?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class GanttGroupInternal {
|
|
12
|
+
id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
origin: GanttGroup;
|
|
15
|
+
items: GanttItemInternal[];
|
|
16
|
+
mergedItems: GanttItemInternal[][];
|
|
17
|
+
expanded?: boolean;
|
|
18
|
+
refs?: {
|
|
19
|
+
height?: number;
|
|
20
|
+
} = {};
|
|
21
|
+
class?: string;
|
|
22
|
+
constructor(group: GanttGroup) {
|
|
23
|
+
this.id = group.id;
|
|
24
|
+
this.origin = group;
|
|
25
|
+
this.title = group.title;
|
|
26
|
+
this.expanded = group.expanded === undefined ? true : group.expanded;
|
|
27
|
+
this.items = [];
|
|
28
|
+
this.mergedItems = [[]];
|
|
29
|
+
this.class = group.class || '';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
setExpand(expanded: boolean) {
|
|
33
|
+
this.expanded = expanded;
|
|
34
|
+
this.origin.expanded = expanded;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { GanttDate } from '../utils/date';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
import { GanttViewType } from './view-type';
|
|
4
|
+
|
|
5
|
+
interface GanttItemRefs {
|
|
6
|
+
width: number;
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export enum GanttItemType {
|
|
12
|
+
bar = 'bar',
|
|
13
|
+
range = 'range',
|
|
14
|
+
custom = 'custom'
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface GanttItem<T = unknown> {
|
|
18
|
+
id: string;
|
|
19
|
+
title: string;
|
|
20
|
+
start?: number;
|
|
21
|
+
end?: number;
|
|
22
|
+
group_id?: string;
|
|
23
|
+
links?: string[];
|
|
24
|
+
draggable?: boolean;
|
|
25
|
+
linkable?: boolean;
|
|
26
|
+
expandable?: boolean;
|
|
27
|
+
expanded?: boolean;
|
|
28
|
+
children?: GanttItem[];
|
|
29
|
+
color?: string;
|
|
30
|
+
barStyle?: Partial<CSSStyleDeclaration>;
|
|
31
|
+
origin?: T;
|
|
32
|
+
type?: GanttItemType;
|
|
33
|
+
progress?: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class GanttItemInternal {
|
|
37
|
+
id: string;
|
|
38
|
+
title: string;
|
|
39
|
+
start: GanttDate;
|
|
40
|
+
end: GanttDate;
|
|
41
|
+
links: string[];
|
|
42
|
+
color?: string;
|
|
43
|
+
barStyle?: Partial<CSSStyleDeclaration>;
|
|
44
|
+
draggable?: boolean;
|
|
45
|
+
linkable?: boolean;
|
|
46
|
+
origin: GanttItem;
|
|
47
|
+
expandable?: boolean;
|
|
48
|
+
expanded?: boolean;
|
|
49
|
+
loading: boolean;
|
|
50
|
+
children: GanttItemInternal[];
|
|
51
|
+
type?: GanttItemType;
|
|
52
|
+
progress?: number;
|
|
53
|
+
viewType?: GanttViewType;
|
|
54
|
+
|
|
55
|
+
get refs() {
|
|
56
|
+
return this.refs$.getValue();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
refs$ = new BehaviorSubject<{ width: number; x?: number; y?: number }>(null);
|
|
60
|
+
|
|
61
|
+
constructor(item: GanttItem, options?: { viewType: GanttViewType }) {
|
|
62
|
+
this.origin = item;
|
|
63
|
+
this.id = this.origin.id;
|
|
64
|
+
this.links = this.origin.links || [];
|
|
65
|
+
this.color = this.origin.color;
|
|
66
|
+
this.barStyle = this.origin.barStyle;
|
|
67
|
+
this.linkable = this.origin.linkable === undefined ? true : this.origin.linkable;
|
|
68
|
+
this.draggable = this.origin.draggable === undefined ? true : this.origin.draggable;
|
|
69
|
+
this.expandable = this.origin.expandable || (this.origin.children || []).length > 0;
|
|
70
|
+
this.expanded = this.origin.expanded === undefined ? false : this.origin.expanded;
|
|
71
|
+
this.start = item.start ? new GanttDate(item.start) : null;
|
|
72
|
+
this.end = item.end ? new GanttDate(item.end) : null;
|
|
73
|
+
this.viewType = options && options.viewType ? options.viewType : GanttViewType.month;
|
|
74
|
+
this.children = (item.children || []).map((subItem) => {
|
|
75
|
+
return new GanttItemInternal(subItem, { viewType: this.viewType });
|
|
76
|
+
});
|
|
77
|
+
this.type = this.origin.type || GanttItemType.bar;
|
|
78
|
+
this.progress = this.origin.progress;
|
|
79
|
+
// fill one month when start or end is null
|
|
80
|
+
this.fillItemStartOrEnd(item);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
fillItemStartOrEnd(item: GanttItem) {
|
|
84
|
+
let addInterval: number;
|
|
85
|
+
switch (this.viewType) {
|
|
86
|
+
case GanttViewType.day:
|
|
87
|
+
case GanttViewType.week:
|
|
88
|
+
addInterval = 0;
|
|
89
|
+
break;
|
|
90
|
+
default:
|
|
91
|
+
addInterval = 30;
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
if (item.start && !item.end) {
|
|
95
|
+
this.end = new GanttDate(item.start).addDays(addInterval).endOfDay();
|
|
96
|
+
}
|
|
97
|
+
if (!item.start && item.end) {
|
|
98
|
+
this.start = new GanttDate(item.end).addDays(-addInterval).startOfDay();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
updateRefs(refs: GanttItemRefs) {
|
|
103
|
+
this.refs$.next(refs);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
updateDate(start: GanttDate, end: GanttDate) {
|
|
107
|
+
this.start = start.startOfDay();
|
|
108
|
+
this.end = end.endOfDay();
|
|
109
|
+
this.origin.start = this.start.getUnixTime();
|
|
110
|
+
this.origin.end = this.end.getUnixTime();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
addChildren(items: GanttItem[]) {
|
|
114
|
+
this.origin.children = items;
|
|
115
|
+
this.children = (items || []).map((subItem) => {
|
|
116
|
+
return new GanttItemInternal(subItem, { viewType: this.viewType });
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
setExpand(expanded: boolean) {
|
|
121
|
+
this.expanded = expanded;
|
|
122
|
+
this.origin.expanded = expanded;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
addLink(linkId: string) {
|
|
126
|
+
this.links = [...this.links, linkId];
|
|
127
|
+
this.origin.links = this.links;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { GanttDate } from '../../utils/date';
|
|
2
|
+
import { GanttGroup, GanttGroupInternal } from '../group';
|
|
3
|
+
|
|
4
|
+
const group: GanttGroup = {
|
|
5
|
+
id: '00001',
|
|
6
|
+
title: 'Project 1',
|
|
7
|
+
class: 'test'
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
describe('GanttGroupInternal', () => {
|
|
11
|
+
let ganttGroupInternal: GanttGroupInternal;
|
|
12
|
+
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
ganttGroupInternal = new GanttGroupInternal(group);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it(`should set expand`, () => {
|
|
18
|
+
ganttGroupInternal.setExpand(true);
|
|
19
|
+
expect(ganttGroupInternal.expanded).toBe(true);
|
|
20
|
+
});
|
|
21
|
+
});
|