041e86476de4bf0066995d646db7fcd3aab3ebeacdd5bfd515e0bbb7c1d7bb6853a83d06e8b52bb021c780b6b9a17ed325ff9e52c95a8110fd876b4bf8483c 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, normalizeStyle, createBlock, withCtx, resolveDynamicComponent, createCommentVNode, renderSlot, toDisplayString } from 'vue';
  2. import { ElIcon } from '../../icon/index.mjs';
  3. import { timelineItemProps } from './timeline-item2.mjs';
  4. import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
  5. import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
  6. const __default__ = defineComponent({
  7. name: "ElTimelineItem"
  8. });
  9. const _sfc_main = /* @__PURE__ */ defineComponent({
  10. ...__default__,
  11. props: timelineItemProps,
  12. setup(__props) {
  13. const props = __props;
  14. const ns = useNamespace("timeline-item");
  15. const defaultNodeKls = computed(() => [
  16. ns.e("node"),
  17. ns.em("node", props.size || ""),
  18. ns.em("node", props.type || ""),
  19. ns.is("hollow", props.hollow)
  20. ]);
  21. return (_ctx, _cache) => {
  22. return openBlock(), createElementBlock("li", {
  23. class: normalizeClass([unref(ns).b(), { [unref(ns).e("center")]: _ctx.center }])
  24. }, [
  25. createElementVNode("div", {
  26. class: normalizeClass(unref(ns).e("tail"))
  27. }, null, 2),
  28. !_ctx.$slots.dot ? (openBlock(), createElementBlock("div", {
  29. key: 0,
  30. class: normalizeClass(unref(defaultNodeKls)),
  31. style: normalizeStyle({
  32. backgroundColor: _ctx.color
  33. })
  34. }, [
  35. _ctx.icon ? (openBlock(), createBlock(unref(ElIcon), {
  36. key: 0,
  37. class: normalizeClass(unref(ns).e("icon"))
  38. }, {
  39. default: withCtx(() => [
  40. (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
  41. ]),
  42. _: 1
  43. }, 8, ["class"])) : createCommentVNode("v-if", true)
  44. ], 6)) : createCommentVNode("v-if", true),
  45. _ctx.$slots.dot ? (openBlock(), createElementBlock("div", {
  46. key: 1,
  47. class: normalizeClass(unref(ns).e("dot"))
  48. }, [
  49. renderSlot(_ctx.$slots, "dot")
  50. ], 2)) : createCommentVNode("v-if", true),
  51. createElementVNode("div", {
  52. class: normalizeClass(unref(ns).e("wrapper"))
  53. }, [
  54. !_ctx.hideTimestamp && _ctx.placement === "top" ? (openBlock(), createElementBlock("div", {
  55. key: 0,
  56. class: normalizeClass([unref(ns).e("timestamp"), unref(ns).is("top")])
  57. }, toDisplayString(_ctx.timestamp), 3)) : createCommentVNode("v-if", true),
  58. createElementVNode("div", {
  59. class: normalizeClass(unref(ns).e("content"))
  60. }, [
  61. renderSlot(_ctx.$slots, "default")
  62. ], 2),
  63. !_ctx.hideTimestamp && _ctx.placement === "bottom" ? (openBlock(), createElementBlock("div", {
  64. key: 1,
  65. class: normalizeClass([unref(ns).e("timestamp"), unref(ns).is("bottom")])
  66. }, toDisplayString(_ctx.timestamp), 3)) : createCommentVNode("v-if", true)
  67. ], 2)
  68. ], 2);
  69. };
  70. }
  71. });
  72. var TimelineItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "timeline-item.vue"]]);
  73. export { TimelineItem as default };
  74. //# sourceMappingURL=timeline-item.mjs.map