Skip to content

Commit b371a10

Browse files
committed
Add menu component
1 parent 1c962f1 commit b371a10

18 files changed

Lines changed: 127 additions & 11 deletions

angular-lib/browserslist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
> 0.5%
2+
last 2 versions
3+
Firefox ESR
4+
not dead
5+
not IE 9-11 # For IE 9-11 support, remove 'not'.

angular-lib/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

angular-lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@exlibris/exl-cloudapp-angular-lib",
3-
"version": "0.5.0",
3+
"version": "0.6.0",
44
"main": "index.js",
55
"description": "Library used in Ex Libris Cloud Apps",
66
"license": "https://developers.exlibrisgroup.com/about/terms",
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
export * from './ui/components/alerts/index';
1+
export * from './ui/components/alerts/index';
2+
export * from './ui/components/menu/index';
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from './menu.module';
2+
export * from './menu/menu.component';
3+
export * from './menu-item/menu-item.component';
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<mat-card [routerLink]="routerLink">
2+
<mat-card-header>
3+
<span mat-card-avatar [class]="icon"></span>
4+
<mat-card-title>{{title | truncate:13:false:''}}</mat-card-title>
5+
</mat-card-header>
6+
<mat-card-content>
7+
<ng-content></ng-content>
8+
</mat-card-content>
9+
</mat-card>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
:host {
2+
& {
3+
display: contents;
4+
}
5+
.mat-card {
6+
& {
7+
background-color: #f5f5f5;
8+
cursor: pointer;
9+
transform: scale(.99);
10+
}
11+
12+
&:hover {
13+
transform: scale(1);
14+
left: -1px;
15+
background: #eaeaea!important;
16+
transition: transform .15s ease-in-out;
17+
}
18+
19+
span[mat-card-avatar] {
20+
margin-right: 5px;
21+
}
22+
23+
.mat-card-content {
24+
overflow: hidden;
25+
text-overflow: ellipsis;
26+
display: -webkit-box;
27+
-webkit-line-clamp: 3;
28+
-webkit-box-orient: vertical;
29+
}
30+
}
31+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Component, Input, OnInit } from "@angular/core";
2+
3+
@Component({
4+
selector: 'eca-menu-item',
5+
templateUrl: './menu-item.component.html',
6+
styleUrls: ['./menu-item.component.scss']
7+
})
8+
export class MenuItemComponent implements OnInit {
9+
@Input() title: string;
10+
@Input() icon = 'uxf-icon uxf-check';
11+
@Input() routerLink: string;
12+
13+
ngOnInit() {
14+
15+
}
16+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { NgModule } from "@angular/core";
2+
import { RouterModule } from "@angular/router";
3+
import { MaterialModule } from "../../../modules/material.module";
4+
import { TruncatePipe } from "./truncate.pipe";
5+
import { MenuItemComponent } from "./menu-item/menu-item.component";
6+
import { MenuComponent } from './menu/menu.component';
7+
import { CommonModule } from "@angular/common";
8+
9+
@NgModule({
10+
imports: [
11+
MaterialModule,
12+
RouterModule,
13+
CommonModule,
14+
],
15+
declarations: [MenuComponent, MenuItemComponent, TruncatePipe],
16+
exports: [MenuComponent, MenuItemComponent],
17+
})
18+
export class MenuModule { }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<ng-content></ng-content>

0 commit comments

Comments
 (0)