vft 0.0.327 → 0.0.329

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,10 @@ export declare const VftSteps: import("vft/es/utils").SFCWithInstall<{
11
11
  type: import("vue").PropType<number>;
12
12
  default: number;
13
13
  };
14
+ contentPosition: {
15
+ type: import("vue").PropType<"top" | "bottom">;
16
+ default: string;
17
+ };
14
18
  alignCenter: {
15
19
  type: import("vue").PropType<boolean>;
16
20
  };
@@ -32,6 +36,7 @@ export declare const VftSteps: import("vft/es/utils").SFCWithInstall<{
32
36
  }, import("vue").PublicProps, {
33
37
  direction: "horizontal" | "vertical";
34
38
  active: number;
39
+ contentPosition: "top" | "bottom";
35
40
  finishStatus: "wait" | "process" | "finish" | "error" | "success";
36
41
  processStatus: "wait" | "process" | "finish" | "error" | "success";
37
42
  }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
@@ -53,6 +58,10 @@ export declare const VftSteps: import("vft/es/utils").SFCWithInstall<{
53
58
  type: import("vue").PropType<number>;
54
59
  default: number;
55
60
  };
61
+ contentPosition: {
62
+ type: import("vue").PropType<"top" | "bottom">;
63
+ default: string;
64
+ };
56
65
  alignCenter: {
57
66
  type: import("vue").PropType<boolean>;
58
67
  };
@@ -72,6 +81,7 @@ export declare const VftSteps: import("vft/es/utils").SFCWithInstall<{
72
81
  }>, {}, {}, {}, {}, {
73
82
  direction: "horizontal" | "vertical";
74
83
  active: number;
84
+ contentPosition: "top" | "bottom";
75
85
  finishStatus: "wait" | "process" | "finish" | "error" | "success";
76
86
  processStatus: "wait" | "process" | "finish" | "error" | "success";
77
87
  }>;
@@ -90,6 +100,10 @@ export declare const VftSteps: import("vft/es/utils").SFCWithInstall<{
90
100
  type: import("vue").PropType<number>;
91
101
  default: number;
92
102
  };
103
+ contentPosition: {
104
+ type: import("vue").PropType<"top" | "bottom">;
105
+ default: string;
106
+ };
93
107
  alignCenter: {
94
108
  type: import("vue").PropType<boolean>;
95
109
  };
@@ -111,6 +125,7 @@ export declare const VftSteps: import("vft/es/utils").SFCWithInstall<{
111
125
  }, string, {
112
126
  direction: "horizontal" | "vertical";
113
127
  active: number;
128
+ contentPosition: "top" | "bottom";
114
129
  finishStatus: "wait" | "process" | "finish" | "error" | "success";
115
130
  processStatus: "wait" | "process" | "finish" | "error" | "success";
116
131
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
@@ -124,7 +139,7 @@ export declare const VftSteps: import("vft/es/utils").SFCWithInstall<{
124
139
  type: import("vue").PropType<string>;
125
140
  };
126
141
  icon: {
127
- type: import("vue").PropType<import("vft/es/vft").IconProps>;
142
+ type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
128
143
  };
129
144
  description: {
130
145
  type: import("vue").PropType<string>;
@@ -144,7 +159,7 @@ export declare const VftSteps: import("vft/es/utils").SFCWithInstall<{
144
159
  type: import("vue").PropType<string>;
145
160
  };
146
161
  icon: {
147
- type: import("vue").PropType<import("vft/es/vft").IconProps>;
162
+ type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
148
163
  };
149
164
  description: {
150
165
  type: import("vue").PropType<string>;
@@ -161,7 +176,7 @@ export declare const VftSteps: import("vft/es/utils").SFCWithInstall<{
161
176
  type: import("vue").PropType<string>;
162
177
  };
163
178
  icon: {
164
- type: import("vue").PropType<import("vft/es/vft").IconProps>;
179
+ type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
165
180
  };
166
181
  description: {
167
182
  type: import("vue").PropType<string>;
@@ -171,9 +186,11 @@ export declare const VftSteps: import("vft/es/utils").SFCWithInstall<{
171
186
  };
172
187
  }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
173
188
  $slots: {
174
- icon?(_: {}): any;
189
+ top?(_: {}): any;
175
190
  title?(_: {}): any;
176
191
  description?(_: {}): any;
192
+ icon?(_: {}): any;
193
+ bottom?(_: {}): any;
177
194
  };
178
195
  });
179
196
  };
