-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
22 lines (22 loc) · 992 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var React = require('react');
var TypeAhead = (function (_super) {
__extends(TypeAhead, _super);
function TypeAhead() {
_super.apply(this, arguments);
}
TypeAhead.prototype.bindTypeAhead = function (input) {
var typeahead = jQuery(input).typeahead(this.props.options, this.props.data);
typeahead.bind('typeahead:selected', this.props.onSelected);
};
TypeAhead.prototype.render = function () {
return React.createElement("input", {type: 'text', className: this.props.className, onChange: this.props.onChange, placeholder: this.props.placeholder, ref: this.bindTypeAhead.bind(this)});
};
return TypeAhead;
}(React.Component));
exports.TypeAhead = TypeAhead;