diff --git a/modules/components/src/animations/from-top.ts b/modules/components/src/animations/from-top.ts index edee1c8..681055d 100644 --- a/modules/components/src/animations/from-top.ts +++ b/modules/components/src/animations/from-top.ts @@ -3,11 +3,13 @@ import { trigger, style, animate, transition } from '@angular/animations' const DURATION = 100 const INITIAL_STATE = { - transform: 'translateY(-100%)' + transform: 'translateY(-100%)', + '-webkit-transform': 'translateY(-100%)' } const END_FRAME_STATE = { - transform: 'translateY(0%)' + transform: 'translateY(0%)', + '-webkit-transform': 'translateY(0%)' } export const FromTopAnimation = trigger('FromTop', [ diff --git a/modules/components/src/components/button/button.component.html b/modules/components/src/components/button/button.component.html index e6a2f18..53e36e2 100644 --- a/modules/components/src/components/button/button.component.html +++ b/modules/components/src/components/button/button.component.html @@ -1,3 +1,3 @@ -
+
\ No newline at end of file diff --git a/modules/components/src/components/button/button.component.scss b/modules/components/src/components/button/button.component.scss index 4ee966e..81938d6 100644 --- a/modules/components/src/components/button/button.component.scss +++ b/modules/components/src/components/button/button.component.scss @@ -12,7 +12,7 @@ justify-content: center; align-items: center; text-align: center; - background-color: rgb(62, 65, 70); + background-color: #3e4146; transition-property: filter; transition-duration: .5s; border-radius: 3px; // font-size: 20px; diff --git a/modules/components/src/components/button/button.component.ts b/modules/components/src/components/button/button.component.ts index f4f276e..e3df571 100644 --- a/modules/components/src/components/button/button.component.ts +++ b/modules/components/src/components/button/button.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core' +import { ColorsService } from '../../services/colors.service' @Component({ selector: 'eqm-button', @@ -13,8 +14,14 @@ export class ButtonComponent implements OnInit { @Input() toggle = false @Input() depressable = true @Input() hoverable = true + @Input() backgroundColor = '#3e4146' + @Input() color = this.colors.light + @Output() pressed = new EventEmitter() @Input() enabled = true - @Output() pressed = new EventEmitter() + + constructor ( + public colors: ColorsService + ) {} ngOnInit () { } @@ -22,7 +29,9 @@ export class ButtonComponent implements OnInit { get style () { return { width: `${this.width}px`, - height: `${this.height}px` + height: `${this.height}px`, + backgroundColor: this.type === 'transparent' ? 'transparent' : this.backgroundColor, + color: this.color } } @@ -39,7 +48,8 @@ export class ButtonComponent implements OnInit { return className } - click () { + click (event: MouseEvent) { + event.stopPropagation() if (this.enabled) { if (this.toggle) { if (this.state && this.depressable) { @@ -51,7 +61,7 @@ export class ButtonComponent implements OnInit { this.state = false }, 100) } - this.pressed.emit() + this.pressed.emit(event) } } } diff --git a/modules/components/src/components/checkbox/checkbox.component.html b/modules/components/src/components/checkbox/checkbox.component.html index d0dd57a..69a093e 100644 --- a/modules/components/src/components/checkbox/checkbox.component.html +++ b/modules/components/src/components/checkbox/checkbox.component.html @@ -1,3 +1,9 @@ - + + + + - \ No newline at end of file + + + + \ No newline at end of file diff --git a/modules/components/src/components/checkbox/checkbox.component.scss b/modules/components/src/components/checkbox/checkbox.component.scss index a709d88..8e8ecb1 100644 --- a/modules/components/src/components/checkbox/checkbox.component.scss +++ b/modules/components/src/components/checkbox/checkbox.component.scss @@ -3,7 +3,11 @@ justify-content: center; align-items: center; cursor: default; - filter: grayscale(80%) + filter: grayscale(80%); + + eqm-label { + margin: 0 5px; + } } :host.enabled { diff --git a/modules/components/src/components/checkbox/checkbox.component.ts b/modules/components/src/components/checkbox/checkbox.component.ts index 9976d0d..7794c68 100644 --- a/modules/components/src/components/checkbox/checkbox.component.ts +++ b/modules/components/src/components/checkbox/checkbox.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, Output, EventEmitter, HostBinding } from '@angular/core' +import { Component, Input, Output, EventEmitter, HostBinding, HostListener } from '@angular/core' @Component({ selector: 'eqm-checkbox', @@ -6,11 +6,13 @@ import { Component, Input, Output, EventEmitter, HostBinding } from '@angular/co styleUrls: [ './checkbox.component.scss' ] }) export class CheckboxComponent { + @Input() contentSide: 'left' | 'right' = 'right' @Input() interactive: boolean = true @Input() checked: boolean = false @Output() checkedChanged = new EventEmitter() @HostBinding('class.enabled') @Input() enabled = true + @HostListener('click') toggle () { if (this.interactive && this.enabled) { this.checked = !this.checked diff --git a/modules/components/src/components/divider/divider.component.ts b/modules/components/src/components/divider/divider.component.ts index 5e20d69..da10c65 100644 --- a/modules/components/src/components/divider/divider.component.ts +++ b/modules/components/src/components/divider/divider.component.ts @@ -14,12 +14,12 @@ export class DividerComponent { @HostBinding('style.width') get width () { - return this.orientation === 'vertical' ? '1px' : `${this.elem.nativeElement.parentElement.offsetWidth}` + return this.orientation === 'vertical' ? '1px' : '100%' } @HostBinding('style.height') get height () { - return this.orientation === 'vertical' ? `${this.elem.nativeElement.parentElement.offsetHeight}` : '1px' + return this.orientation === 'vertical' ? 'initial' : '1px' } @HostBinding('style.border-left') diff --git a/modules/components/src/components/icon/icon.component.html b/modules/components/src/components/icon/icon.component.html index dd293c6..27f8ac1 100644 --- a/modules/components/src/components/icon/icon.component.html +++ b/modules/components/src/components/icon/icon.component.html @@ -1 +1 @@ -
+
diff --git a/modules/components/src/components/icon/icon.component.scss b/modules/components/src/components/icon/icon.component.scss index ff7896d..99e95b2 100644 --- a/modules/components/src/components/icon/icon.component.scss +++ b/modules/components/src/components/icon/icon.component.scss @@ -1,5 +1,5 @@ -.container { +.icon-container { position: relative; svg { width: 100%; @@ -8,5 +8,6 @@ top: 50%; left: 50%; transform: translate(-50%, -50%); + -webkit-transform: translate(-50%, -50%); } } \ No newline at end of file diff --git a/modules/components/src/components/icon/icon.component.ts b/modules/components/src/components/icon/icon.component.ts index b1dd120..478c600 100644 --- a/modules/components/src/components/icon/icon.component.ts +++ b/modules/components/src/components/icon/icon.component.ts @@ -11,7 +11,7 @@ import { DomSanitizer, SafeHtml } from '@angular/platform-browser' selector: 'eqm-icon', templateUrl: './icon.component.html', styleUrls: [ './icon.component.scss' ], - encapsulation: ViewEncapsulation.ShadowDom + encapsulation: ViewEncapsulation.None }) export class IconComponent implements OnInit { @Input() width = 20 @@ -82,6 +82,7 @@ export class IconComponent implements OnInit { style.width = `${this.width}px` } style.transform = `rotate(${this.rotate}deg)` + style['-webkit-transform'] = `rotate(${this.rotate}deg)` if (this.stroke) { style['stroke-width'] = `${this.stroke}px` @@ -92,4 +93,4 @@ export class IconComponent implements OnInit { } } -export * from './icons' \ No newline at end of file +export * from './icons' diff --git a/modules/components/src/components/knob/knob.component.scss b/modules/components/src/components/knob/knob.component.scss index 60ed48c..c32d2c0 100644 --- a/modules/components/src/components/knob/knob.component.scss +++ b/modules/components/src/components/knob/knob.component.scss @@ -13,6 +13,7 @@ top: 50%; left: 50%; transform: translate(-50%, -50%); + -webkit-transform: translate(-50%, -50%); } @mixin size ($size) { @@ -101,6 +102,7 @@ top: -4%; left: 50%; transform: translate(-50%, 0); + -webkit-transform: translate(-50%, 0); background-color: $accent; } } diff --git a/modules/components/src/components/knob/knob.component.ts b/modules/components/src/components/knob/knob.component.ts index 392d301..bf41b05 100644 --- a/modules/components/src/components/knob/knob.component.ts +++ b/modules/components/src/components/knob/knob.component.ts @@ -180,15 +180,21 @@ export class KnobComponent implements OnInit { largeCapMaxAngle = 135 get largeCapClipPathStyle () { + const transform = `rotate(${this.utils.mapValue(this.value, this.min, this.max, -this.largeCapMaxAngle, this.largeCapMaxAngle)}deg)` + const transformOrigin = '50% 50%' return { - transform: `rotate(${this.utils.mapValue(this.value, this.min, this.max, -this.largeCapMaxAngle, this.largeCapMaxAngle)}deg)`, - 'transform-origin': '50% 50%' + transform, + '-webkit-transform': transform, + 'transform-origin': transformOrigin, + '-webkit-transform-origin': transformOrigin } } get largeCapIndicatorStyle () { + const transform = `translate(-50%, -50%) rotate(${this.utils.mapValue(this.value, this.min, this.max, -this.largeCapMaxAngle, this.largeCapMaxAngle)}deg)` return { - transform: `translate(-50%, -50%) rotate(${this.utils.mapValue(this.value, this.min, this.max, -this.largeCapMaxAngle, this.largeCapMaxAngle)}deg)` + transform, + '-webkit-transform': transform } } @@ -201,15 +207,19 @@ export class KnobComponent implements OnInit { mediumCapMaxAngle = 135 get mediumCapIndicatorStyle () { + const transform = `translate(-50%, -50%) rotate(${this.utils.mapValue(this.value, this.min, this.max, -this.mediumCapMaxAngle, this.mediumCapMaxAngle)}deg)` return { - transform: `translate(-50%, -50%) rotate(${this.utils.mapValue(this.value, this.min, this.max, -this.mediumCapMaxAngle, this.mediumCapMaxAngle)}deg)` + transform, + '-webkit-transform': transform } } smallCapMaxAngle = 135 get smallCapIndicatorStyle () { + const transform = `translate(-50%, -50%) rotate(${this.utils.mapValue(this.value, this.min, this.max, -this.smallCapMaxAngle, this.smallCapMaxAngle)}deg)` return { - transform: `translate(-50%, -50%) rotate(${this.utils.mapValue(this.value, this.min, this.max, -this.smallCapMaxAngle, this.smallCapMaxAngle)}deg)` + transform, + '-webkit-transform': transform } } diff --git a/modules/components/src/components/label/label.component.scss b/modules/components/src/components/label/label.component.scss index 7769568..98ca0ae 100644 --- a/modules/components/src/components/label/label.component.scss +++ b/modules/components/src/components/label/label.component.scss @@ -6,7 +6,7 @@ flex-direction: column; align-items: center; justify-content: center; - + text-align: center; cursor: default; & * { cursor: default; diff --git a/modules/components/src/components/pro/pro.component.ts b/modules/components/src/components/pro/pro.component.ts index b394b00..d02d137 100644 --- a/modules/components/src/components/pro/pro.component.ts +++ b/modules/components/src/components/pro/pro.component.ts @@ -4,8 +4,8 @@ import { ColorsService } from '../../services/colors.service' @Component({ selector: 'eqm-pro', template: ` -
- Pro +
+ Pro
` }) @@ -14,11 +14,13 @@ export class ProComponent { @Input() backgroundColor = this.colors.dark @Input() fontSize = 14 constructor (public colors: ColorsService) {} - style: { [name: string]: any } = { - display: 'inline-block', - backgroundColor: this.backgroundColor, - color: this.color, - borderRadius: '4px', - padding: '2px 4px' + get style () { + return { + display: 'inline-block', + backgroundColor: this.backgroundColor, + color: this.color, + borderRadius: '4px', + padding: '2px 4px' + } } } \ No newline at end of file diff --git a/modules/components/src/directives/clicked-outside.directive.ts b/modules/components/src/directives/clicked-outside.directive.ts index abcfc5e..e123c94 100644 --- a/modules/components/src/directives/clicked-outside.directive.ts +++ b/modules/components/src/directives/clicked-outside.directive.ts @@ -2,7 +2,7 @@ import { Directive, EventEmitter, HostListener, Output } from '@angular/core' @Directive({ selector: '[clickedOutside]' }) export class ClickedOutsideDirective { - @Output() clickedOutside = new EventEmitter() + @Output() clickedOutside = new EventEmitter() private inside = false @HostListener('click') @@ -10,10 +10,10 @@ export class ClickedOutsideDirective { this.inside = true } - @HostListener('document:click') - outsideClick () { + @HostListener('document:click', [ '$event' ]) + outsideClick (event: MouseEvent) { if (!this.inside) { - this.clickedOutside.emit() + this.clickedOutside.emit(event) } this.inside = false } diff --git a/modules/components/src/index.ts b/modules/components/src/index.ts index badd737..d59e793 100644 --- a/modules/components/src/index.ts +++ b/modules/components/src/index.ts @@ -21,6 +21,7 @@ export * from './components/tooltip/tooltip-container.component' export * from './components/tooltip/tooltip.component' export * from './components/skeuomorph-slider/skeuomorph-slider.component' export * from './services/utilities.service' +export * from './services/colors.service' export * from './components/label/label.component' export * from './components/loading/loading.component' export * from './components/checkbox/checkbox.component' @@ -28,4 +29,4 @@ export * from './components/prompt/prompt.component' export * from './components/carousel/carousel.component' export * from './components/question/question.component' export * from './directives/clicked-outside.directive' -export * from './components/breadcrumbs/breadcrumbs.component' \ No newline at end of file +export * from './components/breadcrumbs/breadcrumbs.component' diff --git a/ui/src/index.html b/ui/src/index.html index 2a4be92..688de92 100644 --- a/ui/src/index.html +++ b/ui/src/index.html @@ -15,7 +15,7 @@ eqMac - +