Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

atom-select-list

Package Overview
Dependencies
Maintainers
6
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atom-select-list - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

2

package.json
{
"name": "atom-select-list",
"version": "0.4.0",
"version": "0.5.0",
"description": "A general-purpose select list for use in Atom packages",

@@ -5,0 +5,0 @@ "main": "./src/select-list-view.js",

@@ -45,2 +45,3 @@ # atom-select-list

* (Optional) `query: String`: a string that will replace the contents of the query editor.
* (Optional) `selectQuery: Boolean`: a boolean indicating whether the query text should be selected or not.
* (Optional) `order: (item1: Object, item2: Object) -> Number`: a function that allows to change the order in which items are shown.

@@ -47,0 +48,0 @@ * (Optional) `emptyMessage: String`: a string shown when the list is empty.

@@ -114,2 +114,10 @@ const {Disposable, CompositeDisposable, TextEditor} = require('atom')

if (props.hasOwnProperty('selectQuery')) {
if (props.selectQuery) {
this.refs.queryEditor.selectAll()
} else {
this.refs.queryEditor.clearSelections()
}
}
if (props.hasOwnProperty('order')) {

@@ -116,0 +124,0 @@ this.props.order = props.order

@@ -510,2 +510,25 @@ /** @babel */

})
it('changing and selecting the query', async () => {
let selectListView = new SelectListView({
itemsClassList: [], items: [],
elementForItem: (i) => document.createElement('li')
})
await selectListView.update({query: 'test q'})
assert.equal(selectListView.getQuery(), 'test q')
assert.equal(selectListView.refs.queryEditor.getSelectedText(), '')
await selectListView.update({query: 'test q2', selectQuery: true})
assert.equal(selectListView.getQuery(), 'test q2')
assert.equal(selectListView.refs.queryEditor.getSelectedText(), 'test q2')
await selectListView.update({query: 'test q3', selectQuery: false})
assert.equal(selectListView.getQuery(), 'test q3')
assert.equal(selectListView.refs.queryEditor.getSelectedText(), '')
await selectListView.update({selectQuery: true})
assert.equal(selectListView.getQuery(), 'test q3')
assert.equal(selectListView.refs.queryEditor.getSelectedText(), 'test q3')
})
})

@@ -512,0 +535,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