diff --git a/src/components/fields/ZoomSpecField.jsx b/src/components/fields/ZoomSpecField.jsx index a080240..32a329e 100644 --- a/src/components/fields/ZoomSpecField.jsx +++ b/src/components/fields/ZoomSpecField.jsx @@ -5,6 +5,7 @@ import Button from '../Button' import SpecField from './SpecField' import NumberInput from '../inputs/NumberInput' import DocLabel from './DocLabel' +import InputBlock from '../inputs/InputBlock' import AddIcon from 'react-icons/lib/md/add-circle-outline' import DeleteIcon from 'react-icons/lib/md/delete' @@ -85,46 +86,36 @@ export default class ZoomSpecProperty extends React.Component { } renderZoomProperty() { - const label =
- -
- const zoomFields = this.props.value.stops.map((stop, idx) => { const zoomLevel = stop[0] const value = stop[1] + const deleteStopBtn= - return
- {label} - -
- this.changeStop(idx, changedStop, value)} - min={0} - max={22} - /> + return +
+
+ this.changeStop(idx, changedStop, value)} + min={0} + max={22} + /> +
+
+ this.changeStop(idx, zoomLevel, newValue)} + /> +
-
- this.changeStop(idx, zoomLevel, newValue)} - /> -
-
+ }) return
@@ -139,28 +130,18 @@ export default class ZoomSpecProperty extends React.Component { } renderProperty() { - return
- - {this.props.fieldSpec['zoom-function'] && - - } - -
+ let zoomBtn = null + if(this.props.fieldSpec['zoom-function']) { + zoomBtn = + } + + return + + } render() { @@ -172,6 +153,31 @@ export default class ZoomSpecProperty extends React.Component { } } +function MakeZoomFunctionButton(props) { + return +} + +function DeleteStopButton(props) { + return +} + function labelFromFieldName(fieldName) { let label = fieldName.split('-').slice(1).join(' ') return capitalize(label) diff --git a/src/components/inputs/ArrayInput.jsx b/src/components/inputs/ArrayInput.jsx index 45f6b86..c7c313b 100644 --- a/src/components/inputs/ArrayInput.jsx +++ b/src/components/inputs/ArrayInput.jsx @@ -11,7 +11,6 @@ class ArrayInput extends React.Component { type: React.PropTypes.string, length: React.PropTypes.number, default: React.PropTypes.array, - style: React.PropTypes.object, onChange: React.PropTypes.func, } @@ -27,31 +26,23 @@ class ArrayInput extends React.Component { } render() { - const commonStyle = { - width: '48%', - marginRight: '2%', - marginBottom: '2%' - } const inputs = this.values.map((v, i) => { if(this.props.type === 'number') { return } else { return } }) - return
+ return
{inputs}
} diff --git a/src/components/inputs/AutocompleteInput.jsx b/src/components/inputs/AutocompleteInput.jsx index 77d0dc0..d269c7d 100644 --- a/src/components/inputs/AutocompleteInput.jsx +++ b/src/components/inputs/AutocompleteInput.jsx @@ -8,8 +8,6 @@ class AutocompleteInput extends React.Component { static propTypes = { value: React.PropTypes.string, options: React.PropTypes.array, - wrapperStyle: React.PropTypes.object, - inputStyle: React.PropTypes.object, onChange: React.PropTypes.func, } @@ -20,7 +18,10 @@ class AutocompleteInput extends React.Component { render() { return { - return React.cloneElement(child, { - style: { - ...child.props.style, - width: '50%', - } - }) - }) - } - render() { return
{this.props.doc && - +
+ +
} {!this.props.doc && } - {this.renderChildren()} + {this.props.action && +
+ {this.props.action} +
+ } +
+ {this.props.children} +
} } diff --git a/src/components/inputs/NumberInput.jsx b/src/components/inputs/NumberInput.jsx index 43010d9..8393811 100644 --- a/src/components/inputs/NumberInput.jsx +++ b/src/components/inputs/NumberInput.jsx @@ -4,7 +4,6 @@ import input from '../../config/input.js' class NumberInput extends React.Component { static propTypes = { value: React.PropTypes.number, - style: React.PropTypes.object, default: React.PropTypes.number, min: React.PropTypes.number, max: React.PropTypes.number, @@ -69,7 +68,6 @@ class NumberInput extends React.Component { render() { return this.changeValue(e.target.value)} diff --git a/src/components/layers/LayerSourceBlock.jsx b/src/components/layers/LayerSourceBlock.jsx index b5da99b..ea60b8a 100644 --- a/src/components/layers/LayerSourceBlock.jsx +++ b/src/components/layers/LayerSourceBlock.jsx @@ -24,7 +24,6 @@ class LayerSourceBlock extends React.Component { value={this.props.value} onChange={this.props.onChange} options={this.props.sourceIds.map(src => [src, src])} - wrapperStyle={{ width: '50%' }} /> } diff --git a/src/components/layers/LayerSourceLayerBlock.jsx b/src/components/layers/LayerSourceLayerBlock.jsx index 646badf..01b05a9 100644 --- a/src/components/layers/LayerSourceLayerBlock.jsx +++ b/src/components/layers/LayerSourceLayerBlock.jsx @@ -24,7 +24,6 @@ class LayerSourceLayer extends React.Component { value={this.props.value} onChange={this.props.onChange} options={this.props.sourceLayerIds.map(l => [l, l])} - wrapperStyle={{ width: '50%' }} /> } diff --git a/src/styles/_base.scss b/src/styles/_base.scss index 9e67c88..01ea956 100644 --- a/src/styles/_base.scss +++ b/src/styles/_base.scss @@ -50,13 +50,11 @@ h4 { margin-bottom: $margin-3; } -input { - height: 24px; -} input:focus, select:focus { color: $color-white !important; outline: #8e8e8e auto 1px !important; } + label:hover { color: $color-white; } diff --git a/src/styles/_components.scss b/src/styles/_components.scss index a9d836a..bcd7e5c 100644 --- a/src/styles/_components.scss +++ b/src/styles/_components.scss @@ -7,6 +7,7 @@ display: inline; margin-left: $margin-1; } + .maputnik-map { position: fixed !important; top: 40px; @@ -19,6 +20,7 @@ .maputnik-doc-target { cursor: help; } + .maputnik-doc-wrapper { display: inline-block; box-sizing: border-box; @@ -28,8 +30,8 @@ user-select: none; position: relative; vertical-align: top; - width: 50%; } + .maputnik-button { cursor: pointer; background-color: $color-midgray; @@ -52,16 +54,45 @@ padding: $margin-3; font-size: $font-size-5; } -.maputnik-input-block { - margin: $margin-3; + +.maputnik-icon-button { + background-color: transparent; + &:hover { + background-color: transparent; + svg { + fill: $color-white; + } + } } -.maputnik-input-block-label { - display: inline-block; - line-height: 2; - color: $color-lowgray; - user-select: none; - width: 50%; +.maputnik-input-block { + margin: $margin-3; + + &-label { + display: inline-block; + color: $color-lowgray; + user-select: none; + width: 50%; + vertical-align: top; + } + + &-content { + display: inline-block; + width: 50%; + } +} + + +.maputnik-action-block { + .maputnik-input-block-label { + display: inline-block; + width: 43%; + } + .maputnik-input-block-action { + vertical-align: top; + display: inline-block; + width: 7%; + } } .maputnik-space { diff --git a/src/styles/_filtereditor.scss b/src/styles/_filtereditor.scss new file mode 100644 index 0000000..9a5c572 --- /dev/null +++ b/src/styles/_filtereditor.scss @@ -0,0 +1,89 @@ +.maputnik-filter-editor-wrapper { + padding: $margin-3; +} + +.maputnik-filter-editor-property { + display: inline-block; + width: '22%'; +} + +.maputnik-filter-editor-operator { + display: inline-block; + width: 19%; + margin-left: 2%; +} + +.maputnik-filter-editor-args { + display: inline-block; + width: 54%; + margin-left: 2%; +} + +.maputnik-filter-editor-compound-select { + margin-bottom: $margin-2; + + .maputnik-doc-wrapper { + width: 50%; + } + + .maputnik-select { + display: inline-block; + width: 50%; + } +} + +.maputnik-filter-editor-unsupported { + color: $color-midgray; +} + +.maputnik-filter-editor { + @extend .clearfix; +} + +.maputnik-add-filter { + display: inline-block; + float: right; + margin-top: $margin-3; +} + +.maputnik-delete-filter { + @extend .maputnik-icon-button; +} + +.maputnik-filter-editor-block-action { + margin-top: $margin-2; + margin-bottom: $margin-2; +} +.maputnik-filter-editor-block-action { + display: inline-block; + width: 6%; + margin-right: 1.5%; +} + +.maputnik-filter-editor-block-content { + display: inline-block; + width: 92.5%; +} + +.maputnik-filter-editor-property { + display: inline-block; + width: 25%; +} + +.maputnik-filter-editor-operator { + display: inline-block; + width: 17%; + .maputnik-select { + width: 100%; + } +} + +.maputnik-filter-editor-args { + display: inline-block; + width: 54%; + + .maputnik-string, .maputnik-number { + width: 100%; + } +} + diff --git a/src/styles/_input.scss b/src/styles/_input.scss index aff40be..d34879a 100644 --- a/src/styles/_input.scss +++ b/src/styles/_input.scss @@ -1,21 +1,22 @@ -.maputnik-base { - display: inline-block; +//INPUT +.maputnik-input { + height: 24px; + width: 100%; + display: block; box-sizing: border-box; font-size: $font-size-6; line-height: 2; padding-left: $margin-2; padding-right: $margin-2; -} -.maputnik-input { - @extend .maputnik-base; border: none; background-color: $color-gray; color: $color-lowgray; } + .maputnik-string { @extend .maputnik-input; - width: 50%; } + .maputnik-number { @extend .maputnik-input; } @@ -29,107 +30,69 @@ position: relative; display: inline; } + .maputnik-color-picker-offset { + } .maputnik-color-picker-overlay { + } -.maputnik-checkbox-wrapper { - display: inline-block; - box-sizing: border-box; - padding: 0px; - position: relative; - text-align: center; - vertical-align: middle; - cursor: pointer; +// ARRAY + +.maputnik-array { + > * { + margin-bottom: $margin-3; + } } +// SELECT +.maputnik-select { + @extend .maputnik-input; + height: 24px; +} + +// CHECKBOX .maputnik-checkbox { position: absolute; z-index: -1; opacity: 0; width: 50%; -} -.maputnik-checkbox-box { - display: inline-block; - text-align: center; - height: 24px; - width: 24px; - margin-right: $margin-2; - background-color: $color-gray; - border-radius: 2px; - border-style: solid; - border-width: 2px; - border-color: $color-gray; - transition: background-color 0.1s ease-out; -} -.maputnik-checkbox-icon { - width: 50%; - height: 50%; - margin-top: 1px; - fill: $color-lowgray; -} -.maputnik-zoom-spec-property { - @extend .clearfix; - display: block; - margin: $margin-3; -} - -.maputnik-zoom-spec-property-label { - display: inline-block; - width: 41%; -} - -.maputnik-zoom-spec-property-stop-item { - margin-bottom: $margin-2; - margin-top: $margin-2; -} - -.maputnik-zoom-spec-property-stop-edit { - display: inline-block; - width: 7%; - margin-right: 1.5%; - > * { - width: 100%; - } -} - -.maputnik-zoom-spec-property-stop-value { - display: inline-block; - width: 41.5%; - > * { - width: 100%; - } -} - -.maputnik-delete-stop { - background-color: transparent; - vertical-align: top; - - .maputnik-doc-wrapper { - width: auto; - } - .maputnik-doc-target { + &-wrapper { + @extend .maputnik-input; + padding-left: 0; + padding-right: 0; + position: relative; + text-align: center; + vertical-align: middle; cursor: pointer; + max-width: 24px; } - &:hover { - background-color: transparent; - svg { - fill: $color-white; - } + &-box { + display: inline-block; + text-align: center; + height: 24px; + width: 24px; + margin-right: $margin-2; + background-color: $color-gray; + border-radius: 2px; + border-style: solid; + border-width: 2px; + border-color: $color-gray; + transition: background-color 0.1s ease-out; + } + + &-icon { + width: 50%; + height: 50%; + margin-top: 1px; + fill: $color-lowgray; } } -.maputnik-add-stop { - display: inline-block; - float: right; - margin-right: $margin-2; +// AUTOCOMPLETE +.maputnik-autocomplete { } -.maputnik-select { - @extend .maputnik-input; - height: 2.15em; - width: 50%; -} diff --git a/src/styles/_layer.scss b/src/styles/_layer.scss index 0306e95..34d74ff 100644 --- a/src/styles/_layer.scss +++ b/src/styles/_layer.scss @@ -1,4 +1,3 @@ - // LAYER LIST .maputnik-layer-list-container { padding: 0; @@ -69,102 +68,3 @@ background-color: $color-gray; } } - -.maputnik-filter-editor-wrapper { - padding: $margin-3; -} - -.maputnik-filter-editor-property { - display: inline-block; - width: '22%'; -} - -.maputnik-filter-editor-operator { - display: inline-block; - width: 19%; - margin-left: 2%; -} - -.maputnik-filter-editor-args { - display: inline-block; - width: 54%; - margin-left: 2%; -} - -.maputnik-make-zoom-function { - background-color: transparent; - display: inline-block; - padding-bottom: 0px; - padding-top: 0px; - - &:hover { - background-color: transparent; - svg { - fill: $color-white; - } - } -} - -.maputnik-filter-editor-compound-select { - margin-bottom: $margin-2; -} - -.maputnik-filter-editor-unsupported { - color: $color-midgray; -} - -.maputnik-filter-editor { - @extend .clearfix; -} - -.maputnik-add-filter { - display: inline-block; - float: right; - margin-top: $margin-2; -} -.maputnik-delete-filter { - background-color: transparent; - &:hover { - background-color: transparent; - svg { - fill: $color-white; - } - } -} - -.maputnik-filter-editor-block-action { - margin-top: $margin-2; - margin-bottom: $margin-2; -} -.maputnik-filter-editor-block-action { - display: inline-block; - width: 8%; - margin-right: 1.5%; -} - -.maputnik-filter-editor-block-content { - display: inline-block; - width: 90.5%; -} - -.maputnik-filter-editor-property { - display: inline-block; - width: 25%; -} - -.maputnik-filter-editor-operator { - display: inline-block; - width: 17%; - .maputnik-select { - width: 100%; - } -} - -.maputnik-filter-editor-args { - display: inline-block; - width: 54%; - - .maputnik-string, .maputnik-number { - width: 100%; - } -} diff --git a/src/styles/_popup.scss b/src/styles/_popup.scss index 2fab54f..8773830 100644 --- a/src/styles/_popup.scss +++ b/src/styles/_popup.scss @@ -1,5 +1,5 @@ .maputnik-popup-layer { - @extend .maputnik-base ; + display: inline-block; color: $color-lowgray; user-select: none; padding-left: 0; diff --git a/src/styles/_zoomproperty.scss b/src/styles/_zoomproperty.scss new file mode 100644 index 0000000..5c36a19 --- /dev/null +++ b/src/styles/_zoomproperty.scss @@ -0,0 +1,64 @@ +// ZOOM FUNC +.maputnik-make-zoom-function { + background-color: transparent; + display: inline-block; + padding-bottom: 0px; + padding-top: 0px; + vertical-align: middle; + @extend .maputnik-icon-button; +} + +// ZOOM PROPERTY +.maputnik-zoom-spec-property { + @extend .clearfix; +} + +.maputnik-zoom-spec-property-label { + display: inline-block; + width: 41%; +} + +.maputnik-zoom-spec-property-stop-item { + margin-bottom: $margin-2; + margin-top: $margin-2; +} + +.maputnik-zoom-spec-property-stop-edit { + display: inline-block; + vertical-align: top; + width: 16%; + margin-right: 3%; + > * { + width: 100%; + } +} + +.maputnik-zoom-spec-property-stop-value { + display: inline-block; + width: 81%; + > * { + width: 100%; + } +} + +.maputnik-delete-stop { + @extend .maputnik-icon-button; + vertical-align: top; + + .maputnik-doc-wrapper { + width: auto; + } + .maputnik-doc-target { + cursor: pointer; + } +} + +.maputnik-add-stop { + display: inline-block; + float: right; + margin-right: $margin-3; +} + +.maputnik-zoom-spec-property .maputnik-input-block:not(:first-child) .maputnik-input-block-label { + visibility: hidden; +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 3fafcba..8ebf6ac 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -29,4 +29,6 @@ $toolbar-height: 40px; @import 'layout'; @import 'layer'; @import 'input'; +@import 'filtereditor'; +@import 'zoomproperty'; @import 'popup';