Cat UI
GitHub
  • Comece por aqui
    • 1. Instalação
      • Icones
      • Bootstrap
    • 2. Aplicando Tema
    • 3. Estrutura da aplicação
    • 4. Segurança
      • OpenID (Opcional)
      • Claims (Optional)
  • Menu
    • Sidenav
    • Toolbar
    • Dropdown
    • Tab
  • Exibição de Dados
    • Datatable
    • Componentes Dinâmicos
    • Exportação e Download de Dados
      • .csv
      • .xlsx
      • Visualizar .pdf
      • Download base64
    • Chip
  • Formulário
    • Formulário Dinâmico
    • Lista de Itens
    • Campos Personalizados
    • Stepper
    • Expansive Panel
    • Filtro Sobre Demanda
  • Janelas e Alertas
    • Dialog
    • Confirm
    • Alert
    • Snackbar
    • SideWindow
    • Notifications
    • Tooltip
  • Loaders
    • Spinner
    • Loader Page
  • Botões
    • Button
  • Abstrações
    • ServiceBase
    • ComponentBase
    • CRUDComponentBase
    • FormBase
  • Guias
    • Criando uma Aplicação de CRUD
      • Criando Projeto
      • Estrutura
      • Tela de Login
      • Menu
      • Tela de Adoção
      • Serviço HTTP
      • Lista de Pets
      • Formulário de Cadastro e Edição
      • Excluir Pet
      • Conclusão
Powered by GitBook
On this page

Was this helpful?

  1. Janelas e Alertas

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.

Importante

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

Uso

side-window-example.component.ts
import { Component } from "@angular/core";
import { CatDynamicComponentDataInterface } from "@catrx/ui/dynamic-component";

@Component({
  template: `<h2>{{data}}</h2>`
})
export class SideWindowExampleComponent implements CatDynamicComponentDataInterface {
  data: string;
}
page-side-window.component.html
<cat-toolbar [config]="getToolbarInfo()">
  <nav buttons>
    <button (click)="open()" class="btn btn-primary btn-sm">
      Abrir Janela Lateral
    </button>
  </nav>
</cat-toolbar>
page-side-window.component.ts
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.')
    });
  }
}
page-side-window.module.ts
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 {}
PreviousSnackbarNextNotifications

Last updated 2 years ago

Was this helpful?