Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

hovo-sl-components

softlayer4MIT0.12.3

Ember CLI Addon - UI components library

ember-addon, UI, UI components, calendar, chart, grid, menu, tabs, tooltip, progress bar, modal, bootstrap

readme

Latest Release Ember CLI version License Downloads

Dependencies Dev Dependencies

Build Status Code Climate Ember Observer Inch CI Join us on Slack

We use https://waffle.io/softlayer/sl-ember-components to work our issues.

Stories in Ready Stories in In Progress Stories in Ready For Review Stories in In Review

Throughput Graph

What sl-ember-components is

An Ember CLI Addon that provides UI components compatible with Ember.js and Twitter Bootstrap.

This addon is currently BETA. View the Roadmap we're following for a 1.0.0+ release.

Examples and documentation on how to use each component can be viewed at http://softlayer.github.io/sl-ember-components/ which is served from the gh-pages branch of this repository.

Components provided

  • sl-alert
  • sl-button
  • sl-calendar
  • sl-chart (only free for non-commercial use without a Highcharts license)
  • sl-checkbox
  • sl-date-picker
  • sl-date-range-picker
  • sl-date-time
  • sl-drop-button
  • sl-grid
  • sl-input
  • sl-menu
  • sl-modal
  • sl-pagination
  • sl-panel
  • sl-progress-bar
  • sl-radio
  • sl-radio-group
  • sl-select
  • sl-span
  • sl-tab-panel
  • sl-textarea
  • sl-tooltip

Mixins provided

sl-component-input-id

Provides unique id that a component can assign to an input and a label's "for" attribute.

sl-input-based

Provides state properties for input element based components.

sl-namespace

Namespace component events by elementId

sl-tooltip-enabled

Provides Bootstrap tooltip functionality bindings, for both popovers and plain tooltips.

Utility Classes provided

containsValue

Check whether a value is a valid value in object.

warn

Provides a mechanism for initiating console.warn()s

error

Provides a way for individual components to throw errors that are able to be recognized by methods inside of a consuming application's Ember.onerror() function. For more details reference the Error Handling section below.

CSS Classes provided

sl-loading

Apply a loading indicator to an element. See the Loading Indicator section for more information.


All of this functionality is provided through a combination of leveraging the best-of-breed of other component offerings as well as our own implementations when the existing offerings were deficient. Existing offerings that were leveraged include:

LICENSE WARNING

While this library is MIT licensed not all of the third-party component libraries are. Specifically, Highcharts is only free for non-commercial use and requires a license for any other use. See this FAQ page for more information.

Other libraries that are not MIT licensed, though it should not pose a problem, are:

Supported browsers

See http://softlayer.github.io/sl-ember-components/#/browsers

Demo

Live

http://softlayer.github.io/sl-ember-components/#/demos

Development Environment

Installation

  • git clone this repository
  • npm install
  • bower install

Running

For more information on using ember-cli, visit http://www.ember-cli.com/.

Documentation

How to use this addon in your application

Installation

ember install sl-ember-components

Error Handling

The components in sl-ember-components will throw errors if the components are used incorrectly. For example, the sl-radio-group component requires that a name property be passed with the component. If one is not passed an error will be thrown with the name of the component that is throwing the error (sl-radio-group) and the message saying "The name property must be set".

If you wish to capture these errors and pass them along to your error logging application you can do so by adding the following lines to your application's app/app.js file:

import { errorWasThrown, isErrorInstanceOf } from 'sl-ember-components/utils/error';

var App;

...

Ember.onerror = function( error ) {

    if ( errorWasThrown( error ) ) {
        // This will catch any errors coming from the sl-ember-components addon
        // Insert the code you would use to send to your error logging application here
    }

    if ( isErrorInstanceOf( 'radioGroup' ) ) {
        // Use this option if you want granularity at the individual component level
        // Insert the code you would use to send to your error logging application here
    }

    ...Repeat the above for each component that you want to watch for where "radioGroup"
    is the name of the component "sl-radio-group". So if you wanted to watch "sl-menu" you
    would replace "radioGroup" with "menu". To see what can be used look at addon/utils/error.js.

    console.error( error ); // Still send the error to the console
};

