mirror of
https://github.com/discourse/discourse.git
synced 2024-12-19 18:34:09 +08:00
cbc0ece6e8
`<DSelect />` is a wrapper similar to our existing `<DButton />` over the html element `<select>`. The code is ported from form kit which is now directly using `<DSelect />`. Note this component has also been used in edit topic timer modal. This component is recommended for a small list of text items (no icons, no rich formatting...). Usage: ```gjs <DSelect class="my-select" @onChange={{this.handleChange}} as |select|> <select.Option @value="foo" class="my-favorite-option">Foo</select.Option> <select.Option @value="bar">Bar</select.Option> </DSelect> ``` This commit comes with a set of assertions: ```gjs import dselect from "discourse/tests/helpers/d-select-helper"; import { select } from "@ember/test-helpers"; assert .dselect(".my-select") .hasOption({ value: "bar", label: "Bar" }) .hasOption({ value: "foo", label: "Foo" }) .hasNoOption("baz"); await select(".my-select", "foo"); assert.dselect(".my-select").hasSelectedOption({value: "foo", label: "Foo"}); ``` |
||
---|---|---|
.. | ||
sidebar/edit-navigation-menu | ||
_index.scss | ||
add-pm-participants.scss | ||
badges.scss | ||
banner.scss | ||
bookmark-list.scss | ||
bookmark-menu.scss | ||
bookmark-modal.scss | ||
buttons.scss | ||
calendar-date-time-input.scss | ||
char-counter.scss | ||
color-input.scss | ||
conditional-loading-section.scss | ||
convert-to-public-topic-modal.scss | ||
d-breadcrumbs.scss | ||
d-lightbox.scss | ||
d-select.scss | ||
d-stat-tiles.scss | ||
d-toggle-switch.scss | ||
date-input.scss | ||
date-picker.scss | ||
date-time-input-range.scss | ||
date-time-input.scss | ||
download-calendar.scss | ||
file-size-input.scss | ||
footer-nav.scss | ||
form-template-field.scss | ||
group-member-dropdown.scss | ||
groups-form-membership-fields.scss | ||
hashtag.scss | ||
horizontal-overflow-nav.scss | ||
iframed-html.scss | ||
ignored-user-list.scss | ||
keyboard_shortcuts.scss | ||
more-topics.scss | ||
navs.scss | ||
offline-indicator.scss | ||
pick-files-button.scss | ||
powered-by-discourse.scss | ||
relative-time-picker.scss | ||
signup-progress-bar.scss | ||
svg.scss | ||
tap-tile.scss | ||
theme-card.scss | ||
time-input.scss | ||
time-shortcut-picker.scss | ||
topic-map.scss | ||
topic-query-filter.scss | ||
user-card.scss | ||
user-info.scss | ||
user-status-message.scss | ||
user-status-picker.scss | ||
user-stream-item.scss | ||
user-stream.scss | ||
welcome-header.scss | ||
widget-dropdown.scss |