message: feat(side-nav-menu): support toggle event
  This change adds support for a set of custom events that are fired
  before/after a `<bx-side-nav-menu>` toggles is expand state.
diff: @@ -35,10 +35,30 @@ class BXSideNavMenu extends FocusMixin(LitElement) {
  private _titleIconContainerNode!: HTMLDivElement;
  /**
  - * Handles `click` event on the expando button.
  + * Handles user-initiated toggle request of this side nav menu.
  + * @param expanded The new expanded state.
  + */
  + private _handleUserInitiatedToggle(expanded = !this.expanded) {
  + const { eventBeforeToggle, eventToggle } = this.constructor as typeof BXSideNavMenu;
  + const init = {
  + bubbles: true,
  + cancelable: true,
  + composed: true,
  + detail: {
  + expanded,
  + },
  + };
  + if (this.dispatchEvent(new CustomEvent(eventBeforeToggle, init))) {
  + this.expanded = expanded;
  + this.dispatchEvent(new CustomEvent(eventToggle, init));
  + }
  + }
  +
  + /**
  + * Handler for the `click` event on the expando button.
  */
  private _handleClickExpando() {
  - this.expanded = !this.expanded;
  + this._handleUserInitiatedToggle();
  }
  /**
  @@ -144,6 +164,21 @@ class BXSideNavMenu extends FocusMixin(LitElement) {
  return `${prefix}-side-nav-menu-item`;
  }
  + /**
  + * The name of the custom event fired before this side nav menu is being toggled upon a user gesture.
  + * Cancellation of this event stops the user-initiated action of toggling this side nav menu.
  + */
  + static get eventBeforeToggle() {
  + return `${prefix}-side-nav-menu-beingtoggled`;
  + }
  +
  + /**
  + * The name of the custom event fired after this side nav menu is toggled upon a user gesture.
  + */
  + static get eventToggle() {
  + return `${prefix}-side-nav-menu-toggled`;
  + }
  +
  static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader
  }
  