diff --git a/api-generator/components/overlaypanel.js b/api-generator/components/overlaypanel.js index 2b131ef8c..d7aeac610 100644 --- a/api-generator/components/overlaypanel.js +++ b/api-generator/components/overlaypanel.js @@ -43,10 +43,22 @@ const OverlayPanelProps = [ } ]; +const OverlayPanelEvents = [ + { + name: "show", + description: "Callback to invoke before the overlay is shown." + }, + { + name: "hide", + description: "Callback to invoke before the overlay is hidden." + }, +]; + module.exports = { overlaypanel: { name: "OverlayPanel", description: "OverlayPanel is a container component positioned as connected to its target.", - props: OverlayPanelProps + props: OverlayPanelProps, + events: OverlayPanelEvents } }; diff --git a/src/components/overlaypanel/OverlayPanel.d.ts b/src/components/overlaypanel/OverlayPanel.d.ts index cc3b9ed21..ec2e6946f 100755 --- a/src/components/overlaypanel/OverlayPanel.d.ts +++ b/src/components/overlaypanel/OverlayPanel.d.ts @@ -15,6 +15,8 @@ declare class OverlayPanel { toggle(event: Event): void; show(event: Event, target?: any): void; hide(): void; + $emit(eventName: 'show'): this; + $emit(eventName: 'hide'): this; $slots: { '': VNode[]; } diff --git a/src/components/overlaypanel/OverlayPanel.vue b/src/components/overlaypanel/OverlayPanel.vue index fe7b340ca..d16be8e53 100755 --- a/src/components/overlaypanel/OverlayPanel.vue +++ b/src/components/overlaypanel/OverlayPanel.vue @@ -133,6 +133,7 @@ export default { }; OverlayEventBus.on('overlay-click', this.overlayEventListener); + this.$emit('show'); }, onLeave() { this.unbindOutsideClickListener(); @@ -140,6 +141,7 @@ export default { this.unbindResizeListener(); OverlayEventBus.off('overlay-click', this.overlayEventListener); this.overlayEventListener = null; + this.$emit('hide'); }, onAfterLeave(el) { if (this.autoZIndex) { diff --git a/src/views/overlaypanel/OverlayPanelDoc.vue b/src/views/overlaypanel/OverlayPanelDoc.vue index fc7984860..a25cd8062 100755 --- a/src/views/overlaypanel/OverlayPanelDoc.vue +++ b/src/views/overlaypanel/OverlayPanelDoc.vue @@ -135,6 +135,22 @@ toggle(event) { +
Events
+
+ + + + + + + + + + + +
show-Callback to invoke when the overlay is shown.
hide-Callback to invoke when the overlay is hidden.
+
+
Styling

Following is the list of structural style classes, for theming classes visit theming page.