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,11 @@
import Steps from './src/steps.vue';
import Step from './src/item.vue';
import type { SFCWithInstall } from 'element-plus/es/utils';
export declare const ElSteps: SFCWithInstall<typeof Steps> & {
Step: typeof Step;
};
export default ElSteps;
export declare const ElStep: SFCWithInstall<typeof Step>;
export * from './src/item';
export * from './src/steps';
export * from './src/tokens';

View File

@@ -0,0 +1,14 @@
import Steps from './src/steps2.mjs';
import Step from './src/item.mjs';
export { stepProps } from './src/item2.mjs';
export { stepsEmits, stepsProps } from './src/steps.mjs';
export { STEPS_INJECTION_KEY } from './src/tokens.mjs';
import { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';
const ElSteps = withInstall(Steps, {
Step
});
const ElStep = withNoopInstall(Step);
export { ElStep, ElSteps, ElSteps as default };
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/steps/index.ts"],"sourcesContent":["import { withInstall, withNoopInstall } from '@element-plus/utils'\nimport Steps from './src/steps.vue'\nimport Step from './src/item.vue'\n\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nexport const ElSteps: SFCWithInstall<typeof Steps> & {\n Step: typeof Step\n} = withInstall(Steps, {\n Step,\n})\nexport default ElSteps\nexport const ElStep: SFCWithInstall<typeof Step> = withNoopInstall(Step)\n\nexport * from './src/item'\nexport * from './src/steps'\nexport * from './src/tokens'\n"],"names":[],"mappings":";;;;;;;AAGY,MAAC,OAAO,GAAG,WAAW,CAAC,KAAK,EAAE;AAC1C,EAAE,IAAI;AACN,CAAC,EAAE;AAES,MAAC,MAAM,GAAG,eAAe,CAAC,IAAI;;;;"}

View File

@@ -0,0 +1,16 @@
import type Step from './item.vue';
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
export declare const stepProps: {
readonly title: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", 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 description: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly status: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "wait" | "error" | "finish" | "success" | "process", unknown, "", boolean>;
};
export type StepProps = ExtractPropTypes<typeof stepProps>;
export type StepPropsPublic = __ExtractPublicPropTypes<typeof stepProps>;
export type StepInstance = InstanceType<typeof Step> & unknown;

View File

@@ -0,0 +1,198 @@
import { defineComponent, ref, inject, getCurrentInstance, onMounted, watch, computed, onBeforeUnmount, openBlock, createElementBlock, normalizeStyle, unref, normalizeClass, createCommentVNode, createElementVNode, renderSlot, createBlock, withCtx, resolveDynamicComponent, createVNode, toDisplayString, createTextVNode } from 'vue';
import { ElIcon } from '../../icon/index.mjs';
import { Check, Close } from '@element-plus/icons-vue';
import { stepProps } from './item2.mjs';
import { STEPS_INJECTION_KEY } from './tokens.mjs';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
import { isNumber } from '../../../utils/types.mjs';
const __default__ = defineComponent({
name: "ElStep"
});
const _sfc_main = defineComponent({
...__default__,
props: stepProps,
setup(__props) {
const props = __props;
const ns = useNamespace("step");
const index = ref(-1);
const lineStyle = ref({});
const internalStatus = ref("");
const parent = inject(STEPS_INJECTION_KEY);
const currentInstance = getCurrentInstance();
onMounted(() => {
watch([
() => parent.props.active,
() => parent.props.processStatus,
() => parent.props.finishStatus
], ([active]) => {
updateStatus(active);
}, { immediate: true });
});
const currentStatus = computed(() => {
return props.status || internalStatus.value;
});
const prevInternalStatus = computed(() => {
const prevStep = parent.steps.value[index.value - 1];
return prevStep ? prevStep.internalStatus.value : "wait";
});
const isCenter = computed(() => {
return parent.props.alignCenter;
});
const isVertical = computed(() => {
return parent.props.direction === "vertical";
});
const isSimple = computed(() => {
return parent.props.simple;
});
const stepsCount = computed(() => {
return parent.steps.value.length;
});
const isLast = computed(() => {
var _a;
return ((_a = parent.steps.value[stepsCount.value - 1]) == null ? void 0 : _a.uid) === currentInstance.uid;
});
const space = computed(() => {
return isSimple.value ? "" : parent.props.space;
});
const containerKls = computed(() => {
return [
ns.b(),
ns.is(isSimple.value ? "simple" : parent.props.direction),
ns.is("flex", isLast.value && !space.value && !isCenter.value),
ns.is("center", isCenter.value && !isVertical.value && !isSimple.value)
];
});
const style = computed(() => {
const style2 = {
flexBasis: isNumber(space.value) ? `${space.value}px` : space.value ? space.value : `${100 / (stepsCount.value - (isCenter.value ? 0 : 1))}%`
};
if (isVertical.value)
return style2;
if (isLast.value) {
style2.maxWidth = `${100 / stepsCount.value}%`;
}
return style2;
});
const setIndex = (val) => {
index.value = val;
};
const calcProgress = (status) => {
const isWait = status === "wait";
const style2 = {
transitionDelay: `${isWait ? "-" : ""}${150 * index.value}ms`
};
const step = status === parent.props.processStatus || isWait ? 0 : 100;
style2.borderWidth = step && !isSimple.value ? "1px" : 0;
style2[parent.props.direction === "vertical" ? "height" : "width"] = `${step}%`;
lineStyle.value = style2;
};
const updateStatus = (activeIndex) => {
if (activeIndex > index.value) {
internalStatus.value = parent.props.finishStatus;
} else if (activeIndex === index.value && prevInternalStatus.value !== "error") {
internalStatus.value = parent.props.processStatus;
} else {
internalStatus.value = "wait";
}
const prevChild = parent.steps.value[index.value - 1];
if (prevChild)
prevChild.calcProgress(internalStatus.value);
};
const stepItemState = {
uid: currentInstance.uid,
getVnode: () => currentInstance.vnode,
currentStatus,
internalStatus,
setIndex,
calcProgress
};
parent.addStep(stepItemState);
onBeforeUnmount(() => {
parent.removeStep(stepItemState);
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
style: normalizeStyle(unref(style)),
class: normalizeClass(unref(containerKls))
}, [
createCommentVNode(" icon & line "),
createElementVNode("div", {
class: normalizeClass([unref(ns).e("head"), unref(ns).is(unref(currentStatus))])
}, [
!unref(isSimple) ? (openBlock(), createElementBlock("div", {
key: 0,
class: normalizeClass(unref(ns).e("line"))
}, [
createElementVNode("i", {
class: normalizeClass(unref(ns).e("line-inner")),
style: normalizeStyle(lineStyle.value)
}, null, 6)
], 2)) : createCommentVNode("v-if", true),
createElementVNode("div", {
class: normalizeClass([unref(ns).e("icon"), unref(ns).is(_ctx.icon || _ctx.$slots.icon ? "icon" : "text")])
}, [
renderSlot(_ctx.$slots, "icon", {}, () => [
_ctx.icon ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
class: normalizeClass(unref(ns).e("icon-inner"))
}, {
default: withCtx(() => [
(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
]),
_: 1
}, 8, ["class"])) : unref(currentStatus) === "success" ? (openBlock(), createBlock(unref(ElIcon), {
key: 1,
class: normalizeClass([unref(ns).e("icon-inner"), unref(ns).is("status")])
}, {
default: withCtx(() => [
createVNode(unref(Check))
]),
_: 1
}, 8, ["class"])) : unref(currentStatus) === "error" ? (openBlock(), createBlock(unref(ElIcon), {
key: 2,
class: normalizeClass([unref(ns).e("icon-inner"), unref(ns).is("status")])
}, {
default: withCtx(() => [
createVNode(unref(Close))
]),
_: 1
}, 8, ["class"])) : !unref(isSimple) ? (openBlock(), createElementBlock("div", {
key: 3,
class: normalizeClass(unref(ns).e("icon-inner"))
}, toDisplayString(index.value + 1), 3)) : createCommentVNode("v-if", true)
])
], 2)
], 2),
createCommentVNode(" title & description "),
createElementVNode("div", {
class: normalizeClass(unref(ns).e("main"))
}, [
createElementVNode("div", {
class: normalizeClass([unref(ns).e("title"), unref(ns).is(unref(currentStatus))])
}, [
renderSlot(_ctx.$slots, "title", {}, () => [
createTextVNode(toDisplayString(_ctx.title), 1)
])
], 2),
unref(isSimple) ? (openBlock(), createElementBlock("div", {
key: 0,
class: normalizeClass(unref(ns).e("arrow"))
}, null, 2)) : (openBlock(), createElementBlock("div", {
key: 1,
class: normalizeClass([unref(ns).e("description"), unref(ns).is(unref(currentStatus))])
}, [
renderSlot(_ctx.$slots, "description", {}, () => [
createTextVNode(toDisplayString(_ctx.description), 1)
])
], 2))
], 2)
], 6);
};
}
});
var Step = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "item.vue"]]);
export { Step as default };
//# sourceMappingURL=item.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,53 @@
import type { ComputedRef, Ref, VNode } from 'vue';
import type { StepsProps } from './steps';
export interface StepItemState {
uid: number;
getVnode: () => VNode;
currentStatus: ComputedRef<string>;
internalStatus: Ref<string>;
setIndex: (val: number) => void;
calcProgress: (status: string) => void;
}
export interface IStepsInject {
props: StepsProps;
steps: Ref<StepItemState[]>;
addStep: (item: StepItemState) => void;
removeStep: (item: StepItemState) => void;
}
declare function __VLS_template(): {
icon?(_: {}): any;
title?(_: {}): any;
description?(_: {}): any;
};
declare const __VLS_component: import("vue").DefineComponent<{
readonly title: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", 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 description: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly status: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "wait" | "error" | "finish" | "success" | "process", unknown, "", boolean>;
}, {}, 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 title: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", 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 description: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
readonly status: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "" | "wait" | "error" | "finish" | "success" | "process", unknown, "", boolean>;
}>>, {
readonly title: string;
readonly description: string;
readonly status: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "" | "wait" | "error" | "finish" | "success" | "process", unknown>;
}>;
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,24 @@
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
import { iconPropType } from '../../../utils/vue/icon.mjs';
const stepProps = buildProps({
title: {
type: String,
default: ""
},
icon: {
type: iconPropType
},
description: {
type: String,
default: ""
},
status: {
type: String,
values: ["", "wait", "process", "finish", "error", "success"],
default: ""
}
});
export { stepProps };
//# sourceMappingURL=item2.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"item2.mjs","sources":["../../../../../../packages/components/steps/src/item.ts"],"sourcesContent":["import { buildProps, iconPropType } from '@element-plus/utils'\n\nimport type Step from './item.vue'\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\n\nexport const stepProps = buildProps({\n /**\n * @description step title\n */\n title: {\n type: String,\n default: '',\n },\n /**\n * @description step custom icon. Icons can be passed via named slot as well\n */\n icon: {\n type: iconPropType,\n },\n /**\n * @description step description\n */\n description: {\n type: String,\n default: '',\n },\n /**\n * @description current status. It will be automatically set by Steps if not configured.\n */\n status: {\n type: String,\n values: ['', 'wait', 'process', 'finish', 'error', 'success'],\n default: '',\n },\n} as const)\n\nexport type StepProps = ExtractPropTypes<typeof stepProps>\nexport type StepPropsPublic = __ExtractPublicPropTypes<typeof stepProps>\n\nexport type StepInstance = InstanceType<typeof Step> & unknown\n"],"names":[],"mappings":";;;AACY,MAAC,SAAS,GAAG,UAAU,CAAC;AACpC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;AACjE,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,CAAC;;;;"}

