mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 08:13:01 +00:00
revert to single "focused" prop
This commit is contained in:
parent
740eb574c6
commit
6ffc5f076c
2 changed files with 6 additions and 20 deletions
|
@ -14,11 +14,7 @@ import { Rectangle } from "./rectangles";
|
||||||
|
|
||||||
@Options({
|
@Options({
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
focused: {
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
highlighted: {
|
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
@ -26,19 +22,14 @@ import { Rectangle } from "./rectangles";
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
export default class Rect extends Vue {
|
export default class Rect extends Vue {
|
||||||
private selected!: boolean;
|
private focused!: boolean;
|
||||||
private highlighted!: boolean;
|
|
||||||
private rectangle!: Rectangle;
|
private rectangle!: Rectangle;
|
||||||
|
|
||||||
private get classes(): string {
|
private get classes(): string {
|
||||||
let result: string[] = [];
|
let result: string[] = [];
|
||||||
|
|
||||||
if (this.selected) {
|
if (this.focused) {
|
||||||
result.push("select");
|
result.push("focus");
|
||||||
}
|
|
||||||
|
|
||||||
if (this.highlighted) {
|
|
||||||
result.push("highlight");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.join(" ");
|
return result.join(" ");
|
||||||
|
@ -54,12 +45,7 @@ rect {
|
||||||
stroke-opacity: 0.9;
|
stroke-opacity: 0.9;
|
||||||
stroke-width: 1;
|
stroke-width: 1;
|
||||||
|
|
||||||
&.select {
|
&.focus {
|
||||||
fill-opacity: 0.4;
|
|
||||||
stroke-opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.highlight {
|
|
||||||
fill: gold;
|
fill: gold;
|
||||||
stroke: yellow;
|
stroke: yellow;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
/>
|
/>
|
||||||
<Rect
|
<Rect
|
||||||
v-if="preview_visible"
|
v-if="preview_visible"
|
||||||
:highlighted="true"
|
:focused="true"
|
||||||
:rectangle="preview_rectangle"
|
:rectangle="preview_rectangle"
|
||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
Loading…
Reference in a new issue