diff --git a/dist/amd/autocomplete-abstract.js b/dist/amd/autocomplete-abstract.js deleted file mode 100644 index c866997..0000000 --- a/dist/amd/autocomplete-abstract.js +++ /dev/null @@ -1,30 +0,0 @@ -define(['exports'], function (exports) { - 'use strict'; - - var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - - var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - - Object.defineProperty(exports, '__esModule', { - value: true - }); - - var AutoCompleteAbstract = (function () { - function AutoCompleteAbstract() { - _classCallCheck(this, AutoCompleteAbstract); - } - - _createClass(AutoCompleteAbstract, [{ - key: 'search', - value: function search(item) { - return new Promise(function (resolve) { - resolve({ suggestions: [{ value: 'Code and Description', data: '01234' }] }); - }); - } - }]); - - return AutoCompleteAbstract; - })(); - - exports.AutoCompleteAbstract = AutoCompleteAbstract; -}); \ No newline at end of file diff --git a/dist/amd/autocomplete-widget.html b/dist/amd/autocomplete-widget.html new file mode 100644 index 0000000..5502599 --- /dev/null +++ b/dist/amd/autocomplete-widget.html @@ -0,0 +1,10 @@ + + + + + diff --git a/dist/amd/autocomplete-widget.js b/dist/amd/autocomplete-widget.js index be08e05..d7d30b9 100644 --- a/dist/amd/autocomplete-widget.js +++ b/dist/amd/autocomplete-widget.js @@ -1,19 +1,19 @@ define(['exports', 'aurelia-framework', 'jquery', 'devbridge/jQuery-Autocomplete'], function (exports, _aureliaFramework, _jquery, _devbridgeJQueryAutocomplete) { 'use strict'; - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; - - var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - - var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - Object.defineProperty(exports, '__esModule', { value: true }); - var _$ = _interopRequire(_jquery); + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - var _autocomplete = _interopRequire(_devbridgeJQueryAutocomplete); + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + var _$ = _interopRequireDefault(_jquery); + + var _autocomplete = _interopRequireDefault(_devbridgeJQueryAutocomplete); var AutoCompleteWidget = (function () { function AutoCompleteWidget(element) { @@ -22,9 +22,7 @@ define(['exports', 'aurelia-framework', 'jquery', 'devbridge/jQuery-Autocomplete this.element = element; } - var _AutoCompleteWidget = AutoCompleteWidget; - - _createClass(_AutoCompleteWidget, [{ + _createClass(AutoCompleteWidget, [{ key: 'bind', value: function bind() { this.apply(); @@ -32,12 +30,12 @@ define(['exports', 'aurelia-framework', 'jquery', 'devbridge/jQuery-Autocomplete }, { key: 'unbind', value: function unbind() { - _$(this.element).autocomplete('dispose'); + (0, _$['default'])(this.element).autocomplete('dispose'); } }, { key: 'apply', value: function apply() { - _$(this.element).autocomplete({ + (0, _$['default'])(this.element).autocomplete({ lookup: this.lookup.bind(this), onSelect: this.onSelect.bind(this) }); @@ -56,18 +54,20 @@ define(['exports', 'aurelia-framework', 'jquery', 'devbridge/jQuery-Autocomplete } }]); - AutoCompleteWidget = _aureliaFramework.bindable({ + var _AutoCompleteWidget = AutoCompleteWidget; + AutoCompleteWidget = (0, _aureliaFramework.bindable)('title')(AutoCompleteWidget) || AutoCompleteWidget; + AutoCompleteWidget = (0, _aureliaFramework.bindable)({ name: 'selectedItem', attribute: 'selected-item', defaultBindingMode: _aureliaFramework.bindingMode.twoWay })(AutoCompleteWidget) || AutoCompleteWidget; - AutoCompleteWidget = _aureliaFramework.bindable({ + AutoCompleteWidget = (0, _aureliaFramework.bindable)({ name: 'controller', attribute: 'controller', defaultBindingMode: _aureliaFramework.bindingMode.twoWay })(AutoCompleteWidget) || AutoCompleteWidget; - AutoCompleteWidget = _aureliaFramework.customAttribute('autocomplete-widget')(AutoCompleteWidget) || AutoCompleteWidget; - AutoCompleteWidget = _aureliaFramework.inject(Element)(AutoCompleteWidget) || AutoCompleteWidget; + AutoCompleteWidget = (0, _aureliaFramework.customElement)('autocomplete-widget')(AutoCompleteWidget) || AutoCompleteWidget; + AutoCompleteWidget = (0, _aureliaFramework.inject)(Element)(AutoCompleteWidget) || AutoCompleteWidget; return AutoCompleteWidget; })(); diff --git a/dist/amd/lookup-abstract.js b/dist/amd/lookup-abstract.js index 4ac09ba..caea8b3 100644 --- a/dist/amd/lookup-abstract.js +++ b/dist/amd/lookup-abstract.js @@ -1,14 +1,14 @@ define(['exports'], function (exports) { 'use strict'; - var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - - var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - Object.defineProperty(exports, '__esModule', { value: true }); + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + var LookupAbstract = (function () { function LookupAbstract() { _classCallCheck(this, LookupAbstract); diff --git a/dist/amd/lookup-widget.html b/dist/amd/lookup-widget.html index f343f91..70b027f 100644 --- a/dist/amd/lookup-widget.html +++ b/dist/amd/lookup-widget.html @@ -1,6 +1,6 @@ diff --git a/dist/amd/lookup-widget.js b/dist/amd/lookup-widget.js index acdcd31..12ec0bc 100644 --- a/dist/amd/lookup-widget.js +++ b/dist/amd/lookup-widget.js @@ -1,19 +1,19 @@ define(['exports', 'aurelia-framework', 'jquery', 'select2'], function (exports, _aureliaFramework, _jquery, _select2) { 'use strict'; - var _interopRequire = function (obj) { return obj && obj.__esModule ? obj['default'] : obj; }; - - var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - - var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - Object.defineProperty(exports, '__esModule', { value: true }); - var _$ = _interopRequire(_jquery); + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - var _select22 = _interopRequire(_select2); + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + + var _$ = _interopRequireDefault(_jquery); + + var _select22 = _interopRequireDefault(_select2); var LookupWidget = (function () { function LookupWidget(element) { @@ -22,9 +22,7 @@ define(['exports', 'aurelia-framework', 'jquery', 'select2'], function (exports, this.element = element; } - var _LookupWidget = LookupWidget; - - _createClass(_LookupWidget, [{ + _createClass(LookupWidget, [{ key: 'bind', value: function bind() { this.apply(); @@ -32,12 +30,7 @@ define(['exports', 'aurelia-framework', 'jquery', 'select2'], function (exports, }, { key: 'unbind', value: function unbind() { - _$(this.element).find('input').select2('destroy'); - } - }, { - key: 'isShowing', - get: function () { - return this.title.length > 0; + (0, _$['default'])(this.element).find('input').select2('destroy'); } }, { key: 'apply', @@ -45,7 +38,7 @@ define(['exports', 'aurelia-framework', 'jquery', 'select2'], function (exports, var _this = this; var self = this; - _$(this.element).find('input').select2({ + (0, _$['default'])(this.element).find('input').select2({ initSelection: function initSelection(element, callback) { callback(self.controller.setDefaultSelection()); }, @@ -53,45 +46,41 @@ define(['exports', 'aurelia-framework', 'jquery', 'select2'], function (exports, placeholder: this.placeholder, formatSelection: self.controller.formatSelection, formatResult: self.controller.formatItem, - query: (function (_query) { - function query(_x) { - return _query.apply(this, arguments); - } - - query.toString = function () { - return _query.toString(); - }; - - return query; - })(function (query) { - self.controller.search(query.term).then(function (result) { - query.callback({ results: result }); + query: function query(_query) { + self.controller.search(_query.term).then(function (result) { + _query.callback({ results: result }); }); - }), + }, width: '100%' }); - _$(this.element).find('input').select2('val', this.selectedItem); - _$(this.element).find('input').on('change', function () { - _this.selectedItem = _$(_this.element).find('input').select2('val'); + (0, _$['default'])(this.element).find('input').select2('val', this.selectedItem); + (0, _$['default'])(this.element).find('input').on('change', function () { + _this.selectedItem = (0, _$['default'])(_this.element).find('input').select2('val'); }); } + }, { + key: 'isShowing', + get: function get() { + return this.title.length > 0; + } }]); - LookupWidget = _aureliaFramework.bindable('placeholder')(LookupWidget) || LookupWidget; - LookupWidget = _aureliaFramework.bindable('title')(LookupWidget) || LookupWidget; - LookupWidget = _aureliaFramework.bindable({ + var _LookupWidget = LookupWidget; + LookupWidget = (0, _aureliaFramework.bindable)('placeholder')(LookupWidget) || LookupWidget; + LookupWidget = (0, _aureliaFramework.bindable)('title')(LookupWidget) || LookupWidget; + LookupWidget = (0, _aureliaFramework.bindable)({ name: 'selectedItem', attribute: 'selected-item', defaultBindingMode: _aureliaFramework.bindingMode.twoWay })(LookupWidget) || LookupWidget; - LookupWidget = _aureliaFramework.bindable({ + LookupWidget = (0, _aureliaFramework.bindable)({ name: 'controller', attribute: 'controller', defaultBindingMode: _aureliaFramework.bindingMode.twoWay })(LookupWidget) || LookupWidget; - LookupWidget = _aureliaFramework.customElement('lookup-widget')(LookupWidget) || LookupWidget; - LookupWidget = _aureliaFramework.inject(Element)(LookupWidget) || LookupWidget; + LookupWidget = (0, _aureliaFramework.customElement)('lookup-widget')(LookupWidget) || LookupWidget; + LookupWidget = (0, _aureliaFramework.inject)(Element)(LookupWidget) || LookupWidget; return LookupWidget; })(); diff --git a/dist/commonjs/autocomplete-abstract.js b/dist/commonjs/autocomplete-abstract.js deleted file mode 100644 index ca105ea..0000000 --- a/dist/commonjs/autocomplete-abstract.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var AutoCompleteAbstract = (function () { - function AutoCompleteAbstract() { - _classCallCheck(this, AutoCompleteAbstract); - } - - _createClass(AutoCompleteAbstract, [{ - key: 'search', - value: function search(item) { - return new Promise(function (resolve) { - resolve({ suggestions: [{ value: 'Code and Description', data: '01234' }] }); - }); - } - }]); - - return AutoCompleteAbstract; -})(); - -exports.AutoCompleteAbstract = AutoCompleteAbstract; \ No newline at end of file diff --git a/dist/commonjs/autocomplete-widget.html b/dist/commonjs/autocomplete-widget.html new file mode 100644 index 0000000..5502599 --- /dev/null +++ b/dist/commonjs/autocomplete-widget.html @@ -0,0 +1,10 @@ + + + + + diff --git a/dist/commonjs/autocomplete-widget.js b/dist/commonjs/autocomplete-widget.js index ff5e17a..002a584 100644 --- a/dist/commonjs/autocomplete-widget.js +++ b/dist/commonjs/autocomplete-widget.js @@ -1,24 +1,24 @@ 'use strict'; -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; - -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - Object.defineProperty(exports, '__esModule', { value: true }); -var _inject$bindable$customAttribute$bindingMode$computedFrom = require('aurelia-framework'); +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _$ = require('jquery'); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } -var _$2 = _interopRequireWildcard(_$); +var _aureliaFramework = require('aurelia-framework'); -var _autocomplete = require('devbridge/jQuery-Autocomplete'); +var _jquery = require('jquery'); -var _autocomplete2 = _interopRequireWildcard(_autocomplete); +var _jquery2 = _interopRequireDefault(_jquery); + +var _devbridgeJQueryAutocomplete = require('devbridge/jQuery-Autocomplete'); + +var _devbridgeJQueryAutocomplete2 = _interopRequireDefault(_devbridgeJQueryAutocomplete); var AutoCompleteWidget = (function () { function AutoCompleteWidget(element) { @@ -27,9 +27,7 @@ var AutoCompleteWidget = (function () { this.element = element; } - var _AutoCompleteWidget = AutoCompleteWidget; - - _createClass(_AutoCompleteWidget, [{ + _createClass(AutoCompleteWidget, [{ key: 'bind', value: function bind() { this.apply(); @@ -37,12 +35,12 @@ var AutoCompleteWidget = (function () { }, { key: 'unbind', value: function unbind() { - _$2['default'](this.element).autocomplete('dispose'); + (0, _jquery2['default'])(this.element).autocomplete('dispose'); } }, { key: 'apply', value: function apply() { - _$2['default'](this.element).autocomplete({ + (0, _jquery2['default'])(this.element).autocomplete({ lookup: this.lookup.bind(this), onSelect: this.onSelect.bind(this) }); @@ -61,18 +59,20 @@ var AutoCompleteWidget = (function () { } }]); - AutoCompleteWidget = _inject$bindable$customAttribute$bindingMode$computedFrom.bindable({ + var _AutoCompleteWidget = AutoCompleteWidget; + AutoCompleteWidget = (0, _aureliaFramework.bindable)('title')(AutoCompleteWidget) || AutoCompleteWidget; + AutoCompleteWidget = (0, _aureliaFramework.bindable)({ name: 'selectedItem', attribute: 'selected-item', - defaultBindingMode: _inject$bindable$customAttribute$bindingMode$computedFrom.bindingMode.twoWay + defaultBindingMode: _aureliaFramework.bindingMode.twoWay })(AutoCompleteWidget) || AutoCompleteWidget; - AutoCompleteWidget = _inject$bindable$customAttribute$bindingMode$computedFrom.bindable({ + AutoCompleteWidget = (0, _aureliaFramework.bindable)({ name: 'controller', attribute: 'controller', - defaultBindingMode: _inject$bindable$customAttribute$bindingMode$computedFrom.bindingMode.twoWay + defaultBindingMode: _aureliaFramework.bindingMode.twoWay })(AutoCompleteWidget) || AutoCompleteWidget; - AutoCompleteWidget = _inject$bindable$customAttribute$bindingMode$computedFrom.customAttribute('autocomplete-widget')(AutoCompleteWidget) || AutoCompleteWidget; - AutoCompleteWidget = _inject$bindable$customAttribute$bindingMode$computedFrom.inject(Element)(AutoCompleteWidget) || AutoCompleteWidget; + AutoCompleteWidget = (0, _aureliaFramework.customElement)('autocomplete-widget')(AutoCompleteWidget) || AutoCompleteWidget; + AutoCompleteWidget = (0, _aureliaFramework.inject)(Element)(AutoCompleteWidget) || AutoCompleteWidget; return AutoCompleteWidget; })(); diff --git a/dist/commonjs/lookup-abstract.js b/dist/commonjs/lookup-abstract.js index 5c994d0..9ae7511 100644 --- a/dist/commonjs/lookup-abstract.js +++ b/dist/commonjs/lookup-abstract.js @@ -1,13 +1,13 @@ 'use strict'; -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - Object.defineProperty(exports, '__esModule', { value: true }); +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + var LookupAbstract = (function () { function LookupAbstract() { _classCallCheck(this, LookupAbstract); diff --git a/dist/commonjs/lookup-widget.html b/dist/commonjs/lookup-widget.html index f343f91..70b027f 100644 --- a/dist/commonjs/lookup-widget.html +++ b/dist/commonjs/lookup-widget.html @@ -1,6 +1,6 @@ diff --git a/dist/commonjs/lookup-widget.js b/dist/commonjs/lookup-widget.js index ed3401a..002eb93 100644 --- a/dist/commonjs/lookup-widget.js +++ b/dist/commonjs/lookup-widget.js @@ -1,24 +1,24 @@ 'use strict'; -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; - -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - Object.defineProperty(exports, '__esModule', { value: true }); -var _inject$bindable$customElement$bindingMode = require('aurelia-framework'); +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + +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 _aureliaFramework = require('aurelia-framework'); -var _$ = require('jquery'); +var _jquery = require('jquery'); -var _$2 = _interopRequireWildcard(_$); +var _jquery2 = _interopRequireDefault(_jquery); var _select2 = require('select2'); -var _select22 = _interopRequireWildcard(_select2); +var _select22 = _interopRequireDefault(_select2); var LookupWidget = (function () { function LookupWidget(element) { @@ -27,9 +27,7 @@ var LookupWidget = (function () { this.element = element; } - var _LookupWidget = LookupWidget; - - _createClass(_LookupWidget, [{ + _createClass(LookupWidget, [{ key: 'bind', value: function bind() { this.apply(); @@ -37,12 +35,7 @@ var LookupWidget = (function () { }, { key: 'unbind', value: function unbind() { - _$2['default'](this.element).find('input').select2('destroy'); - } - }, { - key: 'isShowing', - get: function () { - return this.title.length > 0; + (0, _jquery2['default'])(this.element).find('input').select2('destroy'); } }, { key: 'apply', @@ -50,7 +43,7 @@ var LookupWidget = (function () { var _this = this; var self = this; - _$2['default'](this.element).find('input').select2({ + (0, _jquery2['default'])(this.element).find('input').select2({ initSelection: function initSelection(element, callback) { callback(self.controller.setDefaultSelection()); }, @@ -58,45 +51,41 @@ var LookupWidget = (function () { placeholder: this.placeholder, formatSelection: self.controller.formatSelection, formatResult: self.controller.formatItem, - query: (function (_query) { - function query(_x) { - return _query.apply(this, arguments); - } - - query.toString = function () { - return _query.toString(); - }; - - return query; - })(function (query) { - self.controller.search(query.term).then(function (result) { - query.callback({ results: result }); + query: function query(_query) { + self.controller.search(_query.term).then(function (result) { + _query.callback({ results: result }); }); - }), + }, width: '100%' }); - _$2['default'](this.element).find('input').select2('val', this.selectedItem); - _$2['default'](this.element).find('input').on('change', function () { - _this.selectedItem = _$2['default'](_this.element).find('input').select2('val'); + (0, _jquery2['default'])(this.element).find('input').select2('val', this.selectedItem); + (0, _jquery2['default'])(this.element).find('input').on('change', function () { + _this.selectedItem = (0, _jquery2['default'])(_this.element).find('input').select2('val'); }); } + }, { + key: 'isShowing', + get: function get() { + return this.title.length > 0; + } }]); - LookupWidget = _inject$bindable$customElement$bindingMode.bindable('placeholder')(LookupWidget) || LookupWidget; - LookupWidget = _inject$bindable$customElement$bindingMode.bindable('title')(LookupWidget) || LookupWidget; - LookupWidget = _inject$bindable$customElement$bindingMode.bindable({ + var _LookupWidget = LookupWidget; + LookupWidget = (0, _aureliaFramework.bindable)('placeholder')(LookupWidget) || LookupWidget; + LookupWidget = (0, _aureliaFramework.bindable)('title')(LookupWidget) || LookupWidget; + LookupWidget = (0, _aureliaFramework.bindable)({ name: 'selectedItem', attribute: 'selected-item', - defaultBindingMode: _inject$bindable$customElement$bindingMode.bindingMode.twoWay + defaultBindingMode: _aureliaFramework.bindingMode.twoWay })(LookupWidget) || LookupWidget; - LookupWidget = _inject$bindable$customElement$bindingMode.bindable({ + LookupWidget = (0, _aureliaFramework.bindable)({ name: 'controller', attribute: 'controller', - defaultBindingMode: _inject$bindable$customElement$bindingMode.bindingMode.twoWay + defaultBindingMode: _aureliaFramework.bindingMode.twoWay })(LookupWidget) || LookupWidget; - LookupWidget = _inject$bindable$customElement$bindingMode.customElement('lookup-widget')(LookupWidget) || LookupWidget; - LookupWidget = _inject$bindable$customElement$bindingMode.inject(Element)(LookupWidget) || LookupWidget; + LookupWidget = (0, _aureliaFramework.customElement)('lookup-widget')(LookupWidget) || LookupWidget; + LookupWidget = (0, _aureliaFramework.inject)(Element)(LookupWidget) || LookupWidget; return LookupWidget; })(); diff --git a/dist/es6/autocomplete-abstract.js b/dist/es6/autocomplete-abstract.js deleted file mode 100644 index 1af3b60..0000000 --- a/dist/es6/autocomplete-abstract.js +++ /dev/null @@ -1,11 +0,0 @@ -export class AutoCompleteAbstract { - constructor() { - } - - search(item) { - //Override this class with your API to execute the query - return new Promise((resolve) => { - resolve({ suggestions: [ { value: 'Code and Description', data: '01234' } ] }); - }); - } -} diff --git a/dist/es6/autocomplete-widget.html b/dist/es6/autocomplete-widget.html new file mode 100644 index 0000000..5502599 --- /dev/null +++ b/dist/es6/autocomplete-widget.html @@ -0,0 +1,10 @@ + + + + + diff --git a/dist/es6/autocomplete-widget.js b/dist/es6/autocomplete-widget.js index 81c942e..62b4d3f 100644 --- a/dist/es6/autocomplete-widget.js +++ b/dist/es6/autocomplete-widget.js @@ -1,9 +1,9 @@ -import {inject, bindable, customAttribute, bindingMode, computedFrom} from 'aurelia-framework'; +import {inject, bindable, customElement, bindingMode} from 'aurelia-framework'; import $ from 'jquery'; import autocomplete from 'devbridge/jQuery-Autocomplete'; @inject(Element) -@customAttribute('autocomplete-widget') +@customElement('autocomplete-widget') @bindable({ name:'controller', attribute:'controller', @@ -14,6 +14,7 @@ import autocomplete from 'devbridge/jQuery-Autocomplete'; attribute:'selected-item', defaultBindingMode: bindingMode.twoWay }) +@bindable('title') export class AutoCompleteWidget { constructor(element) { this.element = element; diff --git a/dist/es6/lookup-widget.html b/dist/es6/lookup-widget.html index f343f91..70b027f 100644 --- a/dist/es6/lookup-widget.html +++ b/dist/es6/lookup-widget.html @@ -1,6 +1,6 @@ diff --git a/dist/system/autocomplete-abstract.js b/dist/system/autocomplete-abstract.js deleted file mode 100644 index 4cdfafe..0000000 --- a/dist/system/autocomplete-abstract.js +++ /dev/null @@ -1,33 +0,0 @@ -System.register([], function (_export) { - var _classCallCheck, _createClass, AutoCompleteAbstract; - - return { - setters: [], - execute: function () { - 'use strict'; - - _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - - _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - - AutoCompleteAbstract = (function () { - function AutoCompleteAbstract() { - _classCallCheck(this, AutoCompleteAbstract); - } - - _createClass(AutoCompleteAbstract, [{ - key: 'search', - value: function search(item) { - return new Promise(function (resolve) { - resolve({ suggestions: [{ value: 'Code and Description', data: '01234' }] }); - }); - } - }]); - - return AutoCompleteAbstract; - })(); - - _export('AutoCompleteAbstract', AutoCompleteAbstract); - } - }; -}); \ No newline at end of file diff --git a/dist/system/autocomplete-widget.html b/dist/system/autocomplete-widget.html new file mode 100644 index 0000000..5502599 --- /dev/null +++ b/dist/system/autocomplete-widget.html @@ -0,0 +1,10 @@ + + + + + diff --git a/dist/system/autocomplete-widget.js b/dist/system/autocomplete-widget.js index 251e216..49fc3c1 100644 --- a/dist/system/autocomplete-widget.js +++ b/dist/system/autocomplete-widget.js @@ -1,25 +1,24 @@ System.register(['aurelia-framework', 'jquery', 'devbridge/jQuery-Autocomplete'], function (_export) { - var inject, bindable, customAttribute, bindingMode, computedFrom, $, autocomplete, _classCallCheck, _createClass, AutoCompleteWidget; + 'use strict'; + + var inject, bindable, customElement, bindingMode, $, autocomplete, AutoCompleteWidget; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } return { setters: [function (_aureliaFramework) { inject = _aureliaFramework.inject; bindable = _aureliaFramework.bindable; - customAttribute = _aureliaFramework.customAttribute; + customElement = _aureliaFramework.customElement; bindingMode = _aureliaFramework.bindingMode; - computedFrom = _aureliaFramework.computedFrom; }, function (_jquery) { $ = _jquery['default']; }, function (_devbridgeJQueryAutocomplete) { autocomplete = _devbridgeJQueryAutocomplete['default']; }], execute: function () { - 'use strict'; - - _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - - _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - AutoCompleteWidget = (function () { function AutoCompleteWidget(element) { _classCallCheck(this, _AutoCompleteWidget); @@ -27,9 +26,7 @@ System.register(['aurelia-framework', 'jquery', 'devbridge/jQuery-Autocomplete'] this.element = element; } - var _AutoCompleteWidget = AutoCompleteWidget; - - _createClass(_AutoCompleteWidget, [{ + _createClass(AutoCompleteWidget, [{ key: 'bind', value: function bind() { this.apply(); @@ -61,6 +58,8 @@ System.register(['aurelia-framework', 'jquery', 'devbridge/jQuery-Autocomplete'] } }]); + var _AutoCompleteWidget = AutoCompleteWidget; + AutoCompleteWidget = bindable('title')(AutoCompleteWidget) || AutoCompleteWidget; AutoCompleteWidget = bindable({ name: 'selectedItem', attribute: 'selected-item', @@ -71,7 +70,7 @@ System.register(['aurelia-framework', 'jquery', 'devbridge/jQuery-Autocomplete'] attribute: 'controller', defaultBindingMode: bindingMode.twoWay })(AutoCompleteWidget) || AutoCompleteWidget; - AutoCompleteWidget = customAttribute('autocomplete-widget')(AutoCompleteWidget) || AutoCompleteWidget; + AutoCompleteWidget = customElement('autocomplete-widget')(AutoCompleteWidget) || AutoCompleteWidget; AutoCompleteWidget = inject(Element)(AutoCompleteWidget) || AutoCompleteWidget; return AutoCompleteWidget; })(); diff --git a/dist/system/index.js b/dist/system/index.js index a9850f3..fd316c1 100644 --- a/dist/system/index.js +++ b/dist/system/index.js @@ -1,4 +1,6 @@ System.register([], function (_export) { + 'use strict'; + _export('configure', configure); function configure(aurelia) { @@ -8,8 +10,6 @@ System.register([], function (_export) { return { setters: [], - execute: function () { - 'use strict'; - } + execute: function () {} }; }); \ No newline at end of file diff --git a/dist/system/lookup-abstract.js b/dist/system/lookup-abstract.js index 22115b9..c8b5f73 100644 --- a/dist/system/lookup-abstract.js +++ b/dist/system/lookup-abstract.js @@ -1,15 +1,15 @@ System.register([], function (_export) { - var _classCallCheck, _createClass, LookupAbstract; + 'use strict'; - return { - setters: [], - execute: function () { - 'use strict'; + var LookupAbstract; - _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + return { + setters: [], + execute: function () { LookupAbstract = (function () { function LookupAbstract() { _classCallCheck(this, LookupAbstract); diff --git a/dist/system/lookup-widget.html b/dist/system/lookup-widget.html index f343f91..70b027f 100644 --- a/dist/system/lookup-widget.html +++ b/dist/system/lookup-widget.html @@ -1,6 +1,6 @@ diff --git a/dist/system/lookup-widget.js b/dist/system/lookup-widget.js index bad7c7f..02678fe 100644 --- a/dist/system/lookup-widget.js +++ b/dist/system/lookup-widget.js @@ -1,5 +1,11 @@ System.register(['aurelia-framework', 'jquery', 'select2'], function (_export) { - var inject, bindable, customElement, bindingMode, $, select2, _classCallCheck, _createClass, LookupWidget; + 'use strict'; + + var inject, bindable, customElement, bindingMode, $, select2, LookupWidget; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } return { setters: [function (_aureliaFramework) { @@ -13,12 +19,6 @@ System.register(['aurelia-framework', 'jquery', 'select2'], function (_export) { select2 = _select2['default']; }], execute: function () { - 'use strict'; - - _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - - _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - LookupWidget = (function () { function LookupWidget(element) { _classCallCheck(this, _LookupWidget); @@ -26,9 +26,7 @@ System.register(['aurelia-framework', 'jquery', 'select2'], function (_export) { this.element = element; } - var _LookupWidget = LookupWidget; - - _createClass(_LookupWidget, [{ + _createClass(LookupWidget, [{ key: 'bind', value: function bind() { this.apply(); @@ -38,11 +36,6 @@ System.register(['aurelia-framework', 'jquery', 'select2'], function (_export) { value: function unbind() { $(this.element).find('input').select2('destroy'); } - }, { - key: 'isShowing', - get: function () { - return this.title.length > 0; - } }, { key: 'apply', value: function apply() { @@ -57,21 +50,11 @@ System.register(['aurelia-framework', 'jquery', 'select2'], function (_export) { placeholder: this.placeholder, formatSelection: self.controller.formatSelection, formatResult: self.controller.formatItem, - query: (function (_query) { - function query(_x) { - return _query.apply(this, arguments); - } - - query.toString = function () { - return _query.toString(); - }; - - return query; - })(function (query) { - self.controller.search(query.term).then(function (result) { - query.callback({ results: result }); + query: function query(_query) { + self.controller.search(_query.term).then(function (result) { + _query.callback({ results: result }); }); - }), + }, width: '100%' }); @@ -80,8 +63,14 @@ System.register(['aurelia-framework', 'jquery', 'select2'], function (_export) { _this.selectedItem = $(_this.element).find('input').select2('val'); }); } + }, { + key: 'isShowing', + get: function get() { + return this.title.length > 0; + } }]); + var _LookupWidget = LookupWidget; LookupWidget = bindable('placeholder')(LookupWidget) || LookupWidget; LookupWidget = bindable('title')(LookupWidget) || LookupWidget; LookupWidget = bindable({ diff --git a/src/autocomplete-abstract.js b/src/autocomplete-abstract.js deleted file mode 100644 index 1af3b60..0000000 --- a/src/autocomplete-abstract.js +++ /dev/null @@ -1,11 +0,0 @@ -export class AutoCompleteAbstract { - constructor() { - } - - search(item) { - //Override this class with your API to execute the query - return new Promise((resolve) => { - resolve({ suggestions: [ { value: 'Code and Description', data: '01234' } ] }); - }); - } -} diff --git a/src/autocomplete-widget.html b/src/autocomplete-widget.html new file mode 100644 index 0000000..5502599 --- /dev/null +++ b/src/autocomplete-widget.html @@ -0,0 +1,10 @@ + + + + + diff --git a/src/autocomplete-widget.js b/src/autocomplete-widget.js index 81c942e..62b4d3f 100644 --- a/src/autocomplete-widget.js +++ b/src/autocomplete-widget.js @@ -1,9 +1,9 @@ -import {inject, bindable, customAttribute, bindingMode, computedFrom} from 'aurelia-framework'; +import {inject, bindable, customElement, bindingMode} from 'aurelia-framework'; import $ from 'jquery'; import autocomplete from 'devbridge/jQuery-Autocomplete'; @inject(Element) -@customAttribute('autocomplete-widget') +@customElement('autocomplete-widget') @bindable({ name:'controller', attribute:'controller', @@ -14,6 +14,7 @@ import autocomplete from 'devbridge/jQuery-Autocomplete'; attribute:'selected-item', defaultBindingMode: bindingMode.twoWay }) +@bindable('title') export class AutoCompleteWidget { constructor(element) { this.element = element; diff --git a/src/lookup-widget.html b/src/lookup-widget.html index f343f91..70b027f 100644 --- a/src/lookup-widget.html +++ b/src/lookup-widget.html @@ -1,6 +1,6 @@