@indice/ng-components 0.2.138-beta → 0.2.139
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/CHANGELOG.md +1 -0
- package/README.md +4 -4
- package/karma.conf.js +44 -0
- package/ng-package.json +10 -0
- package/package.json +18 -9
- package/scripts/css-bundle.ts +33 -0
- package/src/_styles.css +36 -0
- package/src/_tests/utilities.service.spec.ts +16 -0
- package/src/assets/styles/avatar-initials.css +37 -0
- package/src/assets/styles/base.css +46 -0
- package/src/assets/styles/cards.css +71 -0
- package/src/assets/styles/collapsible-panel.css +25 -0
- package/src/assets/styles/components.css +34 -0
- package/src/assets/styles/date-picker.component.css +0 -0
- package/src/assets/styles/drop-down-menu.css +50 -0
- package/src/assets/styles/form-layout.css +49 -0
- package/{_styles.css → src/assets/styles/indice-ng-icons-inline.css} +2286 -3504
- package/src/assets/styles/list-view-empty-state.css +0 -0
- package/src/assets/styles/list-view.css +64 -0
- package/{modal.css → src/assets/styles/modal.css} +157 -157
- package/src/assets/styles/model-view-layout.css +45 -0
- package/src/assets/styles/nav-links.css +35 -0
- package/src/assets/styles/notifications-indicator.component.css +43 -0
- package/src/assets/styles/pager.css +29 -0
- package/src/assets/styles/shell-layout.css +232 -0
- package/src/assets/styles/side-pane.css +46 -0
- package/src/assets/styles/side-view-layout.css +58 -0
- package/src/assets/styles/toast.css +72 -0
- package/src/assets/styles/toggle.css +26 -0
- package/src/assets/styles/view-layout.css +58 -0
- package/src/lib/controls/avatar-initials/avatar-initials.component.html +3 -0
- package/src/lib/controls/avatar-initials/avatar-initials.component.ts +47 -0
- package/src/lib/controls/collapsible-panel/collapsible-panel.component.html +15 -0
- package/src/lib/controls/collapsible-panel/collapsible-panel.component.ts +16 -0
- package/src/lib/controls/date-picker/date-picker.component.html +133 -0
- package/src/lib/controls/date-picker/date-picker.component.ts +258 -0
- package/src/lib/controls/drop-down-menu/drop-down-menu.component.html +61 -0
- package/src/lib/controls/drop-down-menu/drop-down-menu.component.ts +59 -0
- package/src/lib/controls/kpi-tile/kpi-tile.component.html +18 -0
- package/src/lib/controls/kpi-tile/kpi-tile.component.ts +26 -0
- package/src/lib/controls/list-view/list-column.component.ts +10 -0
- package/src/lib/controls/list-view/list-details-section.component.ts +8 -0
- package/src/lib/controls/list-view/list-tile.component.ts +8 -0
- package/src/lib/controls/list-view/list-view-empty-state.component.html +20 -0
- package/src/lib/controls/list-view/list-view-empty-state.component.ts +19 -0
- package/src/lib/controls/list-view/list-view.component.html +151 -0
- package/src/lib/controls/list-view/list-view.component.ts +146 -0
- package/src/lib/controls/nav-links-list/nav-links-list.component.html +27 -0
- package/src/lib/controls/nav-links-list/nav-links-list.component.ts +25 -0
- package/src/lib/controls/notifications-indicator/notifications-indicator.component.html +78 -0
- package/src/lib/controls/notifications-indicator/notifications-indicator.component.ts +75 -0
- package/src/lib/controls/pager/pager.component.html +33 -0
- package/src/lib/controls/pager/pager.component.ts +106 -0
- package/src/lib/controls/side-pane/side-pane.component.html +10 -0
- package/src/lib/controls/side-pane/side-pane.component.ts +59 -0
- package/src/lib/controls/skeleton-loader/skeleton-loader.component.html +112 -0
- package/src/lib/controls/skeleton-loader/skeleton-loader.component.ts +20 -0
- package/src/lib/controls/toaster/toaster-container.component.html +1 -0
- package/src/lib/controls/toaster/toaster-container.component.ts +27 -0
- package/src/lib/controls/toaster/toaster.component.html +103 -0
- package/src/lib/controls/toaster/toaster.component.ts +26 -0
- package/src/lib/controls/toggle/toggle.component.html +15 -0
- package/src/lib/controls/toggle/toggle.component.ts +58 -0
- package/src/lib/directives/click-outside.directive.ts +196 -0
- package/src/lib/directives/dynamic-component-host.directive.ts +7 -0
- package/src/lib/directives/screen-size.directive.ts +67 -0
- package/src/lib/helpers/base-list.component.ts +204 -0
- package/src/lib/icons.ts +39 -0
- package/src/lib/layouts/shell/shell-footer/shell-footer.component.html +71 -0
- package/src/lib/layouts/shell/shell-footer/shell-footer.component.ts +14 -0
- package/src/lib/layouts/shell/shell-header/shell-header.component.html +199 -0
- package/src/lib/layouts/shell/shell-header/shell-header.component.ts +111 -0
- package/src/lib/layouts/shell/shell-layout/shell-layout.component.html +36 -0
- package/src/lib/layouts/shell/shell-layout/shell-layout.component.ts +91 -0
- package/src/lib/layouts/views/form-layout/form-layout.component.html +67 -0
- package/src/lib/layouts/views/form-layout/form-layout.component.ts +66 -0
- package/src/lib/layouts/views/model-view-layout/model-view-layout.component.html +43 -0
- package/src/lib/layouts/views/model-view-layout/model-view-layout.component.ts +37 -0
- package/src/lib/layouts/views/side-view-layout/side-view-layout.component.html +36 -0
- package/src/lib/layouts/views/side-view-layout/side-view-layout.component.ts +67 -0
- package/src/lib/layouts/views/view-layout/view-layout.component.html +68 -0
- package/src/lib/layouts/views/view-layout/view-layout.component.ts +82 -0
- package/src/lib/ng-components.module.ts +135 -0
- package/src/lib/pages/auth/auth-callback/auth-callback.component.html +1 -0
- package/src/lib/pages/auth/auth-callback/auth-callback.component.ts +22 -0
- package/src/lib/pages/auth/auth-renew/auth-renew.component.ts +20 -0
- package/src/lib/pages/auth/logged-out/logged-out.component.html +1 -0
- package/src/lib/pages/auth/logged-out/logged-out.component.ts +22 -0
- package/src/lib/pages/http-status/error/error.component.html +13 -0
- package/src/lib/pages/http-status/error/error.component.ts +13 -0
- package/src/lib/pages/http-status/page-not-found/page-not-found.component.html +14 -0
- package/src/lib/pages/http-status/page-not-found/page-not-found.component.ts +14 -0
- package/src/lib/pages/http-status/unauthorized/unauthorized.component.html +15 -0
- package/src/lib/pages/http-status/unauthorized/unauthorized.component.ts +11 -0
- package/src/lib/pipes/address.pipe.ts +17 -0
- package/src/lib/pipes/duration-format.pipe.ts +67 -0
- package/src/lib/services/component-loader/component-loader-options.class.ts +31 -0
- package/src/lib/services/component-loader/component-loader.class.ts +226 -0
- package/src/lib/services/component-loader/component-loader.factory.ts +27 -0
- package/src/lib/services/component-loader/content-ref.class.ts +10 -0
- package/src/lib/services/interceptors/bad-request.interceptor.ts +34 -0
- package/src/lib/services/modal-service/modal-backdrop-component.ts +40 -0
- package/src/lib/services/modal-service/modal-container-component.ts +125 -0
- package/src/lib/services/modal-service/modal-options.class.ts +92 -0
- package/src/lib/services/modal-service/modal-service.ts +237 -0
- package/src/lib/services/modal-service/modal-styles.class.ts +11 -0
- package/src/lib/services/modal-service/modal.class.ts +45 -0
- package/src/lib/services/shell-state-service.service.ts +10 -0
- package/src/lib/services/toaster.service.ts +23 -0
- package/src/lib/services/utilities.service.ts +40 -0
- package/src/lib/tokens.ts +6 -0
- package/src/lib/types.ts +210 -0
- package/{public-api.d.ts → src/public-api.ts} +60 -43
- package/src/test.ts +28 -0
- package/tsconfig.lib.json +26 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/tslint.json +17 -0
- package/webpack.config.js +36 -0
- package/bundles/indice-ng-components.umd.js +0 -3784
- package/bundles/indice-ng-components.umd.js.map +0 -1
- package/esm2015/indice-ng-components.js +0 -5
- package/esm2015/lib/controls/avatar-initials/avatar-initials.component.js +0 -51
- package/esm2015/lib/controls/collapsible-panel/collapsible-panel.component.js +0 -23
- package/esm2015/lib/controls/date-picker/date-picker.component.js +0 -269
- package/esm2015/lib/controls/drop-down-menu/drop-down-menu.component.js +0 -72
- package/esm2015/lib/controls/kpi-tile/kpi-tile.component.js +0 -39
- package/esm2015/lib/controls/list-view/list-column.component.js +0 -25
- package/esm2015/lib/controls/list-view/list-details-section.component.js +0 -17
- package/esm2015/lib/controls/list-view/list-tile.component.js +0 -17
- package/esm2015/lib/controls/list-view/list-view-empty-state.component.js +0 -32
- package/esm2015/lib/controls/list-view/list-view.component.js +0 -186
- package/esm2015/lib/controls/pager/pager.component.js +0 -133
- package/esm2015/lib/controls/side-pane/side-pane.component.js +0 -76
- package/esm2015/lib/controls/skeleton-loader/skeleton-loader.component.js +0 -29
- package/esm2015/lib/controls/toaster/toaster-container.component.js +0 -31
- package/esm2015/lib/controls/toaster/toaster.component.js +0 -34
- package/esm2015/lib/controls/toggle/toggle.component.js +0 -68
- package/esm2015/lib/directives/click-outside.directive.js +0 -189
- package/esm2015/lib/directives/dynamic-component-host.directive.js +0 -17
- package/esm2015/lib/helpers/base-list.component.js +0 -182
- package/esm2015/lib/icons.js +0 -32
- package/esm2015/lib/layouts/shell/shell-footer/shell-footer.component.js +0 -22
- package/esm2015/lib/layouts/shell/shell-header/shell-header.component.js +0 -142
- package/esm2015/lib/layouts/shell/shell-layout/shell-layout.component.js +0 -101
- package/esm2015/lib/layouts/views/form-layout/form-layout.component.js +0 -86
- package/esm2015/lib/layouts/views/model-view-layout/model-view-layout.component.js +0 -55
- package/esm2015/lib/layouts/views/side-view-layout/side-view-layout.component.js +0 -101
- package/esm2015/lib/layouts/views/view-layout/view-layout.component.js +0 -110
- package/esm2015/lib/ng-components.module.js +0 -220
- package/esm2015/lib/pages/auth/auth-callback/auth-callback.component.js +0 -34
- package/esm2015/lib/pages/auth/auth-renew/auth-renew.component.js +0 -31
- package/esm2015/lib/pages/auth/logged-out/logged-out.component.js +0 -32
- package/esm2015/lib/pages/http-status/error/error.component.js +0 -20
- package/esm2015/lib/pages/http-status/page-not-found/page-not-found.component.js +0 -18
- package/esm2015/lib/pages/http-status/unauthorized/unauthorized.component.js +0 -17
- package/esm2015/lib/pipes/address.pipe.js +0 -21
- package/esm2015/lib/pipes/duration-format.pipe.js +0 -64
- package/esm2015/lib/pipes/obs-with-status.pipe.js +0 -26
- package/esm2015/lib/services/component-loader/component-loader-options.class.js +0 -8
- package/esm2015/lib/services/component-loader/component-loader.class.js +0 -192
- package/esm2015/lib/services/component-loader/component-loader.factory.js +0 -32
- package/esm2015/lib/services/component-loader/content-ref.class.js +0 -13
- package/esm2015/lib/services/modal-service/modal-backdrop-component.js +0 -44
- package/esm2015/lib/services/modal-service/modal-container-component.js +0 -128
- package/esm2015/lib/services/modal-service/modal-options.class.js +0 -35
- package/esm2015/lib/services/modal-service/modal-service.js +0 -220
- package/esm2015/lib/services/modal-service/modal-styles.class.js +0 -11
- package/esm2015/lib/services/modal-service/modal.class.js +0 -27
- package/esm2015/lib/services/toaster.service.js +0 -24
- package/esm2015/lib/tokens.js +0 -4
- package/esm2015/lib/types.js +0 -114
- package/esm2015/public-api.js +0 -53
- package/fesm2015/indice-ng-components.js +0 -3247
- package/fesm2015/indice-ng-components.js.map +0 -1
- package/indice-ng-components.d.ts +0 -5
- package/lib/controls/avatar-initials/avatar-initials.component.d.ts +0 -14
- package/lib/controls/collapsible-panel/collapsible-panel.component.d.ts +0 -10
- package/lib/controls/date-picker/date-picker.component.d.ts +0 -48
- package/lib/controls/drop-down-menu/drop-down-menu.component.d.ts +0 -25
- package/lib/controls/kpi-tile/kpi-tile.component.d.ts +0 -13
- package/lib/controls/list-view/list-column.component.d.ts +0 -9
- package/lib/controls/list-view/list-details-section.component.d.ts +0 -7
- package/lib/controls/list-view/list-tile.component.d.ts +0 -7
- package/lib/controls/list-view/list-view-empty-state.component.d.ts +0 -11
- package/lib/controls/list-view/list-view.component.d.ts +0 -55
- package/lib/controls/pager/pager.component.d.ts +0 -36
- package/lib/controls/side-pane/side-pane.component.d.ts +0 -18
- package/lib/controls/skeleton-loader/skeleton-loader.component.d.ts +0 -11
- package/lib/controls/toaster/toaster-container.component.d.ts +0 -13
- package/lib/controls/toaster/toaster.component.d.ts +0 -15
- package/lib/controls/toggle/toggle.component.d.ts +0 -19
- package/lib/directives/click-outside.directive.d.ts +0 -40
- package/lib/directives/dynamic-component-host.directive.d.ts +0 -9
- package/lib/helpers/base-list.component.d.ts +0 -42
- package/lib/icons.d.ts +0 -30
- package/lib/layouts/shell/shell-footer/shell-footer.component.d.ts +0 -8
- package/lib/layouts/shell/shell-header/shell-header.component.d.ts +0 -45
- package/lib/layouts/shell/shell-layout/shell-layout.component.d.ts +0 -27
- package/lib/layouts/views/form-layout/form-layout.component.d.ts +0 -25
- package/lib/layouts/views/model-view-layout/model-view-layout.component.d.ts +0 -25
- package/lib/layouts/views/side-view-layout/side-view-layout.component.d.ts +0 -28
- package/lib/layouts/views/view-layout/view-layout.component.d.ts +0 -31
- package/lib/ng-components.module.d.ts +0 -45
- package/lib/pages/auth/auth-callback/auth-callback.component.d.ts +0 -13
- package/lib/pages/auth/auth-renew/auth-renew.component.d.ts +0 -12
- package/lib/pages/auth/logged-out/logged-out.component.d.ts +0 -12
- package/lib/pages/http-status/error/error.component.d.ts +0 -8
- package/lib/pages/http-status/page-not-found/page-not-found.component.d.ts +0 -8
- package/lib/pages/http-status/unauthorized/unauthorized.component.d.ts +0 -8
- package/lib/pipes/address.pipe.d.ts +0 -8
- package/lib/pipes/duration-format.pipe.d.ts +0 -8
- package/lib/pipes/obs-with-status.pipe.d.ts +0 -13
- package/lib/services/component-loader/component-loader-options.class.d.ts +0 -30
- package/lib/services/component-loader/component-loader.class.d.ts +0 -92
- package/lib/services/component-loader/component-loader.factory.d.ts +0 -24
- package/lib/services/component-loader/content-ref.class.d.ts +0 -12
- package/lib/services/modal-service/modal-backdrop-component.d.ts +0 -20
- package/lib/services/modal-service/modal-container-component.d.ts +0 -33
- package/lib/services/modal-service/modal-options.class.d.ts +0 -81
- package/lib/services/modal-service/modal-service.d.ts +0 -58
- package/lib/services/modal-service/modal-styles.class.d.ts +0 -10
- package/lib/services/modal-service/modal.class.d.ts +0 -43
- package/lib/services/toaster.service.d.ts +0 -11
- package/lib/tokens.d.ts +0 -4
- package/lib/types.d.ts +0 -135
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { SwitchViewAction } from '../../../types';
|
|
2
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
|
+
import { Component, Input, OnInit, Output, EventEmitter, ViewChild, ElementRef } from '@angular/core';
|
|
4
|
+
import { fromEvent } from 'rxjs';
|
|
5
|
+
import { debounceTime, distinctUntilChanged, filter, map } from 'rxjs/operators';
|
|
6
|
+
import { HeaderMetaItem, RouterViewAction, ViewAction } from '../../../types';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'lib-view-layout',
|
|
10
|
+
templateUrl: './view-layout.component.html'
|
|
11
|
+
})
|
|
12
|
+
export class ViewLayoutComponent implements OnInit {
|
|
13
|
+
// tslint:disable-next-line:no-input-rename
|
|
14
|
+
@ViewChild('search') private searchInput$?: ElementRef;
|
|
15
|
+
// tslint:disable-next-line:no-input-rename
|
|
16
|
+
@Input('show-header') header = true;
|
|
17
|
+
@Input() fluid = false;
|
|
18
|
+
@Input() title = 'no title';
|
|
19
|
+
@Input() icon: string | null = null;
|
|
20
|
+
@Input() actions: ViewAction[] | null = null;
|
|
21
|
+
@Input() busy = false;
|
|
22
|
+
// tslint:disable-next-line:no-input-rename
|
|
23
|
+
@Input('search-placeholder') searchPlaceholder: string | null = 'αναζήτηση';
|
|
24
|
+
@Input() view: string | null = null;
|
|
25
|
+
// tslint:disable-next-line:no-input-rename
|
|
26
|
+
@Input('meta-items') metaItems: HeaderMetaItem[] | null = [];
|
|
27
|
+
// tslint:disable-next-line:no-output-on-prefix
|
|
28
|
+
@Output() onAction: EventEmitter<ViewAction> = new EventEmitter<ViewAction>();
|
|
29
|
+
// tslint:disable-next-line:no-output-on-prefix
|
|
30
|
+
@Output() onSearch: EventEmitter<string> = new EventEmitter<string>();
|
|
31
|
+
|
|
32
|
+
constructor(private route$: ActivatedRoute, private router$: Router) { }
|
|
33
|
+
|
|
34
|
+
ngOnInit(): void {
|
|
35
|
+
if (this.searchInput$?.nativeElement){
|
|
36
|
+
fromEvent(this.searchInput$.nativeElement, 'keyup').pipe(
|
|
37
|
+
map((event: any) => {
|
|
38
|
+
return event.target.value; // Get input value.
|
|
39
|
+
}),
|
|
40
|
+
filter(inputValue => inputValue.length >= 3 || inputValue.length === 0),
|
|
41
|
+
// If character length greater than minimumSearchCharacters setting.
|
|
42
|
+
debounceTime(1000), // Time in milliseconds between key events.
|
|
43
|
+
distinctUntilChanged() // If previous query is different from current.
|
|
44
|
+
).subscribe();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public emitActionClick(action: ViewAction): void {
|
|
49
|
+
this.onAction.emit(action);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public routerLinkActionClick(action: RouterViewAction | any): void {
|
|
53
|
+
// console.log('routerLinkActionClick', action);
|
|
54
|
+
if (action.outlet) {
|
|
55
|
+
this.router$.navigate(['', { outlets: { rightpane: action.link } }]);
|
|
56
|
+
} else {
|
|
57
|
+
this.router$.navigate([action.link]);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
searchActionClick(action: ViewAction, text: string): void {
|
|
62
|
+
this.onSearch.emit(text);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
searchActionType(text: string): void {
|
|
66
|
+
this.onSearch.emit(this.searchInput$?.nativeElement.value);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public handleClear(event: any): void {
|
|
70
|
+
console.log('handle clear!!!');
|
|
71
|
+
event.stopPropagation();
|
|
72
|
+
this.onSearch.emit(event.target?.value);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
public switchViewActionClick(action: SwitchViewAction | any): void {
|
|
76
|
+
// console.log('switchViewActionClick', action);
|
|
77
|
+
this.view = action.param;
|
|
78
|
+
if (action && action.param) {
|
|
79
|
+
this.router$.navigate([], { queryParams: { view: action.param }, queryParamsHandling: 'merge', skipLocationChange: false });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { AvatarInitialsComponent } from './controls/avatar-initials/avatar-initials.component';
|
|
2
|
+
import { ToasterService } from './services/toaster.service';
|
|
3
|
+
import { ToasterComponent } from './controls/toaster/toaster.component';
|
|
4
|
+
import { ToasterContainerComponent } from './controls/toaster/toaster-container.component';
|
|
5
|
+
import { DatepickerComponent } from './controls/date-picker/date-picker.component';
|
|
6
|
+
import { SidePaneComponent } from './controls/side-pane/side-pane.component';
|
|
7
|
+
import { ListDetailsSectionComponent } from './controls/list-view/list-details-section.component';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
9
|
+
import { RouterModule } from '@angular/router';
|
|
10
|
+
import { UnauthorizedComponent } from './pages/http-status/unauthorized/unauthorized.component';
|
|
11
|
+
import { PageNotFoundComponent } from './pages/http-status/page-not-found/page-not-found.component';
|
|
12
|
+
import { ErrorComponent } from './pages/http-status/error/error.component';
|
|
13
|
+
import { LoggedOutComponent } from './pages/auth/logged-out/logged-out.component';
|
|
14
|
+
import { AuthCallbackComponent } from './pages/auth/auth-callback/auth-callback.component';
|
|
15
|
+
import { IndiceAuthModule } from '@indice/ng-auth';
|
|
16
|
+
import { SkeletonLoaderComponent } from './controls/skeleton-loader/skeleton-loader.component';
|
|
17
|
+
import { ListTileComponent } from './controls/list-view/list-tile.component';
|
|
18
|
+
import { ListColumnComponent } from './controls/list-view/list-column.component';
|
|
19
|
+
import { NgModule } from '@angular/core';
|
|
20
|
+
import { DropDownMenuComponent } from './controls/drop-down-menu/drop-down-menu.component';
|
|
21
|
+
import { ListViewComponent } from './controls/list-view/list-view.component';
|
|
22
|
+
import { PagerComponent } from './controls/pager/pager.component';
|
|
23
|
+
import { ClickOutsideDirective } from './directives/click-outside.directive';
|
|
24
|
+
import { ShellFooterComponent } from './layouts/shell/shell-footer/shell-footer.component';
|
|
25
|
+
import { ShellHeaderComponent } from './layouts/shell/shell-header/shell-header.component';
|
|
26
|
+
import { ShellLayoutComponent } from './layouts/shell/shell-layout/shell-layout.component';
|
|
27
|
+
import { FormLayoutComponent } from './layouts/views/form-layout/form-layout.component';
|
|
28
|
+
import { ModelViewLayoutComponent } from './layouts/views/model-view-layout/model-view-layout.component';
|
|
29
|
+
import { SideViewLayoutComponent } from './layouts/views/side-view-layout/side-view-layout.component';
|
|
30
|
+
import { ViewLayoutComponent } from './layouts/views/view-layout/view-layout.component';
|
|
31
|
+
import { AuthRenewComponent } from './pages/auth/auth-renew/auth-renew.component';
|
|
32
|
+
import { AddressPipe } from './pipes/address.pipe';
|
|
33
|
+
import { DurationFormatPipe } from './pipes/duration-format.pipe';
|
|
34
|
+
import { CollapsiblePanelComponent } from './controls/collapsible-panel/collapsible-panel.component';
|
|
35
|
+
import { KpiTileComponent } from './controls/kpi-tile/kpi-tile.component';
|
|
36
|
+
import { DynamicComponentHostDirective } from './directives/dynamic-component-host.directive';
|
|
37
|
+
import { ListViewEmptyStateComponent } from './controls/list-view/list-view-empty-state.component';
|
|
38
|
+
import { ToggleComponent } from './controls/toggle/toggle.component';
|
|
39
|
+
import { NavLinksListComponent } from './controls/nav-links-list/nav-links-list.component';
|
|
40
|
+
import { NotificationsIndicatorComponent } from './controls/notifications-indicator/notifications-indicator.component';
|
|
41
|
+
|
|
42
|
+
@NgModule({
|
|
43
|
+
declarations: [
|
|
44
|
+
// diectives
|
|
45
|
+
ClickOutsideDirective,
|
|
46
|
+
DynamicComponentHostDirective,
|
|
47
|
+
// controls
|
|
48
|
+
DropDownMenuComponent,
|
|
49
|
+
PagerComponent,
|
|
50
|
+
ListViewComponent,
|
|
51
|
+
ListColumnComponent,
|
|
52
|
+
ListTileComponent,
|
|
53
|
+
ListDetailsSectionComponent,
|
|
54
|
+
ListViewEmptyStateComponent,
|
|
55
|
+
SkeletonLoaderComponent,
|
|
56
|
+
CollapsiblePanelComponent,
|
|
57
|
+
KpiTileComponent,
|
|
58
|
+
SidePaneComponent,
|
|
59
|
+
DatepickerComponent,
|
|
60
|
+
AvatarInitialsComponent,
|
|
61
|
+
ToggleComponent,
|
|
62
|
+
// Toaster
|
|
63
|
+
ToasterContainerComponent,
|
|
64
|
+
ToasterComponent,
|
|
65
|
+
// shell layout
|
|
66
|
+
ShellLayoutComponent,
|
|
67
|
+
ShellHeaderComponent,
|
|
68
|
+
ShellFooterComponent,
|
|
69
|
+
// view layouts
|
|
70
|
+
ViewLayoutComponent,
|
|
71
|
+
SideViewLayoutComponent,
|
|
72
|
+
ModelViewLayoutComponent,
|
|
73
|
+
FormLayoutComponent,
|
|
74
|
+
// pages (common)
|
|
75
|
+
AuthCallbackComponent,
|
|
76
|
+
AuthRenewComponent,
|
|
77
|
+
LoggedOutComponent,
|
|
78
|
+
ErrorComponent,
|
|
79
|
+
PageNotFoundComponent,
|
|
80
|
+
UnauthorizedComponent,
|
|
81
|
+
// pipes
|
|
82
|
+
AddressPipe,
|
|
83
|
+
DurationFormatPipe,
|
|
84
|
+
NavLinksListComponent,
|
|
85
|
+
NotificationsIndicatorComponent
|
|
86
|
+
],
|
|
87
|
+
imports: [
|
|
88
|
+
CommonModule,
|
|
89
|
+
RouterModule,
|
|
90
|
+
IndiceAuthModule
|
|
91
|
+
],
|
|
92
|
+
exports: [
|
|
93
|
+
ClickOutsideDirective,
|
|
94
|
+
DropDownMenuComponent,
|
|
95
|
+
PagerComponent,
|
|
96
|
+
ListViewComponent,
|
|
97
|
+
ListColumnComponent,
|
|
98
|
+
ListTileComponent,
|
|
99
|
+
ListDetailsSectionComponent,
|
|
100
|
+
ListViewEmptyStateComponent,
|
|
101
|
+
KpiTileComponent,
|
|
102
|
+
SkeletonLoaderComponent,
|
|
103
|
+
ShellLayoutComponent,
|
|
104
|
+
ShellHeaderComponent,
|
|
105
|
+
ShellFooterComponent,
|
|
106
|
+
ViewLayoutComponent,
|
|
107
|
+
SideViewLayoutComponent,
|
|
108
|
+
ModelViewLayoutComponent,
|
|
109
|
+
FormLayoutComponent,
|
|
110
|
+
AuthCallbackComponent,
|
|
111
|
+
AuthRenewComponent,
|
|
112
|
+
LoggedOutComponent,
|
|
113
|
+
ErrorComponent,
|
|
114
|
+
PageNotFoundComponent,
|
|
115
|
+
UnauthorizedComponent,
|
|
116
|
+
AddressPipe,
|
|
117
|
+
DurationFormatPipe,
|
|
118
|
+
CollapsiblePanelComponent,
|
|
119
|
+
SidePaneComponent,
|
|
120
|
+
DatepickerComponent,
|
|
121
|
+
ToasterContainerComponent,
|
|
122
|
+
ToasterComponent,
|
|
123
|
+
AvatarInitialsComponent,
|
|
124
|
+
ToggleComponent
|
|
125
|
+
]
|
|
126
|
+
})
|
|
127
|
+
export class IndiceComponentsModule {
|
|
128
|
+
// tslint:disable-next-line:typedef
|
|
129
|
+
static forRoot() {
|
|
130
|
+
return {
|
|
131
|
+
ngModule: IndiceComponentsModule,
|
|
132
|
+
providers: [ToasterService]
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<lib-view-layout [title]="status" [busy]="true"></lib-view-layout>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Component, Inject, OnInit } from '@angular/core';
|
|
2
|
+
import { Router } from '@angular/router';
|
|
3
|
+
|
|
4
|
+
import { AuthService } from '@indice/ng-auth';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'lib-auth-callback',
|
|
8
|
+
templateUrl: './auth-callback.component.html'
|
|
9
|
+
})
|
|
10
|
+
export class AuthCallbackComponent implements OnInit {
|
|
11
|
+
constructor(@Inject(AuthService) private authService: AuthService, private router: Router) { }
|
|
12
|
+
|
|
13
|
+
public status = 'παρακαλώ περιμένετε...';
|
|
14
|
+
|
|
15
|
+
public ngOnInit(): void {
|
|
16
|
+
this.authService.signinRedirectCallback().subscribe((user) => {
|
|
17
|
+
if (user) {
|
|
18
|
+
this.router.navigateByUrl(user.state?.url || '/');
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Component, Inject, OnInit } from '@angular/core';
|
|
2
|
+
import { Router } from '@angular/router';
|
|
3
|
+
|
|
4
|
+
import { AuthService } from '@indice/ng-auth';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'lib-auth-renew',
|
|
8
|
+
template: ''
|
|
9
|
+
})
|
|
10
|
+
export class AuthRenewComponent implements OnInit {
|
|
11
|
+
constructor(@Inject(AuthService) private authService: AuthService, private router: Router) { }
|
|
12
|
+
|
|
13
|
+
public ngOnInit(): void {
|
|
14
|
+
this.authService.signinSilentCallback().subscribe(user => {
|
|
15
|
+
if (!user) {
|
|
16
|
+
this.router.navigate(['/unauthorized']);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<lib-view-layout title="Έχετε αποσυνδεθεί με επιτυχία!"></lib-view-layout>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AuthService } from '@indice/ng-auth';
|
|
2
|
+
import { Component, Inject, OnInit } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
// tslint:disable-next-line:component-selector
|
|
7
|
+
selector: 'lib-logged-out',
|
|
8
|
+
templateUrl: './logged-out.component.html'
|
|
9
|
+
})
|
|
10
|
+
export class LoggedOutComponent implements OnInit {
|
|
11
|
+
constructor(@Inject(AuthService) private authService: AuthService) { }
|
|
12
|
+
|
|
13
|
+
public status = 'working on it, please give me a sec...';
|
|
14
|
+
public finished = false;
|
|
15
|
+
|
|
16
|
+
public ngOnInit(): void {
|
|
17
|
+
this.authService.removeUser().subscribe(() => {
|
|
18
|
+
this.status = 'Thank you!';
|
|
19
|
+
this.finished = true;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<lib-view-layout [show-header]="false" title="500 - παρουσιάστηκε σφάλμα!">
|
|
2
|
+
<div class="bg-gray-600 view-container">
|
|
3
|
+
<div class="max-w-2xl mx-auto text-center py-16 px-4 sm:py-20 sm:px-6 lg:px-8">
|
|
4
|
+
<h2 class="text-3xl font-extrabold text-white sm:text-4xl">
|
|
5
|
+
<span class="block">500</span>
|
|
6
|
+
</h2>
|
|
7
|
+
<p class="mt-4 text-lg leading-6 text-gray-200">σφάλμα, κατι δεν πήγε καλά...!</p>
|
|
8
|
+
<a href="/" class="mt-8 inline-flex items-center justify-center px-5 py-3 border border-transparent text-base font-sm rounded-sm text-gray-600 bg-white hover:bg-gray-50 sm:w-auto">
|
|
9
|
+
πατήστε εδώ για να επιστρέψετε
|
|
10
|
+
</a>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</lib-view-layout>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<lib-view-layout [show-header]="false" title="404 - δεν βρέθηκε!">
|
|
2
|
+
<div class="text-gray-900">
|
|
3
|
+
<div class="max-w-4xl mx-auto text-center py-16 px-4 sm:py-20 sm:px-6 lg:px-8">
|
|
4
|
+
<h2 class="text-3xl font-extrabold sm:text-4xl">
|
|
5
|
+
<span class="block">404</span>
|
|
6
|
+
</h2>
|
|
7
|
+
<p class="mt-4 text-lg leading-6 text-gray-800">δεν βρέθηκε η σελίδα που ζητήσατε!</p>
|
|
8
|
+
<a href="/"
|
|
9
|
+
class="mt-8 inline-flex items-center justify-center px-5 py-3 border border-transparent text-base font-sm rounded-sm text-gray-600 bg-white hover:bg-gray-50 sm:w-auto">
|
|
10
|
+
πατήστε εδώ για να επιστρέψετε
|
|
11
|
+
</a>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</lib-view-layout>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Component, OnInit } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'lib-page-not-found',
|
|
5
|
+
templateUrl: './page-not-found.component.html'
|
|
6
|
+
})
|
|
7
|
+
export class PageNotFoundComponent implements OnInit {
|
|
8
|
+
|
|
9
|
+
constructor() { }
|
|
10
|
+
|
|
11
|
+
ngOnInit(): void {
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<lib-view-layout [show-header]="false" title="401 - δεν επιτρέπεται η πρόσβαση!">
|
|
2
|
+
<div class="bg-gray-600 view-container">
|
|
3
|
+
<div class="max-w-2xl mx-auto text-center py-16 px-4 sm:py-20 sm:px-6 lg:px-8">
|
|
4
|
+
<h2 class="text-3xl font-extrabold text-white sm:text-4xl">
|
|
5
|
+
<span class="block">401</span>
|
|
6
|
+
</h2>
|
|
7
|
+
<p class="mt-4 text-lg leading-6 text-gray-200">δεν έχετε τα κατάλληλα δικαιώματα πρόσβασης!</p>
|
|
8
|
+
<a href="/" class="mt-8 inline-flex items-center justify-center px-5 py-3 border border-transparent text-base font-sm rounded-sm text-gray-600 bg-white hover:bg-gray-50 sm:w-auto">
|
|
9
|
+
πατήστε εδώ για να επιστρέψετε
|
|
10
|
+
</a>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</lib-view-layout>
|
|
14
|
+
|
|
15
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Component, Inject, OnInit } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'lib-unauthorized',
|
|
5
|
+
templateUrl: './unauthorized.component.html'
|
|
6
|
+
})
|
|
7
|
+
export class UnauthorizedComponent implements OnInit {
|
|
8
|
+
constructor() { }
|
|
9
|
+
|
|
10
|
+
public ngOnInit(): void { }
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Pipe, PipeTransform } from '@angular/core';
|
|
2
|
+
import { IAddress } from '../types';
|
|
3
|
+
|
|
4
|
+
@Pipe({
|
|
5
|
+
name: 'address',
|
|
6
|
+
pure: false
|
|
7
|
+
})
|
|
8
|
+
export class AddressPipe implements PipeTransform {
|
|
9
|
+
|
|
10
|
+
transform(value: IAddress | undefined): string {
|
|
11
|
+
if (value === undefined || null || '') {
|
|
12
|
+
return '';
|
|
13
|
+
}
|
|
14
|
+
// tslint:disable-next-line:no-non-null-assertion
|
|
15
|
+
return `${value.street || ''}${value.streetNumber ? ' ' + value.streetNumber : ''}${value.city ? ', ' + value.city : ''}${+value.postalCode! ? ', ' + +value.postalCode! : ''}`;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Pipe, PipeTransform } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Pipe({
|
|
4
|
+
name: 'durationFormat',
|
|
5
|
+
pure: false
|
|
6
|
+
})
|
|
7
|
+
export class DurationFormatPipe implements PipeTransform {
|
|
8
|
+
|
|
9
|
+
transform(value: any, arg1: any, arg2: any): string {
|
|
10
|
+
|
|
11
|
+
let days: any;
|
|
12
|
+
let seconds: any;
|
|
13
|
+
let minutes: any;
|
|
14
|
+
let hours: any;
|
|
15
|
+
|
|
16
|
+
if (arg1 === 'ms' && arg2 === 'hhmmss') {
|
|
17
|
+
seconds = Math.floor((value / 1000) % 60);
|
|
18
|
+
minutes = Math.floor(((value / (1000 * 60)) % 60));
|
|
19
|
+
hours = Math.floor((value / (1000 * 60 * 60)));
|
|
20
|
+
return this.format(arg2, seconds, minutes, hours, days);
|
|
21
|
+
|
|
22
|
+
} else if (arg1 === 's' && arg2 === 'hhmmss') {
|
|
23
|
+
seconds = Math.floor((value % 60));
|
|
24
|
+
minutes = Math.floor(((value / 60) % 60));
|
|
25
|
+
hours = Math.floor(((value / 60) / 60));
|
|
26
|
+
return this.format(arg2, seconds, minutes, hours, days);
|
|
27
|
+
|
|
28
|
+
} else if (arg1 === 'ms' && (arg2 === 'ddhhmmss' || arg2 === 'ddhhmmssLong')) {
|
|
29
|
+
seconds = Math.floor(((value / 1000) % 60));
|
|
30
|
+
minutes = Math.floor((value / (1000 * 60) % 60));
|
|
31
|
+
hours = Math.floor((value / (1000 * 60 * 60) % 24));
|
|
32
|
+
days = Math.floor((value / (1000 * 60 * 60 * 24)));
|
|
33
|
+
return this.format(arg2, seconds, minutes, hours, days);
|
|
34
|
+
|
|
35
|
+
} else if (arg1 === 's' && (arg2 === 'ddhhmmss' || arg2 === 'ddhhmmssLong')) {
|
|
36
|
+
seconds = Math.floor(value % 60);
|
|
37
|
+
minutes = Math.floor(((value / 60) % 60));
|
|
38
|
+
hours = Math.floor(((value / 60) / 60) % 24);
|
|
39
|
+
days = Math.floor((((value / 60) / 60) / 24));
|
|
40
|
+
return this.format(arg2, seconds, minutes, hours, days);
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
private format(arg2: string, seconds: any, minutes: any, hours: any, days: any): any {
|
|
49
|
+
(days < 10) ? days = '0' + days : days;
|
|
50
|
+
(hours < 10) ? hours = '0' + hours : hours;
|
|
51
|
+
(minutes < 10) ? minutes = '0' + minutes : minutes;
|
|
52
|
+
(seconds < 10) ? seconds = '0' + seconds : seconds;
|
|
53
|
+
|
|
54
|
+
switch (arg2) {
|
|
55
|
+
case 'hhmmss':
|
|
56
|
+
return `${hours}:${minutes}:${seconds}`;
|
|
57
|
+
|
|
58
|
+
case 'ddhhmmss':
|
|
59
|
+
return `${days}d, ${hours}h, ${minutes}m, ${seconds}s`;
|
|
60
|
+
|
|
61
|
+
case 'ddhhmmssLong':
|
|
62
|
+
return `${days} days, ${hours} hours, ${minutes} minutes, ${seconds} seconds`;
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Options passed to {@link ComponentLoader.show}.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export class ComponentLoaderOptions {
|
|
9
|
+
/**
|
|
10
|
+
* The content to be drawn inside `<ng-content>` of `ComponentLoader` attached component.
|
|
11
|
+
* @remarks
|
|
12
|
+
* `content` can be `Component` , `TemplateRef` or `String`.
|
|
13
|
+
*/
|
|
14
|
+
content?: string | TemplateRef<unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* The data to be passed to view for `TemplateRef` case.
|
|
17
|
+
*/
|
|
18
|
+
context?: unknown;
|
|
19
|
+
/**
|
|
20
|
+
* Initial data to be passed to `content` for `Component` case.
|
|
21
|
+
*/
|
|
22
|
+
initialState?: unknown;
|
|
23
|
+
/**
|
|
24
|
+
* Other properties passed to attached component.
|
|
25
|
+
*/
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
/**
|
|
28
|
+
* id` - The id of the attached component ref.
|
|
29
|
+
*/
|
|
30
|
+
id?: number | string;
|
|
31
|
+
}
|