import * as React from 'react'; import * as _ from 'lodash'; import { Label, Form } from 'semantic-ui-react'; const { Flex, Box } = require('reflexbox'); import { Input, Image } from 'semantic-ui-react'; import { SortableContainer, SortableElement, arrayMove } from 'react-sortable-hoc'; class LexSingleInput extends React.Component { public render() { return (
{this.props.label} {this.props.children}
); } } function changedLabel(changed: boolean, text: string) { let labelClass = changed ? 'olive' : ''; return ( ); } const imageRoot = '/png/'; export function textInput(params: any) { let { field, sh, value, changed } = params; return ( ); } export function selectInput(params: any) { let { field, sh, value, options, langSelOpts, changed } = params; let staticOpts = options; let fieldOpts = _.get(langSelOpts, field, []); let selOpts = staticOpts ? staticOpts : fieldOpts; return ( ); } export function imagePreview(params: any) { let { field, value, changed } = params; let imageSrc = imageRoot + value; return value !== '' ? ( ) : textInput(params); } const SortableItem = SortableElement(({ value }) =>
  • {value}
  • ); const SortableList = SortableContainer(({ items }) => { return (
      {items.map((value: any, index: any) => ( ))}
    ); }); export function listInput(params: any) { let { field, value, changed } = params; let sortEndHandler = (idxs: any) => { let { oldIndex, newIndex } = idxs; arrayMove(value, oldIndex, newIndex); }; console.log('field: ', field, 'value: ', value); return ( ); }