View File

@@ -0,0 +1,28 @@
import type Steps from './steps.vue';
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
export declare const stepsProps: {
readonly space: import("element-plus/es/utils").EpPropFinalized<readonly [NumberConstructor, StringConstructor], unknown, unknown, "", boolean>;
readonly active: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
readonly direction: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "horizontal", boolean>;
readonly alignCenter: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly simple: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly finishStatus: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "wait" | "error" | "finish" | "success" | "process", unknown, "finish", boolean>;
readonly processStatus: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "wait" | "error" | "finish" | "success" | "process", unknown, "process", boolean>;
};
export type StepsProps = ExtractPropTypes<typeof stepsProps>;
export type StepsPropsPublic = __ExtractPublicPropTypes<typeof stepsProps>;
export declare const stepsEmits: {
change: (newVal: number, oldVal: number) => boolean;
};
export type StepsEmits = typeof stepsEmits;
export type StepsInstance = InstanceType<typeof Steps> & unknown;

View File

@@ -0,0 +1,41 @@
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
import { CHANGE_EVENT } from '../../../constants/event.mjs';
import { isNumber } from '../../../utils/types.mjs';
const stepsProps = buildProps({
space: {
type: [Number, String],
default: ""
},
active: {
type: Number,
default: 0
},
direction: {
type: String,
default: "horizontal",
values: ["horizontal", "vertical"]
},
alignCenter: {
type: Boolean
},
simple: {
type: Boolean
},
finishStatus: {
type: String,
values: ["wait", "process", "finish", "error", "success"],
default: "finish"
},
processStatus: {
type: String,
values: ["wait", "process", "finish", "error", "success"],
default: "process"
}
});
const stepsEmits = {
[CHANGE_EVENT]: (newVal, oldVal) => [newVal, oldVal].every(isNumber)
};
export { stepsEmits, stepsProps };
//# sourceMappingURL=steps.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"steps.mjs","sources":["../../../../../../packages/components/steps/src/steps.ts"],"sourcesContent":["import { CHANGE_EVENT } from '@element-plus/constants'\nimport { buildProps, isNumber } from '@element-plus/utils'\n\nimport type Steps from './steps.vue'\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\n\nexport const stepsProps = buildProps({\n /**\n * @description the spacing of each step, will be responsive if omitted. Supports percentage.\n */\n space: {\n type: [Number, String],\n default: '',\n },\n /**\n * @description current activation step\n */\n active: {\n type: Number,\n default: 0,\n },\n /**\n * @description display direction\n */\n direction: {\n type: String,\n default: 'horizontal',\n values: ['horizontal', 'vertical'],\n },\n /**\n * @description center title and description\n */\n alignCenter: {\n type: Boolean,\n },\n /**\n * @description whether to apply simple theme\n */\n simple: {\n type: Boolean,\n },\n /**\n * @description status of end step\n */\n finishStatus: {\n type: String,\n values: ['wait', 'process', 'finish', 'error', 'success'],\n default: 'finish',\n },\n /**\n * @description status of current step\n */\n processStatus: {\n type: String,\n values: ['wait', 'process', 'finish', 'error', 'success'],\n default: 'process',\n },\n} as const)\nexport type StepsProps = ExtractPropTypes<typeof stepsProps>\nexport type StepsPropsPublic = __ExtractPublicPropTypes<typeof stepsProps>\n\nexport const stepsEmits = {\n [CHANGE_EVENT]: (newVal: number, oldVal: number) =>\n [newVal, oldVal].every(isNumber),\n}\nexport type StepsEmits = typeof stepsEmits\n\nexport type StepsInstance = InstanceType<typeof Steps> & unknown\n"],"names":[],"mappings":";;;;AAEY,MAAC,UAAU,GAAG,UAAU,CAAC;AACrC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,YAAY;AACzB,IAAI,MAAM,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC;AACtC,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,OAAO;AACjB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,OAAO;AACjB,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;AAC7D,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;AAC7D,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,UAAU,GAAG;AAC1B,EAAE,CAAC,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;AACtE;;;;"}

