@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.
- package/README.md +136 -127
- package/bundles/frxjs-ngx-timeline.umd.js +696 -0
- package/bundles/frxjs-ngx-timeline.umd.js.map +1 -0
- package/bundles/frxjs-ngx-timeline.umd.min.js +2 -0
- package/bundles/frxjs-ngx-timeline.umd.min.js.map +1 -0
- package/esm2015/frxjs-ngx-timeline.js +8 -0
- package/esm2015/lib/components/index.js +3 -0
- package/esm2015/lib/components/ngx-timeline-event/ngx-timeline-event.component.js +55 -0
- package/esm2015/lib/components/ngx-timeline.component.js +147 -0
- package/esm2015/lib/models/NgxConfigObj.js +93 -0
- package/esm2015/lib/models/NgxTimelineEvent.js +6 -0
- package/esm2015/lib/models/index.js +3 -0
- package/esm2015/lib/ngx-timeline.module.js +23 -0
- package/esm2015/lib/pipes/index.js +2 -0
- package/esm2015/lib/pipes/ngx-date-pipe.js +28 -0
- package/esm2015/public-api.js +8 -0
- package/fesm2015/frxjs-ngx-timeline.js +350 -0
- package/fesm2015/frxjs-ngx-timeline.js.map +1 -0
- package/frxjs-ngx-timeline.d.ts +7 -0
- package/frxjs-ngx-timeline.metadata.json +1 -0
- package/{projects/ngx-timeline/src/lib/components/index.ts → lib/components/index.d.ts} +2 -2
- package/lib/components/ngx-timeline-event/ngx-timeline-event.component.d.ts +35 -0
- package/lib/components/ngx-timeline.component.d.ts +76 -0
- package/lib/models/NgxConfigObj.d.ts +59 -0
- package/lib/models/NgxTimelineEvent.d.ts +29 -0
- package/{projects/ngx-timeline/src/lib/models/index.ts → lib/models/index.d.ts} +2 -2
- package/lib/ngx-timeline.module.d.ts +2 -0
- package/{projects/ngx-timeline/src/lib/pipes/index.ts → lib/pipes/index.d.ts} +1 -1
- package/lib/pipes/ngx-date-pipe.d.ts +7 -0
- package/package.json +21 -50
- package/{projects/ngx-timeline/src/public-api.ts → public-api.d.ts} +4 -7
- package/.editorconfig +0 -16
- package/.github/workflows/main.yml +0 -25
- package/angular.json +0 -169
- package/docs/3rdpartylicenses.txt +0 -268
- package/docs/assets/inter.png +0 -0
- package/docs/favicon.ico +0 -0
- package/docs/index.html +0 -13
- package/docs/main.6005a10000c87d7095d3.js +0 -1
- package/docs/polyfills.f8ddde825b13760c1743.js +0 -1
- package/docs/runtime.0e49e2b53282f40c8925.js +0 -1
- package/docs/styles.09e2c710755c8867a460.css +0 -0
- package/package-lock.json +0 -14400
- package/projects/demo-app/.browserslistrc +0 -17
- package/projects/demo-app/e2e/protractor.conf.js +0 -37
- package/projects/demo-app/e2e/src/app.e2e-spec.ts +0 -23
- package/projects/demo-app/e2e/src/app.po.ts +0 -11
- package/projects/demo-app/e2e/tsconfig.json +0 -13
- package/projects/demo-app/karma.conf.js +0 -44
- package/projects/demo-app/src/app/app.component.html +0 -90
- package/projects/demo-app/src/app/app.component.scss +0 -417
- package/projects/demo-app/src/app/app.component.ts +0 -147
- package/projects/demo-app/src/app/app.module.ts +0 -20
- package/projects/demo-app/src/assets/.gitkeep +0 -0
- package/projects/demo-app/src/assets/inter.png +0 -0
- package/projects/demo-app/src/environments/environment.prod.ts +0 -3
- package/projects/demo-app/src/environments/environment.ts +0 -16
- package/projects/demo-app/src/favicon.ico +0 -0
- package/projects/demo-app/src/index.html +0 -13
- package/projects/demo-app/src/main.ts +0 -12
- package/projects/demo-app/src/polyfills.ts +0 -63
- package/projects/demo-app/src/styles.scss +0 -1
- package/projects/demo-app/src/test.ts +0 -25
- package/projects/demo-app/tsconfig.app.json +0 -26
- package/projects/demo-app/tsconfig.spec.json +0 -18
- package/projects/demo-app/tslint.json +0 -17
- package/projects/ngx-timeline/README.md +0 -127
- package/projects/ngx-timeline/karma.conf.js +0 -44
- package/projects/ngx-timeline/ng-package.json +0 -7
- package/projects/ngx-timeline/package.json +0 -17
- package/projects/ngx-timeline/src/lib/components/ngx-timeline-event/ngx-timeline-event.component.html +0 -37
- package/projects/ngx-timeline/src/lib/components/ngx-timeline-event/ngx-timeline-event.component.scss +0 -197
- package/projects/ngx-timeline/src/lib/components/ngx-timeline-event/ngx-timeline-event.component.spec.ts +0 -89
- package/projects/ngx-timeline/src/lib/components/ngx-timeline-event/ngx-timeline-event.component.ts +0 -66
- package/projects/ngx-timeline/src/lib/components/ngx-timeline.component.html +0 -98
- package/projects/ngx-timeline/src/lib/components/ngx-timeline.component.spec.ts +0 -160
- package/projects/ngx-timeline/src/lib/components/ngx-timeline.component.ts +0 -187
- package/projects/ngx-timeline/src/lib/components/ngx-timeline.scss +0 -226
- package/projects/ngx-timeline/src/lib/models/NgxConfigObj.ts +0 -110
- package/projects/ngx-timeline/src/lib/models/NgxTimelineEvent.ts +0 -32
- package/projects/ngx-timeline/src/lib/ngx-timeline.module.ts +0 -21
- package/projects/ngx-timeline/src/lib/pipes/ngx-date-pipe.ts +0 -29
- package/projects/ngx-timeline/src/test.ts +0 -26
- package/projects/ngx-timeline/tsconfig.lib.json +0 -25
- package/projects/ngx-timeline/tsconfig.lib.prod.json +0 -10
- package/projects/ngx-timeline/tsconfig.spec.json +0 -17
- package/projects/ngx-timeline/tslint.json +0 -17
- package/tsconfig.json +0 -35
- package/tslint.json +0 -140
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
2
|
-
import { NgxTimelineEvent, NgxTimelineEventGroup, NgxTimelineEventChangeSideInGroup, NgxDateFormat } from 'ngx-timeline';
|
|
3
|
-
import { BehaviorSubject } from 'rxjs';
|
|
4
|
-
import { FormGroup, FormControl } from '@angular/forms';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'app-root',
|
|
8
|
-
templateUrl: './app.component.html',
|
|
9
|
-
styleUrls: ['./app.component.scss']
|
|
10
|
-
})
|
|
11
|
-
export class AppComponent {
|
|
12
|
-
title = 'demo-app';
|
|
13
|
-
events: NgxTimelineEvent[];
|
|
14
|
-
events$: BehaviorSubject<NgxTimelineEvent[]> = new BehaviorSubject(null);
|
|
15
|
-
color = 0;
|
|
16
|
-
backgroundColor = 'red';
|
|
17
|
-
form: FormGroup;
|
|
18
|
-
ngxDateFormat = NgxDateFormat;
|
|
19
|
-
|
|
20
|
-
configurations = [
|
|
21
|
-
{
|
|
22
|
-
label: 'Language code',
|
|
23
|
-
formControlName: 'langCode',
|
|
24
|
-
options: [
|
|
25
|
-
{name: 'English', value: 'en'},
|
|
26
|
-
{name: 'French', value: 'fr'},
|
|
27
|
-
{name: 'German', value: 'de'},
|
|
28
|
-
{name: 'Spanish', value: 'es'},
|
|
29
|
-
{name: 'Italian', value: 'it'}
|
|
30
|
-
]
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
label: 'Enable animation',
|
|
34
|
-
formControlName: 'enableAnimation',
|
|
35
|
-
options: [
|
|
36
|
-
{name: 'Enable animation', value: true},
|
|
37
|
-
{name: 'Disable animation', value: false}
|
|
38
|
-
]
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
label: 'Custom class',
|
|
42
|
-
formControlName: 'customClass',
|
|
43
|
-
options: [
|
|
44
|
-
{name: 'No Custom Class', value: false},
|
|
45
|
-
{name: 'Custom Class', value: true}
|
|
46
|
-
]
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
label: 'Group events by',
|
|
50
|
-
formControlName: 'groupEvent',
|
|
51
|
-
options: [
|
|
52
|
-
{name: 'Month Year', value: NgxTimelineEventGroup.MONTH_YEAR},
|
|
53
|
-
{name: 'Day Month Year', value: NgxTimelineEventGroup.DAY_MONTH_YEAR},
|
|
54
|
-
{name: 'Year', value: NgxTimelineEventGroup.YEAR}
|
|
55
|
-
]
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
label: 'Change event side in group',
|
|
59
|
-
formControlName: 'changeSideInGroup',
|
|
60
|
-
options: [
|
|
61
|
-
{name: 'On different day', value: NgxTimelineEventChangeSideInGroup.ON_DIFFERENT_DAY},
|
|
62
|
-
{name: 'All', value: NgxTimelineEventChangeSideInGroup.ALL},
|
|
63
|
-
{name: 'On different hours, minutes and seconds', value: NgxTimelineEventChangeSideInGroup.ON_DIFFERENT_HMS},
|
|
64
|
-
{name: 'On different month', value: NgxTimelineEventChangeSideInGroup.ON_DIFFERENT_MONTH}
|
|
65
|
-
]
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
label: 'Date instant custom template',
|
|
69
|
-
formControlName: 'dateInstantCustomTemplate',
|
|
70
|
-
options: [
|
|
71
|
-
{name: 'No Custom template', value: false},
|
|
72
|
-
{name: 'Custom Date Instant Template', value: true}
|
|
73
|
-
]
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
label: 'Event custom template',
|
|
77
|
-
formControlName: 'eventCustomTemplate',
|
|
78
|
-
options: [
|
|
79
|
-
{name: 'No Custom template', value: false},
|
|
80
|
-
{name: 'Custom Event Template', value: true}
|
|
81
|
-
]
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
label: 'Inner event custom template',
|
|
85
|
-
formControlName: 'innerEventCustomTemplate',
|
|
86
|
-
options: [
|
|
87
|
-
{name: 'No Custom template', value: false},
|
|
88
|
-
{name: 'Custom Inner Event Template', value: true}
|
|
89
|
-
]
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
label: 'Center icon custom template',
|
|
93
|
-
formControlName: 'centerIconCustomTemplate',
|
|
94
|
-
options: [
|
|
95
|
-
{name: 'No Custom Template', value: false},
|
|
96
|
-
{name: 'Custom Icon Template', value: true}
|
|
97
|
-
]
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
label: 'Period custom template',
|
|
101
|
-
formControlName: 'periodCustomTemplate',
|
|
102
|
-
options: [
|
|
103
|
-
{name: 'No Custom Template', value: false},
|
|
104
|
-
{name: 'Custom Period Template', value: true}
|
|
105
|
-
]
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
label: 'Click emitter',
|
|
109
|
-
formControlName: 'clickEmitter',
|
|
110
|
-
options: [
|
|
111
|
-
{name: 'No emitter', value: false},
|
|
112
|
-
{name: 'Handle click (open console)', value: true}
|
|
113
|
-
]
|
|
114
|
-
}
|
|
115
|
-
];
|
|
116
|
-
constructor() {
|
|
117
|
-
this.form = new FormGroup({});
|
|
118
|
-
this.configurations.forEach(configuration =>
|
|
119
|
-
this.form.addControl(configuration.formControlName, new FormControl(configuration.options[0].value)));
|
|
120
|
-
this.initEvents();
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
private initEvents(): void {
|
|
124
|
-
const today = new Date();
|
|
125
|
-
const tomorrow = new Date();
|
|
126
|
-
tomorrow.setDate(today.getDate() + 1);
|
|
127
|
-
const nextMonth = new Date();
|
|
128
|
-
nextMonth.setMonth(today.getMonth() + 1);
|
|
129
|
-
const nextYear = new Date();
|
|
130
|
-
nextYear.setFullYear(today.getFullYear() + 1);
|
|
131
|
-
|
|
132
|
-
this.events = [
|
|
133
|
-
{ id: 5, description: 'This is the description of the event 5', timestamp: nextYear, title: 'title 5' },
|
|
134
|
-
{ id: 0, description: 'This is the description of the event 0', timestamp: today, title: 'title 0' },
|
|
135
|
-
{ id: 1, description: 'This is the description of the event 1', timestamp: tomorrow, title: 'title 1' },
|
|
136
|
-
{ id: 2, description: 'This is the description of the event 2', timestamp: today, title: 'title 2' },
|
|
137
|
-
{ id: 3, description: 'This is the description of the event 3', timestamp: tomorrow, title: 'title 3' },
|
|
138
|
-
{ id: 4, description: 'This is the description of the event 4', timestamp: nextMonth, title: 'title 4' },
|
|
139
|
-
];
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
handleClick(event: any): void {
|
|
143
|
-
if (event) {
|
|
144
|
-
window.console.log('', event);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { BrowserModule } from '@angular/platform-browser';
|
|
2
|
-
import { NgModule } from '@angular/core';
|
|
3
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
4
|
-
|
|
5
|
-
import { AppComponent } from './app.component';
|
|
6
|
-
import { NgxTimelineModule } from 'ngx-timeline';
|
|
7
|
-
|
|
8
|
-
@NgModule({
|
|
9
|
-
declarations: [
|
|
10
|
-
AppComponent
|
|
11
|
-
],
|
|
12
|
-
imports: [
|
|
13
|
-
BrowserModule,
|
|
14
|
-
ReactiveFormsModule,
|
|
15
|
-
NgxTimelineModule
|
|
16
|
-
],
|
|
17
|
-
providers: [],
|
|
18
|
-
bootstrap: [AppComponent]
|
|
19
|
-
})
|
|
20
|
-
export class AppModule { }
|
|
File without changes
|
|
Binary file
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// This file can be replaced during build by using the `fileReplacements` array.
|
|
2
|
-
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
|
|
3
|
-
// The list of file replacements can be found in `angular.json`.
|
|
4
|
-
|
|
5
|
-
export const environment = {
|
|
6
|
-
production: false
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
/*
|
|
10
|
-
* For easier debugging in development mode, you can import the following file
|
|
11
|
-
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
|
|
12
|
-
*
|
|
13
|
-
* This import should be commented out in production mode because it will have a negative impact
|
|
14
|
-
* on performance if an error is thrown.
|
|
15
|
-
*/
|
|
16
|
-
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.
|
|
Binary file
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>DemoApp</title>
|
|
6
|
-
<base href="/">
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
-
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
<app-root></app-root>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { enableProdMode } from '@angular/core';
|
|
2
|
-
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
3
|
-
|
|
4
|
-
import { AppModule } from './app/app.module';
|
|
5
|
-
import { environment } from './environments/environment';
|
|
6
|
-
|
|
7
|
-
if (environment.production) {
|
|
8
|
-
enableProdMode();
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
platformBrowserDynamic().bootstrapModule(AppModule)
|
|
12
|
-
.catch(err => console.error(err));
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file includes polyfills needed by Angular and is loaded before the app.
|
|
3
|
-
* You can add your own extra polyfills to this file.
|
|
4
|
-
*
|
|
5
|
-
* This file is divided into 2 sections:
|
|
6
|
-
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
|
|
7
|
-
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
|
|
8
|
-
* file.
|
|
9
|
-
*
|
|
10
|
-
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
|
|
11
|
-
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
|
|
12
|
-
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
|
|
13
|
-
*
|
|
14
|
-
* Learn more in https://angular.io/guide/browser-support
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/***************************************************************************************************
|
|
18
|
-
* BROWSER POLYFILLS
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/** IE11 requires the following for NgClass support on SVG elements */
|
|
22
|
-
// import 'classlist.js'; // Run `npm install --save classlist.js`.
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Web Animations `@angular/platform-browser/animations`
|
|
26
|
-
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
|
|
27
|
-
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
|
|
28
|
-
*/
|
|
29
|
-
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* By default, zone.js will patch all possible macroTask and DomEvents
|
|
33
|
-
* user can disable parts of macroTask/DomEvents patch by setting following flags
|
|
34
|
-
* because those flags need to be set before `zone.js` being loaded, and webpack
|
|
35
|
-
* will put import in the top of bundle, so user need to create a separate file
|
|
36
|
-
* in this directory (for example: zone-flags.ts), and put the following flags
|
|
37
|
-
* into that file, and then add the following code before importing zone.js.
|
|
38
|
-
* import './zone-flags';
|
|
39
|
-
*
|
|
40
|
-
* The flags allowed in zone-flags.ts are listed here.
|
|
41
|
-
*
|
|
42
|
-
* The following flags will work for all browsers.
|
|
43
|
-
*
|
|
44
|
-
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
|
|
45
|
-
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
|
|
46
|
-
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
|
|
47
|
-
*
|
|
48
|
-
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
|
|
49
|
-
* with the following flag, it will bypass `zone.js` patch for IE/Edge
|
|
50
|
-
*
|
|
51
|
-
* (window as any).__Zone_enable_cross_context_check = true;
|
|
52
|
-
*
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
/***************************************************************************************************
|
|
56
|
-
* Zone JS is required by default for Angular itself.
|
|
57
|
-
*/
|
|
58
|
-
import 'zone.js/dist/zone'; // Included with Angular CLI.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/***************************************************************************************************
|
|
62
|
-
* APPLICATION IMPORTS
|
|
63
|
-
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/* You can add global styles to this file, and also import other style files */
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
2
|
-
|
|
3
|
-
import 'zone.js/dist/zone-testing';
|
|
4
|
-
import { getTestBed } from '@angular/core/testing';
|
|
5
|
-
import {
|
|
6
|
-
BrowserDynamicTestingModule,
|
|
7
|
-
platformBrowserDynamicTesting
|
|
8
|
-
} from '@angular/platform-browser-dynamic/testing';
|
|
9
|
-
|
|
10
|
-
declare const require: {
|
|
11
|
-
context(path: string, deep?: boolean, filter?: RegExp): {
|
|
12
|
-
keys(): string[];
|
|
13
|
-
<T>(id: string): T;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
// First, initialize the Angular testing environment.
|
|
18
|
-
getTestBed().initTestEnvironment(
|
|
19
|
-
BrowserDynamicTestingModule,
|
|
20
|
-
platformBrowserDynamicTesting()
|
|
21
|
-
);
|
|
22
|
-
// Then we find all the tests.
|
|
23
|
-
const context = require.context('./', true, /\.spec\.ts$/);
|
|
24
|
-
// And load the modules.
|
|
25
|
-
context.keys().map(context);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
-
{
|
|
3
|
-
"extends": "../../tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"outDir": "../../out-tsc/app",
|
|
6
|
-
"types": [],
|
|
7
|
-
"paths": {
|
|
8
|
-
"ngx-timeline": [
|
|
9
|
-
"dist/ngx-timeline/ngx-timeline",
|
|
10
|
-
"dist/ngx-timeline"
|
|
11
|
-
]
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"angularCompilerOptions": {
|
|
15
|
-
"strictInjectionParameters": true,
|
|
16
|
-
"strictInputAccessModifiers": true,
|
|
17
|
-
"strictTemplates": false
|
|
18
|
-
},
|
|
19
|
-
"files": [
|
|
20
|
-
"src/main.ts",
|
|
21
|
-
"src/polyfills.ts"
|
|
22
|
-
],
|
|
23
|
-
"include": [
|
|
24
|
-
"src/**/*.d.ts"
|
|
25
|
-
]
|
|
26
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
-
{
|
|
3
|
-
"extends": "../../tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"outDir": "../../out-tsc/spec",
|
|
6
|
-
"types": [
|
|
7
|
-
"jasmine"
|
|
8
|
-
]
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"src/test.ts",
|
|
12
|
-
"src/polyfills.ts"
|
|
13
|
-
],
|
|
14
|
-
"include": [
|
|
15
|
-
"src/**/*.spec.ts",
|
|
16
|
-
"src/**/*.d.ts"
|
|
17
|
-
]
|
|
18
|
-
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
# NgxTimeline 
|
|
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
|
-

|
|
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,44 +0,0 @@
|
|
|
1
|
-
// Karma configuration file, see link for more information
|
|
2
|
-
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
3
|
-
|
|
4
|
-
module.exports = function (config) {
|
|
5
|
-
config.set({
|
|
6
|
-
basePath: '',
|
|
7
|
-
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
|
8
|
-
plugins: [
|
|
9
|
-
require('karma-jasmine'),
|
|
10
|
-
require('karma-chrome-launcher'),
|
|
11
|
-
require('karma-jasmine-html-reporter'),
|
|
12
|
-
require('karma-coverage'),
|
|
13
|
-
require('@angular-devkit/build-angular/plugins/karma')
|
|
14
|
-
],
|
|
15
|
-
client: {
|
|
16
|
-
jasmine: {
|
|
17
|
-
// you can add configuration options for Jasmine here
|
|
18
|
-
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
|
19
|
-
// for example, you can disable the random execution with `random: false`
|
|
20
|
-
// or set a specific seed with `seed: 4321`
|
|
21
|
-
},
|
|
22
|
-
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
23
|
-
},
|
|
24
|
-
jasmineHtmlReporter: {
|
|
25
|
-
suppressAll: true // removes the duplicated traces
|
|
26
|
-
},
|
|
27
|
-
coverageReporter: {
|
|
28
|
-
dir: require('path').join(__dirname, '../../coverage/ngx-timeline'),
|
|
29
|
-
subdir: '.',
|
|
30
|
-
reporters: [
|
|
31
|
-
{ type: 'html' },
|
|
32
|
-
{ type: 'text-summary' }
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
reporters: ['progress', 'kjhtml'],
|
|
36
|
-
port: 9876,
|
|
37
|
-
colors: true,
|
|
38
|
-
logLevel: config.LOG_INFO,
|
|
39
|
-
autoWatch: true,
|
|
40
|
-
browsers: ['Chrome'],
|
|
41
|
-
singleRun: false,
|
|
42
|
-
restartOnFileChange: true
|
|
43
|
-
});
|
|
44
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@frxjs/ngx-timeline",
|
|
3
|
-
"version": "1.0.3",
|
|
4
|
-
"keywords": ["angular", "timeline"],
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "Emanuele Fricano",
|
|
7
|
-
"email": "emanuelefricano93@gmail.com"
|
|
8
|
-
},
|
|
9
|
-
"license": "MIT",
|
|
10
|
-
"peerDependencies": {
|
|
11
|
-
"@angular/common": "^11.0.9",
|
|
12
|
-
"@angular/core": "^11.0.9"
|
|
13
|
-
},
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"tslib": "^2.0.0"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<div class="event-wrapper-container" (click)="clickEmitter.next(event)">
|
|
2
|
-
<div *ngIf="colSidePosition===ngxTimelineItemPosition.ON_RIGHT" class="arrow left"></div>
|
|
3
|
-
<div class="event" [ngClass]="{'enableAnimation': enableAnimation}">
|
|
4
|
-
<ng-container *ngTemplateOutlet="innerEventCustomTemplate || innerEventContainer; context: {event: event}">
|
|
5
|
-
</ng-container>
|
|
6
|
-
</div>
|
|
7
|
-
<div *ngIf="colSidePosition===ngxTimelineItemPosition.ON_LEFT" class="arrow right"></div>
|
|
8
|
-
</div>
|
|
9
|
-
|
|
10
|
-
<ng-template #innerEventContainer let-event=event>
|
|
11
|
-
<div class="event-container" [ngClass]="{'reverse': colSidePosition === ngxTimelineItemPosition.ON_LEFT}">
|
|
12
|
-
<div class="event-info-container">
|
|
13
|
-
<div class="event-info-header">
|
|
14
|
-
<div class="title-container">{{event?.eventInfo?.title | titlecase}}</div>
|
|
15
|
-
</div>
|
|
16
|
-
<div class="event-info-body">
|
|
17
|
-
<p class="event-info-description">{{event?.eventInfo?.description}}</p>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<div class="event-divider-container">
|
|
22
|
-
<hr/>
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
<div class="event-date-container" *ngIf="getDateObj() as dateObj">
|
|
26
|
-
<div>
|
|
27
|
-
<p>{{dateObj?.month}}</p>
|
|
28
|
-
</div>
|
|
29
|
-
<div>
|
|
30
|
-
<p class="day">{{dateObj?.day}}</p>
|
|
31
|
-
</div>
|
|
32
|
-
<div>
|
|
33
|
-
<p>{{dateObj?.year}}</p>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
</ng-template>
|