v1.0.0-alpha.0
版本发布时间: 2016-06-07 20:17:48
cibernox/ember-power-select最新发布版本:v8.3.1(2024-09-09 14:37:17)
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.