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

creare-core-avl-lib

v1.0.64

Published

Biblioteca do mapa AVL da Creare Sistemas

Downloads

383

Readme

Creare Core Avl Library

GitHub repo size GitHub language count GitHub forks Bitbucket open issues Bitbucket open pull requests

Biblioteca do mapa AVL da Creare Sistemas.

Ajustes e melhorias

O projeto ainda está em desenvolvimento e as próximas atualizações serão voltadas nas seguintes tarefas:

  • [x] Criação do componente do mapa AVL
  • [x] Criação do componente de filtros
  • [x] Criação do componente de Tabela
  • [x] Feature de cercas para o mapa
  • [ ] Adição de outros tipos de veiculos para o mapa
  • [x] Adição de novos tipos de filtros
  • [ ] Permitir alterar cores, temas e etc
  • [x] Adição de novos icones

💻 Pré-requisitos

Antes de começar, verifique se você atendeu aos seguintes requisitos:

  • Você instalou a versão mais recente de <node / 16.0>

🚀 Instalando Creare Core Avl Library

Para instalar o Creare Core Avl Library, siga estas etapas:

npm install

Para rodar o Creare Core Avl Library, siga estas etapas:

npm run storybook

Aqui você vai conseguir ver exemplos dos componentes que a lib exporta.

Sempre que um novo componente for criado, deve ser criado um novo stories do Storybook (component.stories.tsx)

Caso for criado uma nova prop de um componente existente, deve ser adicionado esse exemplo de prop dentro do stories desse componente

🚀 Publicando alterações

O comando abaixo já vai buildar, alterar a versão da lib e publicar no npm

npm build

☕ Usando Creare Core Avl Library nos projetos

Para usar Creare Core Avl Library, siga estas etapas:

npm install creare-core-avl-lib

Exemplo de utilização

import { data } from "../data/data";
import { Datatable, Filters, DataProvider, Map } from "creare-core-avl-lib";
import "/node_modules/creare-core-avl-lib/dist/style.css"; <<<< Necessário import dos styles da lib



<DataProvider data={data}>
      <div className="relative h-[630px] mb-5">
        <Map
          type="truck"
          isSearchable
          style={{
            width: "100%",
            height: "630px",
          }}
          center={[1.28333, 103.841]}
          zoom={15}
        />
      </div>
      <Filters
        filters={[
          {
            type: "search",
          },
          {
            accessor: "registration",
            type: "select",
            isSearchable: true,
            options: uniqueByColumn(data, "registration"),
          },
          {
            accessor: "latitude",
            type: "select",
            isSearchable: true,
            options: uniqueByColumn(data, "latitude"),
          },
          {
            accessor: "speed",
            type: "max",
            showButtons: true,
            placeholder: "Speed",
          },
          {
            accessor: "ocurrenceTime",
            type: "date-range",
          },
          {
            accessor: "ignition",
            type: "boolean",
            trueLabel: "Online",
            falseLabel: "Offline",
          },
        ]}
      />
      <Datatable
        columnsConfig={[
          {
            accessor: "id",
            header: () => <span>Id</span>,
            cell: (info: any) => info.getValue(),
            meta: {
              width: "2%",
            },
          },
          {
            accessor: "registration",
            header: () => <span>Vehicle</span>,
            cell: (info: any) => info.getValue(),
            meta: {
              width: "15%",
            },
          },
          {
            accessor: "latitude",
            header: () => <span>Latitude</span>,
            cell: (info: any) => info.getValue(),
            meta: {
              width: "10%",
            },
          },
          {
            accessor: "longitude",
            header: () => <span>Longitude</span>,
            cell: (info: any) => info.getValue(),
            meta: {
              width: "10%",
            },
          },
          {
            accessor: "speed",
            header: () => <span>Speed</span>,
            cell: (info: any) => info.getValue(),
            meta: {
              width: "13%",
            },
          },
          {
            accessor: "ignition",
            header: () => <span>Ignition</span>,
            cell: (info: any) =>
              info.getValue() ? (
                <span className="w-[12px] h-[12px] rounded-xl bg-green-700 block" />
              ) : (
                <span className="w-[12px] h-[12px] rounded-xl bg-red-700 block" />
              ),
            meta: {
              align: "center",
              width: "10%",
            },
          },
          {
            accessor: "loadStatus",
            header: () => <span>Loaded</span>,
            cell: (info: any) => (
              <span
                style={{
                  textTransform: "capitalize",
                }}
              >
                {info.getValue().toLowerCase().replace("_", " ")}
              </span>
            ),
            meta: {
              align: "center",
              width: "10%",
            },
          },
          {
            accessor: "odomoter",
            header: () => <span>Hourmeter</span>,
            cell: (info: any) => info.getValue(),
            meta: {
              width: "10%",
            },
          },
          {
            accessor: "ocurrenceTime",
            header: () => <span>Date</span>,
            cell: (info: any) => format(info.getValue(), "yyyy/MM/dd HH:mm:ss"),
            meta: {
              width: "20%",
            },
          },
        ]}
      />
    </DataProvider>

📫 Contribuindo para Creare Core Avl Library

Para contribuir com Creare Core Avl Library, siga estas etapas:

  1. Bifurque este repositório.
  2. Crie um branch: git checkout -b <nome_branch>.
  3. Faça suas alterações e confirme-as: git commit -m '<mensagem_commit>'
  4. Envie para o branch original: git push origin <nome_do_projeto> / <local>
  5. Crie a solicitação de pull.

Como alternativa, consulte a documentação do GitHub em como criar uma solicitação pull.