Skip to content

Commit 38125b1

Browse files
committed
a lot of change to cursor/pointer and extra options for components
1 parent 95fbca5 commit 38125b1

14 files changed

Lines changed: 103 additions & 21 deletions

ui/src/app/components/options/options.component.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
<!-- Checkbox -->
55
<div *ngIf="option.type === 'checkbox'"
66
fxLayout="row" fxLayoutAlign="center center" fxFill fxLayoutGap="10px"
7+
class="pointer"
78
(click)="toggleCheckbox(option)">
8-
<eqm-checkbox [interactive]="false" [checked]="option.value"></eqm-checkbox><eqm-label>{{option.label}}</eqm-label>
9+
<eqm-checkbox [interactive]="false" [checked]="option.value"></eqm-checkbox><eqm-label [clickable]="true">{{option.label}}</eqm-label>
910
</div>
1011

1112
<!-- Button -->
1213
<eqm-button *ngIf="option.type === 'button'"
1314
fxFill type="narrow"
1415
[disabled]="!!option.isEnabled && option.isEnabled() === false"
1516
(pressed)="option.action()" [hoverable]="option.hasOwnProperty('hoverable') ? option.hoverable : true">
16-
<eqm-label>{{option.label}}</eqm-label>
17+
<eqm-label [clickable]="true">{{option.label}}</eqm-label>
1718
</eqm-button>
1819

1920
<!-- Select -->
@@ -25,7 +26,7 @@
2526
[disabled]="!!option.isEnabled && option.isEnabled() === false"
2627
[depressable]="false" [toggle]="true" type="narrow" [state]="option.selectedId === selectOption.id" (pressed)="selectedOption(option, selectOption)"
2728
>
28-
<eqm-label>{{selectOption.label}}</eqm-label>
29+
<eqm-label [clickable]="true">{{selectOption.label}}</eqm-label>
2930
</eqm-button>
3031
</div>
3132
</div>
@@ -37,11 +38,10 @@
3738

3839
<!-- Label -->
3940
<div *ngIf="option.type === 'label'"
40-
[class]="option.url ? 'clickable' : ''"
4141
(click)="openUrl(option.url)"
4242
fxLayout="row" fxLayoutGap="5px" fxLayoutAlign="center center"
4343
>
44-
<eqm-label>{{option.label}}</eqm-label>
44+
<eqm-label [clickable]="!!option.url" [class]="option.url ? 'clickable' : ''">{{option.label}}</eqm-label>
4545
<eqm-question *ngIf="option.tooltip" [eqmTooltip]="option.tooltip"></eqm-question>
4646
</div>
4747

ui/src/app/components/options/options.component.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88

99
.clickable {
1010
cursor: pointer !important;
11+
text-decoration: underline;
1112
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="row">
22
<div *ngFor="let crumb of crumbs; index as i" class="row">
33
<eqm-icon class="crumb-part" *ngIf="i !== 0" name="triangle" [rotate]="0" [width]="8" [height]="8"></eqm-icon>
4-
<eqm-label class="crumb-part" (click)="crumbClicked.emit({ crumb: crumb, index: i })">{{crumb}}</eqm-label>
4+
<eqm-label [class]="'crumb-part pointer' + (underline ? ' underline' : '')" (click)="crumbClicked.emit({ crumb: crumb, index: i })">{{crumb}}</eqm-label>
55
</div>
66
</div>

ui/src/app/modules/eqmac-components/components/breadcrumbs/breadcrumbs.component.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,12 @@
88

99
.crumb-part {
1010
margin-right: 5px;
11+
}
12+
13+
.underline {
14+
text-decoration: underline;
15+
}
16+
17+
.pointer {
18+
cursor: pointer !important;
1119
}

ui/src/app/modules/eqmac-components/components/breadcrumbs/breadcrumbs.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
77
})
88
export class BreadcrumbsComponent implements OnInit {
99
@Input() crumbs: string[]
10+
@Input() underline = true
1011
@Output() crumbClicked = new EventEmitter<{ crumb: string, index: number }>()
1112
constructor() { }
1213

ui/src/app/modules/eqmac-components/components/button/button.component.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
transition-property: filter;
1616
transition-duration: .5s;
1717
border-radius: 3px; // font-size: 20px;
18+
cursor: pointer !important;
19+
20+
& * {
21+
cursor: pointer !important;
22+
}
1823
}
1924

