/** * Created by guopeng on 16/8/1. */ import * as React from "react"; import {ItemBodyGlyph} from "../behavior/ItemBodyGlyph"; import {ReportItemBase} from "../../items/ReportItemBase"; import {ReportItem} from "../../items/ReportItem"; interface Props { glyph: ItemBodyGlyph } export default class ItemEditingDesigner extends React.Component{ private _glyph: ItemBodyGlyph; constructor(props: Props, contex){ super(props,contex); // this._glyph = this.props.glyph; this.state = { text: props.glyph.item["value"] }; this.onChange = this.onChange.bind(this); } componentWillReceiveProps(props: Props){ this.state = this.state = { text: props.glyph.item["value"] }; } render(): JSX.Element{ const glyph = this.props.glyph; const item = glyph.item as ReportItem; const value = item["value"]; const bound = glyph.bounds; const styles = { position: "absolute", // backgroundColor: item.style.backgroundColor, left: bound.x, top: bound.y, width: bound.width, height: bound.height } return (
); } onChange(e: any): void{ this.setState({"text": e.target.value}); } }