@frxjs/ngx-timeline 1.0.3 → 1.0.7

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 (89) hide show
  1. package/README.md +136 -127
  2. package/bundles/frxjs-ngx-timeline.umd.js +696 -0
  3. package/bundles/frxjs-ngx-timeline.umd.js.map +1 -0
  4. package/bundles/frxjs-ngx-timeline.umd.min.js +2 -0
  5. package/bundles/frxjs-ngx-timeline.umd.min.js.map +1 -0
  6. package/esm2015/frxjs-ngx-timeline.js +8 -0
  7. package/esm2015/lib/components/index.js +3 -0
  8. package/esm2015/lib/components/ngx-timeline-event/ngx-timeline-event.component.js +55 -0
  9. package/esm2015/lib/components/ngx-timeline.component.js +147 -0
  10. package/esm2015/lib/models/NgxConfigObj.js +93 -0
  11. package/esm2015/lib/models/NgxTimelineEvent.js +6 -0
  12. package/esm2015/lib/models/index.js +3 -0
  13. package/esm2015/lib/ngx-timeline.module.js +23 -0
  14. package/esm2015/lib/pipes/index.js +2 -0
  15. package/esm2015/lib/pipes/ngx-date-pipe.js +28 -0
  16. package/esm2015/public-api.js +8 -0
  17. package/fesm2015/frxjs-ngx-timeline.js +350 -0
  18. package/fesm2015/frxjs-ngx-timeline.js.map +1 -0
  19. package/frxjs-ngx-timeline.d.ts +7 -0
  20. package/frxjs-ngx-timeline.metadata.json +1 -0
  21. package/{projects/ngx-timeline/src/lib/components/index.ts → lib/components/index.d.ts} +2 -2
  22. package/lib/components/ngx-timeline-event/ngx-timeline-event.component.d.ts +35 -0
  23. package/lib/components/ngx-timeline.component.d.ts +76 -0
  24. package/lib/models/NgxConfigObj.d.ts +59 -0
  25. package/lib/models/NgxTimelineEvent.d.ts +29 -0
  26. package/{projects/ngx-timeline/src/lib/models/index.ts → lib/models/index.d.ts} +2 -2
  27. package/lib/ngx-timeline.module.d.ts +2 -0
  28. package/{projects/ngx-timeline/src/lib/pipes/index.ts → lib/pipes/index.d.ts} +1 -1
  29. package/lib/pipes/ngx-date-pipe.d.ts +7 -0
  30. package/package.json +21 -50
  31. package/{projects/ngx-timeline/src/public-api.ts → public-api.d.ts} +4 -7
  32. package/.editorconfig +0 -16
  33. package/.github/workflows/main.yml +0 -25
  34. package/angular.json +0 -169
  35. package/docs/3rdpartylicenses.txt +0 -268
  36. package/docs/assets/inter.png +0 -0
  37. package/docs/favicon.ico +0 -0
  38. package/docs/index.html +0 -13
  39. package/docs/main.6005a10000c87d7095d3.js +0 -1
  40. package/docs/polyfills.f8ddde825b13760c1743.js +0 -1
  41. package/docs/runtime.0e49e2b53282f40c8925.js +0 -1
  42. package/docs/styles.09e2c710755c8867a460.css +0 -0
  43. package/package-lock.json +0 -14400
  44. package/projects/demo-app/.browserslistrc +0 -17
  45. package/projects/demo-app/e2e/protractor.conf.js +0 -37
  46. package/projects/demo-app/e2e/src/app.e2e-spec.ts +0 -23
  47. package/projects/demo-app/e2e/src/app.po.ts +0 -11
  48. package/projects/demo-app/e2e/tsconfig.json +0 -13
  49. package/projects/demo-app/karma.conf.js +0 -44
  50. package/projects/demo-app/src/app/app.component.html +0 -90
  51. package/projects/demo-app/src/app/app.component.scss +0 -417
  52. package/projects/demo-app/src/app/app.component.ts +0 -147
  53. package/projects/demo-app/src/app/app.module.ts +0 -20
  54. package/projects/demo-app/src/assets/.gitkeep +0 -0
  55. package/projects/demo-app/src/assets/inter.png +0 -0
  56. package/projects/demo-app/src/environments/environment.prod.ts +0 -3
  57. package/projects/demo-app/src/environments/environment.ts +0 -16
  58. package/projects/demo-app/src/favicon.ico +0 -0
  59. package/projects/demo-app/src/index.html +0 -13
  60. package/projects/demo-app/src/main.ts +0 -12
  61. package/projects/demo-app/src/polyfills.ts +0 -63
  62. package/projects/demo-app/src/styles.scss +0 -1
  63. package/projects/demo-app/src/test.ts +0 -25
  64. package/projects/demo-app/tsconfig.app.json +0 -26
  65. package/projects/demo-app/tsconfig.spec.json +0 -18
  66. package/projects/demo-app/tslint.json +0 -17
  67. package/projects/ngx-timeline/README.md +0 -127
  68. package/projects/ngx-timeline/karma.conf.js +0 -44
  69. package/projects/ngx-timeline/ng-package.json +0 -7
  70. package/projects/ngx-timeline/package.json +0 -17
  71. package/projects/ngx-timeline/src/lib/components/ngx-timeline-event/ngx-timeline-event.component.html +0 -37
  72. package/projects/ngx-timeline/src/lib/components/ngx-timeline-event/ngx-timeline-event.component.scss +0 -197
  73. package/projects/ngx-timeline/src/lib/components/ngx-timeline-event/ngx-timeline-event.component.spec.ts +0 -89
  74. package/projects/ngx-timeline/src/lib/components/ngx-timeline-event/ngx-timeline-event.component.ts +0 -66
  75. package/projects/ngx-timeline/src/lib/components/ngx-timeline.component.html +0 -98
  76. package/projects/ngx-timeline/src/lib/components/ngx-timeline.component.spec.ts +0 -160
  77. package/projects/ngx-timeline/src/lib/components/ngx-timeline.component.ts +0 -187
  78. package/projects/ngx-timeline/src/lib/components/ngx-timeline.scss +0 -226
  79. package/projects/ngx-timeline/src/lib/models/NgxConfigObj.ts +0 -110
  80. package/projects/ngx-timeline/src/lib/models/NgxTimelineEvent.ts +0 -32
  81. package/projects/ngx-timeline/src/lib/ngx-timeline.module.ts +0 -21
  82. package/projects/ngx-timeline/src/lib/pipes/ngx-date-pipe.ts +0 -29
  83. package/projects/ngx-timeline/src/test.ts +0 -26
  84. package/projects/ngx-timeline/tsconfig.lib.json +0 -25
  85. package/projects/ngx-timeline/tsconfig.lib.prod.json +0 -10
  86. package/projects/ngx-timeline/tsconfig.spec.json +0 -17
  87. package/projects/ngx-timeline/tslint.json +0 -17
  88. package/tsconfig.json +0 -35
  89. package/tslint.json +0 -140
