8000 docs(BCollapse): Parity pass by dwgray · Pull Request #2237 · bootstrap-vue-next/bootstrap-vue-next · GitHub
[go: up one dir, main page]

Skip to content

docs(BCollapse): Parity pass #2237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 76 additions & 33 deletions apps/docs/src/data/components/collapse.data.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
import type {BvnComponentProps} from 'bootstrap-vue-next'
import type {ComponentReference, PropertyReference} from '../../types'
import type {ComponentReference, PropertyReference, SlotScopeReference} from '../../types'
import {buildCommonProps, pick} from '../../utils'

const sharedSlots: SlotScopeReference[] = [
{
prop: 'hide',
type: '() => void',
description: "Hides the collapse and fires the 'hide' event",
},
{
prop: 'id',
type: 'string',
description: 'The id of the collapse element',
},
{
prop: 'show',
type: '() => void',
description: "Shows the collapse and fires the 'show' event",
},
{
prop: 'toggle',
type: '() => void',
description: "Toggles the collapse and fires the 'hide' or 'show' event, as appropriate",
},
{
prop: 'visible',
type: '() => void',
description: 'Visible state of the collapse. `true` if the collapse is visible',
},
]

export default {
load: (): ComponentReference[] => [
Expand All @@ -12,94 +41,108 @@ export default {
type: 'boolean',
default: false,
},
id: {
type: 'string',
default: undefined,
},
isNav: {
type: 'boolean',
default: false,
description:
'When set, signifies that the collapse is part of a navbar, enabling certain features for navbar support',
},
modelValue: {
type: 'boolean',
default: false,
description: 'Controls the visibility of the collapse',
},
skipAnimation: {
type: 'boolean',
default: false,
},
tag: {
type: 'string',
default: 'div',
description: 'When set, disables the animation',
},
toggle: {
type: 'boolean',
default: false,
description:
"When set, and prop 'visible' is false on mount, will animate from closed to open on initial mount",
},
visible: {
type: 'boolean',
default: false,
description: "When 'true', expands the collapse",
},
...pick(buildCommonProps(), ['id', 'tag']),
} satisfies Record<keyof BvnComponentProps['BCollapse'], PropertyReference>,
},
emits: [
{
event: 'update:model-value',
description: 'Used to update the v-model',
args: [
{
arg: 'update:model-value',
description: '',
arg: 'value',
type: 'boolean',
description: 'Will be true if the collapse is visible',
},
],
description: '',
event: 'update:model-value',
},
{
args: [],
description: '',
event: 'show',
event: 'hide',
description: 'Emitted when collapse has started to close',
args: [
{
arg: 'value',
type: 'BvTriggerableEvent',
description: 'The event object',
},
],
},
{
event: 'hidden',
description: 'Emitted when collapse has finished closing',
args: [],
description: '',
event: 'shown',
},
{
event: 'hide-prevented',
description: 'Emitted when the Collapse tried to close, but was prevented from doing so.',
args: [],
description: '',
event: 'show-prevented',
},
{
event: 'show',
description: 'Emitted when collapse has started to open',
args: [],
description: '',
event: 'hide',
},
{
args: [],
description: '',
event: 'hidden',
event: 'shown',
description: 'Emitted when collapse has finished opening',
args: [
{
arg: 'value',
type: 'BvTriggerableEvent',
description: 'The event object',
},
],
},
{
event: 'show-prevented',
description: 'Emitted when the Collapse tried to open, but was prevented from doing so.',
args: [],
description: '',
event: 'hide-prevented',
},
],
slots: [
{
description: '',
name: 'default',
scope: [],
description: 'The content shown and hidden by the collapse',
scope: sharedSlots,
},
{
description: '',
name: 'footer',
scope: [],
description:
'Used to create custom toggles for your collapsible content. Placed directly below the content',
scope: sharedSlots,
},
{
description: '',
name: 'header',
scope: [],
description:
'Used to create custom toggles for your collapsible content. Placed directly above the content',
scope: sharedSlots,
},
],
},
Expand Down
Loading
Loading
0