mirror of
https://github.com/maputnik/editor.git
synced 2026-08-31 17:37:25 +00:00
656264f2bc
This is in continue to: - #850 - #848 The last files should be converted as part of this PR, there are only a handful left.
38 lines
949 B
TypeScript
38 lines
949 B
TypeScript
import React from 'react'
|
|
|
|
import {latest} from '@maplibre/maplibre-gl-style-spec'
|
|
import Block from './Block'
|
|
import InputAutocomplete from './InputAutocomplete'
|
|
|
|
type FieldSourceLayerProps = {
|
|
value?: string
|
|
onChange?(...args: unknown[]): unknown
|
|
sourceLayerIds?: unknown[]
|
|
isFixed?: boolean
|
|
error?: {message: string}
|
|
};
|
|
|
|
export default class FieldSourceLayer extends React.Component<FieldSourceLayerProps> {
|
|
static defaultProps = {
|
|
onChange: () => {},
|
|
sourceLayerIds: [],
|
|
isFixed: false
|
|
}
|
|
|
|
render() {
|
|
return <Block
|
|
label={"Source Layer"}
|
|
fieldSpec={latest.layer['source-layer']}
|
|
data-wd-key="layer-source-layer"
|
|
error={this.props.error}
|
|
>
|
|
<InputAutocomplete
|
|
keepMenuWithinWindowBounds={!!this.props.isFixed}
|
|
value={this.props.value}
|
|
onChange={this.props.onChange}
|
|
options={this.props.sourceLayerIds?.map(l => [l, l])}
|
|
/>
|
|
</Block>
|
|
}
|
|
}
|