Skip to content

Commit

Permalink
feat(Drawer): rename hide/show events
Browse files Browse the repository at this point in the history
  • Loading branch information
Cata1989 committed Mar 12, 2024
1 parent 5305e20 commit c236033
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
16 changes: 8 additions & 8 deletions packages/beeq/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ export namespace Components {
}
interface BqDrawer {
/**
* Method to be called to hide the notification component
* Method to be called to hide the drawer component
*/
"hide": () => Promise<void>;
/**
Expand All @@ -412,7 +412,7 @@ export namespace Components {
"open": boolean;
"placement"?: TDrawerPlacement;
/**
* Method to be called to show the notification component
* Method to be called to show the drawer component
*/
"show": () => Promise<void>;
}
Expand Down Expand Up @@ -1540,8 +1540,8 @@ declare global {
new (): HTMLBqDividerElement;
};
interface HTMLBqDrawerElementEventMap {
"bqHide": any;
"bqShow": any;
"bqClose": any;
"bqOpen": any;
"bqAfterOpen": any;
"bqAfterClose": any;
}
Expand Down Expand Up @@ -2429,13 +2429,13 @@ declare namespace LocalJSX {
*/
"onBqAfterOpen"?: (event: BqDrawerCustomEvent<any>) => void;
/**
* Callback handler to be called when the drawer is hidden
* Callback handler to be called when the drawer is closed
*/
"onBqHide"?: (event: BqDrawerCustomEvent<any>) => void;
"onBqClose"?: (event: BqDrawerCustomEvent<any>) => void;
/**
* Callback handler to be called when the drawer is shown
* Callback handler to be called when the drawer is opened
*/
"onBqShow"?: (event: BqDrawerCustomEvent<any>) => void;
"onBqOpen"?: (event: BqDrawerCustomEvent<any>) => void;
/**
* If true, the drawer component will be shown
*/
Expand Down
16 changes: 8 additions & 8 deletions packages/beeq/src/components/drawer/bq-drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ export class BqDrawer {
// Requires JSDocs for public API documentation
// ==============================================

/** Callback handler to be called when the drawer is hidden */
@Event() bqHide!: EventEmitter;
/** Callback handler to be called when the drawer is closed */
@Event() bqClose!: EventEmitter;

/** Callback handler to be called when the drawer is shown */
@Event() bqShow!: EventEmitter;
/** Callback handler to be called when the drawer is opened */
@Event() bqOpen!: EventEmitter;

/** Callback handler to be called after the drawer has been opened */
@Event() bqAfterOpen!: EventEmitter;
Expand Down Expand Up @@ -86,13 +86,13 @@ export class BqDrawer {
// Requires JSDocs for public API documentation.
// ===============================================

/** Method to be called to hide the notification component */
/** Method to be called to hide the drawer component */
@Method()
async hide(): Promise<void> {
await this.handleHide();
}

/** Method to be called to show the notification component */
/** Method to be called to show the drawer component */
@Method()
async show(): Promise<void> {
await this.handleShow();
Expand All @@ -108,7 +108,7 @@ export class BqDrawer {
};

private handleHide = async () => {
const ev = this.bqHide.emit(this.el);
const ev = this.bqClose.emit(this.el);
if (!ev.defaultPrevented) {
await leave(this.drawerElem);
this.open = false;
Expand All @@ -117,7 +117,7 @@ export class BqDrawer {
};

private handleShow = async () => {
const ev = this.bqShow.emit(this.el);
const ev = this.bqOpen.emit(this.el);
if (!ev.defaultPrevented) {
this.open = true;
await enter(this.drawerElem);
Expand Down
8 changes: 4 additions & 4 deletions packages/beeq/src/components/drawer/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
| -------------- | -------------------------------------------------------------- | ------------------ |
| `bqAfterClose` | Callback handler to be called after the drawer has been closed | `CustomEvent<any>` |
| `bqAfterOpen` | Callback handler to be called after the drawer has been opened | `CustomEvent<any>` |
| `bqHide` | Callback handler to be called when the drawer is hidden | `CustomEvent<any>` |
| `bqShow` | Callback handler to be called when the drawer is shown | `CustomEvent<any>` |
| `bqClose` | Callback handler to be called when the drawer is closed | `CustomEvent<any>` |
| `bqOpen` | Callback handler to be called when the drawer is opened | `CustomEvent<any>` |


## Methods

### `hide() => Promise<void>`

Method to be called to hide the notification component
Method to be called to hide the drawer component

#### Returns

Expand All @@ -37,7 +37,7 @@ Type: `Promise<void>`

### `show() => Promise<void>`

Method to be called to show the notification component
Method to be called to show the drawer component

#### Returns

Expand Down

0 comments on commit c236033

Please sign in to comment.