@spicainternational/ngx-sds-components 5.30.1 → 5.31.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/public-api.mjs +2 -1
- package/esm2020/src/lib/date-picker/date-picker.component.mjs +40 -68
- package/esm2020/src/lib/number-box/number-box.component.mjs +3 -1
- package/esm2020/src/lib/timeline/components/timeline.component.mjs +254 -0
- package/esm2020/src/lib/timeline/models/timeline.model.mjs +2 -0
- package/esm2020/src/lib/timeline/public-api.mjs +3 -0
- package/esm2020/src/lib/timeline/services/timeline.service.mjs +115 -0
- package/esm2020/src/lib/timeline/spicainternational-ngx-sds-components-src-lib-timeline.mjs +5 -0
- package/esm2020/src/lib/timeline/timeline.module.mjs +26 -0
- package/esm2020/src/lib/timeline/types/timeline.types.mjs +2 -0
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-date-picker.mjs +39 -67
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-date-picker.mjs.map +1 -1
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-number-box.mjs +2 -0
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-number-box.mjs.map +1 -1
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-timeline.mjs +401 -0
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-timeline.mjs.map +1 -0
- package/fesm2015/spicainternational-ngx-sds-components.mjs +1 -0
- package/fesm2015/spicainternational-ngx-sds-components.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-date-picker.mjs +39 -67
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-date-picker.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-number-box.mjs +2 -0
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-number-box.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-timeline.mjs +398 -0
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-timeline.mjs.map +1 -0
- package/fesm2020/spicainternational-ngx-sds-components.mjs +1 -0
- package/fesm2020/spicainternational-ngx-sds-components.mjs.map +1 -1
- package/package.json +9 -1
- package/public-api.d.ts +1 -0
- package/src/lib/date-picker/date-picker.component.d.ts +4 -0
- package/src/lib/timeline/components/timeline.component.d.ts +116 -0
- package/src/lib/timeline/models/timeline.model.d.ts +21 -0
- package/src/lib/timeline/package.json +10 -0
- package/src/lib/timeline/public-api.d.ts +2 -0
- package/src/lib/timeline/services/timeline.service.d.ts +22 -0
- package/src/lib/timeline/spicainternational-ngx-sds-components-src-lib-timeline.d.ts +5 -0
- package/src/lib/timeline/timeline.module.d.ts +8 -0
- package/src/lib/timeline/types/timeline.types.d.ts +1 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, OnChanges, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
|
|
2
|
+
import { TimelineTickFrequency } from '../types/timeline.types';
|
|
3
|
+
import { TimelineIntervalLabel, TimelineItem, TimelineItemPresentation, TimelineTick } from '../models/timeline.model';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class SdsTimelineComponent implements OnInit, OnChanges, AfterViewInit {
|
|
6
|
+
/**
|
|
7
|
+
* The start date and time for the timeline.
|
|
8
|
+
*
|
|
9
|
+
* @type {Date}
|
|
10
|
+
* @memberof SdsTimelineComponent
|
|
11
|
+
*/
|
|
12
|
+
start: Date;
|
|
13
|
+
/**
|
|
14
|
+
* The end date and time for the timeline.
|
|
15
|
+
*
|
|
16
|
+
* @type {Date}
|
|
17
|
+
* @memberof SdsTimelineComponent
|
|
18
|
+
*/
|
|
19
|
+
end: Date;
|
|
20
|
+
/**
|
|
21
|
+
* The items to be displayed on the timeline. Specify data if you need
|
|
22
|
+
* additional data for custom rendering of the items.
|
|
23
|
+
*
|
|
24
|
+
* @type {TimelineItem[]}
|
|
25
|
+
* @memberof SdsTimelineComponent
|
|
26
|
+
*/
|
|
27
|
+
items: TimelineItem[];
|
|
28
|
+
/**
|
|
29
|
+
* The template to be used for custom rendering of the items.
|
|
30
|
+
*
|
|
31
|
+
* @type {(TemplateRef<any> | undefined)}
|
|
32
|
+
* @memberof SdsTimelineComponent
|
|
33
|
+
*/
|
|
34
|
+
itemTemplate: TemplateRef<any> | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* The frequency of the ticks on the timeline.
|
|
37
|
+
*
|
|
38
|
+
* @type {TimelineTickFrequency}
|
|
39
|
+
* @memberof SdsTimelineComponent
|
|
40
|
+
*/
|
|
41
|
+
tickFrequency: TimelineTickFrequency;
|
|
42
|
+
/**
|
|
43
|
+
* The current zoom level of the timeline. In percent.
|
|
44
|
+
*
|
|
45
|
+
* @type {number}
|
|
46
|
+
* @memberof SdsTimelineComponent
|
|
47
|
+
*/
|
|
48
|
+
zoomPercent: number;
|
|
49
|
+
/**
|
|
50
|
+
* The maximum allowed zoom level of the timeline. In percent.
|
|
51
|
+
*
|
|
52
|
+
* @type {number}
|
|
53
|
+
* @memberof SdsTimelineComponent
|
|
54
|
+
*/
|
|
55
|
+
maxZoomPercent: number;
|
|
56
|
+
/**
|
|
57
|
+
* Whether to show hour labels.
|
|
58
|
+
*
|
|
59
|
+
* @type {boolean}
|
|
60
|
+
* @memberof SdsTimelineComponent
|
|
61
|
+
*/
|
|
62
|
+
showHourLabels: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Whether to show day labels.
|
|
65
|
+
*
|
|
66
|
+
* @type {boolean}
|
|
67
|
+
* @memberof SdsTimelineComponent
|
|
68
|
+
*/
|
|
69
|
+
showDayLabels: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* The height of the timeline. Default is 2rem.
|
|
72
|
+
*
|
|
73
|
+
* @type {string}
|
|
74
|
+
* @memberof SdsTimelineComponent
|
|
75
|
+
*/
|
|
76
|
+
timelineHeight: string;
|
|
77
|
+
/**
|
|
78
|
+
* Whether to enable zoom and drag functionality.
|
|
79
|
+
*
|
|
80
|
+
* @type {boolean}
|
|
81
|
+
* @memberof SdsTimelineComponent
|
|
82
|
+
*/
|
|
83
|
+
enableZoomAndDrag: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Number of minutes added to start and stop to fit the data on the edges
|
|
86
|
+
*
|
|
87
|
+
* @type {number}
|
|
88
|
+
* @memberof SdsTimelineComponent
|
|
89
|
+
*/
|
|
90
|
+
offSetMinutes: number;
|
|
91
|
+
hourTicks: TimelineTick[];
|
|
92
|
+
hourLabels: TimelineIntervalLabel[];
|
|
93
|
+
dayLabels: TimelineIntervalLabel[];
|
|
94
|
+
private _timelineService;
|
|
95
|
+
presentationItems: TimelineItemPresentation[];
|
|
96
|
+
viewOffsetPercent: number;
|
|
97
|
+
isDragging: boolean;
|
|
98
|
+
initialDragX: number;
|
|
99
|
+
private viewOffsetPercentDragStart;
|
|
100
|
+
_viewport: ElementRef | undefined;
|
|
101
|
+
constructor();
|
|
102
|
+
ngAfterViewInit(): void;
|
|
103
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
104
|
+
ngOnInit(): void;
|
|
105
|
+
onScroll(event: WheelEvent): void;
|
|
106
|
+
onDragStart(event: MouseEvent | TouchEvent): void;
|
|
107
|
+
onDragMove(event: MouseEvent): void;
|
|
108
|
+
onDragMoveTouch(event: TouchEvent): void;
|
|
109
|
+
onDragEnd(event: MouseEvent | TouchEvent): void;
|
|
110
|
+
private moveElement;
|
|
111
|
+
private constrainOffset;
|
|
112
|
+
private generateTicks;
|
|
113
|
+
private generateInternalTimelineItems;
|
|
114
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SdsTimelineComponent, never>;
|
|
115
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdsTimelineComponent, "sds-timeline", never, { "start": "start"; "end": "end"; "items": "items"; "itemTemplate": "itemTemplate"; "tickFrequency": "tickFrequency"; "zoomPercent": "zoomPercent"; "maxZoomPercent": "maxZoomPercent"; "showHourLabels": "showHourLabels"; "showDayLabels": "showDayLabels"; "timelineHeight": "timelineHeight"; "enableZoomAndDrag": "enableZoomAndDrag"; }, {}, never, never>;
|
|
116
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface TimelineTick {
|
|
2
|
+
date: Date;
|
|
3
|
+
x: number;
|
|
4
|
+
}
|
|
5
|
+
export interface TimelineIntervalLabel {
|
|
6
|
+
x: number;
|
|
7
|
+
width: number;
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
export interface TimelineItem {
|
|
11
|
+
data?: any;
|
|
12
|
+
start: Date;
|
|
13
|
+
end: Date;
|
|
14
|
+
hint?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface TimelineItemPresentation {
|
|
17
|
+
data?: any;
|
|
18
|
+
x: number;
|
|
19
|
+
width: number;
|
|
20
|
+
hint?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"module": "../../../fesm2015/spicainternational-ngx-sds-components-src-lib-timeline.mjs",
|
|
3
|
+
"es2020": "../../../fesm2020/spicainternational-ngx-sds-components-src-lib-timeline.mjs",
|
|
4
|
+
"esm2020": "../../../esm2020/src/lib/timeline/spicainternational-ngx-sds-components-src-lib-timeline.mjs",
|
|
5
|
+
"fesm2020": "../../../fesm2020/spicainternational-ngx-sds-components-src-lib-timeline.mjs",
|
|
6
|
+
"fesm2015": "../../../fesm2015/spicainternational-ngx-sds-components-src-lib-timeline.mjs",
|
|
7
|
+
"typings": "spicainternational-ngx-sds-components-src-lib-timeline.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"name": "@spicainternational/ngx-sds-components/src/lib/timeline"
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TimelineIntervalLabel, TimelineTick } from '../models/timeline.model';
|
|
2
|
+
import { TimelineTickFrequency } from '../types/timeline.types';
|
|
3
|
+
export declare class SdsTimelineService {
|
|
4
|
+
private start;
|
|
5
|
+
private end;
|
|
6
|
+
private widthPercentPerMinute;
|
|
7
|
+
private hourTicks;
|
|
8
|
+
dayLabels: TimelineIntervalLabel[];
|
|
9
|
+
hourLabels: TimelineIntervalLabel[];
|
|
10
|
+
constructor(start: Date, end: Date, offSetMinutes: number);
|
|
11
|
+
getX(time: Date): number;
|
|
12
|
+
getWidthFromMinutes(minutes: number): number;
|
|
13
|
+
getWidthFromTime(start: Date, end: Date): number;
|
|
14
|
+
getTick(time: Date): TimelineTick;
|
|
15
|
+
getHourTicks(frequency?: TimelineTickFrequency): TimelineTick[];
|
|
16
|
+
private diffInMinutes;
|
|
17
|
+
private roundHoursUp;
|
|
18
|
+
private roundHoursDown;
|
|
19
|
+
private initHourTicks;
|
|
20
|
+
private initDayLabels;
|
|
21
|
+
private initHourLabels;
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./components/timeline.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
export declare class SdsTimelineModule {
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SdsTimelineModule, never>;
|
|
6
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<SdsTimelineModule, [typeof i1.SdsTimelineComponent], [typeof i2.CommonModule], [typeof i1.SdsTimelineComponent]>;
|
|
7
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<SdsTimelineModule>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type TimelineTickFrequency = 'hourly' | '3hrs' | '6hrs';
|