lkt-step-process 2.0.0 → 2.0.2
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.
- package/dist/build.d.ts +2 -2
- package/dist/build.js +95 -81
- package/package.json +1 -1
- package/src/lib-components/LktStepProcess.vue +41 -20
package/dist/build.d.ts
CHANGED
package/dist/build.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as
|
|
1
|
+
var O = Object.defineProperty;
|
|
2
|
+
var q = (e, a, o) => a in e ? O(e, a, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[a] = o;
|
|
3
|
+
var u = (e, a, o) => q(e, typeof a != "symbol" ? a + "" : a, o);
|
|
4
|
+
import { defineComponent as $, mergeDefaults as G, useSlots as K, ref as g, watch as b, computed as v, onMounted as Q, resolveComponent as w, createElementBlock as L, openBlock as f, normalizeClass as W, createBlock as B, createCommentVNode as y, createElementVNode as T, normalizeProps as X, mergeProps as A, withDirectives as P, vShow as S, Fragment as Y, renderList as Z, renderSlot as J } from "vue";
|
|
5
5
|
import "lkt-string-tools";
|
|
6
|
-
var
|
|
6
|
+
var ee = ((e) => (e.Button = "button", e.Submit = "submit", e.Reset = "reset", e.Anchor = "anchor", e.Content = "content", e.Switch = "switch", e.HiddenSwitch = "hidden-switch", e.Split = "split", e.SplitLazy = "split-lazy", e.SplitEver = "split-ever", e.Tooltip = "tooltip", e.TooltipLazy = "tooltip-lazy", e.TooltipEver = "tooltip-ever", e.FileUpload = "file-upload", e.ImageUpload = "image-upload", e))(ee || {}), te = ((e) => (e.Text = "text", e.Email = "email", e.Tel = "tel", e.Password = "password", e.Search = "search", e.Number = "number", e.Color = "color", e.Range = "range", e.Textarea = "textarea", e.Html = "html", e.Date = "date", e.File = "file", e.Image = "image", e.Select = "select", e.Check = "check", e.Switch = "switch", e.Calc = "calc", e.Card = "card", e.Elements = "elements", e))(te || {}), ae = ["lktDateProps", "lktStrictItem", "lktExcludedProps"], i, re = (i = class {
|
|
7
7
|
constructor(a) {
|
|
8
8
|
}
|
|
9
|
-
feed(a = {},
|
|
10
|
-
if (typeof a == "object") for (let [
|
|
9
|
+
feed(a = {}, o = this) {
|
|
10
|
+
if (typeof a == "object") for (let [n, C] of Object.entries(a)) o.assignProp(n, C);
|
|
11
11
|
}
|
|
12
|
-
assignProp(a,
|
|
13
|
-
if (!(
|
|
14
|
-
if (
|
|
15
|
-
this[a] = new Date(
|
|
12
|
+
assignProp(a, o) {
|
|
13
|
+
if (!(ae.includes(a) || i.lktExcludedProps.includes(a))) {
|
|
14
|
+
if (i.lktDateProps.includes(a)) {
|
|
15
|
+
this[a] = new Date(o);
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
this[a] =
|
|
18
|
+
this[a] = o;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
}, i
|
|
21
|
+
}, u(i, "lktAllowUndefinedProps", []), u(i, "lktExcludedProps", []), u(i, "lktDateProps", []), u(i, "lktStrictItem", !1), u(i, "lktDefaultValues", []), i), ne = ((e) => (e.Auto = "auto", e.Always = "always", e.Lazy = "lazy", e.Ever = "ever", e))(ne || {}), le = ((e) => (e.Transform = "transform", e.Height = "height", e.Display = "display", e))(le || {}), oe = ((e) => (e.Href = "href", e.RouterLink = "router-link", e.RouterLinkBack = "router-link-back", e.Mail = "mail", e.Tel = "tel", e.Tab = "tab", e.Download = "download", e.Action = "action", e.Legacy = "", e))(oe || {}), ue = ((e) => (e.Static = "static", e.Parallax = "parallax", e))(ue || {}), ie = ((e) => (e.None = "", e.Field = "field", e.Button = "button", e.Anchor = "anchor", e))(ie || {}), se = ((e) => (e.A0 = "a0", e.A1 = "a1", e.A2 = "a2", e.A3 = "a3", e.A4 = "a4", e.A5 = "a5", e.A6 = "a6", e.A7 = "a7", e.A8 = "a8", e.A9 = "a9", e))(se || {}), ce = ((e) => (e.List = "list", e.Inline = "inline", e.Count = "count", e))(ce || {}), de = ((e) => (e.MinStringLength = "min-str", e.MinNumber = "min-num", e.MaxStringLength = "max-str", e.MaxNumber = "max-num", e.Email = "email", e.Empty = "empty", e.EqualTo = "equal-to", e.MinNumbers = "min-numbers", e.MaxNumbers = "max-numbers", e.MinChars = "min-chars", e.MaxChars = "max-chars", e.MinUpperChars = "min-upper-chars", e.MaxUpperChars = "max-upper-chars", e.MinLowerChars = "min-lower-chars", e.MaxLowerChars = "max-lower-chars", e.MinSpecialChars = "min-special-chars", e.MaxSpecialChars = "max-special-chars", e))(de || {}), ve = ((e) => (e.Ok = "ok", e.Ko = "ko", e.Info = "info", e))(ve || {}), pe = ((e) => (e.StorageUnit = "unit", e.Directory = "dir", e.Image = "img", e.Video = "vid", e.File = "file", e))(pe || {}), me = ((e) => (e.H1 = "h1", e.H2 = "h2", e.H3 = "h3", e.H4 = "h4", e.H5 = "h5", e.H6 = "h6", e))(me || {}), fe = ((e) => (e.NotDefined = "", e.Button = "button", e))(fe || {}), he = ((e) => (e.Start = "start", e.End = "end", e))(he || {}), ke = ((e) => (e.Create = "create", e.Update = "update", e.Read = "read", e))(ke || {}), xe = ((e) => (e.Inline = "inline", e.Modal = "modal", e))(xe || {}), ge = ((e) => (e.Top = "top", e.Bottom = "bottom", e))(ge || {}), ye = ((e) => (e.Changed = "changed", e.Always = "always", e.Never = "never", e))(ye || {}), be = ((e) => (e.Manual = "manual", e.Auto = "auto", e.Delay = "delay", e))(be || {}), Le = ((e) => (e.Toast = "toast", e.Inline = "inline", e))(Le || {}), Be = ((e) => (e.Anchor = "anchor", e.Button = "button", e.Entry = "entry", e))(Be || {}), Ce = ((e) => (e.Modal = "modal", e.Confirm = "confirm", e))(Ce || {}), we = ((e) => (e.Pages = "pages", e.PrevNext = "prev-next", e.PagesPrevNext = "pages-prev-next", e.PagesPrevNextFirstLast = "pages-prev-next-first-last", e.LoadMore = "load-more", e.Infinite = "infinite", e))(we || {}), Ae = ((e) => (e.None = "", e.Incremental = "incremental", e.Decremental = "decremental", e))(Ae || {}), Pe = ((e) => (e.NotDefined = "", e.Hidden = "hidden", e.Integer = "integer", e.Decimal = "decimal", e.Auto = "auto", e))(Pe || {}), I, Se = (I = class extends re {
|
|
22
22
|
constructor(a = {}) {
|
|
23
23
|
super();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
u(this, "modelValue", "");
|
|
25
|
+
u(this, "loading", !1);
|
|
26
|
+
u(this, "steps", []);
|
|
27
|
+
u(this, "header", {});
|
|
28
|
+
u(this, "nextButton", {});
|
|
29
|
+
u(this, "prevButton", {});
|
|
30
30
|
this.feed(a);
|
|
31
31
|
}
|
|
32
|
-
},
|
|
33
|
-
function
|
|
34
|
-
let a = new e(),
|
|
32
|
+
}, u(I, "lktDefaultValues", ["modelValue", "loading", "steps", "header"]), I), Ie = ((e) => (e.Table = "table", e.Item = "item", e.Ul = "ul", e.Ol = "ol", e.Carousel = "carousel", e.Accordion = "accordion", e))(Ie || {}), De = ((e) => (e[e.Auto = 0] = "Auto", e[e.PreferItem = 1] = "PreferItem", e[e.PreferCustomItem = 2] = "PreferCustomItem", e[e.PreferColumns = 3] = "PreferColumns", e))(De || {}), Ee = ((e) => (e.NotDefined = "", e.ActionIcon = "action-icon", e))(Ee || {}), He = ((e) => (e.Message = "message", e.Button = "button", e))(He || {}), Me = ((e) => (e.Left = "left", e.Center = "center", e.Right = "right", e))(Me || {}), Ne = ((e) => (e.Fixed = "fixed", e.Absolute = "absolute", e))(Ne || {}), Te = ((e) => (e.Top = "top", e.Bottom = "bottom", e.Center = "center", e.ReferrerCenter = "referrer-center", e))(Te || {}), Re = ((e) => (e.Left = "left", e.Right = "right", e.Center = "center", e.LeftCorner = "left-corner", e.RightCorner = "right-corner", e))(Re || {}), _e = ((e) => (e.LktAnchor = "lkt-anchor", e.LktLayoutAccordion = "lkt-layout-accordion", e.LktTextAccordion = "lkt-text-accordion", e.LktLayoutBox = "lkt-layout-box", e.LktTextBox = "lkt-text-box", e.LktLayoutBanner = "lkt-layout-banner", e.LktTextBanner = "lkt-text-banner", e.LktButton = "lkt-button", e.LktLayout = "lkt-layout", e.LktHeader = "lkt-header", e.LktIcon = "lkt-icon", e.LktIcons = "lkt-icons", e.LktImage = "lkt-image", e.LktText = "lkt-text", e))(_e || {}), Ve = ((e) => (e.Grid = "grid", e.FlexRow = "flex-row", e.FlexRows = "flex-rows", e.FlexColumn = "flex-column", e))(Ve || {}), Fe = ((e) => (e.None = "", e.Focus = "focus", e.Blur = "blur", e.Always = "always", e))(Fe || {}), ze = ((e) => (e.Auto = "auto", e.Local = "local", e.Remote = "remote", e))(ze || {}), Ue = ((e) => (e.Refresh = "refresh", e.Close = "close", e.ReOpen = "reOpen", e.Exec = "exec", e.Open = "open", e))(Ue || {}), je = ((e) => (e.Asc = "asc", e.Desc = "desc", e))(je || {}), Oe = ((e) => (e.Create = "create", e.Update = "update", e.Edit = "edit", e.Drop = "drop", e.Sort = "sort", e.SwitchEditMode = "switch-edit-mode", e.InlineEdit = "inline-edit", e.InlineCreate = "inline-create", e.ModalCreate = "modal-create", e.InlineCreateEver = "inline-create-ever", e))(Oe || {}), qe = ((e) => (e.Lazy = "lazy", e.Ever = "ever", e))(qe || {}), $e = ((e) => (e.Page = "page", e.Element = "element", e))($e || {}), Ge = ((e) => (e.Quick = "quick", e.Full = "full", e))(Ge || {});
|
|
33
|
+
function Ke(e) {
|
|
34
|
+
let a = new e(), o = {};
|
|
35
35
|
if (!Array.isArray(e.lktDefaultValues)) throw new Error("lktDefaultValues must be a keys array.");
|
|
36
|
-
for (let
|
|
37
|
-
return
|
|
36
|
+
for (let n of e.lktDefaultValues) n in a && (o[n] = a[n]);
|
|
37
|
+
return o;
|
|
38
38
|
}
|
|
39
|
-
const
|
|
39
|
+
const Qe = { class: "lkt-step-process-buttons" }, We = {
|
|
40
40
|
key: 1,
|
|
41
41
|
class: "lkt-step-process_content"
|
|
42
|
-
},
|
|
42
|
+
}, Xe = { class: "lkt-grid-1" }, Ye = /* @__PURE__ */ $({
|
|
43
43
|
__name: "LktStepProcess",
|
|
44
|
-
props: /* @__PURE__ */
|
|
44
|
+
props: /* @__PURE__ */ G({
|
|
45
45
|
modelValue: {},
|
|
46
46
|
loading: { type: Boolean },
|
|
47
47
|
steps: {},
|
|
48
48
|
header: {},
|
|
49
49
|
nextButton: {},
|
|
50
50
|
prevButton: {}
|
|
51
|
-
},
|
|
51
|
+
}, Ke(Se)),
|
|
52
52
|
emits: [
|
|
53
53
|
"next",
|
|
54
54
|
"prev",
|
|
@@ -56,82 +56,96 @@ const We = { class: "lkt-step-process-buttons" }, Xe = {
|
|
|
56
56
|
"update:modelValue",
|
|
57
57
|
"update:loading"
|
|
58
58
|
],
|
|
59
|
-
setup(e, { expose: a, emit:
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
const
|
|
59
|
+
setup(e, { expose: a, emit: o }) {
|
|
60
|
+
const n = e, C = K(), x = o, p = g(n.loading), s = g(n.modelValue), c = g(n.steps), D = g(null), E = g(null);
|
|
61
|
+
b(() => n.loading, (t) => p.value = t), b(() => n.modelValue, (t) => s.value = t), b(p, (t) => x("update:loading", t)), b(s, (t) => x("update:modelValue", t));
|
|
62
|
+
const R = v(() => {
|
|
63
63
|
let t = [];
|
|
64
|
-
for (let
|
|
64
|
+
for (let l in C) l.indexOf("step-") !== -1 && t.push(l.substring(5));
|
|
65
65
|
return t;
|
|
66
|
-
}),
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
66
|
+
}), k = v(() => c.value.findIndex((t) => t.key === s.value)), r = v(() => c.value[k.value]), _ = v(() => k.value === 0), H = v(() => {
|
|
67
|
+
var l, d, m, h;
|
|
68
|
+
if (((l = r.value) == null ? void 0 : l.prevButton) === !1 || n.prevButton === !1 && !((d = r.value) != null && d.prevButton))
|
|
69
|
+
return !1;
|
|
70
|
+
let t = { ...n.prevButton };
|
|
71
|
+
return typeof ((m = r.value) == null ? void 0 : m.prevButton) == "object" && (t = { ...t, ...(h = r.value) == null ? void 0 : h.prevButton }), typeof t.disabled > "u" && (t.disabled = _.value), t;
|
|
72
|
+
}), M = v(() => {
|
|
73
|
+
var l, d, m, h;
|
|
74
|
+
if (((l = r.value) == null ? void 0 : l.nextButton) === !1 || n.nextButton === !1 && !((d = r.value) != null && d.nextButton))
|
|
75
|
+
return !1;
|
|
76
|
+
let t = { ...n.nextButton };
|
|
77
|
+
return typeof ((m = r.value) == null ? void 0 : m.nextButton) == "object" && (t = { ...t, ...(h = r.value) == null ? void 0 : h.nextButton }), t;
|
|
78
|
+
}), V = v(() => {
|
|
79
|
+
var t, l;
|
|
80
|
+
if (typeof r.value == "object") {
|
|
81
|
+
if (typeof ((t = r.value) == null ? void 0 : t.prevHidden) == "function")
|
|
82
|
+
return r.value.prevHidden(r.value, c.value);
|
|
83
|
+
if (typeof ((l = r.value) == null ? void 0 : l.prevHidden) == "boolean")
|
|
84
|
+
return r.value.prevHidden;
|
|
85
|
+
}
|
|
86
|
+
return k.value === 0;
|
|
87
|
+
}), F = v(() => {
|
|
88
|
+
var t, l, d;
|
|
89
|
+
return typeof r.value == "object" ? typeof ((t = r.value) == null ? void 0 : t.nextHidden) == "function" ? r.value.nextHidden(r.value, c.value) : typeof ((l = r.value) == null ? void 0 : l.nextHidden) == "boolean" ? r.value.nextHidden : ((d = r.value) == null ? void 0 : d.nextButton) === !1 : !0;
|
|
90
|
+
}), z = v(() => {
|
|
81
91
|
const t = [];
|
|
82
|
-
return
|
|
83
|
-
}),
|
|
84
|
-
|
|
92
|
+
return s.value && t.push(`step-${s.value}`), t.join(" ");
|
|
93
|
+
}), U = (t) => {
|
|
94
|
+
s.value = c.value[k.value + 1].key, k.value === c.value.length - 1 ? x("finish", t) : x("next", t);
|
|
85
95
|
}, j = (t) => {
|
|
86
|
-
|
|
96
|
+
s.value = c.value[k.value - 1].key, x("prev", t);
|
|
87
97
|
};
|
|
88
98
|
return a({
|
|
89
99
|
goNext: () => {
|
|
90
|
-
|
|
100
|
+
E.value.click();
|
|
91
101
|
},
|
|
92
102
|
goPrev: () => {
|
|
93
|
-
|
|
103
|
+
D.value.click();
|
|
94
104
|
},
|
|
95
|
-
startLoader: () =>
|
|
96
|
-
stopLoader: () =>
|
|
97
|
-
}), (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
105
|
+
startLoader: () => p.value = !0,
|
|
106
|
+
stopLoader: () => p.value = !1
|
|
107
|
+
}), Q(() => {
|
|
108
|
+
!s.value && c.value.length > 0 && (s.value = c.value[0].key);
|
|
109
|
+
}), (t, l) => {
|
|
110
|
+
const d = w("lkt-header"), m = w("lkt-button"), h = w("lkt-loader");
|
|
111
|
+
return f(), L("article", {
|
|
112
|
+
class: W(["lkt-step-process", z.value])
|
|
101
113
|
}, [
|
|
102
|
-
t.header && Object.keys(t.header).length > 0 ? (
|
|
103
|
-
|
|
104
|
-
|
|
114
|
+
t.header && Object.keys(t.header).length > 0 ? (f(), B(d, X(A({ key: 0 }, t.header)), null, 16)) : y("", !0),
|
|
115
|
+
T("div", Qe, [
|
|
116
|
+
H.value ? P((f(), B(m, A({
|
|
117
|
+
key: 0,
|
|
105
118
|
ref_key: "prevButtonRef",
|
|
106
|
-
ref:
|
|
107
|
-
},
|
|
108
|
-
[
|
|
109
|
-
]),
|
|
110
|
-
|
|
119
|
+
ref: D
|
|
120
|
+
}, H.value, { onClick: j }), null, 16)), [
|
|
121
|
+
[S, !p.value && !V.value]
|
|
122
|
+
]) : y("", !0),
|
|
123
|
+
M.value ? P((f(), B(m, A({
|
|
124
|
+
key: 1,
|
|
111
125
|
ref_key: "nextButtonRef",
|
|
112
|
-
ref:
|
|
113
|
-
},
|
|
114
|
-
[
|
|
115
|
-
])
|
|
126
|
+
ref: E
|
|
127
|
+
}, M.value, { onClick: U }), null, 16)), [
|
|
128
|
+
[S, !p.value && !F.value]
|
|
129
|
+
]) : y("", !0)
|
|
116
130
|
]),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
(
|
|
120
|
-
|
|
131
|
+
p.value ? y("", !0) : (f(), L("div", We, [
|
|
132
|
+
T("div", Xe, [
|
|
133
|
+
(f(!0), L(Y, null, Z(R.value, (N) => P((f(), L("div", null, [
|
|
134
|
+
J(t.$slots, "step-" + N, { config: c.value })
|
|
121
135
|
], 512)), [
|
|
122
|
-
[
|
|
136
|
+
[S, N === s.value]
|
|
123
137
|
])), 256))
|
|
124
138
|
])
|
|
125
139
|
])),
|
|
126
|
-
|
|
140
|
+
p.value ? (f(), B(h, { key: 2 })) : y("", !0)
|
|
127
141
|
], 2);
|
|
128
142
|
};
|
|
129
143
|
}
|
|
130
|
-
}),
|
|
144
|
+
}), tt = {
|
|
131
145
|
install: (e, a = {}) => {
|
|
132
|
-
e.component("lkt-step-process",
|
|
146
|
+
e.component("lkt-step-process", Ye);
|
|
133
147
|
}
|
|
134
148
|
};
|
|
135
149
|
export {
|
|
136
|
-
|
|
150
|
+
tt as default
|
|
137
151
|
};
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, ref, useSlots, watch } from 'vue';
|
|
2
|
+
import { computed, onMounted, ref, useSlots, watch } from 'vue';
|
|
3
3
|
import {
|
|
4
4
|
ButtonConfig,
|
|
5
5
|
getDefaultValues,
|
|
@@ -46,12 +46,17 @@
|
|
|
46
46
|
prevDisabled = computed(() => {
|
|
47
47
|
return currentStepIndex.value === 0;
|
|
48
48
|
}),
|
|
49
|
-
nextDisabled = computed(() => {
|
|
50
|
-
return currentStepIndex.value === (stepsHaystack.value.length - 1);
|
|
51
|
-
}),
|
|
52
49
|
computedPrevButton = computed(() => {
|
|
50
|
+
if (currentStepConfig.value?.prevButton === false) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (props.prevButton === false && !currentStepConfig.value?.prevButton) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
|
|
53
58
|
let r: ButtonConfig = { ...props.prevButton };
|
|
54
|
-
if (currentStepConfig.value?.prevButton) {
|
|
59
|
+
if (typeof currentStepConfig.value?.prevButton === 'object') {
|
|
55
60
|
r = { ...r, ...currentStepConfig.value?.prevButton };
|
|
56
61
|
}
|
|
57
62
|
if (typeof r.disabled === 'undefined') {
|
|
@@ -60,32 +65,42 @@
|
|
|
60
65
|
return r;
|
|
61
66
|
}),
|
|
62
67
|
computedNextButton = computed(() => {
|
|
68
|
+
if (currentStepConfig.value?.nextButton === false) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (props.nextButton === false && !currentStepConfig.value?.nextButton) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
|
|
63
76
|
let r: ButtonConfig = { ...props.nextButton };
|
|
64
|
-
if (currentStepConfig.value?.nextButton) {
|
|
77
|
+
if (typeof currentStepConfig.value?.nextButton === 'object') {
|
|
65
78
|
r = { ...r, ...currentStepConfig.value?.nextButton };
|
|
66
79
|
}
|
|
67
|
-
if (typeof r.disabled === 'undefined') {
|
|
68
|
-
r.disabled = nextDisabled.value;
|
|
69
|
-
}
|
|
70
80
|
return r;
|
|
71
81
|
}),
|
|
72
82
|
prevHidden = computed(() => {
|
|
73
|
-
if (typeof currentStepConfig.value
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
if (typeof currentStepConfig.value === 'object'){
|
|
84
|
+
if (typeof currentStepConfig.value?.prevHidden === 'function') {
|
|
85
|
+
return currentStepConfig.value.prevHidden(currentStepConfig.value, stepsHaystack.value);
|
|
86
|
+
}
|
|
87
|
+
if (typeof currentStepConfig.value?.prevHidden === 'boolean') {
|
|
88
|
+
return currentStepConfig.value.prevHidden;
|
|
89
|
+
}
|
|
78
90
|
}
|
|
79
91
|
return currentStepIndex.value === 0;
|
|
80
92
|
}),
|
|
81
93
|
nextHidden = computed(() => {
|
|
82
|
-
if (typeof currentStepConfig.value
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
94
|
+
if (typeof currentStepConfig.value === 'object') {
|
|
95
|
+
if (typeof currentStepConfig.value?.nextHidden === 'function') {
|
|
96
|
+
return currentStepConfig.value.nextHidden(currentStepConfig.value, stepsHaystack.value);
|
|
97
|
+
}
|
|
98
|
+
if (typeof currentStepConfig.value?.nextHidden === 'boolean') {
|
|
99
|
+
return currentStepConfig.value.nextHidden;
|
|
100
|
+
}
|
|
101
|
+
return currentStepConfig.value?.nextButton === false;
|
|
87
102
|
}
|
|
88
|
-
return
|
|
103
|
+
return true;
|
|
89
104
|
}),
|
|
90
105
|
classes = computed(() => {
|
|
91
106
|
const r = [];
|
|
@@ -120,6 +135,10 @@
|
|
|
120
135
|
startLoader: () => isLoading.value = true,
|
|
121
136
|
stopLoader: () => isLoading.value = false,
|
|
122
137
|
});
|
|
138
|
+
|
|
139
|
+
onMounted(() => {
|
|
140
|
+
if (!currentStep.value && stepsHaystack.value.length > 0) currentStep.value = stepsHaystack.value[0].key
|
|
141
|
+
})
|
|
123
142
|
</script>
|
|
124
143
|
|
|
125
144
|
<template>
|
|
@@ -129,12 +148,14 @@
|
|
|
129
148
|
<div class="lkt-step-process-buttons">
|
|
130
149
|
<lkt-button
|
|
131
150
|
ref="prevButtonRef"
|
|
151
|
+
v-if="computedPrevButton"
|
|
132
152
|
v-show="!isLoading && !prevHidden"
|
|
133
153
|
v-bind="computedPrevButton"
|
|
134
154
|
v-on:click="onPrev"
|
|
135
155
|
/>
|
|
136
156
|
<lkt-button
|
|
137
157
|
ref="nextButtonRef"
|
|
158
|
+
v-if="computedNextButton"
|
|
138
159
|
v-show="!isLoading && !nextHidden"
|
|
139
160
|
v-bind="computedNextButton"
|
|
140
161
|
v-on:click="onNext"
|