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 🙏

© 2025 – Pkg Stats / Ryan Hefner

miniform-kl

v0.0.1

Published

Mini form con web components, autocomplete and dropdown

Readme

miniform-kl Component

El componente miniform-kl es un formulario mínimo que incluye un campo de entrada adicional y un campo de autocompletado. Este componente permite buscar opciones a través de una URL de autocompletado y guardar los datos en una URL de guardado.

Propiedades

  • inputName (string): Nombre del campo de entrada adicional.
  • inputLabel (string): Etiqueta del campo de entrada adicional.
  • buttonName (string): Texto del botón de guardar.
  • inputPlaceholder (string): Placeholder del campo de entrada adicional. Valor por defecto: "Ingrese un valor".
  • autocompleteUrl (string): URL para obtener las opciones del autocompletado.
  • saveUrl (string): URL para guardar los datos.
  • autocompleteFieldName (string): Nombre del campo para el valor del autocompletado.
  • inputFieldName (string): Nombre del campo para el valor del input adicional.

Eventos

  • searchResults: Emitido cuando se realiza una búsqueda. Contiene los valores del autocompletado y del campo de entrada adicional.

Métodos

  • handleSearch(): Realiza la búsqueda y guarda los datos en la URL proporcionada.

Uso

<miniform-kl
  inputName="searchInput"
  inputLabel="Descripción"
  buttonName="Guardar"
  inputPlaceholder="Ingrese un valor"
  autocompleteUrl="http://[::1]:3001/users"
  saveUrl="https://api.example.com/save"
  autocompleteFieldName="users"
  inputFieldName="description"
></miniform-kl>

Ejemplo

<!DOCTYPE html>
<html dir="ltr" lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
    <title>Stencil Component Starter</title>
    <script type="module" src="/build/miniform.esm.js"></script>
    <script nomodule src="/build/miniform.js"></script>
  </head>
  <body>
    <h1>Prueba del componente miniform</h1>
    <miniform-kl
      inputName="searchInput"
      inputPlaceholder="Ingrese un valor"
    ></miniform-kl>

    <script>
      // Escuchar eventos personalizados del componente
      const miniform = document.querySelector('miniform-kl');
      miniform.addEventListener('searchResults', (event) => {
        console.log('Cambios form', event.detail);
      });

      miniform.buttonName = 'Guardar';
      miniform.inputLabel="Descripcion";
      miniform.autocompleteUrl = 'http://[::1]:3001/users';
      miniform.saveUrl="https://api.example.com/save";
      miniform.autocompleteFieldName="users";
      miniform.inputFieldName="description";

      miniform.addEventListener('optionSelected', (event) => {
        console.log('Opción seleccionada:', event.detail);
      });

      miniform.addEventListener('inputChange', (event) => {
        console.log('Texto ingresado:', event.detail);
      });
    </script>
  </body>
</html>