toggle(compact = false) {
        if (this.responsiveEnabled()) {
            if (this.responsiveState === NbSidebarComponent.RESPONSIVE_STATE_MOBILE) {
                compact = false;
            }
        }
        const closedStates = [NbSidebarComponent.STATE_COMPACTED, NbSidebarComponent.STATE_COLLAPSED];
        if (compact) {
            this.state = closedStates.includes(this.stateValue) ?
                NbSidebarComponent.STATE_EXPANDED : NbSidebarComponent.STATE_COMPACTED;
        }
        else {
            this.state = closedStates.includes(this.stateValue) ?
                NbSidebarComponent.STATE_EXPANDED : NbSidebarComponent.STATE_COLLAPSED;
        }
    }
/**
     * Toggles sidebar state (expanded|collapsed|compacted)
     * @param {boolean} compact If true, then sidebar state will be changed between expanded & compacted,
     * otherwise - between expanded & collapsed. False by default.
     *
     * Toggle sidebar state
     *
     * ```ts
     * this.sidebar.toggle(true);
     * ```
     */
Toggles sidebar state (expanded|collapsed|compacted)
@param {boolean} compact If true, then sidebar state will be changed between expanded & compacted,
otherwise - between expanded & collapsed. False by default.

Toggle sidebar state


Toggles sidebar state ( expanded|collapsed|compacted ) @param { boolean } compact If true then sidebar state will be changed between expanded & compacted otherwise - between expanded & collapsed . False by default . Toggle sidebar state
toggle(compact = false) {
        if (this.responsiveEnabled()) {
            if (this.responsiveState === NbSidebarComponent.RESPONSIVE_STATE_MOBILE) {
                compact = false;
            }
        }
        const closedStates = [NbSidebarComponent.STATE_COMPACTED, NbSidebarComponent.STATE_COLLAPSED];
        if (compact) {
            this.state = closedStates.includes(this.stateValue) ?
                NbSidebarComponent.STATE_EXPANDED : NbSidebarComponent.STATE_COMPACTED;
        }
        else {
            this.state = closedStates.includes(this.stateValue) ?
                NbSidebarComponent.STATE_EXPANDED : NbSidebarComponent.STATE_COLLAPSED;
        }
    }
toggle ( compact = false ) { if ( this . responsiveEnabled ( ) ) { if ( this . responsiveState === NbSidebarComponent . RESPONSIVE_STATE_MOBILE ) { compact = false ; } } const closedStates = [ NbSidebarComponent . STATE_COMPACTED , NbSidebarComponent . STATE_COLLAPSED ] ; if ( compact ) { this . state = closedStates . includes ( this . stateValue ) ? NbSidebarComponent . STATE_EXPANDED : NbSidebarComponent . STATE_COMPACTED ; } else { this . state = closedStates . includes ( this . stateValue ) ? NbSidebarComponent . STATE_EXPANDED : NbSidebarComponent . STATE_COLLAPSED ; } }
Toggles sidebar state (expanded|collapsed|compacted)
 @param {boolean} compact If true, then sidebar state will be changed between expanded & compacted,
 otherwise - between expanded & collapsed.
Toggles sidebar state ( expanded|collapsed|compacted ) @param { boolean } compact If true then sidebar state will be changed between expanded & compacted otherwise - between expanded & collapsed .