当前位置: 首页 > 软件库 > 程序开发 > >

ember-select-box

🔠 A faux select box for Ember apps
授权协议 MIT License
开发语言 JavaScript
所属分类 程序开发
软件类型 开源软件
地区 不详
投 递 者 应涵容
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

@zestia/ember-select-box

Select box solutions are rarely perfect for what you want.

They come with a myriad of options to configure every possible situation, and they make too many assumptions about how your select-box should behave.

This addon does less, and gives you the primitives to easily compose your own.

Installation

ember install @zestia/ember-select-box

Demo

https://zestia.github.io/ember-select-box

Features

  • Native select box (that supports complex values) ✔︎
  • Faux select box (mimics a native select box, but easily stylable) ✔︎
  • Navigatable options and groups ✔︎
  • ARIA Attributes ✔︎
  • Supports promises ✔︎
  • Any HTML you want ✔︎
  • Will never come with built-in styles ✔︎
  • Ember Data friendly ✔︎
  • Full control at all times with the API ✔︎
  • Native-like typeahead behaviour ✔︎
  • Very few issues over many years of Ember! ✔︎
  • Easily create an autocompleter ✔︎
  • Easily create a dropdown menu ✔︎

Example

To create your own select box, make a new component that renders a select box:

{{! foo-select.hbs }}
<SelectBox
  class="foo"
  @value={{@value}}
  @onSelect={{@onSelect}} as |sb|
>
  <sb.SelectedOption {{on "click" sb.toggle}}>
    {{sb.value.name}}
  </sb.SelectedOption>
  <sb.Options>
    {{yield sb}}
  </sb.Options>
</SelectBox>

...and then use it like this:

{{! application.hbs }}
<FooSelect
  @value={{this.foo1}}
  @onSelect={{this.handleSelectFoo}} as |sb|
>
  {{#each this.foos as |foo|}}
    <sb.Option @value={{foo}}>{{foo.name}}</sb.Option>
  {{/each}}
</FooSelect>

...which will render...

<div class="select-box foo">
  <div class="select-box__selected-option">Foo 1</div>
  <div class="select-box__options">
    <div class="select-box__option">Foo 1</div>
    <div class="select-box__option">Foo 2</div>
    <div class="select-box__option">Foo 3</div>
  </div>
</div>

...as you can see, apart from being able to select a value - this addon does very little out of the box! It's up to you to add the layer of behaviour that you require using the API.

Docs

 相关资料
  • A suite of plugins for working with drop down lists. Includes: addOption ajaxAddOption removeOption sortOptions selectOptions copyOptions containsOption selectedValues

  • Ember-searchable-select This addon is prepared for internal use at TED. We're happy to share our code as open-source, but be aware that it may not be maintianed for broader community use. Installation

  • Ember-Power-Select Ember Power Select is a select component written in Ember with a focus in flexibility and extensibility. It is designed to work well with the way we build Ember apps, so it plays ni

  • ember-bootstrap-power-select Integrate Ember Power Select into your Ember Bootstrapforms. Compatibility Ember Power Select v4 or above Ember Bootstrap v4 or above Ember.js v3.16 or above Ember CLI v3.

  • gtk.Box类是一个抽象类,用于定义容器的功能,其中窗口小部件放置在矩形区域中。 gtk.HBox和gtk.VBox小部件都是从它派生的。 gtk.Hbox中的子窗口小部件水平排列在同一行中。 另一方面,gtk.VBox的子窗口小部件垂直排列在同一列中。 gtk.Box类使用以下构造函数 - gtk.Box(homogenous = True, spacing = 0) homogenous属

  • Box

    长方体是三维或实心形状。 长方体由6个矩形制成,它们以直角放置。 使用方形面的长方体是一个立方体,如果面是矩形,而不是立方体,它看起来像一个鞋盒。 长方体是三维形状,具有length (深度), width和height ,如下图所示 - 在JavaFX中,三维框由名为Box的类表示。 该类属于包javafx.scene.shape 。 通过实例化此类,您可以在JavaFX中创建Box节点。 这个