@worktile/gantt 12.0.1 → 12.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.
Files changed (230) hide show
  1. package/README.md +13 -116
  2. package/bundles/worktile-gantt.umd.js +3303 -0
  3. package/bundles/worktile-gantt.umd.js.map +1 -0
  4. package/class/date-point.d.ts +15 -0
  5. package/{packages/gantt/src/class/event.ts → class/event.d.ts} +6 -12
  6. package/class/group.d.ts +22 -0
  7. package/{packages/gantt/src/class/index.ts → class/index.d.ts} +0 -0
  8. package/class/item.d.ts +70 -0
  9. package/class/view-type.d.ts +7 -0
  10. package/components/bar/bar-drag.d.ts +37 -0
  11. package/components/bar/bar.component.d.ts +26 -0
  12. package/components/calendar/calendar.component.d.ts +28 -0
  13. package/components/drag-backdrop/drag-backdrop.component.d.ts +9 -0
  14. package/components/icon/icon.component.d.ts +13 -0
  15. package/components/icon/icons.d.ts +8 -0
  16. package/components/links/links.component.d.ts +47 -0
  17. package/components/main/gantt-main.component.d.ts +21 -0
  18. package/components/range/range.component.d.ts +13 -0
  19. package/components/table/gantt-table.component.d.ts +36 -0
  20. package/esm2015/class/date-point.js +10 -0
  21. package/esm2015/class/event.js +13 -0
  22. package/esm2015/class/group.js +17 -0
  23. package/esm2015/class/index.js +6 -0
  24. package/esm2015/class/item.js +78 -0
  25. package/esm2015/class/view-type.js +9 -0
  26. package/esm2015/components/bar/bar-drag.js +264 -0
  27. package/esm2015/components/bar/bar.component.js +98 -0
  28. package/esm2015/components/calendar/calendar.component.js +86 -0
  29. package/esm2015/components/drag-backdrop/drag-backdrop.component.js +21 -0
  30. package/esm2015/components/icon/icon.component.js +38 -0
  31. package/esm2015/components/icon/icons.js +87 -0
  32. package/esm2015/components/links/links.component.js +213 -0
  33. package/esm2015/components/main/gantt-main.component.js +53 -0
  34. package/esm2015/components/range/range.component.js +37 -0
  35. package/esm2015/components/table/gantt-table.component.js +146 -0
  36. package/esm2015/gantt-abstract.js +3 -0
  37. package/esm2015/gantt-dom.service.js +103 -0
  38. package/esm2015/gantt-drag-container.js +59 -0
  39. package/esm2015/gantt-item-upper.js +58 -0
  40. package/esm2015/gantt-print.service.js +94 -0
  41. package/esm2015/gantt-upper.js +254 -0
  42. package/esm2015/gantt.component.js +131 -0
  43. package/esm2015/gantt.module.js +74 -0
  44. package/esm2015/gantt.pipe.js +43 -0
  45. package/esm2015/gantt.styles.js +15 -0
  46. package/esm2015/public-api.js +18 -0
  47. package/esm2015/root.component.js +123 -0
  48. package/esm2015/table/gantt-column.component.js +37 -0
  49. package/esm2015/table/gantt-table.component.js +20 -0
  50. package/esm2015/utils/date.js +160 -0
  51. package/esm2015/utils/helpers.js +55 -0
  52. package/esm2015/views/day.js +54 -0
  53. package/esm2015/views/factory.js +23 -0
  54. package/esm2015/views/month.js +48 -0
  55. package/esm2015/views/quarter.js +51 -0
  56. package/esm2015/views/view.js +121 -0
  57. package/esm2015/views/week.js +49 -0
  58. package/esm2015/views/year.js +50 -0
  59. package/esm2015/worktile-gantt.js +5 -0
  60. package/fesm2015/worktile-gantt.js +2637 -0
  61. package/fesm2015/worktile-gantt.js.map +1 -0
  62. package/{packages/gantt/src/gantt-abstract.ts → gantt-abstract.d.ts} +1 -3
  63. package/gantt-dom.service.d.ts +32 -0
  64. package/gantt-drag-container.d.ts +23 -0
  65. package/gantt-item-upper.d.ts +20 -0
  66. package/gantt-print.service.d.ts +13 -0
  67. package/gantt-upper.d.ts +64 -0
  68. package/gantt.component.d.ts +29 -0
  69. package/gantt.module.d.ts +21 -0
  70. package/gantt.pipe.d.ts +18 -0
  71. package/gantt.styles.d.ts +15 -0
  72. package/main.bundle.scss +645 -0
  73. package/package.json +16 -113
  74. package/{packages/gantt/src/public-api.ts → public-api.d.ts} +0 -4
  75. package/root.component.d.ts +28 -0
  76. package/table/gantt-column.component.d.ts +15 -0
  77. package/table/gantt-table.component.d.ts +10 -0
  78. package/utils/date.d.ts +59 -0
  79. package/utils/helpers.d.ts +12 -0
  80. package/views/day.d.ts +14 -0
  81. package/views/factory.d.ts +8 -0
  82. package/views/month.d.ts +12 -0
  83. package/views/quarter.d.ts +12 -0
  84. package/views/view.d.ts +56 -0
  85. package/views/week.d.ts +12 -0
  86. package/views/year.d.ts +12 -0
  87. package/worktile-gantt.d.ts +5 -0
  88. package/.all-contributorsrc +0 -53
  89. package/.angulardoc.json +0 -4
  90. package/.circleci/config.yml +0 -17
  91. package/.coveralls.yml +0 -1
  92. package/.docgenirc.js +0 -64
  93. package/.editorconfig +0 -22
  94. package/.prettierrc +0 -24
  95. package/.travis.yml +0 -23
  96. package/CHANGELOG.md +0 -564
  97. package/Dockerfile +0 -4
  98. package/LICENSE +0 -21
  99. package/angular.json +0 -136
  100. package/docs/guides/basic/components.md +0 -54
  101. package/docs/guides/basic/event.md +0 -70
  102. package/docs/guides/basic/index.md +0 -4
  103. package/docs/guides/basic/style.md +0 -68
  104. package/docs/guides/basic/type.md +0 -70
  105. package/docs/guides/basic/usage.md +0 -189
  106. package/docs/guides/index.md +0 -5
  107. package/docs/guides/intro/getting-started.md +0 -79
  108. package/docs/guides/intro/index.md +0 -51
  109. package/docs/index.md +0 -0
  110. package/example/browserslist +0 -12
  111. package/example/src/app/app-routing.module.ts +0 -26
  112. package/example/src/app/app.component.html +0 -2
  113. package/example/src/app/app.component.ts +0 -11
  114. package/example/src/app/app.module.ts +0 -57
  115. package/example/src/app/components/components.component.html +0 -6
  116. package/example/src/app/components/components.component.ts +0 -33
  117. package/example/src/app/configuration/parameters/api/zh-cn.js +0 -350
  118. package/example/src/app/configuration/parameters/doc/zh-cn.md +0 -5
  119. package/example/src/app/gantt/gantt.component.html +0 -51
  120. package/example/src/app/gantt/gantt.component.ts +0 -119
  121. package/example/src/app/gantt-advanced/component/flat.component.html +0 -30
  122. package/example/src/app/gantt-advanced/component/flat.component.ts +0 -72
  123. package/example/src/app/gantt-advanced/component/flat.scss +0 -31
  124. package/example/src/app/gantt-advanced/gantt-advanced.component.html +0 -32
  125. package/example/src/app/gantt-advanced/gantt-advanced.component.ts +0 -34
  126. package/example/src/app/gantt-advanced/mocks.ts +0 -158
  127. package/example/src/app/gantt-groups/gantt-groups.component.html +0 -42
  128. package/example/src/app/gantt-groups/gantt-groups.component.ts +0 -62
  129. package/example/src/app/gantt-range/gantt-range.component.html +0 -66
  130. package/example/src/app/gantt-range/gantt-range.component.ts +0 -67
  131. package/example/src/app/gantt-range/mocks.ts +0 -150
  132. package/example/src/app/helper.ts +0 -38
  133. package/example/src/assets/.gitkeep +0 -0
  134. package/example/src/environments/environment.prod.ts +0 -3
  135. package/example/src/environments/environment.ts +0 -16
  136. package/example/src/favicon.ico +0 -0
  137. package/example/src/index.html +0 -13
  138. package/example/src/main.ts +0 -12
  139. package/example/src/polyfills.ts +0 -63
  140. package/example/src/styles.scss +0 -56
  141. package/example/tsconfig.app.json +0 -18
  142. package/nginx.conf +0 -17
  143. package/packages/gantt/README.md +0 -24
  144. package/packages/gantt/karma.conf.js +0 -46
  145. package/packages/gantt/ng-package.json +0 -7
  146. package/packages/gantt/ng-package.prod.json +0 -7
  147. package/packages/gantt/package.json +0 -16
  148. package/packages/gantt/src/class/date-point.ts +0 -14
  149. package/packages/gantt/src/class/group.ts +0 -36
  150. package/packages/gantt/src/class/item.ts +0 -129
  151. package/packages/gantt/src/class/test/group.spec.ts +0 -21
  152. package/packages/gantt/src/class/test/item.spec.ts +0 -102
  153. package/packages/gantt/src/class/view-type.ts +0 -7
  154. package/packages/gantt/src/components/bar/bar-drag.ts +0 -298
  155. package/packages/gantt/src/components/bar/bar.component.html +0 -17
  156. package/packages/gantt/src/components/bar/bar.component.scss +0 -169
  157. package/packages/gantt/src/components/bar/bar.component.ts +0 -109
  158. package/packages/gantt/src/components/bar/test/bar.component.spec.ts +0 -54
  159. package/packages/gantt/src/components/bar/test/bar.drag.spec.ts +0 -196
  160. package/packages/gantt/src/components/calendar/calendar.component.html +0 -52
  161. package/packages/gantt/src/components/calendar/calendar.component.scss +0 -77
  162. package/packages/gantt/src/components/calendar/calendar.component.ts +0 -100
  163. package/packages/gantt/src/components/drag-backdrop/drag-backdrop.component.html +0 -6
  164. package/packages/gantt/src/components/drag-backdrop/drag-backdrop.component.scss +0 -48
  165. package/packages/gantt/src/components/drag-backdrop/drag-backdrop.component.ts +0 -13
  166. package/packages/gantt/src/components/icon/icon.component.scss +0 -13
  167. package/packages/gantt/src/components/icon/icon.component.ts +0 -28
  168. package/packages/gantt/src/components/icon/icons.ts +0 -86
  169. package/packages/gantt/src/components/links/links.component.html +0 -19
  170. package/packages/gantt/src/components/links/links.component.scss +0 -27
  171. package/packages/gantt/src/components/links/links.component.ts +0 -263
  172. package/packages/gantt/src/components/main/gantt-main.component.html +0 -35
  173. package/packages/gantt/src/components/main/gantt-main.component.ts +0 -35
  174. package/packages/gantt/src/components/range/range.component.html +0 -8
  175. package/packages/gantt/src/components/range/range.component.scss +0 -35
  176. package/packages/gantt/src/components/range/range.component.ts +0 -27
  177. package/packages/gantt/src/components/range/test/range.component.spec.ts +0 -80
  178. package/packages/gantt/src/components/table/gantt-table.component.html +0 -105
  179. package/packages/gantt/src/components/table/gantt-table.component.scss +0 -144
  180. package/packages/gantt/src/components/table/gantt-table.component.ts +0 -166
  181. package/packages/gantt/src/components/table/test/table.spec.ts +0 -129
  182. package/packages/gantt/src/gantt-dom.service.ts +0 -134
  183. package/packages/gantt/src/gantt-drag-container.ts +0 -73
  184. package/packages/gantt/src/gantt-item-upper.ts +0 -50
  185. package/packages/gantt/src/gantt-print.service.ts +0 -104
  186. package/packages/gantt/src/gantt-upper.ts +0 -289
  187. package/packages/gantt/src/gantt.component.html +0 -18
  188. package/packages/gantt/src/gantt.component.scss +0 -77
  189. package/packages/gantt/src/gantt.component.ts +0 -134
  190. package/packages/gantt/src/gantt.module.ts +0 -47
  191. package/packages/gantt/src/gantt.pipe.ts +0 -31
  192. package/packages/gantt/src/gantt.styles.ts +0 -28
  193. package/packages/gantt/src/root.component.html +0 -12
  194. package/packages/gantt/src/root.component.ts +0 -121
  195. package/packages/gantt/src/styles/index.scss +0 -9
  196. package/packages/gantt/src/styles/variables.scss +0 -46
  197. package/packages/gantt/src/table/gantt-column.component.ts +0 -25
  198. package/packages/gantt/src/table/gantt-table.component.ts +0 -14
  199. package/packages/gantt/src/table/test/table.spec.ts +0 -56
  200. package/packages/gantt/src/test/gantt.component.spec.ts +0 -404
  201. package/packages/gantt/src/test/mocks/data.ts +0 -303
  202. package/packages/gantt/src/test.ts +0 -21
  203. package/packages/gantt/src/utils/date.ts +0 -276
  204. package/packages/gantt/src/utils/helpers.ts +0 -66
  205. package/packages/gantt/src/utils/test/date.spec.ts +0 -105
  206. package/packages/gantt/src/utils/test/helpers.spec.ts +0 -73
  207. package/packages/gantt/src/utils/testing.ts +0 -64
  208. package/packages/gantt/src/views/day.ts +0 -74
  209. package/packages/gantt/src/views/factory.ts +0 -25
  210. package/packages/gantt/src/views/month.ts +0 -66
  211. package/packages/gantt/src/views/quarter.ts +0 -68
  212. package/packages/gantt/src/views/test/day.spec.ts +0 -45
  213. package/packages/gantt/src/views/test/factory.spec.ts +0 -41
  214. package/packages/gantt/src/views/test/mock.ts +0 -14
  215. package/packages/gantt/src/views/test/month.spec.ts +0 -45
  216. package/packages/gantt/src/views/test/quarter.spec.ts +0 -45
  217. package/packages/gantt/src/views/test/view.spec.ts +0 -144
  218. package/packages/gantt/src/views/test/week.spec.ts +0 -45
  219. package/packages/gantt/src/views/test/year.spec.ts +0 -45
  220. package/packages/gantt/src/views/view.ts +0 -186
  221. package/packages/gantt/src/views/week.ts +0 -66
  222. package/packages/gantt/src/views/year.ts +0 -62
  223. package/packages/gantt/tsconfig.lib.json +0 -20
  224. package/packages/gantt/tsconfig.lib.prod.json +0 -9
  225. package/packages/gantt/tsconfig.schematics.json +0 -25
  226. package/packages/gantt/tsconfig.spec.json +0 -17
  227. package/packages/gantt/tslint.json +0 -18
  228. package/scss-bundle.config.json +0 -7
  229. package/tsconfig.json +0 -26
  230. package/tslint.json +0 -51
