'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../hooks/index.js');
var index = require('../_util/vue-types/index.js');
var initDefaultProps = require('../_util/props-util/initDefaultProps.js');
var type = require('../_util/type.js');
var useConfigInject = require('../config-provider/hooks/useConfigInject.js');

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

exports.default = TimelineItem;
exports.timelineItemProps = timelineItemProps;
//# sourceMappingURL=TimelineItem.js.map
