mirror of
https://github.com/maputnik/editor.git
synced 2025-12-25 15:40:00 +00:00
Remove JS input config
This commit is contained in:
@@ -2,8 +2,6 @@ import React from 'react'
|
||||
import Color from 'color'
|
||||
import ChromePicker from 'react-color/lib/components/chrome/Chrome'
|
||||
|
||||
import input from '../../config/input.js'
|
||||
|
||||
function formatColor(color) {
|
||||
const rgb = color.rgb
|
||||
return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${rgb.a})`
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import React from 'react'
|
||||
import input from '../../config/input.js'
|
||||
import colors from '../../config/colors.js'
|
||||
import { margins, fontSizes } from '../../config/scales.js'
|
||||
|
||||
export default class DocLabel extends React.Component {
|
||||
static propTypes = {
|
||||
@@ -10,45 +7,16 @@ export default class DocLabel extends React.Component {
|
||||
React.PropTypes.string
|
||||
]).isRequired,
|
||||
doc: React.PropTypes.string.isRequired,
|
||||
style: React.PropTypes.object,
|
||||
cursorTargetStyle: React.PropTypes.object,
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = { showDoc: false }
|
||||
}
|
||||
|
||||
render() {
|
||||
return <label
|
||||
style={{
|
||||
...this.props.style
|
||||
}}
|
||||
className="maputnik-doc-wrapper"
|
||||
>
|
||||
<span
|
||||
onMouseOver={e => this.setState({showDoc: true})}
|
||||
onMouseOut={e => this.setState({showDoc: false})}
|
||||
className="maputnik-doc-target"
|
||||
style={this.props.cursorTargetStyle}
|
||||
>
|
||||
{this.props.label}
|
||||
</span>
|
||||
<div style={{
|
||||
backgroundColor: colors.gray,
|
||||
padding: margins[1],
|
||||
fontSize: 10,
|
||||
position: 'absolute',
|
||||
top: 20,
|
||||
left: 0,
|
||||
width: 120,
|
||||
display: this.state.showDoc ? null : 'none',
|
||||
zIndex: 3,
|
||||
}}
|
||||
className="maputnik-doc-popup"
|
||||
>
|
||||
{this.props.doc}
|
||||
</div>
|
||||
return <label className="maputnik-doc-wrapper">
|
||||
<div className="maputnik-doc-target">
|
||||
<span>{this.props.label}</span>
|
||||
<div className="maputnik-doc-popup">
|
||||
{this.props.doc}
|
||||
</div>
|
||||
</div >
|
||||
</label>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@ import capitalize from 'lodash.capitalize'
|
||||
|
||||
const iconProperties = ['background-pattern', 'fill-pattern', 'line-pattern', 'fill-extrusion-pattern', 'icon-image']
|
||||
|
||||
import input from '../../config/input.js'
|
||||
|
||||
function labelFromFieldName(fieldName) {
|
||||
let label = fieldName.split('-').slice(1).join(' ')
|
||||
if(label.length > 0) {
|
||||
|
||||
@@ -12,8 +12,6 @@ import DeleteIcon from 'react-icons/lib/md/delete'
|
||||
import FunctionIcon from 'react-icons/lib/md/functions'
|
||||
|
||||
import capitalize from 'lodash.capitalize'
|
||||
import input from '../../config/input.js'
|
||||
import colors from '../../config/colors.js'
|
||||
|
||||
function isZoomField(value) {
|
||||
return typeof value === 'object' && value.stops
|
||||
|
||||
Reference in New Issue
Block a user