package/package.json CHANGED
@@ -1,116 +1,19 @@
1
1
  {
2
2
  "name": "@worktile/gantt",
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
- },
3
+ "version": "12.0.2",
4
+ "schematics": "./schematics/collection.json",
5
+ "peerDependencies": {
6
+ "@angular/common": "^12.0.0",
7
+ "@angular/core": "^12.0.0"
8
+ },
9
+ "main": "bundles/worktile-gantt.umd.js",
10
+ "module": "fesm2015/worktile-gantt.js",
11
+ "es2015": "fesm2015/worktile-gantt.js",
12
+ "esm2015": "esm2015/worktile-gantt.js",
13
+ "fesm2015": "fesm2015/worktile-gantt.js",
14
+ "typings": "worktile-gantt.d.ts",
15
+ "sideEffects": false,
29
16
  "dependencies": {
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
- }
17
+ "tslib": "^2.2.0"
18
+ }
19
+ }
@@ -1,7 +1,3 @@
1
- /*
2
- * Public API Surface of gantt
3
- */
4
-
5
1
  export * from './gantt.module';
6
2
  export * from './gantt-upper';
7
3
  export * from './root.component';
@@ -0,0 +1,28 @@
1
+ import { OnInit, NgZone, ElementRef, TemplateRef } from '@angular/core';
2
+ import { GanttDomService } from './gantt-dom.service';
3
+ import { GanttDragContainer } from './gantt-drag-container';
4
+ import { GanttUpper } from './gantt-upper';
5
+ import { GanttPrintService } from './gantt-print.service';
6
+ import * as i0 from "@angular/core";
7
+ export declare class NgxGanttRootComponent implements OnInit {
8
+ private elementRef;
9
+ private ngZone;
10
+ private dom;
11
+ dragContainer: GanttDragContainer;
12
+ private ganttUpper;
13
+ private printService;
14
+ sideWidth: number;
15
+ ganttClass: boolean;
16
+ sideTemplate: TemplateRef<any>;
17
+ mainTemplate: TemplateRef<any>;
18
+ private unsubscribe$;
19
+ private get view();
20
+ constructor(elementRef: ElementRef<HTMLElement>, ngZone: NgZone, dom: GanttDomService, dragContainer: GanttDragContainer, ganttUpper: GanttUpper, printService: GanttPrintService);
21
+ ngOnInit(): void;
22
+ private setupViewScroll;
23
+ private setupResize;
24
+ private setupScrollClass;
25
+ private scrollToToday;
26
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttRootComponent, [null, null, null, null, null, { optional: true; }]>;
27
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttRootComponent, "ngx-gantt-root", never, { "sideWidth": "sideWidth"; }, {}, ["sideTemplate", "mainTemplate"], never>;
28
+ }
@@ -0,0 +1,15 @@
1
+ import { OnInit, TemplateRef } from '@angular/core';
2
+ import { GanttUpper } from '../gantt-upper';
3
+ import * as i0 from "@angular/core";
4
+ export declare class NgxGanttTableColumnComponent implements OnInit {
5
+ ganttUpper: GanttUpper;
6
+ columnWidth: string;
7
+ set width(width: number | string);
8
+ name: string;
9
+ templateRef: TemplateRef<any>;
10
+ headerTemplateRef: TemplateRef<any>;
11
+ constructor(ganttUpper: GanttUpper);
12
+ ngOnInit(): void;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttTableColumnComponent, never>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttTableColumnComponent, "ngx-gantt-column", never, { "width": "width"; "name": "name"; }, {}, ["templateRef", "headerTemplateRef"], never>;
15
+ }
@@ -0,0 +1,10 @@
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { GanttTableEvent } from '../class';
3
+ import * as i0 from "@angular/core";
4
+ export declare class NgxGanttTableComponent implements OnInit {
5
+ columnChanges: EventEmitter<GanttTableEvent>;
6
+ constructor();
7
+ ngOnInit(): void;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxGanttTableComponent, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxGanttTableComponent, "ngx-gantt-table", never, {}, { "columnChanges": "columnChanges"; }, never, never>;
10
+ }
@@ -0,0 +1,59 @@
1
+ export { addYears, addMonths, addDays, addWeeks, addQuarters, getUnixTime, startOfDay, startOfWeek, startOfMonth, startOfQuarter, startOfYear, endOfDay, endOfWeek, endOfMonth, endOfQuarter, endOfYear, format, fromUnixTime, getDaysInMonth, addSeconds, setDate, addMinutes, addHours, differenceInCalendarDays, isWeekend, getWeek, isToday, differenceInDays, differenceInCalendarQuarters, eachMonthOfInterval, eachWeekOfInterval, eachDayOfInterval } from 'date-fns';
2
+ export declare type GanttDateUtil = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
3
+ export declare class GanttDate {
4
+ value: Date;
5
+ constructor(date?: Date | string | number);
6
+ getYear(): number;
7
+ getMonth(): number;
8
+ getDay(): number;
9
+ getTime(): number;
10
+ getDate(): number;
11
+ getHours(): number;
12
+ getMinutes(): number;
13
+ getSeconds(): number;
14
+ getMilliseconds(): number;
15
+ getWeek(options?: {
16
+ locale?: Locale;
17
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
18
+ }): number;
19
+ getDaysInMonth(): number;
20
+ getDaysInQuarter(): number;
21
+ getDaysInYear(): number;
22
+ setDate(dayOfMonth: number): GanttDate;
23
+ clone(): GanttDate;
24
+ add(amount: number, unit?: GanttDateUtil): GanttDate;
25
+ addSeconds(amount: number): GanttDate;
26
+ addMinutes(amount: number): GanttDate;
27
+ addHours(amount: number): GanttDate;
28
+ addDays(amount: number): GanttDate;
29
+ addWeeks(amount: number): GanttDate;
30
+ addMonths(amount: number): GanttDate;
31
+ addQuarters(amount: number): GanttDate;
32
+ addYears(amount: number): GanttDate;
33
+ startOfDay(): GanttDate;
34
+ startOfWeek(options?: {
35
+ locale?: Locale;
36
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
37
+ }): GanttDate;
38
+ startOfMonth(): GanttDate;
39
+ startOfQuarter(): GanttDate;
40
+ startOfYear(): GanttDate;
41
+ endOfDay(): GanttDate;
42
+ endOfWeek(options?: {
43
+ locale?: Locale;
44
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
45
+ }): GanttDate;
46
+ endOfMonth(): GanttDate;
47
+ endOfQuarter(): GanttDate;
48
+ endOfYear(): GanttDate;
49
+ getUnixTime(): number;
50
+ format(mat: string, options?: {
51
+ locale?: Locale;
52
+ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
53
+ firstWeekContainsDate?: number;
54
+ useAdditionalWeekYearTokens?: boolean;
55
+ useAdditionalDayOfYearTokens?: boolean;
56
+ }): string;
57
+ isWeekend(): boolean;
58
+ isToday(): boolean;
59
+ }
@@ -0,0 +1,12 @@
1
+ import { GanttItem, GanttItemInternal } from '../class/item';
2
+ export interface Dictionary<T = unknown> {
3
+ [key: string]: T;
4
+ }
5
+ export declare function isNumber(value: any): boolean;
6
+ export declare function isString(value: any): boolean;
7
+ export declare function isUndefined(value: any): boolean;
8
+ export declare function hexToRgb(color: string, opacity?: number): string;
9
+ export declare function uniqBy<T = unknown>(array: T[], key: keyof T): any[];
10
+ export declare function flatten<T = unknown>(array: T[]): any;
11
+ export declare function recursiveItems(items: GanttItemInternal[]): any[];
12
+ export declare function getFlatItems(items: GanttItem[]): any[];
package/views/day.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import { GanttView, GanttViewOptions, GanttViewDate } from './view';
2
+ import { GanttDate } from '../utils/date';
3
+ import { GanttDatePoint } from '../class/date-point';
4
+ export declare class GanttViewDay extends GanttView {
5
+ showWeekBackdrop: boolean;
6
+ showTimeline: boolean;
7
+ constructor(start: GanttViewDate, end: GanttViewDate, options?: GanttViewOptions);
8
+ startOf(date: GanttDate): GanttDate;
9
+ endOf(date: GanttDate): GanttDate;
10
+ getPrimaryWidth(): number;
11
+ getDayOccupancyWidth(): number;
12
+ getPrimaryDatePoints(): GanttDatePoint[];
13
+ getSecondaryDatePoints(): GanttDatePoint[];
14
+ }
@@ -0,0 +1,8 @@
1
+ import { GanttViewOptions, GanttViewDate } from './view';
2
+ import { GanttViewMonth } from './month';
3
+ import { GanttViewType } from '../class/view-type';
4
+ import { GanttViewQuarter } from './quarter';
5
+ import { GanttViewDay } from './day';
6
+ import { GanttViewWeek } from './week';
7
+ import { GanttViewYear } from './year';
8
+ export declare function createViewFactory(type: GanttViewType, start: GanttViewDate, end: GanttViewDate, options?: GanttViewOptions): GanttViewMonth | GanttViewQuarter | GanttViewDay | GanttViewWeek | GanttViewYear;
@@ -0,0 +1,12 @@
1
+ import { GanttView, GanttViewOptions, GanttViewDate } from './view';
2
+ import { GanttDate } from '../utils/date';
3
+ import { GanttDatePoint } from '../class/date-point';
4
+ export declare class GanttViewMonth extends GanttView {
5
+ constructor(start: GanttViewDate, end: GanttViewDate, options?: GanttViewOptions);
6
+ startOf(date: GanttDate): GanttDate;
7
+ endOf(date: GanttDate): GanttDate;
8
+ getPrimaryWidth(): number;
9
+ getDayOccupancyWidth(date: GanttDate): number;
10
+ getPrimaryDatePoints(): GanttDatePoint[];
11
+ getSecondaryDatePoints(): GanttDatePoint[];
12
+ }
@@ -0,0 +1,12 @@
1
+ import { GanttView, GanttViewOptions, GanttViewDate } from './view';
2
+ import { GanttDate } from '../utils/date';
3
+ import { GanttDatePoint } from '../class/date-point';
4
+ export declare class GanttViewQuarter extends GanttView {
5
+ constructor(start: GanttViewDate, end: GanttViewDate, options?: GanttViewOptions);
6
+ startOf(date: GanttDate): GanttDate;
7
+ endOf(date: GanttDate): GanttDate;
8
+ getPrimaryWidth(): number;
9
+ getDayOccupancyWidth(date: GanttDate): number;
10
+ getPrimaryDatePoints(): GanttDatePoint[];
11
+ getSecondaryDatePoints(): GanttDatePoint[];
12
+ }
@@ -0,0 +1,56 @@
1
+ import { GanttDate, GanttDateUtil } from '../utils/date';
2
+ import { GanttDatePoint } from '../class/date-point';
3
+ import { BehaviorSubject } from 'rxjs';
4
+ export declare const primaryDatePointTop = 18;
5
+ export declare const secondaryDatePointTop = 36;
6
+ export interface GanttViewDate {
7
+ date: GanttDate;
8
+ isCustom?: boolean;
9
+ }
10
+ export interface GanttViewOptions {
11
+ start?: GanttDate;
12
+ end?: GanttDate;
13
+ min?: GanttDate;
14
+ max?: GanttDate;
15
+ cellWidth?: number;
16
+ addAmount?: number;
17
+ addUnit?: GanttDateUtil;
18
+ }
19
+ export declare abstract class GanttView {
20
+ start$: BehaviorSubject<GanttDate>;
21
+ end$: BehaviorSubject<GanttDate>;
22
+ get start(): GanttDate;
23
+ get end(): GanttDate;
24
+ primaryDatePoints: GanttDatePoint[];
25
+ secondaryDatePoints: GanttDatePoint[];
26
+ width: number;
27
+ cellWidth: number;
28
+ primaryWidth: number;
29
+ showTimeline: boolean;
30
+ showWeekBackdrop: boolean;
31
+ options: GanttViewOptions;
32
+ constructor(start: GanttViewDate, end: GanttViewDate, options: GanttViewOptions);
33
+ abstract startOf(date: GanttDate): GanttDate;
34
+ abstract endOf(date: GanttDate): GanttDate;
35
+ abstract getPrimaryWidth(): number;
36
+ abstract getDayOccupancyWidth(date: GanttDate): number;
37
+ abstract getPrimaryDatePoints(): GanttDatePoint[];
38
+ abstract getSecondaryDatePoints(): GanttDatePoint[];
39
+ protected getDateIntervalWidth(start: GanttDate, end: GanttDate): number;
40
+ protected initialize(): void;
41
+ addStartDate(): {
42
+ start: GanttDate;
43
+ end: GanttDate;
44
+ };
45
+ addEndDate(): {
46
+ start: GanttDate;
47
+ end: GanttDate;
48
+ };
49
+ updateDate(start: GanttDate, end: GanttDate): void;
50
+ getWidth(): number;
51
+ getCellWidth(): number;
52
+ getTodayXPoint(): number;
53
+ getXPointByDate(date: GanttDate): number;
54
+ getDateByXPoint(x: number): GanttDate;
55
+ getDateRangeWidth(start: GanttDate, end: GanttDate): number;
56
+ }
@@ -0,0 +1,12 @@
1
+ import { GanttDatePoint } from '../class/date-point';
2
+ import { GanttDate } from '../utils/date';
3
+ import { GanttView, GanttViewDate, GanttViewOptions } from './view';
4
+ export declare class GanttViewWeek extends GanttView {
5
+ constructor(start: GanttViewDate, end: GanttViewDate, options?: GanttViewOptions);
6
+ startOf(date: GanttDate): GanttDate;
7
+ endOf(date: GanttDate): GanttDate;
8
+ getPrimaryWidth(): number;
9
+ getDayOccupancyWidth(): number;
10
+ getPrimaryDatePoints(): GanttDatePoint[];
11
+ getSecondaryDatePoints(): GanttDatePoint[];
12
+ }
@@ -0,0 +1,12 @@
1
+ import { GanttView, GanttViewOptions, GanttViewDate } from './view';
2
+ import { GanttDate } from '../utils/date';
3
+ import { GanttDatePoint } from '../class/date-point';
4
+ export declare class GanttViewYear extends GanttView {
5
+ constructor(start: GanttViewDate, end: GanttViewDate, options?: GanttViewOptions);
6
+ startOf(date: GanttDate): GanttDate;
7
+ endOf(date: GanttDate): GanttDate;
8
+ getPrimaryWidth(): number;
9
+ getDayOccupancyWidth(date: GanttDate): number;
10
+ getPrimaryDatePoints(): GanttDatePoint[];
11
+ getSecondaryDatePoints(): GanttDatePoint[];
12
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@worktile/gantt" />
5
+ export * from './public-api';
@@ -1,53 +0,0 @@
1
- {
2
- "projectName": "ngx-gantt",
3
- "projectOwner": "walkerkay",
4
- "repoType": "github",
5
- "repoHost": "https://github.com",
6
- "files": [
7
- "README.md"
8
- ],
9
- "imageSize": 100,
10
- "commit": true,
11
- "commitConvention": "angular",
12
- "contributors": [
13
- {
14
- "login": "walkerkay",
15
- "name": "Walker",
16
- "avatar_url": "https://avatars.githubusercontent.com/u/15701592?v=4",
17
- "profile": "https://github.com/walkerkay",
18
- "contributions": [
19
- "question",
20
- "code",
21
- "design",
22
- "doc",
23
- "infra",
24
- "maintenance",
25
- "projectManagement",
26
- "review"
27
- ]
28
- },
29
- {
30
- "login": "HandsomeButterball",
31
- "name": "zhangwen",
32
- "avatar_url": "https://avatars.githubusercontent.com/u/17664721?v=4",
33
- "profile": "https://github.com/HandsomeButterball",
34
- "contributions": [
35
- "question",
36
- "code",
37
- "doc",
38
- "review"
39
- ]
40
- },
41
- {
42
- "login": "mengshuicmq",
43
- "name": "cmq",
44
- "avatar_url": "https://avatars.githubusercontent.com/u/13193164?v=4",
45
- "profile": "https://github.com/mengshuicmq",
46
- "contributions": [
47
- "code"
48
- ]
49
- }
50
- ],
51
- "contributorsPerLine": 7,
52
- "skipCi": true
53
- }
package/.angulardoc.json DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "repoId": "e269ef2e-9a71-4aa1-8085-f4a738a9cfef",
3
- "lastSync": 0
4
- }
@@ -1,17 +0,0 @@
1
- version: 2
2
- jobs:
3
- build:
4
- working_directory: ~/ngx-gantt
5
- docker:
6
- - image: circleci/node:14-browsers
7
- steps:
8
- - checkout
9
- - restore_cache:
10
- key: ngx-gantt-{{ .Branch }}-{{ checksum "package-lock.json" }}
11
- - run: npm install
12
- - save_cache:
13
- key: ngx-gantt-{{ .Branch }}-{{ checksum "package-lock.json" }}
14
- paths:
15
- - 'node_modules'
16
- - run: npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
17
- - run: npm run report-coverage
package/.coveralls.yml DELETED
@@ -1 +0,0 @@
1
- repo_token: owC51u3H1UjhuPi9RlUrxwX2n1dMzqn4V
package/.docgenirc.js DELETED
@@ -1,64 +0,0 @@
1
- module.exports = {
2
- mode: 'full',
3
- title: 'NgxGantt',
4
- siteProjectName: 'example',
5
- outputDir: 'dist/site',
6
- logoUrl: 'https://cdn.pingcode.com/open-sources/gantt/logo.png',
7
- repoUrl: 'https://github.com/worktile/ngx-gantt',
8
- defaultLocale: 'zh-cn',
9
- navs: [
10
- null,
11
- {
12
- title: '组件',
13
- path: 'components',
14
- locales: {
15
- 'en-us': {
16
- title: 'Component'
17
- }
18
- }
19
- },
20
- {
21
- title: '参数',
22
- path: 'configuration',
23
- lib: 'ngx-gantt',
24
- locales: {
25
- 'en-us': {
26
- title: 'Configuration'
27
- }
28
- }
29
- },
30
- {
31
- title: 'GitHub',
32
- path: 'https://github.com/worktile/ngx-gantt',
33
- isExternal: true
34
- },
35
- {
36
- title: '更新日志',
37
- path: 'https://github.com/worktile/ngx-gantt/blob/master/CHANGELOG.md',
38
- isExternal: true,
39
- locales: {
40
- 'en-us': {
41
- title: 'Changelog'
42
- }
43
- }
44
- }
45
- ],
46
- libs: [
47
- {
48
- name: 'ngx-gantt',
49
- rootDir: './example/src/app/configuration',
50
- exclude: [],
51
- categories: [
52
- {
53
- id: 'config',
54
- title: '配置',
55
- locales: {
56
- 'en-us': {
57
- title: 'Configuration'
58
- }
59
- }
60
- }
61
- ]
62
- }
63
- ]
64
- };
package/.editorconfig DELETED
@@ -1,22 +0,0 @@
1
- # Editor configuration, see https://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- charset = utf-8
6
- indent_style = space
7
- indent_size = 2
8
- insert_final_newline = true
9
- trim_trailing_whitespace = true
10
-
11
- [*.ts]
12
- indent_size = 4
13
-
14
- [*.scss]
15
- indent_size = 4
16
-
17
- [*.js]
18
- indent_size = 4
19
-
20
- [*.md]
21
- max_line_length = off
22
- trim_trailing_whitespace = false
package/.prettierrc DELETED
@@ -1,24 +0,0 @@
1
- {
2
- "eslintIntegration": true,
3
- "stylelintIntegration": true,
4
- "tabWidth": 2,
5
- "semi": true,
6
- "printWidth": 140,
7
- "proseWrap": "preserve",
8
- "trailingComma": "none",
9
- "singleQuote": true,
10
- "overrides": [
11
- {
12
- "files": "*.js",
13
- "options": {
14
- "tabWidth": 4
15
- }
16
- },
17
- {
18
- "files": "*.ts",
19
- "options": {
20
- "tabWidth": 4
21
- }
22
- }
23
- ]
24
- }
package/.travis.yml DELETED
@@ -1,23 +0,0 @@
1
- dist: trusty
2
- sudo: false
3
-
4
- language: node_js
5
- node_js:
6
- - 10.16.0
7
-
8
- addons:
9
- apt:
10
- sources:
11
- - google-chrome
12
- packages:
13
- - google-chrome-stable
14
-
15
- cache:
16
- directories:
17
- - ./node_modules
18
-
19
- install:
20
- - npm install
21
-
22
- script:
23
- - npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI