-
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
16 changed files
with
270 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<template> | ||
<div class="form-group"> | ||
<label for="lookupField" class="control-label">${title}</label> | ||
<select class="form-control"> | ||
<option repeat.for="option of options" value="${option.value}" selected.one-time="$parent.selected === option.value">${option.description}</option> | ||
</select> | ||
</div> | ||
</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,60 @@ | ||
define(['exports', 'aurelia-framework'], function (exports, _aureliaFramework) { | ||
'use strict'; | ||
|
||
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 Combo = (function () { | ||
function Combo(element) { | ||
_classCallCheck(this, _Combo); | ||
|
||
this.element = element; | ||
this._boundChange = this._change.bind(this); | ||
} | ||
|
||
_createClass(Combo, [{ | ||
key: 'attached', | ||
value: function attached() { | ||
this.combo = this.element.querySelector('select'); | ||
this.combo.addEventListener('change', this._boundChange); | ||
} | ||
}, { | ||
key: 'detached', | ||
value: function detached() { | ||
this.combo.removeEventListener('change', this._boundChange); | ||
} | ||
}, { | ||
key: '_change', | ||
value: function _change(change) { | ||
this.selected = change.target.value; | ||
} | ||
}]); | ||
|
||
var _Combo = Combo; | ||
Combo = (0, _aureliaFramework.inject)(Element)(Combo) || Combo; | ||
Combo = (0, _aureliaFramework.bindable)({ | ||
name: 'selected', | ||
attribute: 'selected', | ||
defaultBindingMode: _aureliaFramework.bindingMode.twoWay | ||
})(Combo) || Combo; | ||
Combo = (0, _aureliaFramework.bindable)({ | ||
name: 'options', | ||
attribute: 'options', | ||
defaultBindingMode: _aureliaFramework.bindingMode.oneTime | ||
})(Combo) || Combo; | ||
Combo = (0, _aureliaFramework.bindable)({ | ||
name: 'title', | ||
attribute: 'title', | ||
defaultBindingMode: _aureliaFramework.bindingMode.oneTime | ||
})(Combo) || Combo; | ||
Combo = (0, _aureliaFramework.customElement)('combo')(Combo) || Combo; | ||
return Combo; | ||
})(); | ||
|
||
exports.Combo = Combo; | ||
}); |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<template> | ||
|
||
<div class="form-group"> | ||
<label for="lookupField" class="control-label">${title}</label> | ||
<input type="text" id="lookupField"> | ||
|
||
</div> | ||
</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,8 @@ | ||
<template> | ||
<div class="form-group"> | ||
<label for="lookupField" class="control-label">${title}</label> | ||
<select class="form-control"> | ||
<option repeat.for="option of options" value="${option.value}" selected.one-time="$parent.selected === option.value">${option.description}</option> | ||
</select> | ||
</div> | ||
</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,60 @@ | ||
'use strict'; | ||
|
||
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 _aureliaFramework = require('aurelia-framework'); | ||
|
||
var Combo = (function () { | ||
function Combo(element) { | ||
_classCallCheck(this, _Combo); | ||
|
||
this.element = element; | ||
this._boundChange = this._change.bind(this); | ||
} | ||
|
||
_createClass(Combo, [{ | ||
key: 'attached', | ||
value: function attached() { | ||
this.combo = this.element.querySelector('select'); | ||
this.combo.addEventListener('change', this._boundChange); | ||
} | ||
}, { | ||
key: 'detached', | ||
value: function detached() { | ||
this.combo.removeEventListener('change', this._boundChange); | ||
} | ||
}, { | ||
key: '_change', | ||
value: function _change(change) { | ||
this.selected = change.target.value; | ||
} | ||
}]); | ||
|
||
var _Combo = Combo; | ||
Combo = (0, _aureliaFramework.inject)(Element)(Combo) || Combo; | ||
Combo = (0, _aureliaFramework.bindable)({ | ||
name: 'selected', | ||
attribute: 'selected', | ||
defaultBindingMode: _aureliaFramework.bindingMode.twoWay | ||
})(Combo) || Combo; | ||
Combo = (0, _aureliaFramework.bindable)({ | ||
name: 'options', | ||
attribute: 'options', | ||
defaultBindingMode: _aureliaFramework.bindingMode.oneTime | ||
})(Combo) || Combo; | ||
Combo = (0, _aureliaFramework.bindable)({ | ||
name: 'title', | ||
attribute: 'title', | ||
defaultBindingMode: _aureliaFramework.bindingMode.oneTime | ||
})(Combo) || Combo; | ||
Combo = (0, _aureliaFramework.customElement)('combo')(Combo) || Combo; | ||
return Combo; | ||
})(); | ||
|
||
exports.Combo = Combo; |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<template> | ||
|
||
<div class="form-group"> | ||
<label for="lookupField" class="control-label">${title}</label> | ||
<input type="text" id="lookupField"> | ||
|
||
</div> | ||
</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,8 @@ | ||
<template> | ||
<div class="form-group"> | ||
<label for="lookupField" class="control-label">${title}</label> | ||
<select class="form-control"> | ||
<option repeat.for="option of options" value="${option.value}" selected.one-time="$parent.selected === option.value">${option.description}</option> | ||
</select> | ||
</div> | ||
</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,38 @@ | ||
import {customElement, inject, bindable, bindingMode} from 'aurelia-framework'; | ||
|
||
@customElement('combo') | ||
@bindable({ | ||
name:'title', | ||
attribute:'title', | ||
defaultBindingMode: bindingMode.oneTime | ||
}) | ||
@bindable({ | ||
name:'options', | ||
attribute:'options', | ||
defaultBindingMode: bindingMode.oneTime | ||
}) | ||
@bindable({ | ||
name:'selected', | ||
attribute:'selected', | ||
defaultBindingMode: bindingMode.twoWay | ||
}) | ||
@inject(Element) | ||
export class Combo { | ||
constructor(element) { | ||
this.element = element; | ||
this._boundChange = this._change.bind(this); | ||
} | ||
|
||
attached() { | ||
this.combo = this.element.querySelector('select'); | ||
this.combo.addEventListener('change', this._boundChange); | ||
} | ||
|
||
detached() { | ||
this.combo.removeEventListener('change', this._boundChange); | ||
} | ||
|
||
_change(change) { | ||
this.selected = change.target.value; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export function configure(aurelia) { | ||
aurelia.globalResources(['lookup-widget','autocomplete-widget']); | ||
aurelia.globalResources(['lookup-widget','autocomplete-widget', 'combo']); | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<template> | ||
|
||
<div class="form-group"> | ||
<label for="lookupField" class="control-label">${title}</label> | ||
<input type="text" id="lookupField"> | ||
|
||
</div> | ||
</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,8 @@ | ||
<template> | ||
<div class="form-group"> | ||
<label for="lookupField" class="control-label">${title}</label> | ||
<select class="form-control"> | ||
<option repeat.for="option of options" value="${option.value}" selected.one-time="$parent.selected === option.value">${option.description}</option> | ||
</select> | ||
</div> | ||
</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,68 @@ | ||
System.register(['aurelia-framework'], function (_export) { | ||
'use strict'; | ||
|
||
var customElement, inject, bindable, bindingMode, Combo; | ||
|
||
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) { | ||
customElement = _aureliaFramework.customElement; | ||
inject = _aureliaFramework.inject; | ||
bindable = _aureliaFramework.bindable; | ||
bindingMode = _aureliaFramework.bindingMode; | ||
}], | ||
execute: function () { | ||
Combo = (function () { | ||
function Combo(element) { | ||
_classCallCheck(this, _Combo); | ||
|
||
this.element = element; | ||
this._boundChange = this._change.bind(this); | ||
} | ||
|
||
_createClass(Combo, [{ | ||
key: 'attached', | ||
value: function attached() { | ||
this.combo = this.element.querySelector('select'); | ||
this.combo.addEventListener('change', this._boundChange); | ||
} | ||
}, { | ||
key: 'detached', | ||
value: function detached() { | ||
this.combo.removeEventListener('change', this._boundChange); | ||
} | ||
}, { | ||
key: '_change', | ||
value: function _change(change) { | ||
this.selected = change.target.value; | ||
} | ||
}]); | ||
|
||
var _Combo = Combo; | ||
Combo = inject(Element)(Combo) || Combo; | ||
Combo = bindable({ | ||
name: 'selected', | ||
attribute: 'selected', | ||
defaultBindingMode: bindingMode.twoWay | ||
})(Combo) || Combo; | ||
Combo = bindable({ | ||
name: 'options', | ||
attribute: 'options', | ||
defaultBindingMode: bindingMode.oneTime | ||
})(Combo) || Combo; | ||
Combo = bindable({ | ||
name: 'title', | ||
attribute: 'title', | ||
defaultBindingMode: bindingMode.oneTime | ||
})(Combo) || Combo; | ||
Combo = customElement('combo')(Combo) || Combo; | ||
return Combo; | ||
})(); | ||
|
||
_export('Combo', Combo); | ||
} | ||
}; | ||
}); |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<template> | ||
|
||
<div class="form-group"> | ||
<label for="lookupField" class="control-label">${title}</label> | ||
<input type="text" id="lookupField"> | ||
|
||
</div> | ||
</template> |