comic-plus
Version:
<p align="center"> <img width="200px" src="./logo.png"/> </p>
57 lines (56 loc) • 2.44 kB
JavaScript
import { defineComponent, inject, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createBlock, resolveDynamicComponent, normalizeStyle, toDisplayString, createCommentVNode } from "vue";
import { timelineItemProps } from "./item.props.mjs";
import { TIMELINE_PROVIDE } from "./type.mjs";
import "../../../utils/config.mjs";
import { isVueComponent } from "../../../utils/typescript.mjs";
import "@vueuse/core";
const _hoisted_1 = { class: "cu-timeline__axle" };
const _hoisted_2 = {
key: 0,
class: "cu-timeline__timestamp"
};
const _hoisted_3 = {
key: 1,
class: "cu-timeline__timestamp"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
...{
name: "CuTimelineItem"
},
__name: "item",
props: timelineItemProps,
setup(__props) {
const { props: injectProps } = inject(TIMELINE_PROVIDE);
return (_ctx, _cache) => {
return openBlock(), createElementBlock("li", {
class: normalizeClass(["cu-timeline-item", { "is-reverse": unref(injectProps).cross && _ctx.reverse }])
}, [
createElementVNode("div", _hoisted_1, [
renderSlot(_ctx.$slots, "dot", {}, () => [
unref(isVueComponent)(_ctx.icon) ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), {
key: 0,
style: normalizeStyle({ color: _ctx.color })
}, null, 8, ["style"])) : (openBlock(), createElementBlock("div", {
key: 1,
class: normalizeClass(["cu-timeline__dot", { fill: _ctx.fill }]),
style: normalizeStyle({ "--cu-timeline-dotcolor": _ctx.color })
}, null, 6))
]),
createElementVNode("div", {
class: normalizeClass(["cu-timeline__line", { dashed: _ctx.dashedLine }])
}, null, 2)
]),
createElementVNode("div", {
class: normalizeClass(["cu-timeline__content", unref(injectProps).timePosition])
}, [
unref(injectProps).timePosition === "top" && _ctx.time ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(_ctx.time), 1)) : createCommentVNode("", true),
renderSlot(_ctx.$slots, "default"),
unref(injectProps).timePosition === "bottom" && _ctx.time ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(_ctx.time), 1)) : createCommentVNode("", true)
], 2)
], 2);
};
}
});
export {
_sfc_main as default
};