@@ -184,7 +201,7 @@ export declare const VftStep: import("vft/es/utils").SFCWithInstall<{
184
201
  type: import("vue").PropType<string>;
185
202
  };
186
203
  icon: {
187
- type: import("vue").PropType<import("vft/es/vft").IconProps>;
204
+ type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
188
205
  };
189
206
  description: {
190
207
  type: import("vue").PropType<string>;
@@ -204,7 +221,7 @@ export declare const VftStep: import("vft/es/utils").SFCWithInstall<{
204
221
  type: import("vue").PropType<string>;
205
222
  };
206
223
  icon: {
207
- type: import("vue").PropType<import("vft/es/vft").IconProps>;
224
+ type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
208
225
  };
209
226
  description: {
210
227
  type: import("vue").PropType<string>;
@@ -221,7 +238,7 @@ export declare const VftStep: import("vft/es/utils").SFCWithInstall<{
221
238
  type: import("vue").PropType<string>;
222
239
  };
223
240
  icon: {
224
- type: import("vue").PropType<import("vft/es/vft").IconProps>;
241
+ type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
225
242
  };
226
243
  description: {
227
244
  type: import("vue").PropType<string>;
@@ -231,9 +248,11 @@ export declare const VftStep: import("vft/es/utils").SFCWithInstall<{
231
248
  };
232
249
  }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
233
250
  $slots: {
234
- icon?(_: {}): any;
251
+ top?(_: {}): any;
235
252
  title?(_: {}): any;
236
253
  description?(_: {}): any;
254
+ icon?(_: {}): any;
255
+ bottom?(_: {}): any;
237
256
  };
238
257
  })>;
239
258
  export * from './types';
@@ -1,30 +1,24 @@
1
- import type { StepItemProps } from './types';
2
- import type { Ref } from 'vue';
3
- export interface IStepsProps {
4
- space: number | string;
5
- active: number;
6
- direction: string;
7
- alignCenter: boolean;
8
- simple: boolean;
9
- finishStatus: string;
10
- processStatus: string;
11
- }
1
+ import type { StepItemProps, StepsProps } from './types';
2
+ import type { Ref, VNode } from 'vue';
12
3
  export interface StepItemState {
13
4
  uid: number;
5
+ getVnode: () => VNode;
14
6
  currentStatus: string;
15
7
  setIndex: (val: number) => void;
16
8
  calcProgress: (status: string) => void;
17
9
  }
18
10
  export interface IStepsInject {
19
- props: IStepsProps;
11
+ props: StepsProps;
20
12
  steps: Ref<StepItemState[]>;
21
13
  addStep: (item: StepItemState) => void;
22
- removeStep: (uid: number) => void;
14
+ removeStep: (item: StepItemState) => void;
23
15
  }
24
16
  declare function __VLS_template(): {
25
- icon?(_: {}): any;
17
+ top?(_: {}): any;
26
18
  title?(_: {}): any;
27
19
  description?(_: {}): any;
20
+ icon?(_: {}): any;
21
+ bottom?(_: {}): any;
28
22
  };
29
23
  declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<StepItemProps>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<StepItemProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
30
24
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
@@ -1,136 +1,171 @@
1
- import { defineComponent as z, ref as k, inject as q, getCurrentInstance as A, onMounted as F, watch as G, onBeforeUnmount as H, reactive as J, computed as r, createElementBlock as d, openBlock as i, normalizeClass as a, normalizeStyle as D, createElementVNode as m, unref as s, createCommentVNode as W, renderSlot as C, createBlock as f, withCtx as O, resolveDynamicComponent as Q, toDisplayString as $, createTextVNode as x } from "vue";
1
+ import { defineComponent as D, ref as w, inject as Y, getCurrentInstance as q, onMounted as F, watch as G, computed as i, reactive as H, onBeforeUnmount as Q, createElementBlock as a, openBlock as n, normalizeClass as l, normalizeStyle as z, createCommentVNode as S, createElementVNode as d, unref as t, renderSlot as p, createTextVNode as k, toDisplayString as y, createBlock as N, mergeProps as R } from "vue";
2
+ import { VftIcon as V } from "../icon/index.js";
2
3
  import "@vueuse/core";
3
- import { isNumber as R } from "@vft/utils";
4
+ import { singleAttrToObj as X, isNumber as Z } from "@vft/utils";
4
5
  import "../config-provider/hooks/use-global-config.js";
