import { _ as _extends } from '../_rollupPluginBabelHelpers-736b301a.js';
import React__default from 'react';
import { B as BaseList } from '../index-fcf1ad06.js';
import IconSpan from '../IconSpan/index.js';
import { D as DeviceIcon } from '../index-33416316.js';
import '../index-f41abfce.js';
import 'react-virtualized';
import 'lodash';
import 'antd';
import '../IconFont/index.js';
import '@zenview/micro-utils';
import '../CBox/index.js';
import '../HightLevel/index.js';
import '../TreeTitle/index.js';
import '../SearchInput/index.js';
import '@zenview/micro-basic-library';

class DeviceList extends React__default.Component {
  constructor(...args) {
    super(...args);
    this.whatIcon = item => {
      const {
        getIconStyle
      } = this.props;
      if (item.pointDataType === 'place') {
        return /*#__PURE__*/React__default.createElement(IconSpan, {
          type: "icon-S_Place_Place",
          style: {
            fontSize: '16px',
            color: 'var(--icon)',
            marginRight: '4px'
          }
        });
      }
      return /*#__PURE__*/React__default.createElement(DeviceIcon, {
        style: getIconStyle ? getIconStyle(item) : undefined,
        cType: item.cameraType,
        type: item.deviceType,
        status: item.deviceStatus
      });
    };
    this.deleteItem = (item, e) => {
      // Utils.stopPropagation(e);
      e.preventDefault();
      const {
        deleteItem
      } = this.props;
      deleteItem && deleteItem(item);
    };
  }
  render() {
    const {
      className = "",
      deviceList = [],
      deleteItem,
      setDeviceType,
      componentsType,
      renderItemExt,
      deleteDeviceAll,
      selectDevicesType,
      showVideoSet,
      showData,
      onMouseOverItem,
      ...props
    } = this.props;
    return /*#__PURE__*/React__default.createElement(BaseList, _extends({}, props, {
      className: `lm-c-device-and-place-list-wrapper ${className}`,
      list: deviceList,
      itemNameKey: "itemName",
      itemKey: "itemKey",
      rowHeight: 30,
      whatIcon: this.whatIcon,
      onMouseOverItem: onMouseOverItem,
      renderItemExt: item => renderItemExt ? renderItemExt(item) : deleteItem && /*#__PURE__*/React__default.createElement("span", {
        className: "clear-item",
        onClick: e => this.deleteItem(item, e)
      }, /*#__PURE__*/React__default.createElement(IconSpan, {
        type: "icon-S_Edit_LineClose",
        title: "\u5220\u9664"
      }))
    }));
  }
}

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