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

class DeviceList extends React__default.Component {
  constructor(...args) {
    super(...args);
    this.whatIcon = item => {
      const {
        getIconStyle
      } = this.props;
      return /*#__PURE__*/React__default.createElement(DeviceIcon, {
        style: getIconStyle ? getIconStyle(item) : undefined,
        type: item.deviceType,
        status: item.deviceStatus
      });
    };
    this.deleteItem = (item, e) => {
      e.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(CheckList, _extends({}, props, {
      className: `lm-c-device-list-wrapper ${className}`,
      list: deviceList,
      itemNameKey: "deviceName",
      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(IconFont, {
        type: "icon-S_Edit_LineClose",
        title: "\u5220\u9664"
      }))
    }));
  }
}

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