lkt-step-process 2.0.6 → 2.0.7
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.css +1 -1
- package/dist/build.d.ts +2 -2
- package/dist/build.js +157 -128
- package/dist/components/ButtonNav.vue.d.ts +5 -2
- package/dist/config/ButtonNavProps.d.ts +2 -0
- package/dist/lib-components/LktStepProcess.vue.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/ButtonNav.vue +42 -15
- package/src/lib-components/LktStepProcess.vue +14 -12
package/dist/build.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.lkt-step-process{display:flex;flex-direction:column;gap:
|
|
1
|
+
.lkt-step-process{display:flex;flex-direction:column;gap:var(--lkt-step-process--gap)}.lkt-step-process--content{display:flex;flex-direction:column;gap:var(--lkt-step-process--content--gap)}.lkt-step-process--nav{background:var(--lkt-step-process--nav--background);gap:var(--lkt-step-process--nav--gap);padding:var(--lkt-step-process--nav--padding);font-size:var(--lkt-step-process--nav--font-size);line-height:var(--lkt-step-process--nav--line-height);display:flex;align-items:center;justify-content:stretch;transition:all linear .15s;z-index:2;-webkit-user-select:none;user-select:none}.lkt-step-process--nav-info{display:flex;flex-direction:column}.lkt-step-process--dots{gap:var(--lkt-step-process--dots--gap);display:flex;flex-direction:row;justify-content:center}
|
package/dist/build.d.ts
CHANGED
package/dist/build.js
CHANGED
|
@@ -1,45 +1,48 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as
|
|
1
|
+
var oe = Object.defineProperty;
|
|
2
|
+
var le = (e, a, l) => a in e ? oe(e, a, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[a] = l;
|
|
3
|
+
var i = (e, a, l) => le(e, typeof a != "symbol" ? a + "" : a, l);
|
|
4
|
+
import { defineComponent as K, useSlots as Q, ref as N, resolveComponent as M, createElementBlock as g, openBlock as s, withDirectives as E, createCommentVNode as h, createElementVNode as J, createBlock as L, mergeProps as C, vShow as O, renderSlot as A, unref as V, normalizeProps as D, Fragment as W, renderList as Y, mergeDefaults as ue, watch as I, computed as p, onMounted as ie, normalizeClass as se, createSlots as $, withCtx as U, guardReactiveProps as G } from "vue";
|
|
5
5
|
import "lkt-string-tools";
|
|
6
6
|
import "lkt-data-state";
|
|
7
|
-
var
|
|
7
|
+
var de = ((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))(de || {}), ve = ((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.Time = "time", e.DateTime = "datetime", e.File = "file", e.Image = "image", e.Select = "select", e.Check = "check", e.Switch = "switch", e.Calc = "calc", e.Card = "card", e.Table = "table", e.Radio = "radio", e.ToggleButtonGroup = "toggle-button-group", e))(ve || {}), ce = ["lktDateProps", "lktStrictItem", "lktExcludedProps"], v, pe = (v = class {
|
|
8
8
|
constructor(a) {
|
|
9
9
|
}
|
|
10
|
-
feed(a = {},
|
|
11
|
-
if (typeof a == "object") for (let [
|
|
10
|
+
feed(a = {}, l = this) {
|
|
11
|
+
if (typeof a == "object") for (let [n, y] of Object.entries(a)) l.assignProp(n, y);
|
|
12
12
|
}
|
|
13
|
-
assignProp(a,
|
|
14
|
-
if (!(
|
|
15
|
-
if (
|
|
16
|
-
this[a] = new Date(
|
|
13
|
+
assignProp(a, l) {
|
|
14
|
+
if (!(ce.includes(a) || v.lktExcludedProps.includes(a))) {
|
|
15
|
+
if (v.lktDateProps.includes(a)) {
|
|
16
|
+
this[a] = new Date(l);
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
this[a] =
|
|
19
|
+
this[a] = l;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
},
|
|
22
|
+
}, i(v, "lktAllowUndefinedProps", []), i(v, "lktExcludedProps", []), i(v, "lktDateProps", []), i(v, "lktStrictItem", !1), i(v, "lktDefaultValues", []), v), me = ((e) => (e.Auto = "auto", e.Always = "always", e.Lazy = "lazy", e.Ever = "ever", e))(me || {}), fe = ((e) => (e.Transform = "transform", e.Height = "height", e.Display = "display", e))(fe || {}), ke = ((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))(ke || {}), he = ((e) => (e.Static = "static", e.Parallax = "parallax", e))(he || {}), xe = ((e) => (e.None = "", e.Field = "field", e.Button = "button", e.Anchor = "anchor", e.InlineDrop = "inline-drop", e.ColumnIndex = "column-index", e))(xe || {}), ye = ((e) => (e.Date = "date", e.Number = "number", e.Timer = "timer", e))(ye || {}), be = ((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))(be || {}), Se = ((e) => (e.List = "list", e.Inline = "inline", e.Count = "count", e.Table = "table", e))(Se || {}), Be = ((e) => (e.HTTPResponse = "http-response", 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))(Be || {}), ge = ((e) => (e.Ok = "ok", e.Ko = "ko", e.Info = "info", e))(ge || {}), Le = ((e) => (e.StorageUnit = "unit", e.Directory = "dir", e.Image = "img", e.Video = "vid", e.File = "file", e))(Le || {}), Ce = ((e) => (e.H1 = "h1", e.H2 = "h2", e.H3 = "h3", e.H4 = "h4", e.H5 = "h5", e.H6 = "h6", e))(Ce || {}), Ne = ((e) => (e.NotDefined = "", e.Button = "button", e))(Ne || {}), Pe = ((e) => (e.Start = "start", e.End = "end", e))(Pe || {}), we = ((e) => (e.Create = "create", e.Update = "update", e.Read = "read", e))(we || {}), Ie = ((e) => (e.Inline = "inline", e.Modal = "modal", e))(Ie || {}), _ = ((e) => (e.Top = "top", e.Bottom = "bottom", e))(_ || {}), F = ((e) => (e.Changed = "changed", e.Always = "always", e.Never = "never", e))(F || {}), Ae = ((e) => (e.Manual = "manual", e.Auto = "auto", e.Delay = "delay", e))(Ae || {}), De = ((e) => (e.Toast = "toast", e.Inline = "inline", e))(De || {}), Me = ((e) => (e.Current = "current", e.Modifications = "modifications", e.SplitView = "split-view", e.Differences = "differences", e))(Me || {}), Te = ((e) => (e.Anchor = "anchor", e.Button = "button", e.Header = "header", e.Entry = "entry", e))(Te || {}), Re = ((e) => (e.Modal = "modal", e.Confirm = "confirm", e))(Re || {}), He = ((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))(He || {}), Ee = ((e) => (e.None = "", e.Incremental = "incremental", e.Decremental = "decremental", e))(Ee || {}), Oe = ((e) => (e.NotDefined = "", e.Hidden = "hidden", e.Integer = "integer", e.Decimal = "decimal", e.Auto = "auto", e))(Oe || {}), H, Ve = (H = class extends pe {
|
|
23
23
|
constructor(a = {}) {
|
|
24
24
|
super();
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
i(this, "modelValue", "");
|
|
26
|
+
i(this, "loading", !1);
|
|
27
|
+
i(this, "steps", []);
|
|
28
|
+
i(this, "header", {});
|
|
29
|
+
i(this, "nextButton", {});
|
|
30
|
+
i(this, "prevButton", {});
|
|
31
|
+
i(this, "buttonNavPosition", "top");
|
|
32
|
+
i(this, "buttonNavVisibility", "always");
|
|
33
33
|
this.feed(a);
|
|
34
34
|
}
|
|
35
|
-
},
|
|
36
|
-
function
|
|
37
|
-
let a = new e(),
|
|
35
|
+
}, i(H, "lktDefaultValues", ["modelValue", "loading", "steps", "header", "nextButton", "prevButton", "buttonNavPosition", "buttonNavVisibility"]), H), _e = ((e) => (e.Table = "table", e.Item = "item", e.Ul = "ul", e.Ol = "ol", e.Carousel = "carousel", e.Accordion = "accordion", e))(_e || {}), Fe = ((e) => (e[e.Auto = 0] = "Auto", e[e.PreferItem = 1] = "PreferItem", e[e.PreferCustomItem = 2] = "PreferCustomItem", e[e.PreferColumns = 3] = "PreferColumns", e))(Fe || {}), Xe = ((e) => (e.NotDefined = "", e.ActionIcon = "action-icon", e))(Xe || {}), je = ((e) => (e.Message = "message", e.Button = "button", e))(je || {}), ze = ((e) => (e.Left = "left", e.Center = "center", e.Right = "right", e))(ze || {}), $e = ((e) => (e.Fixed = "fixed", e.Absolute = "absolute", e))($e || {}), Ue = ((e) => (e.Top = "top", e.Bottom = "bottom", e.Center = "center", e.ReferrerCenter = "referrer-center", e))(Ue || {}), Ge = ((e) => (e.Left = "left", e.Right = "right", e.Center = "center", e.LeftCorner = "left-corner", e.RightCorner = "right-corner", e))(Ge || {}), qe = ((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))(qe || {}), Ke = ((e) => (e.Grid = "grid", e.FlexRow = "flex-row", e.FlexRows = "flex-rows", e.FlexColumn = "flex-column", e))(Ke || {}), Qe = ((e) => (e.Draft = "draft", e.Public = "public", e.Scheduled = "scheduled", e))(Qe || {}), Je = ((e) => (e[e.XXS = 1] = "XXS", e[e.XS = 2] = "XS", e[e.SM = 3] = "SM", e[e.MD = 4] = "MD", e[e.LG = 5] = "LG", e[e.XL = 6] = "XL", e[e.XXL = 7] = "XXL", e))(Je || {}), We = ((e) => (e.None = "", e.Focus = "focus", e.Blur = "blur", e.Always = "always", e))(We || {}), Ye = ((e) => (e.Message = "message", e.Inline = "inline", e))(Ye || {}), Ze = ((e) => (e.Auto = "auto", e.Local = "local", e.Remote = "remote", e))(Ze || {}), et = ((e) => (e.Refresh = "refresh", e.Close = "close", e.ReOpen = "reOpen", e.Exec = "exec", e.Open = "open", e))(et || {}), tt = ((e) => (e.Asc = "asc", e.Desc = "desc", e))(tt || {}), at = ((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))(at || {}), rt = ((e) => (e.Lazy = "lazy", e.Ever = "ever", e))(rt || {}), nt = ((e) => (e.Page = "page", e.Element = "element", e))(nt || {}), ot = ((e) => (e.Quick = "quick", e.Full = "full", e))(ot || {});
|
|
36
|
+
function lt(e) {
|
|
37
|
+
let a = new e(), l = {};
|
|
38
38
|
if (!Array.isArray(e.lktDefaultValues)) throw new Error("lktDefaultValues must be a keys array.");
|
|
39
|
-
for (let
|
|
40
|
-
return
|
|
39
|
+
for (let n of e.lktDefaultValues) n in a && (l[n] = a[n]);
|
|
40
|
+
return l;
|
|
41
41
|
}
|
|
42
|
-
const
|
|
42
|
+
const ut = { class: "lkt-step-process--nav" }, it = { class: "lkt-step-process--nav-info" }, st = {
|
|
43
|
+
key: 1,
|
|
44
|
+
class: "lkt-step-process--dots"
|
|
45
|
+
}, q = /* @__PURE__ */ K({
|
|
43
46
|
__name: "ButtonNav",
|
|
44
47
|
props: {
|
|
45
48
|
prevButton: { type: [Object, Boolean] },
|
|
@@ -47,44 +50,65 @@ const it = { class: "lkt-step-process-buttons" }, $ = /* @__PURE__ */ G({
|
|
|
47
50
|
isLoading: { type: Boolean },
|
|
48
51
|
currentStep: {},
|
|
49
52
|
currentStepIndex: {},
|
|
50
|
-
amountOfSteps: {}
|
|
53
|
+
amountOfSteps: {},
|
|
54
|
+
dots: { type: Boolean },
|
|
55
|
+
dotsNumbers: { type: Boolean }
|
|
51
56
|
},
|
|
52
57
|
emits: ["prev", "next"],
|
|
53
|
-
setup(e, {
|
|
54
|
-
const
|
|
55
|
-
return (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
setup(e, { expose: a, emit: l }) {
|
|
59
|
+
const n = l, y = Q(), x = N(null), m = N(null);
|
|
60
|
+
return a({
|
|
61
|
+
goNext: () => {
|
|
62
|
+
m.value.click();
|
|
63
|
+
},
|
|
64
|
+
goPrev: () => {
|
|
65
|
+
x.value.click();
|
|
66
|
+
}
|
|
67
|
+
}), (r, u) => {
|
|
68
|
+
const P = M("lkt-button"), T = M("lkt-dot");
|
|
69
|
+
return s(), g("div", ut, [
|
|
70
|
+
r.prevButton ? E((s(), L(P, C({
|
|
59
71
|
key: 0,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
72
|
+
ref_key: "prevButtonRef",
|
|
73
|
+
ref: x
|
|
74
|
+
}, r.prevButton, {
|
|
75
|
+
class: "is-prev-button",
|
|
76
|
+
onClick: u[0] || (u[0] = (c) => n("prev"))
|
|
63
77
|
}), null, 16)), [
|
|
64
|
-
[
|
|
65
|
-
]) :
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
[O, !r.isLoading]
|
|
79
|
+
]) : h("", !0),
|
|
80
|
+
J("div", it, [
|
|
81
|
+
V(y)["nav-info"] ? A(r.$slots, "nav-info", D(C({ key: 0 }, {
|
|
82
|
+
currentStep: r.currentStep,
|
|
83
|
+
currentStepIndex: r.currentStepIndex,
|
|
84
|
+
amountOfSteps: r.amountOfSteps
|
|
85
|
+
}))) : h("", !0),
|
|
86
|
+
r.dots && r.amountOfSteps > 0 ? (s(), g("div", st, [
|
|
87
|
+
(s(!0), g(W, null, Y(r.amountOfSteps, (c) => (s(), L(T, C({ ref_for: !0 }, {
|
|
88
|
+
text: r.dotsNumbers ? c : "",
|
|
89
|
+
class: c === r.currentStepIndex + 1 ? "is-active" : ""
|
|
90
|
+
}), null, 16))), 256))
|
|
91
|
+
])) : h("", !0)
|
|
92
|
+
]),
|
|
93
|
+
r.nextButton ? E((s(), L(P, C({
|
|
94
|
+
key: 1,
|
|
95
|
+
ref_key: "nextButtonRef",
|
|
96
|
+
ref: m
|
|
97
|
+
}, r.nextButton, {
|
|
98
|
+
class: "is-next-button",
|
|
99
|
+
onClick: u[1] || (u[1] = (c) => n("next"))
|
|
76
100
|
}), null, 16)), [
|
|
77
|
-
[
|
|
78
|
-
]) :
|
|
101
|
+
[O, !r.isLoading]
|
|
102
|
+
]) : h("", !0)
|
|
79
103
|
]);
|
|
80
104
|
};
|
|
81
105
|
}
|
|
82
|
-
}),
|
|
106
|
+
}), dt = {
|
|
83
107
|
key: 2,
|
|
84
|
-
class: "lkt-step-
|
|
85
|
-
},
|
|
108
|
+
class: "lkt-step-process--content"
|
|
109
|
+
}, vt = { class: "lkt-grid-1" }, ct = /* @__PURE__ */ K({
|
|
86
110
|
__name: "LktStepProcess",
|
|
87
|
-
props: /* @__PURE__ */
|
|
111
|
+
props: /* @__PURE__ */ ue({
|
|
88
112
|
modelValue: {},
|
|
89
113
|
loading: { type: Boolean },
|
|
90
114
|
steps: {},
|
|
@@ -92,8 +116,10 @@ const it = { class: "lkt-step-process-buttons" }, $ = /* @__PURE__ */ G({
|
|
|
92
116
|
nextButton: {},
|
|
93
117
|
prevButton: {},
|
|
94
118
|
buttonNavPosition: {},
|
|
95
|
-
buttonNavVisibility: {}
|
|
96
|
-
|
|
119
|
+
buttonNavVisibility: {},
|
|
120
|
+
dots: { type: Boolean },
|
|
121
|
+
dotsNumbers: { type: Boolean }
|
|
122
|
+
}, lt(Ve)),
|
|
97
123
|
emits: [
|
|
98
124
|
"next",
|
|
99
125
|
"prev",
|
|
@@ -101,106 +127,109 @@ const it = { class: "lkt-step-process-buttons" }, $ = /* @__PURE__ */ G({
|
|
|
101
127
|
"update:modelValue",
|
|
102
128
|
"update:loading"
|
|
103
129
|
],
|
|
104
|
-
setup(e, { expose: a, emit:
|
|
105
|
-
const
|
|
106
|
-
I(() =>
|
|
107
|
-
const
|
|
130
|
+
setup(e, { expose: a, emit: l }) {
|
|
131
|
+
const n = e, y = Q(), x = l, m = N(n.loading), r = N(n.modelValue), u = N(n.steps), P = N(null);
|
|
132
|
+
I(() => n.loading, (t) => m.value = t), I(() => n.modelValue, (t) => r.value = t), I(m, (t) => x("update:loading", t)), I(r, (t) => x("update:modelValue", t));
|
|
133
|
+
const T = p(() => {
|
|
108
134
|
let t = [];
|
|
109
|
-
for (let
|
|
135
|
+
for (let f in y) f.indexOf("step-") !== -1 && t.push(f.substring(5));
|
|
110
136
|
return t;
|
|
111
|
-
}),
|
|
112
|
-
var
|
|
113
|
-
if (((
|
|
137
|
+
}), c = p(() => u.value.findIndex((t) => t.key === r.value)), o = p(() => u.value[c.value]), Z = p(() => c.value === 0), ee = p(() => {
|
|
138
|
+
var f, b, S, d, k, B, w;
|
|
139
|
+
if (((f = o.value) == null ? void 0 : f.prevButton) === !1 || n.prevButton === !1 && !((b = o.value) != null && b.prevButton) || typeof o.value == "object" && (typeof ((S = o.value) == null ? void 0 : S.prevHidden) == "function" && o.value.prevHidden(o.value, u.value) || typeof ((d = o.value) == null ? void 0 : d.prevHidden) == "boolean" && ((k = o.value) == null ? void 0 : k.prevHidden) === !0))
|
|
114
140
|
return !1;
|
|
115
|
-
let t = { ...
|
|
116
|
-
return typeof ((
|
|
117
|
-
}),
|
|
118
|
-
var
|
|
119
|
-
if (((
|
|
141
|
+
let t = { ...n.prevButton };
|
|
142
|
+
return typeof ((B = o.value) == null ? void 0 : B.prevButton) == "object" && (t = { ...t, ...(w = o.value) == null ? void 0 : w.prevButton }), typeof t.disabled > "u" && (t.disabled = Z.value), t;
|
|
143
|
+
}), te = p(() => {
|
|
144
|
+
var f, b, S, d, k, B, w;
|
|
145
|
+
if (((f = o.value) == null ? void 0 : f.nextButton) === !1 || n.nextButton === !1 && !((b = o.value) != null && b.nextButton) || typeof o.value == "object" && (typeof ((S = o.value) == null ? void 0 : S.nextHidden) == "function" && o.value.nextHidden(o.value, u.value) || typeof ((d = o.value) == null ? void 0 : d.nextHidden) == "boolean" && ((k = o.value) == null ? void 0 : k.nextHidden) === !0))
|
|
120
146
|
return !1;
|
|
121
|
-
let t = { ...
|
|
122
|
-
return typeof ((
|
|
123
|
-
}),
|
|
147
|
+
let t = { ...n.nextButton };
|
|
148
|
+
return typeof ((B = o.value) == null ? void 0 : B.nextButton) == "object" && (t = { ...t, ...(w = o.value) == null ? void 0 : w.nextButton }), t;
|
|
149
|
+
}), ae = p(() => {
|
|
124
150
|
const t = [];
|
|
125
|
-
return
|
|
126
|
-
}),
|
|
127
|
-
isLoading:
|
|
128
|
-
prevButton:
|
|
129
|
-
nextButton:
|
|
130
|
-
currentStep:
|
|
131
|
-
currentStepIndex:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
151
|
+
return r.value && t.push(`step-${r.value}`), t.join(" ");
|
|
152
|
+
}), re = p(() => n.buttonNavVisibility === F.Never ? !1 : !n.buttonNavPosition || n.buttonNavPosition === _.Top), ne = p(() => n.buttonNavVisibility === F.Never ? !1 : n.buttonNavPosition === _.Bottom), R = p(() => u.value.length), X = p(() => ({
|
|
153
|
+
isLoading: m.value,
|
|
154
|
+
prevButton: ee.value,
|
|
155
|
+
nextButton: te.value,
|
|
156
|
+
currentStep: r.value,
|
|
157
|
+
currentStepIndex: c.value,
|
|
158
|
+
amountOfSteps: R.value,
|
|
159
|
+
dots: n.dots,
|
|
160
|
+
dotsNumbers: n.dotsNumbers
|
|
161
|
+
})), j = (t) => {
|
|
162
|
+
r.value = u.value[c.value + 1].key, c.value === u.value.length - 1 ? x("finish", t) : x("next", t);
|
|
163
|
+
}, z = (t) => {
|
|
164
|
+
r.value = u.value[c.value - 1].key, x("prev", t);
|
|
136
165
|
};
|
|
137
166
|
return a({
|
|
138
167
|
goNext: () => {
|
|
139
|
-
|
|
168
|
+
P.value.click();
|
|
140
169
|
},
|
|
141
170
|
goPrev: () => {
|
|
142
|
-
|
|
171
|
+
P.value.click();
|
|
143
172
|
},
|
|
144
|
-
startLoader: () =>
|
|
145
|
-
stopLoader: () =>
|
|
146
|
-
}),
|
|
147
|
-
!
|
|
148
|
-
}), (t,
|
|
149
|
-
const b = M("lkt-header"),
|
|
150
|
-
return
|
|
151
|
-
class:
|
|
173
|
+
startLoader: () => m.value = !0,
|
|
174
|
+
stopLoader: () => m.value = !1
|
|
175
|
+
}), ie(() => {
|
|
176
|
+
!r.value && u.value.length > 0 && (r.value = u.value[0].key);
|
|
177
|
+
}), (t, f) => {
|
|
178
|
+
const b = M("lkt-header"), S = M("lkt-loader");
|
|
179
|
+
return s(), g("article", {
|
|
180
|
+
class: se(["lkt-step-process", ae.value])
|
|
152
181
|
}, [
|
|
153
|
-
t.header && Object.keys(t.header).length > 0 ? (
|
|
154
|
-
|
|
155
|
-
onPrev:
|
|
156
|
-
onNext:
|
|
157
|
-
}),
|
|
158
|
-
|
|
159
|
-
name: "
|
|
160
|
-
fn:
|
|
161
|
-
|
|
162
|
-
currentStep:
|
|
163
|
-
currentStepIndex:
|
|
164
|
-
amountOfSteps:
|
|
182
|
+
t.header && Object.keys(t.header).length > 0 ? (s(), L(b, D(C({ key: 0 }, t.header)), null, 16)) : h("", !0),
|
|
183
|
+
re.value ? (s(), L(q, C({ key: 1 }, X.value, {
|
|
184
|
+
onPrev: z,
|
|
185
|
+
onNext: j
|
|
186
|
+
}), $({ _: 2 }, [
|
|
187
|
+
V(y)["nav-info"] ? {
|
|
188
|
+
name: "nav-info",
|
|
189
|
+
fn: U(({ currentStep: d, currentStepIndex: k, amountOfSteps: B }) => [
|
|
190
|
+
A(t.$slots, "nav-info", D(G({
|
|
191
|
+
currentStep: d,
|
|
192
|
+
currentStepIndex: k,
|
|
193
|
+
amountOfSteps: R.value
|
|
165
194
|
})))
|
|
166
195
|
]),
|
|
167
196
|
key: "0"
|
|
168
197
|
} : void 0
|
|
169
|
-
]), 1040)) :
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
(
|
|
173
|
-
|
|
198
|
+
]), 1040)) : h("", !0),
|
|
199
|
+
m.value ? h("", !0) : (s(), g("div", dt, [
|
|
200
|
+
J("div", vt, [
|
|
201
|
+
(s(!0), g(W, null, Y(T.value, (d) => E((s(), g("div", null, [
|
|
202
|
+
A(t.$slots, "step-" + d, { config: u.value })
|
|
174
203
|
], 512)), [
|
|
175
|
-
[
|
|
204
|
+
[O, d === r.value]
|
|
176
205
|
])), 256))
|
|
177
206
|
])
|
|
178
207
|
])),
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
onPrev:
|
|
182
|
-
onNext:
|
|
183
|
-
}),
|
|
184
|
-
|
|
185
|
-
name: "
|
|
186
|
-
fn:
|
|
187
|
-
|
|
188
|
-
currentStep:
|
|
189
|
-
currentStepIndex:
|
|
190
|
-
amountOfSteps:
|
|
208
|
+
m.value ? (s(), L(S, { key: 3 })) : h("", !0),
|
|
209
|
+
ne.value ? (s(), L(q, C({ key: 4 }, X.value, {
|
|
210
|
+
onPrev: z,
|
|
211
|
+
onNext: j
|
|
212
|
+
}), $({ _: 2 }, [
|
|
213
|
+
V(y)["nav-info"] ? {
|
|
214
|
+
name: "nav-info",
|
|
215
|
+
fn: U(({ currentStep: d, currentStepIndex: k, amountOfSteps: B }) => [
|
|
216
|
+
A(t.$slots, "nav-info", D(G({
|
|
217
|
+
currentStep: d,
|
|
218
|
+
currentStepIndex: k,
|
|
219
|
+
amountOfSteps: R.value
|
|
191
220
|
})))
|
|
192
221
|
]),
|
|
193
222
|
key: "0"
|
|
194
223
|
} : void 0
|
|
195
|
-
]), 1040)) :
|
|
224
|
+
]), 1040)) : h("", !0)
|
|
196
225
|
], 2);
|
|
197
226
|
};
|
|
198
227
|
}
|
|
199
|
-
}),
|
|
228
|
+
}), ht = {
|
|
200
229
|
install: (e, a = {}) => {
|
|
201
|
-
e.component("lkt-step-process",
|
|
230
|
+
e.component("lkt-step-process", ct);
|
|
202
231
|
}
|
|
203
232
|
};
|
|
204
233
|
export {
|
|
205
|
-
|
|
234
|
+
ht as default
|
|
206
235
|
};
|
|
@@ -5,9 +5,12 @@ declare var __VLS_11: {
|
|
|
5
5
|
amountOfSteps: number;
|
|
6
6
|
};
|
|
7
7
|
type __VLS_Slots = {} & {
|
|
8
|
-
'
|
|
8
|
+
'nav-info'?: (props: typeof __VLS_11) => any;
|
|
9
9
|
};
|
|
10
|
-
declare const __VLS_component: import("vue").DefineComponent<ButtonNavProps, {
|
|
10
|
+
declare const __VLS_component: import("vue").DefineComponent<ButtonNavProps, {
|
|
11
|
+
goNext: () => void;
|
|
12
|
+
goPrev: () => void;
|
|
13
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
14
|
next: (...args: any[]) => void;
|
|
12
15
|
prev: (...args: any[]) => void;
|
|
13
16
|
}, string, import("vue").PublicProps, Readonly<ButtonNavProps> & Readonly<{
|
|
@@ -4067,9 +4067,9 @@ declare var __VLS_13: {
|
|
|
4067
4067
|
type __VLS_Slots = {} & {
|
|
4068
4068
|
[K in NonNullable<typeof __VLS_16>]?: (props: typeof __VLS_17) => any;
|
|
4069
4069
|
} & {
|
|
4070
|
-
'
|
|
4070
|
+
'nav-info'?: (props: typeof __VLS_13) => any;
|
|
4071
4071
|
} & {
|
|
4072
|
-
'
|
|
4072
|
+
'nav-info'?: (props: typeof __VLS_31) => any;
|
|
4073
4073
|
};
|
|
4074
4074
|
declare const __VLS_component: import("vue").DefineComponent<StepProcessConfig, {
|
|
4075
4075
|
goNext: () => void;
|
package/package.json
CHANGED
|
@@ -1,36 +1,62 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
|
|
3
3
|
import { ButtonNavProps } from '../config/ButtonNavProps';
|
|
4
|
-
import { SetupContext, useSlots } from 'vue';
|
|
4
|
+
import { ref, SetupContext, useSlots } from 'vue';
|
|
5
|
+
import { DotConfig } from 'lkt-vue-kernel';
|
|
5
6
|
|
|
6
|
-
const props = withDefaults(defineProps<ButtonNavProps>(), {
|
|
7
|
-
|
|
8
|
-
});
|
|
7
|
+
const props = withDefaults(defineProps<ButtonNavProps>(), {});
|
|
9
8
|
|
|
10
9
|
const emit = defineEmits(['prev', 'next']);
|
|
11
10
|
const slots: SetupContext['slots'] = useSlots();
|
|
11
|
+
|
|
12
|
+
const prevButtonRef = ref(null),
|
|
13
|
+
nextButtonRef = ref(null);
|
|
14
|
+
|
|
15
|
+
defineExpose({
|
|
16
|
+
goNext: () => {
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
nextButtonRef.value.click();
|
|
19
|
+
},
|
|
20
|
+
goPrev: () => {
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
prevButtonRef.value.click();
|
|
23
|
+
}
|
|
24
|
+
});
|
|
12
25
|
</script>
|
|
13
26
|
|
|
14
27
|
<template>
|
|
15
|
-
<div class="lkt-step-process
|
|
28
|
+
<div class="lkt-step-process--nav">
|
|
16
29
|
<lkt-button
|
|
17
30
|
ref="prevButtonRef"
|
|
18
31
|
v-if="prevButton"
|
|
19
32
|
v-show="!isLoading"
|
|
20
33
|
v-bind="prevButton"
|
|
34
|
+
class="is-prev-button"
|
|
21
35
|
@click="emit('prev')"
|
|
22
36
|
/>
|
|
23
37
|
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
<div class="lkt-step-process--nav-info">
|
|
39
|
+
<template v-if="slots['nav-info']">
|
|
40
|
+
<slot
|
|
41
|
+
name="nav-info"
|
|
42
|
+
v-bind="{
|
|
43
|
+
currentStep,
|
|
44
|
+
currentStepIndex,
|
|
45
|
+
amountOfSteps,
|
|
46
|
+
}"
|
|
47
|
+
/>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<div class="lkt-step-process--dots" v-if="dots && amountOfSteps > 0">
|
|
51
|
+
<lkt-dot
|
|
52
|
+
v-for="n in amountOfSteps"
|
|
53
|
+
v-bind="<DotConfig>{
|
|
54
|
+
text: dotsNumbers ? n : '',
|
|
55
|
+
class: n === (currentStepIndex + 1) ? 'is-active' : '',
|
|
56
|
+
}"
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
34
60
|
|
|
35
61
|
|
|
36
62
|
<lkt-button
|
|
@@ -38,6 +64,7 @@
|
|
|
38
64
|
v-if="nextButton"
|
|
39
65
|
v-show="!isLoading"
|
|
40
66
|
v-bind="nextButton"
|
|
67
|
+
class="is-next-button"
|
|
41
68
|
@click="emit('next')"
|
|
42
69
|
/>
|
|
43
70
|
</div>
|
|
@@ -27,8 +27,7 @@
|
|
|
27
27
|
const isLoading = ref(props.loading),
|
|
28
28
|
currentStep = ref(props.modelValue),
|
|
29
29
|
stepsHaystack = ref(props.steps),
|
|
30
|
-
|
|
31
|
-
nextButtonRef = ref(null);
|
|
30
|
+
navRef = ref(null);
|
|
32
31
|
|
|
33
32
|
watch(() => props.loading, (value) => isLoading.value = value);
|
|
34
33
|
watch(() => props.modelValue, (value) => currentStep.value = value);
|
|
@@ -106,6 +105,9 @@
|
|
|
106
105
|
if (props.buttonNavVisibility === ItemCrudButtonNavVisibility.Never) return false;
|
|
107
106
|
return props.buttonNavPosition === ItemCrudButtonNavPosition.Bottom;
|
|
108
107
|
}),
|
|
108
|
+
computedAmountOfSteps = computed(() => {
|
|
109
|
+
return stepsHaystack.value.length;
|
|
110
|
+
}),
|
|
109
111
|
computedButtonNavProps = computed(() => {
|
|
110
112
|
return <ButtonNavProps>{
|
|
111
113
|
isLoading: isLoading.value,
|
|
@@ -113,10 +115,10 @@
|
|
|
113
115
|
nextButton: computedNextButton.value,
|
|
114
116
|
currentStep: currentStep.value,
|
|
115
117
|
currentStepIndex: currentStepIndex.value,
|
|
118
|
+
amountOfSteps: computedAmountOfSteps.value,
|
|
119
|
+
dots: props.dots,
|
|
120
|
+
dotsNumbers: props.dotsNumbers,
|
|
116
121
|
};
|
|
117
|
-
}),
|
|
118
|
-
computedAmountOfSteps = computed(() => {
|
|
119
|
-
return stepsHaystack.value.length;
|
|
120
122
|
});
|
|
121
123
|
|
|
122
124
|
const onNext = (data: any) => {
|
|
@@ -137,11 +139,11 @@
|
|
|
137
139
|
defineExpose({
|
|
138
140
|
goNext: () => {
|
|
139
141
|
// @ts-ignore
|
|
140
|
-
|
|
142
|
+
navRef.value.click();
|
|
141
143
|
},
|
|
142
144
|
goPrev: () => {
|
|
143
145
|
// @ts-ignore
|
|
144
|
-
|
|
146
|
+
navRef.value.click();
|
|
145
147
|
},
|
|
146
148
|
startLoader: () => isLoading.value = true,
|
|
147
149
|
stopLoader: () => isLoading.value = false,
|
|
@@ -162,9 +164,9 @@
|
|
|
162
164
|
@prev="onPrev"
|
|
163
165
|
@next="onNext"
|
|
164
166
|
>
|
|
165
|
-
<template #
|
|
167
|
+
<template #nav-info="{currentStep, currentStepIndex, amountOfSteps}" v-if="slots['nav-info']">
|
|
166
168
|
<slot
|
|
167
|
-
name="
|
|
169
|
+
name="nav-info"
|
|
168
170
|
v-bind="{
|
|
169
171
|
currentStep,
|
|
170
172
|
currentStepIndex,
|
|
@@ -174,7 +176,7 @@
|
|
|
174
176
|
</template>
|
|
175
177
|
</button-nav>
|
|
176
178
|
|
|
177
|
-
<div class="lkt-step-
|
|
179
|
+
<div class="lkt-step-process--content" v-if="!isLoading">
|
|
178
180
|
<div class="lkt-grid-1">
|
|
179
181
|
<div v-for="step in slotsSteps" v-show="step === currentStep">
|
|
180
182
|
<slot :name="'step-'+step" v-bind:config="stepsHaystack" />
|
|
@@ -189,9 +191,9 @@
|
|
|
189
191
|
@prev="onPrev"
|
|
190
192
|
@next="onNext"
|
|
191
193
|
>
|
|
192
|
-
<template #
|
|
194
|
+
<template #nav-info="{currentStep, currentStepIndex, amountOfSteps}" v-if="slots['nav-info']">
|
|
193
195
|
<slot
|
|
194
|
-
name="
|
|
196
|
+
name="nav-info"
|
|
195
197
|
v-bind="{
|
|
196
198
|
currentStep,
|
|
197
199
|
currentStepIndex,
|