Move shared styles and attributes from keyboard-key's children to keyboard-key.
This commit is contained in:
@@ -32,7 +32,11 @@ enum LabelTypes {
|
|||||||
[attr.height]="height" [attr.width]="width"
|
[attr.height]="height" [attr.width]="width"
|
||||||
[attr.fill]="fill"
|
[attr.fill]="fill"
|
||||||
/>
|
/>
|
||||||
<svg:g [ngSwitch]="labelType">
|
<svg:g [ngSwitch]="labelType"
|
||||||
|
[attr.font-size]="19"
|
||||||
|
[attr.font-family]="'Helvetica'"
|
||||||
|
[attr.fill]="'white'"
|
||||||
|
style="dominant-baseline: central">
|
||||||
<svg:g svg-one-line-text-key *ngSwitchWhen="enumLabelTypes.OneLineText"
|
<svg:g svg-one-line-text-key *ngSwitchWhen="enumLabelTypes.OneLineText"
|
||||||
[height]="height"
|
[height]="height"
|
||||||
[width]="width"
|
[width]="width"
|
||||||
|
|||||||
@@ -8,11 +8,7 @@ import { Component, OnInit, Input } from '@angular/core';
|
|||||||
<svg:text
|
<svg:text
|
||||||
[attr.x]="0"
|
[attr.x]="0"
|
||||||
[attr.y]="height / 2"
|
[attr.y]="height / 2"
|
||||||
[attr.text-anchor]="'middle'"
|
[attr.text-anchor]="'middle'">
|
||||||
[attr.font-size]="19"
|
|
||||||
[attr.font-family]="'Helvetica'"
|
|
||||||
[attr.fill]="'#ffffff'"
|
|
||||||
style="dominant-baseline: central">
|
|
||||||
<tspan
|
<tspan
|
||||||
[attr.x]="width / 2"
|
[attr.x]="width / 2"
|
||||||
dy="0"
|
dy="0"
|
||||||
|
|||||||
@@ -7,8 +7,7 @@ import { Component, OnInit, Input } from '@angular/core';
|
|||||||
`
|
`
|
||||||
<svg:use [attr.xlink:href]="icon"
|
<svg:use [attr.xlink:href]="icon"
|
||||||
[attr.width]="width / 3" [attr.height]="height / 3"
|
[attr.width]="width / 3" [attr.height]="height / 3"
|
||||||
[attr.x]="width / 3" [attr.y]="height / 3"
|
[attr.x]="width / 3" [attr.y]="height / 3">
|
||||||
fill="white">
|
|
||||||
</svg:use>
|
</svg:use>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -11,17 +11,12 @@ import {MapperService} from '../../services/mapper.service';
|
|||||||
[attr.width]="width / 4"
|
[attr.width]="width / 4"
|
||||||
[attr.height]="height / 4"
|
[attr.height]="height / 4"
|
||||||
[attr.x]="width * 3 / 8"
|
[attr.x]="width * 3 / 8"
|
||||||
[attr.y]="height / 5"
|
[attr.y]="height / 5">
|
||||||
fill="white">
|
|
||||||
</svg:use>
|
</svg:use>
|
||||||
<svg:text
|
<svg:text
|
||||||
[attr.x]="0"
|
[attr.x]="0"
|
||||||
[attr.y]="height * 2 / 3"
|
[attr.y]="height * 2 / 3"
|
||||||
[attr.text-anchor]="'middle'"
|
[attr.text-anchor]="'middle'">
|
||||||
[attr.font-size]="19"
|
|
||||||
[attr.font-family]="'Helvetica'"
|
|
||||||
[attr.fill]="'#ffffff'"
|
|
||||||
style="dominant-baseline: central">
|
|
||||||
<tspan [attr.x]="width / 2">{{ abbreviation }}</tspan>
|
<tspan [attr.x]="width / 2">{{ abbreviation }}</tspan>
|
||||||
</svg:text>
|
</svg:text>
|
||||||
`
|
`
|
||||||
|
|||||||
@@ -8,19 +8,14 @@ import { Component, OnInit, Input } from '@angular/core';
|
|||||||
<svg:text
|
<svg:text
|
||||||
[attr.x]="0"
|
[attr.x]="0"
|
||||||
[attr.y]="width > 2*height? height / 2 : height / 3"
|
[attr.y]="width > 2*height? height / 2 : height / 3"
|
||||||
[attr.text-anchor]="width > 2*height ? 'end' : 'middle'"
|
[attr.text-anchor]="width > 2*height ? 'end' : 'middle'">
|
||||||
[attr.font-size]="19"
|
|
||||||
[attr.font-family]="'Helvetica'"
|
|
||||||
[attr.fill]="'#ffffff'"
|
|
||||||
style="dominant-baseline: central">
|
|
||||||
<tspan [attr.x]="width > 2*height ?0.6*width : width / 2">{{ text }}</tspan>
|
<tspan [attr.x]="width > 2*height ?0.6*width : width / 2">{{ text }}</tspan>
|
||||||
</svg:text>
|
</svg:text>
|
||||||
<svg:use [attr.xlink:href]="icon"
|
<svg:use [attr.xlink:href]="icon"
|
||||||
[attr.width]="width / 3"
|
[attr.width]="width / 3"
|
||||||
[attr.height]="height / 3"
|
[attr.height]="height / 3"
|
||||||
[attr.x]="width > 2*height ? width * 0.6 : width / 3"
|
[attr.x]="width > 2*height ? width * 0.6 : width / 3"
|
||||||
[attr.y]="width > 2*height ? height / 3 : height / 2"
|
[attr.y]="width > 2*height ? height / 3 : height / 2">
|
||||||
fill="white">
|
|
||||||
</svg:use>
|
</svg:use>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -8,11 +8,7 @@ import { Component, OnInit, Input } from '@angular/core';
|
|||||||
<svg:text
|
<svg:text
|
||||||
[attr.x]="0"
|
[attr.x]="0"
|
||||||
[attr.y]="height/2"
|
[attr.y]="height/2"
|
||||||
[attr.text-anchor]="'middle'"
|
[attr.text-anchor]="'middle'">
|
||||||
[attr.font-size]="19"
|
|
||||||
[attr.font-family]="'Helvetica'"
|
|
||||||
[attr.fill]="'#ffffff'"
|
|
||||||
style="dominant-baseline: central">
|
|
||||||
<tspan
|
<tspan
|
||||||
*ngFor="let text of texts; let index = index"
|
*ngFor="let text of texts; let index = index"
|
||||||
[attr.x]="width / 2"
|
[attr.x]="width / 2"
|
||||||
|
|||||||
Reference in New Issue
Block a user