Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@dotburo/multi-select
Advanced tools
Readme
Simple multiple <select> box (dropdown) in vanilla Javascript
›_ demo
npm i -P @dotburo/multi-select
import MultiSelect from 'multi-select';
// Minimal parameters
let multiSelect = new MultiSelect('.multi-select', {
items: ['A', 'B', 'C', 'D']
});
// Listen to changes
multiSelect.on('change', e => console.log(multiSelect.getCurrent()));
items: [] # Array of strings, numbers or objects
display: 'value' # If an array of objects was passed, the property to use for display in the list
current: null # Items to select upon instantiation
parent: null # Parent element, to
maxHeight: 0 # Maximum height of the dropdown, `0` means no constraint
sort: true # Whether to sort the list
order: 'desc' # Sort order
placeHolder: 'Select items' # Place holder text for when nothing is selected
more: '(+{X} more)' # Place holder multiple selections; `{X}` will be replaced with current count;
# if `{X}` is not present, `more` will replace the whole placeholder
MultiSelect triggers one event: change
.
Event handlers can be bound with instance.on()
or instance.getElement().addEventListener()
. In browsers which
support CustomEvent
, the detail
property of the event object contains the selected or deselected item.
To get all currently selected items use instance.getCurrent()
.
Listen to events, pass in and event name (String
), a subscriber (Function
) and optionally and event target (Element
).
If the latter is omitted, events are delegated to instance.getElement()
.
Show or hide the list
Return MultiSelect's outermost element
Get all the items in the list as an array of objects
Return the currently selected items; if a key
is passed, it will be used to return only the matching value of each
item object.
Programmatically set the currently selected items
Find an item in the list by its value (String|Number
)
Unbind all events and clean up the DOM
FAQs
Lightweight & dynamic select dropdown with an input field, without dependencies
The npm package @dotburo/multi-select receives a total of 166 weekly downloads. As such, @dotburo/multi-select popularity was classified as not popular.
We found that @dotburo/multi-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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.