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

@lblanco/ngx-metronic-components

v1.1.18

Published

Angular components for Metronic

Downloads

1

Readme

1. Metronic Angular Components

1.1. Modal

  • idModal: number
  • titulo: string
  • hideModal: boolean = false
<mc-modal [idModal]="1" [titulo]="'My modal" [hideHeader]="false">
    <mc-modal-banner>
        Banner del modal
    </mc-modal-banner>
    <mc-modal-body>
        Cuerpo del Modal
    </mc-modal-body>
    <mc-modal-footer>
        Footer del Modal
    </mc-modal-footer>
</mc-modal>
/*Para abrir y cerrar el modal se debe acceder a las funciones show y hide.*/
/*Para eso se usa ViewChild*/

@ViewChild(ModalComponent) modal

show(){
    this.modal.show()
}

hide(){
    this.modal.hide
}

/*--------------------------------------*/
/*Importante! Al usar ViewChild modal sera undefined hasta que la vista se termine de renderizar*/
/*Si se quiere mostrar el modal cuando inicia un componente hay ejecutar show dentro del afterViewInit*/

/*Correcto*/
ngAfterViewInit(){
    this.modal.show() //Funciona OK!
}

/*Incorrecto*/
ngOnInit(){
    this.modal.show() //Cannot read property show of undefined
}

1.2. Accordion

  • titulo: string
<mc-accordion [titulo]="'My accordion" >
    <mc-accordion-body>
        Cuerpo del Accordion
    </mc-accordion-body>
    <mc-accordion-footer>
        Footer del Accordion
    </mc-accordion-footer>
</mc-accordion>

1.3. Portlet

<mcc-portlet-container>
    <mcc-portlet-header>
        Header del Portlet
    </mcc-portlet-header>
    <mcc-portlet-body>
        Cuerpo del Portlet
    </mcc-portlet-body>
    <mcc-portlet-footer>
        Footer del Portlet
    </mcc-portlet-footer>
</mcc-portlet-container>

1.4. Tabla (Datatable.js)

  • datos: any[]
  • nombreColumnas: string[]
  • valorColumna: string[]
  • acciones: { callback: Function, class: string, name: string}[]
  • totalesACalcular: string[]
  • promediosACalcular: string[]
  • imagen: string[]
  • fallbackImage: string (imagen que se va a mostrar si la imagen no se puede mostrar por algun motivo)
  • checked: boolean = false
  • onCheck: EventEmitter
  • pipes = {}
<mc-tabla
    [datos]="misDatos"
    [nombreColumnas]="['Nombre', 'Saldo Neto']"
    [valorColumnas]="['nombre','saldo']"
    [totalesACalcular]="'saldo'"
    [promediosACalcular]="'saldo'"
    [imagen]="'./imagen'"
    [fallBackImagen]="'./fallBackImagen'"
    [checked]="true"
    (onCheck)="realizarAccionOnCheck($event)"
    [acciones]="misAcciones"
    [pipes]="misPipes"
>
</mc-tabla>

    /* valorColumna, totalesACalcular, promediosACalcular, y los pipes hacen referencia a las claves de los objetos que se envian al componeneste por el input datos*/

    misDatos : Persona[] = [{nombre: 'Sandra', saldo: 100}]

    realizarAccion(persona: Persona){
        console.log(persona)
    }

    acciones = [{
        callback: this.realizarAccion.bind(this),
        class: "flaticon flaticon-edit"
        name: "Realizar accion"
    }]

    /*O para ahorrar el bind(this)*/

    //Se escribe la funcion como un arrow function :)
    realizarAccion = (persona: Persona) => {
        console.log(persona)
    }

    acciones = [{
        callback: this.realizarAccion,
        class: "flaticon flaticon-edit"
        name: "Realizar accion"
    }]

    /*Sobre los pipes*/

    /*Los pipes los funciones que se utilizan para modificar como los datos seran mostrados al usuario. No modifican los datos, solo se altera la forma en que se muestran por pantalla*/

    misPipes = {
        nombre: (nombre) => nombre.toUpperCase(),
        saldo: this.mostrarDosDecimales
    }

    mostrarDosDecimales = (saldo) => saldo.toFixed(2)

1.5. Tabs

  • active: boolean = false
  • titulo: string
<mc-tabs>
    <mc-tab-item [active]="true" titulo="Tab 1">
    Cuerpo del tab 1
    </mc-tab-item>
    <mc-tab-item titulo="Tab 2">
    Cuerpo del tab 2
    </mc-tab-item>
</mc-tabs>

1.6. Estadisticas (Chart.js)

(Simplificado por que es un quilombo)

Se proveen las interfaces

  • GraficoIndicadorI: { titulo: string, valores: Array | ((escala?: string) => Promise) tipo: 'indicador', }
  • IndicadorI: { titulo: string, subtitulo: string, valorActual: number, valorAnterior?: number, color?: string }
  • tablaI: { titulo: string, nombreColumnas: Array, valorColumnas: Array, datos: Array, mostrarTotalesVertical: boolean, mostrarPromediosVertical: boolean }
  • GraficoI: { valores: object | ((escala?: string) => Promise), titulo: string, tipo: 'barra' | 'linea' | 'torta', mostrarTabla?: boolean, mostrarTotalesVertical?: boolean, mostrarPromediosVertical?: boolean, mostrarTotalesHorizontal?: boolean, mostrarPromediosHorizontal?: boolean, mostrarCambiarTipo?: boolean, fullScreen?: boolean, stacked?: boolean, colores?: { nombre: string, color: string }[] }

1.6.1. Grafico torta basico

<mc-grafico-borras
    [valores]="misValores"
>
</mc-grafico-barras>
misValores= [{
    nombre: 'Sandra',
    saldo: 100
}]