package/README.md CHANGED
@@ -1,127 +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
- ## Examples of Usage
15
-
16
- After including "@frxjs/ngx-timeline": "1.0.0" in your dependencies list, npm install and including NgxTimelineModule in your imports module you could add one of following examples to your template in order to display your timeline
17
-
18
- ```
19
- <ngx-timeline [events]="events"></ngx-timeline>
20
- <ngx-timeline [events]="events" [langCode]="it"></ngx-timeline>
21
- <ngx-timeline [events]="events" [langCode]="it" [enableAnimation]="false"></ngx-timeline>
22
- ```
23
- <br/><br/>
24
-
25
- ## Configuration
26
-
27
- ### Input
28
- Input name | Explanation | Mandatory | Type/Supported Values | Default value
29
- --- | --- | --- | --- | ---
30
- events | list of events to be displayed | yes | NgxTimelineEvent | no default
31
- 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'
32
- enableAnimation | Boolean used to enable or disable the animations | no | boolean | true
33
- groupEvent | Logic to be applied in order to group events | no | enum NgxTimelineEventGroup | NgxTimelineEventGroup.MONTH_YEAR
34
- changeSideInGroup | Logic to be applied in order to put evetns on LEFT or RIGHT | no | enum NgxTimelineEventChangeSideInGroup | NgxTimelineEventChangeSideInGroup.ON_DIFFERENT_DAY
35
- periodCustomTemplate | Custom Template displayed before a group of events | no | TemplateRef<any> | no default
36
- eventCustomTemplate | Custom Template displayed to show a single event | no | TemplateRef<any> | no default
37
- centerIconCustomTemplate | Custom Template displayed to show an separator icon | no | TemplateRef<any> | no default
38
- dateInstantCustomTemplate | Custom Template displayed to show the side date | no | TemplateRef<any> | no default
39
- innerEventCustomTemplate | Custom Template displayed to show the inner event | no | TemplateRef<any> | no default
40
- <br/>
41
-
42
- ### Output
43
- Output name | Explanation | Mandatory | Type/Supported Values | Default value
44
- --- | --- | --- | --- | ---
45
- clickEmitter | Output click event emitter | no | BehaviorSubject<NgxTimelineItem> | no default
46
- <br/>
47
-
48
- ### Types and Enums
49
- ```typescript
50
- interface NgxTimelineEvent {
51
- timestamp?: Date;
52
- title?: string;
53
- description?: string;
54
- id?: any;
55
- }
56
- ```
57
- ```typescript
58
- enum NgxTimelineEventGroup {
59
- YEAR = 'YEAR',
60
- MONTH_YEAR = 'MONTH_YEAR',
61
- DAY_MONTH_YEAR = 'DAY_MONTH_YEAR'
62
- }
63
- ```
64
- ```typescript
65
- enum NgxTimelineEventChangeSideInGroup {
66
- ALL = 'ALL',
67
- ON_DIFFERENT_HMS = 'ON_DIFFERENT_HMS',
68
- ON_DIFFERENT_DAY = 'ON_DIFFERENT_DAY',
69
- ON_DIFFERENT_MONTH = 'ON_DIFFERENT_MONTH'
70
- }
71
- ```
72
- <br/>
73
-
74
- ### Examples with contexts of custom templates
75
- ```html
76
- <ng-template #periodCustomTemplate let-period=period let-index=index>
77
- <div [ngClass]="{'transparent first-line': !index}" class="line"></div>
78
- <div class="period-container">
79
- <p>
80
- {{index}} - {{period | json }}
81
- </p>
82
- </div>
83
- <div class="line"></div>
84
- </ng-template>
85
- ```
86
- ```html
87
- <ng-template #centerIconCustomTemplate>
88
- <div class="icon-container">
89
- <img src="assets/image.png"/>
90
- </div>
91
- </ng-template>
92
- ```
93
- ```html
94
- <ng-template #innerEventCustomTemplate let-event=event>
95
- <div class="event" (click)="handleClick(event)">
96
- {{event | json}}
97
- </div>
98
- </ng-template>
99
- ```
100
- ```html
101
- <ng-template #eventCustomTemplate let-event=event let-colSidePosition=colSidePosition>
102
- <div class="event" (click)="handleClick(event)">
103
- {{event | json}}
104
- </div>
105
- </ng-template>
106
- ```
107
- ```html
108
- <ng-template #dateInstantCustomTemplate let-item=item>
109
- <span>
110
- {{item | json}}
111
- </span>
112
- </ng-template>
113
- ```
114
- <br/><br/>
115
-
116
- ## How to contribute
117
- 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.
118
-
119
- To start the contribution:
120
- - `npm run watch-lib` (you are builduing the lib with --watch options)
121
- - `npm run start-dev` (you are linking the lib and starting the demo app )
122
-
123
- Every time you will change the code in your lib, any update will trigger the re-load of the app.
124
- When your code will be ready, create a Pull Request and put the link in a comment under the issue you opened before.
125
- Now is time to enjoy and start to code.
126
-
127
- 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