passing params asis

master
Malar Kannan 2017-07-31 18:06:01 +05:30
parent 7d759f96b2
commit 193cccdfa4
1 changed files with 4 additions and 8 deletions

View File

@ -130,19 +130,15 @@ function propListInput(params: any) {
let { field, changed } = params; let { field, changed } = params;
return ( return (
<LexInputContainer key={field} label={changedLabel(changed, field)}> <LexInputContainer key={field} label={changedLabel(changed, field)}>
<PropListInput params={params} /> <PropListInput {...params} />
</LexInputContainer> </LexInputContainer>
); );
} }
class PropListInput extends React.Component<any, any> { class PropListInput extends React.Component<any, any> {
constructor(props: any) { state = { modalOpen: false, exKey: '', exVal: '' };
super(props);
this.state = { modalOpen: false, exKey: '', exVal: '' };
}
dropOptsForVal(value: any) { dropOptsForVal(value: any) {
let { field, langSelOpts } = this.props.params; let { field, langSelOpts } = this.props;
let fieldOpts = _.get<any>(langSelOpts, field, []); let fieldOpts = _.get<any>(langSelOpts, field, []);
function valueForKey(key: string) { function valueForKey(key: string) {
let match = _.find(value, (v: any) => _.isEqual(v.key, key)); let match = _.find(value, (v: any) => _.isEqual(v.key, key));
@ -162,7 +158,7 @@ class PropListInput extends React.Component<any, any> {
} }
public render() { public render() {
let { sh, value } = this.props.params; let { sh, value } = this.props;
let dropOptions = this.dropOptsForVal(value); let dropOptions = this.dropOptsForVal(value);
let renderLabel = (label: any) => ({ let renderLabel = (label: any) => ({
content: `${label.value.key}-${label.value.value}`, content: `${label.value.key}-${label.value.value}`,