diff --git a/bower.json b/bower.json index 19379e3..66695d8 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-materialize", - "version": "0.2.8", + "version": "0.2.9", "description": "Aurelia integration with Materialize CSS Framework.", "keywords": [ "aurelia", diff --git a/dist/amd/collapsible.js b/dist/amd/collapsible.js new file mode 100644 index 0000000..c3e7ce1 --- /dev/null +++ b/dist/amd/collapsible.js @@ -0,0 +1,34 @@ +define(['exports', 'aurelia-templating', 'aurelia-dependency-injection', 'jquery'], function (exports, _aureliaTemplating, _aureliaDependencyInjection, _jquery) { + 'use strict'; + + exports.__esModule = true; + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + var _$ = _interopRequireDefault(_jquery); + + var MaterialCollapsible = (function () { + function MaterialCollapsible(element) { + _classCallCheck(this, _MaterialCollapsible); + + this.element = element; + } + + var _MaterialCollapsible = MaterialCollapsible; + + _MaterialCollapsible.prototype.attached = function attached() { + (0, _$['default'])(this.element).collapsible({ + accordion: this.accordion + }); + }; + + MaterialCollapsible = (0, _aureliaDependencyInjection.inject)(Element)(MaterialCollapsible) || MaterialCollapsible; + MaterialCollapsible = (0, _aureliaTemplating.bindable)({ name: 'accordion', defaultValue: false })(MaterialCollapsible) || MaterialCollapsible; + MaterialCollapsible = (0, _aureliaTemplating.customAttribute)('material-collapsible')(MaterialCollapsible) || MaterialCollapsible; + return MaterialCollapsible; + })(); + + exports.MaterialCollapsible = MaterialCollapsible; +}); \ No newline at end of file diff --git a/dist/amd/index.js b/dist/amd/index.js index 75d18ab..c60b9ba 100644 --- a/dist/amd/index.js +++ b/dist/amd/index.js @@ -1,4 +1,4 @@ -define(['exports', 'jquery', 'materialize', './select', './side-nav', './toast', './dropdown', './validation-view-strategy'], function (exports, _jquery, _materialize, _select, _sideNav, _toast, _dropdown, _validationViewStrategy) { +define(['exports', 'jquery', 'materialize', './select', './side-nav', './toast', './dropdown', './collapsible', './validation-view-strategy'], function (exports, _jquery, _materialize, _select, _sideNav, _toast, _dropdown, _collapsible, _validationViewStrategy) { 'use strict'; exports.__esModule = true; @@ -7,9 +7,10 @@ define(['exports', 'jquery', 'materialize', './select', './side-nav', './toast', exports.MaterialSideNav = _sideNav.MaterialSideNav; exports.MaterialToast = _toast.MaterialToast; exports.MaterialDropDown = _dropdown.MaterialDropDown; + exports.MaterialCollapsible = _collapsible.MaterialCollapsible; exports.MaterialValidationViewStrategy = _validationViewStrategy.MaterialValidationViewStrategy; function configure(aurelia) { - aurelia.globalizeResources('./select', './side-nav', './toast', './dropdown'); + aurelia.globalizeResources('./select', './side-nav', './toast', './dropdown', './collapsible'); } }); \ No newline at end of file diff --git a/dist/commonjs/collapsible.js b/dist/commonjs/collapsible.js new file mode 100644 index 0000000..4b05948 --- /dev/null +++ b/dist/commonjs/collapsible.js @@ -0,0 +1,38 @@ +'use strict'; + +exports.__esModule = true; + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + +var _aureliaTemplating = require('aurelia-templating'); + +var _aureliaDependencyInjection = require('aurelia-dependency-injection'); + +var _jquery = require('jquery'); + +var _jquery2 = _interopRequireDefault(_jquery); + +var MaterialCollapsible = (function () { + function MaterialCollapsible(element) { + _classCallCheck(this, _MaterialCollapsible); + + this.element = element; + } + + var _MaterialCollapsible = MaterialCollapsible; + + _MaterialCollapsible.prototype.attached = function attached() { + (0, _jquery2['default'])(this.element).collapsible({ + accordion: this.accordion + }); + }; + + MaterialCollapsible = (0, _aureliaDependencyInjection.inject)(Element)(MaterialCollapsible) || MaterialCollapsible; + MaterialCollapsible = (0, _aureliaTemplating.bindable)({ name: 'accordion', defaultValue: false })(MaterialCollapsible) || MaterialCollapsible; + MaterialCollapsible = (0, _aureliaTemplating.customAttribute)('material-collapsible')(MaterialCollapsible) || MaterialCollapsible; + return MaterialCollapsible; +})(); + +exports.MaterialCollapsible = MaterialCollapsible; \ No newline at end of file diff --git a/dist/commonjs/index.js b/dist/commonjs/index.js index d840e47..4aa6e09 100644 --- a/dist/commonjs/index.js +++ b/dist/commonjs/index.js @@ -23,10 +23,14 @@ var _dropdown = require('./dropdown'); exports.MaterialDropDown = _dropdown.MaterialDropDown; +var _collapsible = require('./collapsible'); + +exports.MaterialCollapsible = _collapsible.MaterialCollapsible; + var _validationViewStrategy = require('./validation-view-strategy'); exports.MaterialValidationViewStrategy = _validationViewStrategy.MaterialValidationViewStrategy; function configure(aurelia) { - aurelia.globalizeResources('./select', './side-nav', './toast', './dropdown'); + aurelia.globalizeResources('./select', './side-nav', './toast', './dropdown', './collapsible'); } \ No newline at end of file diff --git a/dist/es6/collapsible.js b/dist/es6/collapsible.js new file mode 100644 index 0000000..c2fc147 --- /dev/null +++ b/dist/es6/collapsible.js @@ -0,0 +1,18 @@ +import {customAttribute, bindable} from 'aurelia-templating'; +import {inject} from 'aurelia-dependency-injection'; +import $ from 'jquery'; + +@customAttribute('material-collapsible') +@bindable({ name: 'accordion', defaultValue: false }) +@inject(Element) +export class MaterialCollapsible { + constructor(element) { + this.element = element; + } + + attached() { + $(this.element).collapsible({ + accordion : this.accordion + }); + } +} \ No newline at end of file diff --git a/dist/es6/index.js b/dist/es6/index.js index 55b28c5..795884b 100644 --- a/dist/es6/index.js +++ b/dist/es6/index.js @@ -5,13 +5,15 @@ export {MaterialSelect} from './select'; export {MaterialSideNav} from './side-nav'; export {MaterialToast} from './toast'; export {MaterialDropDown} from './dropdown'; +export {MaterialCollapsible} from './collapsible'; export {MaterialValidationViewStrategy} from './validation-view-strategy'; export function configure(aurelia) { - aurelia.globalizeResources( - './select', - './side-nav', - './toast', - './dropdown' - ); + aurelia.globalizeResources( + './select', + './side-nav', + './toast', + './dropdown', + './collapsible' + ); } diff --git a/dist/system/collapsible.js b/dist/system/collapsible.js new file mode 100644 index 0000000..6f010b1 --- /dev/null +++ b/dist/system/collapsible.js @@ -0,0 +1,42 @@ +System.register(['aurelia-templating', 'aurelia-dependency-injection', 'jquery'], function (_export) { + 'use strict'; + + var customAttribute, bindable, inject, $, MaterialCollapsible; + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + return { + setters: [function (_aureliaTemplating) { + customAttribute = _aureliaTemplating.customAttribute; + bindable = _aureliaTemplating.bindable; + }, function (_aureliaDependencyInjection) { + inject = _aureliaDependencyInjection.inject; + }, function (_jquery) { + $ = _jquery['default']; + }], + execute: function () { + MaterialCollapsible = (function () { + function MaterialCollapsible(element) { + _classCallCheck(this, _MaterialCollapsible); + + this.element = element; + } + + var _MaterialCollapsible = MaterialCollapsible; + + _MaterialCollapsible.prototype.attached = function attached() { + $(this.element).collapsible({ + accordion: this.accordion + }); + }; + + MaterialCollapsible = inject(Element)(MaterialCollapsible) || MaterialCollapsible; + MaterialCollapsible = bindable({ name: 'accordion', defaultValue: false })(MaterialCollapsible) || MaterialCollapsible; + MaterialCollapsible = customAttribute('material-collapsible')(MaterialCollapsible) || MaterialCollapsible; + return MaterialCollapsible; + })(); + + _export('MaterialCollapsible', MaterialCollapsible); + } + }; +}); \ No newline at end of file diff --git a/dist/system/index.js b/dist/system/index.js index aa096fa..e4665f3 100644 --- a/dist/system/index.js +++ b/dist/system/index.js @@ -1,10 +1,10 @@ -System.register(['jquery', 'materialize', './select', './side-nav', './toast', './dropdown', './validation-view-strategy'], function (_export) { +System.register(['jquery', 'materialize', './select', './side-nav', './toast', './dropdown', './collapsible', './validation-view-strategy'], function (_export) { 'use strict'; _export('configure', configure); function configure(aurelia) { - aurelia.globalizeResources('./select', './side-nav', './toast', './dropdown'); + aurelia.globalizeResources('./select', './side-nav', './toast', './dropdown', './collapsible'); } return { @@ -16,6 +16,8 @@ System.register(['jquery', 'materialize', './select', './side-nav', './toast', ' _export('MaterialToast', _toast.MaterialToast); }, function (_dropdown) { _export('MaterialDropDown', _dropdown.MaterialDropDown); + }, function (_collapsible) { + _export('MaterialCollapsible', _collapsible.MaterialCollapsible); }, function (_validationViewStrategy) { _export('MaterialValidationViewStrategy', _validationViewStrategy.MaterialValidationViewStrategy); }], diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 0eb002d..e4b16ab 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,11 @@ +### 0.2.9 (2015-06-17) + + +#### Features + +* **collapsible:** add the collapsible widget ([c48c18c8](https://github.com/manuel-guilbault/aurelia-materialize/commit/c48c18c804ae0c1510002f83130e8f8ecfba5172)) + + ### 0.2.8 (2015-06-15) diff --git a/package.json b/package.json index 10d4637..cb55b0c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-materialize", - "version": "0.2.8", + "version": "0.2.9", "description": "Aurelia integration with Materialize CSS Framework.", "keywords": [ "aurelia",