Socket
Socket
Sign inDemoInstall

fancy-select

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fancy-select - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

10

index.js

@@ -15,3 +15,5 @@ var mercury = require('mercury')

data.filter = data.filter || function (opt, query, value) {
if (opt.id === '__create__') return {keep: true}
// keep any that start with __
if (opt.id && opt.id.indexOf('__') === 0) return {keep: true}
// omit value

@@ -24,2 +26,3 @@ for (var i = value.length - 1; i >= 0; i--) {

// match query
try {

@@ -76,3 +79,5 @@ var regex = new RegExp(query || '', 'i')

options: tree.state.options,
isOpen: mercury.value(true)
isOpen: mercury.value(true),
placeholder: mercury.value(data.placeholder || '')
})

@@ -82,3 +87,2 @@

state: state,
events: {},
setOptions: tree.setOptions,

@@ -85,0 +89,0 @@ setQuery: tree.setQuery

{
"name": "fancy-select",
"description": "fancy select",
"version": "0.5.0",
"version": "0.6.0",
"repository": {

@@ -6,0 +6,0 @@ "url": "nrw/fancy-select"

@@ -37,4 +37,5 @@ var mercury = require('mercury')

autocomplete: 'off',
placeholder: state.placeholder,
style: {
width: measureString(state.query) + 'px'
width: maxWidth([state.query, state.placeholder]) + 'px'
},

@@ -128,2 +129,13 @@ className: styles.input.className,

function maxWidth (strs) {
var one, max = 0
strs.forEach(function (str) {
one = measureString(str)
if (one > max) {
max = one
}
})
return max
}
function measureString (str, current) {

@@ -130,0 +142,0 @@ if (!str) return 0

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc