Gathering detailed insights and metrics for gavant-ember-bootstrap-dropdown
Gathering detailed insights and metrics for gavant-ember-bootstrap-dropdown
Gathering detailed insights and metrics for gavant-ember-bootstrap-dropdown
Gathering detailed insights and metrics for gavant-ember-bootstrap-dropdown
Dropdown menus built on ember-basic-dropdown, and styled by Bootstrap 4
npm install gavant-ember-bootstrap-dropdown
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (45.77%)
TypeScript (19.92%)
Handlebars (15.25%)
SCSS (11.75%)
HTML (7.31%)
Built with Next.js • Fully responsive • SEO optimized • Open source ready
Total Downloads
1,777
Last Day
1
Last Week
3
Last Month
14
Last Year
115
MIT License
105 Commits
3 Watchers
11 Branches
7 Contributors
Updated on Apr 14, 2022
Latest Version
0.0.2
Package Id
gavant-ember-bootstrap-dropdown@0.0.2
Unpacked Size
238.23 kB
Size
65.30 kB
File Count
21
NPM Version
5.6.0
Node Version
9.8.0
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
0%
3
Compared to previous week
Last Month
133.3%
14
Compared to previous month
Last Year
-8.7%
115
Compared to previous year
2
24
Dropdown menus built on ember-basic-dropdown, and styled by Bootstrap 4.
ember install gavant-ember-bootstrap-dropdown
IMPORTANT: ember-basic-dropdown will be installed along with the addon, and added to your app's package.json. However, if your app already has ember-basic-dropdown as a dependency via another addon, such as ember-power-select, this should be removed from your package.json via yarn remove ember-basic-dropdown
.
This addon assumes that the project already has Bootstrap 4 installed, as by default, it applies CSS classes that are compatible with bootstrap's components. However, these classes can be customized if needed.
To use the addon styles, you must use SASS:
ember install ember-cli-sass
Upon addon installation, an @import
statement will be added to your app.scss
:
1@import "ember-basic-dropdown"; 2@import "gavant-ember-bootstrap-dropdown";
IMPORTANT: If your app already has ember-basic-dropdown as a dependency via another addon, such as ember-power-select, the @import "ember-basic-dropdown";
line should be removed.
This addon is simply an extension of ember-basic-dropdown, so you can use the exact same API, with a couple additional components:
1{{#dropdown-menu as |dd|}} 2 {{#dd.trigger class="btn btn-primary"}}Trigger{{/dd.trigger}} 3 {{#dd.content}} 4 {{#dropdown-action dd=dd action=(action "myAction")}} 5 Dropdown Action 6 {{/dropdown-action}} 7 {{#dropdown-link "some.route" dd=dd}} 8 Dropdown Link 9 {{/dropdown-link}} 10 {{/dd.content}} 11{{/dropdown-menu}}
{{dropdown-menu}}
Just an alias of {{basic-dropdown}}
, it maintains the exact same API. It may be extended with additional behaviors/functionality in the future, so its preferred to use this component for all dropdown menus.
{{dropdown-link}}
Extends Ember.LinkComponent
, so provides the same API as {{link-to}}
. It adds additional classes to style it correctly in a bootstrap dropdown, and its dd
attribute MUST be passed the {{#dropdown-menu as |dd|}}
's yielded dd
object (e.g. {{#dropdown-link "route" dd=dd}}Foo{{/dropdown-link}}
), in order for the dropdown to close when clicked.
{{dropdown-action}}
A button element that adds additional classes to style it correctly in a bootstrap dropdown. Link dropdown-link
, its dd
attribute MUST be passed the {{#dropdown-menu as |dd|}}
's yielded dd
object (e.g. {{#dropdown-link "route" dd=dd}}Foo{{/dropdown-link}}
), in order for the dropdown to close when clicked.
Additionally, the component may be passed an action via its action
attribute, which will be invoked on click, and the click event object will be sent up as an action param. You may also prevent action bubbling by passing in bubbles=false
.
git clone <repository-url>
cd gavant-ember-bootstrap-dropdown
npm install
npm run lint:js
npm run lint:js -- --fix
ember test
– Runs the test suite on the current Ember versionember test --server
– Runs the test suite in "watch mode"ember try:each
– Runs the test suite against multiple Ember versionsember serve
For more information on using ember-cli, visit https://ember-cli.com/.
This project is licensed under the MIT License.
No vulnerabilities found.