# SideWindow

O SideWindow é uma janela lateral que permite exibir conteúdos da sua escolha sem a necessidade de paginação, ideal para exibir detalhes extensos de um item de uma tabela.

{% hint style="info" %}
**Importante**

Ao realizar transições de rota, a janela será automaticamente fechada.
{% endhint %}

### Uso

{% code title="side-window-example.component.ts" lineNumbers="true" %}

```typescript
import { Component } from "@angular/core";
import { CatDynamicComponentDataInterface } from "@catrx/ui/dynamic-component";

@Component({
  template: `<h2>{{data}}</h2>`
})
export class SideWindowExampleComponent implements CatDynamicComponentDataInterface {
  data: string;
}
```

{% endcode %}

{% code title="page-side-window\.component.html" %}

```html
<cat-toolbar [config]="getToolbarInfo()">
  <nav buttons>
    <button (click)="open()" class="btn btn-primary btn-sm">
      Abrir Janela Lateral
    </button>
  </nav>
</cat-toolbar>
```

{% endcode %}

{% code title="page-side-window\.component.ts" lineNumbers="true" %}

```typescript
import { Component } from '@angular/core';
import { CatComponentBase } from '@catrx/ui/common';
import { CatSideWindowService } from '@catrx/ui/side-window';
import { SideWindowExampleComponent } from './side-window-example.compoent';

@Component({
  templateUrl: './page-side-window.component.html',
})
export class PageSideWindowComponent extends CatComponentBase {
  constructor(private sideWindowService: CatSideWindowService) {
    super();
  }

  public open() {
    this.sideWindowService.open(SideWindowExampleComponent, {
      data: 'Olá Mundo',
      onClose: () => alert('Fechou a Janela Lateral.')
    });
  }
}
```

{% endcode %}

{% code title="page-side-window\.module.ts" lineNumbers="true" %}

```typescript
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CatToolbarModule } from '@catrx/ui/toolbar';
import { PageSideWindowComponent } from './page-side-window.component';
import { SideWindowExampleComponent } from './side-window-example.compoent';
import { PageSideWindowRoutingModule } from './page-side-window.routing.module';

@NgModule({
  declarations: [PageSideWindowComponent, SideWindowExampleComponent],
  imports: [
    CommonModule,
    CatToolbarModule,
    PageSideWindowRoutingModule
  ],
})
export class PageSideWindowModule {}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.catui.igordrangel.com.br/janelas-e-alertas/sidewindow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
