diff --git a/src/filter/editor.jsx b/src/filter/editor.jsx new file mode 100644 index 0000000..a334c97 --- /dev/null +++ b/src/filter/editor.jsx @@ -0,0 +1,62 @@ +import React from 'react' +import Immutable from 'immutable' +import { PropertyGroup } from '../fields/spec' +import PureRenderMixin from 'react-addons-pure-render-mixin'; +import inputStyle from '../fields/input.js' +import GlSpec from 'mapbox-gl-style-spec/reference/latest.min.js' + +export default class FilterEditor extends React.Component { + static propTypes = { + filter: React.PropTypes.array.isRequired, + onFilterChanged: React.PropTypes.func.isRequired, + } + + constructor(props) { + super(props); + this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this); + } + + render() { + const op = this.props.filter[0] + const filters = this.props.filter.slice(1) + const filterElems = filters.map(f => { + const filterOp = f[0] + const prop = f[1] + const args = f.slice(2) + + const availableFilterOperators = GlSpec.filter_operator.values + const filterOpOptions = availableFilterOperators.map(value => { + return + }) + + return