sgh-navbar 0.0.35 → 0.0.37

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/karma.conf.js +44 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +11 -31
  4. package/src/lib/sgh-navbar.component.spec.ts +23 -0
  5. package/src/lib/sgh-navbar.component.ts +20 -0
  6. package/src/lib/sgh-navbar.module.ts +48 -0
  7. package/src/lib/sgh-navbar.service.spec.ts +16 -0
  8. package/src/lib/sgh-navbar.service.ts +34 -0
  9. package/src/lib/sidenav/helper.ts +25 -0
  10. package/src/lib/sidenav/menu-list-item/item1/item1.component.html +1 -0
  11. package/src/lib/sidenav/menu-list-item/item1/item1.component.scss +0 -0
  12. package/src/lib/sidenav/menu-list-item/item1/item1.component.spec.ts +25 -0
  13. package/src/lib/sidenav/menu-list-item/item1/item1.component.ts +15 -0
  14. package/src/lib/sidenav/menu-list-item/item1/sub-item1/sub-item1.component.html +1 -0
  15. package/src/lib/sidenav/menu-list-item/item1/sub-item1/sub-item1.component.scss +0 -0
  16. package/src/lib/sidenav/menu-list-item/item1/sub-item1/sub-item1.component.spec.ts +25 -0
  17. package/src/lib/sidenav/menu-list-item/item1/sub-item1/sub-item1.component.ts +15 -0
  18. package/src/lib/sidenav/menu-list-item/item2/item2.component.html +1 -0
  19. package/src/lib/sidenav/menu-list-item/item2/item2.component.scss +0 -0
  20. package/src/lib/sidenav/menu-list-item/item2/item2.component.spec.ts +25 -0
  21. package/src/lib/sidenav/menu-list-item/item2/item2.component.ts +15 -0
  22. package/src/lib/sidenav/menu-list-item/item3/item3.component.html +1 -0
  23. package/src/lib/sidenav/menu-list-item/item3/item3.component.scss +0 -0
  24. package/src/lib/sidenav/menu-list-item/item3/item3.component.spec.ts +25 -0
  25. package/src/lib/sidenav/menu-list-item/item3/item3.component.ts +15 -0
  26. package/src/lib/sidenav/menu-list-item/menu-list-item.component.html +17 -0
  27. package/src/lib/sidenav/menu-list-item/menu-list-item.component.scss +128 -0
  28. package/src/lib/sidenav/menu-list-item/menu-list-item.component.spec.ts +25 -0
  29. package/src/lib/sidenav/menu-list-item/menu-list-item.component.ts +42 -0
  30. package/src/lib/sidenav/nav-data.ts +98 -0
  31. package/src/lib/sidenav/sidenav-data.ts +12 -0
  32. package/src/lib/sidenav/sidenav.component.html +34 -0
  33. package/src/lib/sidenav/sidenav.component.scss +173 -0
  34. package/src/lib/sidenav/sidenav.component.ts +84 -0
  35. package/src/lib/sidenav/sublevel-menu.component.ts +106 -0
  36. package/src/lib/toolbar/assets/Synergen_Logo-Large2.png +0 -0
  37. package/src/lib/toolbar/noftification-list/noftification-list.component.html +18 -0
  38. package/src/lib/toolbar/noftification-list/noftification-list.component.scss +67 -0
  39. package/src/lib/toolbar/noftification-list/noftification-list.component.spec.ts +25 -0
  40. package/src/lib/toolbar/noftification-list/noftification-list.component.ts +14 -0
  41. package/src/lib/toolbar/search.pipe.ts +18 -0
  42. package/src/lib/toolbar/sub-client-dialog/sub-client-dialog.component.html +14 -0
  43. package/src/lib/toolbar/sub-client-dialog/sub-client-dialog.component.scss +40 -0
  44. package/src/lib/toolbar/sub-client-dialog/sub-client-dialog.component.spec.ts +23 -0
  45. package/src/lib/toolbar/sub-client-dialog/sub-client-dialog.component.ts +41 -0
  46. package/src/lib/toolbar/toolbar-data.ts +35 -0
  47. package/src/lib/toolbar/toolbar.component.html +79 -0
  48. package/src/lib/toolbar/toolbar.component.scss +493 -0
  49. package/src/lib/toolbar/toolbar.component.ts +218 -0
  50. package/{public-api.d.ts → src/public-api.ts} +6 -0
  51. package/src/test.ts +15 -0
  52. package/tsconfig.lib.json +15 -0
  53. package/tsconfig.lib.prod.json +10 -0
  54. package/tsconfig.spec.json +17 -0
  55. package/esm2020/lib/sgh-navbar.component.mjs +0 -22
  56. package/esm2020/lib/sgh-navbar.module.mjs +0 -77
  57. package/esm2020/lib/sgh-navbar.service.mjs +0 -36
  58. package/esm2020/lib/sidenav/helper.mjs +0 -12
  59. package/esm2020/lib/sidenav/menu-list-item/menu-list-item.component.mjs +0 -46
  60. package/esm2020/lib/sidenav/nav-data.mjs +0 -97
  61. package/esm2020/lib/sidenav/sidenav-data.mjs +0 -3
  62. package/esm2020/lib/sidenav/sidenav.component.mjs +0 -92
  63. package/esm2020/lib/sidenav/sublevel-menu.component.mjs +0 -168
  64. package/esm2020/lib/toolbar/noftification-list/noftification-list.component.mjs +0 -14
  65. package/esm2020/lib/toolbar/search.pipe.mjs +0 -21
  66. package/esm2020/lib/toolbar/sub-client-dialog/sub-client-dialog.component.mjs +0 -47
  67. package/esm2020/lib/toolbar/toolbar-data.mjs +0 -9
  68. package/esm2020/lib/toolbar/toolbar.component.mjs +0 -214
  69. package/esm2020/public-api.mjs +0 -10
  70. package/esm2020/sgh-navbar.mjs +0 -5
  71. package/fesm2015/sgh-navbar.mjs +0 -817
  72. package/fesm2015/sgh-navbar.mjs.map +0 -1
  73. package/fesm2020/sgh-navbar.mjs +0 -809
  74. package/fesm2020/sgh-navbar.mjs.map +0 -1
  75. package/index.d.ts +0 -5
  76. package/lib/sgh-navbar.component.d.ts +0 -8
  77. package/lib/sgh-navbar.module.d.ts +0 -21
  78. package/lib/sgh-navbar.service.d.ts +0 -15
  79. package/lib/sidenav/helper.d.ts +0 -9
  80. package/lib/sidenav/menu-list-item/menu-list-item.component.d.ts +0 -16
  81. package/lib/sidenav/nav-data.d.ts +0 -2
  82. package/lib/sidenav/sidenav-data.d.ts +0 -10
  83. package/lib/sidenav/sidenav.component.d.ts +0 -24
  84. package/lib/sidenav/sublevel-menu.component.d.ts +0 -18
  85. package/lib/toolbar/noftification-list/noftification-list.component.d.ts +0 -8
  86. package/lib/toolbar/search.pipe.d.ts +0 -7
  87. package/lib/toolbar/sub-client-dialog/sub-client-dialog.component.d.ts +0 -19
  88. package/lib/toolbar/toolbar-data.d.ts +0 -32
  89. package/lib/toolbar/toolbar.component.d.ts +0 -41
