@worktile/gantt 17.0.0-next.0 → 18.0.0

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 (59) hide show
  1. package/class/date-point.d.ts +2 -2
  2. package/components/bar/bar.component.scss +3 -0
  3. package/components/calendar/calendar.scss +0 -1
  4. package/components/calendar/grid/calendar-grid.component.d.ts +0 -1
  5. package/components/calendar/header/calendar-header.component.d.ts +1 -1
  6. package/components/drag-backdrop/drag-backdrop.component.d.ts +3 -0
  7. package/components/drag-backdrop/drag-backdrop.component.scss +0 -1
  8. package/components/links/links.component.scss +0 -1
  9. package/components/table/gantt-table.scss +0 -3
  10. package/components/table/header/gantt-table-header.component.d.ts +2 -0
  11. package/components/toolbar/toolbar.component.d.ts +1 -0
  12. package/esm2022/class/date-point.mjs +1 -1
  13. package/esm2022/components/bar/bar-drag.mjs +3 -3
  14. package/esm2022/components/bar/bar.component.mjs +3 -3
  15. package/esm2022/components/baseline/baseline.component.mjs +3 -3
  16. package/esm2022/components/calendar/grid/calendar-grid.component.mjs +6 -7
  17. package/esm2022/components/calendar/header/calendar-header.component.mjs +14 -8
  18. package/esm2022/components/drag-backdrop/drag-backdrop.component.mjs +15 -7
  19. package/esm2022/components/icon/icon.component.mjs +3 -3
  20. package/esm2022/components/links/links.component.mjs +3 -3
  21. package/esm2022/components/loader/loader.component.mjs +3 -3
  22. package/esm2022/components/main/gantt-main.component.mjs +5 -5
  23. package/esm2022/components/range/range.component.mjs +3 -3
  24. package/esm2022/components/table/body/gantt-table-body.component.mjs +5 -5
  25. package/esm2022/components/table/header/gantt-table-header.component.mjs +16 -4
  26. package/esm2022/components/toolbar/toolbar.component.mjs +10 -4
  27. package/esm2022/gantt-abstract.mjs +1 -1
  28. package/esm2022/gantt-dom.service.mjs +3 -3
  29. package/esm2022/gantt-drag-container.mjs +3 -3
  30. package/esm2022/gantt-item-upper.mjs +3 -3
  31. package/esm2022/gantt-print.service.mjs +3 -3
  32. package/esm2022/gantt-upper.mjs +7 -7
  33. package/esm2022/gantt.component.mjs +6 -6
  34. package/esm2022/gantt.config.mjs +6 -1
  35. package/esm2022/gantt.module.mjs +4 -4
  36. package/esm2022/gantt.pipe.mjs +9 -9
  37. package/esm2022/gantt.styles.mjs +1 -6
  38. package/esm2022/root.component.mjs +3 -3
  39. package/esm2022/table/gantt-column.component.mjs +3 -3
  40. package/esm2022/table/gantt-table.component.mjs +3 -3
  41. package/esm2022/views/hour.mjs +11 -1
  42. package/esm2022/views/month.mjs +2 -2
  43. package/esm2022/views/quarter.mjs +2 -2
  44. package/esm2022/views/view.mjs +3 -3
  45. package/esm2022/views/year.mjs +2 -2
  46. package/fesm2022/worktile-gantt.mjs +153 -113
  47. package/fesm2022/worktile-gantt.mjs.map +1 -1
  48. package/gantt-abstract.d.ts +2 -2
  49. package/gantt-upper.d.ts +2 -3
  50. package/gantt.component.scss +0 -5
  51. package/gantt.config.d.ts +6 -0
  52. package/gantt.pipe.d.ts +3 -3
  53. package/gantt.styles.d.ts +0 -6
  54. package/package.json +1 -1
  55. package/styles/variables.scss +4 -2
  56. package/utils/date.d.ts +0 -1
  57. package/utils/helpers.d.ts +2 -2
  58. package/views/hour.d.ts +1 -0
  59. package/views/view.d.ts +2 -2
@@ -1,10 +1,10 @@
1
1
  import { InjectionToken, ChangeDetectorRef } from '@angular/core';
2
2
  import { GanttGroupInternal, GanttItemInternal } from './class';
3
- import { GanttStyles } from './gantt.styles';
4
3
  import { NgxGanttTableComponent } from './table/gantt-table.component';
