2020-11-20 15:17:41 +01:00
|
|
|
<template>
|
2021-07-26 15:27:23 +02:00
|
|
|
<svg class="ui-icon" :width="size" :height="size" :stroke-width="stroke" :data-symbol="symbolName" :class="classes">
|
2021-03-16 13:57:52 +01:00
|
|
|
<use v-show="!isFlag" v-bind="{ 'xlink:href': href }" />
|
2021-01-17 16:29:05 +01:00
|
|
|
</svg>
|
2020-11-20 15:17:41 +01:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
2021-12-07 01:11:18 +01:00
|
|
|
<script lang="ts">
|
2020-11-20 15:17:41 +01:00
|
|
|
export default {
|
|
|
|
|
props: {
|
2021-01-17 16:29:05 +01:00
|
|
|
symbol: {
|
2020-11-20 15:17:41 +01:00
|
|
|
type: String,
|
2021-02-04 14:00:09 +01:00
|
|
|
default: null,
|
|
|
|
|
required: true
|
2021-01-17 16:29:05 +01:00
|
|
|
},
|
2021-03-16 13:57:52 +01:00
|
|
|
file: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: null
|
|
|
|
|
},
|
2021-01-17 16:29:05 +01:00
|
|
|
size: {
|
|
|
|
|
type: Number,
|
|
|
|
|
default: 17
|
|
|
|
|
},
|
2021-02-05 13:00:42 +01:00
|
|
|
stroke: {
|
2021-01-17 16:29:05 +01:00
|
|
|
type: Number,
|
|
|
|
|
default: 2
|
2020-11-20 15:17:41 +01:00
|
|
|
}
|
2021-01-20 15:54:12 +01:00
|
|
|
},
|
|
|
|
|
|
2021-03-16 13:57:52 +01:00
|
|
|
|
2021-01-20 15:54:12 +01:00
|
|
|
computed: {
|
2021-07-26 15:27:23 +02:00
|
|
|
|
|
|
|
|
symbolName()
|
|
|
|
|
{
|
2022-01-04 17:56:34 +01:00
|
|
|
return this.symbol && this.symbol.split(' ')[0].trim();
|
2021-07-26 15:27:23 +02:00
|
|
|
},
|
|
|
|
|
classes()
|
|
|
|
|
{
|
|
|
|
|
return this.symbol ? this.symbol.split(' ').slice(1) : [];
|
|
|
|
|
},
|
2021-01-20 15:54:12 +01:00
|
|
|
isFlag()
|
|
|
|
|
{
|
|
|
|
|
return this.symbol && this.symbol.indexOf('flag') === 0;
|
2021-03-16 13:57:52 +01:00
|
|
|
},
|
|
|
|
|
href()
|
|
|
|
|
{
|
2022-01-04 17:56:34 +01:00
|
|
|
return (this.file || '') + '#' + this.symbolName;
|
2021-01-20 15:54:12 +01:00
|
|
|
}
|
2020-11-20 15:17:41 +01:00
|
|
|
}
|
|
|
|
|
}
|
2021-01-17 16:29:05 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
.ui-icon
|
|
|
|
|
{
|
|
|
|
|
stroke: currentColor;
|
|
|
|
|
stroke-linecap: round;
|
|
|
|
|
stroke-linejoin: round;
|
2021-08-25 10:38:13 +02:00
|
|
|
//fill: var(--color-bg-shade-3);
|
2021-01-17 16:29:05 +01:00
|
|
|
fill: none;
|
|
|
|
|
}
|
2021-02-05 13:00:42 +01:00
|
|
|
|
|
|
|
|
.ui-icon[data-symbol="fth-waffle"]
|
|
|
|
|
{
|
|
|
|
|
stroke: none;
|
|
|
|
|
fill: currentColor;
|
|
|
|
|
}
|
2021-01-17 16:29:05 +01:00
|
|
|
</style>
|