package/karma.conf.js ADDED
@@ -0,0 +1,44 @@
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/sgh-navbar'),
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
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/sgh-navbar",
4
+ "lib": {
5
+ "entryFile": "src/public-api.ts"
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,31 +1,11 @@
1
- {
2
- "name": "sgh-navbar",
3
- "version": "0.0.35",
4
- "peerDependencies": {
5
- "@angular/common": "^15.2.8",
6
- "@angular/core": "^15.2.8"
7
- },
8
- "dependencies": {
9
- "tslib": "^2.3.0"
10
- },
11
- "module": "fesm2015/sgh-navbar.mjs",
12
- "es2020": "fesm2020/sgh-navbar.mjs",
13
- "esm2020": "esm2020/sgh-navbar.mjs",
14
- "fesm2020": "fesm2020/sgh-navbar.mjs",
15
- "fesm2015": "fesm2015/sgh-navbar.mjs",
16
- "typings": "index.d.ts",
17
- "exports": {
18
- "./package.json": {
19
- "default": "./package.json"
20
- },
21
- ".": {
22
- "types": "./index.d.ts",
23
- "esm2020": "./esm2020/sgh-navbar.mjs",
24
- "es2020": "./fesm2020/sgh-navbar.mjs",
25
- "es2015": "./fesm2015/sgh-navbar.mjs",
26
- "node": "./fesm2015/sgh-navbar.mjs",
27
- "default": "./fesm2020/sgh-navbar.mjs"
28
- }
29
- },
30
- "sideEffects": false
31
- }
1
+ {
2
+ "name": "sgh-navbar",
3
+ "version": "0.0.37",
4
+ "peerDependencies": {
5
+ "@angular/common": "^15.2.8",
6
+ "@angular/core": "^15.2.8"
7
+ },
8
+ "dependencies": {
9
+ "tslib": "^2.3.0"
10
+ }
11
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { SghNavbarComponent } from './sgh-navbar.component';
4
+
5
+ describe('SghNavbarComponent', () => {
6
+ let component: SghNavbarComponent;
7
+ let fixture: ComponentFixture<SghNavbarComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ SghNavbarComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(SghNavbarComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,20 @@
1
+ import { Component, OnInit } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'lib-sgh-navbar',
5
+ template: `
6
+ <p>
7
+ sgh-navbar works!
8
+ </p>
9
+ `,
10
+ styles: [
11
+ ]
12
+ })
13
+ export class SghNavbarComponent implements OnInit {
14
+
15
+ constructor() { }
16
+
17
+ ngOnInit(): void {
18
+ }
19
+
20
+ }
@@ -0,0 +1,48 @@
1
+ import {NgModule} from '@angular/core';
2
+ import {SghNavbarComponent} from './sgh-navbar.component';
3
+ import {SublevelMenuComponent} from './sidenav/sublevel-menu.component';
4
+ import {SidenavComponent} from './sidenav/sidenav.component';
5
+ import {ToolbarComponent} from './toolbar/toolbar.component';
6
+ import {CommonModule} from '@angular/common';
7
+ import {RouterModule} from '@angular/router';
8
+ import {FormsModule} from '@angular/forms';
9
+ import {MenuListItemComponent} from "./sidenav/menu-list-item/menu-list-item.component";
10
+ import {SghNavbarService} from "./sgh-navbar.service";
11
+ import {NoftificationListComponent} from "./toolbar/noftification-list/noftification-list.component";
12
+ import {MatMenuModule} from "@angular/material/menu";
13
+ import {SearchPipe} from "./toolbar/search.pipe";
14
+ import {MatRippleModule} from "@angular/material/core";
15
+ import { SubClientDialogComponent } from './toolbar/sub-client-dialog/sub-client-dialog.component';
16
+ import {MatDialogModule} from "@angular/material/dialog";
17
+ import {MatRadioModule} from "@angular/material/radio";
18
+
19
+ @NgModule({
20
+ declarations: [
21
+ SghNavbarComponent,
22
+ SublevelMenuComponent,
23
+ SidenavComponent,
24
+ ToolbarComponent,
25
+ MenuListItemComponent,
26
+ NoftificationListComponent,
27
+ SearchPipe,
28
+ SubClientDialogComponent
29
+ ],
30
+ imports: [
31
+ CommonModule,
32
+ RouterModule,
33
+ FormsModule,
34
+ MatMenuModule,
35
+ MatRippleModule,
36
+ MatDialogModule,
37
+ MatRadioModule
38
+ ],
39
+ exports: [
40
+ SghNavbarComponent,
41
+ SublevelMenuComponent,
42
+ SidenavComponent,
43
+ ToolbarComponent
44
+ ],
45
+ providers: [SghNavbarService],
46
+ })
47
+ export class SghNavbarModule {
48
+ }
@@ -0,0 +1,16 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+
3
+ import { SghNavbarService } from './sgh-navbar.service';
4
+
5
+ describe('SghNavbarService', () => {
6
+ let service: SghNavbarService;
7
+
8
+ beforeEach(() => {
9
+ TestBed.configureTestingModule({});
10
+ service = TestBed.inject(SghNavbarService);
11
+ });
12
+
13
+ it('should be created', () => {
14
+ expect(service).toBeTruthy();
15
+ });
16
+ });
@@ -0,0 +1,34 @@
1
+ import { Injectable } from '@angular/core';
2
+ import {BehaviorSubject} from "rxjs";
3
+
4
+ @Injectable({
5
+ providedIn: 'root'
6
+ })
7
+ export class SghNavbarService {
8
+ expanded:boolean;
9
+ client = new BehaviorSubject({});
10
+ subClient = new BehaviorSubject({});
11
+ setExpanded(value: boolean) {
12
+ this.expanded = value;
13
+ }
14
+
15
+ getExpanded() {
16
+ return this.expanded;
17
+ }
18
+
19
+ setClient(client) {
20
+ this.client.next(client);
21
+ }
22
+
23
+ getClient() {
24
+ return this.client;
25
+ }
26
+
27
+ setSubclient(subclient) {
28
+ this.subClient.next(subclient);
29
+ }
30
+
31
+ getSubclient() {
32
+ return this.subClient;
33
+ }
34
+ }
@@ -0,0 +1,25 @@
1
+ import { animate, style, transition, trigger } from "@angular/animations";
2
+
3
+ export interface INavbarData {
4
+ routeLink: string;
5
+ icon?: string;
6
+ label: string;
7
+ expanded?: boolean;
8
+ visible: boolean;
9
+ items?: INavbarData[];
10
+ }
11
+
12
+ export const fadeInOut = trigger('fadeInOut', [
13
+ transition(':enter', [
14
+ style({opacity: 0}),
15
+ animate('350ms',
16
+ style({opacity: 1})
17
+ )
18
+ ]),
19
+ transition(':leave', [
20
+ style({opacity: 1}),
21
+ animate('350ms',
22
+ style({opacity: 0})
23
+ )
24
+ ])
25
+ ])
@@ -0,0 +1 @@
1
+ <p>item1 works!</p>
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { Item1Component } from './item1.component';
4
+
5
+ describe('Item1Component', () => {
6
+ let component: Item1Component;
7
+ let fixture: ComponentFixture<Item1Component>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ Item1Component ]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(Item1Component);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,15 @@
1
+ import { Component, OnInit } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'app-item1',
5
+ templateUrl: './item1.component.html',
6
+ styleUrls: ['./item1.component.scss']
7
+ })
8
+ export class Item1Component implements OnInit {
9
+
10
+ constructor() { }
11
+
12
+ ngOnInit(): void {
13
+ }
14
+
15
+ }
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { SubItem1Component } from './sub-item1.component';
4
+
5
+ describe('SubItem1Component', () => {
6
+ let component: SubItem1Component;
7
+ let fixture: ComponentFixture<SubItem1Component>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ SubItem1Component ]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(SubItem1Component);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,15 @@
1
+ import { Component, OnInit } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'app-sub-item1',
5
+ templateUrl: './sub-item1.component.html',
6
+ styleUrls: ['./sub-item1.component.scss']
7
+ })
8
+ export class SubItem1Component implements OnInit {
9
+
10
+ constructor() { }
11
+
12
+ ngOnInit(): void {
13
+ }
14
+
15
+ }
@@ -0,0 +1 @@
1
+ <p>item2 works!</p>
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { Item2Component } from './item2.component';
4
+
5
+ describe('Item2Component', () => {
6
+ let component: Item2Component;
7
+ let fixture: ComponentFixture<Item2Component>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ Item2Component ]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(Item2Component);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,15 @@
1
+ import { Component, OnInit } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'app-item2',
5
+ templateUrl: './item2.component.html',
6
+ styleUrls: ['./item2.component.scss']
7
+ })
8
+ export class Item2Component implements OnInit {
9
+
10
+ constructor() { }
11
+
12
+ ngOnInit(): void {
13
+ }
14
+
15
+ }
@@ -0,0 +1 @@
1
+ <p>item3 works!</p>
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { Item3Component } from './item3.component';
4
+
5
+ describe('Item3Component', () => {
6
+ let component: Item3Component;
7
+ let fixture: ComponentFixture<Item3Component>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ Item3Component ]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(Item3Component);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,15 @@
1
+ import { Component, OnInit } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'app-item3',
5
+ templateUrl: './item3.component.html',
6
+ styleUrls: ['./item3.component.scss']
7
+ })
8
+ export class Item3Component implements OnInit {
9
+
10
+ constructor() { }
11
+
12
+ ngOnInit(): void {
13
+ }
14
+
15
+ }
@@ -0,0 +1,17 @@
1
+ <div class="sidebar_div" *ngFor="let data of items">
2
+ <a (click)="onItemSelected(data)" class="sub-link"
3
+ [routerLink]="[data.routeLink]" routerLinkActive="item-active" *ngIf="data.visible">
4
+ <div class="text-wrapper">
5
+ <i class="fa-size fa fa-{{data.icon}} {{data.icon ? '' : 'padding-10'}}"></i>
6
+ <div class="text-div">
7
+ {{data.label}}
8
+ </div>
9
+ </div>
10
+ <i class="fa-size fa fa-angle-down" *ngIf="!(data.items == undefined)"
11
+ [@indicatorRotate]="data.expanded ? 'expanded': 'collapsed'"></i>
12
+ </a>
13
+ <div class="sub-link-wrapper" *ngIf="data.expanded">
14
+ <app-menu-list-item [items]="data.items">
15
+ </app-menu-list-item>
16
+ </div>
17
+ </div>
@@ -0,0 +1,128 @@
1
+ .padding-10{
2
+ padding-left: 10px;
3
+ }
4
+ .text-div{
5
+ text-align: initial;
6
+ padding-left: 10px;
7
+ }
8
+ .sub-link {
9
+ padding-left: 30px !important;
10
+ }
11
+
12
+ .sidebar_div {
13
+ margin: 0;
14
+ padding: 0;
15
+ //width: 200px;
16
+
17
+ //position: fixed;
18
+ //height: 100%;
19
+ overflow: auto;
20
+
21
+ }
22
+
23
+ /* sidebar_div links */
24
+ .sidebar_div a {
25
+ color: #005860;
26
+ padding: 10px 13px;
27
+ text-decoration: none;
28
+ margin: 0px 2px;
29
+ display: flex;
30
+ align-items: center;
31
+ justify-content: space-between;
32
+
33
+ }
34
+
35
+ /* Active/current link */
36
+ .sidebar_div a.active {
37
+ background-color: #006068;
38
+ color: white;
39
+ border-radius: 13px;
40
+ }
41
+
42
+ /* Links on mouse-over */
43
+ .sidebar_div a:hover:not(.active) {
44
+ background-color: #26787f !important;
45
+ color: white;
46
+ border-radius: 13px;
47
+ }
48
+
49
+ /* Page content. The value of the margin-left property should match the value of the sidebar_div's width property */
50
+ div.content {
51
+ margin-left: 200px;
52
+ padding: 1px 16px;
53
+ height: 1000px;
54
+ }
55
+
56
+ /* On screens that are less than 700px wide, make the sidebar_div into a topbar */
57
+ @media screen and (max-width: 700px) {
58
+ .sidebar_div {
59
+ width: 100%;
60
+ height: auto;
61
+ position: relative;
62
+ }
63
+ .sidebar_div a {
64
+ float: left;
65
+ width: -webkit-fill-available;
66
+ }
67
+ div.content {
68
+ margin-left: 0;
69
+ }
70
+ }
71
+
72
+ /* On screens that are less than 400px, display the bar vertically, instead of horizontally */
73
+ @media screen and (max-width: 400px) {
74
+ .sidebar_div a {
75
+ text-align: center;
76
+ float: none;
77
+ }
78
+ }
79
+
80
+
81
+ .nav-list li a {
82
+ text-decoration: none;
83
+ display: block;
84
+ padding: 10px;
85
+ cursor: pointer;
86
+ border-bottom: 1px solid #515151 !important;
87
+ color: #9d9d9d;
88
+ }
89
+
90
+ .nav-list > li > a {
91
+ color: #C4C4C4;
92
+ font-size: 14px;
93
+ padding-left: 13px !important;
94
+ border-bottom: 1px solid #585858;
95
+ }
96
+
97
+ .nav-list > li > a:hover {
98
+ background-color: #444444;
99
+ }
100
+
101
+ .sidenav-overlay {
102
+ display: none;
103
+ position: fixed;
104
+ width: 100%;
105
+ height: 100%;
106
+ background-color: #0009 !important;
107
+ left: 0%;
108
+ top: 0;
109
+ z-index: -1;
110
+ cursor: default;
111
+ }
112
+
113
+ .text-wrapper {
114
+ display: flex !important;
115
+ align-items: center !important;
116
+ margin-left: 10px !important;
117
+ }
118
+
119
+ @media screen and (max-width: 600px) {
120
+ .sgh-sidebar {
121
+ position: absolute !important;
122
+ background: white !important;
123
+ }
124
+ .sidenav-overlay {
125
+ display: block;
126
+ }
127
+
128
+ }
@@ -0,0 +1,25 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { MenuListItemComponent } from './menu-list-item.component';
4
+
5
+ describe('MenuListItemComponent', () => {
6
+ let component: MenuListItemComponent;
7
+ let fixture: ComponentFixture<MenuListItemComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ MenuListItemComponent ]
12
+ })
13
+ .compileComponents();
14
+ });
15
+
16
+ beforeEach(() => {
17
+ fixture = TestBed.createComponent(MenuListItemComponent);
18
+ component = fixture.componentInstance;
19
+ fixture.detectChanges();
20
+ });
21
+
22
+ it('should create', () => {
23
+ expect(component).toBeTruthy();
24
+ });
25
+ });
@@ -0,0 +1,42 @@
1
+ import {Component, HostBinding, Input, OnInit, ViewEncapsulation} from '@angular/core';
2
+ import {INavbarData} from '../helper';
3
+ import {Router} from '@angular/router';
4
+ import {animate, state, style, transition, trigger} from '@angular/animations';
5
+
6
+ @Component({
7
+ selector: 'app-menu-list-item',
8
+ templateUrl: './menu-list-item.component.html',
9
+ styleUrls: ['./menu-list-item.component.scss'],
10
+ encapsulation:ViewEncapsulation.None,
11
+ animations: [
12
+ trigger('indicatorRotate', [
13
+ state('collapsed', style({transform: 'rotate(0deg)'})),
14
+ state('expanded', style({transform: 'rotate(180deg)'})),
15
+ transition('expanded <=> collapsed',
16
+ animate('225ms cubic-bezier(0.4,0.0,0.2,1)')
17
+ ),
18
+ ])
19
+ ]
20
+ })
21
+ export class MenuListItemComponent implements OnInit {
22
+ expanded: boolean;
23
+ expandMenu: boolean;
24
+ // @ts-ignore
25
+ @HostBinding('attr.aria-expanded') ariaExpanded = this.expanded;
26
+ @Input() items: any;
27
+
28
+ constructor(public router: Router) { }
29
+
30
+ ngOnInit(): void {
31
+ }
32
+
33
+ onItemSelected(item: INavbarData) {
34
+ if (!item.items || !item.items.length) {
35
+ this.router.navigate([item.routeLink]).then();
36
+ }
37
+ if (item.items && item.items.length) {
38
+ item.expanded = !item.expanded;
39
+ }
40
+ }
41
+
42
+ }