|
1 | 1 | <template> |
2 | 2 | <v-row> |
3 | 3 | <v-col |
4 | | - id="components-props" |
| 4 | + id="components" |
5 | 5 | cols="12" |
6 | 6 | > |
7 | 7 | <h2 :class="classes.h2"> |
8 | 8 | <a |
9 | 9 | :class="classes.headerA" |
10 | | - href="#props" |
| 10 | + href="#components" |
11 | 11 | >#</a> |
12 | 12 | Components |
13 | 13 | </h2> |
| 14 | + </v-col> |
| 15 | + |
| 16 | + <v-col cols="12"> |
| 17 | + Many of the Vuetify Components are built into the form. The following components are available: |
| 18 | + </v-col> |
14 | 19 |
|
15 | | - <div> |
16 | | - If you have multiple components you can use this section. |
17 | | - </div> |
| 20 | + <v-col cols="12"> |
| 21 | + <template |
| 22 | + v-for="component in componentList" |
| 23 | + :key="component.title" |
| 24 | + > |
| 25 | + <code class="ic mr-2">{{ component.title }}</code> |
| 26 | + </template> |
| 27 | + </v-col> |
| 28 | + |
| 29 | + <v-col |
| 30 | + id="components-additional" |
| 31 | + cols="12" |
| 32 | + > |
| 33 | + <h4 :class="classes.h4"> |
| 34 | + <a |
| 35 | + :class="classes.headerA" |
| 36 | + href="#components-additionalops-pages" |
| 37 | + >#</a> |
| 38 | + Additional Fields |
| 39 | + </h4> |
| 40 | + </v-col> |
| 41 | + |
| 42 | + <v-col cols="12"> |
| 43 | + My <code class="ic">VColorField</code> component is also available for use via the <a |
| 44 | + :href="links.vColorField">@wdns/vuetify-color-field</a> package. |
| 45 | + </v-col> |
| 46 | + |
| 47 | + <v-col |
| 48 | + id="components-buttons-field" |
| 49 | + cols="12" |
| 50 | + > |
| 51 | + <h3 :class="classes.h3"> |
| 52 | + <a |
| 53 | + :class="classes.headerA" |
| 54 | + href="#components-buttons-field" |
| 55 | + >#</a> |
| 56 | + Buttons Field |
| 57 | + </h3> |
18 | 58 | </v-col> |
| 59 | + |
| 60 | + <v-col cols="12"> |
| 61 | + The <code class="ic">buttons</code> field is a custom component integrated into this form, utilizing the <code |
| 62 | + class="ic" |
| 63 | + >VBtn</code> component to easily display booleans, text, icons, or any other content where a button-style |
| 64 | + interface is preferred over traditional checkboxes, radio buttons, or switches. |
| 65 | + </v-col> |
| 66 | + |
| 67 | + <v-col cols="12"> |
| 68 | + This component supports most of the <code class="ic">VBtn</code> props, which can be added directly to the Field |
| 69 | + object. Additionally, some props are accessible within the option object. |
| 70 | + </v-col> |
| 71 | + |
| 72 | + <v-col cols="12"> |
| 73 | + <VCodeBlock |
| 74 | + :code="buttonsFieldType" |
| 75 | + :highlightjs="codeBlockSettings.plugin === 'highlightjs'" |
| 76 | + lang="typescript" |
| 77 | + :prismjs="codeBlockSettings.plugin === 'prismjs'" |
| 78 | + :theme="codeBlockSettings.theme" |
| 79 | + > |
| 80 | + <template #label> |
| 81 | + <div v-html="buttonFieldTypesLabel" /> |
| 82 | + </template> |
| 83 | + </VCodeBlock> |
| 84 | + </v-col> |
| 85 | + |
| 86 | + <v-col cols="12"> |
| 87 | + <VCodeBlock |
| 88 | + :code="buttonsFieldOptions" |
| 89 | + :highlightjs="codeBlockSettings.plugin === 'highlightjs'" |
| 90 | + label="Option Types" |
| 91 | + lang="typescript" |
| 92 | + :prismjs="codeBlockSettings.plugin === 'prismjs'" |
| 93 | + :theme="codeBlockSettings.theme" |
| 94 | + /> |
| 95 | + </v-col> |
| 96 | + |
| 97 | + <v-col cols="12"> |
| 98 | + An example of its usage can be found in the <a href="#examples-buttons-field">Buttons Field</a> example within the |
| 99 | + Examples section below. |
| 100 | + </v-col> |
| 101 | + |
| 102 | + <!-- <v-col |
| 103 | + id="components-field-label" |
| 104 | + cols="12" |
| 105 | + > |
| 106 | + <h3 :class="classes.h3"> |
| 107 | + <a |
| 108 | + :class="classes.headerA" |
| 109 | + href="#components-field-label" |
| 110 | + >#</a> |
| 111 | + Field Label |
| 112 | + </h3> |
| 113 | + </v-col> --> |
19 | 114 | </v-row> |
20 | 115 | </template> |
21 | 116 |
|
22 | 117 | <script setup lang="ts"> |
| 118 | +const codeBlockSettings = inject<Docs.CodeBlockSettings>('codeBlockSettings')!; |
23 | 119 | const classes = inject<Docs.GlobalClasses>('classes')!; |
| 120 | +const links = inject<Docs.Links>('links')!; |
| 121 | +
|
| 122 | +const componentList = [ |
| 123 | + { |
| 124 | + subTitle: '', |
| 125 | + title: 'VAutocomplete', |
| 126 | + }, |
| 127 | + { |
| 128 | + subTitle: '', |
| 129 | + title: 'VCheckbox', |
| 130 | + }, |
| 131 | + { |
| 132 | + subTitle: '', |
| 133 | + title: 'VCombobox', |
| 134 | + }, |
| 135 | + // { |
| 136 | + // subTitle: '', |
| 137 | + // title: 'VDatePicker', |
| 138 | + // }, |
| 139 | + { |
| 140 | + subTitle: '', |
| 141 | + title: 'VFileInput', |
| 142 | + }, |
| 143 | + { |
| 144 | + subTitle: '', |
| 145 | + title: 'VRadio', |
| 146 | + }, |
| 147 | + { |
| 148 | + subTitle: '', |
| 149 | + title: 'VSelect', |
| 150 | + }, |
| 151 | + { |
| 152 | + subTitle: '', |
| 153 | + title: 'VSwitch', |
| 154 | + }, |
| 155 | + { |
| 156 | + subTitle: '', |
| 157 | + title: 'VTextarea', |
| 158 | + }, |
| 159 | + { |
| 160 | + subTitle: '', |
| 161 | + title: 'VTextField', |
| 162 | + }, |
| 163 | +]; |
| 164 | +
|
| 165 | +const buttonFieldTypesLabel = 'Field Types. The Buttons Field also extends the <a href="#props-field-interface">Field Interface.</a>.'; |
| 166 | +const buttonsFieldType = `{ |
| 167 | + activeColor?: VBtn['activeColor']; |
| 168 | + align?: string; |
| 169 | + appendIcon?: VBtn['appendIcon']; |
| 170 | + block?: VBtn['block']; |
| 171 | + border?: VBtn['border']; |
| 172 | + gap?: string | number; |
| 173 | + height?: VBtn['height']; |
| 174 | + hint?: string; |
| 175 | + icon?: VBtn['icon']; |
| 176 | + justify?: string; |
| 177 | + messages?: string | string[]; |
| 178 | + minWidth?: VBtn['minWidth']; |
| 179 | + multiple?: boolean; |
| 180 | + options?: Option[]; |
| 181 | + persistentHint?: boolean; |
| 182 | + prependIcon?: VBtn['prependIcon']; |
| 183 | + selectedClass?: string; |
| 184 | + size?: VBtn['size']; |
| 185 | + stacked?: boolean; |
| 186 | + variant?: VBtn['variant']; |
| 187 | + width?: VBtn['width']; |
| 188 | +}`; |
| 189 | +
|
| 190 | +const buttonsFieldOptions = `interface Option { |
| 191 | + appendIcon?: VBtn['appendIcon']; |
| 192 | + class?: string; |
| 193 | + color?: VBtn['color']; |
| 194 | + icon?: VBtn['icon']; |
| 195 | + id?: Field['id']; |
| 196 | + label: Field['label']; |
| 197 | + prependIcon?: VBtn['prependIcon']; |
| 198 | + value: string | number; |
| 199 | +}`; |
24 | 200 | </script> |
25 | 201 |
|
26 | | -<style lang="scss" scoped></style> |
| 202 | +<style lang="scss" scoped> |
| 203 | +.component-list { |
| 204 | + > .v-list-item { |
| 205 | + grid-template-columns: min-content 1fr !important; |
| 206 | + } |
| 207 | +
|
| 208 | + :deep(.v-list-item__prepend) { |
| 209 | + align-items: flex-start; |
| 210 | + align-self: flex-start; |
| 211 | + font-size: .5em; |
| 212 | + padding-top: 5px; |
| 213 | + width: 22px; |
| 214 | + } |
| 215 | +} |
| 216 | +</style> |
0 commit comments