npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-data-bootstrap3-forms

v3.10.0

Published

The default blueprint for ember-cli addons.

Downloads

4

Readme

ember-data-bootstrap3-forms

npm version downloads Code Climate

ember-observer-badge License

This addon helps present your Ember-Data model errors in a consistent fashion using Bootstrap3 alerts and help-blocks.

Compatibility

  • Ember.js v2.18 or above
  • Ember CLI v2.13 or above
  • Node.js v8 or above
  • Ember Data - the twbs-errors-alert & twbs-form-group components depend on Ember Data's modeling of errors.
  • You should have Bootstrap 3.x

Installation

ember install ember-data-bootstrap3-forms

As mentioned, you should install Bootstrap3 in order for the correct styling to be applied. Refer to the requirements section above.

Demo

The demonstration web application can be found here: http://ember-data-bootstrap3-forms.cybertooth.io/.

What Does This Addon Do?

This addon supplies the following components:

  • {{twbs-errors-alert}} - a component that listens to a single model's errors and prepares a bootstrap alert box with the fields you want in a bulleted list.
  • {{twbs-form}} - a component that creates a form element that you can easily bind the submit and reset action to. Then all you need to do is add a submit and/or reset button to your form.
  • {{twbs-form-group}} - a component generating a Bootstrap <div class="form-group">...</div> that has intelligence built in to detect when it's field enters the error-state; the .has-error class will be applied and error messages will be appended to the bottom of the component's template.

Further information about these items can be found in the Usage section below.

Usage

As mentioned above there are several examples on the demonstration site: http://ember-data-bootstrap3-forms.cybertooth.io/

Components

{{twbs-form}}

A standard HTML form with the Bootstrap3 .form class assigned. Provide a block with all the form-groups and inputs that you want inside the form container. The twbs-form component accepts a submit and reset property both of which should take in a closure function.

Arguments
  • submit (OPTIONAL) - the action that will be fired if the form happens to be submitted by a basic submit button or by pressing enter while focused on an input. Ideal for posting model changes.
  • reset (OPTIONAL) - the action the will be fired when the form is reset by clicking on a basic reset button. Ideal for rolling back model changes.
Examples

Check out the demo application

{{twbs-errors-alert}}

A Bootstrap3 alert box that contains a list of model errors. You provide a block to the component, it will be placed in a paragraph element just above the unordered-list of errors. When the model does not have any errors, the alert will not be visible.

Arguments
  • model (REQUIRED) - the supplied model's DS.Errors collection is the source for the list of errors presented in the alert.
  • excludes (OPTIONAL) - a comma-separated list of the camelCased attribute names from the model whose errors will be ignored and not presented in the list. If you specify both an includes and excludes argument, the excludes argument always takes precedence.
  • includes (OPTIONAL) - a comma-separated list of the camelCased attribute names from the model whose errors should be included in the list.
  • classNames (OPTIONAL) - use the classNames argument to pass an alert style to the errors alert. For example, alert-danger or alert-warning.
Examples

Check out the demo application

{{twbs-form-group}}

A Bootstrap 3 .form-group that accepts a model's errors for a given field and listens for field errors in order to apply the danger colour and produce the list of error messages below the form itself.

To understand how this works, familiarize yourself with Bootstrap 3's form validation states. Also recognize that Ember Data model errors can be viewed from a field's perspective and this component is watching that particular view of the errors.

Arguments
  • fieldErrors (REQUIRED) - the model's errors collection for a specific field. For example, if your model has a field named firstName you would pass the following: model.errors.firstName.
Examples

Check out the demo application

Troubleshooting And Tips

  1. Do you have Ember Data in your application and are using it for your data modeling?
  2. Is Bootstrap 3 installed? As the addon's name states, this isn't Bootstrap 4 ready.

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.