| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- import { defineComponent, inject, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, unref, normalizeStyle, createBlock, withCtx, resolveDynamicComponent, createCommentVNode, renderSlot, toDisplayString } from 'vue';
- import { ElIcon } from '../../icon/index.mjs';
- import { timelineItemProps } from './timeline-item2.mjs';
- import { TIMELINE_INJECTION_KEY } from './tokens.mjs';
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
- const _sfc_main = defineComponent({
- ...{
- name: "ElTimelineItem"
- },
- __name: "timeline-item",
- props: timelineItemProps,
- setup(__props) {
- const props = __props;
- const { props: timelineProps } = inject(
- TIMELINE_INJECTION_KEY
- );
- const ns = useNamespace("timeline-item");
- const defaultNodeKls = computed(() => [
- ns.e("node"),
- ns.em("node", props.size || ""),
- ns.em("node", props.type || ""),
- ns.is("hollow", props.hollow)
- ]);
- const timelineItemKls = computed(() => [
- ns.b(),
- { [ns.e("center")]: props.center },
- ns.is(timelineProps.mode)
- ]);
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock(
- "li",
- {
- class: normalizeClass(timelineItemKls.value)
- },
- [
- createElementVNode(
- "div",
- {
- class: normalizeClass(unref(ns).e("tail"))
- },
- null,
- 2
- ),
- !_ctx.$slots.dot ? (openBlock(), createElementBlock(
- "div",
- {
- key: 0,
- class: normalizeClass(defaultNodeKls.value),
- style: normalizeStyle({
- backgroundColor: _ctx.color
- })
- },
- [
- _ctx.icon ? (openBlock(), createBlock(unref(ElIcon), {
- key: 0,
- class: normalizeClass(unref(ns).e("icon"))
- }, {
- default: withCtx(() => [
- (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
- ]),
- _: 1
- }, 8, ["class"])) : createCommentVNode("v-if", true)
- ],
- 6
- )) : createCommentVNode("v-if", true),
- _ctx.$slots.dot ? (openBlock(), createElementBlock(
- "div",
- {
- key: 1,
- class: normalizeClass(unref(ns).e("dot"))
- },
- [
- renderSlot(_ctx.$slots, "dot")
- ],
- 2
- )) : createCommentVNode("v-if", true),
- createElementVNode(
- "div",
- {
- class: normalizeClass(unref(ns).e("wrapper"))
- },
- [
- !_ctx.hideTimestamp && _ctx.placement === "top" ? (openBlock(), createElementBlock(
- "div",
- {
- key: 0,
- class: normalizeClass([unref(ns).e("timestamp"), unref(ns).is("top")])
- },
- toDisplayString(_ctx.timestamp),
- 3
- )) : createCommentVNode("v-if", true),
- createElementVNode(
- "div",
- {
- class: normalizeClass(unref(ns).e("content"))
- },
- [
- renderSlot(_ctx.$slots, "default")
- ],
- 2
- ),
- !_ctx.hideTimestamp && _ctx.placement === "bottom" ? (openBlock(), createElementBlock(
- "div",
- {
- key: 1,
- class: normalizeClass([unref(ns).e("timestamp"), unref(ns).is("bottom")])
- },
- toDisplayString(_ctx.timestamp),
- 3
- )) : createCommentVNode("v-if", true)
- ],
- 2
- )
- ],
- 2
- );
- };
- }
- });
- var TimelineItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/timeline/src/timeline-item.vue"]]);
- export { TimelineItem as default };
- //# sourceMappingURL=timeline-item.mjs.map
|