Commit Graph

60 Commits

Author SHA1 Message Date
Brock Whittaker 4d54515455 input-pill: Add copy override functionality for input pills.
When a pill is selected and you press copy, it will by default return
the value, but it can be overridden with the `onCopyReturn` function.
2018-02-20 14:18:11 -08:00
Brock Whittaker bee0fa4001 input-pill: Disable input of commas with invalid pills.
A user should not be able to start forming a new pill if the previous
pill is invalid.
2018-02-20 14:11:51 -08:00
Brock Whittaker 4cd25fb861 input-pill: Add multiple pill support with pasting.
This allows for pasting in comma separated lists that will validate
pills on paste, along with creating an API for inserting many pills.

This now allows in the `input_pill.pill.append` a comma separated list
that will then call the `insertManyPills` method that will break up the
input and then call `append`.
2018-02-20 14:11:47 -08:00
Brock Whittaker 8ea39d2609 input-pill: Wrap "values" in IIFE.
The function should execute initially and return a function, not
be a function that when executed returns another function. This
fixes an existing bug.
2017-12-20 08:53:27 -05:00
Brock Whittaker 511f2f3db4 input-pill: Add "onPillRemove" callback.
This will now allow a callback to be triggered when a pill is
removed from the set.
2017-12-20 08:53:27 -05:00
Brock Whittaker 5ae4b8d3f3 input-pill: Add clean up functions.
This adds functions to remove pills and reset the state.
2017-11-10 14:14:03 -08:00
Brock Whittaker 5a0bba2afc input-pill: Add validation callback for pills.
This adds a validator that when calling `reject` will reject a pill
from being added.
2017-11-10 14:14:03 -08:00
Brock Whittaker 5d0aae283f input-pill: Add key/value caching.
Some of the calls in our codebase will call for the `.keys()` method a
lot, so this caches the results and returns them rather than mapping
the array if it knows the state to be the same as before.
2017-11-10 14:14:03 -08:00
Brock Whittaker 93141cbe39 input-pill: Have all clicks directly on container focus input.
If a user clicks on the pill container and not directly on a pill
or on an "x" inside of a pill, it should be presumed they are
trying to input new text. This effectively makes the whole non-pill
section an input bar.
2017-11-10 14:14:03 -08:00
Brock Whittaker 7b00736fa2 input-pill: Add "input_pill" class and documentation. 2017-11-10 14:14:03 -08:00