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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@use-angular/types

v1.0.3

Published

O componente UseTypes gerencia seletores de opções do tipo Rádio Button.

Downloads

14

Readme

Types

use-pattern npm github

@use-pattern/types

O componente UseTypes gerencia seletores de opções do tipo Rádio Button.

Conteúdo

  1. Instalar
  2. Utilizar
  3. Aprender
  4. Contribuir

Instalar

Instale a partir do npm:

npm install @use-pattern/types --save

Utilizar

Aprender

src/app/app.component.ts

import {Component} from '@angular/core';
import {UseTypesInterface} from '@use-pattern/types';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {

  //Titulo do componente
  public title: string = 'Tipo';
    
  // Lista de opções de tipos
  public listTypes: Array<UseTypesInterface> = [
    {option: 'Mantas', value: 'mantas'},
    {option: 'Almofadas', value: 'almofadas'},
    {option: 'Capas de Almofadas', value: 'capas de almofadas'},
    {option: 'Porta Travesseiro', value: 'porta travesseiro', disabled: true},
    {option: 'Peseira', value: 'peseira'},
    {option: 'Jogo Americano', value: 'jogo americano'}
  ];

  //Evento disparado sempre que um item for selecionado
  public onChangeType(item): void {
    console.log('onChangeType', item);
  }
}

UseTypesInterface

  {
    option: string;
    value: string;
    disabled?: boolean;
  }

src/app/app.template.html

<use-types #type
           [title]="title"
           [listItems]="listTypes"
           [selectedItem]="{option: 'Capas de Almofadas', value: 'capas de almofadas'}"
           (change)="onChangeType($event)"
></use-types>

<div class="selected">
  Item Selecionado: {{type.selectedItem?.value}}
</div>

src/styles.scss

Estrutura de estilo para personalização do componente

.use-types {
  .title{
  }
  .grid {
    .mat-radio-group {
      .mat-radio-button {
      }
    }
  }
}

*Utiliza !important para forçar a sobrposição das configurações de estilos.

Propriedades públicas

| Propriedade | Descrição | Tipo | | ----------------- | --------------------------------------------------------------------------------- | :------: | | title | Título do componente | string | | listItems | Lista de items | UseTypesInterface | | selectedItem | Item selecionado | UseTypesInterface |

Eventos

| Propriedade | Descrição | Tipo | | ----------------- | --------------------------------------------------------------------------------- | :------: | | (change)onChangeType | Evento disparado sempre que um item for selecionado | UseTypesInterface |

Contribuir

Contibuições são sempre muito bem vindas! As contribuições não precisam serem somente através de desenvolvimentos de códigos, qualquer ajuda com ideias, sugestões, melhorias na documentação ou doações para os desenvolvedores são sempre muito apreciadas!

Participe da comunidade Projeto que Vale e colabore da forma que achar melhor.

Licença

MIT License

Copyright (c) 2018 PROJETO QUE VALE

É concedida permissão, gratuitamente, a qualquer pessoa que obtenha uma cópia deste software e dos arquivos de documentação associados (o "Software"), para negociar o Software sem restrições, incluindo, sem limitação, os direitos de uso, cópia, modificação e fusão , publicar, distribuir, sublicenciar e / ou vender cópias do Software, e permitir que as pessoas a quem o Software é fornecido o façam, sujeitas às seguintes condições:

O aviso de copyright acima e este aviso de permissão devem ser incluídos em todas as cópias ou partes substanciais do Software.

O SOFTWARE É FORNECIDO "NO ESTADO EM QUE SE ENCONTRA", SEM NENHUM TIPO DE GARANTIA, EXPRESSA OU IMPLÍCITA, INCLUINDO, MAS NÃO SE LIMITANDO ÀS GARANTIAS DE COMERCIALIZAÇÃO, ADEQUAÇÃO A UM FIM ESPECÍFICO E NÃO VIOLAÇÃO. EM NENHUMA CIRCUNSTÂNCIA, OS AUTORES OU PROPRIETÁRIOS DE DIREITOS DE AUTOR PODERÃO SER RESPONSABILIZADOS POR QUAISQUER REIVINDICAÇÕES, DANOS OU OUTRAS RESPONSABILIDADES, QUER EM ACÇÃO DE CONTRATO, DELITO OU DE OUTRA FORMA, DECORRENTES DE, OU EM CONEXÃO COM O SOFTWARE OU O USO OU OUTRAS NEGOCIAÇÕES NO PROGRAMAS.