2026-01-08 17:26:52 +02:00
|
|
|
import Checkbox from 'src/components/checkbox/checkbox.vue'
|
|
|
|
|
import Popover from 'src/components/popover/popover.vue'
|
|
|
|
|
import { useInterfaceStore } from 'src/stores/interface'
|
|
|
|
|
import Select from '../select/select.vue'
|
|
|
|
|
|
2024-06-26 14:17:22 +03:00
|
|
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
2024-06-26 17:05:59 +03:00
|
|
|
import {
|
|
|
|
|
faExclamationTriangle,
|
2026-01-06 16:22:52 +02:00
|
|
|
faFont,
|
2026-01-06 16:23:17 +02:00
|
|
|
faKeyboard,
|
2024-06-26 17:05:59 +03:00
|
|
|
} from '@fortawesome/free-solid-svg-icons'
|
2024-06-26 14:17:22 +03:00
|
|
|
|
2026-01-06 16:22:52 +02:00
|
|
|
library.add(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,
|
2026-01-06 16:22:52 +02:00
|
|
|
Popover,
|
2021-03-11 16:11:44 +02:00
|
|
|
},
|
2026-01-06 16:22:52 +02:00
|
|
|
props: ['name', 'label', 'modelValue', 'fallback', 'options', 'no-inherit'],
|
|
|
|
|
mounted() {
|
2025-02-03 00:14:44 +02:00
|
|
|
useInterfaceStore().queryLocalFonts()
|
2024-06-27 00:34:25 +03:00
|
|
|
},
|
2022-03-27 14:16:23 +03:00
|
|
|
emits: ['update:modelValue'],
|
2026-01-06 16:22:52 +02:00
|
|
|
data() {
|
2018-12-11 00:56:15 +03:00
|
|
|
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',
|
2026-01-06 16:22:52 +02:00
|
|
|
...(this.options || []),
|
|
|
|
|
].filter((_) => _),
|
2018-12-11 00:56:15 +03:00
|
|
|
}
|
|
|
|
|
},
|
2024-06-26 17:05:59 +03:00
|
|
|
methods: {
|
2026-01-06 16:22:52 +02:00
|
|
|
toggleManualEntry() {
|
2024-06-26 17:05:59 +03:00
|
|
|
this.manualEntry = !this.manualEntry
|
2026-01-06 16:22:52 +02:00
|
|
|
},
|
2018-12-11 00:56:15 +03:00
|
|
|
},
|
|
|
|
|
computed: {
|
2026-01-06 16:22:52 +02:00
|
|
|
present() {
|
2024-06-27 00:34:25 +03:00
|
|
|
return typeof this.modelValue !== 'undefined'
|
2024-06-26 14:17:22 +03:00
|
|
|
},
|
2026-01-06 16:22:52 +02:00
|
|
|
localFontsList() {
|
2025-01-30 21:56:07 +02:00
|
|
|
return useInterfaceStore().localFonts
|
2018-12-11 00:56:15 +03:00
|
|
|
},
|
2026-01-06 16:22:52 +02:00
|
|
|
localFontsSize() {
|
2025-01-30 21:56:07 +02:00
|
|
|
return useInterfaceStore().localFonts?.length
|
2026-01-06 16:22:52 +02:00
|
|
|
},
|
|
|
|
|
},
|
2018-12-11 00:56:15 +03:00
|
|
|
}
|