import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
import Help from '../Help/index.js';
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
import '../Tooltip/index.js';
import '../_verture/slicedToArray-76060636.js';
import '../_verture/unsupportedIterableToArray-cb478f24.js';
import 'react';
import 'rc-tooltip';
import 'rc-tooltip/lib/placements';
import 'clsx';
import '@iam-com/icons/Help';

var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2022/3/23 8:29 PM\n* @description 标题\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-label {\n  font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n  font-size: 14px;\n  font-weight: 400;\n  color: rgba(46, 55, 67, 0.7);\n  margin-bottom: 8px;\n  display: inline-block;\n  line-height: 1.43;\n  word-break: break-all;\n}\n.paraui-v3-label > .label-required {\n  margin-left: 2px;\n  color: rgb(235, 96, 84);\n}\n.paraui-v3-label > .paraui-v3-help {\n  vertical-align: top;\n  margin-left: 4px;\n}\n.paraui-v3-label > .paraui-v3-help svg {\n  vertical-align: top;\n  position: relative;\n  top: 2px;\n}\n.paraui-v3-label.paraui-v3-label-line.paraui-v3-label-tooltip {\n  border-bottom: 1px dashed rgba(46, 55, 67, 0.4);\n  padding-bottom: 2px;\n}";
styleInject(css_248z);

var Label = function Label(props) {
  var className = props.className,
    helpClassName = props.helpClassName,
    style = props.style,
    label = props.label,
    labelSign = props.labelSign,
    _props$required = props.required,
    required = _props$required === void 0 ? false : _props$required,
    tooltip = props.tooltip,
    _props$tooltipType = props.tooltipType,
    tooltipType = _props$tooltipType === void 0 ? 'icon' : _props$tooltipType,
    placement = props.placement,
    arrow = props.arrow,
    tooltipIcon = props.tooltipIcon,
    onClick = props.onClick,
    othersProps = __rest(props, ["className", "helpClassName", "style", "label", "labelSign", "required", "tooltip", "tooltipType", "placement", "arrow", "tooltipIcon", "onClick"]);
  // 处理class
  var handClass = function handClass() {
    var str = $prefixCls + '-label';
    if (tooltipType) str += " ".concat($prefixCls, "-label-").concat(tooltipType);
    if (tooltip) str += " ".concat($prefixCls, "-label-tooltip");
    if (className) str += ' ' + className;
    return str;
  };
  var onClickCom = function onClickCom(e) {
    onClick && onClick(e);
  };
  return jsxs(Fragment, {
    children: [tooltipType === 'icon' && jsxs("label", Object.assign({
      className: handClass(),
      style: style,
      onClick: onClickCom
    }, {
      children: [jsx(Fragment, {
        children: label
      }), required && jsx("span", Object.assign({
        className: "label-required"
      }, {
        children: "*"
      })), labelSign && jsx("span", {
        children: labelSign
      }), tooltip && jsx(Help, Object.assign({
        title: tooltip,
        placement: placement,
        arrow: arrow,
        className: helpClassName
      }, othersProps, {
        children: tooltipIcon
      }))]
    })), tooltipType === 'line' && jsx(Help, Object.assign({
      title: tooltip || '',
      placement: placement,
      arrow: arrow,
      className: helpClassName
    }, othersProps, {
      children: jsxs("label", Object.assign({
        className: handClass(),
        style: style,
        onClick: onClickCom
      }, {
        children: [jsx(Fragment, {
          children: label
        }), required && jsx("span", Object.assign({
          className: "label-required"
        }, {
          children: "*"
        })), labelSign && jsx("span", {
          children: labelSign
        })]
      }))
    }))]
  });
};

export { Label as default };
