├── .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 |
{{helpText}}
16 | {{/if}} 17 | -------------------------------------------------------------------------------- /addon/templates/components/sl-date-range-picker.hbs: -------------------------------------------------------------------------------- 1 | {{#if label}} 2 | 3 | {{/if}} 4 | 5 |{{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 |{{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 |{{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{{text}}
4 | 5 | {{sl-input placeholder="Enter some text" value=inputText}} 6 | -------------------------------------------------------------------------------- /tests/dummy/app/templates/components/demos/tabs/tab-two.hbs: -------------------------------------------------------------------------------- 1 |8 | {{type}}{{#if default}}, default: {{default}}{{/if}}{{#if requires}}, requires {{requires}}{{/if}} 9 |
10 |{{yield}}
-------------------------------------------------------------------------------- /tests/dummy/app/templates/demos/sl-calendar.hbs: -------------------------------------------------------------------------------- 1 |A standalone calendar to display date values from an array of objects.
3 | 4 |\{{sl-calendar action="logLabel" content=content}}12 | 13 |
model: [ 15 | { 16 | date: new Date(), 17 | label: 'Today!' 18 | } 19 | ]20 |
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 |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 | 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 |\{{sl-chart 14 | options=chartOptions 15 | series=content 16 | title="Fruit Consumption" 17 | }}18 | 19 |
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 |
content = [ 38 | { 39 | name: 'Jane', 40 | data: [ 1, 0, 4 ] 41 | }, { 42 | name: 'John', 43 | data: [ 5, 7, 3 ] 44 | } 45 | ]46 |
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 |An improved substitute for the default <input type="checkbox"> element. See Bootstrap - Supported controls for details.
3 | 4 |\{{sl-checkbox 12 | checked=checkboxValue 13 | label="Checkbox" 14 | name="checkbox" 15 | inline=true 16 | }}17 |
\{{sl-checkbox 33 | disabled=true 34 | label="Disabled checkbox" 35 | }}36 |
sl-input-based
51 |sl-tooltip-enabled
54 |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 |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 | A component to use for date ranges, using two {{#link-to "demos.sl-date-picker"}}sl-date-picker{{/link-to}} components.
3 | 4 |\{{sl-date-range-picker 12 | label="Select date range" 13 | startDatePlaceholder="Select start date" 14 | endDatePlaceholder="Select end date" 15 | }}16 |
sl-component-input-id
35 |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 |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 | 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 | A component used for displaying and controlling pages of content.
3 | 4 |\{{sl-pagination changePage="changePage" totalPages=20}}12 |
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 |A basic content wrapper for Bootstrap - Panels.
3 | 4 |\{{#sl-panel heading="Test Panel" theme="primary"}} 12 | <p>Hello world!</p> 13 | \{{/sl-panel}}14 |
Hello world!
20 | {{/sl-panel}} 21 |\{{#sl-panel footer="Test Panel"}} 28 | <p>Hello world!</p> 29 | \{{/sl-panel}}30 |
Hello world!
36 | {{/sl-panel}} 37 |\{{#sl-panel heading="Test Panel" loading=true}} 44 | <p>Hello world!</p> 45 | \{{/sl-panel}}46 |
Hello world!
52 | {{/sl-panel}} 53 |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 |Individual radio button component.
3 | 4 |\{{sl-radio inline=true label="Test radio button"}}12 |
\{{sl-radio disabled=true label="Disabled radio button"}}24 |
sl-input-based
39 |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 |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 | A wrapper to intelligently represent state for inline content.
3 | 4 |<p> 12 | Loads in 5 seconds: \{{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 |Loads in 5 seconds: {{sl-span class="text-success" loading=isLoading value="Done!"}}
25 |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 |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 | A component with selectable tabs and related tab panes. Based on Bootstrap - Togglable tabs.
3 | 4 |\{{#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 |
Content for tab three!
39 | {{/sl-tab-pane}} 40 | {{/sl-tab-panel}} 41 |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 |name
property of the sl-tab-pane component. If omitted, the first tab pane will be open on initialization.
66 | {{/property-text}}
67 | This value is never displayed in the tabs.
80 |Used to set the data-tab-name
attribute on the tab and used internally by the component to manage tab selection.
The name provided can be specified in the initialTabName
property of the sl-tab-panel component to indicate which tab should be active when initially displayed.
A simple component that surrounds content to enable Bootstrap's tooltip and popover behavior.
3 | 4 |\{{#sl-tooltip 12 | tagName="u" 13 | title="Tooltip text!" 14 | }} 15 | Tooltip example 16 | \{{/sl-tooltip}}17 |
{{#sl-tooltip tagName="u" title="Tooltip text!"}}Tooltip example{{/sl-tooltip}}
22 |\{{#sl-tooltip 29 | popover="Popover content!" 30 | tagName="u" 31 | title="Popover title" 32 | }} 33 | Popover example 34 | \{{/sl-tooltip}}35 |
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 |popover
property is set.
76 | {{/property-text}}
77 |
78 | {{#property-text name="popover" type="String"}}
79 | Popover content text.
80 | {{/property-text}}
81 | An Ember CLI Addon that provides a variety of UI components.
5 |Demo
70 | {{/link-to}} 71 | 72 |Documentation
74 | 75 | {{#link-to "browsers" class="col-md-3 text-center"}} 76 |Supported Browsers
78 | {{/link-to}} 79 | 80 |Available on GitHub
82 | 83 |