import { defineComponent, computed, createVNode } from 'vue';
import '../hooks/index.mjs';
import PropTypes from '../_util/vue-types/index.mjs';
import initDefaultProps from '../_util/props-util/initDefaultProps.mjs';
import { booleanType, tuple } from '../_util/type.mjs';
import useConfigInject from '../config-provider/hooks/useConfigInject.mjs';

const timelineItemProps = () => ({
  prefixCls: String,
  color: String,
  dot: PropTypes.any,
  pending: booleanType(),
  position: PropTypes.oneOf(tuple("left", "right", "")).def(""),
  label: PropTypes.any
});
var TimelineItem = /* @__PURE__ */ defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "ATimelineItem",
  props: initDefaultProps(timelineItemProps(), {
    color: "blue",
    pending: false
  }),
  slots: Object,
  setup(props, {
    slots
  }) {
    const {
      prefixCls
    } = useConfigInject("timeline", props);
    const itemClassName = computed(() => ({
      [`${prefixCls.value}-item`]: true,
      [`${prefixCls.value}-item-pending`]: props.pending
    }));
    const customColor = computed(() => /blue|red|green|gray/.test(props.color || "") ? void 0 : props.color || "blue");
    const dotClassName = computed(() => ({
      [`${prefixCls.value}-item-head`]: true,
      [`${prefixCls.value}-item-head-${props.color || "blue"}`]: !customColor.value
    }));
    return () => {
      var _a, _b, _c;
      const {
        label = (_a = slots.label) == null ? void 0 : _a.call(slots),
        dot = (_b = slots.dot) == null ? void 0 : _b.call(slots)
      } = props;
      return createVNode("li", {
        "class": itemClassName.value
      }, [label && createVNode("div", {
        "class": `${prefixCls.value}-item-label`
      }, [label]), createVNode("div", {
        "class": `${prefixCls.value}-item-tail`
      }, null), createVNode("div", {
        "class": [dotClassName.value, !!dot && `${prefixCls.value}-item-head-custom`],
        "style": {
          borderColor: customColor.value,
          color: customColor.value
        }
      }, [dot]), createVNode("div", {
        "class": `${prefixCls.value}-item-content`
      }, [(_c = slots.default) == null ? void 0 : _c.call(slots)])]);
    };
  }
});

export { TimelineItem as default, timelineItemProps };
//# sourceMappingURL=TimelineItem.mjs.map
