Skip to content

Commit cfb10fb

Browse files
author
issayah
committed
2 parents cfa4cad + ae0f677 commit cfb10fb

File tree

5 files changed

+28
-14
lines changed

5 files changed

+28
-14
lines changed

docs/components/Dropdown.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,12 +1099,14 @@ the dropdown menu, ensure they are wrapped with a plain `<li>`.
10991099

11001100
#### Events
11011101

1102-
| Name | Argument | Description |
1103-
| -------- | -------- | -------------------------------------------------- |
1104-
| `hidden` | | Emitted when dropdown is hidden |
1105-
| `hide` | | Emitted just before dropdown is hidden. Cancelable |
1106-
| `show` | | Emitted just before dropdown is shown. Cancelable |
1107-
| `shown` | | Emitted when dropdown is shown |
1102+
| Name | Argument | Description |
1103+
| -------- | --------------------------------- | -------------------------------------------------- |
1104+
| `hidden` | | Emitted when dropdown is hidden |
1105+
| `hide` | | Emitted just before dropdown is hidden. Cancelable |
1106+
| `show` | | Emitted just before dropdown is shown. Cancelable |
1107+
| `shown` | | Emitted when dropdown is shown |
1108+
| `click` | event - Native click event object | Emitted when split button is clicked in split mode |
1109+
| `toggle` | | Emitted when toggle button is clicked |
11081110

11091111
### `<b-dropdown-item>`
11101112

docs/components/InputGroup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ input groups. However, the inputs inside the input group do support contextual s
557557
| --------- | ------ | ------------------------------------------- |
558558
| `default` | No | Content to place in the input group prepend |
559559

560-
### `<b-input-group-Apppend>`
560+
### `<b-input-group-append>`
561561

562562
**Note** Bootstrap 5 dropped `.input-group-append`. You can now just add buttons and `.input-group-text` as direct children of the input groups. `<b-input-group-append>` is added for compatibility reasons.
563563

src/App.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,8 @@
966966
class="m-2"
967967
variant="outline-primary"
968968
split-variant="primary"
969+
@click="(event: Event) => consoleLog('main split button clicked', event)"
970+
@toggle="consoleLog('toggle button clicked')"
969971
>
970972
<b-dropdown-item href="#">Action</b-dropdown-item>
971973
</b-dropdown>
@@ -1716,8 +1718,8 @@
17161718
<em>Title</em>
17171719
- {{ popoverInput }}
17181720
</template>
1719-
<b-button @click="consoleLog">456</b-button>I am popover <b>component</b> content!
1720-
<b-form-input v-model="popoverInput" type="text" />Name:
1721+
<b-button @click="consoleLog('Button Click!')">456</b-button>I am popover
1722+
<b>component</b> content! <b-form-input v-model="popoverInput" type="text" />Name:
17211723
<strong>{{ popoverInput }}</strong>
17221724
</b-popover>
17231725
<button
@@ -1744,8 +1746,8 @@
17441746
<em>Title</em>
17451747
- {{ popoverInput }}
17461748
</template>
1747-
<b-button @click="consoleLog">456</b-button>I am popover <b>component</b> content!
1748-
<b-form-input v-model="popoverInput" type="text" />Name:
1749+
<b-button @click="consoleLog('Button Click!')">456</b-button>I am popover
1750+
<b>component</b> content! <b-form-input v-model="popoverInput" type="text" />Name:
17491751
<strong>{{ popoverInput }}</strong>
17501752
</b-popover>
17511753
</div>
@@ -1890,7 +1892,7 @@
18901892
<b-button class="mt-3" @click="createToast()">Show Toast</b-button>
18911893
<b-button class="mt-3" @click="createToast2()">Show Toast 2</b-button>
18921894
<b-button class="mt-3" @click="createToastError()">Show a danger Toast</b-button>
1893-
<b-button class="mt-3" @click="consoleLog">Hide Toast</b-button>
1895+
<b-button class="mt-3" @click="consoleLog('Button Click!')">Hide Toast</b-button>
18941896
<div id="demo"></div>
18951897
</b-container>
18961898
</template>
@@ -1956,7 +1958,7 @@ export default defineComponent({
19561958
const popoverRef = ref<ComponentPublicInstance<HTMLButtonElement>>()
19571959
const popoverContainerRef = ref<HTMLButtonElement>()
19581960
1959-
const consoleLog = () => console.log('Button Click!')
1961+
const consoleLog = (...args: unknown[]) => console.log(...args)
19601962
const checkedDefault = ref(false)
19611963
const checkedButton = ref(false)
19621964
const checkedRequired = ref(false)

src/components/BDropdown/BDropdown.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
:disabled="disabled"
99
:type="splitButtonType"
1010
v-bind="buttonAttr"
11+
@click="onSplitClick"
1112
>
1213
{{ text }}
1314
<slot name="button-content" />
@@ -22,6 +23,7 @@
2223
class="dropdown-toggle-split dropdown-toggle"
2324
data-bs-toggle="dropdown"
2425
aria-expanded="false"
26+
@click="emit('toggle')"
2527
>
2628
<span class="visually-hidden">
2729
{{ toggleText }}
@@ -107,6 +109,8 @@ interface BDropdownEmits {
107109
(e: 'shown'): void
108110
(e: 'hide'): void
109111
(e: 'hidden'): void
112+
(e: 'click', event: Event): void
113+
(e: 'toggle'): void
110114
}
111115
112116
const emit = defineEmits<BDropdownEmits>()
@@ -121,6 +125,12 @@ useEventListener(parent, 'shown.bs.dropdown', () => emit('shown'))
121125
useEventListener(parent, 'hide.bs.dropdown', () => emit('hide'))
122126
useEventListener(parent, 'hidden.bs.dropdown', () => emit('hidden'))
123127
128+
const onSplitClick = (event: Event) => {
129+
if (props.split) {
130+
emit('click', event)
131+
}
132+
}
133+
124134
const classes = computed(() => ({
125135
'd-grid': props.block,
126136
'd-flex': props.block && props.split,

src/types/components/BFormTags/BFormTags.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface Props {
3030
tagPills?: boolean
3131
tagRemoveLabel?: string
3232
tagRemovedLabel?: string
33-
tagValidator?: <T>(t: T) => boolean
33+
tagValidator?: (t: unknown) => boolean
3434
tagVariant?: ColorVariant
3535
}
3636
// Emits

0 commit comments

Comments
 (0)