@frxjs/ngx-timeline 1.0.5 → 1.1.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 (31) hide show
  1. package/README.md +136 -136
  2. package/bundles/frxjs-ngx-timeline.umd.js +658 -653
  3. package/bundles/frxjs-ngx-timeline.umd.js.map +1 -1
  4. package/esm2015/frxjs-ngx-timeline.js +7 -7
  5. package/esm2015/lib/components/index.js +3 -3
  6. package/esm2015/lib/components/ngx-timeline-event/ngx-timeline-event.component.js +55 -55
  7. package/esm2015/lib/components/ngx-timeline.component.js +146 -147
  8. package/esm2015/lib/models/NgxConfigObj.js +93 -93
  9. package/esm2015/lib/models/NgxTimelineEvent.js +5 -5
  10. package/esm2015/lib/models/index.js +3 -3
  11. package/esm2015/lib/ngx-timeline.module.js +22 -22
  12. package/esm2015/lib/pipes/index.js +2 -2
  13. package/esm2015/lib/pipes/ngx-date-pipe.js +27 -27
  14. package/esm2015/public-api.js +7 -7
  15. package/fesm2015/frxjs-ngx-timeline.js +323 -324
  16. package/fesm2015/frxjs-ngx-timeline.js.map +1 -1
  17. package/frxjs-ngx-timeline.d.ts +7 -7
  18. package/frxjs-ngx-timeline.metadata.json +1 -1
  19. package/lib/components/index.d.ts +2 -2
  20. package/lib/components/ngx-timeline-event/ngx-timeline-event.component.d.ts +35 -35
  21. package/lib/components/ngx-timeline.component.d.ts +76 -76
  22. package/lib/models/NgxConfigObj.d.ts +59 -59
  23. package/lib/models/NgxTimelineEvent.d.ts +29 -29
  24. package/lib/models/index.d.ts +2 -2
  25. package/lib/ngx-timeline.module.d.ts +2 -2
  26. package/lib/pipes/index.d.ts +1 -1
  27. package/lib/pipes/ngx-date-pipe.d.ts +7 -7
  28. package/package.json +3 -3
  29. package/public-api.d.ts +4 -4
  30. package/bundles/frxjs-ngx-timeline.umd.min.js +0 -2
  31. package/bundles/frxjs-ngx-timeline.umd.min.js.map +0 -1
