diff --git a/src/components/filter/CombiningOperatorSelect.jsx b/src/components/filter/CombiningOperatorSelect.jsx
new file mode 100644
index 00000000..7227be48
--- /dev/null
+++ b/src/components/filter/CombiningOperatorSelect.jsx
@@ -0,0 +1,41 @@
+import React from 'react'
+import SelectInput from '../inputs/SelectInput'
+
+import input from '../../config/input.js'
+import { margins } from '../../config/scales.js'
+
+class CombiningOperatorSelect extends React.Component {
+ static propTypes = {
+ value: React.PropTypes.string.isRequired,
+ onChange: React.PropTypes.func.isRequired,
+ style: React.PropTypes.object,
+ }
+
+ render() {
+ return
+
+
+
+ }
+}
+
+export default CombiningOperatorSelect
diff --git a/src/components/filter/FilterEditor.jsx b/src/components/filter/FilterEditor.jsx
index d7de3b53..05e74b60 100644
--- a/src/components/filter/FilterEditor.jsx
+++ b/src/components/filter/FilterEditor.jsx
@@ -3,11 +3,13 @@ import GlSpec from 'mapbox-gl-style-spec/reference/latest.js'
import input from '../../config/input.js'
import colors from '../../config/colors.js'
-import { margins } from '../../config/scales.js'
+import { margins, fontSizes } from '../../config/scales.js'
+import CombiningOperatorSelect from './CombiningOperatorSelect'
import DocLabel from '../fields/DocLabel'
import Button from '../Button'
import SelectInput from '../inputs/SelectInput'
+import MultiButtonInput from '../inputs/MultiButtonInput'
import StringInput from '../inputs/StringInput'
import AutocompleteInput from '../inputs/AutocompleteInput'
@@ -32,45 +34,6 @@ function hasNestedCombiningFilter(filter) {
return false
}
-class CombiningOperatorSelect extends React.Component {
- static propTypes = {
- value: React.PropTypes.string.isRequired,
- onChange: React.PropTypes.func.isRequired,
- style: React.PropTypes.object,
- }
-
- render() {
- const options = combiningFilterOps.map(op => {
- return
- })
-
- return
-
-
-
- }
-}
class OperatorSelect extends React.Component {
static propTypes = {
@@ -194,16 +157,18 @@ export default class CombiningFilterEditor extends React.Component {
const filterEditors = filters.map((f, idx) => {
return
-
+
+
+
-
+
-
{filterEditors}
}
diff --git a/src/components/inputs/MultiButtonInput.jsx b/src/components/inputs/MultiButtonInput.jsx
index ef780158..a8eab9e0 100644
--- a/src/components/inputs/MultiButtonInput.jsx
+++ b/src/components/inputs/MultiButtonInput.jsx
@@ -15,21 +15,29 @@ class MultiButtonInput extends React.Component {
}
render() {
- const selectedValue = this.props.value || this.props.options[0][0]
- const buttons = this.props.options.map(([val, label])=> {
+ let options = this.props.options
+ if(options.length > 0 && !Array.isArray(options[0])) {
+ options = options.map(v => [v, v])
+ }
+
+ const selectedValue = this.props.value || options[0][0]
+ const buttons = options.map(([val, label])=> {
return
})
- return
+ return
{buttons}
}
diff --git a/src/components/inputs/SelectInput.jsx b/src/components/inputs/SelectInput.jsx
index ba07ef2c..8c3f0b99 100644
--- a/src/components/inputs/SelectInput.jsx
+++ b/src/components/inputs/SelectInput.jsx
@@ -11,9 +11,10 @@ class SelectInput extends React.Component {
render() {
- const options = this.props.options.map(([val, label])=> {
- return
- })
+ let options = this.props.options
+ if(options.length > 0 && !Array.isArray(options[0])) {
+ options = options.map(v => [v, v])
+ }
return
}
}