View File

@@ -0,0 +1,57 @@
declare function __VLS_template(): {
default?(_: {}): any;
};
declare const __VLS_component: import("vue").DefineComponent<{
readonly space: import("element-plus/es/utils").EpPropFinalized<readonly [NumberConstructor, StringConstructor], unknown, unknown, "", boolean>;
readonly active: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
readonly direction: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "horizontal", boolean>;
readonly alignCenter: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly simple: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly finishStatus: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "wait" | "error" | "finish" | "success" | "process", unknown, "finish", boolean>;
readonly processStatus: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "wait" | "error" | "finish" | "success" | "process", unknown, "process", boolean>;
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
change: (newVal: number, oldVal: number) => void;
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
readonly space: import("element-plus/es/utils").EpPropFinalized<readonly [NumberConstructor, StringConstructor], unknown, unknown, "", boolean>;
readonly active: import("element-plus/es/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 0, boolean>;
readonly direction: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "horizontal", boolean>;
readonly alignCenter: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly simple: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly finishStatus: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "wait" | "error" | "finish" | "success" | "process", unknown, "finish", boolean>;
readonly processStatus: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "wait" | "error" | "finish" | "success" | "process", unknown, "process", boolean>;
}>> & {
onChange?: ((newVal: number, oldVal: number) => any) | undefined;
}, {
readonly direction: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "horizontal" | "vertical", unknown>;
readonly space: import("element-plus/es/utils").EpPropMergeType<readonly [NumberConstructor, StringConstructor], unknown, unknown>;
readonly active: number;
readonly finishStatus: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "wait" | "error" | "finish" | "success" | "process", unknown>;
readonly processStatus: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "wait" | "error" | "finish" | "success" | "process", unknown>;
}>;
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,47 @@
import { defineComponent, getCurrentInstance, watch, provide, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createVNode } from 'vue';
import { stepsProps, stepsEmits } from './steps.mjs';
import { STEPS_INJECTION_KEY } from './tokens.mjs';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
import { useOrderedChildren } from '../../../hooks/use-ordered-children/index.mjs';
import { CHANGE_EVENT } from '../../../constants/event.mjs';
const __default__ = defineComponent({
name: "ElSteps"
});
const _sfc_main = /* @__PURE__ */ defineComponent({
...__default__,
props: stepsProps,
emits: stepsEmits,
setup(__props, { emit }) {
const props = __props;
const ns = useNamespace("steps");
const {
children: steps,
addChild: addStep,
removeChild: removeStep,
ChildrenSorter: StepsSorter
} = useOrderedChildren(getCurrentInstance(), "ElStep");
watch(steps, () => {
steps.value.forEach((instance, index) => {
instance.setIndex(index);
});
});
provide(STEPS_INJECTION_KEY, { props, steps, addStep, removeStep });
watch(() => props.active, (newVal, oldVal) => {
emit(CHANGE_EVENT, newVal, oldVal);
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass([unref(ns).b(), unref(ns).m(_ctx.simple ? "simple" : _ctx.direction)])
}, [
renderSlot(_ctx.$slots, "default"),
createVNode(unref(StepsSorter))
], 2);
};
}
});
var Steps = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "steps.vue"]]);
export { Steps as default };
//# sourceMappingURL=steps2.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"steps2.mjs","sources":["../../../../../../packages/components/steps/src/steps.vue"],"sourcesContent":["<template>\n <div :class=\"[ns.b(), ns.m(simple ? 'simple' : direction)]\">\n <slot />\n <steps-sorter />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { getCurrentInstance, provide, watch } from 'vue'\nimport { CHANGE_EVENT } from '@element-plus/constants'\nimport { useNamespace, useOrderedChildren } from '@element-plus/hooks'\nimport { stepsEmits, stepsProps } from './steps'\nimport { STEPS_INJECTION_KEY } from './tokens'\n\nimport type { StepItemState } from './item.vue'\n\ndefineOptions({\n name: 'ElSteps',\n})\n\nconst props = defineProps(stepsProps)\nconst emit = defineEmits(stepsEmits)\n\nconst ns = useNamespace('steps')\nconst {\n children: steps,\n addChild: addStep,\n removeChild: removeStep,\n ChildrenSorter: StepsSorter,\n} = useOrderedChildren<StepItemState>(getCurrentInstance()!, 'ElStep')\n\nwatch(steps, () => {\n steps.value.forEach((instance: StepItemState, index: number) => {\n instance.setIndex(index)\n })\n})\n\nprovide(STEPS_INJECTION_KEY, { props, steps, addStep, removeStep })\n\nwatch(\n () => props.active,\n (newVal: number, oldVal: number) => {\n emit(CHANGE_EVENT, newVal, oldVal)\n }\n)\n</script>\n"],"names":["_openBlock","_createElementBlock","_normalizeClass","_unref"],"mappings":";;;;;;;;mCAgBc,CAAA;AAAA,EACZ,IAAM,EAAA,SAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAK,aAAa,OAAO,CAAA,CAAA;AAC/B,IAAM,MAAA;AAAA,MACJ,QAAU,EAAA,KAAA;AAAA,MACV,QAAU,EAAA,OAAA;AAAA,MACV,WAAa,EAAA,UAAA;AAAA,MACb,cAAgB,EAAA,WAAA;AAAA,KACd,GAAA,kBAAA,CAAkC,kBAAmB,EAAA,EAAI,QAAQ,CAAA,CAAA;AAErE,IAAA,KAAA,CAAM,OAAO,MAAM;AACjB,MAAA,KAAA,CAAM,KAAM,CAAA,OAAA,CAAQ,CAAC,QAAA,EAAyB,KAAkB,KAAA;AAC9D,QAAA,QAAA,CAAS,SAAS,KAAK,CAAA,CAAA;AAAA,OACxB,CAAA,CAAA;AAAA,KACF,CAAA,CAAA;AAED,IAAA,OAAA,CAAQ,qBAAqB,EAAE,KAAA,EAAO,KAAO,EAAA,OAAA,EAAS,YAAY,CAAA,CAAA;AAElE,IAAA,KAAA,CAAA,MAAA,KAAA,CAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,KAAA;AAAA,MACE,iBAAY,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA;AAAA,KACZ,CAAA,CAAC;AACC,IAAK,OAAA,CAAA,IAAA,EAAA,MAAA;AAA4B,MACnC,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA;AAAA,QACF,KAAA,EAAAC,cAAA,CAAA,CAAAC,KAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,EAAAA,KAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,MAAA,GAAA,QAAA,GAAA,IAAA,CAAA,SAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;"}

View File

@@ -0,0 +1 @@
export declare const STEPS_INJECTION_KEY = "ElSteps";

View File

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

View File

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

View File

@@ -0,0 +1,2 @@
import 'element-plus/es/components/base/style/css';
import 'element-plus/theme-chalk/el-steps.css';

View File

@@ -0,0 +1,3 @@
import '../../base/style/css.mjs';
import 'element-plus/theme-chalk/el-steps.css';
//# sourceMappingURL=css.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"css.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}

View File

@@ -0,0 +1,2 @@
import 'element-plus/es/components/base/style';
import 'element-plus/theme-chalk/src/steps.scss';

View File

@@ -0,0 +1,3 @@
import '../../base/style/index.mjs';
import 'element-plus/theme-chalk/src/steps.scss';
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}