import { _ as _extends } from '../_rollupPluginBabelHelpers-736b301a.js';
import React__default from 'react';
import Drawer from '../Drawer/index.js';
import LMap from '../LMap/index.js';
import { isEqual } from '@zenview/micro-utils';
import 'antd';
import 'leaflet';
import '../index-33416316.js';
import '../IconFont/index.js';
import '@zenview/micro-basic-library';
import '../SearchInput/index.js';
import 'lodash';
import '../LabelValue/index.js';
import 'geometric';
import 'turf';
import '@src/libs/echarts-leaflet';
import 'leaflet/dist/leaflet.css';
import 'mapbox-gl-leaflet';
import 'react-dom';
import '../DeviceList/index.js';
import '../index-6ef7005c.js';
import '../index-f41abfce.js';
import 'react-virtualized';
import '../CBox/index.js';
import '../TreeTitle/index.js';
import '../HightLevel/index.js';
import '../ImageView/index.js';
import 'leaflet.zv.markercluster';
import 'leaflet.zv.markercluster/dist/MarkerCluster.Default.css';
import 'leaflet.zv.markercluster/dist/MarkerCluster.css';
import '../PlaceTree/index.js';
import '../Tree/index.js';
import '../index-71189681.js';
import '../_commonjsHelpers-e7b0df42.js';
import 'react-is';
import 'mobx-react';
import '../DeviceAndPlace/index.js';
import '../index-fcf1ad06.js';
import '../IconSpan/index.js';

class MapSeelct extends React__default.Component {
  constructor(props) {
    super(props);
    this.onChange = ids => {
      this.setState({
        value: ids
      });
    };
    this.onSunChange = () => {
      this.props.onChange && this.props.onChange(this.state.value);
      this.props.onClose && this.props.onClose();
    };
    this.state = {
      value: props.defaultValue || props.value
    };
  }
  UNSAFE_componentWillReceiveProps(props) {
    if (isEqual(props.value, this.props.value)) {
      this.setState({
        value: props.value || []
      });
    }
  }
  render() {
    const {
      points,
      value,
      onChange,
      onClose,
      ...props
    } = this.props;
    return /*#__PURE__*/React__default.createElement(Drawer, _extends({
      className: "lm-c-map-select-drawer-content",
      disabled: !Array.isArray(this.state.value) || this.state.value.length === 0,
      onOk: this.onSunChange,
      onClose: onClose
    }, props), /*#__PURE__*/React__default.createElement(LMap.SelectPointsMap, {
      points: points,
      selectKeys: this.state.value,
      onChange: this.onChange
    }));
  }
}

export { MapSeelct as default };
//# sourceMappingURL=index.js.map
