UNPKG

solrkit

Version:

![Build Status](https://travis-ci.org/garysieling/solrkit.svg?branch=master) ![Dependencies](https://david-dm.org/garysieling/solrkit/status.svg) UI Components for Solr, using TypeScript + React

50 lines 2.25 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); import * as React from 'react'; import { Icon, Card, Input, Grid } from 'semantic-ui-react'; import 'semantic-ui-css/semantic.min.css'; var Properties = (function (_super) { __extends(Properties, _super); function Properties() { var _this = _super.call(this) || this; _this.state = { flip: true }; _this.onFlip = _this.onFlip.bind(_this); return _this; } Properties.prototype.onFlip = function () { this.setState({ flip: !this.state.flip }); }; Properties.prototype.render = function () { var renderedProperties = this.props.properties.map(function (property, i) { return (React.createElement(Grid.Row, { key: i }, React.createElement(Grid.Column, { style: { width: '100px' } }, property.display), React.createElement(Grid.Column, null, React.createElement(Input, null)))); }); var view = this.state.flip ? (React.createElement(Grid.Row, null, React.createElement(Grid.Column, { style: { width: '100px' } }, this.props.children))) : renderedProperties; return ( // TODO layout component React.createElement(Card, { style: { width: '300px' } }, React.createElement(Grid, { columns: 2 }, view), React.createElement(Card.Content, null, React.createElement(Card.Header, null, React.createElement(Icon, { name: "paint brush", onClick: this.onFlip }), " ", this.props.name)))); }; return Properties; }(React.Component)); export default Properties; //# sourceMappingURL=Properties.js.map