![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
fancy-select
Advanced tools
Readme
A unidirectional combobox component based on the aria spec.
var mercury = require('mercury')
var FancySelect = require('fancy-select')
require('fancy-select/style') // include default stylesheet
var component = FancySelect({
options: [{
id: 'c',
title: 'Consistency'
}, {
id: 'a',
title: 'Availability'
}, {
id: 'p',
title: 'Partition Tolerance'
}],
placeholder: 'Choose Two'
})
mercury.app(document.body, component.state, component.render)
An instance of observ-struct
. Holds the state for this component. All parts of the state are subclasses of observ
.
state.options
the full option treestate.value
the current value of this comboboxstate.filtered
the option tree after it has been passed through the current filter function.state.query
the current query stringstate.active
the path of the active option in the listboxstate.isOpen
whether the dropdown is currently openstate.placeholder
the current placeholder textstate.separator
the key code for the current separatorThe render function to be passed to a main-loop
or placed into another template.
All the config options can be changed on the fly with the set
function with a matching name:
component.setOptions(options)
component.setValue(value)
component.setFilter(filter)
component.setActions(actions)
component.setQuery(query)
component.setTemplates(templates)
An array of option
objects to use as the data source for this combobox. Will be passed to option-tree-navigate
.
The properties in an option
object used by fancy-select
are:
option.id
Any option with an id will be selectable. Options without an id
will be rendered as option groups.option.title
By default, will be used as the label for an optionoption.options
An array of option
objects. The children of this option.An array of option
objects to use as the initial value. Will be passed to option-tree-navigate
. Child options will not be shown when an option with children is selected.
The function to use when filtering which options are available to select. Gets passed to option-tree-filter
. The default filter function includes these rules:
id
starts with __
id
is identical to an option already in the value
id
and title
do not match the query
string (case insensiteve).A hash of option ids to the functions that should be called when that id
is selected. Will be passed to option-select-action
.
A hash of template names to render functions. The tree of default templates is nested in this order with these names:
combobox
textbox
input
listbox
group
option
optionlabel
A render function is passed the state
, a template
function, for inserting other templates, and then any other arguments it was called with.
var templates = {
option: function (state, template, option, path) {
return h('div.option', [
// insert another named template like this.
// any arguments after the template name are
// passed to its render function
template('optionlabel', option, path)
])
}
}
The string to use as the placeholder text in the textbox.
The key code of a key to consider a separator. Pressing the separator key will trigger the same action as pressing enter.
Include the default stylesheet with require('fancy-select/style')
FAQs
a unidirectional combobox component based on the aria spec
The npm package fancy-select receives a total of 0 weekly downloads. As such, fancy-select popularity was classified as not popular.
We found that fancy-select demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.