├── .bowerrc ├── .editorconfig ├── .ember-cli ├── .gitattributes ├── .gitignore ├── .jshintrc ├── .npmignore ├── .watchmanconfig ├── ACCEPTED-CLAS.md ├── CHANGELOG.md ├── CLA-CORPORATE.md ├── CLA-INDIVIDUAL.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── RELEASE-INSTRUCTIONS.md ├── ROADMAP.md ├── VISION-STATEMENT.md ├── addon ├── components │ ├── sl-alert.js │ ├── sl-button.js │ ├── sl-calendar-day.js │ ├── sl-calendar-month.js │ ├── sl-calendar-year.js │ ├── sl-calendar.js │ ├── sl-chart.js │ ├── sl-checkbox.js │ ├── sl-date-picker.js │ ├── sl-date-range-picker.js │ ├── sl-date-time.js │ ├── sl-drop-button.js │ ├── sl-drop-option-divider.js │ ├── sl-drop-option.js │ ├── sl-grid-cell.js │ ├── sl-grid-column-header.js │ ├── sl-grid-row.js │ ├── sl-grid.js │ ├── sl-input.js │ ├── sl-menu-item-show-all.js │ ├── sl-menu-item.js │ ├── sl-menu.js │ ├── sl-modal-body.js │ ├── sl-modal-footer.js │ ├── sl-modal-header.js │ ├── sl-modal.js │ ├── sl-pagination.js │ ├── sl-panel.js │ ├── sl-progress-bar.js │ ├── sl-radio-group.js │ ├── sl-radio.js │ ├── sl-select.js │ ├── sl-span.js │ ├── sl-tab-pane.js │ ├── sl-tab-panel.js │ ├── sl-textarea.js │ └── sl-tooltip.js ├── mixins │ ├── class-prefix.js │ ├── sl-component-input-id.js │ ├── sl-input-based.js │ ├── sl-namespace.js │ └── sl-tooltip-enabled.js ├── templates │ └── components │ │ ├── sl-alert.hbs │ │ ├── sl-button.hbs │ │ ├── sl-calendar-day.hbs │ │ ├── sl-calendar-month.hbs │ │ ├── sl-calendar-year.hbs │ │ ├── sl-calendar.hbs │ │ ├── sl-chart.hbs │ │ ├── sl-checkbox.hbs │ │ ├── sl-date-picker.hbs │ │ ├── sl-date-range-picker.hbs │ │ ├── sl-date-time.hbs │ │ ├── sl-drop-button.hbs │ │ ├── sl-drop-option-divider.hbs │ │ ├── sl-drop-option.hbs │ │ ├── sl-grid-cell.hbs │ │ ├── sl-grid-column-header.hbs │ │ ├── sl-grid.hbs │ │ ├── sl-input.hbs │ │ ├── sl-menu-item-show-all.hbs │ │ ├── sl-menu-item.hbs │ │ ├── sl-menu.hbs │ │ ├── sl-modal-body.hbs │ │ ├── sl-modal-footer.hbs │ │ ├── sl-modal-header.hbs │ │ ├── sl-modal.hbs │ │ ├── sl-pagination.hbs │ │ ├── sl-panel.hbs │ │ ├── sl-progress-bar.hbs │ │ ├── sl-radio-group.hbs │ │ ├── sl-radio.hbs │ │ ├── sl-select.hbs │ │ ├── sl-span.hbs │ │ ├── sl-tab-pane.hbs │ │ ├── sl-tab-panel.hbs │ │ └── sl-textarea.hbs └── utils │ ├── bootstrap-naming.js │ ├── class-prefix.js │ ├── containsValue.js │ ├── error.js │ └── warn.js ├── app ├── components │ ├── sl-alert.js │ ├── sl-button.js │ ├── sl-calendar-day.js │ ├── sl-calendar-month.js │ ├── sl-calendar-year.js │ ├── sl-calendar.js │ ├── sl-chart.js │ ├── sl-checkbox.js │ ├── sl-date-picker.js │ ├── sl-date-range-picker.js │ ├── sl-date-time.js │ ├── sl-drop-button.js │ ├── sl-drop-option-divider.js │ ├── sl-drop-option.js │ ├── sl-grid-cell.js │ ├── sl-grid-column-header.js │ ├── sl-grid-row.js │ ├── sl-grid.js │ ├── sl-input.js │ ├── sl-menu-item-show-all.js │ ├── sl-menu-item.js │ ├── sl-menu.js │ ├── sl-modal-body.js │ ├── sl-modal-footer.js │ ├── sl-modal-header.js │ ├── sl-modal.js │ ├── sl-pagination.js │ ├── sl-panel.js │ ├── sl-progress-bar.js │ ├── sl-radio-group.js │ ├── sl-radio.js │ ├── sl-select.js │ ├── sl-span.js │ ├── sl-tab-pane.js │ ├── sl-tab-panel.js │ ├── sl-textarea.js │ └── sl-tooltip.js └── styles │ ├── addon.less │ ├── mixins.less │ ├── sl-alert.less │ ├── sl-buttons.less │ ├── sl-calendar.less │ ├── sl-date-picker.less │ ├── sl-drop-button.less │ ├── sl-ember-components.less │ ├── sl-grid.less │ ├── sl-input.less │ ├── sl-menu.less │ ├── sl-modal.less │ ├── sl-pagination.less │ ├── sl-progress-bar.less │ ├── sl-select.less │ ├── sl-tab-panel.less │ └── variables.less ├── blueprints └── sl-ember-components │ └── index.js ├── bower.json ├── circle.yml ├── config ├── ember-try.js └── environment.js ├── ember-cli-build.js ├── inch.json ├── index.js ├── jsdoc.json ├── package.json ├── public ├── .gitkeep └── assets │ └── images │ ├── spinner-dark-sm.png │ ├── spinner-dark.png │ ├── spinner-light-sm.png │ └── spinner-light.png ├── testem.js ├── tests ├── .jshintrc ├── blanket-options.js ├── dummy │ ├── .jshintrc │ ├── app │ │ ├── app.js │ │ ├── components │ │ │ ├── demos │ │ │ │ ├── sl-grid-detail.js │ │ │ │ └── tabs │ │ │ │ │ └── tab-one.js │ │ │ └── property-text.js │ │ ├── controllers │ │ │ ├── browsers.js │ │ │ └── demos │ │ │ │ ├── sl-calendar.js │ │ │ │ ├── sl-chart.js │ │ │ │ ├── sl-date-time.js │ │ │ │ ├── sl-drop-button.js │ │ │ │ ├── sl-grid.js │ │ │ │ ├── sl-input.js │ │ │ │ ├── sl-menu.js │ │ │ │ ├── sl-pagination.js │ │ │ │ ├── sl-progress-bar.js │ │ │ │ ├── sl-radio-group.js │ │ │ │ ├── sl-select.js │ │ │ │ ├── sl-span.js │ │ │ │ └── tabs │ │ │ │ └── home.js │ │ ├── helpers │ │ │ └── .gitkeep │ │ ├── index.html │ │ ├── models │ │ │ └── .gitkeep │ │ ├── resolver.js │ │ ├── router.js │ │ ├── routes │ │ │ ├── application.js │ │ │ └── demos │ │ │ │ ├── sl-calendar.js │ │ │ │ ├── sl-chart.js │ │ │ │ ├── sl-grid.js │ │ │ │ ├── sl-menu.js │ │ │ │ └── sl-select.js │ │ ├── styles │ │ │ └── app.less │ │ └── templates │ │ │ ├── application.hbs │ │ │ ├── browsers.hbs │ │ │ ├── components │ │ │ ├── demos │ │ │ │ ├── sl-grid-detail-footer.hbs │ │ │ │ ├── sl-grid-detail-header.hbs │ │ │ │ ├── sl-grid-detail.hbs │ │ │ │ └── tabs │ │ │ │ │ ├── tab-one.hbs │ │ │ │ │ └── tab-two.hbs │ │ │ └── property-text.hbs │ │ │ ├── demos │ │ │ ├── index.hbs │ │ │ ├── sl-alert.hbs │ │ │ ├── sl-button.hbs │ │ │ ├── sl-calendar.hbs │ │ │ ├── sl-chart.hbs │ │ │ ├── sl-checkbox.hbs │ │ │ ├── sl-date-picker.hbs │ │ │ ├── sl-date-range-picker.hbs │ │ │ ├── sl-date-time.hbs │ │ │ ├── sl-drop-button.hbs │ │ │ ├── sl-grid.hbs │ │ │ ├── sl-grid │ │ │ │ ├── detail.hbs │ │ │ │ ├── footer.hbs │ │ │ │ └── header.hbs │ │ │ ├── sl-input.hbs │ │ │ ├── sl-menu.hbs │ │ │ ├── sl-modal.hbs │ │ │ ├── sl-pagination.hbs │ │ │ ├── sl-panel.hbs │ │ │ ├── sl-progress-bar.hbs │ │ │ ├── sl-radio-group.hbs │ │ │ ├── sl-radio.hbs │ │ │ ├── sl-select.hbs │ │ │ ├── sl-span.hbs │ │ │ ├── sl-tab-panel.hbs │ │ │ ├── sl-textarea.hbs │ │ │ └── sl-tooltip.hbs │ │ │ └── index.hbs │ ├── config │ │ └── environment.js │ └── public │ │ ├── .gitkeep │ │ ├── crossdomain.xml │ │ ├── favicon.png │ │ └── robots.txt ├── helpers │ ├── destroy-app.js │ ├── module-for-acceptance.js │ ├── resolver.js │ └── start-app.js ├── index.html ├── integration │ └── components │ │ ├── sl-alert-test.js │ │ ├── sl-button-test.js │ │ ├── sl-calendar-test.js │ │ ├── sl-chart-test.js │ │ ├── sl-checkbox-test.js │ │ ├── sl-date-picker-test.js │ │ ├── sl-date-range-picker-test.js │ │ ├── sl-date-time-test.js │ │ ├── sl-drop-button-test.js │ │ ├── sl-drop-option-divider-test.js │ │ ├── sl-drop-option-test.js │ │ ├── sl-grid-cell-test.js │ │ ├── sl-grid-column-header-test.js │ │ ├── sl-grid-row-test.js │ │ ├── sl-grid-test.js │ │ ├── sl-input-test.js │ │ ├── sl-menu-item-show-all-test.js │ │ ├── sl-menu-item-test.js │ │ ├── sl-menu-test.js │ │ ├── sl-modal-body-test.js │ │ ├── sl-modal-footer-test.js │ │ ├── sl-modal-header-test.js │ │ ├── sl-modal-test.js │ │ ├── sl-pagination-test.js │ │ ├── sl-panel-test.js │ │ ├── sl-progress-bar-test.js │ │ ├── sl-radio-group-test.js │ │ ├── sl-radio-test.js │ │ ├── sl-span-test.js │ │ ├── sl-tab-pane-test.js │ │ ├── sl-tab-panel-test.js │ │ ├── sl-textarea-test.js │ │ └── sl-tooltip-test.js ├── test-helper.js └── unit │ ├── components │ ├── sl-alert-test.js │ ├── sl-button-test.js │ ├── sl-calendar-day-test.js │ ├── sl-calendar-month-test.js │ ├── sl-calendar-test.js │ ├── sl-calendar-year-test.js │ ├── sl-chart-test.js │ ├── sl-checkbox-test.js │ ├── sl-date-picker-test.js │ ├── sl-date-range-picker-test.js │ ├── sl-date-time-test.js │ ├── sl-drop-button-test.js │ ├── sl-drop-option-test.js │ ├── sl-grid-cell-test.js │ ├── sl-grid-column-header-test.js │ ├── sl-grid-row-test.js │ ├── sl-grid-test.js │ ├── sl-input-test.js │ ├── sl-menu-item-show-all-test.js │ ├── sl-menu-item-test.js │ ├── sl-menu-test.js │ ├── sl-modal-body-test.js │ ├── sl-modal-footer-test.js │ ├── sl-modal-header-test.js │ ├── sl-modal-test.js │ ├── sl-pagination-test.js │ ├── sl-panel-test.js │ ├── sl-progress-bar-test.js │ ├── sl-radio-group-test.js │ ├── sl-radio-test.js │ ├── sl-select-test.js │ ├── sl-span-test.js │ ├── sl-tab-pane-test.js │ ├── sl-tab-panel-test.js │ ├── sl-textarea-test.js │ └── sl-tooltip-test.js │ ├── mixins │ ├── sl-component-class-prefix-test.js │ ├── sl-component-input-id-test.js │ ├── sl-input-based-test.js │ └── sl-tooltip-enabled-test.js │ └── utils │ ├── class-prefix-test.js │ └── error-test.js └── vendor └── .gitkeep /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "bower_components", 3 | "analytics": false 4 | } 5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | indent_style = space 14 | indent_size = 4 15 | 16 | [*.js] 17 | indent_style = space 18 | indent_size = 4 19 | 20 | [*.hbs] 21 | insert_final_newline = false 22 | indent_style = space 23 | indent_size = 4 24 | 25 | [*.css] 26 | indent_style = space 27 | indent_size = 4 28 | 29 | [*.html] 30 | indent_style = space 31 | indent_size = 4 32 | 33 | [*.{diff,md}] 34 | trim_trailing_whitespace = false 35 | -------------------------------------------------------------------------------- /.ember-cli: -------------------------------------------------------------------------------- 1 | { 2 | /** 3 | Ember CLI sends analytics information by default. The data is completely 4 | anonymous, but there are times when you might want to disable this behavior. 5 | 6 | Setting `disableAnalytics` to true will prevent any data from being sent. 7 | */ 8 | "disableAnalytics": false 9 | } 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /docs 7 | coverage.json 8 | 9 | # dependencies 10 | /node_modules 11 | /bower_components 12 | 13 | # misc 14 | /.sass-cache 15 | /connect.lock 16 | /coverage/* 17 | /libpeerconnection.log 18 | npm-debug.log 19 | testem.log 20 | *.swp 21 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "document", 4 | "window", 5 | "-Promise" 6 | ], 7 | "browser": true, 8 | "boss": true, 9 | "curly": true, 10 | "debug": false, 11 | "devel": true, 12 | "eqeqeq": true, 13 | "evil": true, 14 | "forin": false, 15 | "immed": false, 16 | "laxbreak": false, 17 | "newcap": true, 18 | "noarg": true, 19 | "noempty": false, 20 | "nonew": false, 21 | "nomen": false, 22 | "onevar": false, 23 | "plusplus": false, 24 | "regexp": false, 25 | "undef": true, 26 | "sub": true, 27 | "strict": false, 28 | "white": false, 29 | "eqnull": true, 30 | "esnext": true, 31 | "unused": true 32 | } 33 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | /bower_components 2 | /config/ember-try.js 3 | /dist 4 | /tests 5 | /tmp 6 | **/.gitkeep 7 | .bowerrc 8 | .editorconfig 9 | .ember-cli 10 | .gitattributes 11 | .gitignore 12 | .jshintrc 13 | .watchmanconfig 14 | .travis.yml 15 | ACCEPTED-CLAS.md 16 | CHANGELOG.md 17 | CLA-CORPORATE.md 18 | CLA-INDIVIDUAL.md 19 | CONTRIBUTING.md 20 | LICENSE.md 21 | README.md 22 | RELEASE-INSTRUCTIONS.md 23 | ROADMAP.md 24 | VISION-STATEMENT.md 25 | bower.json 26 | ember-cli-build.js 27 | inch.json 28 | jsdoc.json 29 | testem.js 30 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | { 2 | "ignore_dirs": ["tmp", "dist"] 3 | } 4 | -------------------------------------------------------------------------------- /ACCEPTED-CLAS.md: -------------------------------------------------------------------------------- 1 | This is a list of GitHub users that have submitted a CLA and from whom we can 2 | accept pull requests. It exists to be able to cross-reference these names 3 | against PRs received from developers. 4 | 5 | * jkgisme 6 | * notmessenger 7 | * juwara0 8 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 SoftLayer Technologies, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /RELEASE-INSTRUCTIONS.md: -------------------------------------------------------------------------------- 1 | # Repository Release Instructions 2 | 3 | This document captures the steps a project maintainer should follow when releasing a new version of this Addon. 4 | 5 | * Merge all desired pull requests into `master` branch 6 | * Create a test Ember application and run `ember install softlayer/sl-ember-components#master` to ensure addon installs correctly 7 | * Exercise the functionality of this addon in the test application 8 | * If change is due to upgrading Ember CLI version 9 | * Update Ember CLI version text in *README.md* file 10 | * Update *CHANGELOG.md* 11 | * Organize each entry into one of the following categories, to be displayed in this order: 12 | * Breaking Enhancement 13 | * An enhancement that breaks the existing usage or features 14 | * Any change that requires a user to change their configuration, *bower.json*, *package.json*, or *ember-cli-build.js* files 15 | * Breaking Bug Fix 16 | * A bug fix that breaks the existing usage or features 17 | * Enhancement 18 | * An improvement to the usage or feature set that users are interested in. 19 | * Deprecation 20 | * A removed feature or method of usage 21 | * Bug Fix 22 | * Bug fixes 23 | * Documentation 24 | * Documentation changes 25 | * Internal 26 | * Changes that do not affect the usage or feature set 27 | * Following the pattern of the existing entries for guidance 28 | * Add appropriately linked "View complete changeset" link at bottom of entries 29 | * Mark as completed any related task items in the appropriate version section of the [ROADMAP](ROADMAP.md) 30 | * After changes have been committed: 31 | * `npm version x.x.x`, where *x.x.x* is the Semantic Version of the changeset 32 | * `git push origin master` 33 | * `git push origin --tags` 34 | * `npm publish --registry http://registry.npmjs.org/` 35 | * Note: `--registry` flag is workaround for occasional issues with default SSL url 36 | * Copy the content of the additions made to the *CHANGELOG.md* file to the Release Notes of the just-released tag 37 | * Run `ember build` 38 | * Run `npm run docs` 39 | * Copy the following resources outside of the working directory so they can be retained between switching branches: 40 | * */docs* 41 | * */dist/index.html* 42 | * */dist/assets/dummy/* * 43 | * */dist/assets/vendor/* * 44 | * */dist/fonts* folder 45 | * */sl-ember-components/assets* folder 46 | * Switch to the `gh-pages` branch 47 | * Replace the same resources listed above with their copies 48 | * Commit and push the changes 49 | -------------------------------------------------------------------------------- /ROADMAP.md: -------------------------------------------------------------------------------- 1 | Content has been moved to [the wiki](https://github.com/softlayer/sl-ember-components/wiki/Roadmap). 2 | -------------------------------------------------------------------------------- /VISION-STATEMENT.md: -------------------------------------------------------------------------------- 1 | Content has been moved to [the wiki](https://github.com/softlayer/sl-ember-components/wiki/Vision-Statement). 2 | -------------------------------------------------------------------------------- /addon/components/sl-calendar-day.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import layout from '../templates/components/sl-calendar-day'; 3 | 4 | /** 5 | * @module 6 | * @augments ember/Component 7 | */ 8 | export default Ember.Component.extend({ 9 | 10 | // ------------------------------------------------------------------------- 11 | // Dependencies 12 | 13 | // ------------------------------------------------------------------------- 14 | // Attributes 15 | 16 | /** @type {String[]} */ 17 | classNameBindings: [ 18 | 'active', 19 | 'new', 20 | 'old' 21 | ], 22 | 23 | /** @type {String[]} */ 24 | classNames: [ 25 | 'day' 26 | ], 27 | 28 | /** @type {Object} */ 29 | layout, 30 | 31 | /** @type {String} */ 32 | tagName: 'td', 33 | 34 | // ------------------------------------------------------------------------- 35 | // Actions 36 | 37 | // ------------------------------------------------------------------------- 38 | // Events 39 | 40 | /** 41 | * @function 42 | * @returns {undefined} 43 | */ 44 | click() { 45 | const content = this.get( 'content' ); 46 | 47 | if ( content ) { 48 | this.sendAction( 'action', content ); 49 | } 50 | }, 51 | 52 | // ------------------------------------------------------------------------- 53 | // Properties 54 | 55 | /** 56 | * Whether the calendar day this cell represents is actively selected day 57 | * 58 | * @type {Boolean} 59 | */ 60 | active: false, 61 | 62 | /** 63 | * The various data representing the day (created and passed in through 64 | * sl-calendar) 65 | * 66 | * @type {?Object} 67 | */ 68 | content: null, 69 | 70 | /** 71 | * Whether the calendar day this cell represents is part of the next month 72 | * in the primary calendar view 73 | * 74 | * @type {Boolean} 75 | */ 76 | 'new': false, 77 | 78 | /** 79 | * Whether the calendar day this cell represents is part of the previous 80 | * month in the primary calendar view 81 | * 82 | * @type {Boolean} 83 | */ 84 | old: false 85 | 86 | // ------------------------------------------------------------------------- 87 | // Observers 88 | 89 | // ------------------------------------------------------------------------- 90 | // Methods 91 | 92 | }); 93 | -------------------------------------------------------------------------------- /addon/components/sl-calendar-month.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import layout from '../templates/components/sl-calendar-month'; 3 | 4 | /** 5 | * @module 6 | * @augments ember/Component 7 | */ 8 | export default Ember.Component.extend({ 9 | 10 | // ------------------------------------------------------------------------- 11 | // Dependencies 12 | 13 | // ------------------------------------------------------------------------- 14 | // Attributes 15 | 16 | /** @type {String[]} */ 17 | classNameBindings: [ 18 | 'active' 19 | ], 20 | 21 | /** @type {Object} */ 22 | layout, 23 | 24 | /** @type {String} */ 25 | tagName: 'span', 26 | 27 | // ------------------------------------------------------------------------- 28 | // Actions 29 | 30 | // ------------------------------------------------------------------------- 31 | // Events 32 | 33 | /** 34 | * @function 35 | * @returns {undefined} 36 | */ 37 | click() { 38 | this.sendAction( 'action', this.get( 'month' ) ); 39 | }, 40 | 41 | // ------------------------------------------------------------------------- 42 | // Properties 43 | 44 | /** 45 | * Whether the month that this component represents is selected by the 46 | * overall calendar component 47 | * 48 | * @type {Boolean} 49 | */ 50 | active: false, 51 | 52 | /** 53 | * The locale string to use for moment dates 54 | * 55 | * @type {String} 56 | */ 57 | locale: 'en', 58 | 59 | /** 60 | * The number of the month (1-12) 61 | * 62 | * @type {?Number} 63 | */ 64 | month: null, 65 | 66 | // ------------------------------------------------------------------------- 67 | // Observers 68 | 69 | // ------------------------------------------------------------------------- 70 | // Methods 71 | 72 | /** 73 | * The short string name of the represented month 74 | * 75 | * @function 76 | * @returns {String} 77 | */ 78 | shortName: Ember.computed( 79 | 'month', 80 | function() { 81 | return window.moment([ 1, this.get( 'month' ) - 1 ]) 82 | .locale( this.get( 'locale' ) ) 83 | .format( 'MMM' ); 84 | } 85 | ) 86 | 87 | }); 88 | -------------------------------------------------------------------------------- /addon/components/sl-calendar-year.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import layout from '../templates/components/sl-calendar-year'; 3 | 4 | /** 5 | * @module 6 | * @augments ember/Component 7 | */ 8 | export default Ember.Component.extend({ 9 | 10 | // ------------------------------------------------------------------------- 11 | // Dependencies 12 | 13 | // ------------------------------------------------------------------------- 14 | // Attributes 15 | 16 | /** @type {String[]} */ 17 | classNameBindings: [ 18 | 'active', 19 | 'new', 20 | 'old' 21 | ], 22 | 23 | /** @type {Object} */ 24 | layout, 25 | 26 | /** @type {String} */ 27 | tagName: 'span', 28 | 29 | // ------------------------------------------------------------------------- 30 | // Actions 31 | 32 | // ------------------------------------------------------------------------- 33 | // Events 34 | 35 | /** 36 | * @function 37 | * @returns {undefined} 38 | */ 39 | click() { 40 | this.sendAction( 'action', this.get( 'year' ) ); 41 | }, 42 | 43 | // ------------------------------------------------------------------------- 44 | // Properties 45 | 46 | /** 47 | * Whether the year this component represents is the currently active year 48 | * of the parent calendar component 49 | * 50 | * @type {Boolean} 51 | */ 52 | active: false, 53 | 54 | /** 55 | * Whether the year this component represents is in the next decade from the 56 | * parent calendar's current year 57 | * 58 | * @type {Boolean} 59 | */ 60 | 'new': false, 61 | 62 | /** 63 | * Whether the year this component represents is in the previous decade from 64 | * the parent calendar's current year 65 | * 66 | * @type {Boolean} 67 | */ 68 | old: false, 69 | 70 | /** 71 | * The year number this component represents 72 | * 73 | * @type {?Number} 74 | */ 75 | year: null 76 | 77 | // ------------------------------------------------------------------------- 78 | // Observers 79 | 80 | // ------------------------------------------------------------------------- 81 | // Methods 82 | 83 | }); 84 | -------------------------------------------------------------------------------- /addon/components/sl-checkbox.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import ClassPrefix from '../mixins/class-prefix'; 3 | import InputBased from '../mixins/sl-input-based'; 4 | import TooltipEnabled from '../mixins/sl-tooltip-enabled'; 5 | import layout from '../templates/components/sl-checkbox'; 6 | 7 | /** 8 | * @module 9 | * @augments ember/Component 10 | * @augments module:mixins/sl-input-based 11 | * @augments module:mixins/sl-tooltip-enabled 12 | */ 13 | export default Ember.Component.extend( ClassPrefix, InputBased, TooltipEnabled, { 14 | 15 | // ------------------------------------------------------------------------- 16 | // Dependencies 17 | 18 | // ------------------------------------------------------------------------- 19 | // Attributes 20 | 21 | /** @type {String[]} */ 22 | classNameBindings: [ 23 | 'componentClassName', 24 | 'checkboxType', 25 | 'inline::form-group' 26 | ], 27 | 28 | /** @type {Object} */ 29 | layout, 30 | 31 | /** @type {String} */ 32 | tagName: 'div', 33 | 34 | // ------------------------------------------------------------------------- 35 | // Actions 36 | 37 | // ------------------------------------------------------------------------- 38 | // Events 39 | 40 | // ------------------------------------------------------------------------- 41 | // Properties 42 | 43 | /** 44 | * Whether the input is checked or not 45 | * 46 | * @type {Boolean} 47 | */ 48 | checked: false, 49 | 50 | /** 51 | * Component class that will be prefixed with base component class 52 | * 53 | * @type {String} 54 | */ 55 | componentClass: 'checkbox', 56 | 57 | /** 58 | * Whether to show the component in-line 59 | * 60 | * @type {Boolean} 61 | */ 62 | inline: false, 63 | 64 | /** 65 | * The input's label text 66 | * 67 | * @type {?String} 68 | */ 69 | label: null, 70 | 71 | // ------------------------------------------------------------------------- 72 | // Observers 73 | 74 | /** 75 | * Initialize any computed properties that need setup 76 | * 77 | * @function 78 | * @returns {undefined} 79 | */ 80 | initialize: Ember.on( 81 | 'init', 82 | function() { 83 | if ( this.get( 'inline' ) ) { 84 | this.set( 'tagName', 'label' ); 85 | } 86 | } 87 | ), 88 | 89 | // ------------------------------------------------------------------------- 90 | // Methods 91 | 92 | /** 93 | * Type of checkbox; "checkbox-inline" when inline, "checkbox" default 94 | * 95 | * @function 96 | * @returns {String} 97 | */ 98 | checkboxType: Ember.computed( 99 | 'inline', 100 | function() { 101 | return this.get( 'inline' ) ? 'checkbox-inline' : 'checkbox'; 102 | } 103 | ) 104 | 105 | }); 106 | -------------------------------------------------------------------------------- /addon/components/sl-drop-option-divider.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import ClassPrefix from '../mixins/class-prefix'; 3 | import layout from '../templates/components/sl-drop-option-divider'; 4 | 5 | /** 6 | * @module 7 | * @augments ember/Component 8 | */ 9 | export default Ember.Component.extend( ClassPrefix, { 10 | 11 | // ------------------------------------------------------------------------- 12 | // Dependencies 13 | 14 | // ------------------------------------------------------------------------- 15 | // Attributes 16 | 17 | /** @type {String} */ 18 | ariaRole: 'separator', 19 | 20 | /** @type {String[]} */ 21 | classNameBindings: [ 22 | 'componentClassName' 23 | ], 24 | 25 | /** @type {String[]} */ 26 | classNames: [ 27 | 'divider' 28 | ], 29 | 30 | /** @type {Object} */ 31 | layout, 32 | 33 | /** @type {String} */ 34 | tagName: 'li', 35 | 36 | // ------------------------------------------------------------------------- 37 | // Actions 38 | 39 | // ------------------------------------------------------------------------- 40 | // Events 41 | 42 | // ------------------------------------------------------------------------- 43 | // Properties 44 | 45 | /** 46 | * Component class that will be prefixed with base component class 47 | * 48 | * @type {String} 49 | */ 50 | componentClass: 'drop-option-divider' 51 | 52 | // ------------------------------------------------------------------------- 53 | // Observers 54 | 55 | // ------------------------------------------------------------------------- 56 | // Methods 57 | 58 | }); 59 | -------------------------------------------------------------------------------- /addon/components/sl-drop-option.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import ClassPrefix from '../mixins/class-prefix'; 3 | import layout from '../templates/components/sl-drop-option'; 4 | 5 | /** 6 | * @module 7 | * @augments ember/Component 8 | */ 9 | export default Ember.Component.extend( ClassPrefix, { 10 | 11 | // ------------------------------------------------------------------------- 12 | // Dependencies 13 | 14 | // ------------------------------------------------------------------------- 15 | // Attributes 16 | 17 | /** @type {String[]} */ 18 | classNameBindings: [ 19 | 'componentClassName' 20 | ], 21 | 22 | /** @type {Object} */ 23 | layout, 24 | 25 | /** @type {String} */ 26 | tagName: 'li', 27 | 28 | // ------------------------------------------------------------------------- 29 | // Actions 30 | 31 | /** @type {Object} */ 32 | actions: { 33 | 34 | /** 35 | * Send the primary action, with `data` property if defined, when the 36 | * click action is triggered 37 | * 38 | * @function actions:click 39 | * @returns {undefined} 40 | */ 41 | click() { 42 | this.sendAction( 'action', this.get( 'data' ), this.get( 'actionContext' ) ); 43 | } 44 | 45 | }, 46 | 47 | // ------------------------------------------------------------------------- 48 | // Events 49 | 50 | // ------------------------------------------------------------------------- 51 | // Properties 52 | 53 | /** 54 | * Additional context to be passed along with the action 55 | * 56 | * Can be used by the receiver of the action sent to determine which drop button 57 | * option was selected 58 | * 59 | * @type {?*} 60 | */ 61 | actionContext: null, 62 | 63 | /** 64 | * Component class that will be prefixed with base component class 65 | * 66 | * @type {String} 67 | */ 68 | componentClass: 'drop-option', 69 | 70 | /** 71 | * Any data to be passed along with the action 72 | * 73 | * @type {?Object} 74 | */ 75 | data: null, 76 | 77 | /** 78 | * Text label for the option 79 | * 80 | * @type {?String} 81 | */ 82 | label: null 83 | 84 | // ------------------------------------------------------------------------- 85 | // Observers 86 | 87 | // ------------------------------------------------------------------------- 88 | // Methods 89 | 90 | }); 91 | -------------------------------------------------------------------------------- /addon/components/sl-grid-column-header.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import SlGridCell from './sl-grid-cell'; 3 | import layout from '../templates/components/sl-grid-column-header'; 4 | 5 | /** 6 | * Valid sort values for the sl-grid-column-header component 7 | * 8 | * @memberof module:addon/components/sl-grid-column-header 9 | * @enum {String} 10 | * @property {String} ASC 'asc', 11 | * @property {String} DESC 'desc', 12 | * @property {String} NULL null, 13 | */ 14 | export const Sort = Object.freeze({ 15 | ASC: 'asc', 16 | DESC: 'desc', 17 | NULL: null 18 | }); 19 | 20 | /** 21 | * @module 22 | * @augments module:components/sl-grid-cell 23 | */ 24 | export default SlGridCell.extend({ 25 | 26 | // ------------------------------------------------------------------------- 27 | // Dependencies 28 | 29 | // ------------------------------------------------------------------------- 30 | // Attributes 31 | 32 | /** @type {String[]} */ 33 | classNameBindings: [ 34 | 'sortable:sortable-column', 35 | 'sortedClass' 36 | ], 37 | 38 | /** @type {Object} */ 39 | layout, 40 | 41 | /** @type {String} */ 42 | tagName: 'th', 43 | 44 | // ------------------------------------------------------------------------- 45 | // Actions 46 | 47 | // ------------------------------------------------------------------------- 48 | // Events 49 | 50 | /** 51 | * @function 52 | * @returns {undefined} 53 | */ 54 | click() { 55 | if ( true === this.get( 'sortable' ) ) { 56 | this.sendAction( 'onClick', this.get( 'column' ) ); 57 | } 58 | }, 59 | 60 | // ------------------------------------------------------------------------- 61 | // Properties 62 | 63 | /** 64 | * The column record 65 | * 66 | * @type {?Object} 67 | */ 68 | column: null, 69 | 70 | /** 71 | * Whether the column is sortable 72 | * 73 | * @type {Boolean} 74 | */ 75 | sortable: true, 76 | 77 | /** 78 | * The sort direction of the column 79 | * 80 | * @type {Sort} 81 | */ 82 | sorted: Sort.NULL, 83 | 84 | // ------------------------------------------------------------------------- 85 | // Observers 86 | 87 | // ------------------------------------------------------------------------- 88 | // Methods 89 | 90 | /** 91 | * Class name string based on sorted property 92 | * 93 | * @function 94 | * @returns {?String} 95 | */ 96 | sortedClass: Ember.computed( 97 | 'sortable', 98 | 'sorted', 99 | function() { 100 | const sorted = this.get( 'sorted' ); 101 | let className = null; 102 | 103 | if ( this.get( 'sortable' ) && !Ember.isNone( sorted ) ) { 104 | className = 'column-' + ( 105 | 'asc' === sorted ? 'ascending' : 'descending' 106 | ); 107 | } 108 | 109 | return className; 110 | } 111 | ) 112 | 113 | }); 114 | -------------------------------------------------------------------------------- /addon/components/sl-grid-row.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import config from 'ember-get-config'; 3 | 4 | /** 5 | * @module 6 | * @augments ember/Component 7 | */ 8 | export default Ember.Component.extend({ 9 | 10 | // ------------------------------------------------------------------------- 11 | // Dependencies 12 | 13 | // ------------------------------------------------------------------------- 14 | // Attributes 15 | 16 | /** @type {String[]} */ 17 | classNameBindings: [ 18 | 'active:active' 19 | ], 20 | 21 | /** @type {String} */ 22 | tagName: 'tr', 23 | 24 | // ------------------------------------------------------------------------- 25 | // Actions 26 | 27 | // ------------------------------------------------------------------------- 28 | // Events 29 | 30 | /** 31 | * @function 32 | * @param {Event} event - The raw click event 33 | * @returns {undefined} 34 | */ 35 | click( event ) { 36 | const dropButtonClass = `.${config.componentClassPrefix}-drop-button`; 37 | if ( this.$( event.target ).closest( dropButtonClass ).length < 1 ) { 38 | this.sendAction( 'onClick', this ); 39 | } 40 | }, 41 | 42 | // ------------------------------------------------------------------------- 43 | // Properties 44 | 45 | /** 46 | * Whether the row is selected 47 | * 48 | * @type {Boolean} 49 | */ 50 | active: false, 51 | 52 | /** 53 | * The row record model instance 54 | * 55 | * @type {?Object} 56 | */ 57 | record: null 58 | 59 | // ------------------------------------------------------------------------- 60 | // Observers 61 | 62 | // ------------------------------------------------------------------------- 63 | // Methods 64 | 65 | }); 66 | -------------------------------------------------------------------------------- /addon/components/sl-menu-item-show-all.js: -------------------------------------------------------------------------------- 1 | import SlMenuItem from './sl-menu-item'; 2 | import layout from '../templates/components/sl-menu-item-show-all'; 3 | 4 | /** 5 | * @module 6 | * @augments module:components/sl-button 7 | */ 8 | export default SlMenuItem.extend({ 9 | 10 | // ------------------------------------------------------------------------- 11 | // Dependencies 12 | 13 | // ------------------------------------------------------------------------- 14 | // Attributes 15 | 16 | /** @type {String[]} */ 17 | classNames: [ 18 | 'btn', 19 | 'btn-default' 20 | ], 21 | 22 | /** @type {Object} */ 23 | layout, 24 | 25 | // ------------------------------------------------------------------------- 26 | // Actions 27 | 28 | /** @type {Object} */ 29 | actions: { 30 | 31 | /** 32 | * Click event handler 33 | * 34 | * @function actions:click 35 | * @returns {undefined} 36 | */ 37 | click() {} 38 | 39 | }, 40 | 41 | // ------------------------------------------------------------------------- 42 | // Events 43 | 44 | /** 45 | * mouseEnter event handler 46 | * 47 | * @function 48 | * @returns {undefined} 49 | */ 50 | mouseEnter() { 51 | this.sendAction( 'onMouseEnter' ); 52 | } 53 | 54 | // ------------------------------------------------------------------------- 55 | // Properties 56 | 57 | // ------------------------------------------------------------------------- 58 | // Observers 59 | 60 | // ------------------------------------------------------------------------- 61 | // Methods 62 | 63 | }); 64 | -------------------------------------------------------------------------------- /addon/components/sl-modal-body.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import ClassPrefix from '../mixins/class-prefix'; 3 | import layout from '../templates/components/sl-modal-body'; 4 | 5 | /** 6 | * @module 7 | * @augments ember/Component 8 | */ 9 | export default Ember.Component.extend( ClassPrefix, { 10 | 11 | // ------------------------------------------------------------------------- 12 | // Dependencies 13 | 14 | // ------------------------------------------------------------------------- 15 | // Attributes 16 | 17 | /** @type {String[]} */ 18 | classNameBindings: [ 19 | 'componentClassName' 20 | ], 21 | 22 | /** @type {String[]} */ 23 | classNames: [ 24 | 'modal-body' 25 | ], 26 | 27 | /** @type {Object} */ 28 | layout: layout, 29 | 30 | // ------------------------------------------------------------------------- 31 | // Actions 32 | 33 | // ------------------------------------------------------------------------- 34 | // Events 35 | 36 | // ------------------------------------------------------------------------- 37 | // Properties 38 | 39 | /** 40 | * Component class that will be prefixed with base component class 41 | * 42 | * @type {String} 43 | */ 44 | componentClass: 'modal-body' 45 | 46 | // ------------------------------------------------------------------------- 47 | // Observers 48 | 49 | // ------------------------------------------------------------------------- 50 | // Methods 51 | }); 52 | -------------------------------------------------------------------------------- /addon/components/sl-modal-footer.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import ClassPrefix from '../mixins/class-prefix'; 3 | import layout from '../templates/components/sl-modal-footer'; 4 | 5 | /** 6 | * @module 7 | * @augments ember/Component 8 | */ 9 | export default Ember.Component.extend( ClassPrefix, { 10 | 11 | // ------------------------------------------------------------------------- 12 | // Dependencies 13 | 14 | // ------------------------------------------------------------------------- 15 | // Attributes 16 | 17 | /** 18 | * The close button text 19 | * 20 | * @type {String} 21 | */ 22 | buttonText: 'Close', 23 | 24 | /** @type {String[]} */ 25 | classNameBindings: [ 26 | 'componentClassName' 27 | ], 28 | 29 | /** @type {String[]} */ 30 | classNames: [ 31 | 'modal-footer' 32 | ], 33 | 34 | /** @type {Object} */ 35 | layout: layout, 36 | 37 | // ------------------------------------------------------------------------- 38 | // Actions 39 | 40 | // ------------------------------------------------------------------------- 41 | // Events 42 | 43 | // ------------------------------------------------------------------------- 44 | // Properties 45 | 46 | /** 47 | * Component class that will be prefixed with base component class 48 | * 49 | * @type {String} 50 | */ 51 | componentClass: 'modal-footer' 52 | 53 | // ------------------------------------------------------------------------- 54 | // Observers 55 | 56 | // ------------------------------------------------------------------------- 57 | // Methods 58 | }); 59 | -------------------------------------------------------------------------------- /addon/components/sl-modal-header.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import ClassPrefix from '../mixins/class-prefix'; 3 | import layout from '../templates/components/sl-modal-header'; 4 | 5 | /** 6 | * @module 7 | * @augments ember/Component 8 | */ 9 | export default Ember.Component.extend( ClassPrefix, { 10 | 11 | // ------------------------------------------------------------------------- 12 | // Dependencies 13 | 14 | // ------------------------------------------------------------------------- 15 | // Attributes 16 | 17 | /** @type {String[]} */ 18 | classNameBindings: [ 19 | 'componentClassName' 20 | ], 21 | 22 | /** @type {String[]} */ 23 | classNames: [ 24 | 'modal-header' 25 | ], 26 | 27 | /** @type {Object} */ 28 | layout: layout, 29 | 30 | // ------------------------------------------------------------------------- 31 | // Actions 32 | 33 | // ------------------------------------------------------------------------- 34 | // Events 35 | 36 | // ------------------------------------------------------------------------- 37 | // Properties 38 | 39 | /** 40 | * Component class that will be prefixed with base component class 41 | * 42 | * @type {String} 43 | */ 44 | componentClass: 'modal-header' 45 | 46 | // ------------------------------------------------------------------------- 47 | // Observers 48 | 49 | // ------------------------------------------------------------------------- 50 | // Methods 51 | }); 52 | -------------------------------------------------------------------------------- /addon/components/sl-panel.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import ClassPrefix from '../mixins/class-prefix'; 3 | import layout from '../templates/components/sl-panel'; 4 | import containsValue from '../utils/containsValue'; 5 | import warn from '../utils/warn'; 6 | import { 7 | Theme as TWBSTheme 8 | } from '../utils/bootstrap-naming'; 9 | 10 | /** 11 | * @module 12 | * @augments ember/Component 13 | */ 14 | export default Ember.Component.extend( ClassPrefix, { 15 | 16 | // ------------------------------------------------------------------------- 17 | // Dependencies 18 | 19 | // ------------------------------------------------------------------------- 20 | // Attributes 21 | 22 | /** @type {String[]} */ 23 | classNameBindings: [ 24 | 'componentClassName', 25 | 'themeClassName' 26 | ], 27 | 28 | /** @type {String[]} */ 29 | classNames: [ 30 | 'panel' 31 | ], 32 | 33 | /** @type {Object} */ 34 | layout, 35 | 36 | // ------------------------------------------------------------------------- 37 | // Actions 38 | 39 | // ------------------------------------------------------------------------- 40 | // Events 41 | 42 | // ------------------------------------------------------------------------- 43 | // Properties 44 | 45 | /** 46 | * Component class that will be prefixed with base component class 47 | * 48 | * @type {String} 49 | */ 50 | componentClass: 'panel', 51 | 52 | /** 53 | * Footer text to display in the footer section of the panel 54 | * 55 | * @type {?String} 56 | */ 57 | footer: null, 58 | 59 | /** 60 | * Heading text to display in the header section of the panel 61 | * 62 | * @type {?String} 63 | */ 64 | heading: null, 65 | 66 | /** 67 | * When true, the panel body will be in a loading state 68 | * 69 | * @type {Boolean} 70 | */ 71 | loading: false, 72 | 73 | /** 74 | * The Bootstrap "theme" style name 75 | * 76 | * @type {TWBSTheme} 77 | */ 78 | theme: TWBSTheme.DEFAULT, 79 | 80 | // ------------------------------------------------------------------------- 81 | // Observers 82 | 83 | // ------------------------------------------------------------------------- 84 | // Methods 85 | 86 | /** 87 | * Element-specific class name for the Bootstrap "theme" style 88 | * 89 | * @function 90 | * @returns {String} 91 | */ 92 | themeClassName: Ember.computed( 93 | 'theme', 94 | function() { 95 | const theme = this.get( 'theme' ); 96 | 97 | if ( !containsValue( theme, TWBSTheme ) ) { 98 | warn( `Invalid theme property value "${theme}"` ); 99 | } 100 | 101 | return `panel-${theme}`; 102 | } 103 | ) 104 | 105 | }); 106 | -------------------------------------------------------------------------------- /addon/components/sl-radio.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import ClassPrefix from '../mixins/class-prefix'; 3 | import InputBased from '../mixins/sl-input-based'; 4 | import layout from '../templates/components/sl-radio'; 5 | 6 | /** 7 | * @module 8 | * @augments ember/Component 9 | * @augments module:mixins/sl-input-based 10 | */ 11 | export default Ember.Component.extend( ClassPrefix, InputBased, { 12 | 13 | // ------------------------------------------------------------------------- 14 | // Dependencies 15 | 16 | // ------------------------------------------------------------------------- 17 | // Attributes 18 | 19 | /** @type {String[]} */ 20 | classNameBindings: [ 21 | 'componentClassName', 22 | 'radioType', 23 | 'inline::form-group' 24 | ], 25 | 26 | /** @type {Object} */ 27 | layout, 28 | 29 | /** @type {String} */ 30 | tagName: 'div', 31 | 32 | // ------------------------------------------------------------------------- 33 | // Actions 34 | 35 | // ------------------------------------------------------------------------- 36 | // Events 37 | 38 | // ------------------------------------------------------------------------- 39 | // Properties 40 | 41 | /** 42 | * Component class that will be prefixed with base component class 43 | * 44 | * @type {String} 45 | */ 46 | componentClass: 'radio', 47 | 48 | /** 49 | * Whether to show the component in-line 50 | * 51 | * @type {Boolean} 52 | */ 53 | inline: false, 54 | 55 | /** 56 | * Text label for the component 57 | * 58 | * @type {?String} 59 | */ 60 | label: null, 61 | 62 | /** 63 | * Bound value for the radio button 64 | * 65 | * @type {?String} 66 | */ 67 | value: null, 68 | 69 | // ------------------------------------------------------------------------- 70 | // Observers 71 | 72 | /** 73 | * Initialize any computed properties that need setup 74 | * 75 | * @function 76 | * @returns {undefined} 77 | */ 78 | initialize: Ember.on( 79 | 'init', 80 | function() { 81 | if ( this.get( 'inline' ) ) { 82 | this.set( 'tagName', 'label' ); 83 | } 84 | } 85 | ), 86 | 87 | // ------------------------------------------------------------------------- 88 | // Methods 89 | 90 | /** 91 | * Type of radio button; "radio-inline" when inline, "radio" default 92 | * 93 | * @function 94 | * @returns {String} 95 | */ 96 | radioType: Ember.computed( 97 | 'inline', 98 | function() { 99 | return this.get( 'inline' ) ? 'radio-inline' : 'radio'; 100 | } 101 | ) 102 | 103 | }); 104 | -------------------------------------------------------------------------------- /addon/components/sl-span.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import ClassPrefix from '../mixins/class-prefix'; 3 | import layout from '../templates/components/sl-span'; 4 | 5 | /** 6 | * @module 7 | * @augments ember/Component 8 | */ 9 | export default Ember.Component.extend( ClassPrefix, { 10 | 11 | // ------------------------------------------------------------------------- 12 | // Dependencies 13 | 14 | // ------------------------------------------------------------------------- 15 | // Attributes 16 | 17 | /** @type {String[]} */ 18 | classNameBindings: [ 19 | 'componentClassName', 20 | 'inverse', 21 | 'loading:sl-loading' 22 | ], 23 | 24 | /** @type {Object} */ 25 | layout, 26 | 27 | /** @type {String} */ 28 | tagName: 'span', 29 | 30 | // ------------------------------------------------------------------------- 31 | // Actions 32 | 33 | // ------------------------------------------------------------------------- 34 | // Events 35 | 36 | // ------------------------------------------------------------------------- 37 | // Properties 38 | 39 | /** 40 | * Component class that will be prefixed with base component class 41 | * 42 | * @type {String} 43 | */ 44 | componentClass: 'span', 45 | 46 | /** 47 | * Whether "inverse" class should be applied (only for sl-loading in this context) 48 | * 49 | * @type {Boolean} 50 | */ 51 | inverse: false, 52 | 53 | /** 54 | * Whether to show the loading icon or content 55 | * 56 | * @type {Boolean} 57 | */ 58 | loading: false, 59 | 60 | /** 61 | * The value to display once loaded/ready 62 | * 63 | * @type {?String} 64 | */ 65 | value: null 66 | 67 | // ------------------------------------------------------------------------- 68 | // Observers 69 | 70 | // ------------------------------------------------------------------------- 71 | // Methods 72 | 73 | }); 74 | -------------------------------------------------------------------------------- /addon/components/sl-tab-pane.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import layout from '../templates/components/sl-tab-pane'; 3 | 4 | /** 5 | * @module 6 | * @augments ember/Component 7 | */ 8 | export default Ember.Component.extend({ 9 | 10 | // ------------------------------------------------------------------------- 11 | // Dependencies 12 | 13 | // ------------------------------------------------------------------------- 14 | // Attributes 15 | 16 | /** @type {String[]} */ 17 | attributeBindings: [ 18 | 'data-tab-label', 19 | 'data-tab-name' 20 | ], 21 | 22 | /** @type {String[]} */ 23 | classNames: [ 24 | 'tab-pane' 25 | ], 26 | 27 | /** @type {Object} */ 28 | layout, 29 | 30 | // ------------------------------------------------------------------------- 31 | // Actions 32 | 33 | // ------------------------------------------------------------------------- 34 | // Events 35 | 36 | // ------------------------------------------------------------------------- 37 | // Properties 38 | 39 | /** 40 | * Alias to `label`; data attribute binding for the `label` property 41 | * 42 | * @type {module:components/sl-tab-pane~label} 43 | */ 44 | 'data-tab-label': Ember.computed.alias( 'label' ), 45 | 46 | /** 47 | * Alias to `name`; data attribute binding for the `name` property 48 | * 49 | * @type {module:components/sl-tab-pane~name} 50 | */ 51 | 'data-tab-name': Ember.computed.alias( 'name' ), 52 | 53 | /** 54 | * Label text for the displayed tab name 55 | * 56 | * @type {?String} 57 | */ 58 | label: null, 59 | 60 | /** 61 | * Text for internal tab identification 62 | * 63 | * @type {?String} 64 | */ 65 | name: null 66 | 67 | // ------------------------------------------------------------------------- 68 | // Observers 69 | 70 | // ------------------------------------------------------------------------- 71 | // Methods 72 | 73 | }); 74 | -------------------------------------------------------------------------------- /addon/components/sl-tooltip.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import ClassPrefix from '../mixins/class-prefix'; 3 | import TooltipEnabled from '../mixins/sl-tooltip-enabled'; 4 | import { throwTooltipError } from '../utils/error'; 5 | 6 | /** 7 | * @module 8 | * @augments ember/Component 9 | * @augments module:mixins/sl-tooltip-enabled 10 | */ 11 | export default Ember.Component.extend( ClassPrefix, TooltipEnabled, { 12 | 13 | // ------------------------------------------------------------------------- 14 | // Dependencies 15 | 16 | // ------------------------------------------------------------------------- 17 | // Attributes 18 | 19 | /** @type {String[]} */ 20 | classNameBindings: [ 21 | 'componentClassName' 22 | ], 23 | 24 | /** @type {String} */ 25 | tagName: 'span', 26 | 27 | // ------------------------------------------------------------------------- 28 | // Actions 29 | 30 | // ------------------------------------------------------------------------- 31 | // Events 32 | 33 | /** 34 | * init event hook 35 | * 36 | * @returns {undefined} 37 | */ 38 | init() { 39 | this._super( ...arguments ); 40 | this.initialize(); 41 | }, 42 | 43 | // ------------------------------------------------------------------------- 44 | // Properties 45 | 46 | /** 47 | * Component class that will be prefixed with base component class 48 | * 49 | * @type {String} 50 | */ 51 | componentClass: 'tooltip', 52 | 53 | // ------------------------------------------------------------------------- 54 | // Observers 55 | 56 | // ------------------------------------------------------------------------- 57 | // Methods 58 | 59 | /** 60 | * Check passed parameters on initialization 61 | * 62 | * @private 63 | * @throws {sl-ember-components/utils/error/tooltip} Thrown if 'title' or 'popover' is invalid 64 | * @returns {undefined} 65 | */ 66 | initialize() { 67 | if ( 'string' !== Ember.typeOf( this.get( 'title' ) ) ) { 68 | throwTooltipError( 69 | 'enableTooltip() and enablePopover() expect the parameter "title" and for it to be a string' 70 | ); 71 | } 72 | 73 | if ( 'string' !== Ember.typeOf( this.get( 'popover' ) ) && 74 | 'undefined' !== Ember.typeOf( this.get( 'popover' ) ) ) { 75 | throwTooltipError( 76 | 'enablePopover() expects the parameter "popover" and for it to be a string' 77 | ); 78 | } 79 | } 80 | 81 | }); 82 | -------------------------------------------------------------------------------- /addon/mixins/class-prefix.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import prefix from '../utils/class-prefix'; 3 | 4 | export default Ember.Mixin.create({ 5 | 6 | // ------------------------------------------------------------------------- 7 | // Dependencies 8 | 9 | // ------------------------------------------------------------------------- 10 | // Attributes 11 | 12 | // ------------------------------------------------------------------------- 13 | // Actions 14 | 15 | // ------------------------------------------------------------------------- 16 | // Events 17 | 18 | // ------------------------------------------------------------------------- 19 | // Properties 20 | 21 | /** 22 | * Dynamically prefix component class name 23 | * 24 | * @function 25 | * @returns {String} 26 | */ 27 | componentClassName: Ember.computed( 28 | '', 29 | function() { 30 | return prefix( this.componentClass ); 31 | } 32 | ) 33 | 34 | // ------------------------------------------------------------------------- 35 | // Methods 36 | 37 | }); 38 | -------------------------------------------------------------------------------- /addon/mixins/sl-component-input-id.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | /** 4 | * @module 5 | * @augments ember/Mixin 6 | */ 7 | export default Ember.Mixin.create({ 8 | 9 | // ------------------------------------------------------------------------- 10 | // Dependencies 11 | 12 | // ------------------------------------------------------------------------- 13 | // Attributes 14 | 15 | // ------------------------------------------------------------------------- 16 | // Actions 17 | 18 | // ------------------------------------------------------------------------- 19 | // Events 20 | 21 | /** 22 | * init event hook 23 | * 24 | * @function 25 | * @returns {undefined} 26 | */ 27 | init: function() { 28 | this._super( ...arguments ); 29 | this.setInputId(); 30 | }, 31 | 32 | // ------------------------------------------------------------------------- 33 | // Properties 34 | 35 | /** 36 | * Unique input id that a component can assign to an input 37 | * and a label's for attribute 38 | * 39 | * @type {?String} 40 | */ 41 | inputId: null, 42 | 43 | // ------------------------------------------------------------------------- 44 | // Observers 45 | 46 | // ------------------------------------------------------------------------- 47 | // Methods 48 | 49 | /** 50 | * Set unique inputId that will be set on label and input element 51 | * 52 | * @private 53 | * @function 54 | * @returns {undefined} 55 | */ 56 | setInputId: function() { 57 | if ( !this.get( 'inputId' ) ) { 58 | this.set( 'inputId', this.get( 'elementId' ) + '-input' ); 59 | } 60 | } 61 | }); 62 | -------------------------------------------------------------------------------- /addon/mixins/sl-input-based.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | /** 4 | * @module 5 | * @augments ember/Mixin 6 | */ 7 | export default Ember.Mixin.create({ 8 | 9 | // ------------------------------------------------------------------------- 10 | // Dependencies 11 | 12 | // ------------------------------------------------------------------------- 13 | // Attributes 14 | 15 | /** @type {String[]} */ 16 | classNameBindings: [ 17 | 'disabled', 18 | 'optional', 19 | 'readonly', 20 | 'required' 21 | ], 22 | 23 | // ------------------------------------------------------------------------- 24 | // Actions 25 | 26 | // ------------------------------------------------------------------------- 27 | // Events 28 | 29 | // ------------------------------------------------------------------------- 30 | // Properties 31 | 32 | /** 33 | * Whether the input-based component should be disabled 34 | * 35 | * The internal input element should be passed this attribute as a property. 36 | * 37 | * @type {Boolean} 38 | */ 39 | disabled: false, 40 | 41 | /** 42 | * Unique input id that will get generated and set on init of component 43 | * 44 | * @type {?String} 45 | */ 46 | inputId: null, 47 | 48 | /** 49 | * The name of the input element 50 | * 51 | * @type {?String} 52 | */ 53 | name: null, 54 | 55 | /** 56 | * Whether the input-based component should be displayed as optional 57 | * 58 | * @type {Boolean} 59 | */ 60 | optional: false, 61 | 62 | /** 63 | * Whether the input-based component is readonly or not 64 | * 65 | * The internal input element should be passed this attribute as a property. 66 | * 67 | * @type {Boolean} 68 | */ 69 | readonly: false, 70 | 71 | /** 72 | * Whether the input-based component is required 73 | * 74 | * @type {Boolean} 75 | */ 76 | required: false, 77 | 78 | // ------------------------------------------------------------------------- 79 | // Observers 80 | 81 | // ------------------------------------------------------------------------- 82 | // Methods 83 | 84 | /** 85 | * Returns a string value for the boolean readonly property 86 | * which will get set on the input. 87 | * 88 | * @function 89 | * @returns {?String} 90 | */ 91 | readonlyString: Ember.computed( 92 | 'readonly', 93 | function() { 94 | return this.get( 'readonly' ) ? 'readonly' : null; 95 | } 96 | ) 97 | }); 98 | -------------------------------------------------------------------------------- /addon/mixins/sl-namespace.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | /** 4 | * @module 5 | * @augments ember/Mixin 6 | */ 7 | export default Ember.Mixin.create({ 8 | 9 | // ------------------------------------------------------------------------- 10 | // Dependencies 11 | 12 | // ------------------------------------------------------------------------- 13 | // Attributes 14 | 15 | // ------------------------------------------------------------------------- 16 | // Actions 17 | 18 | // ------------------------------------------------------------------------- 19 | // Events 20 | 21 | // ------------------------------------------------------------------------- 22 | // Properties 23 | 24 | // ------------------------------------------------------------------------- 25 | // Methods 26 | 27 | /** 28 | * Namespace component events by elementId 29 | * 30 | * @function 31 | * @returns {String} 32 | */ 33 | namespaceEvent( eventName ) { 34 | return `${ eventName }.${ this.get( 'elementId' ) }`; 35 | } 36 | }); 37 | -------------------------------------------------------------------------------- /addon/templates/components/sl-alert.hbs: -------------------------------------------------------------------------------- 1 | {{#if dismissable}} 2 | 5 | {{/if}} 6 | 7 | {{yield}} 8 | -------------------------------------------------------------------------------- /addon/templates/components/sl-button.hbs: -------------------------------------------------------------------------------- 1 | {{#if currentLabel}} 2 | {{currentLabel}} 3 | {{else}} 4 | {{yield}} 5 | {{/if}} 6 | -------------------------------------------------------------------------------- /addon/templates/components/sl-calendar-day.hbs: -------------------------------------------------------------------------------- 1 | {{day}} -------------------------------------------------------------------------------- /addon/templates/components/sl-calendar-month.hbs: -------------------------------------------------------------------------------- 1 | {{shortName}} -------------------------------------------------------------------------------- /addon/templates/components/sl-calendar-year.hbs: -------------------------------------------------------------------------------- 1 | {{year}} -------------------------------------------------------------------------------- /addon/templates/components/sl-chart.hbs: -------------------------------------------------------------------------------- 1 | {{#if title}} 2 |
{{title}}
3 | {{/if}} 4 | 5 |
6 |
7 |
8 | -------------------------------------------------------------------------------- /addon/templates/components/sl-checkbox.hbs: -------------------------------------------------------------------------------- 1 | {{#if inline}} 2 | {{input 3 | type="checkbox" 4 | checked=checked 5 | disabled=disabled 6 | name=name}} 7 | {{label}} 8 | {{else}} 9 | 17 | {{/if}} 18 | -------------------------------------------------------------------------------- /addon/templates/components/sl-date-picker.hbs: -------------------------------------------------------------------------------- 1 | {{#if label}} 2 | 3 | {{/if}} 4 | 5 | {{input 6 | type="text" 7 | class="date-picker form-control" 8 | disabled=disabled 9 | id=inputId 10 | placeholder=placeholder 11 | value=value 12 | }} 13 | 14 | {{#if helpText}} 15 |

{{helpText}}

16 | {{/if}} 17 | -------------------------------------------------------------------------------- /addon/templates/components/sl-date-range-picker.hbs: -------------------------------------------------------------------------------- 1 | {{#if label}} 2 | 3 | {{/if}} 4 | 5 |
6 | {{sl-date-picker 7 | class="sl-daterange-start-date col-md-6" 8 | endDate=latestStartDate 9 | placeholder=startDatePlaceholder 10 | startDate=minDate 11 | value=startDateValue 12 | inputId=inputId 13 | format=format 14 | }} 15 | 16 | {{sl-date-picker 17 | class="sl-daterange-end-date col-md-6" 18 | endDate=maxDate 19 | placeholder=endDatePlaceholder 20 | startDate=earliestEndDate 21 | value=endDateValue 22 | format=format 23 | }} 24 |
25 | 26 | {{#if helpText}} 27 |

{{helpText}}

28 | {{/if}} 29 | -------------------------------------------------------------------------------- /addon/templates/components/sl-date-time.hbs: -------------------------------------------------------------------------------- 1 | {{formattedValue}} 2 | -------------------------------------------------------------------------------- /addon/templates/components/sl-drop-button.hbs: -------------------------------------------------------------------------------- 1 | {{#sl-button 2 | class="dropdown-toggle" 3 | dataToggle="dropdown" 4 | size=size 5 | theme=theme 6 | }} 7 | {{#if label}} 8 | {{label}} 9 | 10 | {{else}} 11 | {{#if content}} 12 | {{yield}} 13 | {{/if}} 14 | {{/if}} 15 | {{/sl-button}} 16 | 17 | 30 | -------------------------------------------------------------------------------- /addon/templates/components/sl-drop-option-divider.hbs: -------------------------------------------------------------------------------- 1 | {{yield}} 2 | -------------------------------------------------------------------------------- /addon/templates/components/sl-drop-option.hbs: -------------------------------------------------------------------------------- 1 | 2 | {{#if hasBlock}} 3 | {{yield}} 4 | {{else}} 5 | {{label}} 6 | {{/if}} 7 | 8 | -------------------------------------------------------------------------------- /addon/templates/components/sl-grid-cell.hbs: -------------------------------------------------------------------------------- 1 | {{contentValue}} 2 | -------------------------------------------------------------------------------- /addon/templates/components/sl-grid-column-header.hbs: -------------------------------------------------------------------------------- 1 | {{yield}} 2 | 3 | {{#if sortable}} 4 | 5 | {{/if}} 6 | -------------------------------------------------------------------------------- /addon/templates/components/sl-input.hbs: -------------------------------------------------------------------------------- 1 | {{#if label}} 2 | 13 | {{/if}} 14 | 15 | {{input 16 | id=inputId 17 | type=type 18 | class=inputClass 19 | disabled=disabled 20 | name=name 21 | placeholder=placeholder 22 | readonly=readonlyString 23 | value=value 24 | }} 25 | 26 | {{#if helpText}} 27 |

{{helpText}}

28 | {{/if}} 29 | -------------------------------------------------------------------------------- /addon/templates/components/sl-menu-item-show-all.hbs: -------------------------------------------------------------------------------- 1 | Show All 2 | -------------------------------------------------------------------------------- /addon/templates/components/sl-menu-item.hbs: -------------------------------------------------------------------------------- 1 | {{#if subItems}} 2 | {{item.label}} 3 | 4 | 12 | {{else}} 13 | {{item.label}} 14 | {{/if}} 15 | -------------------------------------------------------------------------------- /addon/templates/components/sl-menu.hbs: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /addon/templates/components/sl-modal-body.hbs: -------------------------------------------------------------------------------- 1 | {{yield}} 2 | -------------------------------------------------------------------------------- /addon/templates/components/sl-modal-footer.hbs: -------------------------------------------------------------------------------- 1 | {{#if hasBlock}} 2 | {{yield}} 3 | {{else}} 4 | 7 | {{/if}} 8 | -------------------------------------------------------------------------------- /addon/templates/components/sl-modal-header.hbs: -------------------------------------------------------------------------------- 1 | {{#if hasBlock}} 2 | {{yield ariaLabelledBy}} 3 | {{else}} 4 | 7 | {{/if}} 8 | 9 | {{#if title}} 10 | {{title}} 11 | {{/if}} 12 | -------------------------------------------------------------------------------- /addon/templates/components/sl-modal.hbs: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /addon/templates/components/sl-pagination.hbs: -------------------------------------------------------------------------------- 1 |
  • 2 | 3 | previous page 4 | 5 |
  • 6 | 7 | {{~#each range as |page|~}} 8 |
  • 9 | {{page.index}} 10 |
  • 11 | {{~/each~}} 12 | 13 |
  • 14 | 15 | next page 16 | 17 |
  • 18 | -------------------------------------------------------------------------------- /addon/templates/components/sl-panel.hbs: -------------------------------------------------------------------------------- 1 | {{#if heading}} 2 |
    {{heading}}
    3 | {{/if}} 4 | 5 |
    6 | {{yield}} 7 |
    8 | 9 | {{#if footer}} 10 | 11 | {{/if}} 12 | -------------------------------------------------------------------------------- /addon/templates/components/sl-progress-bar.hbs: -------------------------------------------------------------------------------- 1 |
    11 | {{#if label}} 12 | {{value}}% 13 | {{else}} 14 | {{value}}% Complete 15 | {{/if}} 16 |
    17 | -------------------------------------------------------------------------------- /addon/templates/components/sl-radio-group.hbs: -------------------------------------------------------------------------------- 1 | {{#if label}} 2 | 13 | {{/if}} 14 | 15 | {{yield}} 16 | -------------------------------------------------------------------------------- /addon/templates/components/sl-radio.hbs: -------------------------------------------------------------------------------- 1 | {{#if inline}} 2 | {{input 3 | type="radio" 4 | disabled=disabled 5 | name=name 6 | value=value}} 7 | {{label}} 8 | {{else}} 9 | 17 | {{/if}} 18 | -------------------------------------------------------------------------------- /addon/templates/components/sl-select.hbs: -------------------------------------------------------------------------------- 1 | {{#if label}} 2 | 13 | {{/if}} 14 | 15 | {{input 16 | type="hidden" 17 | class="form-control" 18 | disabled=disabled 19 | name=name 20 | readonly=readonlyString 21 | value=value 22 | }} 23 | 24 | {{#if helpText}} 25 |

    {{helpText}}

    26 | {{/if}} 27 | -------------------------------------------------------------------------------- /addon/templates/components/sl-span.hbs: -------------------------------------------------------------------------------- 1 | {{#unless loading}} 2 | {{#if value}} 3 | {{value}} 4 | {{else}} 5 | {{yield}} 6 | {{/if}} 7 | {{/unless}} 8 | -------------------------------------------------------------------------------- /addon/templates/components/sl-tab-pane.hbs: -------------------------------------------------------------------------------- 1 | {{yield}} 2 | -------------------------------------------------------------------------------- /addon/templates/components/sl-tab-panel.hbs: -------------------------------------------------------------------------------- 1 | 8 | 9 |
    10 | {{yield}} 11 |
    12 | -------------------------------------------------------------------------------- /addon/templates/components/sl-textarea.hbs: -------------------------------------------------------------------------------- 1 | {{#if label}} 2 | 13 | {{/if}} 14 | 15 | {{textarea 16 | id=inputId 17 | autofocus=autofocus 18 | class="form-control" 19 | cols=cols 20 | disabled=disabled 21 | maxlength=maxlength 22 | name=name 23 | placeholder=placeholder 24 | readonly=readonlyString 25 | rows=rows 26 | selectionDirection=selectionDirection 27 | selectionEnd=selectionEnd 28 | selectionStart=selectionStart 29 | spellcheck=spellcheck 30 | tabindex=tabindex 31 | value=value 32 | wrap=wrap 33 | }} 34 | 35 | {{#if helpText}} 36 |

    {{helpText}}

    37 | {{/if}} 38 | -------------------------------------------------------------------------------- /addon/utils/bootstrap-naming.js: -------------------------------------------------------------------------------- 1 | export const Theme = Object.freeze({ 2 | DANGER: 'danger', 3 | DEFAULT: 'default', 4 | INFO: 'info', 5 | PRIMARY: 'primary', 6 | SUCCESS: 'success', 7 | WARNING: 'warning' 8 | }); 9 | -------------------------------------------------------------------------------- /addon/utils/class-prefix.js: -------------------------------------------------------------------------------- 1 | import config from 'ember-get-config'; 2 | 3 | export default function( componentClass ) { 4 | return `${config.componentClassPrefix}-${componentClass}`; 5 | } 6 | -------------------------------------------------------------------------------- /addon/utils/containsValue.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @module 3 | */ 4 | 5 | /** 6 | * Check whether the `value` is a valid value in `object` 7 | * 8 | * @function 9 | * @param {*} value - The value to check for the presence of 10 | * @param {Object} object - The object to check for the presence of `value` in 11 | * @returns {Boolean} - True if the `value` is a valid value of the `object` 12 | */ 13 | export default function( value, object ) { 14 | return Object.keys( object ) 15 | .map( key => object[ key ] ) 16 | .indexOf( value ) > -1; 17 | } 18 | -------------------------------------------------------------------------------- /addon/utils/warn.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default function( message ) { 4 | Ember.Logger.warn( message ); 5 | return true; 6 | } 7 | -------------------------------------------------------------------------------- /app/components/sl-alert.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-alert'; 2 | -------------------------------------------------------------------------------- /app/components/sl-button.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-button'; 2 | -------------------------------------------------------------------------------- /app/components/sl-calendar-day.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-calendar-day'; 2 | -------------------------------------------------------------------------------- /app/components/sl-calendar-month.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-calendar-month'; 2 | -------------------------------------------------------------------------------- /app/components/sl-calendar-year.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-calendar-year'; 2 | -------------------------------------------------------------------------------- /app/components/sl-calendar.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-calendar'; 2 | -------------------------------------------------------------------------------- /app/components/sl-chart.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-chart'; 2 | -------------------------------------------------------------------------------- /app/components/sl-checkbox.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-checkbox'; 2 | -------------------------------------------------------------------------------- /app/components/sl-date-picker.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-date-picker'; 2 | -------------------------------------------------------------------------------- /app/components/sl-date-range-picker.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-date-range-picker'; 2 | -------------------------------------------------------------------------------- /app/components/sl-date-time.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-date-time'; 2 | -------------------------------------------------------------------------------- /app/components/sl-drop-button.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-drop-button'; 2 | -------------------------------------------------------------------------------- /app/components/sl-drop-option-divider.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-drop-option-divider'; 2 | -------------------------------------------------------------------------------- /app/components/sl-drop-option.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-drop-option'; 2 | -------------------------------------------------------------------------------- /app/components/sl-grid-cell.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-grid-cell'; 2 | -------------------------------------------------------------------------------- /app/components/sl-grid-column-header.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-grid-column-header'; 2 | -------------------------------------------------------------------------------- /app/components/sl-grid-row.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-grid-row'; 2 | -------------------------------------------------------------------------------- /app/components/sl-grid.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-grid'; 2 | -------------------------------------------------------------------------------- /app/components/sl-input.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-input'; 2 | -------------------------------------------------------------------------------- /app/components/sl-menu-item-show-all.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-menu-item-show-all'; 2 | -------------------------------------------------------------------------------- /app/components/sl-menu-item.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-menu-item'; 2 | -------------------------------------------------------------------------------- /app/components/sl-menu.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-menu'; 2 | -------------------------------------------------------------------------------- /app/components/sl-modal-body.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-modal-body'; 2 | -------------------------------------------------------------------------------- /app/components/sl-modal-footer.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-modal-footer'; 2 | -------------------------------------------------------------------------------- /app/components/sl-modal-header.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-modal-header'; 2 | -------------------------------------------------------------------------------- /app/components/sl-modal.js: -------------------------------------------------------------------------------- 1 | import SLModal from 'sl-ember-components/components/sl-modal'; 2 | 3 | export default SLModal; 4 | -------------------------------------------------------------------------------- /app/components/sl-pagination.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-pagination'; 2 | -------------------------------------------------------------------------------- /app/components/sl-panel.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-panel'; 2 | -------------------------------------------------------------------------------- /app/components/sl-progress-bar.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-progress-bar'; 2 | -------------------------------------------------------------------------------- /app/components/sl-radio-group.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-radio-group'; 2 | -------------------------------------------------------------------------------- /app/components/sl-radio.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-radio'; 2 | -------------------------------------------------------------------------------- /app/components/sl-select.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-select'; 2 | -------------------------------------------------------------------------------- /app/components/sl-span.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-span'; 2 | -------------------------------------------------------------------------------- /app/components/sl-tab-pane.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-tab-pane'; 2 | -------------------------------------------------------------------------------- /app/components/sl-tab-panel.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-tab-panel'; 2 | -------------------------------------------------------------------------------- /app/components/sl-textarea.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-textarea'; 2 | -------------------------------------------------------------------------------- /app/components/sl-tooltip.js: -------------------------------------------------------------------------------- 1 | export { default } from 'sl-ember-components/components/sl-tooltip'; 2 | -------------------------------------------------------------------------------- /app/styles/mixins.less: -------------------------------------------------------------------------------- 1 | .CloseButtons( @icon ) { 2 | button.close { 3 | font-size: 1.4em; 4 | 5 | .sl-icon-close::before { 6 | content: @icon; 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /app/styles/sl-alert.less: -------------------------------------------------------------------------------- 1 | .@{component-class-prefix}-alert { 2 | .CloseButtons( @icon-alert-close ); 3 | } 4 | 5 | .sl-icon-close { 6 | &:extend( .sl-ember-components-icons all ); 7 | } 8 | -------------------------------------------------------------------------------- /app/styles/sl-buttons.less: -------------------------------------------------------------------------------- 1 | .@{component-class-prefix}-button{ 2 | &.btn-hover { 3 | background-color: transparent; 4 | } 5 | 6 | &.btn-hover:hover { 7 | background-color: buttonface; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /app/styles/sl-calendar.less: -------------------------------------------------------------------------------- 1 | .@{component-class-prefix}-calendar{ 2 | .sl-icon-previous::before { 3 | content: @icon-calendar-previous; 4 | } 5 | 6 | .sl-icon-next::before { 7 | content: @icon-calendar-next; 8 | } 9 | 10 | .datepicker-months, 11 | .datepicker-days, 12 | .datepicker-years { 13 | display: block; 14 | } 15 | } 16 | 17 | .sl-icon-previous, .sl-icon-next { 18 | &:extend( .sl-ember-components-icons all ); 19 | } 20 | -------------------------------------------------------------------------------- /app/styles/sl-date-picker.less: -------------------------------------------------------------------------------- 1 | .datepicker { 2 | thead th { 3 | &.prev, &.next { 4 | text-indent: 1em; 5 | overflow: hidden; 6 | display: inline-block; 7 | white-space: nowrap; 8 | 9 | &::before { 10 | font-family: "Glyphicons Halflings"; 11 | font-size: .65em; 12 | margin-right: 2em; 13 | } 14 | } 15 | 16 | &.prev:before { 17 | content: @icon-date-picker-previous; 18 | margin-left: -1.05em; 19 | } 20 | 21 | &.next:before { 22 | content: @icon-date-picker-next; 23 | margin-left: -.81em; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/styles/sl-drop-button.less: -------------------------------------------------------------------------------- 1 | .@{component-class-prefix}-drop-button{ 2 | .sl-icon-dropdown::before { 3 | content: @icon-drop-button-open; 4 | } 5 | } 6 | 7 | .sl-icon-dropdown { 8 | &:extend( .sl-ember-components-icons all ); 9 | } 10 | -------------------------------------------------------------------------------- /app/styles/sl-ember-components.less: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------------- 2 | // Twitter Bootstrap 3 | 4 | @import 'bower_components/bootstrap/less/bootstrap'; 5 | 6 | 7 | // ------------------------------------------------------------------------- 8 | // Twitter Bootstrap customization 9 | 10 | @import 'variables.less'; 11 | 12 | 13 | // ------------------------------------------------------------------------- 14 | // Bootstrap Datepicker 15 | 16 | @import 'bower_components/bootstrap-datepicker/less/datepicker3'; 17 | 18 | 19 | // ------------------------------------------------------------------------- 20 | // sl-ember-components 21 | 22 | @import 'addon'; 23 | @import 'mixins'; 24 | @import 'sl-alert'; 25 | @import 'sl-buttons'; 26 | @import 'sl-calendar'; 27 | @import 'sl-date-picker'; 28 | @import 'sl-drop-button'; 29 | @import 'sl-grid'; 30 | @import 'sl-input'; 31 | @import 'sl-menu'; 32 | @import 'sl-modal'; 33 | @import 'sl-pagination'; 34 | @import 'sl-progress-bar'; 35 | @import 'sl-select'; 36 | @import 'sl-tab-panel'; 37 | -------------------------------------------------------------------------------- /app/styles/sl-input.less: -------------------------------------------------------------------------------- 1 | .twitter-typeahead { 2 | display: block !important; 3 | 4 | .tt-hint { 5 | color: @gray; 6 | } 7 | 8 | .tt-menu { 9 | background: @input-bg; 10 | border: 1px solid @brand-primary; 11 | border-top-color: @input-border; 12 | margin-top: -1px; 13 | width: 100%; 14 | 15 | .tt-suggestion { 16 | color: @gray; 17 | cursor: pointer; 18 | padding: @padding-base-vertical @padding-base-horizontal; 19 | 20 | &:hover, 21 | &.tt-cursor { 22 | color: @input-bg; 23 | background: @brand-primary; 24 | 25 | p strong { 26 | color: @input-bg; 27 | } 28 | } 29 | 30 | p { 31 | margin: 0; 32 | 33 | strong { 34 | color: @gray-dark; 35 | font-weight: normal; 36 | } 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/styles/sl-menu.less: -------------------------------------------------------------------------------- 1 | .@{component-class-prefix}-menu { 2 | .dropdown-menu { 3 | margin-top: 0; 4 | } 5 | 6 | .contains-dropdown:hover > .dropdown-menu, .dropdown-toggle:focus ~ .dropdown-menu { 7 | display: block; 8 | } 9 | 10 | .contains-dropdown.active > .dropdown-menu { 11 | display: block; 12 | } 13 | 14 | &.show-all .dropdown-menu { 15 | display: block; 16 | } 17 | 18 | .contains-dropdown { 19 | position: relative; 20 | } 21 | 22 | .contains-dropdown .contains-dropdown .dropdown-menu { 23 | left: 100%; 24 | top: 0; 25 | } 26 | 27 | .sl-icon-show-all::before { 28 | content: @icon-menu-show-all; 29 | } 30 | } 31 | 32 | .sl-icon-show-all { 33 | &:extend( .sl-ember-components-icons all ); 34 | } 35 | -------------------------------------------------------------------------------- /app/styles/sl-modal.less: -------------------------------------------------------------------------------- 1 | .@{component-class-prefix}-modal{ 2 | .CloseButtons( @icon-modal-close ); 3 | } 4 | 5 | .sl-icon-close { 6 | &:extend( .sl-ember-components-icons all ); 7 | } 8 | 9 | -------------------------------------------------------------------------------- /app/styles/sl-pagination.less: -------------------------------------------------------------------------------- 1 | .@{component-class-prefix}-pagination { 2 | .sl-pagination-button { 3 | cursor: pointer; 4 | } 5 | 6 | li.overflow span:before { 7 | content: "..."; 8 | } 9 | 10 | .sl-icon-next::before { 11 | content: @icon-pagination-next; 12 | } 13 | 14 | .sl-icon-previous::before { 15 | content: @icon-pagination-previous; 16 | } 17 | } 18 | 19 | .sl-icon-previous, .sl-icon-next { 20 | &:extend( .sl-ember-components-icons all ); 21 | } 22 | -------------------------------------------------------------------------------- /app/styles/sl-progress-bar.less: -------------------------------------------------------------------------------- 1 | .@{component-class-prefix}-progress-bar{ 2 | span { 3 | padding: 0 @padding-base-vertical; 4 | } 5 | } 6 | 7 | .sl-progress-bar-low-percentage span { 8 | color: @text-color; 9 | margin-left: 100%; 10 | } 11 | -------------------------------------------------------------------------------- /app/styles/sl-tab-panel.less: -------------------------------------------------------------------------------- 1 | .@{component-class-prefix}-tab-panel{ 2 | &> .nav > li { 3 | float: none; 4 | display: inline-block; 5 | } 6 | 7 | &.sl-align-tabs-right > .nav { 8 | text-align: right; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /app/styles/variables.less: -------------------------------------------------------------------------------- 1 | @component-class-prefix: sl-ember-components; 2 | 3 | @icon-font-path: "../sl-ember-components/assets/fonts/"; 4 | 5 | @loading-spinner-light: "/sl-ember-components/assets/images/spinner-light-sm.png"; 6 | @loading-spinner-dark: "/sl-ember-components/assets/images/spinner-dark-sm.png"; 7 | 8 | // ------------------------------------------------------------------------- 9 | // icons (generic) 10 | 11 | @icon-all-close: '\e014'; 12 | @icon-all-next: '\e250'; 13 | @icon-all-previous: '\e251'; 14 | 15 | // ------------------------------------------------------------------------- 16 | // icons (specific) 17 | 18 | @icon-alert-close: @icon-all-close; 19 | @icon-calendar-next: @icon-all-next; 20 | @icon-calendar-previous: @icon-all-previous; 21 | @icon-date-picker-next: @icon-all-next; 22 | @icon-date-picker-previous: @icon-all-previous; 23 | @icon-drop-button-open: '\e252'; 24 | @icon-grid-details-close: @icon-all-close; 25 | @icon-grid-sortable: '\e150'; 26 | @icon-grid-sorted-asc: '\e093'; 27 | @icon-grid-sorted-desc: '\e094'; 28 | @icon-menu-show-all: '\e252'; 29 | @icon-modal-close: @icon-all-close; 30 | @icon-pagination-next: @icon-all-next; 31 | @icon-pagination-previous: @icon-all-previous; 32 | @icon-select-close: '\e253'; 33 | @icon-select-open: '\e252'; 34 | -------------------------------------------------------------------------------- /blueprints/sl-ember-components/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | afterInstall: function() { 3 | return this.addBowerPackagesToProject([ 4 | { 5 | name: 'bootstrap', 6 | target: '3.3.7' 7 | }, { 8 | name: 'bootstrap-datepicker', 9 | target: '~1.3.0' 10 | }, { 11 | name: 'highcharts', 12 | target: '~4.1.10' 13 | }, { 14 | name: 'jquery-mousewheel', 15 | target: '^3.1.12' 16 | }, { 17 | name: 'jquery.fn.twbs-responsive-pagination', 18 | target: '~0.1.2' 19 | }, { 20 | name: 'moment', 21 | target: '~2.10.3' 22 | }, { 23 | name: 'moment-timezone', 24 | target: '~0.4.0' 25 | }, { 26 | name: 'rxjs', 27 | target: '~2.5.2' 28 | }, { 29 | name: 'select2', 30 | target: '~3.5.2' 31 | }, { 32 | name: 'typeahead.js', 33 | target: '~0.11.1' 34 | } 35 | ]); 36 | }, 37 | 38 | normalizeEntityName: function() {} 39 | }; 40 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sl-ember-components", 3 | "dependencies": { 4 | "bootstrap": "3.3.6", 5 | "bootstrap-datepicker": "~1.3.0", 6 | "ember": "~2.4.3", 7 | "ember-cli-shims": "0.1.1", 8 | "ember-cli-test-loader": "0.2.2", 9 | "ember-qunit-notifications": "0.1.0", 10 | "highcharts": "~4.1.5", 11 | "jquery-mousewheel": "^3.1.12", 12 | "jquery.fn.twbs-responsive-pagination": "~0.1.2", 13 | "moment": "~2.10.3", 14 | "moment-timezone": "~0.4.0", 15 | "rxjs": "~2.5.2", 16 | "select2": "~3.5.2", 17 | "typeahead.js": "~0.11.1" 18 | }, 19 | "devDependencies": { 20 | "blanket": "~1.1.5" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | node: 3 | version: 5.9.1 4 | dependencies: 5 | pre: 6 | - npm install -g bower 7 | override: 8 | - npm i --no-optional 9 | - bower i 10 | test: 11 | pre: 12 | - node_modules/.bin/ember ember-cli-jsdoc && npm run lint-all 13 | override: 14 | - ? > 15 | PATH="./node_modules/.bin:$PATH"; 16 | 17 | case $CIRCLE_NODE_INDEX in 18 | 0) ember try default || echo "WARNING: Tests failed on default." ;; 19 | 1) ember try ember-release || echo "WARNING: Tests failed on release." ;; 20 | esac 21 | : parallel: true 22 | -------------------------------------------------------------------------------- /config/ember-try.js: -------------------------------------------------------------------------------- 1 | /* jshint node:true*/ 2 | module.exports = { 3 | scenarios: [ 4 | { 5 | name: 'default', 6 | bower: { 7 | dependencies: { } 8 | } 9 | }, 10 | { 11 | name: 'ember-1.13', 12 | bower: { 13 | dependencies: { 14 | 'ember': '~1.13.0' 15 | }, 16 | resolutions: { 17 | 'ember': '~1.13.0' 18 | } 19 | } 20 | }, 21 | { 22 | name: 'ember-release', 23 | bower: { 24 | dependencies: { 25 | 'ember': 'components/ember#release' 26 | }, 27 | resolutions: { 28 | 'ember': 'release' 29 | } 30 | } 31 | }, 32 | { 33 | name: 'ember-beta', 34 | bower: { 35 | dependencies: { 36 | 'ember': 'components/ember#beta' 37 | }, 38 | resolutions: { 39 | 'ember': 'beta' 40 | } 41 | } 42 | }, 43 | { 44 | name: 'ember-canary', 45 | bower: { 46 | dependencies: { 47 | 'ember': 'components/ember#canary' 48 | }, 49 | resolutions: { 50 | 'ember': 'canary' 51 | } 52 | } 53 | } 54 | ] 55 | }; 56 | -------------------------------------------------------------------------------- /config/environment.js: -------------------------------------------------------------------------------- 1 | /*jshint node:true*/ 2 | 'use strict'; 3 | 4 | module.exports = function( environment ) { 5 | var ENV = { 6 | environment: environment, 7 | 8 | EmberENV: { 9 | FEATURES: { 10 | // Here you can enable experimental features on an ember canary build 11 | // e.g. 'with-controller': true 12 | } 13 | }, 14 | 15 | APP: { 16 | // Here you can pass flags/options to your application instance when it is created 17 | // Also put default values here 18 | } 19 | }; 20 | 21 | // overwrite default values for different environments as needed 22 | 23 | if ( 'development' === environment ) { 24 | } 25 | 26 | if ( 'test' === environment ) { 27 | } 28 | 29 | if ( 'production' === environment ) { 30 | } 31 | 32 | return ENV; 33 | }; 34 | -------------------------------------------------------------------------------- /ember-cli-build.js: -------------------------------------------------------------------------------- 1 | /*jshint node:true*/ 2 | /* global require, module */ 3 | const EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); 4 | const replace = require( 'broccoli-string-replace' ); 5 | const env = require( './config/environment' ); 6 | const packageConfig = require( './package.json' ); 7 | 8 | module.exports = function( defaults ) { 9 | const app = new EmberAddon( defaults, { 10 | babel: { 11 | includePolyfill: true 12 | }, 13 | 14 | fingerprint: { 15 | enabled: true, 16 | exclude: [], 17 | extensions: [ 'png', 'jpg', 'gif', 'eot', 'svg', 'ttf', 'woff', 'woff2' ], 18 | prepend: env().baseAssetsURL, 19 | replaceExtensions: [ 'html', 'css', 'js' ] 20 | } 21 | }); 22 | 23 | /* 24 | This build file specifies the options for the dummy test app of this 25 | addon, located in `/tests/dummy` 26 | This build file does *not* influence how the addon or the app using it 27 | behave. You most likely want to be modifying `./index.js` or app's build file 28 | */ 29 | 30 | // Development dependencies 31 | app.import( app.bowerDirectory + '/ember/ember-template-compiler.js', { 32 | type: 'test' 33 | }); 34 | 35 | const tree = replace( app.toTree(), { 36 | files: [ 37 | 'index.html', 38 | 'assets/dummy.js' 39 | ], 40 | 41 | patterns: [ 42 | { 43 | match: /REPLACE_META_DESCRIPTION/g, 44 | replacement: packageConfig[ 'description' ] 45 | }, { 46 | match: /REPLACE_META_KEYWORDS/g, 47 | replacement: packageConfig[ 'keywords' ].join( ', ' ) + ', ember, ember cli' 48 | }, { 49 | match: /REPLACE_APPLICATION_VERSION/g, 50 | replacement: packageConfig[ 'version' ] 51 | } 52 | ] 53 | }); 54 | 55 | return tree; 56 | }; 57 | -------------------------------------------------------------------------------- /inch.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": { 3 | "included": [ 4 | "app/**/*.js", 5 | "addon/**/*.js" 6 | ], 7 | "excluded": [ 8 | "addon/templates/**/*.hbs", 9 | "app/styles/*", 10 | "app/styles/**/*", 11 | "app/templates/*.hbs" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /jsdoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "tags": { 3 | "allowUnknownTags": true, 4 | "dictionaries": [ 5 | "jsdoc" 6 | ] 7 | }, 8 | "source": { 9 | "include": [ 10 | "app", 11 | "addon", 12 | "blueprints" 13 | ], 14 | "includePattern": ".+\\.js(doc)?$", 15 | "exclude": [ 16 | "addon/templates", 17 | "app/styles", 18 | "app/templates" 19 | ], 20 | "excludePattern": "(^|\\/|\\\\)_" 21 | }, 22 | "plugins": [ 23 | "plugins/markdown", 24 | "node_modules/jsdoc-plugins/plugins/defaultTag", 25 | "node_modules/jsdoc-plugins/plugins/emberListensTag", 26 | "node_modules/jsdoc-plugins/plugins/emberObservesTag" 27 | ], 28 | "templates": { 29 | "cleverLinks": false, 30 | "monospaceLinks": false 31 | }, 32 | "opts": { 33 | "encoding": "utf8", 34 | "template": "node_modules/ember-cli-jsdoc/jsdocTemplates/default", 35 | "destination": "docs", 36 | "recurse": true, 37 | "access": "all", 38 | "readme": "README.md" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sl-ember-components", 3 | "version": "0.12.3", 4 | "description": "Ember CLI Addon - UI components library", 5 | "homepage": "http://softlayer.github.io/sl-ember-components", 6 | "scripts": { 7 | "build": "ember build", 8 | "docs": "ember ember-cli-jsdoc", 9 | "lint": "sl-eslint", 10 | "lint-all": "sl-eslint addon app tests", 11 | "start": "ember server", 12 | "test": "ember ember-cli-jsdoc && npm run lint-all && ember test" 13 | }, 14 | "bugs": "https://github.com/softlayer/sl-ember-components/issues", 15 | "repository": { 16 | "type": "git", 17 | "url": "http://github.com/softlayer/sl-ember-components.git" 18 | }, 19 | "engines": { 20 | "node": ">= 5.0.0" 21 | }, 22 | "keywords": [ 23 | "ember-addon", 24 | "UI", 25 | "UI components", 26 | "calendar", 27 | "chart", 28 | "grid", 29 | "menu", 30 | "tabs", 31 | "tooltip", 32 | "progress bar", 33 | "modal", 34 | "bootstrap" 35 | ], 36 | "ember-addon": { 37 | "configPath": "tests/dummy/config", 38 | "demoURL": "http://softlayer.github.io/sl-ember-components/" 39 | }, 40 | "contributors": [ 41 | "Jeremy Brown (http://www.notmessenger.com)", 42 | "Michael Carroll (https://github.com/juwara0)" 43 | ], 44 | "license": "MIT", 45 | "dependencies": { 46 | "broccoli-autoprefixer": "4.1.0", 47 | "broccoli-funnel": "^1.0.1", 48 | "broccoli-less-single": "^0.5.0", 49 | "broccoli-merge-trees": "^1.1.0", 50 | "ember-cli-babel": "^5.1.6", 51 | "ember-cli-htmlbars": "^1.0.3", 52 | "ember-stream": "^0.7.3", 53 | "ember-get-config": "0.0.2" 54 | }, 55 | "devDependencies": { 56 | "broccoli-asset-rev": "^2.4.2", 57 | "broccoli-string-replace": "0.1.1", 58 | "ember-ajax": "0.7.1", 59 | "ember-cli": "2.4.3", 60 | "ember-cli-app-version": "^1.0.0", 61 | "ember-cli-blanket": "0.8.0", 62 | "ember-cli-dependency-checker": "^1.2.0", 63 | "ember-cli-doc-server": "1.1.0", 64 | "ember-cli-htmlbars-inline-precompile": "^0.3.1", 65 | "ember-cli-inject-live-reload": "^1.4.0", 66 | "ember-cli-jsdoc": "1.4.0", 67 | "ember-cli-less": "^1.5.3", 68 | "ember-cli-qunit": "^1.4.0", 69 | "ember-cli-uglify": "^1.2.0", 70 | "ember-disable-prototype-extensions": "^1.1.0", 71 | "ember-export-application-global": "^1.0.5", 72 | "ember-load-initializers": "^0.5.1", 73 | "ember-resolver": "^2.0.3", 74 | "ember-sinon": "0.5.0", 75 | "ember-try": "^0.2.2", 76 | "loader.js": "^4.0.1", 77 | "sl-ember-test-helpers": "1.12.0", 78 | "sl-eslint": "0.4.0" 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /public/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softlayer/sl-ember-components/b666df5d75c6ecf51da82ca2c3fd2722add17715/public/.gitkeep -------------------------------------------------------------------------------- /public/assets/images/spinner-dark-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softlayer/sl-ember-components/b666df5d75c6ecf51da82ca2c3fd2722add17715/public/assets/images/spinner-dark-sm.png -------------------------------------------------------------------------------- /public/assets/images/spinner-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softlayer/sl-ember-components/b666df5d75c6ecf51da82ca2c3fd2722add17715/public/assets/images/spinner-dark.png -------------------------------------------------------------------------------- /public/assets/images/spinner-light-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softlayer/sl-ember-components/b666df5d75c6ecf51da82ca2c3fd2722add17715/public/assets/images/spinner-light-sm.png -------------------------------------------------------------------------------- /public/assets/images/spinner-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softlayer/sl-ember-components/b666df5d75c6ecf51da82ca2c3fd2722add17715/public/assets/images/spinner-light.png -------------------------------------------------------------------------------- /testem.js: -------------------------------------------------------------------------------- 1 | /* jshint node:true*/ 2 | module.exports = { 3 | 'framework': 'qunit', 4 | 'test_page': 'tests/index.html?hidepassed&nojshint', 5 | 'disable_watching': true, 6 | 'launch_in_ci': [ 7 | 'Chrome' 8 | ], 9 | 'launch_in_dev': [ 10 | 'Chrome', 11 | 'IE8', 12 | 'IE9', 13 | 'IE10', 14 | 'IE11', 15 | 'Firefox', 16 | 'Safari', 17 | 'Opera' 18 | ] 19 | }; 20 | -------------------------------------------------------------------------------- /tests/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "$", 4 | "-Promise", 5 | "DS", 6 | "QUnit", 7 | "andThen", 8 | "asyncTest", 9 | "click", 10 | "console", 11 | "contains", 12 | "currentPath", 13 | "currentRouteName", 14 | "currentURL", 15 | "deepEqual", 16 | "define", 17 | "document", 18 | "equal", 19 | "exists", 20 | "expect", 21 | "fillIn", 22 | "find", 23 | "findWithAssert", 24 | "isolatedContainer", 25 | "keyEvent", 26 | "location", 27 | "module", 28 | "moduleFor", 29 | "moduleForComponent", 30 | "moduleForModel", 31 | "notEqual", 32 | "notStrictEqual", 33 | "ok", 34 | "process", 35 | "raises", 36 | "requires", 37 | "setTimeout", 38 | "start", 39 | "startApp", 40 | "stop", 41 | "strictEqual", 42 | "test", 43 | "testBoth", 44 | "testWithDefault", 45 | "throws", 46 | "triggerEvent", 47 | "visit", 48 | "wait", 49 | "window" 50 | ], 51 | "boss": true, 52 | "browser": false, 53 | "curly": true, 54 | "debug": false, 55 | "devel": false, 56 | "eqeqeq": true, 57 | "eqnull": true, 58 | "esnext": true, 59 | "evil": true, 60 | "forin": false, 61 | "immed": false, 62 | "laxbreak": false, 63 | "newcap": true, 64 | "noarg": true, 65 | "node": false, 66 | "noempty": false, 67 | "nomen": false, 68 | "nonew": false, 69 | "onevar": false, 70 | "plusplus": false, 71 | "regexp": false, 72 | "strict": false, 73 | "sub": true, 74 | "undef": true, 75 | "unused": true, 76 | "white": false 77 | } 78 | -------------------------------------------------------------------------------- /tests/blanket-options.js: -------------------------------------------------------------------------------- 1 | /* globals blanket, module */ 2 | 3 | const options = { 4 | modulePrefix: 'sl-ember-components', 5 | filter: '//.*sl-ember-components/.*/', 6 | antifilter: '//.*(tests|template).*/', 7 | loaderExclusions: [], 8 | enableCoverage: true, 9 | modulePattern: '\/(\\w+)', 10 | branchTracking: true, 11 | cliOptions: { 12 | reporters: [ 'json' ], 13 | autostart: true 14 | } 15 | }; 16 | 17 | if ( 'undefined' === typeof exports ) { 18 | blanket.options( options ); 19 | } else { 20 | module.exports = options; 21 | } 22 | -------------------------------------------------------------------------------- /tests/dummy/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "predef": [ 3 | "document", 4 | "window", 5 | "-Promise" 6 | ], 7 | "browser" : true, 8 | "boss" : true, 9 | "curly": true, 10 | "debug": false, 11 | "devel": true, 12 | "eqeqeq": true, 13 | "evil": true, 14 | "forin": false, 15 | "immed": false, 16 | "laxbreak": false, 17 | "newcap": true, 18 | "noarg": true, 19 | "noempty": false, 20 | "nonew": false, 21 | "nomen": false, 22 | "onevar": false, 23 | "plusplus": false, 24 | "regexp": false, 25 | "undef": true, 26 | "sub": true, 27 | "strict": false, 28 | "white": false, 29 | "eqnull": true, 30 | "esnext": true, 31 | "unused": true 32 | } 33 | -------------------------------------------------------------------------------- /tests/dummy/app/app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import Resolver from './resolver'; 3 | import loadInitializers from 'ember-load-initializers'; 4 | import config from './config/environment'; 5 | 6 | Ember.MODEL_FACTORY_INJECTIONS = true; 7 | 8 | const App = Ember.Application.extend({ 9 | modulePrefix: config.modulePrefix, 10 | podModulePrefix: config.podModulePrefix, 11 | Resolver 12 | }); 13 | 14 | loadInitializers( App, config.modulePrefix ); 15 | 16 | export default App; 17 | -------------------------------------------------------------------------------- /tests/dummy/app/components/demos/sl-grid-detail.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Component.extend(); 4 | -------------------------------------------------------------------------------- /tests/dummy/app/components/demos/tabs/tab-one.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Component.extend({ 4 | inputText: 'One input text', 5 | 6 | text: 'Here is some dynamic content from the \'demos/tabs/tab-one\' component.' 7 | }); 8 | -------------------------------------------------------------------------------- /tests/dummy/app/components/property-text.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Component.extend({ 4 | classNameBindings: [ 5 | 'required:list-group-item-warning' 6 | ], 7 | 8 | classNames: [ 9 | 'list-group-item' 10 | ], 11 | 12 | required: false 13 | }); 14 | -------------------------------------------------------------------------------- /tests/dummy/app/controllers/browsers.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Controller.extend({ 4 | components: Ember.A([ 5 | { 6 | name: 'sl-alert', 7 | lib: { 'twb': true } 8 | }, 9 | { 10 | name: 'sl-button', 11 | lib: { 'twb': true } 12 | }, 13 | { 14 | name: 'sl-calendar', 15 | lib: { 'sec': true } 16 | }, 17 | { 18 | name: 'sl-chart', 19 | lib: { 'hc': true } 20 | }, 21 | { 22 | name: 'sl-checkbox', 23 | lib: { 'twb': true } 24 | }, 25 | { 26 | name: 'sl-date-picker', 27 | lib: { 'bd': true } 28 | }, 29 | { 30 | name: 'sl-date-range-picker', 31 | lib: { 'bd': true } 32 | }, 33 | { 34 | name: 'sl-date-time', 35 | lib: { 'sec': true } 36 | }, 37 | { 38 | name: 'sl-drop-button', 39 | lib: { 'twb': true } 40 | }, 41 | { 42 | name: 'sl-drop-option', 43 | lib: { 'twb': true } 44 | }, 45 | { 46 | name: 'sl-grid', 47 | lib: { 'sec': true } 48 | }, 49 | { 50 | name: 'sl-input', 51 | lib: { 'twb': true, 'ta': true } 52 | }, 53 | { 54 | name: 'sl-menu', 55 | lib: { 'sec': true } 56 | }, 57 | { 58 | name: 'sl-modal', 59 | lib: { 'twb': true } 60 | }, 61 | { 62 | name: 'sl-pagination', 63 | lib: { 'sec': true } 64 | }, 65 | { 66 | name: 'sl-panel', 67 | lib: { 'twb': true } 68 | }, 69 | { 70 | name: 'sl-progress-bar', 71 | lib: { 'twb': true } 72 | }, 73 | { 74 | name: 'sl-radio', 75 | lib: { 'sec': true } 76 | }, 77 | { 78 | name: 'sl-radio-group', 79 | lib: { 'twb': true } 80 | }, 81 | { 82 | name: 'sl-select', 83 | lib: { 's2': true } 84 | }, 85 | { 86 | name: 'sl-span', 87 | lib: { 'sec': true } 88 | }, 89 | { 90 | name: 'sl-tab-pane', 91 | lib: { 'twb': true } 92 | }, 93 | { 94 | name: 'sl-tab-panel', 95 | lib: { 'twb': true } 96 | }, 97 | { 98 | name: 'sl-textarea', 99 | lib: { 'sec': true } 100 | }, 101 | { 102 | name: 'sl-tooltip', 103 | lib: { 'twb': true } 104 | } 105 | ]) 106 | }); 107 | -------------------------------------------------------------------------------- /tests/dummy/app/controllers/demos/sl-calendar.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Controller.extend({ 4 | actions: { 5 | logLabel( dateObjects ) { 6 | window.console.log( dateObjects ); 7 | } 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /tests/dummy/app/controllers/demos/sl-chart.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Controller.extend({ 4 | actions: { 5 | logOptions() { 6 | window.console.log( 'Chart options:', this.get( 'chartOptions' ) ); 7 | }, 8 | 9 | logSeries() { 10 | window.console.log( 'Content:', this.get( 'content' ) ); 11 | } 12 | }, 13 | 14 | chartOptions: { 15 | chart: { 16 | type: 'bar' 17 | }, 18 | 19 | xAxis: { 20 | categories: [ 'Apples', 'Bananas', 'Oranges' ] 21 | }, 22 | 23 | yAxis: { 24 | title: { 25 | text: 'Fruit Eaten' 26 | } 27 | } 28 | } 29 | }); 30 | -------------------------------------------------------------------------------- /tests/dummy/app/controllers/demos/sl-date-time.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Controller.extend({ 4 | firstDayDate: Ember.computed( 5 | function() { 6 | return window.moment().dayOfYear( 1 ); 7 | } 8 | ), 9 | 10 | threeMonthsAgoDate: Ember.computed( 11 | function() { 12 | const now = window.moment(); 13 | 14 | return window.moment().month( now.month() - 3 ); 15 | } 16 | ) 17 | }); 18 | -------------------------------------------------------------------------------- /tests/dummy/app/controllers/demos/sl-drop-button.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Controller.extend({ 4 | actions: { 5 | logRed() { 6 | window.console.log( 'Red!' ); 7 | }, 8 | 9 | logGreen() { 10 | window.console.log( 'Green!' ); 11 | }, 12 | 13 | logWhite() { 14 | window.console.log( 'White!' ); 15 | } 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /tests/dummy/app/controllers/demos/sl-grid.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Controller.extend({ 4 | sortProperties: [ 'fruit' ], 5 | sortedModel: Ember.computed.sort( 'model', 'sortProperties' ), 6 | 7 | actions: { 8 | rowClick( row ) { 9 | window.console.log( 'Clicked', row ); 10 | }, 11 | 12 | logName( row ) { 13 | window.console.log( 'Record:', Ember.get( row, 'name' ) ); 14 | }, 15 | 16 | sortColumn( column ) { 17 | const columns = this.get( 'columns' ); 18 | const currentDir = Ember.get( column, 'sorted' ); 19 | 20 | let sortDir = 'asc'; 21 | if ( 'asc' === currentDir ) { 22 | sortDir = 'desc'; 23 | } 24 | 25 | for ( let i = 0; i < columns.length; i++ ) { 26 | Ember.set( columns[ i ], 'sorted', null ); 27 | } 28 | 29 | Ember.set( column, 'sorted', sortDir ); 30 | 31 | let columnString = column[ 'valuePath' ]; 32 | 33 | if ( sortDir !== 'asc' ) { 34 | columnString = `${columnString}:desc`; 35 | } 36 | 37 | this.set( 'sortProperties', [ columnString ] ); 38 | } 39 | }, 40 | 41 | columns: Ember.A([ 42 | { 43 | title: 'Color', 44 | valuePath: 'name' 45 | }, 46 | { 47 | headerClass: 'smallWidth', 48 | primary: true, 49 | sortable: true, 50 | sorted: 'asc', 51 | title: 'Fruit', 52 | valuePath: 'fruit' 53 | }, 54 | { 55 | headerClass: 'smallWidth', 56 | sortable: true, 57 | title: 'Hex Code', 58 | valuePath: 'hexCode' 59 | } 60 | ]), 61 | 62 | rowActions: [ 63 | { 64 | label: 'Log', 65 | action: 'sendLog' 66 | } 67 | ], 68 | 69 | totalCount: 6 70 | }); 71 | -------------------------------------------------------------------------------- /tests/dummy/app/controllers/demos/sl-input.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Controller.extend({ 4 | colors: [ 5 | { id: 'Black' }, 6 | { id: 'Blue' }, 7 | { id: 'Gray' }, 8 | { id: 'Green' }, 9 | { id: 'Orange' }, 10 | { id: 'Purple' }, 11 | { id: 'Red' }, 12 | { id: 'White' }, 13 | { id: 'Yellow' } 14 | ], 15 | 16 | names: [ 17 | 'Jeff', 18 | 'Michael', 19 | 'Jeremy' 20 | ] 21 | }); 22 | -------------------------------------------------------------------------------- /tests/dummy/app/controllers/demos/sl-pagination.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Controller.extend({ 4 | actions: { 5 | changePage( pageNumber ) { 6 | window.console.log( 'Page changed to', pageNumber ); 7 | } 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /tests/dummy/app/controllers/demos/sl-progress-bar.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Controller.extend({ 4 | dynamicValue: 42 5 | }); 6 | -------------------------------------------------------------------------------- /tests/dummy/app/controllers/demos/sl-radio-group.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Controller.extend({ 4 | currentColor: 'blue' 5 | }); 6 | -------------------------------------------------------------------------------- /tests/dummy/app/controllers/demos/sl-select.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Controller.extend({ 4 | numbers: [ 10, 20, 30, 40, 50, 60, 70, 80, 90 ] 5 | }); 6 | -------------------------------------------------------------------------------- /tests/dummy/app/controllers/demos/sl-span.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Controller.extend({ 4 | initialize: Ember.on( 5 | 'init', 6 | function() { 7 | setTimeout( () => { 8 | this.set( 'isLoading', false ); 9 | }, 5000 ); 10 | } 11 | ), 12 | 13 | isLoading: true 14 | }); 15 | -------------------------------------------------------------------------------- /tests/dummy/app/controllers/demos/tabs/home.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Controller.extend({ 4 | testValue: 'Hello' 5 | }); 6 | -------------------------------------------------------------------------------- /tests/dummy/app/helpers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softlayer/sl-ember-components/b666df5d75c6ecf51da82ca2c3fd2722add17715/tests/dummy/app/helpers/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | sl-ember-components Demo Application and Documentation 7 | 8 | 9 | 10 | 11 | 12 | {{content-for "head"}} 13 | 14 | 15 | 16 | 17 | 18 | 19 | {{content-for "head-footer"}} 20 | 21 | 22 | {{content-for "body"}} 23 | 24 | 25 | 26 | 27 | {{content-for "body-footer"}} 28 | 29 | 30 | -------------------------------------------------------------------------------- /tests/dummy/app/models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softlayer/sl-ember-components/b666df5d75c6ecf51da82ca2c3fd2722add17715/tests/dummy/app/models/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/app/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from 'ember-resolver'; 2 | 3 | export default Resolver; 4 | -------------------------------------------------------------------------------- /tests/dummy/app/router.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import config from './config/environment'; 3 | 4 | const Router = Ember.Router.extend({ 5 | location: config.locationType, 6 | 7 | scrollToTopAfterRouteTransition: Ember.observer( 8 | 'url', 9 | function() { 10 | window.scrollTo( 0, 0 ); 11 | } 12 | ) 13 | }); 14 | 15 | Router.map( function() { 16 | this.route( 'index', { path: '/' }); 17 | this.route( 'browsers' ); 18 | 19 | this.route( 'demos', function() { 20 | this.route( 'sl-alert' ); 21 | this.route( 'sl-modal' ); 22 | this.route( 'sl-button' ); 23 | this.route( 'sl-calendar' ); 24 | this.route( 'sl-chart' ); 25 | this.route( 'sl-checkbox' ); 26 | this.route( 'sl-date-picker' ); 27 | this.route( 'sl-date-range-picker' ); 28 | this.route( 'sl-date-time' ); 29 | this.route( 'sl-drop-button' ); 30 | this.route( 'sl-input' ); 31 | this.route( 'sl-grid' ); 32 | this.route( 'sl-menu' ); 33 | this.route( 'sl-pagination' ); 34 | this.route( 'sl-panel' ); 35 | this.route( 'sl-progress-bar' ); 36 | this.route( 'sl-radio' ); 37 | this.route( 'sl-radio-group' ); 38 | this.route( 'sl-select' ); 39 | this.route( 'sl-span' ); 40 | this.route( 'sl-tab-panel' ); 41 | this.route( 'sl-textarea' ); 42 | this.route( 'sl-tooltip' ); 43 | 44 | this.route( 'services', function() { 45 | this.route( 'sl-modal' ); 46 | }); 47 | }); 48 | }); 49 | 50 | export default Router; 51 | -------------------------------------------------------------------------------- /tests/dummy/app/routes/application.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Route.extend(); 4 | -------------------------------------------------------------------------------- /tests/dummy/app/routes/demos/sl-calendar.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Route.extend({ 4 | model() { 5 | return Ember.A([ 6 | { 7 | date: new Date(), 8 | label: 'Today!' 9 | } 10 | ]); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /tests/dummy/app/routes/demos/sl-chart.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Route.extend({ 4 | model() { 5 | return Ember.A([ 6 | { 7 | name: 'Jane', 8 | data: [ 1, 0, 4 ] 9 | }, 10 | { 11 | name: 'John', 12 | data: [ 5, 7, 3 ] 13 | } 14 | ]); 15 | } 16 | }); 17 | -------------------------------------------------------------------------------- /tests/dummy/app/routes/demos/sl-grid.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Route.extend({ 4 | model() { 5 | return Ember.A([ 6 | { 7 | name: 'Red', 8 | fruit: 'Apple', 9 | hexCode: '#FF0000' 10 | }, 11 | { 12 | name: 'Orange', 13 | fruit: 'Orange', 14 | hexCode: '#FF7700' 15 | }, 16 | { 17 | name: 'Yellow', 18 | fruit: 'Banana', 19 | hexCode: '#FFFF00' 20 | }, 21 | { 22 | name: 'Green', 23 | fruit: 'Lime', 24 | hexCode: '#00FF00' 25 | }, 26 | { 27 | name: 'Blue', 28 | fruit: 'Blueberry', 29 | hexCode: '#0000FF' 30 | }, 31 | { 32 | name: 'Purple', 33 | fruit: 'Grape', 34 | hexCode: '#FF00FF' 35 | } 36 | ]); 37 | } 38 | }); 39 | -------------------------------------------------------------------------------- /tests/dummy/app/routes/demos/sl-select.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default Ember.Route.extend({ 4 | model() { 5 | return Ember.A([ 6 | { 7 | label: 'Red', 8 | description: 'Apples', 9 | value: 'red' 10 | }, 11 | { 12 | label: 'Orange', 13 | description: 'Oranges', 14 | value: 'orange' 15 | }, 16 | { 17 | label: 'Yellow', 18 | description: 'Bananas', 19 | value: 'yellow' 20 | }, 21 | { 22 | label: 'Green', 23 | description: 'Avocados', 24 | value: 'green' 25 | }, 26 | { 27 | label: 'Purple', 28 | description: 'Blueberries', 29 | value: 'purple' 30 | }, 31 | { 32 | label: 'Splorge', 33 | description: '???', 34 | value: 'splorge' 35 | } 36 | ]); 37 | } 38 | }); 39 | -------------------------------------------------------------------------------- /tests/dummy/app/styles/app.less: -------------------------------------------------------------------------------- 1 | @import "sl-ember-components"; 2 | 3 | .page-header .nav .dropdown a.active { 4 | background-color: @brand-primary; 5 | } 6 | 7 | h5 { 8 | text-decoration: underline; 9 | } 10 | 11 | section { 12 | margin-top: 2rem; 13 | } 14 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/components/demos/sl-grid-detail-footer.hbs: -------------------------------------------------------------------------------- 1 | {{model.hexCode}} 2 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/components/demos/sl-grid-detail-header.hbs: -------------------------------------------------------------------------------- 1 | Color: {{model.name}} 2 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/components/demos/sl-grid-detail.hbs: -------------------------------------------------------------------------------- 1 |

    {{model.name}} fruit: {{model.fruit}}

    2 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/components/demos/tabs/tab-one.hbs: -------------------------------------------------------------------------------- 1 |

    Tab Pane One

    2 | 3 |

    {{text}}

    4 | 5 | {{sl-input placeholder="Enter some text" value=inputText}} 6 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/components/demos/tabs/tab-two.hbs: -------------------------------------------------------------------------------- 1 |

    Tab Pane Two

    2 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/components/property-text.hbs: -------------------------------------------------------------------------------- 1 |

    2 | {{name}} 3 | {{#if required}} 4 | required 5 | {{/if}} 6 |

    7 |

    8 | {{type}}{{#if default}}, default: {{default}}{{/if}}{{#if requires}}, requires {{requires}}{{/if}} 9 |

    10 |

    {{yield}}

    -------------------------------------------------------------------------------- /tests/dummy/app/templates/demos/sl-calendar.hbs: -------------------------------------------------------------------------------- 1 |

    sl-calendar

    2 |

    A standalone calendar to display date values from an array of objects.

    3 | 4 |
    5 | 6 |

    Example

    7 | 8 |
    9 |
    10 |
    Template
    11 |
    \{{sl-calendar action="logLabel" content=content}}
    12 | 13 |
    Route/Controller
    14 |
    model: [
    15 |     {
    16 |         date: new Date(),
    17 |         label: 'Today!'
    18 |     }
    19 | ]
    20 |
    21 | 22 |
    23 |
    Rendered Component
    24 | {{sl-calendar action="logLabel" class="col-sm-6" content=content}} 25 |
    26 |
    27 | 28 |
    29 | 30 |

    Custom CSS styling

    31 | 32 |
    33 |
    34 |

    sl-ember-components-calendar

    35 |

    The default class prefix is "sl-ember-components" unless the consuming application passes in a custom prefix. In which case, the CSS class would be [customprefix]-calendar.

    36 |
    37 |
    38 | 39 |
    40 | 41 |

    Properties

    42 | 43 |
    44 | {{#property-text name="action" type="Function"}} 45 | Action to call when a day is clicked that contains one of the content dates. An array of content objects with dates occurring on the clicked date will be returned to this action. 46 | {{/property-text}} 47 | 48 | {{#property-text name="content" type="Object[]"}} 49 | Bound array of objects with date values, looked up using the dateValuePath property. 50 | {{/property-text}} 51 | 52 | {{#property-text name="currentMonth" type="Number" default="current month"}} 53 | The month number to display (1-12). 54 | {{/property-text}} 55 | 56 | {{#property-text name="currentYear" type="Number" default="current year"}} 57 | The year to display. 58 | {{/property-text}} 59 | 60 | {{#property-text name="dateValuePath" type="String" default="\"date\""}} 61 | Path to the content objects' date value. 62 | {{/property-text}} 63 | 64 | {{#property-text name="locale" type="String" default="\"en\""}} 65 | The locale string to use for moment date formats. 66 | {{/property-text}} 67 | 68 | {{#property-text name="locked" type="Boolean" default="false"}} 69 | When true, the view is locked in the initial mode, and forward and back buttons are disabled. 70 | {{/property-text}} 71 | 72 | {{#property-text name="viewMode" type="String" default="\"days\""}} 73 | The view to display the calendar in; "days", "months", or "years". 74 | {{/property-text}} 75 |
    76 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/demos/sl-chart.hbs: -------------------------------------------------------------------------------- 1 |

    sl-chart

    2 |

    A wrapper component for Highcharts.

    3 |

    Highcharts is only free for non-commercial use and requires a license for any other use. See 4 | this FAQ page for more information.

    5 | 6 |
    7 | 8 |

    Example

    9 | 10 |
    11 |
    12 |
    Template
    13 |
    \{{sl-chart
    14 |     options=chartOptions
    15 |     series=content
    16 |     title="Fruit Consumption"
    17 | }}
    18 | 19 |
    Controller
    20 |
    chartOptions: {
    21 |     chart: {
    22 |         type: 'bar'
    23 |     },
    24 | 
    25 |     xAxis: {
    26 |         categories: [ 'Apples', 'Bananas', 'Oranges' ]
    27 |     },
    28 | 
    29 |     yAxis: {
    30 |         title: {
    31 |             text: 'Fruit Eaten'
    32 |         }
    33 |     }
    34 | }
    35 | 36 |
    Route
    37 |
    content = [
    38 |     {
    39 |         name: 'Jane',
    40 |         data: [ 1, 0, 4 ]
    41 |     }, {
    42 |         name: 'John',
    43 |         data: [ 5, 7, 3 ]
    44 |     }
    45 | ]
    46 |
    47 | 48 |
    49 |
    Rendered Component
    50 | {{sl-chart options=chartOptions series=content title="Fruit Consumption"}} 51 |
    52 |
    53 | 54 |
    55 | 56 |

    Custom CSS styling

    57 | 58 |
    59 |
    60 |

    sl-ember-components-chart

    61 |

    The default class prefix is "sl-ember-components" unless the consuming application passes in a custom prefix. In which case, the CSS class would be [customprefix]-chart.

    62 |
    63 |
    64 | 65 |
    66 | 67 |

    Properties

    68 | 69 |
    70 | {{#property-text name="options" required=true type="Object"}} 71 | An object of options passed directly to Highcharts initialization. 72 | {{/property-text}} 73 | 74 | {{#property-text name="series" required=true type="Array"}} 75 | Array of series data to bind to the component. 76 | {{/property-text}} 77 | 78 | {{#property-text name="height" type="String"}} 79 | CSS string for the height inline style value. 80 | {{/property-text}} 81 | 82 | {{#property-text name="loading" type="Boolean" default="false"}} 83 | When true, the chart is masked and a loading icon appears. 84 | {{/property-text}} 85 | 86 | {{#property-text name="title" type="String"}} 87 | The title of the chart's panel. 88 | {{/property-text}} 89 | 90 | {{#property-text name="width" type="String"}} 91 | CSS string for the width inline style value. 92 | {{/property-text}} 93 |
    94 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/demos/sl-checkbox.hbs: -------------------------------------------------------------------------------- 1 |

    sl-checkbox

    2 |

    An improved substitute for the default <input type="checkbox"> element. See Bootstrap - Supported controls for details.

    3 | 4 |
    5 | 6 |

    Example

    7 | 8 |
    9 |
    10 |
    Template
    11 |
    \{{sl-checkbox
     12 |     checked=checkboxValue
     13 |     label="Checkbox"
     14 |     name="checkbox"
     15 |     inline=true
     16 | }}
    17 |
    18 | 19 |
    20 |
    Rendered Component
    21 | {{sl-checkbox checked=checkboxValue label="Checkbox" name="checkbox" inline=true}} 22 | 23 | {{#if checkboxValue}} 24 | Checked! 25 | {{/if}} 26 |
    27 |
    28 | 29 |
    30 |
    31 |
    Template
    32 |
    \{{sl-checkbox
     33 |     disabled=true
     34 |     label="Disabled checkbox"
     35 | }}
    36 |
    37 | 38 |
    39 |
    Rendered Component
    40 | {{sl-checkbox disabled=true label="Disabled checkbox"}} 41 |
    42 |
    43 | 44 |
    45 | 46 |

    Mixins used

    47 | 48 |
    49 |
    50 |

    sl-input-based

    51 |
    52 |
    53 |

    sl-tooltip-enabled

    54 |
    55 |
    56 | 57 |
    58 | 59 |

    Custom CSS styling

    60 | 61 |
    62 |
    63 |

    sl-ember-components-checkbox

    64 |

    The default class prefix is "sl-ember-components" unless the consuming application passes in a custom prefix. In which case, the CSS class would be [customprefix]-checkbox.

    65 |
    66 |
    67 | 68 |
    69 | 70 |

    Properties

    71 | 72 |
    73 | {{#property-text name="checked" type="Boolean" default="false"}} 74 | The bound value indicating if the checkbox is checked or not. 75 | {{/property-text}} 76 | 77 | {{#property-text name="disabled" type="Boolean" default="false"}} 78 | When true, the checkbox is disabled. 79 | {{/property-text}} 80 | 81 | {{#property-text name="inline" type="Boolean" default="false"}} 82 | Display the checkbox inline with others. 83 | {{/property-text}} 84 | 85 | {{#property-text name="label" type="String"}} 86 | Label text to display beside the checkbox. 87 | {{/property-text}} 88 | 89 | {{#property-text name="name" type="String"}} 90 | name attribute value for the input. 91 | {{/property-text}} 92 | 93 | {{#property-text name="popover" type="String"}} 94 | Popover content text. 95 | {{/property-text}} 96 | 97 | {{#property-text name="title" type="String"}} 98 | Tooltip text string, or becomes popover title with supplied popover property. 99 | {{/property-text}} 100 |
    101 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/demos/sl-date-range-picker.hbs: -------------------------------------------------------------------------------- 1 |

    sl-date-range-picker

    2 |

    A component to use for date ranges, using two {{#link-to "demos.sl-date-picker"}}sl-date-picker{{/link-to}} components.

    3 | 4 |
    5 | 6 |

    Example

    7 | 8 |
    9 |
    10 |
    Template
    11 |
    \{{sl-date-range-picker
    12 |     label="Select date range"
    13 |     startDatePlaceholder="Select start date"
    14 |     endDatePlaceholder="Select end date"
    15 | }}
    16 |
    17 | 18 |
    19 |
    Rendered Component
    20 | {{sl-date-range-picker 21 | label="Select date range" 22 | startDatePlaceholder="Select start date" 23 | endDatePlaceholder="Select end date" 24 | }} 25 |
    26 |
    27 | 28 |
    29 | 30 |

    Mixins used

    31 | 32 |
    33 |
    34 |

    sl-component-input-id

    35 |
    36 |
    37 | 38 |
    39 | 40 |

    Custom CSS styling

    41 | 42 |
    43 |
    44 |

    sl-ember-components-date-range-picker

    45 |

    The default class prefix is "sl-ember-components" unless the consuming application passes in a custom prefix. In which case, the CSS class would be [customprefix]-date-range-picker.

    46 |
    47 |
    48 | 49 |
    50 | 51 |

    Properties

    52 | 53 |
    54 | {{#property-text name="endDatePlaceholder" type="String"}} 55 | The placeholder attribute text for the end date input. 56 | {{/property-text}} 57 | 58 | {{#property-text name="endDateValue" type="String" default="null"}} 59 | The binding value for the endDate input. 60 | {{/property-text}} 61 | 62 | {{#property-text name="format" type="String" default="\"mm/dd/yyyy\""}} 63 | The date format used for both inputs; combination of d, dd, D, DD, m, mm, M, MM, yy, yyyy 64 | 71 | {{/property-text}} 72 | 73 | {{#property-text name="maxDate" type="Date/String" default="null"}} 74 | The latest possible date for the range. 75 | {{/property-text}} 76 | 77 | {{#property-text name="minDate" type="Date/String" default="null"}} 78 | The earliest possible date for the range. 79 | {{/property-text}} 80 | 81 | {{#property-text name="startDatePlaceholder" type="String"}} 82 | The placeholder attribute text for the start date input. 83 | {{/property-text}} 84 | 85 | {{#property-text name="startDateValue" type="String" default="null"}} 86 | The binding value for the startDate input. 87 | {{/property-text}} 88 |
    89 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/demos/sl-grid/detail.hbs: -------------------------------------------------------------------------------- 1 |

    {{model.name}} fruit: {{model.fruit}}

    2 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/demos/sl-grid/footer.hbs: -------------------------------------------------------------------------------- 1 | Viewing {{content.length}} of {{totalCount}} Colors 2 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/demos/sl-grid/header.hbs: -------------------------------------------------------------------------------- 1 | {{#sl-drop-button label="Do something"}} 2 | {{sl-drop-option click=sayHello label="Say Hello" targetObject=parentView}} 3 | {{sl-drop-option click=sayGoodbye label="Say Goodbye" targetObject=parentView}} 4 | {{/sl-drop-button}} 5 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/demos/sl-pagination.hbs: -------------------------------------------------------------------------------- 1 |

    sl-pagination

    2 |

    A component used for displaying and controlling pages of content.

    3 | 4 |
    5 | 6 |

    Example

    7 | 8 |
    9 |
    10 |
    Template
    11 |
    \{{sl-pagination changePage="changePage" totalPages=20}}
    12 |
    13 |
    14 |
    Rendered Component
    15 | {{sl-pagination changePage="changePage" totalPages=20}} 16 |
    17 |
    18 | 19 |
    20 | 21 |

    Custom CSS styling

    22 | 23 |
    24 |
    25 |

    sl-ember-components-pagination

    26 |

    The default class prefix is "sl-ember-components" unless the consuming application passes in a custom prefix. In which case, the CSS class would be [customprefix]-pagination.

    27 |
    28 |
    29 | 30 |
    31 | 32 |

    Properties

    33 | 34 |
    35 | {{#property-text name="totalPages" required=true type="Number"}} 36 | The total number of pages. 37 | {{/property-text}} 38 | 39 | {{#property-text name="busy" type="Boolean" default="false"}} 40 | When true, the state of the pagination component will not change. 41 | {{/property-text}} 42 | 43 | {{#property-text name="changePage" type="String"}} 44 | An action triggered when the currentPage value is changed. The page number changed to is sent to the action. 45 | {{/property-text}} 46 | 47 | {{#property-text name="currentPage" type="Number" default="1"}} 48 | The current page bound value. 49 | {{/property-text}} 50 | 51 | {{#property-text name="isResponsive" type="Boolean" default="true"}} 52 | Whether to use the responsive jQuery plugin. 53 | {{/property-text}} 54 | 55 | {{#property-text name="nextPage" type="String"}} 56 | An action triggered when the page is incremented successfully. The action is passed the new page number. 57 | {{/property-text}} 58 | 59 | {{#property-text name="previousPage" type="String"}} 60 | An action triggered when the page is decremented successfully. The action is passed the new page number. 61 | {{/property-text}} 62 |
    63 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/demos/sl-panel.hbs: -------------------------------------------------------------------------------- 1 |

    sl-panel

    2 |

    A basic content wrapper for Bootstrap - Panels.

    3 | 4 |
    5 | 6 |

    Example

    7 | 8 |
    9 |
    10 |
    Template
    11 |
    \{{#sl-panel heading="Test Panel" theme="primary"}}
    12 |     <p>Hello world!</p>
    13 | \{{/sl-panel}}
    14 |
    15 | 16 |
    17 |
    Rendered Template
    18 | {{#sl-panel heading="Test Panel" theme="primary"}} 19 |

    Hello world!

    20 | {{/sl-panel}} 21 |
    22 |
    23 | 24 |
    25 |
    26 |
    Template
    27 |
    \{{#sl-panel footer="Test Panel"}}
    28 |     <p>Hello world!</p>
    29 | \{{/sl-panel}}
    30 |
    31 | 32 |
    33 |
    Rendered Template
    34 | {{#sl-panel footer="Test Panel"}} 35 |

    Hello world!

    36 | {{/sl-panel}} 37 |
    38 |
    39 | 40 |
    41 |
    42 |
    Template
    43 |
    \{{#sl-panel heading="Test Panel" loading=true}}
    44 |     <p>Hello world!</p>
    45 | \{{/sl-panel}}
    46 |
    47 | 48 |
    49 |
    Rendered Template
    50 | {{#sl-panel heading="Test Panel" loading=true}} 51 |

    Hello world!

    52 | {{/sl-panel}} 53 |
    54 |
    55 | 56 |
    57 | 58 |

    Custom CSS styling

    59 | 60 |
    61 |
    62 |

    sl-ember-components-panel

    63 |

    The default class prefix is "sl-ember-components" unless the consuming application passes in a custom prefix. In which case, the CSS class would be [customprefix]-panel.

    64 |
    65 |
    66 | 67 |
    68 | 69 |

    Properties

    70 | 71 |
    72 | {{#property-text name="footer" type="String"}} 73 | Text for the panel footer. 74 | {{/property-text}} 75 | 76 | {{#property-text name="heading" type="String"}} 77 | Text for the panel heading. 78 | {{/property-text}} 79 | 80 | {{#property-text name="loading" type="Boolean" default="false"}} 81 | When true, the panel body becomes masked and a loading icon appears. 82 | {{/property-text}} 83 | 84 | {{#property-text name="theme" type="String" default="\"default\""}} 85 | The Bootstrap contextual theme string to style the panel with. 86 | {{/property-text}} 87 |
    88 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/demos/sl-radio.hbs: -------------------------------------------------------------------------------- 1 |

    sl-radio

    2 |

    Individual radio button component.

    3 | 4 |
    5 | 6 |

    Examples

    7 | 8 |
    9 |
    10 |
    Template
    11 |
    \{{sl-radio inline=true label="Test radio button"}}
    12 |
    13 | 14 |
    15 |
    Rendered Component
    16 | {{sl-radio inline=true label="Test radio button"}} 17 |
    18 |
    19 | 20 |
    21 |
    22 |
    Template
    23 |
    \{{sl-radio disabled=true label="Disabled radio button"}}
    24 |
    25 | 26 |
    27 |
    Rendered Component
    28 | {{sl-radio disabled=true label="Disabled radio button"}} 29 |
    30 |
    31 | 32 |
    33 | 34 |

    Mixins used

    35 | 36 |
    37 |
    38 |

    sl-input-based

    39 |
    40 |
    41 | 42 |
    43 | 44 |

    Custom CSS styling

    45 | 46 |
    47 |
    48 |

    sl-ember-components-radio

    49 |

    The default class prefix is "sl-ember-components" unless the consuming application passes in a custom prefix. In which case, the CSS class would be [customprefix]-radio.

    50 |
    51 |
    52 | 53 |
    54 | 55 |

    Properties

    56 | 57 |
    58 | {{#property-text name="disabled" type="Boolean" default="false"}} 59 | When true, the radio button will be disabled. 60 | {{/property-text}} 61 | 62 | {{#property-text name="inline" type="Boolean" default="false"}} 63 | Display the radio inputs inline with each other. 64 | {{/property-text}} 65 | 66 | {{#property-text name="label" type="String"}} 67 | Text label for the button. 68 | {{/property-text}} 69 | 70 | {{#property-text name="name" type="String"}} 71 | name attribute value for the button. 72 | {{/property-text}} 73 | 74 | {{#property-text name="value" type="String"}} 75 | Bound value for the radio button. 76 | {{/property-text}} 77 |
    78 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/demos/sl-span.hbs: -------------------------------------------------------------------------------- 1 |

    sl-span

    2 |

    A wrapper to intelligently represent state for inline content.

    3 | 4 |
    5 | 6 |

    Example

    7 | 8 |
    9 |
    10 |
    Template
    11 |
    <p>
    12 |     Loads in 5 seconds:&emsp;\{{sl-span
    13 |         class="text-success"
    14 |         loading=isLoading
    15 |         value="Done!"
    16 |     }}
    17 | </p>
    18 | 19 |

    Note: This component does not provide a time-delay mechanism. The 5 second time delay represented in the example is implemented in the demonstration controller and is employed to emulate the waiting for a promise to be resolved in order to demonstrate the loading state of this component and the final display of the resolved data value.

    20 |
    21 | 22 |
    23 |
    Rendered Component
    24 |

    Loads in 5 seconds: {{sl-span class="text-success" loading=isLoading value="Done!"}}

    25 |
    26 |
    27 | 28 |
    29 | 30 |

    Custom CSS styling

    31 | 32 |
    33 |
    34 |

    sl-ember-components-span

    35 |

    The default class prefix is "sl-ember-components" unless the consuming application passes in a custom prefix. In which case, the CSS class would be [customprefix]-span.

    36 |
    37 |
    38 | 39 |
    40 | 41 |

    Properties

    42 | 43 |
    44 | {{#property-text name="class" type="String"}} 45 | The class attribute to apply to the span. 46 | {{/property-text}} 47 | 48 | {{#property-text name="loading" type="Boolean" default="false"}} 49 | When true, a loading icon will be displayed in place of content. 50 | {{/property-text}} 51 | 52 | {{#property-text name="value" type="String"}} 53 | The value to display once loaded/ready. This property will override the yielded content. 54 | {{/property-text}} 55 |
    56 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/demos/sl-tab-panel.hbs: -------------------------------------------------------------------------------- 1 |

    sl-tab-panel

    2 |

    A component with selectable tabs and related tab panes. Based on Bootstrap - Togglable tabs.

    3 | 4 |
    5 | 6 |

    Examples

    7 | 8 |
    9 |
    10 |
    Template
    11 |
    \{{#sl-tab-panel}}
    12 |     \{{#sl-tab-pane label="One" name="one"}}
    13 |         \{{demos/tabs/tab-one}}
    14 |     \{{/sl-tab-pane}}
    15 | 
    16 |     \{{#sl-tab-pane label="Two" name="two"}}
    17 |         \{{demos/tabs/tab-two}}
    18 |     \{{/sl-tab-pane}}
    19 | 
    20 |     \{{#sl-tab-pane label="Three" name="three"}}
    21 |         <p>Content for tab three!</p>
    22 |     \{{/sl-tab-pane}}
    23 | \{{/sl-tab-panel}}
    24 |
    25 | 26 |
    27 |
    Rendered Component
    28 | {{#sl-tab-panel}} 29 | {{#sl-tab-pane label="One" name="one"}} 30 | {{demos/tabs/tab-one}} 31 | {{/sl-tab-pane}} 32 | 33 | {{#sl-tab-pane label="Two" name="two"}} 34 | {{demos/tabs/tab-two}} 35 | {{/sl-tab-pane}} 36 | 37 | {{#sl-tab-pane label="Three" name="three"}} 38 |

    Content for tab three!

    39 | {{/sl-tab-pane}} 40 | {{/sl-tab-panel}} 41 |
    42 |
    43 | 44 |
    45 | 46 |

    Custom CSS styling

    47 | 48 |
    49 |
    50 |

    sl-ember-components-tab-panel

    51 |

    The default class prefix is "sl-ember-components" unless the consuming application passes in a custom prefix. In which case, the CSS class would be [customprefix]-tab-panel.

    52 |
    53 |
    54 | 55 |
    56 | 57 |

    sl-tab-panel Properties

    58 | 59 |
    60 | {{#property-text name="alignTabs" type="String" default="\"left\""}} 61 | How to align the tabs, "left" or "right". 62 | {{/property-text}} 63 | 64 | {{#property-text name="initialTabName" type="String"}} 65 | Name of the initial active tab. This value corresponds to the value set on the name property of the sl-tab-pane component. If omitted, the first tab pane will be open on initialization. 66 | {{/property-text}} 67 |
    68 | 69 |
    70 | 71 |

    sl-tab-pane Properties

    72 | 73 | 84 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/demos/sl-tooltip.hbs: -------------------------------------------------------------------------------- 1 |

    sl-tooltip

    2 |

    A simple component that surrounds content to enable Bootstrap's tooltip and popover behavior.

    3 | 4 |
    5 | 6 |

    Examples

    7 | 8 |
    9 |
    10 |
    Template
    11 |
    \{{#sl-tooltip
    12 |     tagName="u"
    13 |     title="Tooltip text!"
    14 | }}
    15 |     Tooltip example
    16 | \{{/sl-tooltip}}
    17 |
    18 | 19 |
    20 |
    Rendered Component
    21 |

    {{#sl-tooltip tagName="u" title="Tooltip text!"}}Tooltip example{{/sl-tooltip}}

    22 |
    23 |
    24 | 25 |
    26 |
    27 |
    Template
    28 |
    \{{#sl-tooltip
    29 |     popover="Popover content!"
    30 |     tagName="u"
    31 |     title="Popover title"
    32 | }}
    33 |     Popover example
    34 | \{{/sl-tooltip}}
    35 |
    36 | 37 |
    38 |
    Rendered Component
    39 | {{#sl-tooltip 40 | popover="Popover content!" 41 | tagName="u" 42 | title="Popover title"}} 43 | Popover example 44 | {{/sl-tooltip}} 45 |
    46 |
    47 | 48 |
    49 | 50 |

    Mixins used

    51 | 52 |
    53 |
    54 | sl-tooltip-enabled 55 |
    56 |
    57 | 58 |
    59 | 60 |

    Custom CSS styling

    61 | 62 |
    63 |
    64 |

    sl-ember-components-tooltip

    65 |

    The default class prefix is "sl-ember-components" unless the consuming application passes in a custom prefix. In which case, the CSS class would be [customprefix]-tooltip.

    66 |
    67 |
    68 | 69 |
    70 | 71 |

    Properties

    72 | 73 |
    74 | {{#property-text name="title" type="String" required=true}} 75 | Tooltip content text, or popover title text when popover property is set. 76 | {{/property-text}} 77 | 78 | {{#property-text name="popover" type="String"}} 79 | Popover content text. 80 | {{/property-text}} 81 |
    82 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/index.hbs: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |

    sl-ember-components REPLACE_APPLICATION_VERSION

    4 |

    An Ember CLI Addon that provides a variety of UI components.

    5 |
    6 |
    7 | 8 |
    9 |
    10 |

    Components

    11 |
      12 |
    • sl-alert
    • 13 |
    • sl-button
    • 14 |
    • sl-calendar
    • 15 |
    • sl-chart
    • 16 |
    • sl-checkbox
    • 17 |
    • sl-date-picker
    • 18 |
    • sl-date-range-picker
    • 19 |
    • sl-date-time
    • 20 |
    • sl-drop-button
    • 21 |
    • sl-grid
    • 22 |
    • sl-input
    • 23 |
    • sl-menu
    • 24 |
    • sl-modal
    • 25 |
    • sl-pagination
    • 26 |
    • sl-panel
    • 27 |
    • sl-progress-bar
    • 28 |
    • sl-radio
    • 29 |
    • sl-radio-group
    • 30 |
    • sl-select
    • 31 |
    • sl-span
    • 32 |
    • sl-tab-panel
    • 33 |
    • sl-textarea
    • 34 |
    • sl-tooltip
    • 35 |
    36 |
    37 | 38 |
    39 |

    Mixins

    40 |
      41 |
    • sl-component-input-id
    • 42 |
    • sl-input-based
    • 43 |
    • sl-namespace
    • 44 |
    • sl-tooltip-enabled
    • 45 |
    46 |
    47 | 48 |
    49 |

    Utility Classes

    50 |
      51 |
    • containsValue
    • 52 |
    • error
    • 53 |
    • warn
    • 54 |
    55 |
    56 | 57 |
    58 |

    CSS Classes

    59 |
      60 |
    • sl-loading
    • 61 |
    62 |
    63 |
    64 | 65 |
    66 |
    67 | {{#link-to "demos" class="col-md-3 text-center"}} 68 |

    69 |

    Demo

    70 | {{/link-to}} 71 | 72 |

    73 |

    Documentation

    74 |
    75 | {{#link-to "browsers" class="col-md-3 text-center"}} 76 |

    77 |

    Supported Browsers

    78 | {{/link-to}} 79 | 80 |

    81 |

    Available on GitHub

    82 |
    83 |
    84 |
    85 | -------------------------------------------------------------------------------- /tests/dummy/config/environment.js: -------------------------------------------------------------------------------- 1 | /* jshint node: true */ 2 | 3 | module.exports = function( environment ) { 4 | const ENV = { 5 | modulePrefix: 'dummy', 6 | environment: environment, 7 | baseURL: '/', 8 | baseAssetsURL: '/sl-ember-components/', 9 | locationType: 'auto', 10 | 11 | EmberENV: { 12 | FEATURES: { 13 | // Here you can enable experimental features on an ember canary 14 | // build (e.g. 'with-controller': true) 15 | } 16 | }, 17 | 18 | APP: { 19 | // Here you can pass flags/options to your application instance 20 | // when it is created 21 | } 22 | }; 23 | 24 | if ( 'development' === environment ) { 25 | // We want to be able to host the demo app without `ember serve` 26 | ENV.locationType = 'hash'; 27 | 28 | // ENV.APP.LOG_RESOLVER = true; 29 | // ENV.APP.LOG_ACTIVE_GENERATION = true; 30 | // ENV.APP.LOG_TRANSITIONS = true; 31 | // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; 32 | // ENV.APP.LOG_VIEW_LOOKUPS = true; 33 | } 34 | 35 | if ( 'test' === environment ) { 36 | // Testem prefers this... 37 | ENV.baseURL = '/'; 38 | ENV.locationType = 'none'; 39 | 40 | // keep test console output quieter 41 | ENV.APP.LOG_ACTIVE_GENERATION = false; 42 | ENV.APP.LOG_VIEW_LOOKUPS = false; 43 | 44 | ENV.APP.rootElement = '#ember-testing'; 45 | } 46 | 47 | // if ( 'production' === environment ) { 48 | 49 | return ENV; 50 | }; 51 | -------------------------------------------------------------------------------- /tests/dummy/public/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softlayer/sl-ember-components/b666df5d75c6ecf51da82ca2c3fd2722add17715/tests/dummy/public/.gitkeep -------------------------------------------------------------------------------- /tests/dummy/public/crossdomain.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /tests/dummy/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softlayer/sl-ember-components/b666df5d75c6ecf51da82ca2c3fd2722add17715/tests/dummy/public/favicon.png -------------------------------------------------------------------------------- /tests/dummy/public/robots.txt: -------------------------------------------------------------------------------- 1 | # http://www.robotstxt.org 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /tests/helpers/destroy-app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | 3 | export default function destroyApp( application ) { 4 | Ember.run( application, 'destroy' ); 5 | } 6 | -------------------------------------------------------------------------------- /tests/helpers/module-for-acceptance.js: -------------------------------------------------------------------------------- 1 | import { module } from 'qunit'; 2 | import startApp from '../helpers/start-app'; 3 | import destroyApp from '../helpers/destroy-app'; 4 | 5 | export default function( name, options = {} ) { 6 | module( name, { 7 | beforeEach() { 8 | this.application = startApp(); 9 | 10 | if ( options.beforeEach ) { 11 | options.beforeEach.apply( this, arguments ); 12 | } 13 | }, 14 | 15 | afterEach() { 16 | if ( options.afterEach ) { 17 | options.afterEach.apply( this, arguments ); 18 | } 19 | 20 | destroyApp( this.application ); 21 | } 22 | }); 23 | } 24 | -------------------------------------------------------------------------------- /tests/helpers/resolver.js: -------------------------------------------------------------------------------- 1 | import Resolver from '../../resolver'; 2 | import config from '../../config/environment'; 3 | 4 | const resolver = Resolver.create(); 5 | 6 | resolver.namespace = { 7 | modulePrefix: config.modulePrefix, 8 | podModulePrefix: config.podModulePrefix 9 | }; 10 | 11 | export default resolver; 12 | -------------------------------------------------------------------------------- /tests/helpers/start-app.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import slRegisterTestHelpers from './sl/register-test-helpers'; 3 | import Application from '../../app'; 4 | import config from '../../config/environment'; 5 | 6 | export default function startApp( attrs ) { 7 | let attributes = Ember.merge( {}, config.APP ); 8 | attributes = Ember.merge( attributes, attrs ); // use defaults, but you can override; 9 | 10 | let application; 11 | Ember.run( () => { 12 | application = Application.create( attributes ); 13 | application.setupForTesting(); 14 | slRegisterTestHelpers(); 15 | application.injectTestHelpers(); 16 | }); 17 | 18 | return application; 19 | } 20 | -------------------------------------------------------------------------------- /tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | sl-ember-components Tests 7 | 8 | 9 | 10 | {{content-for "head"}} 11 | {{content-for "test-head"}} 12 | 13 | 14 | 15 | 16 | 17 | 23 | 24 | {{content-for "head-footer"}} 25 | {{content-for "test-head-footer"}} 26 | 27 | 28 | {{content-for "body"}} 29 | {{content-for "test-body"}} 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | {{content-for "body-footer"}} 41 | {{content-for "test-body-footer"}} 42 | 43 | 44 | -------------------------------------------------------------------------------- /tests/integration/components/sl-drop-option-divider-test.js: -------------------------------------------------------------------------------- 1 | import { moduleForComponent, test } from 'ember-qunit'; 2 | import hbs from 'htmlbars-inline-precompile'; 3 | 4 | moduleForComponent( 'sl-drop-option-divider', 'Integration | Component | sl drop option divider', { 5 | integration: true 6 | }); 7 | 8 | test( 'Default rendered state', function( assert ) { 9 | this.render( hbs` 10 | {{sl-drop-option-divider}} 11 | ` ); 12 | 13 | assert.ok( 14 | this.$( '>:first-child' ).hasClass( 'sl-ember-components-drop-option-divider' ), 15 | 'Has class "sl-ember-components-drop-option-divider"' 16 | ); 17 | 18 | assert.ok( 19 | this.$( '>:first-child' ).hasClass( 'divider' ), 20 | 'Rendered component initially has class "divider"' 21 | ); 22 | 23 | assert.strictEqual( 24 | this.$( '>:first-child' ).attr( 'role' ), 25 | 'separator', 26 | 'ARIA role is properly set to "separator"' 27 | ); 28 | }); 29 | 30 | -------------------------------------------------------------------------------- /tests/integration/components/sl-drop-option-test.js: -------------------------------------------------------------------------------- 1 | import { moduleForComponent, test } from 'ember-qunit'; 2 | import hbs from 'htmlbars-inline-precompile'; 3 | 4 | moduleForComponent( 'sl-drop-option', 'Integration | Component | sl drop option', { 5 | integration: true 6 | }); 7 | 8 | test( 'Default rendered state', function( assert ) { 9 | this.render( hbs` 10 | {{sl-drop-option}} 11 | ` ); 12 | 13 | assert.ok( 14 | this.$( '>:first-child' ).hasClass( 'sl-ember-components-drop-option' ), 15 | 'Default rendered component has class "sl-ember-components-drop-option"' 16 | ); 17 | 18 | assert.strictEqual( 19 | this.$( '>:first-child' ).find( 'a' ).attr( 'role' ), 20 | 'menuitem', 21 | 'ARIA role is properly set to "menuitem"' 22 | ); 23 | }); 24 | 25 | test( 'Action is wired into template hyperlink tag', function( assert ) { 26 | assert.expect( 1 ); 27 | 28 | const done = assert.async(); 29 | 30 | this.render( hbs` 31 | {{sl-drop-option action="testAction" label="test"}} 32 | ` ); 33 | 34 | this.on( 'testAction', () => { 35 | assert.ok( 36 | true, 37 | 'The test action was called' 38 | ); 39 | 40 | done(); 41 | }); 42 | 43 | this.$( '>:first-child' ).find( 'a' ).click(); 44 | }); 45 | 46 | test( 'Content is yielded', function( assert ) { 47 | this.render( hbs` 48 | {{#sl-drop-option}} 49 | Some yielded text 50 | {{/sl-drop-option}} 51 | ` ); 52 | 53 | assert.strictEqual( 54 | this.$( '>:first-child' ).find( 'a' ).text().trim(), 55 | 'Some yielded text', 56 | 'Content is yielded correctly' 57 | ); 58 | }); 59 | 60 | -------------------------------------------------------------------------------- /tests/integration/components/sl-grid-cell-test.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import { moduleForComponent, test } from 'ember-qunit'; 3 | import hbs from 'htmlbars-inline-precompile'; 4 | import sinon from 'sinon'; 5 | 6 | moduleForComponent( 'sl-grid-cell', 'Integration | Component | sl grid cell', { 7 | integration: true 8 | }); 9 | 10 | const defaultColumn = Ember.Object.extend({ 11 | valuePath: 'value' 12 | }); 13 | 14 | const defaultRecord = Ember.Object.extend({ 15 | value: 'Test' 16 | }); 17 | 18 | const columnTemplate = hbs` 19 | {{sl-grid-cell column=column}} 20 | `; 21 | 22 | test( 'Column alignment class is applied', function( assert ) { 23 | const column = defaultColumn.create({ 24 | align: 'right' 25 | }); 26 | 27 | this.set( 'column', column ); 28 | 29 | this.render( columnTemplate ); 30 | 31 | assert.ok( 32 | this.$( '>:first-child' ).hasClass( 'text-right' ), 33 | 'Component has expected class "text-right" with right-aligned column' 34 | ); 35 | }); 36 | 37 | test( 'Primary column class is applied', function( assert ) { 38 | const column = defaultColumn.create({ 39 | primary: true 40 | }); 41 | 42 | this.set( 'column', column ); 43 | 44 | this.render( columnTemplate ); 45 | 46 | assert.ok( 47 | this.$( '>:first-child' ).hasClass( 'primary-column' ), 48 | 'Component has expected class "primary-column"' 49 | ); 50 | }); 51 | 52 | test( 'Content value is handled for valuePath', function( assert ) { 53 | const column = defaultColumn.create(); 54 | const record = defaultRecord.create(); 55 | 56 | this.set( 'column', column ); 57 | this.set( 'record', record ); 58 | 59 | this.render( hbs` 60 | {{sl-grid-cell column=column record=record}} 61 | ` ); 62 | 63 | assert.equal( 64 | this.$( '>:first-child' ).text().trim(), 65 | record.get( 'value' ), 66 | 'record value matches content value' 67 | ); 68 | }); 69 | 70 | test( 'Clicking on grid-cell invokes onClick handler', function( assert ) { 71 | const column = defaultColumn.create(); 72 | const record = defaultRecord.create(); 73 | const spyOnClick = sinon.spy(); 74 | 75 | this.set( 'column', column ); 76 | this.set( 'record', record ); 77 | 78 | this.on( 'onClick', spyOnClick ); 79 | 80 | this.render( hbs` 81 | {{sl-grid-cell column=column record=record onClick="onClick"}} 82 | ` ); 83 | 84 | this.$( '>:first-child' ).click(); 85 | 86 | assert.ok( 87 | spyOnClick.called, 88 | 'onClick action handler was called' 89 | ); 90 | }); 91 | -------------------------------------------------------------------------------- /tests/integration/components/sl-grid-column-header-test.js: -------------------------------------------------------------------------------- 1 | import { moduleForComponent, test } from 'ember-qunit'; 2 | import hbs from 'htmlbars-inline-precompile'; 3 | 4 | moduleForComponent( 'sl-grid-column-header', 'Integration | Component | sl grid column header', { 5 | integration: true 6 | }); 7 | 8 | test( 'Sorted icon class is applied correctly', function( assert ) { 9 | this.set( 'sortable', true ); 10 | this.set( 'sorted', null ); 11 | 12 | this.render( hbs` 13 | {{sl-grid-column-header sortable=sortable sorted=sorted}} 14 | ` ); 15 | 16 | assert.ok( 17 | this.$( '>:first-child' ).hasClass( 'sortable-column' ), 18 | true, 19 | 'Component has class "sortable-column" with sortable column' 20 | ); 21 | 22 | this.set( 'sorted', 'asc' ); 23 | 24 | assert.ok( 25 | this.$( '>:first-child' ).hasClass( 'column-ascending' ), 26 | 'column-ascending class is present when sorted is "asc"' 27 | ); 28 | 29 | this.set( 'sorted', 'desc' ); 30 | 31 | assert.ok( 32 | this.$( '>:first-child' ).hasClass( 'column-descending' ), 33 | 'column-descending class is present when sorted is "desc"' 34 | ); 35 | }); 36 | 37 | test( 'Content is yielded', function( assert ) { 38 | this.render( hbs` 39 | {{#sl-grid-column-header}} 40 | test text 41 | {{/sl-grid-column-header}} 42 | ` ); 43 | 44 | assert.strictEqual( 45 | this.$( '>:first-child' ).text().trim(), 46 | 'test text', 47 | 'Title was rendered correctly' 48 | ); 49 | }); 50 | -------------------------------------------------------------------------------- /tests/integration/components/sl-grid-row-test.js: -------------------------------------------------------------------------------- 1 | import { moduleForComponent, test } from 'ember-qunit'; 2 | import hbs from 'htmlbars-inline-precompile'; 3 | import sinon from 'sinon'; 4 | 5 | moduleForComponent( 'sl-grid-row', 'Integration | Component | sl grid row', { 6 | integration: true 7 | }); 8 | 9 | test( 'Active row class is supported', function( assert ) { 10 | const row = {}; 11 | 12 | this.set( 'row', row ); 13 | this.set( 'active', false ); 14 | 15 | this.render( hbs` 16 | {{sl-grid-row record=row active=active}} 17 | ` ); 18 | 19 | assert.notOk( 20 | this.$( '>:first-child' ).hasClass( 'active' ), 21 | 'Component with non-active state does not have "active" class' 22 | ); 23 | 24 | this.set( 'active', true ); 25 | 26 | assert.ok( 27 | this.$( '>:first-child' ).hasClass( 'active' ), 28 | 'Component with active state has "active" class' 29 | ); 30 | }); 31 | 32 | test( 'onClick action handler is called when row is clicked', function( assert ) { 33 | const row = {}; 34 | const spy = sinon.spy(); 35 | 36 | this.set( 'row', row ); 37 | this.on( 'onClick', spy ); 38 | 39 | this.render( hbs` 40 | {{sl-grid-row record=row onClick="onClick"}} 41 | ` ); 42 | 43 | this.$( '>:first-child' ).trigger( 'click' ); 44 | 45 | assert.ok( 46 | spy.called 47 | ); 48 | }); 49 | -------------------------------------------------------------------------------- /tests/integration/components/sl-menu-item-show-all-test.js: -------------------------------------------------------------------------------- 1 | import { moduleForComponent, test } from 'ember-qunit'; 2 | import hbs from 'htmlbars-inline-precompile'; 3 | import sinon from 'sinon'; 4 | 5 | moduleForComponent( 'sl-menu-item-show-all', 'Integration | Component | sl menu item show all', { 6 | integration: true 7 | }); 8 | 9 | test( 'mouseEnter triggers calling of sendAction', function( assert ) { 10 | this.set( 'onMouseEnterSpy', sinon.spy() ); 11 | 12 | this.render( hbs` 13 | {{sl-menu-item-show-all 14 | onMouseEnter=onMouseEnterSpy 15 | }} 16 | ` ); 17 | 18 | this.$( '>:first-child' ).find( 'a' ).trigger( 'mouseenter' ); 19 | 20 | assert.ok( 21 | this.get( 'onMouseEnterSpy' ).calledOnce, 22 | 'sendAction() was triggered successfully' 23 | ); 24 | }); 25 | -------------------------------------------------------------------------------- /tests/integration/components/sl-modal-body-test.js: -------------------------------------------------------------------------------- 1 | import hbs from 'htmlbars-inline-precompile'; 2 | import { moduleForComponent, test } from 'ember-qunit'; 3 | 4 | moduleForComponent( 'sl-modal-body', 'Integration | Component | sl modal body', { 5 | integration: true 6 | }); 7 | 8 | test( 'Default rendered state', function( assert ) { 9 | this.render( hbs` 10 | {{sl-modal-body}} 11 | ` ); 12 | 13 | assert.ok( 14 | this.$( '>:first-child' ).hasClass( 'sl-ember-components-modal-body' ), 15 | 'Component has class "sl-ember-components-modal-body"' 16 | ); 17 | 18 | assert.ok( 19 | this.$( '>:first-child' ).hasClass( 'modal-body' ), 20 | 'Component has class "modal-body"' 21 | ); 22 | }); 23 | 24 | test( 'Content is yielded', function( assert ) { 25 | this.render( hbs` 26 | {{#sl-modal-body}} 27 |
    28 | {{/sl-modal-body}}` 29 | ); 30 | 31 | assert.strictEqual( 32 | this.$( '>:first-child' ).find( '.test' ).length, 33 | 1 34 | ); 35 | }); 36 | -------------------------------------------------------------------------------- /tests/integration/components/sl-modal-footer-test.js: -------------------------------------------------------------------------------- 1 | import hbs from 'htmlbars-inline-precompile'; 2 | import { moduleForComponent, test } from 'ember-qunit'; 3 | 4 | moduleForComponent( 'sl-modal-footer', 'Integration | Component | sl modal footer', { 5 | integration: true 6 | }); 7 | 8 | test( 'Default rendered state', function( assert ) { 9 | this.render( hbs` 10 | {{sl-modal-footer}} 11 | ` ); 12 | 13 | assert.ok( 14 | this.$( '>:first-child' ).hasClass( 'sl-ember-components-modal-footer' ), 15 | 'Component has class "sl-ember-components-modal-footer"' 16 | ); 17 | 18 | assert.ok( 19 | this.$( '>:first-child' ).hasClass( 'modal-footer' ), 20 | 'Component has class "modal-footer"' 21 | ); 22 | }); 23 | 24 | test( 'Content is yielded', function( assert ) { 25 | this.render( hbs` 26 | {{#sl-modal-footer}} 27 |
    28 | {{/sl-modal-footer}} 29 | ` ); 30 | 31 | assert.strictEqual( 32 | this.$( '>:first-child' ).find( '.test' ).length, 33 | 1, 34 | 'Content is yielded correctly' 35 | ); 36 | 37 | this.render( hbs` 38 | {{sl-modal-footer}} 39 | ` ); 40 | 41 | assert.ok( 42 | this.$( '>:first-child' ).find( '[data-dismiss="modal"]' ).length > 0, 43 | 'Default footer content and button rendered when not yielded' 44 | ); 45 | }); 46 | 47 | test( 'Close button text is customizable', function( assert ) { 48 | const buttonText = 'Custom Close Text'; 49 | 50 | this.set( 'buttonText', buttonText ); 51 | 52 | this.render( hbs` 53 | {{sl-modal-footer buttonText=buttonText}} 54 | ` ); 55 | 56 | assert.strictEqual( 57 | this.$( '>:first-child' ).find( 'button[data-dismiss="modal"]' ).text().trim(), 58 | buttonText 59 | ); 60 | }); 61 | -------------------------------------------------------------------------------- /tests/integration/components/sl-modal-header-test.js: -------------------------------------------------------------------------------- 1 | import hbs from 'htmlbars-inline-precompile'; 2 | import { moduleForComponent, test } from 'ember-qunit'; 3 | 4 | moduleForComponent( 'sl-modal-header', 'Integration | Component | sl modal header', { 5 | integration: true 6 | }); 7 | 8 | test( 'Default rendered state', function( assert ) { 9 | this.render( hbs` 10 | {{sl-modal-header}} 11 | ` ); 12 | 13 | assert.ok( 14 | this.$( '>:first-child' ).hasClass( 'sl-ember-components-modal-header' ), 15 | 'Component has class "sl-ember-components-modal-header"' 16 | ); 17 | 18 | assert.ok( 19 | this.$( '>:first-child' ).hasClass( 'modal-header' ), 20 | 'Component has class "modal-header"' 21 | ); 22 | 23 | assert.ok( 24 | this.$( '>:first-child' ).find( '[data-dismiss="modal"]' ).length > 0, 25 | 'Default header content and close button rendered' 26 | ); 27 | }); 28 | 29 | test( 'Setting title on header works', function( assert ) { 30 | const title = 'hello world'; 31 | 32 | this.set( 'title', title ); 33 | 34 | this.render( hbs` 35 | {{sl-modal-header title=title}} 36 | ` ); 37 | 38 | assert.strictEqual( 39 | this.$( '>:first-child' ).find( '.modal-title' ).text(), 40 | title 41 | ); 42 | }); 43 | 44 | test( 'Component may be used as block', function( assert ) { 45 | this.render( hbs` 46 | {{#sl-modal-header}} 47 |
    48 | {{/sl-modal-header}} 49 | ` ); 50 | 51 | assert.strictEqual( 52 | this.$( '>:first-child' ).find( '.test' ).length, 53 | 1, 54 | 'Content is yielded correctly' 55 | ); 56 | }); 57 | 58 | test( 'Modal title\'s id is set to ariaLabelledBy property value', function( assert ) { 59 | this.set( 'title', 'label test' ); 60 | this.set( 'ariaLabelledBy', 'initial value' ); 61 | 62 | this.render( hbs` 63 | {{sl-modal-header title=title ariaLabelledBy=ariaLabelledBy}} 64 | ` ); 65 | 66 | assert.strictEqual( 67 | this.$( '>:first-child' ).find( '.modal-title' ).prop( 'id' ), 68 | this.get( 'ariaLabelledBy' ) 69 | ); 70 | }); 71 | -------------------------------------------------------------------------------- /tests/integration/components/sl-panel-test.js: -------------------------------------------------------------------------------- 1 | import { moduleForComponent, test } from 'ember-qunit'; 2 | import hbs from 'htmlbars-inline-precompile'; 3 | 4 | moduleForComponent( 'sl-panel', 'Integration | Component | sl panel', { 5 | integration: true 6 | }); 7 | 8 | test( 'Default rendered state', function( assert ) { 9 | this.render( hbs` 10 | {{sl-panel}} 11 | ` ); 12 | 13 | assert.ok( 14 | this.$( '>:first-child' ).hasClass( 'sl-ember-components-panel' ), 15 | 'Default rendered component has class "sl-ember-components-panel"' 16 | ); 17 | 18 | assert.ok( 19 | this.$( '>:first-child' ).hasClass( 'panel' ), 20 | 'Default rendered component has class "panel"' 21 | ); 22 | 23 | assert.ok( 24 | this.$( '>:first-child' ).hasClass( 'panel-default' ), 25 | 'Default rendered component has class "panel-default"' 26 | ); 27 | 28 | const panelBody = this.$( '>:first-child' ).find( '> .panel-body' ); 29 | 30 | assert.strictEqual( 31 | panelBody.length, 32 | 1, 33 | 'Default rendered component has child with class "panel-body"' 34 | ); 35 | }); 36 | 37 | test( 'Valid heading value renders panel-heading', function( assert ) { 38 | this.render( hbs` 39 | {{sl-panel heading="Test"}} 40 | ` ); 41 | 42 | assert.strictEqual( 43 | this.$( '>:first-child' ).find( '.panel-heading' ).length, 44 | 1, 45 | 'Rendered component has panel-heading text' 46 | ); 47 | 48 | assert.strictEqual( 49 | this.$( '>:first-child' ).find( '.panel-heading' ).text(), 50 | 'Test', 51 | 'Text of rendered heading is equal to value passed to it' 52 | ); 53 | }); 54 | 55 | test( 'Loading state applies class name', function( assert ) { 56 | this.render( hbs` 57 | {{sl-panel loading=true}} 58 | ` ); 59 | 60 | assert.ok( 61 | this.$( '>:first-child' ).find( '> .panel-body' ).hasClass( 'sl-loading' ), 62 | 'Rendered component body has class "sl-loading"' 63 | ); 64 | }); 65 | 66 | test( 'Content is yielded', function( assert ) { 67 | this.render( hbs` 68 | {{#sl-panel}} 69 |
    70 | {{/sl-panel}} 71 | ` ); 72 | 73 | assert.strictEqual( 74 | this.$( '>:first-child' ).find( '.yield-test' ).length, 75 | 1, 76 | 'Content yields successfully' 77 | ); 78 | }); 79 | -------------------------------------------------------------------------------- /tests/integration/components/sl-radio-test.js: -------------------------------------------------------------------------------- 1 | import { moduleForComponent, test } from 'ember-qunit'; 2 | import hbs from 'htmlbars-inline-precompile'; 3 | 4 | const defaultTemplate = hbs` 5 | {{sl-radio}} 6 | `; 7 | 8 | moduleForComponent( 'sl-radio', 'Integration | Component | sl radio', { 9 | integration: true 10 | }); 11 | 12 | test( 'Default rendered state', function( assert ) { 13 | this.render( defaultTemplate ); 14 | 15 | assert.ok( 16 | this.$( '>:first-child' ).hasClass( 'form-group' ), 17 | 'Has class "form-group"' 18 | ); 19 | 20 | assert.ok( 21 | this.$( '>:first-child' ).hasClass( 'sl-ember-components-radio' ), 22 | 'Has class "sl-ember-components-radio"' 23 | ); 24 | 25 | assert.ok( 26 | this.$( '>:first-child' ).hasClass( 'radio' ), 27 | 'Has class "radio"' 28 | ); 29 | 30 | assert.strictEqual( 31 | this.$( '>:first-child' ).find( 'input[type="radio"]' ).length, 32 | 1, 33 | 'input type is set to "radio"' 34 | ); 35 | }); 36 | 37 | test( 'Disabled state applies disabled class, and attribute to input', function( assert ) { 38 | this.render( hbs` 39 | {{sl-radio disabled=true}} 40 | ` ); 41 | 42 | assert.ok( 43 | this.$( '>:first-child' ).find( 'input' ).prop( 'disabled' ), 44 | 'has attribute "disabled"' 45 | ); 46 | 47 | assert.ok( 48 | this.$( '>:first-child' ).hasClass( 'disabled' ), 49 | 'has class "disabled"' 50 | ); 51 | }); 52 | 53 | test( 'Inline property sets relevant class', function( assert ) { 54 | this.render( hbs` 55 | {{sl-radio inline=true}} 56 | ` ); 57 | 58 | assert.ok( 59 | this.$( '>:first-child' ).hasClass( 'radio-inline' ), 60 | 'has class "radio-inline"' 61 | ); 62 | 63 | assert.notOk( 64 | this.$( '>:first-child' ).hasClass( 'form-group' ), 65 | 'inline radio does not have class "form-group"' 66 | ); 67 | }); 68 | 69 | test( 'name applies property to input', function( assert ) { 70 | this.render( defaultTemplate ); 71 | 72 | assert.strictEqual( 73 | this.$( '>:first-child' ).find( 'input' ).prop( 'name' ), 74 | '', 75 | 'Rendered input has empty name' 76 | ); 77 | 78 | this.render( hbs` 79 | {{sl-radio name="testname"}} 80 | ` ); 81 | 82 | assert.strictEqual( 83 | this.$( '>:first-child' ).find( 'input' ).prop( 'name' ), 84 | 'testname', 85 | 'Rendered input has name set' 86 | ); 87 | }); 88 | 89 | test( '"value" property is supported', function( assert ) { 90 | this.render( hbs` 91 | {{sl-radio value="testValue"}} 92 | ` ); 93 | 94 | assert.strictEqual( 95 | this.$( '>:first-child' ).find( 'input' ).val(), 96 | 'testValue', 97 | '"value" is set' 98 | ); 99 | }); 100 | 101 | test( '"label" property is supported', function( assert ) { 102 | this.render( hbs` 103 | {{sl-radio label="testLabel"}} 104 | ` ); 105 | 106 | assert.strictEqual( 107 | this.$( '>:first-child' ).find( 'label' ).text().trim(), 108 | 'testLabel', 109 | '"label" text gets set' 110 | ); 111 | }); 112 | -------------------------------------------------------------------------------- /tests/integration/components/sl-span-test.js: -------------------------------------------------------------------------------- 1 | import { moduleForComponent, test } from 'ember-qunit'; 2 | import hbs from 'htmlbars-inline-precompile'; 3 | 4 | moduleForComponent( 'sl-span', 'Integration | Component | sl span', { 5 | integration: true 6 | }); 7 | 8 | test( 'Default rendered state', function( assert ) { 9 | this.render( hbs` 10 | {{sl-span}} 11 | ` ); 12 | 13 | assert.ok( 14 | this.$( '>:first-child' ).hasClass( 'sl-ember-components-span' ), 15 | 'Has class "sl-ember-components-span"' 16 | ); 17 | 18 | assert.strictEqual( 19 | this.$( '>:first-child' ).text().trim(), 20 | '', 21 | '"value" defaults to null' 22 | ); 23 | }); 24 | 25 | test( 'Content is yielded', function( assert ) { 26 | this.render( hbs` 27 | {{#sl-span}} 28 | Some yielded text 29 | {{/sl-span}} 30 | ` ); 31 | 32 | assert.strictEqual( 33 | this.$( '>:first-child' ).text().trim(), 34 | 'Some yielded text', 35 | 'Content yields successfully' 36 | ); 37 | }); 38 | 39 | test( '"value" property is supported', function( assert ) { 40 | this.render( hbs` 41 | {{sl-span value="value text"}} 42 | ` ); 43 | 44 | assert.strictEqual( 45 | this.$( '>:first-child' ).text().trim(), 46 | 'value text', 47 | '"value" text is displayed' 48 | ); 49 | }); 50 | 51 | test( '"value" property overrides yield', function( assert ) { 52 | this.render( hbs` 53 | {{#sl-span value="value text"}} 54 | Some yielded text 55 | {{/sl-span}} 56 | ` ); 57 | 58 | assert.strictEqual( 59 | this.$( '>:first-child' ).text().trim(), 60 | 'value text', 61 | '"value" text is displayed instead of yield' 62 | ); 63 | }); 64 | 65 | test( 'loading property applies loading class', function( assert ) { 66 | this.render( hbs` 67 | {{sl-span}} 68 | ` ); 69 | 70 | assert.notOk( 71 | this.$( '>:first-child' ).hasClass( 'sl-loading' ), 72 | 'Component does not have class "sl-loading"' 73 | ); 74 | 75 | this.render( hbs` 76 | {{sl-span loading=true}} 77 | ` ); 78 | 79 | assert.ok( 80 | this.$( '>:first-child' ).hasClass( 'sl-loading' ), 81 | 'Component has class "sl-loading"' 82 | ); 83 | }); 84 | 85 | test( 'inverse property applies inverse class', function( assert ) { 86 | this.render( hbs` 87 | {{sl-span}} 88 | ` ); 89 | 90 | assert.notOk( 91 | this.$( '>:first-child' ).hasClass( 'inverse' ), 92 | 'Component does not have class "inverse"' 93 | ); 94 | 95 | this.render( hbs` 96 | {{sl-span inverse=true}} 97 | ` ); 98 | 99 | assert.ok( 100 | this.$( '>:first-child' ).hasClass( 'inverse' ), 101 | 'Component has class "inverse"' 102 | ); 103 | }); 104 | -------------------------------------------------------------------------------- /tests/integration/components/sl-tab-pane-test.js: -------------------------------------------------------------------------------- 1 | import { moduleForComponent, test } from 'ember-qunit'; 2 | import hbs from 'htmlbars-inline-precompile'; 3 | 4 | moduleForComponent( 'sl-tab-pane', 'Integration | Component | sl tab pane', { 5 | integration: true 6 | }); 7 | 8 | test( 'Default rendered state', function( assert ) { 9 | 10 | const label = 'Test Label'; 11 | this.set( 'labelTest', label ); 12 | 13 | const name = 'Test Name'; 14 | this.set( 'nameTest', name ); 15 | 16 | this.render( hbs` 17 | {{sl-tab-pane 18 | label=labelTest 19 | name=nameTest 20 | }} 21 | ` ); 22 | 23 | assert.ok( 24 | this.$( '>:first-child' ).hasClass( 'tab-pane' ), 25 | 'Has class "tab-pane"' 26 | ); 27 | 28 | assert.strictEqual( 29 | this.$( '>:first-child' ).attr( 'data-tab-label' ), 30 | label, 31 | 'Data tab label is set properly' 32 | ); 33 | 34 | assert.strictEqual( 35 | this.$( '>:first-child' ).attr( 'data-tab-name' ), 36 | name, 37 | 'Data tab name is set properly' 38 | ); 39 | }); 40 | 41 | test( 'Yielded content passes through', function( assert ) { 42 | 43 | this.render( hbs` 44 | {{#sl-tab-pane}} 45 | A content 46 | {{/sl-tab-pane}} 47 | ` ); 48 | 49 | assert.strictEqual( 50 | this.$( '>:first-child' ).text().trim(), 51 | 'A content', 52 | 'Expected content is present' 53 | ); 54 | }); 55 | -------------------------------------------------------------------------------- /tests/integration/components/sl-tooltip-test.js: -------------------------------------------------------------------------------- 1 | import { moduleForComponent, test } from 'ember-qunit'; 2 | import hbs from 'htmlbars-inline-precompile'; 3 | 4 | moduleForComponent( 'sl-tooltip', 'Integration | Component | sl tooltip', { 5 | integration: true 6 | }); 7 | 8 | test( 'Default rendered state', function( assert ) { 9 | this.set( 'title', 'test title' ); 10 | 11 | this.render( hbs` 12 | {{sl-tooltip title=title}} 13 | ` ); 14 | 15 | assert.ok( 16 | this.$( '>:first-child' ).hasClass( 'sl-ember-components-tooltip' ), 17 | 'Has class "sl-ember-components-tooltip"' 18 | ); 19 | }); 20 | 21 | test( '"Title" capabilities are supported', function( assert ) { 22 | this.set( 'title', 'test title' ); 23 | 24 | this.render( hbs` 25 | {{sl-tooltip title=title}} 26 | ` ); 27 | 28 | assert.strictEqual( 29 | this.$( '>:first-child' ).attr( 'data-original-title' ), 30 | this.get( 'title' ), 31 | 'Title prop supported' 32 | ); 33 | }); 34 | 35 | test( '"Popover" capabilities are supported', function( assert ) { 36 | this.set( 'popover', 'Popover content' ); 37 | this.set( 'title', 'test title' ); 38 | 39 | this.render( hbs` 40 | {{sl-tooltip title=title popover=popover}} 41 | ` ); 42 | 43 | assert.strictEqual( 44 | this.$( '>:first-child' ).data( 'bs.popover' ).options.content, 45 | this.get( 'popover' ), 46 | 'Popover capabilites are supported' 47 | ); 48 | }); 49 | -------------------------------------------------------------------------------- /tests/test-helper.js: -------------------------------------------------------------------------------- 1 | import resolver from './helpers/resolver'; 2 | import { setResolver } from 'ember-qunit'; 3 | 4 | setResolver( resolver ); 5 | -------------------------------------------------------------------------------- /tests/unit/components/sl-calendar-month-test.js: -------------------------------------------------------------------------------- 1 | import { moduleForComponent, test } from 'ember-qunit'; 2 | import globalLibraries from '../../helpers/sl/synchronous/global-libraries'; 3 | 4 | moduleForComponent( 5 | 'sl-calendar-month', 6 | 'Unit | Component | sl calendar month', { 7 | unit: true 8 | } 9 | ); 10 | 11 | test( 'Default state is inactive', function( assert ) { 12 | const component = this.subject(); 13 | 14 | assert.strictEqual( 15 | component.get( 'active' ), 16 | false, 17 | 'Component is not active' 18 | ); 19 | 20 | assert.strictEqual( 21 | this.$().hasClass( 'active' ), 22 | false, 23 | 'Component does not have "active" class' 24 | ); 25 | }); 26 | 27 | test( 'Active state is set correctly', function( assert ) { 28 | const component = this.subject({ active: true }); 29 | 30 | assert.ok( 31 | component.get( 'active' ), 32 | 'Component is active' 33 | ); 34 | 35 | assert.ok( 36 | this.$().hasClass( 'active' ), 37 | '"active" class is present' 38 | ); 39 | }); 40 | 41 | test( 'Action binding sends action with month', function( assert ) { 42 | this.subject({ 43 | action: 'test', 44 | month: 6, 45 | targetObject: { 46 | test( month ) { 47 | assert.strictEqual( 48 | month, 49 | 6, 50 | 'Test action fired with expected month' 51 | ); 52 | } 53 | } 54 | }); 55 | 56 | assert.expect( 1 ); 57 | 58 | this.$().trigger( 'click' ); 59 | }); 60 | 61 | test( 'Short name property is invalid without month', function( assert ) { 62 | const component = this.subject(); 63 | 64 | assert.strictEqual( 65 | component.get( 'shortName' ), 66 | 'Invalid date', 67 | 'Invalid month results in invalid shortName' 68 | ); 69 | }); 70 | 71 | test( 'Short name property is defined with valid month', function( assert ) { 72 | const component = this.subject({ month: 1 }); 73 | 74 | assert.strictEqual( 75 | component.get( 'shortName' ), 76 | 'Jan', 77 | 'Valid shortName with valid month' 78 | ); 79 | }); 80 | 81 | test( 'Dependent keys are correct', function( assert ) { 82 | const component = this.subject(); 83 | 84 | const shortNameDependentKeys = [ 85 | 'month' 86 | ]; 87 | 88 | assert.deepEqual( 89 | component.shortName._dependentKeys, 90 | shortNameDependentKeys, 91 | 'Dependent keys are correct for shortName()' 92 | ); 93 | }); 94 | 95 | test( 'There are no references to Ember.$, $ or jQuery', function( assert ) { 96 | globalLibraries.setupSpies(); 97 | 98 | const component = this.subject(); 99 | 100 | this.render(); 101 | 102 | globalLibraries.triggerEvents( component ); 103 | 104 | assert.notOk( 105 | globalLibraries.called(), 106 | 'Global libraries are not referenced in component' 107 | ); 108 | 109 | globalLibraries.restoreSpies(); 110 | }); 111 | -------------------------------------------------------------------------------- /tests/unit/components/sl-calendar-year-test.js: -------------------------------------------------------------------------------- 1 | import { moduleForComponent, test } from 'ember-qunit'; 2 | import globalLibraries from '../../helpers/sl/synchronous/global-libraries'; 3 | 4 | moduleForComponent( 'sl-calendar-year', 'Unit | Component | sl calendar year', { 5 | unit: true 6 | }); 7 | 8 | test( 'Default state is not active, new, or old', function( assert ) { 9 | const component = this.subject(); 10 | 11 | assert.strictEqual( 12 | component.get( 'active' ), 13 | false, 14 | 'Default component is not active' 15 | ); 16 | 17 | assert.strictEqual( 18 | component.get( 'new' ), 19 | false, 20 | 'Default component is not in new state' 21 | ); 22 | 23 | assert.strictEqual( 24 | component.get( 'old' ), 25 | false, 26 | 'Default component is not in old state' 27 | ); 28 | 29 | assert.strictEqual( 30 | this.$().hasClass( 'active' ), 31 | false, 32 | 'Default rendered component does not have class "active"' 33 | ); 34 | 35 | assert.strictEqual( 36 | this.$().hasClass( 'new' ), 37 | false, 38 | 'Default rendered component does not have class "new"' 39 | ); 40 | 41 | assert.strictEqual( 42 | this.$().hasClass( 'old' ), 43 | false, 44 | 'Default rendered component does not have class "old"' 45 | ); 46 | }); 47 | 48 | test( 'Click event sends action with year value', function( assert ) { 49 | assert.expect( 1 ); 50 | 51 | const done = assert.async(); 52 | 53 | const exampleYear = 2000; 54 | 55 | this.subject({ 56 | action: 'test', 57 | 58 | targetObject: { 59 | test: ( year ) => { 60 | assert.strictEqual( 61 | year, 62 | exampleYear, 63 | 'Received year' 64 | ); 65 | 66 | done(); 67 | } 68 | }, 69 | 70 | year: exampleYear 71 | }); 72 | 73 | this.$().trigger( 'click' ); 74 | }); 75 | 76 | test( 'There are no references to Ember.$, $ or jQuery', function( assert ) { 77 | globalLibraries.setupSpies(); 78 | 79 | const component = this.subject(); 80 | 81 | this.render(); 82 | 83 | globalLibraries.triggerEvents( component ); 84 | 85 | assert.notOk( 86 | globalLibraries.called(), 87 | 'Global libraries are not referenced in component' 88 | ); 89 | 90 | globalLibraries.restoreSpies(); 91 | }); 92 | -------------------------------------------------------------------------------- /tests/unit/components/sl-drop-option-test.js: -------------------------------------------------------------------------------- 1 | import ClassPrefix from 'sl-ember-components/mixins/class-prefix'; 2 | import sinon from 'sinon'; 3 | import { moduleForComponent, test } from 'ember-qunit'; 4 | import globalLibraries from '../../helpers/sl/synchronous/global-libraries'; 5 | 6 | moduleForComponent( 'sl-drop-option', 'Unit | Component | sl drop option', { 7 | unit: true 8 | }); 9 | 10 | test( 'Expected Mixins are present', function( assert ) { 11 | assert.ok( 12 | ClassPrefix.detect( this.subject() ), 13 | 'ClassPrefix Mixin is present' 14 | ); 15 | }); 16 | 17 | test( 'Default property values', function( assert ) { 18 | const component = this.subject(); 19 | 20 | assert.strictEqual( 21 | component.get( 'componentClass' ), 22 | 'drop-option', 23 | 'componentClass is set to drop-option' 24 | ); 25 | 26 | assert.strictEqual( 27 | component.get( 'data' ), 28 | null, 29 | '"Data" property defaults to null' 30 | ); 31 | 32 | assert.strictEqual( 33 | component.get( 'actionContext' ), 34 | null, 35 | '"Actioncontext" property defaults to null' 36 | ); 37 | 38 | assert.strictEqual( 39 | component.get( 'tagName' ), 40 | 'li', 41 | '"tagName" property defaults to li' 42 | ); 43 | }); 44 | 45 | test( 'Click triggers bound action with correct arguments', function( assert ) { 46 | const testDataObject = { 47 | testProp: 'testValue' 48 | }; 49 | 50 | const testActionSpy = sinon.spy(); 51 | 52 | this.subject({ 53 | action: 'testAction', 54 | actionContext: 'testActionContext', 55 | data: testDataObject, 56 | label: 'Test', 57 | targetObject: { 58 | testAction: testActionSpy 59 | } 60 | }); 61 | 62 | this.$( 'a' ).trigger( 'click' ); 63 | 64 | // spy.calledWith() does a deepEquals on objects 65 | assert.ok( 66 | testActionSpy.calledWith( testDataObject, 'testActionContext' ), 67 | 'Test action fired correctly with the correct arguments' 68 | ); 69 | }); 70 | 71 | test( 'There are no references to Ember.$, $ or jQuery', function( assert ) { 72 | globalLibraries.setupSpies(); 73 | 74 | const component = this.subject(); 75 | 76 | this.render(); 77 | 78 | globalLibraries.triggerEvents( component ); 79 | 80 | assert.notOk( 81 | globalLibraries.called(), 82 | 'Global libraries are not referenced in component' 83 | ); 84 | 85 | globalLibraries.restoreSpies(); 86 | }); 87 | -------------------------------------------------------------------------------- /tests/unit/components/sl-grid-row-test.js: -------------------------------------------------------------------------------- 1 | import { moduleForComponent, test } from 'ember-qunit'; 2 | import globalLibraries from '../../helpers/sl/synchronous/global-libraries'; 3 | 4 | moduleForComponent( 'sl-grid-row', 'Unit | Component | sl grid row', { 5 | unit: true 6 | }); 7 | 8 | test( 'Default property values', function( assert ) { 9 | const component = this.subject(); 10 | 11 | assert.strictEqual( 12 | component.get( 'tagName' ), 13 | 'tr', 14 | 'tagName is tr' 15 | ); 16 | 17 | assert.strictEqual( 18 | component.get( 'record' ), 19 | null, 20 | 'record is null' 21 | ); 22 | }); 23 | 24 | test( 'Click event triggers rowClick action with row record', function( assert ) { 25 | const record = { testValue: true }; 26 | 27 | this.subject({ 28 | record, 29 | onClick: 'test', 30 | 31 | targetObject: { 32 | test( passedRow ) { 33 | assert.equal( 34 | passedRow.record, 35 | record, 36 | 'Row record passed from onClick is expected value' 37 | ); 38 | } 39 | } 40 | }); 41 | 42 | this.$().trigger( 'click' ); 43 | }); 44 | 45 | test( 'There are no references to Ember.$, $ or jQuery', function( assert ) { 46 | globalLibraries.setupSpies(); 47 | 48 | const component = this.subject(); 49 | 50 | this.render(); 51 | 52 | globalLibraries.triggerEvents( component ); 53 | 54 | assert.notOk( 55 | globalLibraries.called(), 56 | 'Global libraries are not referenced in component' 57 | ); 58 | 59 | globalLibraries.restoreSpies(); 60 | }); 61 | -------------------------------------------------------------------------------- /tests/unit/components/sl-menu-item-show-all-test.js: -------------------------------------------------------------------------------- 1 | import { moduleForComponent, test } from 'ember-qunit'; 2 | import globalLibraries from '../../helpers/sl/synchronous/global-libraries'; 3 | 4 | moduleForComponent( 'sl-menu-item-show-all', 'Unit | Component | sl menu item show all', { 5 | unit: true 6 | }); 7 | 8 | test( 'There are no references to Ember.$, $ or jQuery', function( assert ) { 9 | globalLibraries.setupSpies(); 10 | 11 | const component = this.subject(); 12 | 13 | this.render(); 14 | 15 | globalLibraries.triggerEvents( component ); 16 | 17 | assert.notOk( 18 | globalLibraries.called(), 19 | 'Global libraries are not referenced in component' 20 | ); 21 | 22 | globalLibraries.restoreSpies(); 23 | }); 24 | -------------------------------------------------------------------------------- /tests/unit/components/sl-modal-body-test.js: -------------------------------------------------------------------------------- 1 | import ClassPrefix from 'sl-ember-components/mixins/class-prefix'; 2 | import globalLibraries from '../../helpers/sl/synchronous/global-libraries'; 3 | import { moduleForComponent, test } from 'ember-qunit'; 4 | 5 | moduleForComponent( 'sl-modal-body', 'Unit | Component | sl modal body', { 6 | unit: true 7 | }); 8 | 9 | test( 'Expected Mixins are present', function( assert ) { 10 | assert.ok( 11 | ClassPrefix.detect( this.subject() ), 12 | 'ClassPrefix Mixin is present' 13 | ); 14 | }); 15 | 16 | test( 'Default property values are set correctly', function( assert ) { 17 | const component = this.subject(); 18 | 19 | assert.strictEqual( 20 | component.get( 'componentClass' ), 21 | 'modal-body', 22 | 'componentClass is set to modal-body' 23 | ); 24 | }); 25 | 26 | test( 'There are no references to Ember.$, $ or jQuery', function( assert ) { 27 | globalLibraries.setupSpies(); 28 | 29 | const component = this.subject(); 30 | 31 | this.render(); 32 | 33 | globalLibraries.triggerEvents( component ); 34 | 35 | assert.notOk( 36 | globalLibraries.called(), 37 | 'Global libraries are not referenced in component' 38 | ); 39 | 40 | globalLibraries.restoreSpies(); 41 | }); 42 | -------------------------------------------------------------------------------- /tests/unit/components/sl-modal-footer-test.js: -------------------------------------------------------------------------------- 1 | import ClassPrefix from 'sl-ember-components/mixins/class-prefix'; 2 | import { moduleForComponent, test } from 'ember-qunit'; 3 | import globalLibraries from '../../helpers/sl/synchronous/global-libraries'; 4 | 5 | moduleForComponent( 'sl-modal-footer', 'Unit | Component | sl modal footer', { 6 | unit: true 7 | }); 8 | 9 | test( 'Default property values', function( assert ) { 10 | const component = this.subject(); 11 | 12 | assert.strictEqual( 13 | component.get( 'buttonText' ), 14 | 'Close', 15 | 'Default buttonText is "Close"' 16 | ); 17 | 18 | assert.ok( 19 | ClassPrefix.detect( this.subject() ), 20 | 'ClassPrefix Mixin is present' 21 | ); 22 | }); 23 | 24 | test( 'Default property values are set correctly', function( assert ) { 25 | const component = this.subject(); 26 | 27 | assert.strictEqual( 28 | component.get( 'componentClass' ), 29 | 'modal-footer', 30 | 'componentClass is set to modal-footer' 31 | ); 32 | }); 33 | 34 | test( 'There are no references to Ember.$, $ or jQuery', function( assert ) { 35 | globalLibraries.setupSpies(); 36 | 37 | const component = this.subject(); 38 | 39 | this.render(); 40 | 41 | globalLibraries.triggerEvents( component ); 42 | 43 | assert.notOk( 44 | globalLibraries.called(), 45 | 'Global libraries are not referenced in component' 46 | ); 47 | 48 | globalLibraries.restoreSpies(); 49 | }); 50 | -------------------------------------------------------------------------------- /tests/unit/components/sl-modal-header-test.js: -------------------------------------------------------------------------------- 1 | import { moduleForComponent, test } from 'ember-qunit'; 2 | import globalLibraries from '../../helpers/sl/synchronous/global-libraries'; 3 | 4 | moduleForComponent( 'sl-modal-header', 'Unit | Component | sl modal header', { 5 | unit: true 6 | }); 7 | 8 | test( 'There are no references to Ember.$, $ or jQuery', function( assert ) { 9 | globalLibraries.setupSpies(); 10 | 11 | const component = this.subject(); 12 | 13 | this.render(); 14 | 15 | globalLibraries.triggerEvents( component ); 16 | 17 | assert.notOk( 18 | globalLibraries.called(), 19 | 'Global libraries are not referenced in component' 20 | ); 21 | 22 | globalLibraries.restoreSpies(); 23 | }); 24 | -------------------------------------------------------------------------------- /tests/unit/components/sl-panel-test.js: -------------------------------------------------------------------------------- 1 | import ClassPrefix from 'sl-ember-components/mixins/class-prefix'; 2 | import { moduleForComponent, test } from 'ember-qunit'; 3 | import globalLibraries from '../../helpers/sl/synchronous/global-libraries'; 4 | 5 | moduleForComponent( 'sl-panel', 'Unit | Component | sl panel', { 6 | unit: true 7 | }); 8 | 9 | test( 'Expected Mixins are present', function( assert ) { 10 | assert.ok( 11 | ClassPrefix.detect( this.subject() ), 12 | 'ClassPrefix Mixin is present' 13 | ); 14 | }); 15 | 16 | test( 'Default property values', function( assert ) { 17 | const component = this.subject(); 18 | 19 | assert.strictEqual( 20 | component.get( 'componentClass' ), 21 | 'panel', 22 | 'componentClass is set to panel' 23 | ); 24 | 25 | assert.strictEqual( 26 | component.get( 'heading' ), 27 | null, 28 | 'Default heading value is null' 29 | ); 30 | 31 | assert.strictEqual( 32 | component.get( 'loading' ), 33 | false, 34 | 'Default loading value is null' 35 | ); 36 | }); 37 | 38 | test( 'There are no references to Ember.$, $ or jQuery', function( assert ) { 39 | globalLibraries.setupSpies(); 40 | 41 | const component = this.subject(); 42 | 43 | this.render(); 44 | 45 | globalLibraries.triggerEvents( component ); 46 | 47 | assert.notOk( 48 | globalLibraries.called(), 49 | 'Global libraries are not referenced in component' 50 | ); 51 | 52 | globalLibraries.restoreSpies(); 53 | }); 54 | -------------------------------------------------------------------------------- /tests/unit/components/sl-radio-test.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import ClassPrefix from 'sl-ember-components/mixins/class-prefix'; 3 | import InputBasedMixin from 'sl-ember-components/mixins/sl-input-based'; 4 | import{ moduleForComponent, test } from 'ember-qunit'; 5 | import globalLibraries from '../../helpers/sl/synchronous/global-libraries'; 6 | 7 | moduleForComponent( 'sl-radio', 'Unit | Component | sl radio', { 8 | unit: true 9 | }); 10 | 11 | test( 'Expected Mixins are present', function( assert ) { 12 | assert.ok( 13 | ClassPrefix.detect( this.subject() ), 14 | 'ClassPrefix Mixin is present' 15 | ); 16 | 17 | assert.ok( 18 | InputBasedMixin.detect( this.subject() ), 19 | 'InputBased Mixin is present' 20 | ); 21 | }); 22 | 23 | test( 'Default property values', function( assert ) { 24 | const component = this.subject(); 25 | 26 | assert.strictEqual( 27 | component.get( 'componentClass' ), 28 | 'radio', 29 | 'ComponentClass is set to radio' 30 | ); 31 | 32 | assert.strictEqual( 33 | component.get( 'label' ), 34 | null, 35 | 'Default property "label" is null' 36 | ); 37 | 38 | assert.strictEqual( 39 | component.get( 'tagName' ), 40 | 'div', 41 | 'tagName is "div" in default state' 42 | ); 43 | 44 | assert.strictEqual( 45 | component.get( 'value' ), 46 | null, 47 | 'Default property "value" is null' 48 | ); 49 | }); 50 | 51 | test( 'radioType property sets relevant class', function( assert ) { 52 | const component = this.subject(); 53 | 54 | assert.strictEqual( 55 | component.get( 'radioType' ), 56 | 'radio', 57 | 'RadioType defaults to "radio"' 58 | ); 59 | 60 | Ember.run( () => { 61 | component.set( 'inline', true ); 62 | }); 63 | 64 | assert.strictEqual( 65 | component.get( 'radioType' ), 66 | 'radio-inline', 67 | 'RadioType is inline' 68 | ); 69 | }); 70 | 71 | test( 'inline property changes tagName', function( assert ) { 72 | const component = this.subject({ 73 | inline: true 74 | }); 75 | 76 | assert.strictEqual( 77 | component.get( 'tagName' ), 78 | 'label', 79 | 'tagName is "label" when component is inline' 80 | ); 81 | }); 82 | 83 | test( 'Dependent keys are correct', function( assert ) { 84 | const component = this.subject(); 85 | 86 | const radioTypeDependentKeys = [ 87 | 'inline' 88 | ]; 89 | 90 | assert.deepEqual( 91 | component.radioType._dependentKeys, 92 | radioTypeDependentKeys, 93 | 'Dependent keys are correct for radioType()' 94 | ); 95 | }); 96 | 97 | test( 'There are no references to Ember.$, $ or jQuery', function( assert ) { 98 | globalLibraries.setupSpies(); 99 | 100 | const component = this.subject(); 101 | 102 | this.render(); 103 | 104 | globalLibraries.triggerEvents( component ); 105 | 106 | assert.notOk( 107 | globalLibraries.called(), 108 | 'Global libraries are not referenced in component' 109 | ); 110 | 111 | globalLibraries.restoreSpies(); 112 | }); 113 | -------------------------------------------------------------------------------- /tests/unit/components/sl-select-test.js: -------------------------------------------------------------------------------- 1 | import { moduleForComponent, test } from 'ember-qunit'; 2 | import globalLibraries from '../../helpers/sl/synchronous/global-libraries'; 3 | 4 | moduleForComponent( 'sl-select', 'Unit | Component | sl select', { 5 | unit: true 6 | }); 7 | 8 | test( 'There are no references to Ember.$, $ or jQuery', function( assert ) { 9 | globalLibraries.setupSpies(); 10 | 11 | const component = this.subject(); 12 | 13 | this.render(); 14 | 15 | globalLibraries.triggerEvents( component ); 16 | 17 | assert.notOk( 18 | globalLibraries.called(), 19 | 'Global libraries are not referenced in component' 20 | ); 21 | 22 | globalLibraries.restoreSpies(); 23 | }); 24 | -------------------------------------------------------------------------------- /tests/unit/components/sl-span-test.js: -------------------------------------------------------------------------------- 1 | import ClassPrefix from 'sl-ember-components/mixins/class-prefix'; 2 | import globalLibraries from '../../helpers/sl/synchronous/global-libraries'; 3 | import{ moduleForComponent, test } from 'ember-qunit'; 4 | 5 | moduleForComponent( 'sl-span', 'Unit | Component | sl span', { 6 | unit: true 7 | }); 8 | 9 | test( 'Expected Mixins are present', function( assert ) { 10 | assert.ok( 11 | ClassPrefix.detect( this.subject() ), 12 | 'ClassPrefix Mixin is present' 13 | ); 14 | }); 15 | 16 | test( 'Default property values', function( assert ) { 17 | const component = this.subject(); 18 | 19 | assert.strictEqual( 20 | component.get( 'componentClass' ), 21 | 'span', 22 | 'ComponentClass is set to span' 23 | ); 24 | 25 | assert.strictEqual( 26 | component.get( 'tagName' ), 27 | 'span', 28 | 'Default property "tagName" is "span"' 29 | ); 30 | 31 | assert.strictEqual( 32 | component.get( 'inverse' ), 33 | false, 34 | 'Default property "inverse" is false' 35 | ); 36 | 37 | assert.strictEqual( 38 | component.get( 'loading' ), 39 | false, 40 | 'Default property "loading" is false' 41 | ); 42 | 43 | assert.strictEqual( 44 | component.get( 'value' ), 45 | null, 46 | 'Default property "value" is null' 47 | ); 48 | }); 49 | 50 | test( 'There are no references to Ember.$, $ or jQuery', function( assert ) { 51 | globalLibraries.setupSpies(); 52 | 53 | const component = this.subject(); 54 | 55 | this.render(); 56 | 57 | globalLibraries.triggerEvents( component ); 58 | 59 | assert.notOk( 60 | globalLibraries.called(), 61 | 'Global libraries are not referenced in component' 62 | ); 63 | 64 | globalLibraries.restoreSpies(); 65 | }); 66 | -------------------------------------------------------------------------------- /tests/unit/components/sl-tab-pane-test.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import { moduleForComponent, test } from 'ember-qunit'; 3 | import startApp from '../../helpers/start-app'; 4 | import globalLibraries from '../../helpers/sl/synchronous/global-libraries'; 5 | 6 | let App; 7 | 8 | moduleForComponent( 'sl-tab-pane', 'Unit | Component | sl tab pane', { 9 | needs: [ 'component:sl-tab-panel' ], 10 | 11 | beforeEach() { 12 | App = startApp(); 13 | }, 14 | 15 | afterEach() { 16 | Ember.run( App, App.destroy ); 17 | }, 18 | 19 | unit: true 20 | }); 21 | 22 | test( 'Default property values', function( assert ) { 23 | const component = this.subject( { 24 | label: 'Test Label', 25 | name: 'Test Name' 26 | } ); 27 | 28 | assert.strictEqual( 29 | component.get( 'data-tab-label' ), 30 | 'Test Label', 31 | '"data-tab-label" is set to the value of "label"' 32 | ); 33 | 34 | assert.strictEqual( 35 | component.get( 'data-tab-name' ), 36 | 'Test Name', 37 | '"data-tab-name" is set to the value of "name"' 38 | ); 39 | }); 40 | 41 | test( 'There are no references to Ember.$, $ or jQuery', function( assert ) { 42 | globalLibraries.setupSpies(); 43 | 44 | const component = this.subject(); 45 | 46 | this.render(); 47 | 48 | globalLibraries.triggerEvents( component ); 49 | 50 | assert.notOk( 51 | globalLibraries.called(), 52 | 'Global libraries are not referenced in component' 53 | ); 54 | 55 | globalLibraries.restoreSpies(); 56 | }); 57 | -------------------------------------------------------------------------------- /tests/unit/mixins/sl-component-class-prefix-test.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import mixinUnderTest from 'sl-ember-components/mixins/class-prefix'; 3 | import * as prefixModule from 'sl-ember-components/utils/class-prefix'; 4 | import sinon from 'sinon'; 5 | import { module, test } from 'qunit'; 6 | 7 | module( 'Unit | Mixin | sl component class prefix' ); 8 | 9 | test( 'Can be successfully mixed', function( assert ) { 10 | const testObject = Ember.Component.extend( mixinUnderTest ); 11 | const subject = testObject.create(); 12 | 13 | assert.ok( 14 | subject 15 | ); 16 | }); 17 | 18 | test( 'prefix() is called when getComponentClassName() invoked', function( assert ) { 19 | const testObject = Ember.Component.extend( mixinUnderTest, { 20 | componentClass: 'test-component' 21 | }); 22 | 23 | const subject = testObject.create(); 24 | const prefixSpy = sinon.spy( prefixModule, 'default' ); 25 | 26 | subject.getComponentClassName(); 27 | 28 | assert.ok( 29 | prefixSpy.called, 30 | 'prefix() was called' 31 | ); 32 | }); 33 | 34 | test( 'Prefixed component class is present in classNames array', function( assert ) { 35 | const testObject = Ember.Component.extend( mixinUnderTest, { 36 | componentClass: 'test-component' 37 | }); 38 | 39 | const subject = testObject.create(); 40 | const prefix = prefixModule.default; 41 | const prefixedComponentClass = prefix( 'test-component' ); 42 | 43 | assert.ok( 44 | subject.get( 'classNames' ).contains( prefixedComponentClass ), 45 | 'Prefixed component class is present in classNames array' 46 | ); 47 | }); 48 | -------------------------------------------------------------------------------- /tests/unit/mixins/sl-component-input-id-test.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import mixinUnderTest from 'sl-ember-components/mixins/sl-component-input-id'; 3 | import { module, test } from 'qunit'; 4 | 5 | module( 'Unit | Mixin | sl component input id' ); 6 | 7 | test( 'Can be successfully mixed', function( assert ) { 8 | const testObject = Ember.Object.extend( mixinUnderTest ); 9 | const subject = testObject.create(); 10 | 11 | assert.ok( 12 | subject, 13 | 'sl-component-input-id mixin is present' 14 | ); 15 | }); 16 | 17 | test( 'inputId is set on component', function( assert ) { 18 | const component = Ember.Component.extend( mixinUnderTest ).create(); 19 | 20 | assert.strictEqual( 21 | component.get( 'inputId' ), 22 | component.get( 'elementId' ) + '-input' 23 | ); 24 | }); 25 | 26 | test( 'inputId value is preserved if it is already set', function( assert ) { 27 | const id = 'preset-id'; 28 | const component = Ember.Component.extend( mixinUnderTest ).create( { 29 | inputId: id 30 | }); 31 | 32 | assert.strictEqual( 33 | component.get( 'inputId' ), 34 | id 35 | ); 36 | }); 37 | -------------------------------------------------------------------------------- /tests/unit/mixins/sl-input-based-test.js: -------------------------------------------------------------------------------- 1 | import Ember from 'ember'; 2 | import mixinUnderTest from 'sl-ember-components/mixins/sl-input-based'; 3 | import { module, test } from 'qunit'; 4 | 5 | module( 'Unit | Mixin | sl input based' ); 6 | 7 | test( 'Successfully mixed', function( assert ) { 8 | const testObject = Ember.Object.extend( mixinUnderTest ); 9 | const subject = testObject.create(); 10 | 11 | assert.ok( 12 | subject 13 | ); 14 | }); 15 | 16 | test( 'Default values are set correctly', function( assert ) { 17 | const testObject = Ember.Object.extend( mixinUnderTest ); 18 | const subject = testObject.create(); 19 | 20 | assert.strictEqual( 21 | subject.get( 'disabled' ), 22 | false, 23 | 'Disabled is false by default' 24 | ); 25 | 26 | assert.strictEqual( 27 | subject.get( 'optional' ), 28 | false, 29 | 'Optional is false by default' 30 | ); 31 | 32 | assert.strictEqual( 33 | subject.get( 'name' ), 34 | null, 35 | 'Name is null by default' 36 | ); 37 | 38 | assert.strictEqual( 39 | subject.get( 'readonly' ), 40 | false, 41 | 'Readonly is false by default' 42 | ); 43 | 44 | assert.strictEqual( 45 | subject.get( 'required' ), 46 | false, 47 | 'Required is false by default' 48 | ); 49 | }); 50 | 51 | test( 'Class name bindings contain expected bindings', function( assert ) { 52 | const expectedClassNameBindings = [ 53 | 'disabled', 54 | 'optional', 55 | 'readonly', 56 | 'required' 57 | ]; 58 | const testObject = Ember.Object.extend( mixinUnderTest ); 59 | const subject = testObject.create(); 60 | 61 | assert.deepEqual( 62 | subject.get( 'classNameBindings' ), 63 | expectedClassNameBindings, 64 | 'classNameBindings contains the expected class names' 65 | ); 66 | }); 67 | 68 | test( 'readonlyString() returns expected value', function( assert ) { 69 | const testObject = Ember.Object.extend( mixinUnderTest ); 70 | const subject = testObject.create(); 71 | 72 | subject.set( 'readonly', true ); 73 | 74 | assert.strictEqual( 75 | subject.get( 'readonlyString' ), 76 | 'readonly', 77 | 'readonlyString() returns expected string when "readonly" is true' 78 | ); 79 | 80 | subject.set( 'readonly', false ); 81 | 82 | assert.strictEqual( 83 | subject.get( 'readonlyString' ), 84 | null, 85 | 'readonlyString() returns null when "readonly" is false' 86 | ); 87 | }); 88 | 89 | test( 'Dependent keys are correct', function( assert ) { 90 | const testObject = Ember.Object.extend( mixinUnderTest ); 91 | const subject = testObject.create(); 92 | 93 | const readonlyStringDependentKeys = [ 94 | 'readonly' 95 | ]; 96 | 97 | assert.deepEqual( 98 | subject.readonlyString._dependentKeys, 99 | readonlyStringDependentKeys, 100 | 'Dependent keys are correct for readonlyString()' 101 | ); 102 | }); 103 | -------------------------------------------------------------------------------- /tests/unit/utils/class-prefix-test.js: -------------------------------------------------------------------------------- 1 | import prefix from 'sl-ember-components/utils/class-prefix'; 2 | import { module, test } from 'qunit'; 3 | import config from 'ember-get-config'; 4 | 5 | module( 'Unit | Utility | class-prefix' ); 6 | 7 | test( 'prefix() returns a correctly structured prefixed component class name', function( assert ) { 8 | config.componentClassPrefix = 'test-prefix'; 9 | 10 | assert.strictEqual( 11 | prefix( 'test-component' ), 12 | 'test-prefix-test-component', 13 | 'prefix returns a correctly structured prefixed component class name' 14 | ); 15 | }); 16 | -------------------------------------------------------------------------------- /vendor/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softlayer/sl-ember-components/b666df5d75c6ecf51da82ca2c3fd2722add17715/vendor/.gitkeep --------------------------------------------------------------------------------