npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@clavisco/app-header

v0.1.0

Published

**Token**: `AppHeader` > Permite presentar una barra superior en la aplicación para facilitar el acceso a ciertas funciones

Readme

Acerca de @clavisco/app-header

Token: AppHeader

Permite presentar una barra superior en la aplicación para facilitar el acceso a ciertas funciones

¿Qué resuelve?

  • Responsividad automática (ajuste dinámico de elementos en móvil/escritorio)
  • Búsqueda integrada (filtrado de rutas con redireccionamiento)
  • Personalización (botones, textos, avatar y menús configurables).
  • Soporte para NotificationCenter

Dependencias requeridas

Resumen de versión

  • Centro de notificaciones integrado
  • Menús de acceso desplegables (dropdown)
  • Búsqueda y redirrecionamiento de vistas de usuario
  • Botones de acción configurables
  • Avatar de usuario con menú personalizable
  • Toolbar responsivo que se adapta a diferentes tamaños de pantalla
  • Sistema de búsqueda automático basado en rutas configuradas

Instalación

npm install @clavisco/app-header

¿Cómo lo implemento?

  1. Importar el módulo en la aplicación Angular.
import { AppHeaderModule } from '@clavisco/app-header';
@NgModule({
   imports: [
      AppHeaderModule
        // ... otros módulos
     ]
   })
export class AppModule { }
  1. Agregar en el template
<cl-app-header>
  <router-outlet></router-outlet>
</cl-app-header>

Con esta configuración, se obtendrá una implementación básica del componente app-header.

Eventos emitidos

  1. Para habilitar la respuesta a la interacción con los botones del toolbar y del menú de usuario, es necesario registrar sus eventos en los canales correspondientes.
  • Registrar un evento en el canal OUTPUT para los botones del toolbar.
  • Registrar un evento en el canal DATA_LINE_1 para los botones del menú de usuario.
ngOnInit(): void {
  Register<CL_CHANNEL>(this.headerId, CL_CHANNEL.OUTPUT, this.ButtonsEvent, this.callbacks);
  Register<CL_CHANNEL>(this.headerId, CL_CHANNEL.DATA_LINE_1, this.handleMenuEvent, this.callbacks);
}
  1. Verificar de que la configuración del paquete @clavisco/linker esté correctamente definida y completa.
  2. Definir las funciones que se asignarán a cada botón de forma individual, según la acción que deben ejecutar.
  3. Implementar un método para manejar los eventos recibidos, utilizando el identificador del botón (buttonId) para determinar la acción correspondiente.
private handleActionEvent = (_event: ICLEvent): void => {
  const BUTTON_EVENT = JSON.parse(_event.Data);
  if (!BUTTON_EVENT.buttonId) {
      console.error('buttonId no definido en el evento:', BUTTON_EVENT);
      return;
  }
  try {
      switch (BUTTON_EVENT.buttonId) {
          case 'action1':
              this.eventAction1();
              break;
          case 'action2':
              this.eventAction2();
              break;
          default:
              console.warn('buttonId no implementado:', BUTTON_EVENT.buttonId);
          }
      } catch (error) {
          console.error('Error al manejar la acción:', error);
    }
};

Nota de Integración con @clavisco/menu: Para que el botón de menú del toolbar funcione correctamente con @clavisco/menu, el componente menú debe declararse con el identificador: MENU-ID ya que el toolbar utiliza LinkerService para emitir eventos de toggle (apertura/cierre) y buscará a componente que posea este ID.

API de Referencia

Propiedades de Entrada

| Parámetro | Tipo | Descripción | Valor por Defecto | Mandatorio | |-----------------------|----------------------|-----------------------------------------------------------------------------|-------------------|------------| | headerId | string | Identificador único para manejo de eventos | - | No | | toolbarconfiguration | IToolbarConfiguration | Configuración completa del toolbar | - | No |


Interface: IToolbarConfiguration
Parámetro: toolbarConfiguration
Descripción: Configuración global del toolbar.

