Skip to content

Commit ee1513b

Browse files
committed
renamed all disabled params to enabled, for consistency
1 parent 63808c3 commit ee1513b

30 files changed

Lines changed: 99 additions & 90 deletions

modules/components/src/components/button/button.component.scss

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616
transition-property: filter;
1717
transition-duration: .5s;
1818
border-radius: 3px; // font-size: 20px;
19-
cursor: pointer !important;
20-
21-
& * {
22-
cursor: pointer !important;
23-
}
19+
filter: grayscale(80%) brightness(80%);
2420
}
2521

2622
.transparent {
@@ -68,12 +64,11 @@
6864
}
6965
}
7066

71-
.disabled {
72-
// box-shadow: 0 0 0 1px black, 0 0 0 1px rgba(gray, .1) inset, 0 0 15px 10px rgba(black, .3) inset;
73-
filter: grayscale(80%) brightness(80%);
74-
cursor: default !important;
67+
.enabled {
68+
filter: none;
69+
cursor: pointer !important;
7570

7671
& * {
77-
cursor: default !important;
72+
cursor: pointer !important;
7873
}
7974
}

modules/components/src/components/button/button.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class ButtonComponent implements OnInit {
1313
@Input() toggle = false
1414
@Input() depressable = true
1515
@Input() hoverable = true
16-
@Input() disabled = false
16+
@Input() enabled = true
1717
@Output() pressed = new EventEmitter()
1818

1919
ngOnInit () {
@@ -29,18 +29,18 @@ export class ButtonComponent implements OnInit {
2929
computeClass () {
3030
let className = 'button'
3131
className += ` ${this.type}`
32-
className += ` ${this.type}`
3332
className += this.state ? ' on' : ' off'
34-
if (this.disabled) {
35-
className += ' disabled'
36-
} else if (this.hoverable) {
33+
if (this.enabled) {
34+
className += ' enabled'
35+
}
36+
if (this.hoverable) {
3737
className += ' hoverable-' + (this.state ? 'on' : 'off')
3838
}
3939
return className
4040
}
4141

4242
click () {
43-
if (!this.disabled) {
43+
if (this.enabled) {
4444
if (this.toggle) {
4545
if (this.state && this.depressable) {
4646
this.state = !this.state

modules/components/src/components/container/container.component.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
box-shadow: 0 0 0 1px #000,
1010
0 0 0 2px rgb(70, 74, 77);
1111
background-size: 6px 6px;
12+
filter: grayscale(80%);
1213
}
1314

14-
:host.disabled {
15-
filter: grayscale(80%);
15+
:host.enabled {
16+
filter: none;
1617
}

modules/components/src/components/container/container.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Component, OnInit, HostBinding, Input } from '@angular/core'
66
styleUrls: [ './container.component.scss' ]
77
})
88
export class ContainerComponent implements OnInit {
9-
@HostBinding('class.disabled') @Input() disabled = false
9+
@HostBinding('class.enabled') @Input() enabled = true
1010

1111
ngOnInit () {
1212
}

modules/components/src/components/dropdown/dropdown.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<eqm-container #container [disabled]="disabled" (click)="editable ? undefined : toggle($event)"
1+
<eqm-container #container [enabled]="enabled" (click)="editable ? undefined : toggle($event)"
22
class="container">
33
<div class="item">
44

modules/components/src/components/dropdown/dropdown.component.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
width: 100%;
66
transition: filter;
77
transition-duration: 0.5s;
8+
filter: grayscale(80%);
89
}
910

1011
.container {
@@ -45,8 +46,8 @@ $animation-duration: .2s;
4546
transform-origin: bottom center;
4647
}
4748

48-
:host.disabled {
49-
filter: grayscale(80%);
49+
:host.enabled {
50+
filter: none;
5051
}
5152

5253
.item {

modules/components/src/components/dropdown/dropdown.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class DropdownComponent implements OnInit {
3131
}
3232

3333
@Output() refChanged = new EventEmitter<DropdownComponent>()
34-
@HostBinding('class.disabled') @Input() disabled = false
34+
@HostBinding('class.enabled') @Input() enabled = true
3535
@Input() selectedItem = null
3636
@Output() selectedItemChange = new EventEmitter<any>()
3737
@Input() labelParam = 'text'
@@ -108,15 +108,15 @@ export class DropdownComponent implements OnInit {
108108
}
109109

110110
async open () {
111-
if (!this.disabled && !this.shown && this.items.length) {
111+
if (this.enabled && !this.shown && this.items.length) {
112112
this.calculateYCoordinate()
113113
this.setDimensions()
114114
this.shown = true
115115
}
116116
}
117117

118118
async close () {
119-
if (!this.disabled && this.shown) {
119+
if (this.enabled && this.shown) {
120120
this.shown = false
121121
this.searchText = undefined
122122
}
@@ -134,7 +134,7 @@ export class DropdownComponent implements OnInit {
134134
searchText?: string
135135
@HostListener('document:keypress', [ '$event' ])
136136
keypress (event: KeyboardEvent) {
137-
if (!this.disabled && this.shown && this.searchable) {
137+
if (this.enabled && this.shown && this.searchable) {
138138
switch (event.key) {
139139
case 'Backspace': {
140140
if (this.searchText?.length) {

modules/components/src/components/flat-slider/flat-slider.component.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
:host {
33
display: block;
44
padding: 2px;
5+
filter: grayscale(80%);
56
}
67

7-
:host.disabled {
8-
filter: grayscale(80%);
8+
:host.enabled {
9+
filter: none;
910
}
1011

1112
.container {

modules/components/src/components/flat-slider/flat-slider.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class FlatSliderComponent {
5858
public defaultColor = '#4f8d71'
5959
public _enabled = true
6060

61-
@HostBinding('class.disabled') get disabled () { return !this.enabled }
61+
@HostBinding('class.enabled')
6262
@Input()
6363
set enabled (shouldBeEnabled) {
6464
this._enabled = shouldBeEnabled
@@ -180,7 +180,7 @@ export class FlatSliderComponent {
180180
})()
181181
if (this.notches?.length) {
182182
const closest = this.notches.reduce((prev, curr) => {
183-
return (Math.abs(curr - value) < Math.abs(prev - value) ? curr : prev);
183+
return (Math.abs(curr - value) < Math.abs(prev - value) ? curr : prev)
184184
})
185185
value = closest
186186
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<eqm-container class="container" #container>
2-
<input [(ngModel)]="text" [placeholder]="placeholder" (input)="inputChanged()" (keyup.enter)="enterPressed()" class="input-field" [readonly]="disabled || !editable" [style.font-size.px]="fontSize">
2+
<input [(ngModel)]="text" [placeholder]="placeholder" (input)="inputChanged()" (keyup.enter)="enterPressed()" class="input-field" [readonly]="!enabled || !editable" [style.font-size.px]="fontSize">
33
</eqm-container>

0 commit comments

Comments
 (0)