2025
.transparent {
@@ -65,4 +70,9 @@
6570
.disabled {
6671
// box-shadow: 0 0 0 1px black, 0 0 0 1px rgba(gray, .1) inset, 0 0 15px 10px rgba(black, .3) inset;
6772
filter: grayscale(80%) brightness(80%);
73+
cursor: default !important;
74+
75+
& * {
76+
cursor: default !important;
77+
}
6878
}

ui/src/app/modules/eqmac-components/components/checkbox/checkbox.component.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,11 @@
22
display: flex;
33
justify-content: center;
44
align-items: center;
5-
}
5+
cursor: default;
6+
filter: grayscale(80%)
7+
}
8+
9+
:host.enabled {
10+
filter: none;
11+
cursor: pointer;
12+
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'
1+
import { Component, OnInit, Input, Output, EventEmitter, HostBinding } from '@angular/core'
22

33
@Component({
44
selector: 'eqm-checkbox',
@@ -9,11 +9,12 @@ export class CheckboxComponent {
99
@Input() interactive: boolean = true
1010
@Input() checked: boolean = false
1111
@Output() checkedChanged = new EventEmitter<boolean>()
12+
@HostBinding('class.enabled') @Input() enabled = true
1213

1314
toggle () {
14-
if (this.interactive) {
15+
if (this.interactive && this.enabled) {
1516
this.checked = !this.checked
16-
this.checkedChanged.emit()
17+
this.checkedChanged.emit(this.checked)
1718
}
1819
}
1920
}

ui/src/app/modules/eqmac-components/components/dropdown/dropdown.component.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@
33
<div class="item">
44

55
<eqm-icon *ngIf="selectedItem && selectedItem.icon" [name]="selectedItem.icon" class="icon" color="#4f8d71"></eqm-icon>
6-
<eqm-label color="#4f8d71"> {{(items.length ? (selectedItem ? selectedItem[labelParam] : placeholder) : noItemsPlaceholder)}} </eqm-label>
6+
<eqm-label color="#4f8d71"> {{(searchText || (items.length ? (selectedItem ? selectedItem[labelParam] : placeholder) : noItemsPlaceholder))}} </eqm-label>
77
</div>
88

9-
<div class="arrows" (click)="editable ? toggle($event) : undefined">
9+
<div class="right" *ngIf="searchText" (click)="searchText = null">
10+
<eqm-icon [name]="'cross'" [height]="16" [width]="16" color="#4f8d71"></eqm-icon>
11+
</div>
12+
<div class="right" *ngIf="!searchText" (click)="editable ? toggle($event) : undefined">
1013
<eqm-icon [name]="'triangle'" [height]="8" [width]="8" [color]="items.length ? '#4f8d71' : '#555'" rotate="-90">
1114
</eqm-icon>
1215
<eqm-icon [name]="'triangle'" [height]="8" [width]="8" [color]="items.length ? '#4f8d71' : '#555'" rotate="90">
1316
</eqm-icon>
1417
</div>
1518
</eqm-container>
16-
<eqm-select-box [numberOfVisibleItems]="numberOfVisibleItems" (clickedOutside)="close()" #box [hidden]="!shown"
17-
[class]="'items-select-box' + (direction === 'down' ? ' down' : ' up')" [items]="items" [labelParam]="labelParam"
19+
<eqm-select-box [numberOfVisibleItems]="numberOfVisibleItems" (clickedOutside)="close()" #box [hidden]="!shown || (filteredItems.length === 0)"
20+
[class]="'items-select-box' + (direction === 'down' ? ' down' : ' up')" [items]="filteredItems" [labelParam]="labelParam"
1821
[selectedItem]="selectedItem" (itemSelected)="selectItem($event)" [style.top.px]="yCoordinate"></eqm-select-box>

ui/src/app/modules/eqmac-components/components/dropdown/dropdown.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
transform: translateX(-2px);
2020
}
2121

22-
.arrows {
22+
.right {
2323
width: 20px;
2424
display: inline-flex;
2525
flex-direction: column;

0 commit comments

Comments
 (0)