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

@govbr-ds-testing/webcomponents-angular

v1.23.5

Published

Biblioteca de integração dos Web Components GovBR-DS com o Angular

Downloads

573

Readme

Webcomponents Angular

Bibiloteca de componentes angular que encapsulam os Web Components GovBR-DS.

Instalação

Instale os pacotes abaixo:

npm install --save-dev @govbr-ds/core @govbr-ds-testing/webcomponents @govbr-ds-testing/webcomponents-angular

Uso

Inclua o módulo WebcomponentsAngularModule no arquivo app.module.ts da sua aplicação.

import { WebcomponentsAngularModule } from '@govbr-ds-testing/webcomponents-angular'
import "@govbr-ds/core/dist/core.min.css";

...

@NgModule({
    ...
    imports: [
        WebcomponentsAngularModule,
    ],
    ...
})
export class AppModule { }

E no .angular.json:

"architect": {
    "build": {
        "options": {
            "styles": [
                "node_modules/@govbr-ds/core/dist/core.min.css"
            ]
        }
    }
}

O core.min.css é quem define os valores dos tokens de CSS usados.

Em seguida, você pode utilizar qualquer web component disponibilizado pela biblioteca de Web Components diretamente nos templates HTML:

<br-button type="submit" emphasis="primary">
    Enviar Formulário
</br-button>

Consulte a documentação da biblioteca para saber quais propriedades cada componente pode receber.

Uso dos Web Components seguindo as regras do angular

Os Web Components podem ser usados como qualquer outra tag HTML e funcionam no mecanismo de reatividade do angular, como "one-way-binding", "two-way-binding" e "events".

<br-button
    [active]="isActive"
    [disabled]=isDisabled
    emphasis="primary"
    type="button"
    (brComponentDidLoad)="onComponentDidLoad()"
>{{ label }}
</br-button>

Como pode ser notado, os Web Components emitem eventos de ciclo de vida, que pode ser ouvidos pelo angular, para executar uma determinada ação. Consulte a documentação do componente para saber mais sobre os eventos de ciclo de vida.

Estrutura de pastas e arquivos

- component-library
  - src
    - lib
      - stencil-generated
      - component-library.module.ts
    - index.ts

Ao gerar um build da biblioteca te Web Components os arquivos da pasta src/lib/stencil-generated são deletados e recriados. Todas as alterações nesses arquivos vão ser perdidas ao gerar um novo build dos Web Components.

O Arquivo component-library.module.ts exporta os componentes e registra os componentes como custom elements.

O Arquivo index.ts é o entry point da biblioteca.

Build

Rode o comando npm run build.

Reportar bugs/necessidades

Você pode usar as issues para nos informar os problemas que tem enfrentado ao usar nossa biblioteca ou mesmo o que gostaria que fizesse parte do projeto. Por favor use o modelo que mais se encaixa na sua necessidade e preencha com o máximo de detalhes possível.

Nos comprometemos a responder a todas as issues.

Commits

Nesse projeto usamos um padrão para branches e commits. Por favor observe a documentação na nossa wiki para aprender sobre os nossos padrões.

Precisa de ajuda?

Por favor não crie issues para fazer perguntas.

Use nossos canais abaixo para obter tirar suas dúvidas:

Créditos

Os Web Components do GovBR-DS são criados pelo SERPRO juntamente com a comunidade.

Licença

Nesse projeto usamos a licença MIT.