Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
184a362
move showHide emits and slots types to new file.
xvaara Dec 3, 2024
509f947
feat(BAlert)!: make act like toast, useShowHide.
xvaara Dec 4, 2024
de0e7cb
feat(useShowHide): create triggerRegistry for adding external trigger…
xvaara Dec 4, 2024
f26354d
fix: type popoverController
xvaara Dec 5, 2024
58d3199
fix(useShowHide): focustrap off at the begining of leave, pass down t…
xvaara Dec 5, 2024
e1272cb
fix(vBToggle): keep track of targets
xvaara Dec 5, 2024
166860c
fix(BPopover)!: change prop content to body to align with other compo…
xvaara Dec 5, 2024
9c39065
fix tests, skip setTimeout if not needed in useShowHide
xvaara Dec 5, 2024
330782f
feat(usePopoverController): allow more options
xvaara Dec 6, 2024
0a34b38
fix(vBToggle): find late components, ie. inside ClientOnly
xvaara Dec 6, 2024
9349c0e
fix(useModalController)!: move props to main level, add slots
xvaara Dec 6, 2024
9076556
feat(useToastController)!: remove props obj, the parameters are flat …
xvaara Dec 7, 2024
cd2c559
Merge branch 'main' of https://github.com/VividLemon/bootstrap-vue-ne…
VividLemon Dec 7, 2024
0d9e4b6
fix docs build
xvaara Dec 7, 2024
37c3f96
implement few suggestions
xvaara Dec 7, 2024
9916fca
fix some tests
xvaara Dec 8, 2024
268207d
feat(useShowHide): show returns a promise, resolve on show or hide.
xvaara Feb 14, 2025
327345a
feat(useToggle): toggle any show/hide component
xvaara Feb 14, 2025
c9b7bdc
feat!: controller composables functions return promise, with id and c…
xvaara Feb 14, 2025
dad5879
Merge branch 'main' into flatten-composables
xvaara Feb 14, 2025
96b804a
small fix
xvaara Feb 14, 2025
fa0afef
fix type
xvaara Feb 14, 2025
2f4c4ee
fix docs
xvaara Feb 14, 2025
a4d852c
fix confirm, add and fix some docs
xvaara Feb 14, 2025
7f5b285
Merge remote-tracking branch 'upstream/main' into flatten-composables
xvaara Feb 15, 2025
08ac026
small fixes
xvaara Feb 15, 2025
e57dddc
add stop to the promise object. add set to the other plugins.
xvaara Feb 18, 2025
148e3c7
Merge branch 'main' into flatten-composables
xvaara Mar 17, 2025
914e50e
add split-click to ComponentEmits.ts
xvaara Mar 17, 2025
ff1fe3a
feat(useModalController): add support for using syntax in ts
xvaara Mar 18, 2025
7c8ecba
feat(BModal): add okClass and cancelClass to add classes to the buttons.
xvaara Mar 20, 2025
891975d
feat(useModalController)!: change of api, check the docs
xvaara Mar 20, 2025
a40ad2a
docs, fix hide triggers
xvaara Mar 20, 2025
c4970b3
document usePopoverController
xvaara Mar 27, 2025
a443de8
Merge branch 'main' into flatten-composables
xvaara Apr 12, 2025
870149a
fix lint
xvaara Apr 12, 2025
9961fa6
fix coderabbitai suggestions
xvaara Apr 22, 2025
04558f1
fix build and typo, and few suggestions
xvaara Apr 22, 2025
3355135
small fix
xvaara Apr 22, 2025
87e3879
jsdoc for create functions
xvaara Apr 24, 2025
84420d4
fix some bot suggestions
xvaara Apr 28, 2025
07acc1e
small fix
xvaara Apr 28, 2025
1d98f71
suggestion for edge case prevention in watch
xvaara Apr 28, 2025
0186ec0
fix: inline functional style to show toast,modal and dropdown
xvaara Apr 28, 2025
00e9079
Merge branch 'main' into flatten-composables
xvaara Apr 28, 2025
5a77dcb
fix mounted check
xvaara Apr 29, 2025
a6d73e4
feat(useToggle): add trigger to promise resolve on hide.
xvaara Apr 29, 2025
fa1bd87
fix(BCarousel): fix v-for updates
xvaara Apr 29, 2025
e76a1f4
add deprecation warns
xvaara Apr 30, 2025
d7157fa
fix return
xvaara Apr 30, 2025
f678981
fix bot suggestions
xvaara Apr 30, 2025
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
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,19 @@
],
"type": "node"
},
{
"name": "Launch app unit test",
"request": "launch",
"runtimeArgs": [
"test:unit",
"--filter",
"bootstrap-vue-next"
],
"runtimeExecutable": "pnpm",
"skipFiles": [
"<node_internals>/**"
],
"type": "node"
},
]
}
2 changes: 2 additions & 0 deletions apps/docs/.vitepress/theme/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<BNavbar v-b-color-mode="'dark'" variant="primary" sticky="top" toggleable="lg" :container="true">
<BToastOrchestrator />
<BModalOrchestrator />
<BPopoverOrchestrator />
<div class="d-flex gap-2 align-items-center">
<BNavbarToggle v-b-toggle.sidebar-menu />
<BNavbarBrand :to="withBase('/')" class="p-0 me-0 me-lg-2">
Expand Down Expand Up @@ -163,6 +164,7 @@ import {
BNavItem,
BNavItemDropdown,
BOffcanvas,
BPopoverOrchestrator,
BRow,
BToastOrchestrator,
useColorMode,
Expand Down
2 changes: 2 additions & 0 deletions apps/docs/src/components/TableOfContentsNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ const componentsList: {name: string}[] = [
{name: 'Table'},
{name: 'Tabs'},
{name: 'Toast'},
{name: 'Tooltip'},
]

const composablesList: {name: string}[] = [
Expand All @@ -148,6 +149,7 @@ const composablesList: {name: string}[] = [
{name: 'useModal'},
{name: 'useModalController'},
{name: 'useToastController'},
{name: 'useToggle'},
{name: 'usePopoverController'},
]

Expand Down
98 changes: 77 additions & 21 deletions apps/docs/src/data/components/alert.data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type {BvnComponentProps} from 'bootstrap-vue-next'
import type {ComponentReference, PropertyReference} from '../../types'
import {buildCommonProps, pick} from '../../utils'
import {buildCommonProps, omit, pick, showHideProps} from '../../utils'
import {linkProps, linkTo} from '../../utils/link-props'

export default {
load: (): ComponentReference[] => [
Expand All @@ -9,61 +10,116 @@ export default {
sourcePath: '/BAlert/BAlert.vue',
props: {
'': {
closeVariant: {
type: 'ButtonVariant | null',
default: 'secondary',
description: 'Applies one of the Bootstrap button variants to the close button',
alertClass: {
type: 'ClassValue',
default: undefined,
description: 'CSS class (or classes) to add to the alert wrapper element',
},
bgVariant: {
type: 'ColorVariant | null',
default: null,
},
body: {
type: 'string',
default: undefined,
description: 'The text content of the body',
},
bodyClass: {
type: 'ClassValue',
default: undefined,
description: 'CSS class (or classes) to add to the alert body element',
},
closeClass: {
type: 'ClassValue',
default: undefined,
description: 'Applies one or more custom classes to the close button',
},
closeContent: {
type: 'string',
default: undefined,
description: 'Sets the text of the close button. The `close` slot takes precedence',
},
closeLabel: {
type: 'string',
default: 'Close',
description: 'Sets the aria-label attribute on the close button',
},
closeContent: {
type: 'string',
default: undefined,
description: 'Sets the text of the close button. The `close` slot takes precedence',
closeVariant: {
type: 'string | null',
default: null,
description: 'Color variant for the close button',
},
dismissible: {
type: 'boolean',
default: false,
description: 'When set, enables the close button',
},
fade: {
headerClass: {
type: 'ClassValue',
default: undefined,
description: 'CSS class (or classes) to add to the alert header element',
},
headerTag: {
type: 'string',
default: 'div',
description: 'Specify the HTML tag to render instead of the default tag for the footer',
},
id: {
type: 'string',
default: undefined,
description:
'Used to set the `id` attribute on the rendered content, and used as the base to generate any additional element IDs as needed',
},
interval: {
type: 'number | requestAnimationFrame',
default: 'requestAnimationFrame',
description: 'The interval in milliseconds to update the countdown timer',
},
isStatus: {
type: 'boolean',
default: false,
description: 'When set to true, enables the fade animation/transition on the component',
description:
"When set to 'true', makes the alert have attributes aria-live=polite and role=status. When 'false' aria-live will be 'assertive' and role will be 'alert'",
},
modelValue: {
type: 'boolean | number',
default: false,
description:
'Controls the visibility of the alert. A `boolean` value directly controls the visibility. A number starts the countdown timer',
},
immediate: {
type: 'boolean',
default: true,
progressProps: {
type: "Omit<BProgressBarProps, 'label' | 'max' | 'value'>",
default: undefined,
description:
'Setting this property to `false` will cause a timer to not start immediately upon render. A timer that is not started is not rendered. It must manually be started with `resume()` or `restart()`',
},
interval: {
type: 'number | requestAnimationFrame',
default: 'requestAnimationFrame',
description: 'The interval in milliseconds to update the countdown timer',
'The properties to define the progress bar in the alert. No progress will be shown if left undefined',
},
showOnPause: {
type: 'boolean',
default: true,
description:
'Setting this property to `false` will override the behavior of showing the Alert when the timer is paused',
},
textVariant: {
type: 'TextColorVariant | null',
default: null,
},
title: {
type: 'string',
default: undefined,
description: "The alert's title text",
},
...omit(showHideProps, ['modelValue']),
...pick(buildCommonProps(), ['variant', 'noHoverPause', 'noResumeOnHoverLeave']),
} satisfies Record<keyof BvnComponentProps['BAlert'], PropertyReference>,
} satisfies Record<
Exclude<keyof BvnComponentProps['BAlert'], keyof typeof linkProps>,
PropertyReference
>,
'BLink props': {
_linkTo: {
type: linkTo,
},
...linkProps,
},
},
slots: [
{
Expand Down
10 changes: 10 additions & 0 deletions apps/docs/src/data/components/modal.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ export default {
type: 'Size',
default: 'md',
},
cancelClass: {
type: 'ClassValue',
default: undefined,
description: "CSS class (or classes) to apply to the '.modal-cancel' button",
},
cancelDisabled: {
type: 'boolean',
default: false,
Expand Down Expand Up @@ -234,6 +239,11 @@ export default {
default: false,
description: 'Disables the focus trap feature',
},
okClass: {
type: 'ClassValue',
default: undefined,
description: "CSS class (or classes) to apply to the '.modal-ok' button",
},
okDisabled: {
type: 'boolean',
default: false,
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/data/components/popover.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default {
type: 'boolean',
default: false,
},
content: {
body: {
type: 'string',
default: undefined,
},
Expand Down
22 changes: 21 additions & 1 deletion apps/docs/src/data/components/toast.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,26 @@ export default {
default: undefined,
description: 'CSS class (or classes) to add to the toast body element',
},
closeClass: {
type: 'ClassValue',
default: undefined,
description: 'Applies one or more custom classes to the close button',
},
closeContent: {
type: 'string',
default: undefined,
description: 'Sets the text of the close button. The `close` slot takes precedence',
},
closeLabel: {
type: 'string',
default: 'Close',
description: 'Sets the aria-label attribute on the close button',
},
closeVariant: {
type: 'string | null',
default: null,
description: 'Color variant for the close button',
},
headerClass: {
type: 'ClassValue',
default: undefined,
Expand Down Expand Up @@ -94,7 +114,7 @@ export default {
description: 'CSS class (or classes) to add to the toast wrapper element',
},
...omit(showHideProps, ['modelValue']),
...pick(buildCommonProps(), ['noHoverPause', 'noResumeOnHoverLeave']),
...pick(buildCommonProps(), ['variant', 'noHoverPause', 'noResumeOnHoverLeave']),
} satisfies Record<
Exclude<keyof BvnComponentProps['BToast'], keyof typeof linkProps>,
PropertyReference
Expand Down
6 changes: 5 additions & 1 deletion apps/docs/src/docs/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,11 @@ const componentList: {name: string; description: string}[] = [
{
name: 'Form Spinbutton',
description: ''
}
},
{
name: 'Tooltip',
description: 'Tooltip provides a tooltip behavior over another component',
},
]

const computedComponentsList = computed(() =>
Expand Down
83 changes: 83 additions & 0 deletions apps/docs/src/docs/components/tooltip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Tooltip

## Tooltip is a wrapper for Popover

Tooltip is a wrapper for Popover, providing a simple way to create tooltips in your application. It uses the same API as Popover, but with some default properties set for tooltips.

## Usage

To use the tooltip, simply wrap your target element with the `<BTooltip>` component and provide the necessary props.

<HighlightCard>
<BTooltip>
<template #target>
<BButton>Hover me</BButton>
</template>
Hello World!
</BTooltip>

<template #html>

```vue
<template>
<BTooltip>
<template #target>
<BButton>Hover me</BButton>
</template>
Hello World!
</BTooltip>
</template>
```

</template>
</HighlightCard>

## Differences with Popover

The delay is zero, hideMargin is 0, and it is noninteractive by default. You can override these properties if needed.
`BTooltip` has an interactive prop, which allows you to set the tooltip to be interactive. This means that the tooltip will remain open when the mouse is over it or focus is in it, allowing users to interact with its content.

<HighlightCard>
<BTooltip interactive>
<template #target>
<BButton>Hover me</BButton>
</template>
<span>{{ count }}</span>
<BButton @click="count++">+</BButton>
</BTooltip>

<template #html>

```vue
<template>
<BTooltip interactive>
<template #target>
<BButton>Hover me</BButton>
</template>
<span>{{ count }}</span>
<BButton @click="count++">+</BButton>
</BTooltip>
</template>
<script setup lang="ts">
import {ref} from 'vue'
const count = ref(0)
</script>
```

</template>

</HighlightCard>

## Additional Notes

Make sure to check the Popover documentation for more details on customization options.

see [Popover](/docs/components/popover)

<script setup lang="ts">
import {BButton, BTooltip} from 'bootstrap-vue-next'
import HighlightCard from '../../components/HighlightCard.vue'
import {ref, onMounted} from 'vue'

const count = ref(0)
</script>
4 changes: 4 additions & 0 deletions apps/docs/src/docs/composables.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ const composablesList: {name: string; description: string}[] = [
name: 'useToastController',
description: 'Conveniently orchestrate a push notification system by showing or hiding Toasts with our useToastController composable system',
},
{
name: 'useToggle',
description: 'Conveniently show, hide or toggle components programmatically from anywhere in the app',
},
{
name: 'usePopoverController',
description: 'Control popovers and tooltips in your application, enabling the display popover elements with ease',
Expand Down
Loading