advent22/ui/src/components/calendar/SVGRect.vue

72 lines
1.1 KiB
Vue
Raw Normal View History

2023-01-17 18:25:56 +00:00
<template>
2023-09-07 01:17:14 +00:00
<rect
:class="variant !== undefined ? variant : ''"
2023-09-07 01:17:14 +00:00
:x="rectangle.left"
:y="rectangle.top"
:width="rectangle.width"
:height="rectangle.height"
/>
2023-01-17 18:25:56 +00:00
</template>
<script lang="ts">
2023-09-07 02:08:56 +00:00
import { Rectangle } from "@/lib/rectangle";
2023-09-06 16:25:35 +00:00
import { Options, Vue } from "vue-class-component";
2023-01-17 18:25:56 +00:00
type RectColor = "primary" | "link" | "info" | "success" | "warning" | "danger";
2023-09-20 16:16:45 +00:00
2023-01-17 18:25:56 +00:00
@Options({
props: {
variant: {
2023-09-20 16:16:45 +00:00
type: String,
required: false,
2023-01-17 18:25:56 +00:00
},
rectangle: Rectangle,
},
})
2023-01-24 23:19:25 +00:00
export default class extends Vue {
public variant?: RectColor;
2023-09-06 16:25:35 +00:00
public rectangle!: Rectangle;
2023-01-17 18:25:56 +00:00
}
</script>
<style lang="scss" scoped>
@import "@/bulma-vars";
2023-01-17 18:25:56 +00:00
rect {
2023-09-20 16:16:45 +00:00
fill: transparent;
fill-opacity: 0.3;
stroke-opacity: 0.9;
stroke-width: 1;
2023-09-20 16:16:45 +00:00
&.primary {
fill: $primary;
stroke: $primary;
}
2023-09-20 16:16:45 +00:00
&.link {
fill: $link;
stroke: $link;
}
&.info {
fill: $info;
stroke: $info;
}
&.success {
fill: $success;
stroke: $success;
}
&.warning {
fill: $warning;
stroke: $warning;
}
2023-01-17 18:25:56 +00:00
&.danger {
fill: $danger;
stroke: $danger;
2023-01-17 18:25:56 +00:00
}
}
2023-09-07 01:17:14 +00:00
</style>