removing blueprintjs wip

master
Malar Kannan 2017-06-21 18:32:11 +05:30
parent 026aed6604
commit 78c746af3b
1 changed files with 19 additions and 21 deletions

View File

@ -1,14 +1,14 @@
import * as React from 'react';
import * as _ from 'lodash';
import {
FocusStyleManager,
} from '@blueprintjs/core';
// import { Image } from 'semantic-ui-react';
// import {
// FocusStyleManager,
// } from '@blueprintjs/core';
import { Image,Input } from 'semantic-ui-react';
import * as XML from 'xml2js';
import { LexSingleInput } from './LexInputComponents';
const { Flex, Box } = require('reflexbox');
FocusStyleManager.onlyShowFocusOnTabs();
// FocusStyleManager.onlyShowFocusOnTabs();
interface LexEditorProps {
fileName: RequestInfo;
@ -115,9 +115,8 @@ class LexSearch extends React.Component<any, any> {
</div>
<div className="pt-input-group" style={{ width: '120px' }}>
<span className="pt-icon pt-icon-search" />
<input
<Input
type="text"
className="pt-input"
placeholder="Search input"
dir="auto"
onChange={e => this.handleLookup(e)}
@ -193,49 +192,48 @@ function LexMatches(props: any) {
class LexEdit extends React.Component<any, any> {
public render() {
let li = this.props.lexItem;
let lexFields = _.keys(fieldMetaMap).map(ft => {
let defaultText = _.get<any>(li, fieldMetaMap[ft].lens, '');
let lexFields = _.keys(fieldMetaMap).map(field => {
let defaultText = _.get<any>(li, fieldMetaMap[field].lens, '');
let sh = (e: any) => {
let eventData = {};
eventData[ft] = e.target.value;
eventData[field] = e.target.value;
this.handleOnChange(eventData);
};
// let pred = (x: any) => _.isEqual(fieldMetaMap[ft].type, x);
// _.findIndex(['text', 'number'], pred) !== -1
if (fieldMetaMap[ft].type === 'text') {
if (fieldMetaMap[field].type === 'text') {
return (
<LexSingleInput key={ft} labelText={_.capitalize(ft)}>
<input
<LexSingleInput key={field} labelText={_.capitalize(field)}>
<Input
onChange={sh}
style={{ width: '110px' }}
className="pt-input"
defaultValue={defaultText}
placeholder={ft}
placeholder={field}
type="text"
dir="auto"
/>
</LexSingleInput>
);
} else if (fieldMetaMap[ft].type === 'select') {
} else if (fieldMetaMap[field].type === 'select') {
return (
<LexSingleInput key={ft} labelText={_.capitalize(ft)}>
<LexSingleInput key={field} labelText={_.capitalize(field)}>
<select
onChange={sh}
style={{ width: '110px' }}
className="pt-select"
defaultValue={defaultText}
>
{this.props.selectionMeta[ft].map((k: any, i: any, c: any) => {
{this.props.selectionMeta[field].map((k: any, i: any, c: any) => {
return <option key={i} value={k}> {k}</option>;
})}
</select>
</LexSingleInput>
);
} else if (fieldMetaMap[ft].type === 'preview' && defaultText !== '') {
} else if (fieldMetaMap[field].type === 'preview' && defaultText !== '') {
let imageSrc = imageRoot + defaultText;
return (
<LexSingleInput key={ft} labelText={_.capitalize(ft)}>
<img src={imageSrc} width="70px"/>
<LexSingleInput key={field} labelText={_.capitalize(field)}>
<Image src={imageSrc} size="small"/>
</LexSingleInput>
);
} else {