5
6
  import "lodash-es";
6
- import { useNamespace as X } from "../../hooks/use-namespace/index.js";
7
+ import { useNamespace as _ } from "../../hooks/use-namespace/index.js";
7
8
  import "../../hooks/use-model-toggle/index.js";
8
9
  import "@popperjs/core";
9
10
  import "../../hooks/use-z-index/index.js";
10
- import { VftIcon as g } from "../icon/index.js";
11
- const Y = z({
11
+ import { STEPS_INJECTION_KEY as x } from "./tokens.js";
12
+ const ee = D({
12
13
  name: "VftStep"
13
- }), oe = /* @__PURE__ */ z({
14
- ...Y,
14
+ }), ve = /* @__PURE__ */ D({
15
+ ...ee,
15
16
  props: {
16
17
  title: {},
17
18
  icon: {},
18
19
  description: {},
19
20
  status: {}
20
21
  },
21
- setup(E) {
22
- const P = E, t = X("step"), l = k(-1), w = k({}), p = k(""), n = q("VftSteps"), V = A();
22
+ setup(K) {
23
+ const I = K, s = _("step"), c = w(-1), B = w({}), m = w(""), o = Y(x), $ = q();
23
24
  F(() => {
24
25
  G(
25
26
  [
26
- () => n.props.active,
27
- () => n.props.processStatus,
28
- () => n.props.finishStatus
27
+ () => o.props.active,
28
+ () => o.props.processStatus,
29
+ () => o.props.finishStatus
29
30
  ],
30
31
  ([e]) => {
31
32
  U(e);
32
33
  },
33
34
  { immediate: !0 }
34
35
  );
35
- }), H(() => {
36
- n.removeStep(I.uid);
37
36
  });
38
- const u = r(() => P.status || p.value), j = r(() => {
39
- const e = n.steps.value[l.value - 1];
37
+ const E = i(
38
+ () => X(I.icon, "icon")
39
+ ), r = i(() => I.status || m.value), O = i(() => {
40
+ const e = o.steps.value[c.value - 1];
40
41
  return e ? e.currentStatus : "wait";
41
- }), S = r(() => n.props.alignCenter), B = r(() => n.props.direction === "vertical"), o = r(() => n.props.simple), y = r(() => n.steps.value.length), N = r(() => n.steps.value[y.value - 1]?.uid === V?.uid), v = r(() => o.value ? "" : n.props.space), K = r(() => [
42
- t.b(),
43
- t.is(o.value ? "simple" : n.props.direction),
44
- t.is("flex", N.value && !v.value && !S.value),
45
- t.is("center", S.value && !B.value && !o.value)
46
- ]), L = r(() => {
42
+ }), h = i(() => o.props.alignCenter), P = i(() => o.props.direction === "vertical"), u = i(() => o.props.simple), g = i(() => o.props.contentPosition === "top"), C = i(() => o.steps.value.length), T = i(() => o.steps.value[C.value - 1]?.uid === $.uid), f = i(() => u.value ? "" : o.props.space), A = i(() => [
43
+ s.b(),
44
+ s.is(u.value ? "simple" : o.props.direction),
45
+ s.is("flex", T.value && !f.value && !h.value),
46
+ s.is("center", h.value && !P.value && !u.value),
47
+ s.is("content-top", g.value)
48
+ ]), J = i(() => {
47
49
  const e = {
48
- flexBasis: R(v.value) ? `${v.value}px` : v.value ? v.value : `${100 / (y.value - (S.value ? 0 : 1))}%`
50
+ flexBasis: Z(f.value) ? `${f.value}px` : f.value ? f.value : `${100 / (C.value - (h.value ? 0 : 1))}%`
49
51
  };
50
- return B.value || N.value && (e.maxWidth = `${100 / y.value}%`), e;
51
- }), M = (e) => {
52
- l.value = e;
53
- }, T = (e) => {
54
- const c = e === "wait", h = {
55
- transitionDelay: `${c ? "-" : ""}${150 * l.value}ms`
56
- }, b = e === n.props.processStatus || c ? 0 : 100;
57
- h.borderWidth = b && !o.value ? "1px" : 0, h[n.props.direction === "vertical" ? "height" : "width"] = `${b}%`, w.value = h;
52
+ return P.value || T.value && (e.maxWidth = `${100 / C.value}%`), e;
53
+ }), L = (e) => {
54
+ c.value = e;
55
+ }, M = (e) => {
56
+ const v = e === "wait", b = {
57
+ transitionDelay: `${v ? "-" : ""}${150 * c.value}ms`
58
+ }, j = e === o.props.processStatus || v ? 0 : 100;
59
+ b.borderWidth = j && !u.value ? "1px" : 0, b[o.props.direction === "vertical" ? "height" : "width"] = `${j}%`, B.value = b;
58
60
  }, U = (e) => {
59
- e > l.value ? p.value = n.props.finishStatus : e === l.value && j.value !== "error" ? p.value = n.props.processStatus : p.value = "wait";
60
- const c = n.steps.value[l.value - 1];
61
- c && c.calcProgress(p.value);
62
- }, I = J({
63
- uid: V.uid,
64
- currentStatus: u,
65
- setIndex: M,
66
- calcProgress: T
61
+ e > c.value ? m.value = o.props.finishStatus : e === c.value && O.value !== "error" ? m.value = o.props.processStatus : m.value = "wait";
62
+ const v = o.steps.value[c.value - 1];
63
+ v && v.calcProgress(m.value);
64
+ }, W = H({
65
+ uid: $.uid,
66
+ getVnode: () => $.vnode,
67
+ currentStatus: r,
68
+ setIndex: L,
69
+ calcProgress: M
67
70
  });
68
- return n.addStep(I), (e, c) => (i(), d("div", {
69
- style: D(L.value),
70
- class: a(K.value)
71
+ return o.addStep(W), Q(() => {
72
+ o.removeStep(W);
73
+ }), (e, v) => (n(), a("div", {
74
+ style: z(J.value),
75
+ class: l(A.value)
71
76
  }, [
72
- m("div", {
73
- class: a([s(t).e("head"), s(t).is(u.value)])
77
+ e.$slots.top ? (n(), a("div", {
78
+ key: 0,
79
+ class: l(t(s).e("top-slot"))
74
80
  }, [
75
- o.value ? W("", !0) : (i(), d("div", {
81
+ p(e.$slots, "top")
82
+ ], 2)) : g.value ? (n(), a("div", {
83
+ key: 1,
84
+ class: l(t(s).e("main"))
85
+ }, [
86
+ d("div", {
87
+ class: l([t(s).e("title"), t(s).is(r.value)])
88
+ }, [
89
+ p(e.$slots, "title", {}, () => [
90
+ k(y(e.title), 1)
91
+ ])
92
+ ], 2),
93
+ u.value ? (n(), a("div", {
94
+ key: 0,
95
+ class: l(t(s).e("arrow"))
96
+ }, null, 2)) : S("", !0),
97
+ d("div", {
98
+ class: l([t(s).e("description"), t(s).is(r.value)])
99
+ }, [
100
+ p(e.$slots, "description", {}, () => [
101
+ k(y(e.description), 1)
102
+ ])
103
+ ], 2)
104
+ ], 2)) : S("", !0),
105
+ d("div", {
106
+ class: l([t(s).e("head"), t(s).is(r.value)])
107
+ }, [
108
+ u.value ? S("", !0) : (n(), a("div", {
76
109
  key: 0,
77
- class: a(s(t).e("line"))
110
+ class: l(t(s).e("line"))
78
111
  }, [
79
- m("i", {
80
- class: a(s(t).e("line-inner")),
81
- style: D(w.value)
112
+ d("i", {
113
+ class: l(t(s).e("line-inner")),
114
+ style: z(B.value)
82
115
  }, null, 6)
83
116
  ], 2)),
84
- m("div", {
85
- class: a([s(t).e("icon"), s(t).is(e.icon || e.$slots.icon ? "icon" : "text")])
117
+ d("div", {
118
+ class: l([t(s).e("icon"), t(s).is(e.icon || e.$slots.icon ? "icon" : "text")])
86
119
  }, [
87
- C(e.$slots, "icon", {}, () => [
88
- e.icon ? (i(), f(s(g), {
89
- key: 0,
90
- class: a(s(t).e("icon-inner"))
91
- }, {
92
- default: O(() => [
93
- (i(), f(Q(e.icon)))
94
- ]),
95
- _: 1
96
- }, 8, ["class"])) : u.value === "success" ? (i(), f(s(g), {
120
+ p(e.$slots, "icon", {}, () => [
121
+ E.value?.icon ? (n(), N(t(V), R({ key: 0 }, E.value, {
122
+ class: t(s).e("icon-inner")
123
+ }), null, 16, ["class"])) : r.value === "success" ? (n(), N(t(V), {
97
124
  key: 1,
98
- class: a([s(t).e("icon-inner"), s(t).is("status")])
99
- }, null, 8, ["class"])) : u.value === "error" ? (i(), f(s(g), {
125
+ class: l([t(s).e("icon-inner"), t(s).is("status")]),
126
+ icon: "icon-check"
127
+ }, null, 8, ["class"])) : r.value === "error" ? (n(), N(t(V), {
100
128
  key: 2,
101
- class: a([s(t).e("icon-inner"), s(t).is("status")])
102
- }, null, 8, ["class"])) : o.value ? W("", !0) : (i(), d("div", {
129
+ class: l([t(s).e("icon-inner"), t(s).is("status")]),
130
+ icon: "icon-close"
131
+ }, null, 8, ["class"])) : u.value ? S("", !0) : (n(), a("div", {
103
132
  key: 3,
104
- class: a(s(t).e("icon-inner"))
105
- }, $(l.value + 1), 3))
133
+ class: l(t(s).e("icon-inner"))
134
+ }, y(c.value + 1), 3))
106
135
  ])
107
136
  ], 2)
108
137
  ], 2),
109
- m("div", {
110
- class: a(s(t).e("main"))
138
+ e.$slots.bottom ? (n(), a("div", {
139
+ key: 2,
140
+ class: l(t(s).e("bottom-slot"))
141
+ }, [
142
+ p(e.$slots, "bottom")
143
+ ], 2)) : g.value ? S("", !0) : (n(), a("div", {
144
+ key: 3,
145
+ class: l(t(s).e("main"))
111
146
  }, [
112
- m("div", {
113
- class: a([s(t).e("title"), s(t).is(u.value)])
147
+ d("div", {
148
+ class: l([t(s).e("title"), t(s).is(r.value)])
114
149
  }, [
115
- C(e.$slots, "title", {}, () => [
116
- x($(e.title), 1)
150
+ p(e.$slots, "title", {}, () => [
151
+ k(y(e.title), 1)
117
152
  ])
118
153
  ], 2),
119
- o.value ? (i(), d("div", {
154
+ u.value ? (n(), a("div", {
120
155
  key: 0,
121
- class: a(s(t).e("arrow"))
122
- }, null, 2)) : (i(), d("div", {
156
+ class: l(t(s).e("arrow"))
157
+ }, null, 2)) : (n(), a("div", {
123
158
  key: 1,
124
- class: a([s(t).e("description"), s(t).is(u.value)])
159
+ class: l([t(s).e("description"), t(s).is(r.value)])
125
160
  }, [
126
- C(e.$slots, "description", {}, () => [
127
- x($(e.description), 1)
161
+ p(e.$slots, "description", {}, () => [
162
+ k(y(e.description), 1)
128
163
  ])
129
164
  ], 2))
130
- ], 2)
165
+ ], 2))
131
166
  ], 6));
132
167
  }
133
168
  });
134
169
  export {
135
- oe as default
170
+ ve as default
136
171
  };
@@ -7,6 +7,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
7
7
  direction: string;
8
8
  finishStatus: string;
9
9
  processStatus: string;
10
+ contentPosition: string;
10
11
  }>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
12
  change: (newVal?: number | undefined, oldVal?: number | undefined) => void;
12
13
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<StepsProps>, {
@@ -14,11 +15,13 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
14
15
  direction: string;
15
16
  finishStatus: string;
16
17
  processStatus: string;
18
+ contentPosition: string;
17
19
  }>>> & Readonly<{
18
20
  onChange?: ((newVal?: number | undefined, oldVal?: number | undefined) => any) | undefined;
19
21
  }>, {
20
22
  direction: "horizontal" | "vertical";
21
23
  active: number;
24
+ contentPosition: "top" | "bottom";
22
25
  finishStatus: "wait" | "process" | "finish" | "error" | "success";
23
26
  processStatus: "wait" | "process" | "finish" | "error" | "success";
24
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,17 +1,19 @@
1
- import { defineComponent as p, getCurrentInstance as f, watch as i, provide as u, createElementBlock as h, openBlock as v, normalizeClass as C, unref as n, renderSlot as S } from "vue";
1
+ import { defineComponent as p, getCurrentInstance as u, watch as n, provide as h, createElementBlock as S, openBlock as C, normalizeClass as v, unref as r, renderSlot as E, createVNode as _ } from "vue";
2
+ import { CHANGE_EVENT as N } from "../../constants/event.js";
2
3
  import "@vueuse/core";
3
4
  import "@vft/utils";
4
5
  import "../config-provider/hooks/use-global-config.js";
5
6
  import "lodash-es";
6
- import { useNamespace as _ } from "../../hooks/use-namespace/index.js";
7
+ import { useNamespace as B } from "../../hooks/use-namespace/index.js";
7
8
  import "../../hooks/use-model-toggle/index.js";
8
- import { useOrderedChildren as g } from "../../hooks/use-ordered-children/index.js";
9
+ import { useOrderedChildren as I } from "../../hooks/use-ordered-children/index.js";
9
10
  import "@popperjs/core";
10
11
  import "../../hooks/use-z-index/index.js";
11
- const B = p({
12
+ import { STEPS_INJECTION_KEY as g } from "./tokens.js";
13
+ const T = p({
12
14
  name: "vft-steps"
13
- }), $ = /* @__PURE__ */ p({
14
- ...B,
15
+ }), K = /* @__PURE__ */ p({
16
+ ...T,
15
17
  props: {
16
18
  space: {},
17
19
  active: { default: 0 },
@@ -19,31 +21,34 @@ const B = p({
19
21
  alignCenter: { type: Boolean },
20
22
  simple: { type: Boolean },
21
23
  finishStatus: { default: "finish" },
22
- processStatus: { default: "process" }
24
+ processStatus: { default: "process" },
25
+ contentPosition: { default: "bottom" }
23
26
  },
24
27
  emits: ["change"],
25
- setup(a, { emit: l }) {
26
- const s = a, m = l, r = _("steps"), {
28
+ setup(a, { emit: m }) {
29
+ const s = a, l = m, i = B("steps"), {
27
30
  children: o,
28
- addChild: c,
29
- removeChild: d
30
- } = g(f(), "ElStep");
31
- return i(o, () => {
31
+ addChild: d,
32
+ removeChild: c,
33
+ ChildrenSorter: f
34
+ } = I(u(), "VftStep");
35
+ return n(o, () => {
32
36
  o.value.forEach((e, t) => {
33
37
  e.setIndex(t);
34
38
  });
35
- }), u("VftSteps", { props: s, steps: o, addStep: c, removeStep: d }), i(
39
+ }), h(g, { props: s, steps: o, addStep: d, removeStep: c }), n(
36
40
  () => s.active,
37
41
  (e, t) => {
38
- m("change", e, t);
42
+ l(N, e, t);
39
43
  }
40
- ), (e, t) => (v(), h("div", {
41
- class: C([n(r).b(), n(r).m(e.simple ? "simple" : e.direction)])
44
+ ), (e, t) => (C(), S("div", {
45
+ class: v([r(i).b(), r(i).m(e.simple ? "simple" : e.direction)])
42
46
  }, [
43
- S(e.$slots, "default")
47
+ E(e.$slots, "default"),
48
+ _(r(f))
44
49
  ], 2));
45
50
  }
46
51
  });
47
52
  export {
48
- $ as default
53
+ K as default
49
54
  };
@@ -0,0 +1 @@
1
+ export declare const STEPS_INJECTION_KEY = "VftSteps";
@@ -0,0 +1,4 @@
1
+ const t = "VftSteps";
2
+ export {
3
+ t as STEPS_INJECTION_KEY
4
+ };
@@ -7,10 +7,12 @@ export interface StepsProps {
7
7
  simple?: boolean;
8
8
  finishStatus?: 'wait' | 'process' | 'finish' | 'error' | 'success';
9
9
  processStatus?: 'wait' | 'process' | 'finish' | 'error' | 'success';
10
+ /** 内容区域位置:'top' | 'bottom',默认为 'bottom' */
11
+ contentPosition?: 'top' | 'bottom';
10
12
  }
11
13
  export interface StepItemProps {
12
14
  title?: string;
13
- icon?: IconProps;
15
+ icon?: IconProps | string;
14
16
  description?: string;
15
17
  status?: '' | 'wait' | 'process' | 'finish' | 'error' | 'success';
16
18
  }