| Propiedad | Tipo | Descripción | Valor por Defecto | Mandatorio | |----------------|--------------------|-----------------------------------------------------------------------------|-------------------|------------| | headerTitle | string | Título principal del toolbar | '' | No | | routes | IAppHeaderRoute[] | Rutas para el sistema de búsqueda | [] | No | | actions | IHeaderButton[] | Botones de acción | [] | No | | avatar | IHeaderAvatar[] | Configuración del avatar de usuario | [] | No | | plainText | IHeaderText[] | Textos informativos | [] | No | | avatarMenu | IUserMenu | Configuración del menú de usuario | {userInfo: false, buttonOption: []} | No |


Interface: IAppHeaderRoute
Propiedad: routes
Descripción: Listado de rutas utilizadas para el sistema de búsqueda y navegación.

| Propiedad | Tipo | Descripción | Valor por Defecto | Mandatorio | |-----------|----------|-----------------------------------------------|-------------------|------------| | Name | string | Nombre visible de la ruta | - | Sí | | Route | string | Ruta de navegación | - | Sí | | Icon | string | Ícono Material (opcional) | '' | No | Importante Asegurarse de que las rutas coincidan con las rutas mostradas en el menú.


Interface: IHeaderButton
Propiedad: actions
Descripción: Botones de acción principales que se muestran en el toolbar.

| Propiedad | Tipo | Descripción | Valor por Defecto | Mandatorio | |-----------------|---------------------------|-----------------------------------------------|-------------------|------------| | buttonId | string | Identificador único del botón | - | Sí | | label | string | Texto del botón | - | Sí | | icon | string | Ícono Material (opcional) | '' | No | | action | Structures.Enums.CL_ACTIONS; | Acción asociada al botón | '' | No | | buttonStyle | 'stroked'\|'flat'\|'raised' | Estilo del botón | '' | No | | buttonColor | string | Color del botón ('primary', 'accent', 'warn')| '' | No |


Interface: IHeaderAvatar
Propiedad: avatar
Descripción: Configuración de la imagen y datos del usuario para el avatar.

| Propiedad | Tipo | Descripción | Valor por Defecto | Mandatorio | |------------------|----------|-----------------------------------------------|-------------------|------------| | avatarImage | string | URL de la imagen de perfil | '' | No | | avatarLabel | string | Nombre a mostrar | 'Usuario' | No |


Interface: IUserMenu
Propiedad: avatarMenu
Descripción: Agregar un menú que se despliega al hacer click sobre el avatar en el toolbar.

| Propiedad | Tipo | Descripción | Valor por Defecto | Mandatorio | |------------------|--------------------|-----------------------------------------------|-------------------|------------| | userInfo | boolean | Mostrar información de usuario | false | No | | buttonOption | IUserMenuOption[] | Opciones del menú | [] | No |

Importante En la sección de información de usuario, se tomará el label del avatar como el nombre del usuario,


Interface: IUserMenuOption
Propiedad: buttonOption
Descripción: Botones de acción que se muestran en el avatarMenu.

| Propiedad | Tipo | Descripción | Valor por Defecto | Mandatorio | |------------------|----------|-----------------------------------------------|-------------------|------------| | optionId | string | Identificador único de la opción | - | Sí | | optionLabel | string | Texto a mostrar | - | Sí | | optionGlyph | string | Ícono Material (opcional) | '' | No | | action | string | Acción asociada (opcional) | '' | No |


Interface: IHeaderText
Propiedad: plainText
Descripción: Textos sin acción que se muestran en el toolbar.

| Propiedad | Tipo | Descripción | Valor por Defecto | Mandatorio | |------------------|----------|-------------------------------|-------------------|------------| | textId | string | Identificador único del texto | - | Sí | | message | string | Texto a mostrar | - | Sí | | glyph | string | Ícono Material (opcional) | '' | No |


ClavisCo 2024