"use strict"; import classNames from "classnames"; import PropTypes from "prop-types"; import createReactClass from "create-react-class"; import PureRenderMixin from 'react-addons-pure-render-mixin'; import {CSSTransition, TransitionGroup} from "react-transition-group"; import {Controlled as CodeMirror} from 'react-codemirror2'; require('codemirror/mode/fcs-ql/fcs-ql'); require('codemirror/mode/javascript/javascript'); var PT = PropTypes; function nextId() { return nextId.id++; } nextId.id = 0; var QueryInput = createReactClass({ //fixme! - class QueryInput extends React.Component { propTypes: { searchedLanguage: PT.array, queryTypeId: PT.string.isRequired, query: PT.string, embedded: PT.bool.isRequired, placeholder: PT.string, onQueryChange: PT.func.isRequired, onKeyDown: PT.func.isRequired }, render: function() { if (this.props.queryTypeId == "cql") { return ( this.props.onQueryChange(evt.target.value) } //onQuery={this.props.onQuery} onKeyDown={this.props.onKeyDown} ref="cqlOrEmbeddedQuery"/> /* // { // this.setState({value}); // }} // onChange={(editor, data, value) => { // this.props.onChange(value); // }} // onQuery={this.props.onQuery} // onKeyDown={(editor, event) => { // this.props.onKeyDown(editor, event) // }} // ref="cqlOrEmbeddedQuery" // > // */ ); } else if (this.props.embedded && this.props.queryTypeId == "fcs") { return (