import * as React from 'react'; import * as _ from 'lodash'; import { LexEdit } from './LexEdit'; import { Input, Dropdown, } from 'semantic-ui-react'; const { Flex } = require('reflexbox'); // container component export class LexEditor extends React.Component { public render() { let searchMeta = this.props.fieldMetaMap[this.props.searchState.searchType]; let searchText = this.props.searchState.searchValue; let matchedEntries = _.chain(this.props.allEntries) .filter((q: any) => searchMeta.get(q) === searchText) .take(10) .value(); let { fieldMetaMap, save, saveXMLBackend } = this.props; return (
); } } class LexSearch extends React.Component { public render() { let dropOptions = _.keys(this.props.fieldMetaMap).map((k, i, c) => { return { key: i, value: k, text: _.capitalize(k) }; }); return (
this.handleChange(d, true)} value={this.props.searchState.searchType} compact={true} selection={true} /> this.handleChange(d, false)} />
); } private handleChange(e: any, t: boolean) { if (t) { this.props.searchForType(e.value); } else { this.props.searchForValue(e.value); } } } function LexMatches(params: any) { const selectMode = (props: any) => { if (props.searchText === '') { return (

Empty

Type something in the searchbar.
); } else { let editEntries = props.matchedEntries.map((mObj: any) => { let uniqueKey = mObj.guid[0] + '#' + mObj.$.id; return ( ); }); let addProps = props.searchMeta.set({}, props.searchText); let addEntry = ( ); editEntries.push(addEntry); return editEntries; } }; // const debouncedSelect = _.throttle(selectMode,10000,{leading:true}); return ( {selectMode(params)} ); }