mirror of
https://github.com/maputnik/editor.git
synced 2026-01-03 03:50:00 +00:00
This is to continue the work of migrating all the jsx files into tsx files. The MO is basically described here: #848. About 7 files to go...
34 lines
876 B
TypeScript
34 lines
876 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
|
|
};
|
|
|
|
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"
|
|
>
|
|
<InputAutocomplete
|
|
keepMenuWithinWindowBounds={!!this.props.isFixed}
|
|
value={this.props.value}
|
|
onChange={this.props.onChange}
|
|
options={this.props.sourceLayerIds?.map(l => [l, l])}
|
|
/>
|
|
</Block>
|
|
}
|
|
}
|