package/README.md CHANGED
@@ -1,136 +1,136 @@
1
- # NgxTimeline ![check-code-coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)
2
-
3
- The main goal of this angular library is to give you the possibility to integrate a timeline in your app.
4
- <br/>
5
- Go to [here](https://emanuelefricano93.github.io/frxjs-Ngx-Timeline/) and discover all possible configurations for the timeline
6
-
7
- ![image](https://user-images.githubusercontent.com/26500344/130092921-8338496a-31df-46fa-b75f-40989eb53d33.png)
8
- <p align = "center">
9
- Fig.1 - Preview of <a href="https://emanuelefricano93.github.io/frxjs-Ngx-Timeline/">Timeline example configuration page</a>
10
- </p>
11
- <br/><br/>
12
-
13
-
14
- ## Installation
15
- Running the following command to install the library
16
- ```
17
- npm install @frxjs/ngx-timeline
18
- ```
19
- <br/><br/>
20
-
21
-
22
-
23
- ## Examples of Usage
24
-
25
- After installing the library and including NgxTimelineModule in your imports module you could add one of following examples to your template in order to display your timeline
26
-
27
- ```
28
- <ngx-timeline [events]="events"></ngx-timeline>
29
- <ngx-timeline [events]="events" [langCode]="it"></ngx-timeline>
30
- <ngx-timeline [events]="events" [langCode]="it" [enableAnimation]="false"></ngx-timeline>
31
- ```
32
- <br/><br/>
33
-
34
- ## Configuration
35
-
36
- ### Input
37
- Input name | Explanation | Mandatory | Type/Supported Values | Default value
38
- --- | --- | --- | --- | ---
39
- events | list of events to be displayed | yes | NgxTimelineEvent | no default
40
- langCode | language code use to format dates | no | <ul><li>'en'</li><li>'it'</li><li>'fr'</li><li>'de'</li><li>'es'</li></ul> | 'en'
41
- enableAnimation | Boolean used to enable or disable the animations | no | boolean | true
42
- groupEvent | Logic to be applied in order to group events | no | enum NgxTimelineEventGroup | NgxTimelineEventGroup.MONTH_YEAR
43
- changeSideInGroup | Logic to be applied in order to put evetns on LEFT or RIGHT | no | enum NgxTimelineEventChangeSideInGroup | NgxTimelineEventChangeSideInGroup.ON_DIFFERENT_DAY
44
- periodCustomTemplate | Custom Template displayed before a group of events | no | TemplateRef<any> | no default
45
- eventCustomTemplate | Custom Template displayed to show a single event | no | TemplateRef<any> | no default
46
- centerIconCustomTemplate | Custom Template displayed to show an separator icon | no | TemplateRef<any> | no default
47
- dateInstantCustomTemplate | Custom Template displayed to show the side date | no | TemplateRef<any> | no default
48
- innerEventCustomTemplate | Custom Template displayed to show the inner event | no | TemplateRef<any> | no default
49
- <br/>
50
-
51
- ### Output
52
- Output name | Explanation | Mandatory | Type/Supported Values | Default value
53
- --- | --- | --- | --- | ---
54
- clickEmitter | Output click event emitter | no | BehaviorSubject<NgxTimelineItem> | no default
55
- <br/>
56
-
57
- ### Types and Enums
58
- ```typescript
59
- interface NgxTimelineEvent {
60
- timestamp?: Date;
61
- title?: string;
62
- description?: string;
63
- id?: any;
64
- }
65
- ```
66
- ```typescript
67
- enum NgxTimelineEventGroup {
68
- YEAR = 'YEAR',
69
- MONTH_YEAR = 'MONTH_YEAR',
70
- DAY_MONTH_YEAR = 'DAY_MONTH_YEAR'
71
- }
72
- ```
73
- ```typescript
74
- enum NgxTimelineEventChangeSideInGroup {
75
- ALL = 'ALL',
76
- ON_DIFFERENT_HMS = 'ON_DIFFERENT_HMS',
77
- ON_DIFFERENT_DAY = 'ON_DIFFERENT_DAY',
78
- ON_DIFFERENT_MONTH = 'ON_DIFFERENT_MONTH'
79
- }
80
- ```
81
- <br/>
82
-
83
- ### Examples with contexts of custom templates
84
- ```html
85
- <ng-template #periodCustomTemplate let-period=period let-index=index>
86
- <div [ngClass]="{'transparent first-line': !index}" class="line"></div>
87
- <div class="period-container">
88
- <p>
89
- {{index}} - {{period | json }}
90
- </p>
91
- </div>
92
- <div class="line"></div>
93
- </ng-template>
94
- ```
95
- ```html
96
- <ng-template #centerIconCustomTemplate>
97
- <div class="icon-container">
98
- <img src="assets/image.png"/>
99
- </div>
100
- </ng-template>
101
- ```
102
- ```html
103
- <ng-template #innerEventCustomTemplate let-event=event>
104
- <div class="event" (click)="handleClick(event)">
105
- {{event | json}}
106
- </div>
107
- </ng-template>
108
- ```
109
- ```html
110
- <ng-template #eventCustomTemplate let-event=event let-colSidePosition=colSidePosition>
111
- <div class="event" (click)="handleClick(event)">
112
- {{event | json}}
113
- </div>
114
- </ng-template>
115
- ```
116
- ```html
117
- <ng-template #dateInstantCustomTemplate let-item=item>
118
- <span>
119
- {{item | json}}
120
- </span>
121
- </ng-template>
122
- ```
123
- <br/><br/>
124
-
125
- ## How to contribute
126
- First of all, in order to track everything, open an issue describing the problem or a missing functionality you would like to add to the lib.
127
-
128
- To start the contribution:
129
- - `npm run watch-lib` (you are builduing the lib with --watch options)
130
- - `npm run start-dev` (you are linking the lib and starting the demo app )
131
-
132
- Every time you will change the code in your lib, any update will trigger the re-load of the app.
133
- When your code will be ready, create a Pull Request and put the link in a comment under the issue you opened before.
134
- Now is time to enjoy and start to code.
135
-
136
- Thanks in advance for your contribution
1
+ # NgxTimeline ![check-code-coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)
2
+
3
+ The main goal of this angular library is to give you the possibility to integrate a timeline in your app.
4
+ <br/>
5
+ Go [here](https://emanuelefricano93.github.io/frxjs-Ngx-Timeline/) and discover all possible configurations for the timeline
6
+
7
+ ![image](https://user-images.githubusercontent.com/26500344/130092921-8338496a-31df-46fa-b75f-40989eb53d33.png)
8
+ <p align = "center">
9
+ Fig.1 - Preview of <a href="https://emanuelefricano93.github.io/frxjs-Ngx-Timeline/">Timeline example configuration page</a>
10
+ </p>
11
+ <br/><br/>
12
+
13
+
14
+ ## Installation
15
+ Running the following command to install the library
16
+ ```
17
+ npm install @frxjs/ngx-timeline
18
+ ```
19
+ <br/><br/>
20
+
21
+
22
+
23
+ ## Examples of Usage
24
+
25
+ After installing the library and including NgxTimelineModule in your imports module you could add one of following examples to your template in order to display your timeline
26
+
27
+ ```
28
+ <ngx-timeline [events]="events"></ngx-timeline>
29
+ <ngx-timeline [events]="events" [langCode]="it"></ngx-timeline>
30
+ <ngx-timeline [events]="events" [langCode]="it" [enableAnimation]="false"></ngx-timeline>
31
+ ```
32
+ <br/><br/>
33
+
34
+ ## Configuration
35
+
36
+ ### Input
37
+ Input name | Explanation | Mandatory | Type/Supported Values | Default value
38
+ --- | --- | --- | --- | ---
39
+ events | list of events to be displayed | yes | NgxTimelineEvent | no default
40
+ langCode | language code use to format dates | no | <ul><li>'en'</li><li>'it'</li><li>'fr'</li><li>'de'</li><li>'es'</li></ul> | 'en'
41
+ enableAnimation | Boolean used to enable or disable the animations | no | boolean | true
42
+ groupEvent | Logic to be applied in order to group events | no | enum NgxTimelineEventGroup | NgxTimelineEventGroup.MONTH_YEAR
43
+ changeSideInGroup | Logic to be applied in order to put evetns on LEFT or RIGHT | no | enum NgxTimelineEventChangeSideInGroup | NgxTimelineEventChangeSideInGroup.ON_DIFFERENT_DAY
44
+ periodCustomTemplate | Custom Template displayed before a group of events | no | TemplateRef<any> | no default
45
+ eventCustomTemplate | Custom Template displayed to show a single event | no | TemplateRef<any> | no default
46
+ centerIconCustomTemplate | Custom Template displayed to show an separator icon | no | TemplateRef<any> | no default
47
+ dateInstantCustomTemplate | Custom Template displayed to show the side date | no | TemplateRef<any> | no default
48
+ innerEventCustomTemplate | Custom Template displayed to show the inner event | no | TemplateRef<any> | no default
49
+ <br/>
50
+
51
+ ### Output
52
+ Output name | Explanation | Mandatory | Type/Supported Values | Default value
53
+ --- | --- | --- | --- | ---
54
+ clickEmitter | Output click event emitter | no | BehaviorSubject<NgxTimelineItem> | no default
55
+ <br/>
56
+
57
+ ### Types and Enums
58
+ ```typescript
59
+ interface NgxTimelineEvent {
60
+ timestamp?: Date;
61
+ title?: string;
62
+ description?: string;
63
+ id?: any;
64
+ }
65
+ ```
66
+ ```typescript
67
+ enum NgxTimelineEventGroup {
68
+ YEAR = 'YEAR',
69
+ MONTH_YEAR = 'MONTH_YEAR',
70
+ DAY_MONTH_YEAR = 'DAY_MONTH_YEAR'
71
+ }
72
+ ```
73
+ ```typescript
74
+ enum NgxTimelineEventChangeSideInGroup {
75
+ ALL = 'ALL',
76
+ ON_DIFFERENT_HMS = 'ON_DIFFERENT_HMS',
77
+ ON_DIFFERENT_DAY = 'ON_DIFFERENT_DAY',
78
+ ON_DIFFERENT_MONTH = 'ON_DIFFERENT_MONTH'
79
+ }
80
+ ```
81
+ <br/>
82
+
83
+ ### Examples with contexts of custom templates
84
+ ```html
85
+ <ng-template #periodCustomTemplate let-period=period let-index=index>
86
+ <div [ngClass]="{'transparent first-line': !index}" class="line"></div>
87
+ <div class="period-container">
88
+ <p>
89
+ {{index}} - {{period | json }}
90
+ </p>
91
+ </div>
92
+ <div class="line"></div>
93
+ </ng-template>
94
+ ```
95
+ ```html
96
+ <ng-template #centerIconCustomTemplate>
97
+ <div class="icon-container">
98
+ <img src="assets/image.png"/>
99
+ </div>
100
+ </ng-template>
101
+ ```
102
+ ```html
103
+ <ng-template #innerEventCustomTemplate let-event=event>
104
+ <div class="event" (click)="handleClick(event)">
105
+ {{event | json}}
106
+ </div>
107
+ </ng-template>
108
+ ```
109
+ ```html
110
+ <ng-template #eventCustomTemplate let-event=event let-colSidePosition=colSidePosition>
111
+ <div class="event" (click)="handleClick(event)">
112
+ {{event | json}}
113
+ </div>
114
+ </ng-template>
115
+ ```
116
+ ```html
117
+ <ng-template #dateInstantCustomTemplate let-item=item>
118
+ <span>
119
+ {{item | json}}
120
+ </span>
121
+ </ng-template>
122
+ ```
123
+ <br/><br/>
124
+
125
+ ## How to contribute
126
+ First of all, in order to track everything, open an issue describing the problem or a missing functionality you would like to add to the lib.
127
+
128
+ To start the contribution:
129
+ - `npm run watch-lib` (you are builduing the lib with --watch options)
130
+ - `npm run start-dev` (you are linking the lib and starting the demo app )
131
+
132
+ Every time you will change the code in your lib, any update will trigger the re-load of the app.
133
+ When your code will be ready, create a Pull Request and put the link in a comment under the issue you opened before.
134
+ Now is time to enjoy and start to code.
135
+
136
+ Thanks in advance for your contribution