mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-11 02:48:21 +00:00
Added Heading component for Form Sections
This commit is contained in:
parent
55bdaf915c
commit
e5b7bfeacb
3 changed files with 18 additions and 0 deletions
15
client/src/components/display/Heading.vue
Normal file
15
client/src/components/display/Heading.vue
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
const props = withDefaults(defineProps<{
|
||||||
|
headingLevel?: number,
|
||||||
|
caption?: string,
|
||||||
|
}>(), {
|
||||||
|
headingLevel: 2,
|
||||||
|
caption: '',
|
||||||
|
});
|
||||||
|
const { headingLevel, caption } = $(props);
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<component :is="`h` + headingLevel">{{ caption }}</component>
|
||||||
|
</template>
|
|
@ -14,6 +14,7 @@ import MultilineTextBox from './components/inputs/MultilineTextBox.vue';
|
||||||
import CheckBox from './components/inputs/CheckBox.vue';
|
import CheckBox from './components/inputs/CheckBox.vue';
|
||||||
import SingleSelect from './components/inputs/SingleSelect.vue';
|
import SingleSelect from './components/inputs/SingleSelect.vue';
|
||||||
import MultiSelect from './components/inputs/MultiSelect.vue';
|
import MultiSelect from './components/inputs/MultiSelect.vue';
|
||||||
|
import Heading from './components/display/Heading.vue';
|
||||||
|
|
||||||
import { Form, Field, ErrorMessage } from 'vee-validate';
|
import { Form, Field, ErrorMessage } from 'vee-validate';
|
||||||
|
|
||||||
|
@ -47,6 +48,7 @@ app.component('ErrorMessage', ErrorMessage);
|
||||||
app.component('SingleSelect', SingleSelect);
|
app.component('SingleSelect', SingleSelect);
|
||||||
app.component('MultiSelect', MultiSelect);
|
app.component('MultiSelect', MultiSelect);
|
||||||
app.component('EnumInput', EnumInput);
|
app.component('EnumInput', EnumInput);
|
||||||
|
app.component('Heading', Heading);
|
||||||
|
|
||||||
|
|
||||||
app.mount('#app');
|
app.mount('#app');
|
||||||
|
|
|
@ -25,6 +25,7 @@ function genSP(indexIsChar: boolean): SearchProvider {
|
||||||
<NicerForm :fields="{
|
<NicerForm :fields="{
|
||||||
Single: { is: 'SingleSelect', label: 'SingleSelect', props: { options: testValues, searchProvider: genSP(true) } },
|
Single: { is: 'SingleSelect', label: 'SingleSelect', props: { options: testValues, searchProvider: genSP(true) } },
|
||||||
Multiple: { is: 'MultiSelect', label: 'Multiselect', props: { options: testValues, searchProvider: genSP(false) } },
|
Multiple: { is: 'MultiSelect', label: 'Multiselect', props: { options: testValues, searchProvider: genSP(false) } },
|
||||||
|
adv: { is: 'Heading', props: { caption: 'Subsection' } },
|
||||||
IP: { is: 'EnumInput', label: 'IP Address', props: { variants: {
|
IP: { is: 'EnumInput', label: 'IP Address', props: { variants: {
|
||||||
'dhcp': { display: 'DHCP' },
|
'dhcp': { display: 'DHCP' },
|
||||||
'static-ipv4': {
|
'static-ipv4': {
|
||||||
|
|
Loading…
Add table
Reference in a new issue