var _excluded = ["value", "options", "label", "required", "placeholder", "size", "className", "style"];
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
/**
 * PisellMultipleSelect - DisabledView (禁用态视图)
 * 禁用状态下的渲染
 */

import React, { forwardRef, useMemo } from 'react';
import { Select } from 'antd';
import classNames from 'classnames';
var DisabledView = /*#__PURE__*/forwardRef(function (props, ref) {
  var _props$value = props.value,
    value = _props$value === void 0 ? [] : _props$value,
    options = props.options,
    label = props.label,
    required = props.required,
    _props$placeholder = props.placeholder,
    placeholder = _props$placeholder === void 0 ? '请选择' : _props$placeholder,
    _props$size = props.size,
    size = _props$size === void 0 ? 'middle' : _props$size,
    className = props.className,
    style = props.style,
    restProps = _objectWithoutProperties(props, _excluded);

  // 转换为 Ant Design 需要的格式
  var antdOptions = useMemo(function () {
    return options.map(function (opt) {
      return {
        label: opt.label,
        value: opt.value,
        disabled: opt.disabled
      };
    });
  }, [options]);
  return /*#__PURE__*/React.createElement("div", {
    className: classNames('pisell-multiple-select-wrapper', className),
    style: style
  }, label && /*#__PURE__*/React.createElement("label", {
    className: classNames('pisell-multiple-select-label', {
      'pisell-multiple-select-label-required': required
    })
  }, label), /*#__PURE__*/React.createElement(Select, _extends({}, restProps, {
    ref: ref,
    mode: "multiple",
    value: value,
    options: antdOptions,
    placeholder: placeholder,
    disabled: true,
    size: size,
    className: "pisell-multiple-select"
  })));
});
DisabledView.displayName = 'PisellMultipleSelectDisabledView';
export default DisabledView;