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

vue3-search-select

v1.0.7

Published

A lightweight and versatile Vue search and select package allowing for efficient searching, selection, and modification of items

Downloads

464

Readme

Vue 3 Search Select Component

A light-weight, flexible and easy-to-use Vue 3 SearchSelect component that allows users to search and select options from a dynamic or static list.

Demo

Check out the live demonstration to see the package in action.

Installation

Install the package via npm:

npm i vue3-search-select

Basic Usage

import SearchSelect from 'vue3-search-select'
import "vue3-search-select/Vue-Search-Select.css";
 <SearchSelect
    :data="pseudoEmployeeData"
    placeholderName="Employee"
    displayKey="firstName lastName - employeeId"
    :selectMax="2" // optional
    v-model="employee"
    primaryKey="employeeId"
    :defaultValue="['emp-0001']" // optional
  />

Explanations

  • data: This is where you pass your data to, it houses/consumes your data.

  • placeholderName: This is what is attached to the count of the things you will pick in the input box e.g 2 Employee Selected. Take note of the "Employee that was passed to the component". You can change it to whatever you want.

  • displayKey: This is what will be displayed from the data you are passing. You can decide to add a separator. From the example component you can decide to use

firstName lastName // coming from the api/json you are consuing

OR

firstName lastName | employeeId // coming from the api/json you are consuing
  • selectMax: This is an optional prop, if you want to pick from the list inifintely, you can take off the selectMax prop from the component. But if you have need to cap the number of items to be picked from the list then add the selectMax prop. Once it is met, all other items will be disabled.

  • v-model: of course we know what v-model is.

  • primaryKey: Primary key is an essential part of this component, because it tells the component to keep track of a particular key in the array that is being passed to it and this is what v-model will be keep track of. If your primary key is employeeId, as you keeping picking from the list, it will keep adding employeeId to v-model as an array e.g [00000, 22222, 44444].

  • defaultValue: This is an optional prop. This is the prop you will use if you need to pass default value that matches the primaryKey. E.g in an edit page, you will certainly be passing default value.

Other optional props

| Prop | Description | Default Value | | --------------------- | ----------------------------------------------------------------------------------------------------- | ----------------- | | listBackgroundColor | This is the background of the dropdown list. | #e5e7eb | | inputBorderColour | This is the input border colour. | 1px solid gray | | inputFocusBorderColor | When the input is active or focused on, what colour do you want to show. this is where to specify it. | 1px solid #6a7ada |

Happing coding!