4
+ import { GanttStyleOptions } from './gantt.config';
5
5
  export interface GanttAbstractComponent {
6
6
  table: NgxGanttTableComponent;
7
- styles: GanttStyles;
7
+ styles: GanttStyleOptions;
8
8
  maxLevel: number;
9
9
  async: boolean;
10
10
  cdr: ChangeDetectorRef;
package/gantt-upper.d.ts CHANGED
@@ -2,10 +2,9 @@ import { TemplateRef, EventEmitter, ElementRef, ChangeDetectorRef, NgZone, Simpl
2
2
  import { Subject } from 'rxjs';
3
3
  import { GanttItem, GanttGroup, GanttViewType, GanttLoadOnScrollEvent, GanttDragEvent, GanttGroupInternal, GanttItemInternal, GanttBarClickEvent, GanttLinkDragEvent, GanttToolbarOptions } from './class';
4
4
  import { GanttView, GanttViewOptions } from './views/view';
5
- import { GanttStyles } from './gantt.styles';
6
5
  import { Dictionary } from './utils/helpers';
7
6
  import { GanttDragContainer } from './gantt-drag-container';
8
- import { GanttGlobalConfig } from './gantt.config';
7
+ import { GanttGlobalConfig, GanttStyleOptions } from './gantt.config';
9
8
  import { GanttLinkOptions } from './class/link';
10
9
  import { SelectionModel } from '@angular/cdk/collections';
11
10
  import { BooleanInput } from '@angular/cdk/coercion';
@@ -25,7 +24,7 @@ export declare abstract class GanttUpper implements OnChanges, OnInit, OnDestroy
25
24
  end: number;
26
25
  showTodayLine: boolean;
27
26
  draggable: boolean;
28
- styles: GanttStyles;
27
+ styles: GanttStyleOptions;
29
28
  showToolbar: boolean;
30
29
  toolbarOptions: GanttToolbarOptions;
31
30
  viewOptions: GanttViewOptions;
@@ -22,7 +22,6 @@
22
22
 
23
23
  .gantt-side-header {
24
24
  box-sizing: border-box;
25
- height: variables.$gantt-header-height;
26
25
  }
27
26
 
28
27
  .gantt-side-container {
@@ -69,10 +68,8 @@
69
68
 
70
69
  .gantt-main-container {
71
70
  width: 100%;
72
- height: calc(100% - #{variables.$gantt-header-height});
73
71
  flex: 1;
74
72
  position: absolute;
75
- top: variables.$gantt-header-height;
76
73
  bottom: 0;
77
74
  left: 0;
78
75
  right: 0;
@@ -86,7 +83,6 @@
86
83
  }
87
84
 
88
85
  .gantt-group {
89
- height: variables.$gantt-group-height;
90
86
  background: variables.$gantt-group-background-color;
91
87
  border-bottom: 1px solid variables.$gantt-border-color;
92
88
  box-sizing: border-box;
@@ -110,7 +106,6 @@
110
106
  .gantt-virtual-scroll-viewport {
111
107
  position: absolute;
112
108
  left: 0;
113
- top: variables.$gantt-header-height;
114
109
  right: 0;
115
110
  bottom: 0;
116
111
  z-index: 2;
package/gantt.config.d.ts CHANGED
@@ -15,10 +15,16 @@ export interface GanttDateOptions {
15
15
  locale?: Locale;
16
16
  weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
17
17
  }
18
+ export interface GanttStyleOptions {
19
+ headerHeight?: number;
20
+ lineHeight?: number;
21
+ barHeight?: number;
22
+ }
18
23
  export interface GanttGlobalConfig {
19
24
  dateFormat?: GanttDateFormat;
20
25
  dateOptions?: GanttDateOptions;
21
26
  linkOptions?: GanttLinkOptions;
27
+ styleOptions?: GanttStyleOptions;
22
28
  }
23
29
  export declare const defaultConfig: GanttGlobalConfig;
24
30
  export declare const GANTT_GLOBAL_CONFIG: InjectionToken<GanttGlobalConfig>;
package/gantt.pipe.d.ts CHANGED
@@ -2,17 +2,17 @@ import { PipeTransform } from '@angular/core';
2
2
  import { GanttItemType } from './class';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class IsGanttRangeItemPipe implements PipeTransform {
5
- transform(value: GanttItemType): boolean;
5
+ transform(value: GanttItemType): value is GanttItemType.range;
6
6
  static ɵfac: i0.ɵɵFactoryDeclaration<IsGanttRangeItemPipe, never>;
7
7
  static ɵpipe: i0.ɵɵPipeDeclaration<IsGanttRangeItemPipe, "isGanttRangeItem", true>;
8
8
  }
9
9
  export declare class IsGanttBarItemPipe implements PipeTransform {
10
- transform(value: GanttItemType): boolean;
10
+ transform(value: GanttItemType): value is GanttItemType.bar;
11
11
  static ɵfac: i0.ɵɵFactoryDeclaration<IsGanttBarItemPipe, never>;
12
12
  static ɵpipe: i0.ɵɵPipeDeclaration<IsGanttBarItemPipe, "isGanttBarItem", true>;
13
13
  }
14
14
  export declare class IsGanttCustomItemPipe implements PipeTransform {
15
- transform(value: GanttItemType): boolean;
15
+ transform(value: GanttItemType): value is GanttItemType.custom;
16
16
  static ɵfac: i0.ɵɵFactoryDeclaration<IsGanttCustomItemPipe, never>;
17
17
  static ɵpipe: i0.ɵɵPipeDeclaration<IsGanttCustomItemPipe, "isGanttCustomItem", true>;
18
18
  }
package/gantt.styles.d.ts CHANGED
@@ -1,9 +1,3 @@
1
- export declare const defaultStyles: {
2
- lineHeight: number;
3
- barHeight: number;
4
- };
5
- export declare const headerHeight = 44;
6
- export type GanttStyles = typeof defaultStyles;
7
1
  export declare const sideWidth = 400;
8
2
  export declare const sideMiddleWidth = 500;
9
3
  export declare const sideMaxWidth = 600;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worktile/gantt",
3
- "version": "17.0.0-next.0",
3
+ "version": "18.0.0",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "author": "walkerkay001",
6
6
  "license": "MIT",
@@ -6,12 +6,10 @@ $gantt-border-color: #eee !default;
6
6
  $gantt-bg-color: #fff !default;
7
7
  $gantt-side-shadow: 12px 0 16px -10px rgba(0, 0, 0, 0.15) !default;
8
8
  $gantt-container-background-color: #fafafa !default;
9
- $gantt-item-height: 44px !default;
10
9
  $gantt-group-background-color: rgba(
11
10
  $color: #f3f3f3,
12
11
  $alpha: 0.5
13
12
  ) !default;
14
- $gantt-group-height: 44px !default;
15
13
  $gantt-table-td-padding: 0 15px !default;
16
14
 
17
15
  // calendar
@@ -59,3 +57,7 @@ $gantt-loader-loading-color: $gantt-primary-color !default;
59
57
 
60
58
  // footer
61
59
  $gantt-footer-height: 44px !default;
60
+
61
+ // @deprecated, please use global config `GANTT_GLOBAL_CONFIG` set custom height
62
+ $gantt-item-height: none;
63
+ $gantt-group-height: none;
package/utils/date.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="date-fns" />
2
1
  export { Locale, addDays, addHours, addMinutes, addMonths, addQuarters, addSeconds, addWeeks, addYears, differenceInCalendarDays, differenceInCalendarQuarters, differenceInDays, eachDayOfInterval, eachMonthOfInterval, eachWeekOfInterval, endOfDay, endOfMonth, endOfQuarter, endOfWeek, endOfYear, format, fromUnixTime, getDaysInMonth, getUnixTime, getWeek, isToday, isWeekend, setDate, startOfDay, startOfMonth, startOfQuarter, startOfWeek, startOfYear, startOfMinute, startOfHour, endOfMinute, endOfHour, differenceInMinutes, eachHourOfInterval } from 'date-fns';
3
2
  export type GanttDateUtil = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
4
3
  export declare class GanttDate {
@@ -2,8 +2,8 @@ import { GanttItem, GanttItemInternal } from '../class/item';
2
2
  export interface Dictionary<T = unknown> {
3
3
  [key: string]: T;
4
4
  }
5
- export declare function isNumber(value: any): boolean;
6
- export declare function isString(value: any): boolean;
5
+ export declare function isNumber(value: any): value is number;
6
+ export declare function isString(value: any): value is string;
7
7
  export declare function isUndefined(value: any): boolean;
8
8
  export declare function hexToRgb(color: string, opacity?: number): string;
9
9
  export declare function uniqBy<T = unknown>(array: T[], key: keyof T): any[];
package/views/hour.d.ts CHANGED
@@ -14,6 +14,7 @@ export declare class GanttViewHour extends GanttView {
14
14
  private getHourOccupancyWidth;
15
15
  getPrimaryDatePoints(): GanttDatePoint[];
16
16
  getSecondaryDatePoints(): GanttDatePoint[];
17
+ getTodayXPoint(): number;
17
18
  getDateIntervalWidth(start: GanttDate, end: GanttDate): number;
18
19
  getDateByXPoint(x: number): GanttDate;
19
20
  }
package/views/view.d.ts CHANGED
@@ -3,8 +3,8 @@ import { GanttViewType } from '../class';
3
3
  import { GanttDatePoint } from '../class/date-point';
4
4
  import { GanttDateFormat } from '../gantt.config';
5
5
  import { GanttDate, GanttDateUtil } from '../utils/date';
6
- export declare const primaryDatePointTop = 18;
7
- export declare const secondaryDatePointTop = 36;
6
+ export declare const primaryDatePointTop = "40%";
7
+ export declare const secondaryDatePointTop = "80%";
8
8
  export interface GanttViewDate {
9
9
  date: GanttDate;
10
10
  isCustom?: boolean;