diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index f5c359f10..85fb695eb 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,4 +1,4 @@
{
- "packages/bootstrap-vue-next": "0.24.17",
- "packages/nuxt": "0.24.17"
+ "packages/bootstrap-vue-next": "0.24.23",
+ "packages/nuxt": "0.24.23"
}
diff --git a/apps/docs/src/components/ComponentReference.vue b/apps/docs/src/components/ComponentReference.vue
index 94e4fe11a..98853b768 100644
--- a/apps/docs/src/components/ComponentReference.vue
+++ b/apps/docs/src/components/ComponentReference.vue
@@ -77,14 +77,16 @@
Extensions:
+ 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[] => [
@@ -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,
},
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,
},
],
},
diff --git a/apps/docs/src/data/components/dropdown.data.ts b/apps/docs/src/data/components/dropdown.data.ts
index 20a592bde..d0df1cd7a 100644
--- a/apps/docs/src/data/components/dropdown.data.ts
+++ b/apps/docs/src/data/components/dropdown.data.ts
@@ -1,5 +1,7 @@
import type {BvnComponentProps} from 'bootstrap-vue-next'
import type {ComponentReference, PropertyReference} from '../../types'
+import {buildCommonProps, omit, pick} from '../../utils'
+import {linkProps, linkTo} from '../../utils/link-props'
export default {
load: (): ComponentReference[] => [
@@ -8,249 +10,322 @@ export default {
sourcePath: '/BDropdown/BDropdown.vue',
props: {
'': {
- ariaLabel: {
- type: 'string',
- default: undefined,
- },
autoClose: {
type: "boolean | 'inside' | 'outside'",
default: true,
+ description:
+ 'Controls the automatic closing of the dropdown when clicking. See above for details.',
},
boundary: {
type: 'Boundary | RootBoundary',
default: 'clippingAncestors',
+ description:
+ "The boundary constraint of dropdown: any value of floating-us's Boundary or RootBoundary type. See above for details.",
},
boundaryPadding: {
type: 'Padding',
default: undefined,
+ description: 'The virtual padding around the boundary to check for overflow',
},
center: {
type: 'boolean',
default: false,
- },
- disabled: {
- type: 'boolean',
- default: false,
+ description: 'Centers the dropdown on the button',
},
dropend: {
type: 'boolean',
default: false,
+ description:
+ 'When set, positions the menu to at the end (right for ltr reading) of the button',
},
dropstart: {
type: 'boolean',
default: false,
+ description:
+ 'When set, positions the menu to at the start (left for ltr reading) of the button.',
},
dropup: {
type: 'boolean',
default: false,
+ description: 'When set, positions the menu on the top of the button',
},
end: {
type: 'boolean',
default: false,
+ description:
+ 'Aligns the dropdown with the end (right for ltr reading) of the button. Default is start (left for ltr reading)',
},
floatingMiddleware: {
type: 'Middleware[]',
default: undefined,
- },
- id: {
- type: 'string',
- default: undefined,
+ description: 'Directly set the floating-ui middleware behavior. See above for details.',
},
isNav: {
type: 'boolean',
default: false,
+ description: 'Indicates the dropdown is a nav dropdown',
},
lazy: {
type: 'boolean',
default: false,
+ description:
+ 'When set, will only mount the dropdown content into the DOM when the dropdown is open',
},
menuClass: {
type: 'ClassValue',
default: undefined,
+ description: 'CSS class (or classes) to add to the menu container',
},
modelValue: {
type: 'boolean',
default: false,
+ description: 'Controls the visibility of the dropdown',
},
noCaret: {
type: 'boolean',
default: false,
+ description: 'Hide the caret indicator on the toggle button',
},
noFlip: {
type: 'boolean',
default: false,
+ description: 'Prevent the menu from auto flipping positions',
},
noShift: {
type: 'boolean',
default: false,
+ description: 'Prevent the menu from automatically shifting positions',
},
noSize: {
type: 'boolean',
default: false,
+ description: 'Prevent the menu from automatically resizing',
},
offset: {
type: 'number | string | {mainAxis?: number; crossAxis?: number; alignmentAxis?: number | null',
default: 0,
- },
- role: {
- type: 'string',
- default: 'menu',
- },
- size: {
- type: 'Size',
- default: 'md',
+ description:
+ 'Specify the number of pixels to shift the menu by. See above for details.',
},
skipWrapper: {
type: 'boolean',
default: false,
+ description: 'Do not render the dropdown wrapper element',
},
split: {
type: 'boolean',
default: false,
+ description: 'When set, renders a split button dropdown',
},
splitButtonType: {
type: 'ButtonType',
default: 'button',
+ description:
+ "Value to place in the 'type' attribute on the split button: 'button', 'submit', 'reset'",
},
splitClass: {
type: 'ClassValue',
default: undefined,
+ description: 'CSS class (or classes) to add to the split button',
},
splitDisabled: {
type: 'boolean',
default: undefined,
+ description: 'When set, the split button is disabled',
},
splitHref: {
type: 'string',
default: undefined,
+ description: 'Denotes the target URL of the link for the split button',
},
splitTo: {
type: 'RouteLocationRaw',
default: undefined,
+ description:
+ 'Denotes the target route of the split button. When clicked, the value of the to prop will be passed to router.push() internally, so the value can be either a string or a Location descriptor object',
},
splitVariant: {
type: 'ButtonVariant | null',
default: undefined,
+ description:
+ "Applies one of the Bootstrap theme color variants to the split button. Defaults to the 'variant' prop value",
},
strategy: {
type: 'Strategy',
default: 'absolute',
+ description:
+ 'The strategy used to determine when to hide the dropdown. See above for details.',
},
text: {
type: 'string',
default: undefined,
+ description: 'Text to place in the toggle button, or in the split button is split mode',
},
toggleClass: {
type: 'ClassValue',
default: undefined,
+ description: 'CSS class (or classes) to add to the toggle button',
},
toggleText: {
type: 'string',
default: 'Toggle dropdown',
- },
- variant: {
- type: 'ButtonVariant | null',
- default: 'secondary',
+ description:
+ 'ARIA label (sr-only) to set on the toggle when in split mode. Overriden by the slot of the same name',
},
wrapperClass: {
type: 'ClassValue',
default: undefined,
},
- teleportDisabled: {},
- teleportTo: {},
+ teleportDisabled: {
+ type: 'boolean',
+ default: false,
+ description: 'Renders the dropdown in the exact place it was defined',
+ },
+ teleportTo: {
+ type: 'string | RendererElement | null | undefined',
+ default: undefined,
+ description: 'Overrides the default teleport location',
+ },
+ ...pick(
+ buildCommonProps({
+ role: {
+ default: 'menu',
+ },
+ variant: {
+ default: 'secondary',
+ },
+ }),
+ ['ariaLabel', 'disabled', 'id', 'role', 'size', 'variant']
+ ),
} satisfies Record,
},
emits: [
{
- args: [],
- event: 'show',
- description: '',
+ event: 'hide',
+ description: 'Emitted just before dropdown is hidden. Cancelable',
+ args: [
+ {
+ arg: 'value',
+ type: 'BvTriggerableEvent',
+ description: 'Call value.preventDefault() to cancel hide',
+ },
+ ],
},
{
- args: [],
- event: 'shown',
- description: '',
+ event: 'hidden',
+ description: 'Called after dropdown is hidden',
},
{
- args: [],
- event: 'show-prevented',
- description: '',
+ event: 'hide-prevented',
+ description: 'Emitted when the dropdown tried to close, but was prevented from doing so.',
},
{
- args: [],
- event: 'hide',
- description: '',
+ event: 'click',
+ description: 'Emitted when button is clicked',
+ args: [
+ {
+ arg: 'event',
+ type: 'MouseEvent',
+ description: 'Native click event object',
+ },
+ ],
},
{
- args: [],
- event: 'hidden',
- description: '',
+ event: 'show',
+ description: 'Emitted just before dropdown is shown. Cancelable',
+ args: [
+ {
+ arg: 'value',
+ type: 'BvTriggerableEvent',
+ description: 'Call value.preventDefault() to cancel show',
+ },
+ ],
},
{
- args: [],
- event: 'hide-prevented',
- description: '',
+ event: 'shown',
+ description: 'Called after dropdown is shown',
},
{
- event: 'click',
- description: '',
+ event: 'show-prevented',
+ description: 'Emitted when the dropdown tried to open, but was prevented from doing so.',
+ },
+ {
+ event: 'split-click',
+ description: 'Emitted when split button is clicked in split mode',
args: [
{
- arg: 'click',
- description: '',
+ arg: 'event',
type: 'MouseEvent',
+ description: 'Native click event object',
},
],
},
{
- args: [],
event: 'toggle',
- description: '',
+ description: 'Emitted when toggle button is clicked',
},
],
slots: [
{
- description: '',
- scope: [],
- name: 'button-content',
+ name: 'default',
+ description: 'Optionally scoped default slot for dropdown menu content',
+ scope: [
+ {
+ prop: 'hide',
+ type: '() => void',
+ description: 'Can be used to close the dropdown',
+ },
+ {
+ prop: 'show',
+ type: '() => void',
+ description: 'Can be used to open the dropdown',
+ },
+ ],
},
{
- description: '',
- scope: [],
- name: 'toggle-text',
+ name: 'button-content',
+ description: 'Can be used to implement custom text with icons and more styling',
},
{
- scope: [],
- description: '',
- name: 'default',
+ name: 'toggle-text',
+ description:
+ 'ARIA label (sr-only) to set on the toggle when in split mode. Overrides the toggle-text prop',
},
],
},
{
component: 'BDropdownDivider',
sourcePath: '/BDropdown/BDropdownDivider.vue',
- emits: [],
- slots: [],
props: {
'': {
- tag: {
- description: '',
- type: 'string',
- default: 'hr',
- },
+ ...pick(
+ buildCommonProps({
+ tag: {
+ default: 'hr',
+ },
+ }),
+ ['tag']
+ ),
} satisfies Record,
},
},
{
component: 'BDropdownForm',
sourcePath: '/BDropdown/BDropdownForm.vue',
- emits: [],
- props: {} satisfies Record,
+ props: {
+ '': {
+ formClass: {notYetImplemented: true},
+ inline: {notYetImplemented: true},
+ novalidate: {notYetImplemented: true},
+ validated: {notYetImplemented: true},
+ },
+ },
+ // Add the typing back in when props are implemented
+ // satisfies Record,
slots: [
{
- scope: [],
- description: '',
name: 'default',
+ description: 'Content to place in the dropdown form',
},
],
},
@@ -260,42 +335,28 @@ export default {
emits: [],
props: {
'': {
- ariaDescribedby: {
- type: 'string',
- default: undefined,
- },
header: {
type: 'string',
default: undefined,
},
- headerClass: {
- type: 'ClassValue',
- default: undefined,
- },
- headerTag: {
- type: 'string',
- default: 'header',
- },
- headerVariant: {
- type: 'ColorVariant | null',
- default: null,
- },
- id: {
- type: 'string',
- default: undefined,
- },
+ ...pick(
+ buildCommonProps({
+ headerTag: {
+ default: 'header',
+ },
+ }),
+ ['ariaDescribedby', 'headerClass', 'headerTag', 'headerVariant', 'id']
+ ),
} satisfies Record,
},
slots: [
{
- description: '',
- scope: [],
name: 'default',
+ description: 'Content (items) to place in the dropdown group',
},
{
- scope: [],
- description: '',
name: 'header',
+ description: 'Optional header content for the dropdown group',
},
],
},
@@ -306,185 +367,84 @@ export default {
props: {} satisfies Record,
slots: [
{
- scope: [],
- description: '',
name: 'default',
+ description: 'Content to place in the dropdown header',
},
],
},
{
component: 'BDropdownItem',
sourcePath: '/BDropdown/BDropdownItem.vue',
+ props: {
+ '': {
+ ...pick(buildCommonProps({}), ['linkClass', 'wrapperAttrs']),
+ } satisfies Record<
+ Exclude,
+ PropertyReference
+ >,
+ 'BLink props': {
+ _linkTo: {
+ type: linkTo,
+ },
+ ...omit(linkProps, ['routerTag']),
+ },
+ },
emits: [
{
event: 'click',
+ description: 'Emitted when item is clicked',
args: [
{
- arg: 'click',
- description: '',
+ arg: 'value',
type: 'MouseEvent',
+ description: 'Native click event object',
},
],
- description: '',
},
],
- props: {
- '': {
- active: {
- type: 'boolean',
- default: undefined,
- },
- activeClass: {
- type: 'string',
- default: undefined,
- },
- disabled: {
- type: 'boolean',
- default: undefined,
- },
- exactActiveClass: {
- type: 'string',
- default: undefined,
- },
- href: {
- type: 'string',
- default: undefined,
- },
- icon: {
- type: 'boolean',
- default: undefined,
- },
- linkClass: {
- type: 'ClassValue',
- default: undefined,
- },
- noPrefetch: {
- type: 'boolean',
- },
- noRel: {
- type: 'boolean',
- },
- opacity: {
- type: '10 | 25 | 50 | 75 | 100 | "10" | "25" | "50" | "75" | "100"',
- default: undefined,
- },
- opacityHover: {
- type: '10 | 25 | 50 | 75 | 100 | "10" | "25" | "50" | "75" | "100"',
- default: undefined,
- },
- prefetch: {
- type: 'boolean',
- },
- prefetchedClass: {
- type: 'ClassValue',
- },
- rel: {
- type: 'string',
- default: undefined,
- },
- replace: {
- type: 'boolean',
- default: undefined,
- },
- routerComponentName: {
- type: 'string',
- default: undefined,
- },
- stretched: {
- type: 'boolean',
- default: false,
- },
- target: {
- type: 'LinkTarget',
- default: undefined,
- },
- to: {
- type: 'RouteLocationRaw',
- default: undefined,
- },
- underlineOffset: {
- type: '1 | 2 | 3 | "1" | "2" | "3"',
- default: undefined,
- },
- underlineOffsetHover: {
- type: '1 | 2 | 3 | "1" | "2" | "3"',
- default: undefined,
- },
- underlineOpacity: {
- type: '0 | 10 | 25 | 50 | 75 | 100 | "0" | "10" | "25" | "50" | "75" | "100"',
- default: undefined,
- },
- underlineOpacityHover: {
- type: '0 | 10 | 25 | 50 | 75 | 100 | "0" | "10" | "25" | "50" | "75" | "100"',
- default: undefined,
- },
- underlineVariant: {
- type: 'ColorVariant | null',
- default: undefined,
- },
- variant: {
- type: 'ColorVariant | null',
- default: null,
- },
- wrapperAttrs: {
- type: 'Readonly',
- default: undefined,
- },
- } satisfies Record,
- },
slots: [
{
- description: '',
name: 'default',
- scope: [],
+ description: 'Content to place in the dropdown item',
},
],
},
{
component: 'BDropdownItemButton',
sourcePath: '/BDropdown/BDropdownItemButton.vue',
+ props: {
+ '': {
+ buttonClass: {
+ type: 'ClassValue',
+ default: undefined,
+ description: 'Class or classes to apply to the inner button element',
+ },
+ ...pick(buildCommonProps({}), [
+ 'active',
+ 'activeClass',
+ 'disabled',
+ 'variant',
+ 'wrapperAttrs',
+ ]),
+ } satisfies Record,
+ },
emits: [
{
+ event: 'click',
+ description: 'Emitted when item is clicked',
args: [
{
- arg: 'click',
- description: '',
+ arg: 'value',
type: 'MouseEvent',
+ description: 'Native click event object',
},
],
- description: '',
- event: 'click',
},
],
- props: {
- '': {
- active: {
- type: 'boolean',
- default: false,
- },
- activeClass: {
- type: 'ClassValue',
- default: 'active',
- },
- buttonClass: {
- type: 'ClassValue',
- default: undefined,
- },
- disabled: {
- type: 'boolean',
- default: false,
- },
- variant: {
- type: 'ColorVariant | null',
- default: null,
- },
- } satisfies Record,
- },
slots: [
{
- description: '',
name: 'default',
- scope: [],
+ description: 'Content to place in the dropdown item button',
},
],
},
@@ -495,17 +455,16 @@ export default {
props: {
'': {
text: {
- description: '',
+ default: undefined,
+ description: 'Content to place in the dropdown text. Default slot takes precedence',
type: 'string',
- default: '',
},
} satisfies Record,
},
slots: [
{
- description: '',
name: 'default',
- scope: [],
+ description: 'Content to place in the dropdown text',
},
],
},
diff --git a/apps/docs/src/data/components/formCheckbox.data.ts b/apps/docs/src/data/components/formCheckbox.data.ts
index cf1c62f93..464e048cd 100644
--- a/apps/docs/src/data/components/formCheckbox.data.ts
+++ b/apps/docs/src/data/components/formCheckbox.data.ts
@@ -37,6 +37,11 @@ export default {
description:
'When set, renders the checkbox as an inline element rather than as a 100% width block',
},
+ inputClass: {
+ type: 'ClassValue',
+ default: undefined,
+ description: 'Class to be applied to the body of the checkbox item',
+ },
modelValue: {
type: 'CheckboxValue | readonly CheckboxValue[]',
default: undefined,
@@ -64,16 +69,6 @@ export default {
default: true,
description: 'Value returned when this checkbox is checked',
},
- wrapperAttrs: {
- type: 'Readonly',
- default: undefined,
- description: 'Attributes to be applied to the wrapper element',
- },
- inputClass: {
- type: 'ClassValue',
- default: undefined,
- description: 'Class to be applied to the body of the accordion item',
- },
...pick(buildCommonProps(), [
'ariaLabel',
'ariaLabelledby',
@@ -86,6 +81,7 @@ export default {
'required',
'size',
'state',
+ 'wrapperAttrs',
]),
} satisfies Record,
},
diff --git a/apps/docs/src/docs/components/breadcrumb.md b/apps/docs/src/docs/components/breadcrumb.md
index e4f05e611..c28001634 100644
--- a/apps/docs/src/docs/components/breadcrumb.md
+++ b/apps/docs/src/docs/components/breadcrumb.md
@@ -48,6 +48,12 @@ Use slot `prepend` to put content before the breadcrumb. Use slot `append` to pu
-
diff --git a/apps/docs/src/docs/components/button.md b/apps/docs/src/docs/components/button.md
index 5c716eeb6..79fd6620e 100644
--- a/apps/docs/src/docs/components/button.md
+++ b/apps/docs/src/docs/components/button.md
@@ -193,15 +193,15 @@ documentation for details
- Block Level Button
- Another Block Level Button
+ Block Level Button
+ Another Block Level Button
```vue-html
- Block Level Button
- Another Block Level Button
+ Block Level Button
+ Another Block Level Button
```
diff --git a/apps/docs/src/docs/components/card.md b/apps/docs/src/docs/components/card.md
index 89ecff7dd..8cfeba52c 100644
--- a/apps/docs/src/docs/components/card.md
+++ b/apps/docs/src/docs/components/card.md
@@ -215,6 +215,12 @@ set them to display: inline-block as column-break-inside: avoid is not a bulletp
-
diff --git a/apps/docs/src/docs/components/carousel.md b/apps/docs/src/docs/components/carousel.md
index 937bd7b64..82ae68d19 100644
--- a/apps/docs/src/docs/components/carousel.md
+++ b/apps/docs/src/docs/components/carousel.md
@@ -137,31 +137,14 @@ You are also able to use the built in methods for going to the next, or previous
<<< DEMO ./demo/CarouselFull.vue#template{vue-html}
-## Reference
-
-
diff --git a/apps/docs/src/docs/components/collapse.md b/apps/docs/src/docs/components/collapse.md
index a5099339e..7ac49f8b2 100644
--- a/apps/docs/src/docs/components/collapse.md
+++ b/apps/docs/src/docs/components/collapse.md
@@ -10,97 +10,24 @@
Easily toggle visibility of almost any content on your pages in a vertically collapsing container.
Includes support for making accordions. Visibility can be easily toggled with our
-[`v-b-toggle` directive](/docs/directives/toggle), or via `v-model`.
+[`v-b-toggle` directive](/docs/directives/BToggle), or via [`v-model`](#v-model-support).
-
- Toggle Collapse
-
-
-
- Toggle Inner Collapse
-
- Hello!
-
-
-
-```
-
-
-
+<<< DEMO ./demo/CollapseOverview.vue#template{vue-html}
## Usage
Other elements can easily toggle `BCollapse` components using the
[`v-b-toggle` directive](/docs/directives/toggle).
-
-
- Toggle Collapse
-
- Toggle Collapse
-
-
- I am collapsible content!
-
-
-
-```vue-html
-
-Toggle Collapse
-
-
-Toggle Collapse
-
-
-
- I am collapsible content!
-
-```
-
-
-
+<<< DEMO ./demo/CollapseUsage.vue#template{vue-html}
## Initial visibility (start expanded)
To make the `BCollapse` show initially, set the `v-model` prop:
-
- Toggle Collapse
-
- I should start open!
-
-
-
-```vue-html
-Toggle Collapse
-
-
- I should start open!
-
-```
-
-
-
-
-~~By default, an initially visible collapse will not animate on mount. To enable the collapse
-expanding animation on mount (when `visible` or `v-model` is `true`), set the `appear` prop on
-`BCollapse`.~~
+<<< DEMO ./demo/CollapseInitial.vue#template{vue-html}
## `v-model` support
@@ -112,44 +39,10 @@ are not automatically placed on the trigger button (as is the case when using th
directive). In this example we **must control the attributes ourselves** for proper accessibility
support.
-
-
- Toggle Collapse
-
-
- I should start open!
-
-
-
-```vue
-
-
-
- Toggle Collapse
-
-
- I should start open!
-
-
-
-
-
-```
+By default, an initially visible collapse will not animate on mount. To enable the collapse expanding animation on mount,
+set the `toggle` prop on `` and leave the `visible` prop as false.
-
-
+<<< DEMO ./demo/CollapseModel.vue
## Trigger multiple collapse elements
@@ -158,56 +51,16 @@ multiple target Ids using _modifiers_.
You can also pass multiple target Ids via the directive _value_ in BootstrapVueNext.
-
-
-
- Toggle Collapse A and B
-
- Toggle Collapse A and B
-
- Toggle Collapse A and B
-
-
-
- I am collapsible content A!
-
-
- I am collapsible content B!
-
-
-
-```vue-html
-
-Toggle Collapse A and B
-
-
-Toggle Collapse A and B
-
-
-Toggle Collapse A and B
-
-
-
- I am collapsible content A!
-
-
-
- I am collapsible content B!
-
-```
-
-
-
-
-## Hiding and showing content in the toggle button based on collapse state
-
-New in v0.8.0
-
-The `header` slot can be used to create custom toggles for your collapsible content. The `footer` slot is also available and can be used in the same manner.
+<<< DEMO ./demo/CollapseMultiple.vue#template{vue-html}
+
+## Slots
+
+The `header` and `footer` slots can be used to create custom toggles for your collapsible content. The default slot is
+used for the content to be hidden or shown.
Using the `v-b-toggle` directive to toggle the `BCollapse` will still work but the `collapsed` CSS class will no longer be applied to the element with the directive.
-The following properties are available for the `header` and `footer` slots:
+The following properties are available for the `header` and `footer` and `default` slots:
| Property | Type | Description |
| --------- | -------- | ------------------------------------- |
@@ -217,32 +70,23 @@ The following properties are available for the `header` and `footer` slots:
| `hide` | Function | When called, will close the collapse |
| `id` | String | The ID of the collapsible element |
-
-
-
-
- {{ visible ? 'Close' : 'Open' }} My Collapse
-
-
-
-
-
-```
-
-
-
+`BCollapse` also [provides](https://vuejs.org/guide/components/provide-inject.html) the above variables
+to its children as well as the value of the `isNav` prop.
+
+<<< DEMO ./demo/CollapseContent.vue#template{vue-html}
+
+## Exposed functions
+
+`BCollapse` exposes several functions and properties that allow manipulation and examination of the state of the components.
+These are accessed through the [template ref](https://vuejs.org/guide/essentials/template-refs.html#template-refs)
+
+- hide: Hides the collapse and fires the `hide` event
+- show: Shows the collapse and fires the `show` event
+- toggle: Toggles the collapse and fires the `hide` or `show` event, as appropriate
+- isNav: The value of the `isNav` prop of the collapse
+- visible: The visible state of the collapse
+
+<<< DEMO ./demo/CollapseExpose.vue
## Accessibility
@@ -262,39 +106,14 @@ something other than a button or link (or similar component), you should add the
`tabindex="0"` and `role="button"` to allow users of assistive technology to reach your trigger
element.
-When using accordion mode, make sure you place the trigger elements and `BCollapse` components
-inside an element with `role="tablist"` and set `role="tab"` on each trigger element's container in
-order to help screen reader users navigate the accordion group. Unfortunately, BootstrapVueNext cannot
-apply those roles for you automatically, as it depends on your final document markup.
-
-
-
+
diff --git a/apps/docs/src/docs/components/demo/CollapseContent.vue b/apps/docs/src/docs/components/demo/CollapseContent.vue
new file mode 100644
index 000000000..98332498d
--- /dev/null
+++ b/apps/docs/src/docs/components/demo/CollapseContent.vue
@@ -0,0 +1,13 @@
+
+
+
+
+
+ {{ visible ? 'Close' : 'Open' }} My Collapse
+
+
+
+
This is data that is being collapsed
+
+
+
diff --git a/apps/docs/src/docs/components/demo/CollapseExpose.vue b/apps/docs/src/docs/components/demo/CollapseExpose.vue
new file mode 100644
index 000000000..a000f509b
--- /dev/null
+++ b/apps/docs/src/docs/components/demo/CollapseExpose.vue
@@ -0,0 +1,23 @@
+
+
+ show
+ hide
+ toggle
+
+
+ I am controlled by exposed functions!
+
+
+
+
+ Action
+ Another action
+ Something else here
+
+
+ Action
+ Another action
+ Something else here
+
+
+
+
diff --git a/apps/docs/src/docs/components/demo/DropdownText.vue b/apps/docs/src/docs/components/demo/DropdownText.vue
new file mode 100644
index 000000000..2e22142b7
--- /dev/null
+++ b/apps/docs/src/docs/components/demo/DropdownText.vue
@@ -0,0 +1,13 @@
+
+
+
+
+ Some example text that is free-flowing within the dropdown menu.
+
+ And this is more example text.
+
+ First item
+ Second Item
+
+
+
diff --git a/apps/docs/src/docs/components/dropdown.md b/apps/docs/src/docs/components/dropdown.md
index 81f277d1c..b413fefe2 100644
--- a/apps/docs/src/docs/components/dropdown.md
+++ b/apps/docs/src/docs/components/dropdown.md
@@ -14,36 +14,7 @@ Dropdowns are toggleable, contextual overlays for displaying lists of links and
`BDropdown` components are toggleable, contextual overlays for displaying lists of links, and more. They're toggled by clicking (or pressing space or enter when focused), not by hovering; this is an [intentional design decision](https://markdotto.com/2012/02/27/bootstrap-explained-dropdowns/).
-
-
- First Action
- Second Action
- Third Action
-
- Active action
- Disabled action
-
-
-
-```vue
-
-
- First Action
- Second Action
- Third Action
-
- Active action
- Disabled action
-
-
-
-
-```
-
-
-
+<<< DEMO ./demo/DropdownOverview.vue#template{vue-html}
## Button content
@@ -51,44 +22,7 @@ You can customize the text of the dropdown button by using either the `text` pro
If both the prop `text` and slot `button-content` are present, the slot `button-content` will take precedence.
-
-
- An item
- Another item
-
-
-
- Custom Content with HTML via Slot
-
- An item
- Another item
-
-
-
-```vue
-
-
- An item
- Another item
-
-
-
-
- Custom Content with HTML via Slot
-
- An item
- Another item
-
-
-
-
-```
-
-
-
+<<< DEMO ./demo/DropdownButtonContent.vue#template{vue-html}
## Positioning
@@ -98,83 +32,13 @@ Dropdown supports various positioning such as left and right aligned, dropdown a
The dropdown menu can either be _start_ aligned (default) or _end_ aligned to the button above it. To have the dropdown aligned on the _end_, set the `end` prop.
-
-
- Action
- Another action
- Something else here
-
-
- Action
- Another action
- Something else here
-
-
- Action
- Another action
- Something else here
-
-
-
-```vue
-
-
- Action
- Another action
- Something else here
-
-
-
- Action
- Another action
- Something else here
-
-
-
- Action
- Another action
- Something else here
-
-
-
-
-```
-
-
-
+<<< DEMO ./demo/DropdownMenuAlignment.vue#template{vue-html}
### Dropup
Turn your dropdown menu into a drop-up menu by setting the `dropup` prop.
-
-
- Action
- Another action
- Something else here
-
-
-
-```vue
-
-
- Action
- Another action
- Something else here
-
-
-
-
-```
-
-
-
+<<< DEMO ./demo/DropdownDropup.vue#template{vue-html}
### Drop start or end
@@ -182,152 +46,36 @@ Turn your dropdown menu into a drop-end menu by setting the `dropend` prop. Or,
The order of precedence is top -> start -> end -> bottom.
-
-
- Action
- Another action
- Something else here
-
-
- Action
- Another action
- Something else here
-
-
-
-```vue
-
-
- Action
- Another action
- Something else here
-
-
-
- Action
- Another action
- Something else here
-
-
-
-
-```
-
-
-
+<<< DEMO ./demo/DropdownStartEnd.vue#template{vue-html}
### Auto "flipping"
By default, dropdowns may flip to the top, or the bottom, based on their current position in the viewport. To disable this auto-flip feature, set the `no-flip` prop.
-
-
- An item
- Another item
- Yet Another item
-
-
-
-```vue
-
-
- An item
- Another item
- Yet Another item
-
-
-
-
-```
-
-
-
+<<< DEMO ./demo/DropdownNoFlip.vue#template{vue-html}
### Menu offset
Like to move your menu away from the toggle buttons a bit? Then use the `offset` prop to specify the number of pixels to push right (or left when negative) from the toggle button:
-
-
- Action
- Another action
- Something else here
-
-
- Action
- Another action
- Something else here
-
-
-
-```vue
-
-
- Action
- Another action
- Something else here
-
-
-
- Action
- Another action
- Something else here
-
-
-
-
-```
-
-
-
+<<< DEMO ./demo/DropdownMenuOffset.vue#template{vue-html}
### Floating Strategy
By default, the floating element will render using _absolute_. You can change this using the `strategy` prop. The only other option is `fixed`.
+See the [floating-ui documentation](https://floating-ui.com/docs/hide#strategy) for details.
-
-
- Action
- Another action
- Something else here
-
-
-
-```vue
-
-
- Action
- Another action
- Something else here
-
-
-
-
-```
-
-
-
+<<< DEMO ./demo/DropdownFloating.vue#template{vue-html}
### Boundary constraint
-By default, dropdowns are visually constrained to their clipping ancestors, which will suffice in most situations. However, if you place a dropdown inside an element that has `overflow: scroll` (or similar) set, the dropdown menu may - in some situations - get cut off. To get around this, you can specify a boundary element via the `boundary` prop. Supported values are `clippingAncestors` (the default), `viewport`, `document`, or a reference to an HTML element.
+By default, dropdowns are visually constrained to their clipping ancestors, which will suffice in most situations. However, if you place a dropdown inside an element that has `overflow: scroll` (or similar) set, the dropdown menu may - in some situations - get cut off. To get around this, you can specify a boundary element via the `boundary` prop. Supported values any values from [floating-ui](https://floating-ui.com/)
+[Boundary](https://floating-ui.com/docs/detectoverflow#boundary) or [RootBoundary](https://floating-ui.com/docs/detectoverflow#rootboundary) types. The default value is `clippingAncestors`.
**Note:** When `boundary` is any value other than the default of `clippingAncestors`, the style `position: static` is applied to the dropdown component's root element to allow the menu to "break out" of its scroll container. In some situations, this may affect your layout or positioning of the dropdown trigger button. In these cases, you may need to wrap your dropdown inside another element
+**Note:** BootstrapVueNext uses [floating-ui](https://floating-ui.com/) under the hood, so please read [their options documnetation](https://floating-ui.com/docs/detectoverflow#options) for details on `boundary` and `boundary-padding`.
+
### Container element
By default, dropdowns are next to the toggle button. However, you can specify a container element via the `container` prop where dropdowns will be teleported to instead. Supported values are CSS selector string, an actual DOM node or a reference to an HTML element.
@@ -343,66 +91,7 @@ The `auto-close`property has 4 options.
- `inside` : the dropdown will be closed (only) by clicking inside the dropdown menu
- `outside` : the dropdown will be closed (only) by clicking outside the dropdown menu
-
-
- Action
- Another action
- Something else here
-
-
- Action
- Another action
- Something else here
-
-
- Action
- Another action
- Something else here
-
-
- Action
- Another action
- Something else here
-
-
-
-```vue
-
-
- Action
- Another action
- Something else here
-
-
-
- Action
- Another action
- Something else here
-
-
-
- Action
- Another action
- Something else here
-
-
-
- Action
- Another action
- Something else here
-
-
-
-
-```
-
-
-
+<<< DEMO ./demo/DropdownAutoClose.vue#template{vue-html}
### Advanced floating-ui configuration
@@ -416,59 +105,13 @@ You can view the [Floating-ui docs](https://floating-ui.com/docs/middleware) to
Create a split dropdown button, where the left button provides standard `click` event and link support, while the right-hand side is the dropdown menu toggle button.
-
-
- Action
- Another action
- Something else here...
-
-
-
-```vue
-
-
- Action
- Another action
- Something else here...
-
-
-
-
-```
-
-
-
+<<< DEMO ./demo/DropdownSplitButton.vue#template{vue-html}
### Split button link support
The left split button defaults to an element of type `
diff --git a/packages/bootstrap-vue-next/src/components/BDropdown/BDropdownGroup.vue b/packages/bootstrap-vue-next/src/components/BDropdown/BDropdownGroup.vue
index c53801f7b..c17d4eecf 100644
--- a/packages/bootstrap-vue-next/src/components/BDropdown/BDropdownGroup.vue
+++ b/packages/bootstrap-vue-next/src/components/BDropdown/BDropdownGroup.vue
@@ -24,6 +24,7 @@
diff --git a/packages/bootstrap-vue-next/src/components/BDropdown/BDropdownItem.vue b/packages/bootstrap-vue-next/src/components/BDropdown/BDropdownItem.vue
index 80316fb4e..0bf8d5014 100644
--- a/packages/bootstrap-vue-next/src/components/BDropdown/BDropdownItem.vue
+++ b/packages/bootstrap-vue-next/src/components/BDropdown/BDropdownItem.vue
@@ -27,6 +27,7 @@ import type {BDropdownItemProps} from '../../types/ComponentProps'
import {useBLinkHelper} from '../../composables/useBLinkHelper'
import {collapseInjectionKey, dropdownInjectionKey, navbarInjectionKey} from '../../utils/keys'
import {useDefaults} from '../../composables/useDefaults'
+import {useColorVariantClasses} from '../../composables/useColorVariantClasses'
defineOptions({
inheritAttrs: false,
@@ -74,12 +75,17 @@ defineSlots<{
const {computedLink, computedLinkProps} = useBLinkHelper(props)
+const colorClasses = useColorVariantClasses(
+ computed(() => ({
+ textVariant: props.variant,
+ }))
+)
const computedClasses = computed(() => [
props.linkClass,
+ colorClasses.value,
{
active: props.active,
disabled: props.disabled,
- [`text-${props.variant}`]: props.variant !== null,
},
])
diff --git a/packages/bootstrap-vue-next/src/components/BDropdown/BDropdownItemButton.vue b/packages/bootstrap-vue-next/src/components/BDropdown/BDropdownItemButton.vue
index c49e88377..e50697b7c 100644
--- a/packages/bootstrap-vue-next/src/components/BDropdown/BDropdownItemButton.vue
+++ b/packages/bootstrap-vue-next/src/components/BDropdown/BDropdownItemButton.vue
@@ -15,6 +15,7 @@
diff --git a/packages/bootstrap-vue-next/src/components/BFormFile/BFormFile.vue b/packages/bootstrap-vue-next/src/components/BFormFile/BFormFile.vue
index 9d0006f8a..5967d78d5 100644
--- a/packages/bootstrap-vue-next/src/components/BFormFile/BFormFile.vue
+++ b/packages/bootstrap-vue-next/src/components/BFormFile/BFormFile.vue
@@ -56,7 +56,7 @@ const _props = withDefaults(defineProps>(), {
accept: '',
autofocus: false,
// eslint-disable-next-line vue/require-valid-default-prop
- capture: false,
+ capture: undefined,
directory: false,
disabled: false,
form: undefined,
diff --git a/packages/bootstrap-vue-next/src/components/BFormFile/form-file.spec.ts b/packages/bootstrap-vue-next/src/components/BFormFile/form-file.spec.ts
index 295ad09df..606542d98 100644
--- a/packages/bootstrap-vue-next/src/components/BFormFile/form-file.spec.ts
+++ b/packages/bootstrap-vue-next/src/components/BFormFile/form-file.spec.ts
@@ -229,7 +229,7 @@ describe('form-file', () => {
props: {capture: undefined},
})
const $input = wrapper.get('input')
- expect($input.attributes('capture')).toBe('false')
+ expect($input.attributes('capture')).toBe(undefined)
})
it('input element has set attr accept to empty when prop accept is true', () => {
diff --git a/packages/bootstrap-vue-next/src/components/BFormTags/BFormTag.vue b/packages/bootstrap-vue-next/src/components/BFormTags/BFormTag.vue
index cd3ffdb8f..327037945 100644
--- a/packages/bootstrap-vue-next/src/components/BFormTags/BFormTag.vue
+++ b/packages/bootstrap-vue-next/src/components/BFormTags/BFormTag.vue
@@ -28,6 +28,7 @@ import {useDefaults} from '../../composables/useDefaults'
import {useId} from '../../composables/useId'
import type {BFormTagProps} from '../../types/ComponentProps'
import BCloseButton from '../BButton/BCloseButton.vue'
+import {useColorVariantClasses} from '../../composables/useColorVariantClasses'
const _props = withDefaults(defineProps(), {
disabled: false,
@@ -57,9 +58,12 @@ const tagText = computed(
)
const taglabelId = computed(() => `${computedId.value}taglabel__`)
-const computedClasses = computed(() => ({
- [`text-bg-${props.variant}`]: props.variant !== null,
- 'rounded-pill': props.pill,
- 'disabled': props.disabled,
-}))
+const colorClasses = useColorVariantClasses(props)
+const computedClasses = computed(() => [
+ colorClasses.value,
+ {
+ 'rounded-pill': props.pill,
+ 'disabled': props.disabled,
+ },
+])
diff --git a/packages/bootstrap-vue-next/src/components/BModal/BModal.vue b/packages/bootstrap-vue-next/src/components/BModal/BModal.vue
index 6156402df..ceea62344 100644
--- a/packages/bootstrap-vue-next/src/components/BModal/BModal.vue
+++ b/packages/bootstrap-vue-next/src/components/BModal/BModal.vue
@@ -1,7 +1,7 @@