This commit is contained in:
2025-09-19 14:25:20 +08:00
parent 269893a435
commit fbf3f77229
24949 changed files with 2839404 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
import type TimelineItem from './timeline-item.vue';
export declare const timelineItemProps: {
readonly timestamp: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly hideTimestamp: BooleanConstructor;
readonly center: BooleanConstructor;
readonly placement: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "top" | "bottom", unknown, "bottom", boolean>;
readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "primary" | "success" | "warning" | "info" | "danger", unknown, "", boolean>;
readonly color: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly size: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "normal" | "large", unknown, "normal", boolean>;
readonly icon: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly hollow: BooleanConstructor;
};
export type TimelineItemProps = ExtractPropTypes<typeof timelineItemProps>;
export type TimelineItemPropsPublic = __ExtractPublicPropTypes<typeof timelineItemProps>;
export type TimelineItemInstance = InstanceType<typeof TimelineItem> & unknown;

View File

@@ -0,0 +1,76 @@
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, normalizeStyle, createBlock, withCtx, resolveDynamicComponent, createCommentVNode, renderSlot, toDisplayString } from 'vue';
import { ElIcon } from '../../icon/index.mjs';
import { timelineItemProps } from './timeline-item2.mjs';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
const __default__ = defineComponent({
name: "ElTimelineItem"
});
const _sfc_main = /* @__PURE__ */ defineComponent({
...__default__,
props: timelineItemProps,
setup(__props) {
const props = __props;
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)
]);
return (_ctx, _cache) => {
return openBlock(), createElementBlock("li", {
class: normalizeClass([unref(ns).b(), { [unref(ns).e("center")]: _ctx.center }])
}, [
createElementVNode("div", {
class: normalizeClass(unref(ns).e("tail"))
}, null, 2),
!_ctx.$slots.dot ? (openBlock(), createElementBlock("div", {
key: 0,
class: normalizeClass(unref(defaultNodeKls)),
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", "timeline-item.vue"]]);
export { TimelineItem as default };
//# sourceMappingURL=timeline-item.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"timeline-item.mjs","sources":["../../../../../../packages/components/timeline/src/timeline-item.vue"],"sourcesContent":["<template>\n <li :class=\"[ns.b(), { [ns.e('center')]: center }]\">\n <div :class=\"ns.e('tail')\" />\n <div\n v-if=\"!$slots.dot\"\n :class=\"defaultNodeKls\"\n :style=\"{\n backgroundColor: color,\n }\"\n >\n <el-icon v-if=\"icon\" :class=\"ns.e('icon')\">\n <component :is=\"icon\" />\n </el-icon>\n </div>\n <div v-if=\"$slots.dot\" :class=\"ns.e('dot')\">\n <slot name=\"dot\" />\n </div>\n\n <div :class=\"ns.e('wrapper')\">\n <div\n v-if=\"!hideTimestamp && placement === 'top'\"\n :class=\"[ns.e('timestamp'), ns.is('top')]\"\n >\n {{ timestamp }}\n </div>\n\n <div :class=\"ns.e('content')\">\n <slot />\n </div>\n\n <div\n v-if=\"!hideTimestamp && placement === 'bottom'\"\n :class=\"[ns.e('timestamp'), ns.is('bottom')]\"\n >\n {{ timestamp }}\n </div>\n </div>\n </li>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useNamespace } from '@element-plus/hooks'\nimport { timelineItemProps } from './timeline-item'\n\ndefineOptions({\n name: 'ElTimelineItem',\n})\n\nconst props = defineProps(timelineItemProps)\n\nconst ns = useNamespace('timeline-item')\nconst defaultNodeKls = computed(() => [\n ns.e('node'),\n ns.em('node', props.size || ''),\n ns.em('node', props.type || ''),\n ns.is('hollow', props.hollow),\n])\n</script>\n"],"names":[],"mappings":";;;;;;mCA8Cc,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAIA,IAAM,MAAA,EAAA,GAAK,aAAa,eAAe,CAAA,CAAA;AACvC,IAAM,MAAA,cAAA,GAAiB,SAAS,MAAM;AAAA,MACpC,EAAA,CAAG,EAAE,MAAM,CAAA;AAAA,MACX,EAAG,CAAA,EAAA,CAAG,MAAQ,EAAA,KAAA,CAAM,QAAQ,EAAE,CAAA;AAAA,MAC9B,EAAG,CAAA,EAAA,CAAG,MAAQ,EAAA,KAAA,CAAM,QAAQ,EAAE,CAAA;AAAA,MAC9B,EAAG,CAAA,EAAA,CAAG,QAAU,EAAA,KAAA,CAAM,MAAM,CAAA;AAAA,KAC7B,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,51 @@
declare function __VLS_template(): {
dot?(_: {}): any;
default?(_: {}): any;
};
declare const __VLS_component: import("vue").DefineComponent<{
readonly timestamp: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly hideTimestamp: BooleanConstructor;
readonly center: BooleanConstructor;
readonly placement: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "top" | "bottom", unknown, "bottom", boolean>;
readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "primary" | "success" | "warning" | "info" | "danger", unknown, "", boolean>;
readonly color: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly size: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "normal" | "large", unknown, "normal", boolean>;
readonly icon: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly hollow: BooleanConstructor;
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
readonly timestamp: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly hideTimestamp: BooleanConstructor;
readonly center: BooleanConstructor;
readonly placement: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "top" | "bottom", unknown, "bottom", boolean>;
readonly type: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "primary" | "success" | "warning" | "info" | "danger", unknown, "", boolean>;
readonly color: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly size: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "normal" | "large", unknown, "normal", boolean>;
readonly icon: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | ((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component))[], unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly hollow: BooleanConstructor;
}>>, {
readonly center: boolean;
readonly color: string;
readonly size: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "normal" | "large", unknown>;
readonly type: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "primary" | "success" | "warning" | "info" | "danger", unknown>;
readonly placement: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "top" | "bottom", unknown>;
readonly timestamp: string;
readonly hideTimestamp: boolean;
readonly hollow: boolean;
}>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};

View File

@@ -0,0 +1,37 @@
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
import { iconPropType } from '../../../utils/vue/icon.mjs';
const timelineItemProps = buildProps({
timestamp: {
type: String,
default: ""
},
hideTimestamp: Boolean,
center: Boolean,
placement: {
type: String,
values: ["top", "bottom"],
default: "bottom"
},
type: {
type: String,
values: ["primary", "success", "warning", "danger", "info"],
default: ""
},
color: {
type: String,
default: ""
},
size: {
type: String,
values: ["normal", "large"],
default: "normal"
},
icon: {
type: iconPropType
},
hollow: Boolean
});
export { timelineItemProps };
//# sourceMappingURL=timeline-item2.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"timeline-item2.mjs","sources":["../../../../../../packages/components/timeline/src/timeline-item.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type TimelineItem from './timeline-item.vue'\n\nexport const timelineItemProps = buildProps({\n /**\n * @description timestamp content\n */\n timestamp: {\n type: String,\n default: '',\n },\n /**\n * @description whether to show timestamp\n */\n hideTimestamp: Boolean,\n /**\n * @description whether vertically centered\n */\n center: Boolean,\n /**\n * @description position of timestamp\n */\n placement: {\n type: String,\n values: ['top', 'bottom'],\n default: 'bottom',\n },\n /**\n * @description node type\n */\n type: {\n type: String,\n values: ['primary', 'success', 'warning', 'danger', 'info'],\n default: '',\n },\n /**\n * @description background color of node\n */\n color: {\n type: String,\n default: '',\n },\n /**\n * @description node size\n */\n size: {\n type: String,\n values: ['normal', 'large'],\n default: 'normal',\n },\n /**\n * @description icon component\n */\n icon: {\n type: iconPropType,\n },\n /**\n * @description icon is hollow\n */\n hollow: Boolean,\n} as const)\nexport type TimelineItemProps = ExtractPropTypes<typeof timelineItemProps>\nexport type TimelineItemPropsPublic = __ExtractPublicPropTypes<\n typeof timelineItemProps\n>\n\nexport type TimelineItemInstance = InstanceType<typeof TimelineItem> & unknown\n"],"names":[],"mappings":";;;AACY,MAAC,iBAAiB,GAAG,UAAU,CAAC;AAC5C,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,aAAa,EAAE,OAAO;AACxB,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;AAC7B,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC;AAC/D,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;AAC/B,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,EAAE,MAAM,EAAE,OAAO;AACjB,CAAC;;;;"}

View File

@@ -0,0 +1,5 @@
declare const Timeline: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
export default Timeline;
export type TimelineInstance = InstanceType<typeof Timeline> & unknown;

View File

@@ -0,0 +1,17 @@
import { defineComponent, provide, h, renderSlot } from 'vue';
import { TIMELINE_INJECTION_KEY } from './tokens.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
const Timeline = defineComponent({
name: "ElTimeline",
setup(_, { slots }) {
const ns = useNamespace("timeline");
provide(TIMELINE_INJECTION_KEY, slots);
return () => {
return h("ul", { class: [ns.b()] }, [renderSlot(slots, "default")]);
};
}
});
export { Timeline as default };
//# sourceMappingURL=timeline.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"timeline.mjs","sources":["../../../../../../packages/components/timeline/src/timeline.ts"],"sourcesContent":["import { defineComponent, h, provide, renderSlot } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { TIMELINE_INJECTION_KEY } from './tokens'\n\nconst Timeline = defineComponent({\n name: 'ElTimeline',\n setup(_, { slots }) {\n const ns = useNamespace('timeline')\n\n provide(TIMELINE_INJECTION_KEY, slots)\n\n /**\n * Maybe ,this component will not support prop 'reverse', why ?\n *\n * Example 1:\n * <component-a>\n * <div>1</div>\n * <div>2</div>\n * </component-a>\n *\n * Example 2:\n * <component-a>\n * <div v-for=\"i in 2\" :key=\"i\">{{ i }}</div>\n * </component-a>\n *\n * 'slots.default()' value in example 1 just like [Vnode, Vnode]\n * 'slots.default()' value in example 2 just like [Vnode]\n *\n * so i can't reverse the slots, when i use 'v-for' directive.\n */\n\n return () => {\n return h('ul', { class: [ns.b()] }, [renderSlot(slots, 'default')])\n }\n },\n})\n\nexport default Timeline\nexport type TimelineInstance = InstanceType<typeof Timeline> & unknown\n"],"names":[],"mappings":";;;;AAGK,MAAC,QAAQ,GAAG,eAAe,CAAC;AACjC,EAAE,IAAI,EAAE,YAAY;AACpB,EAAE,KAAK,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;AACtB,IAAI,MAAM,EAAE,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;AACxC,IAAI,OAAO,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;AAC3C,IAAI,OAAO,MAAM;AACjB,MAAM,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;AAC1E,KAAK,CAAC;AACN,GAAG;AACH,CAAC;;;;"}

View File

@@ -0,0 +1 @@
export declare const TIMELINE_INJECTION_KEY = "timeline";

View File

@@ -0,0 +1,4 @@
const TIMELINE_INJECTION_KEY = "timeline";
export { TIMELINE_INJECTION_KEY };
//# sourceMappingURL=tokens.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"tokens.mjs","sources":["../../../../../../packages/components/timeline/src/tokens.ts"],"sourcesContent":["export const TIMELINE_INJECTION_KEY = 'timeline'\n"],"names":[],"mappings":"AAAY,MAAC,sBAAsB,GAAG;;;;"}