Fingerprinting Assets

If fingerprinting is enabled in the consuming application, then by default the following font types are fingerprinted:

eot, svg, ttf, woff, woff2

IMPORTANT: If you list extensions that are not exact matches to the default ones set by broccoli-asset-rev, you will need to add the desired font extensions to the extensions property in the consuming application's fingerprinting settings in the ember-cli-build.js file, as demonstrated below:

const EmberApp = require( 'ember-cli/lib/broccoli/ember-app' );
const env = require( './config/environment' );

module.exports = function( defaults ) {
    const app = new EmberApp( defaults, {
        fingerprint: {
            enabled: true,
            exclude: [],
            extensions: [ 'png', 'jpg', 'gif', 'eot', 'svg', 'ttf', 'woff', 'woff2' ],
            prepend: env().baseAssetsURL,
            replaceExtensions: [ 'html', 'css', 'js' ]
        }
    });

    return app.toTree();
};

Styling

If you wish to modify the styling of the components you have two options for doing so.

The first is to define your CSS declarations in your application's app/styles folder.

The second is to build the CSS declarations from the LESS source files. This will layer any of your LESS values on top of this addon's LESS values which are then in turn laid on top of Twitter Bootstrap's. This does require you though to use LESS for your entire application's CSS generation. To use LESS, run

npm install --save-dev ember-cli-less

then create a app/styles/app.less file and add this to it:

@import 'sl-ember-components';

Finally, you will need to run broccoli-autoprefixer against the updated Twitter Bootstrap and/or LESS files. To do so, run

npm install --save-dev broccoli-autoprefixer

and set the browsers option in your ember-cli-build.js file to:

var autoprefixer = require( 'broccoli-autoprefixer' );
...
tree = autoprefixer(
    tree,
    {
        browsers: [
            'Android 2.3',
            'Android >= 4',
            'Chrome >= 20',
            'Firefox >= 24',
            'Explorer >= 8',
            'iOS >= 6',
            'Opera >= 12',
            'Safari >= 6'
        ]
    }
);

The options listed in browsers above are the recommended settings by Twitter Bootstrap

Component Classes

Each component has its own unique CSS class selector so that it is easy to target and style specific components. Refer to each component's respective documentation at http://softlayer.github.io/sl-ember-components for these values.

Customizing a component's CSS prefix

All components share a common CSS prefix, namely, sl-ember-components. To target and style a particular component, for example the sl-grid component, one would use the CSS class selector .sl-ember-components-grid. The reason for such a verbose selector is to prevent styling conflicts with other libraries. You can customize the prefix value and change it from the default sl-ember-components to whatever you would like. Depending on what option you picked in the Styling section, the steps below describe how you would go about customizing the CSS prefix.

To get started, you will need to add a config value to your ember-cli-build.js

var app = new EmberApp(defaults, {
    'sl-ember-components': {
        componentClassPrefix: 'custom-prefix' // specify your custom prefix here
    }
});

If you are not using LESS as a preprocessor then nothing else needs to be done on your part. You should now be able to target components using your custom prefix (e.g. in the case of sl-grid you should now be able to use the CSS class selector .custom-prefix-grid).

If you are using LESS then you will need to set a @component-class-prefix variable below the line of code which imports the sl-ember-components as shown below.

@import 'sl-ember-components'
@component-class-prefix: custom-prefix;

You should now be able to target components using your custom prefix (e.g. in the case of sl-grid you should now be able to use the CSS class selector .custom-prefix-grid).

Note: If you have already served your application, remember to re-serve after making changes to the ember-cli-build.js file so changes can take affect.

Icons

