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

@tillhub/vue-search-filter

v1.11.4

Published

Search input field widht dropdown for filters

Downloads

10

Readme

@tillhub/vue-search-filter CircleCI

Vue search input with dropdown for more filters

Install

npm install --save @tillhub/vue-search-filter

Usage

Please see example folder for complete code example. Note, that the css has to be imported separately. This library assumes that element-ui is being used by the caller.

To see the example in action:

npm run serve
<template>
  <th-search-filter
    @submit="handleSubmit"
    @reset="handleReset"
    :width="500"
    locale="de"
    resetButtonText="Reset now"
    input-placeholder="Search in customer names"
  >
    <template slot="dropdown-content" slot-scope="{input, addTag}">
      <branch-filter :input="input" :add-tag="addTag"/>
      <status-filter :input="input" :add-tag="addTag"/>
      <active-switch :input="input" :add-tag="addTag"/>
      <date-picker :input="input" :add-tag="addTag"/>
    </template>
  </th-search-filter>
</template>

<script>
import ThSearchFilter from '../src/index.vue'
import BranchFilter from './BranchFilter.vue'
import StatusFilter from './StatusFilter.vue'
import ActiveSwitch from './ActiveSwitch.vue'
import DatePicker from './DatePicker.vue'

export default {
  components: {
    ThSearchFilter,
    BranchFilter,
    StatusFilter,
    ActiveSwitch,
    DatePicker
  },
  methods: {
    handleSubmit (result) {
      console.log('submit', result)
    },
    handleReset () {
      console.log('reset')
    }
  }
}

</script>

Attributes

| Attribute | Type | Required | Example | Default | Description | |------------------|--------|----------|----------------------|----------|---------------------------------------------------------------------| | width | number | no | 500 | 460 | sets fixed width of component in pixels, minimum is 350 | | locale | string | no | "de" | "en" | Currently only German and English is supported. Only 'de' and 'en ' | | inputPlaceholder | string | no | "Search in products" | "Search" | Sets the placeholder text in the input field | | searchButtonText | string | no | "Submit" | "Search" | Sets a custom text in the blue submitting button | | resetButtonText | string | no | "Reset" | "Cancel" | Sets a custom text in the reset button |

Events

| Event | Description | Params | |-----------------|-----------------------------------------------------|---------| | submit | triggers when the user clicks on "search" button | filters | | reset | triggers when the user clicks on the "reset" button | -- | | close-dropwdown | triggers when the user closes the dropwdown | -- |

Slot

One named slot it provided: "dropwdown-content". It is highly advised to refer to the example folder to see how this slot is used. Understanding the parent-child communication is crucial as the dropdown content and input content are closely linked.

| Name | Type | Example | Description | |--------|----------|----------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | input | object | { key1: { label: "product name", value: "product uuid"}, key2: { label: "branch name", value: "branch uuid"} } | this is an object that depicts the current state of the tags in the input field, on every change they are passed to the slot so the consumer can update the slot children accordingly. The key name is determined by the user, when it is being passed in the "addTag" method (see below). | | addTag | function | ({ name, value, label }) => {} | This method communicates the changes in the slot children to the parent.It adds tags to the parent input field.E.g. it can be called on every change in the child.The method expects to be called with an object with at least the "name" prop.If "label" is falsey, it will default to "value". |

License

MIT © qtotuan