-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
671 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
var gulp = require('gulp'); | ||
var minifyCSS = require('gulp-minify-css'); | ||
var plumber = require('gulp-plumber'); | ||
var sass = require('gulp-ruby-sass'); | ||
var gulpFilter = require('gulp-filter'); | ||
var sourcemaps = require('gulp-sourcemaps'); | ||
var paths = require('../paths'); | ||
var runSequence = require('run-sequence'); | ||
|
||
|
||
/** | ||
* Generate CSS from SCSS | ||
* Build sourcemaps | ||
*/ | ||
gulp.task('sass', function () { | ||
|
||
var sassConfig = { | ||
noCache: true, | ||
compass: true, | ||
sourcemap: false, | ||
force: false | ||
}; | ||
|
||
// Don’t write sourcemaps of sourcemaps | ||
var filter = gulpFilter(['*.css', '!*.map']); | ||
|
||
return sass(paths.sass, sassConfig) | ||
.pipe(plumber()) | ||
.pipe(sourcemaps.init()) | ||
.pipe(filter) // Don’t write sourcemaps of sourcemaps | ||
.pipe(sourcemaps.write()) | ||
.pipe(filter.restore()) // Restore original files | ||
.pipe(gulp.dest(paths.styleFolder)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<template> | ||
<label class="control-label" show.bind="isShowing">${title}</label> | ||
<input class="form-control" type="text" class="autocomplete-widget" /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
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 _createDecoratedClass = (function () { function defineProperties(target, descriptors, initializers) { for (var i = 0; i < descriptors.length; i++) { var descriptor = descriptors[i]; var decorators = descriptor.decorators; var key = descriptor.key; delete descriptor.key; delete descriptor.decorators; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor || descriptor.initializer) descriptor.writable = true; if (decorators) { for (var f = 0; f < decorators.length; f++) { var decorator = decorators[f]; if (typeof decorator === 'function') { descriptor = decorator(target, key, descriptor) || descriptor; } else { throw new TypeError('The decorator for method ' + descriptor.key + ' is of the invalid type ' + typeof decorator); } } if (initializers) initializers[key] = descriptor.initializer; } Object.defineProperty(target, key, descriptor); } } return function (Constructor, protoProps, staticProps, protoInitializers, staticInitializers) { if (protoProps) defineProperties(Constructor.prototype, protoProps, protoInitializers); if (staticProps) defineProperties(Constructor, staticProps, staticInitializers); return Constructor; }; })(); | ||
|
||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
|
||
var _$ = _interopRequire(_jquery); | ||
|
||
var _autocomplete = _interopRequire(_devbridgeJQueryAutocomplete); | ||
|
||
var AutoCompleteWidget = (function () { | ||
function AutoCompleteWidget(element) { | ||
_classCallCheck(this, _AutoCompleteWidget); | ||
|
||
this.element = element; | ||
} | ||
|
||
var _AutoCompleteWidget = AutoCompleteWidget; | ||
|
||
_createDecoratedClass(_AutoCompleteWidget, [{ | ||
key: 'bind', | ||
value: function bind() { | ||
this.apply(); | ||
} | ||
}, { | ||
key: 'isShowing', | ||
decorators: [_aureliaFramework.computedFrom('title')], | ||
get: function () { | ||
return this.title != undefined && this.title.length > 0; | ||
} | ||
}, { | ||
key: 'apply', | ||
value: function apply() { | ||
_$(this.element).find('input').autocomplete({ | ||
lookup: this.lookup.bind(this), | ||
onSelect: this.onSelect.bind(this) | ||
}); | ||
} | ||
}, { | ||
key: 'lookup', | ||
value: function lookup(query, done) { | ||
this.controller.search(query).then(function (results) { | ||
done(results); | ||
}); | ||
} | ||
}, { | ||
key: 'onSelect', | ||
value: function onSelect(suggestion) { | ||
this.selectedItem = suggestion.data; | ||
} | ||
}]); | ||
|
||
AutoCompleteWidget = _aureliaFramework.bindable('title')(AutoCompleteWidget) || AutoCompleteWidget; | ||
AutoCompleteWidget = _aureliaFramework.bindable({ | ||
name: 'selectedItem', | ||
attribute: 'selected-item', | ||
defaultBindingMode: _aureliaFramework.bindingMode.twoWay | ||
})(AutoCompleteWidget) || AutoCompleteWidget; | ||
AutoCompleteWidget = _aureliaFramework.bindable({ | ||
name: 'controller', | ||
attribute: 'controller', | ||
defaultBindingMode: _aureliaFramework.bindingMode.twoWay | ||
})(AutoCompleteWidget) || AutoCompleteWidget; | ||
AutoCompleteWidget = _aureliaFramework.customElement('autocomplete-widget')(AutoCompleteWidget) || AutoCompleteWidget; | ||
AutoCompleteWidget = _aureliaFramework.inject(Element)(AutoCompleteWidget) || AutoCompleteWidget; | ||
return AutoCompleteWidget; | ||
})(); | ||
|
||
exports.AutoCompleteWidget = AutoCompleteWidget; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<template> | ||
<label class="control-label" show.bind="isShowing">${title}</label> | ||
<input class="form-control" type="text" class="autocomplete-widget" /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
'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 _createDecoratedClass = (function () { function defineProperties(target, descriptors, initializers) { for (var i = 0; i < descriptors.length; i++) { var descriptor = descriptors[i]; var decorators = descriptor.decorators; var key = descriptor.key; delete descriptor.key; delete descriptor.decorators; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor || descriptor.initializer) descriptor.writable = true; if (decorators) { for (var f = 0; f < decorators.length; f++) { var decorator = decorators[f]; if (typeof decorator === 'function') { descriptor = decorator(target, key, descriptor) || descriptor; } else { throw new TypeError('The decorator for method ' + descriptor.key + ' is of the invalid type ' + typeof decorator); } } if (initializers) initializers[key] = descriptor.initializer; } Object.defineProperty(target, key, descriptor); } } return function (Constructor, protoProps, staticProps, protoInitializers, staticInitializers) { if (protoProps) defineProperties(Constructor.prototype, protoProps, protoInitializers); if (staticProps) defineProperties(Constructor, staticProps, staticInitializers); return Constructor; }; })(); | ||
|
||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
|
||
var _inject$bindable$customElement$bindingMode$computedFrom = require('aurelia-framework'); | ||
|
||
var _$ = require('jquery'); | ||
|
||
var _$2 = _interopRequireWildcard(_$); | ||
|
||
var _autocomplete = require('devbridge/jQuery-Autocomplete'); | ||
|
||
var _autocomplete2 = _interopRequireWildcard(_autocomplete); | ||
|
||
var AutoCompleteWidget = (function () { | ||
function AutoCompleteWidget(element) { | ||
_classCallCheck(this, _AutoCompleteWidget); | ||
|
||
this.element = element; | ||
} | ||
|
||
var _AutoCompleteWidget = AutoCompleteWidget; | ||
|
||
_createDecoratedClass(_AutoCompleteWidget, [{ | ||
key: 'bind', | ||
value: function bind() { | ||
this.apply(); | ||
} | ||
}, { | ||
key: 'isShowing', | ||
decorators: [_inject$bindable$customElement$bindingMode$computedFrom.computedFrom('title')], | ||
get: function () { | ||
return this.title != undefined && this.title.length > 0; | ||
} | ||
}, { | ||
key: 'apply', | ||
value: function apply() { | ||
_$2['default'](this.element).find('input').autocomplete({ | ||
lookup: this.lookup.bind(this), | ||
onSelect: this.onSelect.bind(this) | ||
}); | ||
} | ||
}, { | ||
key: 'lookup', | ||
value: function lookup(query, done) { | ||
this.controller.search(query).then(function (results) { | ||
done(results); | ||
}); | ||
} | ||
}, { | ||
key: 'onSelect', | ||
value: function onSelect(suggestion) { | ||
this.selectedItem = suggestion.data; | ||
} | ||
}]); | ||
|
||
AutoCompleteWidget = _inject$bindable$customElement$bindingMode$computedFrom.bindable('title')(AutoCompleteWidget) || AutoCompleteWidget; | ||
AutoCompleteWidget = _inject$bindable$customElement$bindingMode$computedFrom.bindable({ | ||
name: 'selectedItem', | ||
attribute: 'selected-item', | ||
defaultBindingMode: _inject$bindable$customElement$bindingMode$computedFrom.bindingMode.twoWay | ||
})(AutoCompleteWidget) || AutoCompleteWidget; | ||
AutoCompleteWidget = _inject$bindable$customElement$bindingMode$computedFrom.bindable({ | ||
name: 'controller', | ||
attribute: 'controller', | ||
defaultBindingMode: _inject$bindable$customElement$bindingMode$computedFrom.bindingMode.twoWay | ||
})(AutoCompleteWidget) || AutoCompleteWidget; | ||
AutoCompleteWidget = _inject$bindable$customElement$bindingMode$computedFrom.customElement('autocomplete-widget')(AutoCompleteWidget) || AutoCompleteWidget; | ||
AutoCompleteWidget = _inject$bindable$customElement$bindingMode$computedFrom.inject(Element)(AutoCompleteWidget) || AutoCompleteWidget; | ||
return AutoCompleteWidget; | ||
})(); | ||
|
||
exports.AutoCompleteWidget = AutoCompleteWidget; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.