If you wish to use different Glyphicons than the defaut ones, you simply only need to redefine the content definition for the appropriate styles. For example, to replace the "Show All" icon used for the sl-menu component, use the following declaration:

.sl-ember-components-menu .sl-icon-show-all:before {
    content: "\e011";
}

If you wish to use a font library other than Glyphicons Halflings you will need to take a few extra steps but it is still very easy to do. The first step is to make sure you have properly installed, and are including, your desired font library. Next, you need to define a [class^="sl-icon-"], [class*=" sl-icon-"] declaration and copy your font library's main css declaration into it. The example below demonstrates this, replacing Glyphicons Halflings with Font Awesome:

[class^="sl-icon-"], [class*=" sl-icon-"] {
    display: inline-block;
    font: normal normal normal 14px/1 FontAwesome;
    font-size: inherit;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

Then you only need to redefine the content definition in the appropriate styles, as previously explained above:

.sl-ember-components-menu .sl-icon-show-all:before {
    content: "\f270";
}

Loading indicator

A loading indicator can be made to display over an element's content, masking it from view, by simply adding the "sl-loading" class to it. This class blurs the content via a dark-colored mask. If a lighter mask is desired then add the additional "inverse" class to the same element.

Examples

Dark Mask Example Light Mask Example

If you wish to modify the loading image displayed when applying the "sl-loading" class you can do so by either defining CSS declarations or setting LESS variable values, depending on which Styling approach you are using in your application.

To do so via CSS declarations, define the background-image property for the .sl-loading:after and .sl-loading.inverse:after selectors.

To do so via LESS, assign values to the @loading-spinner-light and @loading-spinner-dark variables.

Additional modifications can be applied to any of these selectors as well:

  • .sl-loading
  • .sl-loading:before
  • .sl-loading:after
  • .sl-loading.inverse:before
  • .sl-loading.inverse:after

Examples and documentation on how to use each component

Examples and documentation on how to use each component can be viewed at http://softlayer.github.io/sl-ember-components

Versioning

Employs Semantic Versioning 2.0.0

Contribution

See CONTRIBUTING.md

Copyright and License

sl-ember-components and its source files are Copyright © 2014-2015 SoftLayer Technologies, Inc. The software is MIT Licensed

sl-ember-components leverages several third-party libraries which are not all MIT licensed. Specifically, Highcharts is only free for non-commercial use and requires a license for any other use. See this FAQ page for more information.

Other libraries that are not MIT licensed, though it should not pose a problem, are:

Warranty

This software is provided “as is” and without any express or implied warranties, including, without limitation, the implied warranties of merchantability and fitness for a particular purpose.

changelog

sl-ember-components Changelog

0.12.3

BUG FIX

View complete changeset

0.12.2

  • #1672 Broccoli plugin fails when running in Node >= 5

View complete changeset

0.12.1

All of the changes from the 0.12.0 release that were inadvertenly not merged into the branch.

View complete changeset

0.12.0

BREAKING ENHANCEMENT

  • #1663 Upgrade Ember CLI to v2.4.3

DOCUMENTATION

  • #1654 Update sl-grid documentation

View complete changeset

0.11.1

BUG FIX

Move broccoli-autoprefixer from devDependencies to dependencies

View complete changeset

0.11.0

BREAKING ENHANCEMENT

  • No longer require ember-cli-less to be installed in an application in order to use this addon!!
  • #564 The page number(s) indicator visually reacts like a button even though is not interactive as such
  • #974 Refactor DOM structure and supporting CSS and JS logic of sl-grid component
  • #1338 Create instructions for using loading class
  • #1395 Remove addon/utils/all.js file
  • #1399 Refactor to support "sl-ember-components-[component]" class pattern for sl-alert component
  • #1374 Refactor to support "sl-ember-components-[component]" class pattern for sl-button component
  • #1400 Refactor to support "sl-ember-components-[component]" class pattern for sl-calendar component
  • #1401 Refactor to support "sl-ember-components-[component]" class pattern for sl-chart component
  • #1375 Refactor to support "sl-ember-components-[component]" class pattern for sl-checkbox component
  • #1376 Refactor to support "sl-ember-components-[component]" class pattern for sl-date-picker component
  • #1377 Refactor to support "sl-ember-components-[component]" class pattern for sl-date-range-picker component
  • #1378 Refactor to support "sl-ember-components-[component]" class pattern for sl-date-time component
  • #1379 Refactor to support "sl-ember-components-[component]" class pattern for sl-drop-button component
  • #1380 Refactor to support "sl-ember-components-[component]" class pattern for sl-input component
  • #1403 Refactor to support "sl-ember-components-[component]" class pattern for sl-grid component
  • #1404 Refactor to support "sl-ember-components-[component]" class pattern for sl-loading-icon component
  • #1405 Refactor to support "sl-ember-components-[component]" class pattern for sl-menu component
  • #1406 Refactor to support "sl-ember-components-[component]" class pattern for sl-modal component
  • #1407 Refactor to support "sl-ember-components-[component]" class pattern for sl-pagination component
  • #1408 Refactor to support "sl-ember-components-[component]" class pattern for sl-progress-bar component
  • #1381 Refactor to support "sl-ember-components-[component]" class pattern for sl-radio component
  • #1382 Refactor to support "sl-ember-components-[component]" class pattern for sl-select component
  • #1383 Refactor to support "sl-ember-components-[component]" class pattern for sl-span component
  • #1384 Refactor to support "sl-ember-components-[component]" class pattern for sl-tab-panel component
  • #1385 Refactor to support "sl-ember-components-[component]" class pattern for sl-textarea component
  • #1386 Refactor to support "sl-ember-components-[component]" class pattern for sl-tooltip component
  • #1446 Missing "icon" property in component definition for sl-drop-option, sl-drop-button, and sl-drop-option-divider
  • #1477 Allow sl-chart options to be updated after render
  • #1486 Prevent click event in sl-menu-item-show-all component

ENHANCEMENT

  • All components now correctly leverage Twitter Bootstrap DOM and classes
  • #315 Autoprefixer support
  • #864 Add ability to specify initial sorted column and direction
  • #1173 Standardize bootstrap glyphs across components
  • #1179 Add size support to sl-modal component
  • #1201 and #1478 Upgrade version of Twitter Bootstrap to v3.3.5
  • #1243 sl-select background color
  • #1350 Create error architecture for sl-ember-components

BUG FIX

  • #1035 Invalid CSS property declaration at: *

DEPRECATION

  • #1197 Remove sl-loading-icon component offering

DOCUMENTATION

  • #11 Demo app doesn't like being in a "narrower" browser window
  • #33 Provide directions on how to modify the CSS to swap the loading image
  • #47 Document how consuming application should reference .LESS files
  • #1387 Add documentation to each component about its CSS namespacing
  • #1417 Improve the content on the Error Handling wiki page
  • #1419 Add content to Built in Icon Support page
  • #1430 Create instructions on swapping base font
  • #1434 Link in README.md to support browsers is incorrect.
  • #1452 Remove copy/paste error in warn section of README
  • #1344 Remove select2 from list of dependencies that are not MIT licensed in README

INTERNAL

  • Improved test coverage
  • #1279 Fix file naming
  • #1283 Reduce app.import() calls to single entries vs per-environment

View complete changeset

0.10.2

BUG FIX

  • #1391 jQuery version increased but Ember CLI is checking for previous version

DOCUMENTATION

INTERNAL

View complete changeset

0.10.1

BUG FIX

  • #1340 Highcharts library changed the folder structure of their built/distributed code...again.

DOCUMENTATION

  • #1344 Update README.md. Select2 dependency license is now MIT.

View complete changeset

0.10.0

BREAKING ENHANCEMENT

  • #452 Upgrade to Ember CLI 1.13.8
  • #1223 Validate timezone value in sl-date-time
  • #823 Refactor "spellcheck" property in sl-textarea

ENHANCEMENT

  • #916 Add name property to sl-input-based mixin
  • #791 Extract setInputId() from sl-input-based mixin into own mixin
  • #784 Add missing properties to sl-radio
  • #762 Refactor DOM of sl-modal-header
  • #759 Refactor DOM of sl-modal-footer
  • #757 Refactor DOM of sl-modal-body

BUG FIX

  • #949 sl-grid footer is misaligned
  • #900 Auto-column width does not align header with body
  • #685 Replace use of single quotes with double quotes in template construction in integration tests
  • #682 Refactor the format of the template rendering in the tests to pass linting checks
  • #648 sl-drop-button not showing dropdown options when clicked
  • #614 Failing tests for sl-textarea
  • #613 Failing tests for sl-tab-panel
  • #610 Failing tests for sl-modal

DOCUMENTATION

  • #1233 sl-calender's demo model is not in sync with demo model template
  • #1014 README.MD needs to be updated to include correct components, mixins, etc
  • #962 Add action to documentation for sl-date-picker
  • #877 "Align" enum is not showing up in generated documentation as expected
  • #878 Are other enums experiencing this same documentation problem?
  • #808 Add missing entry for sl-component-input-id mixin in documentation pages
  • #807 Add missing @augments for sl-component-input-id mixin in sl-input and sl-textarea
  • #744 Update sl-button documentation
  • #700 Remove undefined from the @type for the "value" property for sl-date-time
  • #696 Grid demo is broken
  • #664 Change reference to Brocfile.js in 8README.MD* to ember-cli-build.js

INTERNAL

A large majority of these are related to creating a better testing story through the use of component integration tests.

View complete changeset

0.9.4

ENHANCEMENT

BUGFIX

  • #1250 Highcharts dependency changed the location of their source files

INTERNAL

  • #880 Upgrade sl-eslint and ember-cli-jsdoc dependencies
  • #1278 Update blueprint to reflect latest Highcharts version already being installed

View complete changeset

0.9.3

BUGFIX

  • #684 jQuery mousewheel production import is incorrect

INTERNAL

  • #509 sl-modal: Computed properties should return null value by default
  • #672 Synchronize installed version of PhantomJS between TravisCI and dev environments

View complete changeset

0.9.2

BUGFIX

#651 sl-bootstrap blueprint needs to use name and source

View complete changeset

0.9.1

BUGFIX

#642 softlayer/sl-bootstrap entry in blueprints/sl-ember-components/index.js should reference correct version #643 ember-stream should be a dependency, not a devDependency

View complete changeset

0.9.0

BREAKING ENHANCEMENT

  • #344 Upgrade to Ember CLI 0.2.7
  • #344 Replaced implementation of sl-grid with new one
  • #208 Refactored sl-checkboxand added improvements
  • #226 Refactored sl-panel and added improvements
  • #359 Refactored sl-menu and added improvements
  • #499 Added used of ember-stream by sl-menu
  • #429 Deleted mixin:sl-notify-view
  • #441 Deleted mixin:sl-modal-manager and mixin:sl-modal
  • #499 Deleted 'service:sl-modal'
  • #499 Refactored sl-modal to use ember-stream instead of service:sl-modal
  • #478 Put fonts in namespace

BREAKING BUGFIX

  • #306 sl-date-range-picker: Remove change bindings for "startDateChange" and "endDateChange"

ENHANCEMENT

  • #392 Install ember-cli-jsdoc
  • #404 Install joshforisha/sl-eslint
  • #331 mixin:sl-tooltip-enabled: Enable tooltip functionality to include popover and title

BUGFIX

  • #309 Update dependencies for underlying dependency chaining mis-matches that have occurred within Ember CLI ecosystem
  • #389 Dropdown options are shifted off of the dropdown list element
  • #390 sl-select: Couldn't recognize Ember objects passed in (thanks to @JKGisMe)
  • #396 Ember.typeOf( Symbol ) returns "function", caused by https://github.com/emberjs/ember.js/issues/11673
  • #410 sl-select doesn' show pre-existing selection (thanks to @JKGisMe)
  • #526 Added jquery-mousewheel dependency

DOCUMENTATION

  • Added and improved documentation and demo application
  • #365 Support publishing of generated docs to gh-pages branch/site

INTERNAL

  • All components are now fully tested
  • Codebase now aligns with the Ember Style Guide
  • #14 All expected properties that can be defined when a component is used in a template should also be set in the component

View complete changeset

0.8.0

BREAKING ENHANCEMENT

  • #266 Remove es5-shim
  • #271 Upgrade to Ember CLI 0.1.15

ENHANCEMENT

  • #167 Overwrite Font Awesome fonts if already in application tree
  • #276 Update sl-ember-test-helpers to 1.3.0
  • #279 Removed ember-cli-6to5 3.0.0. Added ember-cli-babel 4.0.0
  • #284 Update sl-ember-translate to 1.4.0

BUGFIX

  • #130 Keyboard shortcuts not working correctly in menu

DOCUMENTATION

  • #280 Update installation instructions

INTERNAL

  • Increase test coverage
  • Refactor tests
  • #283 Replaced instances of Ember.A() with []

View complete changeset

0.7.0

BREAKING ENHANCEMENT

  • #159 Upgrade to Ember CLI 0.1.5
  • #152 Upgrade dependencies

ENHANCEMENT

  • #140 Close grid action menu on mouseLeave

DOCUMENTATION

  • #147 Change demo application link
  • #155 Update installation instructions

INTERNAL

  • #145 Installed ember-cli-es5-shim to faciliate running of tests via TravisCI

View complete changeset

0.6.0

BREAKING ENHANCEMENT

  • #131 [BREAKING ENHANCEMENT] Update sl-bootstrap Bower dependency to1.1.0

ENHANCEMENT

  • #116 [ENHANCEMENT] Make CSS source map inclusion dependent on development environment
  • #122 [ENHANCEMENT] Add "align" property to sl-drop-button
  • #123 [ENHANCEMENT] Improve buttons size options

BUGFIX

  • #115 [BUGFIX] Remove duplicate LESS import statements
  • #117 [BUGFIX] Fix Bower package name in blueprint
  • #120 [BUGFIX] Layout of hidden columns in grid system
  • #125 [BUGFIX] Cleanup event listeners in grid system

View complete changeset

0.5.0

BREAKING ENHANCEMENT

  • #106 Upgrade to Ember CLI 0.1.4

ENHANCEMENT

  • #101 Make date-picker properties configurable instead of hard-coded
  • #103 Add properties for additional HTML attributes
  • #104 Additional updates to textarea attributes

BUGFIX

  • #97 Correct asset paths

INTERNAL

  • #90 Update bower dependency url

View complete changeset

0.4.0

BREAKING ENHANCEMENT

  • #58 Upgrade Ember CLI to 0.1.3

ENHANCEMENT

  • #60 Remove content security policy addon
  • #84 Changed the git endpoint for sl-bootstrap Bower dependency
  • #86 Remove content security policy addon configuration from demo application

BUGFIX

  • #55 Add "disabled" class binding to checkbox's div
  • #59

DOCUMENTATION

INTERNAL

View complete changeset

0.3.0

BREAKING INTERNAL

  • #48 Some additional references to previous repository name that was not correctly caught
  • #58 Upgrade Ember CLI to 0.1.3

INTERNAL

  • #49 Update dummy app .LESS reference

View complete changeset

0.2.0

INTERNAL

  • #40 Add additional details to upgrade information
  • #41 Change repository name references missed in previous rename changes
  • #42 Remove incorrect bower dependency on self
  • #43 Update urls
  • #44 Remove @TODO text

View complete changeset

0.1.0

  • Initial release