2021-03-11 16:11:44 +02:00
|
|
|
import Select from '../select/select.vue'
|
2024-06-26 14:17:22 +03:00
|
|
|
import Checkbox from 'src/components/checkbox/checkbox.vue'
|
|
|
|
|
import Popover from 'src/components/popover/popover.vue'
|
|
|
|
|
|
|
|
|
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
2024-06-26 17:05:59 +03:00
|
|
|
import {
|
|
|
|
|
faExclamationTriangle,
|
|
|
|
|
faKeyboard,
|
|
|
|
|
faFont
|
|
|
|
|
} from '@fortawesome/free-solid-svg-icons'
|
2024-06-26 14:17:22 +03:00
|
|
|
|
|
|
|
|
library.add(
|
2024-06-26 17:05:59 +03:00
|
|
|
faExclamationTriangle,
|
|
|
|
|
faKeyboard,
|
|
|
|
|
faFont
|
2024-06-26 14:17:22 +03:00
|
|
|
)
|
|
|
|
|
|
2018-12-11 00:56:15 +03:00
|
|
|
export default {
|
2021-03-11 16:11:44 +02:00
|
|
|
components: {
|
2024-06-26 14:17:22 +03:00
|
|
|
Select,
|
|
|
|
|
Checkbox,
|
|
|
|
|
Popover
|
2021-03-11 16:11:44 +02:00
|
|
|
},
|
2018-12-11 00:56:15 +03:00
|
|
|
props: [
|
2022-03-27 14:16:23 +03:00
|
|
|
'name', 'label', 'modelValue', 'fallback', 'options', 'no-inherit'
|
2018-12-11 00:56:15 +03:00
|
|
|
],
|
2024-06-27 00:34:25 +03:00
|
|
|
mounted () {
|
|
|
|
|
this.$store.dispatch('queryLocalFonts')
|
|
|
|
|
},
|
2022-03-27 14:16:23 +03:00
|
|
|
emits: ['update:modelValue'],
|
2018-12-11 00:56:15 +03:00
|
|
|
data () {
|
|
|
|
|
return {
|
2024-06-27 00:59:24 +03:00
|
|
|
manualEntry: false,
|
2018-12-11 00:56:15 +03:00
|
|
|
availableOptions: [
|
|
|
|
|
this.noInherit ? '' : 'inherit',
|
|
|
|
|
'serif',
|
2024-06-26 17:05:59 +03:00
|
|
|
'sans-serif',
|
2018-12-11 00:56:15 +03:00
|
|
|
'monospace',
|
2024-06-26 17:05:59 +03:00
|
|
|
...(this.options || [])
|
2018-12-11 00:56:15 +03:00
|
|
|
].filter(_ => _)
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-06-26 17:05:59 +03:00
|
|
|
methods: {
|
|
|
|
|
toggleManualEntry () {
|
|
|
|
|
this.manualEntry = !this.manualEntry
|
|
|
|
|
}
|
2018-12-11 00:56:15 +03:00
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
present () {
|
2024-06-27 00:34:25 +03:00
|
|
|
return typeof this.modelValue !== 'undefined'
|
2024-06-26 14:17:22 +03:00
|
|
|
},
|
2024-06-27 00:34:25 +03:00
|
|
|
localFontsList () {
|
2024-07-21 23:45:21 +03:00
|
|
|
return this.$store.state.interface.localFonts
|
2018-12-11 00:56:15 +03:00
|
|
|
},
|
2024-06-27 00:34:25 +03:00
|
|
|
localFontsSize () {
|
2024-07-21 23:45:21 +03:00
|
|
|
return this.$store.state.interface.localFonts?.length
|
2018-12-11 00:56:15 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|