Releases: cibernox/ember-power-select
Just a salad
First minor version bump in the 1.X cycle.
The main feature in this version is the usage of Ember.isEqual
to compare options instead of a simple ===
operator.
Using this comparator function is unlikely to break anyone code, but I thought that it deserved a minor bump.
Among of the advantages of this are:
- Better results when comparing dates. While in JS,
new Date(2017, 5, 5) !== new Date(2017, 5, 5)
because objects are compared by reference, this is hardly ever the intended behaviour.Ember.isEqual(new Date(2017, 5, 5), new Date(2017, 5, 5))
will correctly return true. - Allows the user to define their own way of comparing equality. If an object defines an
isEqual(other) {}
method it will be used instead of a simple===
. This allows users to decide that two POJOs should be considered equal if theirid
property is the same.
Estrella Galicia
🎉 🎉 🎉
An after a loong looong time delaying the unavoidable, today is the first stable release of Ember Power Select
🎉 🎉 🎉
The latest betas were mostly bugfixes and refactors to ensure the component works well and without deprecations from 2.3.1 to the latest 2.10/2.11 versions that ship with the shiny new Glimmer2 engine. Not to mention being compatible with Fastboot and Engines.
This version just means a commitment to not break the public API of the select or any of its internal components for the foreseeable future. The component might get additive features (there is a few ideas already) and it will track progress in the framework like the upcoming glimmer-components.
This is a big milestone on a project that started like a rant against the rigidness of wrapped jquery plugins used from Ember, and it aimed to provide a select that was native, idiomatic, usable out-of-the-box but flexible enough for allowing users to step forward and customize or even replace what they don't like.
I think it was achieved, to the best of my ability.
Can't finish this release without thanking the over 50 contributors who improved the components or its documentations, and the hundreds who tested it, reported issues and reached me, publicly or privately, to thank me for the addon or tell me that they love it.
That really matters.
Prawns risotto
Notable changes:
- Support for
cancelable
tasks (p.e. ember-concurrency's tasks) in the search action! 🎉 🎉 If a search is ongoing but the component doesn't care about it anymore (because the select was closed or because a newer search was fired), instead of just ignoring that search, not EPS attempts to cancel it and save some potentially expensive work to be done. selectChoose
andselectSearch
now throw helpful errors when either the select or the option cannot be found.- The documentation page got some nice syntax highlighting in the code examples.
Salmon crumble
This release contains one main change when compared with the 1.0.0-beta.5: IMMUTABLE API.
The publicAPI
object received by subcomponents, actions and the block of the components is now immutable. Any change in the state of this object actually creates a new object.
Subcomponents can now rely on this to replace usages of Ember.Observe
with didReceiveAttrs
, since now the select
object will be updated after each change.
Also, every change in this object will be broadcasted to the outside using the registerAPI
action. This can be used to track how the state of the select evolved after every change, giving a poor's man log and I hope will evolve into a time-travel debugging feature.
For a fill list of changes check the Changelog file.
Escalivada
1.0.0-alpha.0 🎉 🎉 🎉
Finally the component is ready to commit to a public API for internal sub components. This process might take a couple more iterations, but generally speaking all changes are going to be additive.
Will be updated soon.
The shape of the publicAPI objected received by all sub-components is this one:
{
options: <array[T]>, // Contains the regular array with the resolved collection of options.
results: <array[T]>, // Contains the regular array with the active set of results.
resultsCount: <number>, // Contains the number of results incuding those nested/disabled
selected: <T> or <array[T]>, // Contains the resolved selected option (or options in multiple selects)
highlighted: <T>, // Contains the currently highlighted option (if any)
searchText: <string>, // Contains the text of the current search
lastSearchedText: <string>, // Contains the text of the last finished search. In sync searches will match `searchText`. In async searches, it will match it if the current search is fulfilled
loading: <boolean>, // Truthy if there is a pending promise that will update the results
isActive: <boolean>, // Truthy if the trigger is focused. Other subcomponents can mark it as active depending on other logic.
actions: {
open() { ... }, // Opens the select
close() { ... }, // Closes the select
toggle() { ... }, // Toggles the select
reposition() { ... }, // Repositions the dropdown (noop if renderInPlace=true)
search(term) { ... } // Performs a search
highlight(option) { ... } // Highlights the given option (if it's not disabled)
select(option) { ... } // Selects the given option (if it's not disabled)
choose(option) { ... } // Chooses the given options if it's not disabled (slight different than `select`)
scrollTo(option) { ... } // Scrolls the given option into the viewport
}
}
Users creating their own version of Ember Power Select replacing built in components with their own can trust that this public API object (received by those components as select
) will keep this shape (it might get more options with time).
The definitive list of slots that can be customized with custom components:
afterOptionsComponent
beforeOptionsComponent
optionsComponent
selectedItemComponent
triggerComponent
Those components can be strings or contextual components wrapped along with some state using the component
keyword. Check http://www.ember-power-select.com/docs/architecture for more information on how this components compose to get the final result.
The full list of configuration options accepted by the component can be consulted in http://www.ember-power-select.com/docs/api-reference
For those who don't know, Escalivada is a dish typical from the east of Spain consisting of charcoal-grilled peeled vegetables (tomatoes, eggplants, young onions and red peppers) seasoned with olive oil, salt and pepper, eaten at room temperature, usually during the summer months. I personally like to also add a pinch of smoked paprika instead of pepper.
Braided chicken with spinach bechamel
Big release
Huge internal refactor to use the new final API of Ember Basic Dropdown internally, to make it more flexible and easy to customize.
The public API of the component remains the same with the exception that trigger no longer needs a wrapper div, so the main component is tagless and the class attribute has no effect on it. The component can still have a tag and a class if the user passes tagName="div" class="whatever"
, but that is not the default anymore.
Some classes have changed to make the css hierarchy flatter. That won't affect you unless you are customizing the default styles by targeting that specific class.
There is more work to be done in the 0.11 series:
- Remove hacks needed prior to 2.3 in inputs.
- Use ember-concurrecy to simplify internals.
- Thanks to the new flexibility of Ember Basic Dropdown, the multiple select can be simplified
Chickpeas and chorizo potage
After a week without any but, 0.10 becomes stable! 💃
Accumulated changelog since 0.9
- [BUGFIX] Ensure that returning
false
from theonkeydown
action prevents the default behaviour
even when that default behaviour is handled by ember-basic-dropdown. - [BREAKING]
e.preventDefault()
no longer affects the behaviour of the component, just prevents
the native browser behaviour. Returnfalse
instead. - [BUGFIX/BREAKING]
onopen
/onclose
actions are called before the component is opens/closes,
giving the user the change to prevent that from happening by returning false. - [BUGFIX]
select.actions.select
doesn't callstopPropagation
orpreventDefault
in the given
event anymore. It's not it's responsability. - [INTERNAL] Update Ember-basic-dropdown to 0.9.5-beta.14. PublicAPI should be the same, but
internal have been simplified and responsabilities better divided across components. Nothing should
break, but given the size of the changes ¯_(ツ)_/¯ - [BUGFIX] The trigger of the single select applies overflow if the content is too long
- [FEATURE] Selects can now be nested inside other dropdowns.
- [FEATURE] Allow to pass WAI-ARIA states (ariaDescribedBy, ariaInvalid, ariaLabel, ariaLabelledBy and required)
- [BUGFIX] Avoid highlight disabled options when they are the first option after a search. Instead,
highlight the first non-disabled option in the list. When all results are disabled, nothing gets
highlighted. - [ENHANCEMENT] Add a class to the component when an element inside has the focus. This allows to
style the component not only when the component itself is focused but when an input inside
is, which was previously impossible. - [BUGFIX] Allow to pass
horizontalPosition
to customize to which edge of the trigger
the dropdown is anchored to. - [FEATURE] The
selected
option can now also be a promise. When it's a promise, the component
won't have any selection (the trigger will be empty, no option of the list will be
highlighted) until that promise resolves. Once it resolves, the trigger and the highlighted
option will update. - [BUGFIX] Fixed bug after event-delegation refactor where mouseovering the list itself
(which happens when options are disabled) throwed an error. - [BUGFIX] Disabled select shouldn't be clearable even if
allowClear=true
. - [BUGFIX] In multiple selects when test in the searchbox was too long the text overflowed the trigger.
- [REMOVE FEATURE] The
opened
property (the only using double bindings instead of DDAU) has been
removed. It was the cause of some errors due to race conditions in the bindings propagation.
It is still possible to passinitiallyOpened=true
to render a select already opened, but it is
a one time property. It won't onpen/close the select when mutated nor will be mutated when the
select is opened or closed. - [BUGFIX] Fix option highlighting when the use mouseovers in an element inside the
<li>
s - [BUGFIX] Fix option selection when the use click in an element inside the
<li>
s - [BUGFIX] In multiple selects, deleting the last element of the list using BACKSPACE to trigger a
search must open the dropdown if not already opened. - [FEATURE] Added
oninput
action that will be fired by changes in the search input. If the user
returnsfalse
from this action the default behaviour (perform a search) is not run.
This is particular useful for addons than need to preprocess the text being typed, by example to
tokenize it and add entries instead of performing a search. - [ENHANCEMENT] Improve accuracy
selectChoose
. BeforeselectChoose('.my-select', 'User')
might,
erroneously, select the option containing the textUser team
if it was before thanUser
in the
list. Now if there is more than one option containing the given text it but the content of
one of the options is identical, then that one is choosen. If none is identical, the first one.
Chicken with beer sauce and mashed potatoes
I don't expect any more changes before 0.10 final.
And 0.10 will probably the latest before 1.0.0 🎉
- [BREAKING]
e.preventDefault()
no longer affects the behaviour of the component, just prevents
the native browser behaviour. Returnfalse
instead. - [BUGFIX/BREAKING]
onopen
/onclose
actions are called before the component is opens/closes,
giving the user the change to prevent that from happening by returning false. - [BUGFIX]
select.actions.select
doesn't callstopPropagation
orpreventDefault
in the given
event anymore. It's not it's responsability. - [INTERNAL] Update Ember-basic-dropdown to 0.9.5-beta.14. PublicAPI should be the same, but
internal have been simplified and responsabilities better divided across components. Nothing should
break, but given the size of the changes ¯_(ツ)_/¯ - [BUGFIX] The trigger of the single select applies overflow if the content is too long
- [FEATURE] Selects can now be nested inside other dropdowns.
- [FEATURE] Allow to pass WAI-ARIA states (ariaDescribedBy, ariaInvalid, ariaLabel, ariaLabelledBy and required)
- [BUGFIX] Avoid highlight disabled options when they are the first option after a search. Instead,
highlight the first non-disabled option in the list. When all results are disabled, nothing gets
highlighted. - [ENHANCEMENT] Add a class to the component when an element inside has the focus. This allows to
style the component not only when the component itself is focused but when an input inside
is, which was previously impossible. - [BUGFIX] Allow to pass
horizontalPosition
to customize to which edge of the trigger
the dropdown is anchored to. - [FEATURE] The
selected
option can now also be a promise. When it's a promise, the component
won't have any selection (the trigger will be empty, no option of the list will be
highlighted) until that promise resolves. Once it resolves, the trigger and the highlighted
option will update. - [BUGFIX] Fixed bug after event-delegation refactor where mouseovering the list itself
(which happens when options are disabled) throwed an error. - [BUGFIX] Disabled select shouldn't be clearable even if
allowClear=true
. - [BUGFIX] In multiple selects when test in the searchbox was too long the text overflowed the trigger.
- [REMOVE FEATURE] The
opened
property (the only using double bindings instead of DDAU) has been
removed. It was the cause of some errors due to race conditions in the bindings propagation.
It is still possible to passinitiallyOpened=true
to render a select already opened, but it is
a one time property. It won't onpen/close the select when mutated nor will be mutated when the
select is opened or closed. - [BUGFIX] Fix option highlighting when the use mouseovers in an element inside the
<li>
s - [BUGFIX] Fix option selection when the use click in an element inside the
<li>
s - [BUGFIX] In multiple selects, deleting the last element of the list using BACKSPACE to trigger a
search must open the dropdown if not already opened. - [FEATURE] Added
oninput
action that will be fired by changes in the search input. If the user
returnsfalse
from this action the default behaviour (perform a search) is not run.
This is particular useful for addons than need to preprocess the text being typed, by example to
tokenize it and add entries instead of performing a search. - [ENHANCEMENT] Improve accuracy
selectChoose
. BeforeselectChoose('.my-select', 'User')
might,
erroneously, select the option containing the textUser team
if it was before thanUser
in the
list. Now if there is more than one option containing the given text it but the content of
one of the options is identical, then that one is choosen. If none is identical, the first one.
Mutabal, potato pancakes and raw avocado
This is a beta version with basic support for transitions and animations.
When the dropdown is rendered, it gets a .ember-basic-dropdown--transitioned-in
class after it's first rendered, so it's trivial to add transitions when opened.
The closed, the dropdown gets a ember-basic-dropdown--transitioning-out
class, and if there is any CSS animation or transition on the dropdown, the select is not really closed until that animation finishes.
All this behaviour is actually part of ember-basic-dropdown.
This is the kind of feature that might have corner cases depending on the browser, so please, test it and report.
I don't know yet, but something italian I reckon.
- [BUGFIX] Fixes acceptance helpers to fire native events and therefore work with Ember Basic Dropdown 0.9.2