├── .bowerrc ├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .gitignore ├── LICENSE ├── README.md ├── bower.json ├── example └── src │ ├── .gitignore │ ├── WidgetFactory.js │ ├── WidgetRenderer.js │ ├── example.css │ ├── example.js │ ├── example.less │ ├── excel.css │ ├── excel.less │ └── index.html ├── gulpfile.js ├── package.json └── src ├── PropertyEditor.js ├── editors ├── BgEditor.js ├── BindingEditor.js ├── BindingValueEditor.js ├── BorderEditor.js ├── BoxEditor.js ├── BoxSizeEditor.js ├── CodeEditor.js ├── ColorPickerEditor.js ├── FontEditor.js ├── GradientColorPickerEditor.js ├── GridEditor.js ├── HtmlEditor.js ├── JsonEditor.js ├── PageOptionsEditor.js ├── PlainJsonEditor.js ├── PlainTextEditor.js ├── PositionEditor.js └── WidgetStyleEditor.js └── utils ├── EmptyValue.js ├── ModalStyles.js ├── SelectValue.js ├── TooltipStyles.js ├── TruncateString.js ├── standardPageSizes.js └── toEmptyProps.js /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "example/dist/bower_components" 3 | } 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs 2 | # editorconfig.org 3 | root = true 4 | 5 | [*] 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = false 9 | insert_final_newline = true 10 | indent_style = tab 11 | 12 | [*.json] 13 | indent_style = space 14 | indent_size = 2 15 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | .publish/* 2 | dist/* 3 | example/dist/* 4 | lib/* 5 | node_modules/* 6 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "env": { 4 | "browser": true, 5 | "node": true 6 | }, 7 | "plugins": [ 8 | "react" 9 | ], 10 | "rules": { 11 | "curly": [2, "multi-line"], 12 | "quotes": [2, "single", "avoid-escape"], 13 | "react/display-name": 0, 14 | "react/jsx-boolean-value": 1, 15 | "react/jsx-quotes": 1, 16 | "react/jsx-no-undef": 1, 17 | "react/jsx-sort-props": 0, 18 | "react/jsx-sort-prop-types": 1, 19 | "react/jsx-uses-react": 1, 20 | "react/jsx-uses-vars": 1, 21 | "react/no-did-mount-set-state": 1, 22 | "react/no-did-update-set-state": 1, 23 | "react/no-multi-comp": 1, 24 | "react/no-unknown-property": 1, 25 | "react/prop-types": 1, 26 | "react/react-in-jsx-scope": 1, 27 | "react/self-closing-comp": 1, 28 | "react/wrap-multilines": 1, 29 | "semi": 2, 30 | "strict": 0 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Coverage tools 11 | lib-cov 12 | coverage 13 | coverage.html 14 | .cover* 15 | 16 | # Dependency directory 17 | node_modules 18 | 19 | # Example build directory 20 | example/dist 21 | .publish 22 | 23 | # Editor and other tmp files 24 | *.swp 25 | *.un~ 26 | *.iml 27 | *.ipr 28 | *.iws 29 | *.sublime-* 30 | .idea/ 31 | *.DS_Store 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Roman Samec 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | React property editor 2 | ======================= 3 | 4 | It is based on [react-json](https://github.com/arqex/react-json) and offers some predefined editors. 5 | 6 | + html editor - [react-tinymce](https://github.com/mzabriskie/react-tinymce) 7 | + code editor - [react-code-mirror](https://github.com/ForbesLindesay/react-code-mirror) 8 | + color picker - [react-color-picker](https://github.com/zippyui/react-color-picker) 9 | + binding editor - [react-binding](https://github.com/rsamec/react-binding) 10 | 11 | 12 | ## Demo & Examples 13 | 14 | [Live demo](http://rsamec.github.io/react-property-editor/) 15 | 16 | To build the examples locally, run: 17 | 18 | ``` 19 | npm install 20 | gulp dev 21 | ``` 22 | 23 | Then open [`localhost:8000`](http://localhost:8000) in a browser. 24 | 25 | 26 | ## Installation 27 | 28 | The easiest way to use this component is to install it from NPM and include it in your own React build process (using [Browserify](http://browserify.org), [Webpack](http://webpack.github.io/), etc). 29 | 30 | You can also use the standalone build by including `dist/react-pathjs-chart.js` in your page. If you use this, make sure you have already included React, and it is available as a global variable. 31 | 32 | ``` 33 | npm install react-pathjs-chart --save 34 | ``` 35 | 36 | 37 | ## Usage 38 | 39 | ``` 40 | import PropertyEditor from 'react-property-editor'; 41 | 42 | var App = React.createClass({ 43 | getInitialState(){ 44 | return { 45 | value: { 46 | name: "amigo", 47 | color: '', 48 | html: '', 49 | code: '', 50 | chart: { 51 | showLines: true, 52 | axisX: { 53 | showLines: true 54 | }, 55 | }, 56 | array: [1, 2, 3] 57 | } 58 | } 59 | }, 60 | logChange(value){ 61 | console.log(value); 62 | this.setState({value:value}); 63 | console.log(this.state.value); 64 | 65 | }, 66 | render() { 67 | return (
{JSON.stringify(this.state.current.props, null, 2)}79 |
{JSON.stringify(this.state.current.binding, null, 2)}80 |