diff --git a/src/components/register.ts b/src/components/register.ts index 722060aac7..f6fd02d59f 100644 --- a/src/components/register.ts +++ b/src/components/register.ts @@ -33,6 +33,7 @@ import VProgressCircular from './v-progress/circular/'; import VRadio from './v-radio/'; import VSelect from './v-select/'; import VSheet from './v-sheet/'; +import VSkeletonLoader from './v-skeleton-loader/'; import VSlider from './v-slider/'; import VSwitch from './v-switch/'; import VTable from './v-table/'; @@ -75,6 +76,7 @@ Vue.component('v-progress-circular', VProgressCircular); Vue.component('v-radio', VRadio); Vue.component('v-select', VSelect); Vue.component('v-sheet', VSheet); +Vue.component('v-skeleton-loader', VSkeletonLoader); Vue.component('v-slider', VSlider); Vue.component('v-switch', VSwitch); Vue.component('v-table', VTable); diff --git a/src/components/v-form/readme.md b/src/components/v-form/readme.md index 7412051256..032d5089a5 100644 --- a/src/components/v-form/readme.md +++ b/src/components/v-form/readme.md @@ -13,12 +13,13 @@ Renders a form using interfaces based on the passed collection name. ``` ## Props -| Prop | Description | Default | -|-----------------|-------------------------------------------------------------------------------|---------| -| `collection` | The collection of which you want to render the fields | -- | -| `fields` | Array of fields to render. This can be used instead of the collection prop | -- | -| `initialValues` | Object of the starting values of the fields | -- | -| `edits` | The edits that were made after the form was rendered. Being used in `v-model` | -- | +| Prop | Description | Default | +|-----------------|-------------------------------------------------------------------------------------------------------------------------|---------| +| `collection` | The collection of which you want to render the fields | -- | +| `fields` | Array of fields to render. This can be used instead of the collection prop | -- | +| `initialValues` | Object of the starting values of the fields | -- | +| `edits` | The edits that were made after the form was rendered. Being used in `v-model` | -- | +| `loading` | Display the form in a loading state. Prevents the ctx menus from being used and renders skeleton loaders for the fields | `false` | **Note**: You have to pass either the collection or fields prop. diff --git a/src/components/v-form/v-form.story.ts b/src/components/v-form/v-form.story.ts index 411c20191e..afff48025d 100644 --- a/src/components/v-form/v-form.story.ts +++ b/src/components/v-form/v-form.story.ts @@ -6,6 +6,7 @@ import { defineComponent, ref } from '@vue/composition-api'; import { useFieldsStore } from '@/stores/fields'; import { FormField } from './types'; import { i18n } from '@/lang'; +import { withKnobs, boolean } from '@storybook/addon-knobs'; Vue.component('v-form', VForm); @@ -14,7 +15,7 @@ export default { parameters: { notes: markdown, }, - decorators: [withPadding], + decorators: [withPadding, withKnobs], }; export const collection = () => @@ -67,6 +68,11 @@ export const collection = () => export const fields = () => defineComponent({ i18n, + props: { + loading: { + default: boolean('Loading', false), + }, + }, setup() { const fields: FormField[] = [ { @@ -105,6 +111,7 @@ export const fields = () => template: `
- +