Skip to content

Commit b38806c

Browse files
committed
Removed the action prop of pf-drawer-group and added an #actions slot so that any number of actions can be applied.
1 parent ea33e8e commit b38806c

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
## [Unreleased]
55
### Added
66
- `pf-dropdown` components can now inject the dropdown menu inside any element, with the `append-to` prop, to circumvent issues with clipped containers (e.g. `overflow:hidden`).
7+
- Addeed `pf-drawer-group-action` functional component to use inside the new `pf-drawer-group` `#actions` slot.
8+
9+
### Changed
10+
- **BACKWARD INCOMPATIBLE CHANGE**: Removed the `action` prop of `pf-drawer-group` and added an `#actions` slot so that any number of actions can be applied.
711

812
### Fixed
913
- Added missing `type="button"` attribute to the buttons in `pf-toolbar` and `pf-sort` so that they won't trigger a submit event when inside a form.

src/components/DrawerGroup.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,8 @@
2626
</div>
2727
</div>
2828

29-
<div v-if="action" class="drawer-pf-action">
30-
<div class="drawer-pf-action-link">
31-
<button type="button" class="btn btn-link" @click="$emit('action')">
32-
{{action}}
33-
</button>
34-
</div>
29+
<div v-if="withSlot.actions" class="drawer-pf-action">
30+
<slot name="actions" />
3531
</div>
3632
</div>
3733
</transition>
@@ -49,7 +45,6 @@ export default {
4945
props: {
5046
title: String,
5147
counter: String,
52-
action: String,
5348
loading: Boolean,
5449
},
5550
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<template functional>
2+
<div class="drawer-pf-action-link">
3+
<button v-bind="data.attrs" v-on="listeners" type="button" class="btn btn-link">
4+
<slot />
5+
</button>
6+
</div>
7+
</template>
8+
9+
<script>
10+
export default {
11+
name: 'pf-drawer-group-action',
12+
};
13+
</script>

src/components/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import Notification from './Notification.vue';
1717
import NotificationBell from './NotificationBell.vue';
1818
import Drawer from './Drawer.vue';
1919
import DrawerGroup from './DrawerGroup.vue';
20+
import DrawerGroupAction from './DrawerGroupAction.vue';
2021
import DrawerNotification from './DrawerNotification.vue';
2122
import ExpandCollapse from './ExpandCollapse.vue';
2223
import Layout from './Layout.vue';
@@ -55,6 +56,7 @@ export {
5556
NotificationBell,
5657
Drawer,
5758
DrawerGroup,
59+
DrawerGroupAction,
5860
DrawerNotification,
5961
ExpandCollapse,
6062
Layout,

0 commit comments

Comments
 (0)