lkt-step-process 2.0.0 → 2.0.1
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 +66 -66
- package/package.json +1 -1
- package/src/lib-components/LktStepProcess.vue +1 -7
package/dist/build.d.ts
CHANGED
package/dist/build.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var i = (e, a,
|
|
4
|
-
import { defineComponent as
|
|
1
|
+
var q = Object.defineProperty;
|
|
2
|
+
var $ = (e, a, l) => a in e ? q(e, a, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[a] = l;
|
|
3
|
+
var i = (e, a, l) => $(e, typeof a != "symbol" ? a + "" : a, l);
|
|
4
|
+
import { defineComponent as G, mergeDefaults as K, useSlots as Q, ref as f, watch as x, computed as u, resolveComponent as b, createElementBlock as g, openBlock as h, normalizeClass as W, createBlock as E, createCommentVNode as L, createElementVNode as H, normalizeProps as X, mergeProps as C, withDirectives as B, createVNode as M, vShow as w, 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"], s, re = (s = class {
|
|
7
7
|
constructor(a) {
|
|
8
8
|
}
|
|
9
|
-
feed(a = {},
|
|
10
|
-
if (typeof a == "object") for (let [o, y] of Object.entries(a))
|
|
9
|
+
feed(a = {}, l = this) {
|
|
10
|
+
if (typeof a == "object") for (let [o, y] of Object.entries(a)) l.assignProp(o, y);
|
|
11
11
|
}
|
|
12
|
-
assignProp(a,
|
|
13
|
-
if (!(
|
|
12
|
+
assignProp(a, l) {
|
|
13
|
+
if (!(ae.includes(a) || s.lktExcludedProps.includes(a))) {
|
|
14
14
|
if (s.lktDateProps.includes(a)) {
|
|
15
|
-
this[a] = new Date(
|
|
15
|
+
this[a] = new Date(l);
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
this[a] =
|
|
18
|
+
this[a] = l;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
}, i(s, "lktAllowUndefinedProps", []), i(s, "lktExcludedProps", []), i(s, "lktDateProps", []), i(s, "lktStrictItem", !1), i(s, "lktDefaultValues", []), s),
|
|
21
|
+
}, i(s, "lktAllowUndefinedProps", []), i(s, "lktExcludedProps", []), i(s, "lktDateProps", []), i(s, "lktStrictItem", !1), i(s, "lktDefaultValues", []), s), 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 || {}), ie = ((e) => (e.Static = "static", e.Parallax = "parallax", e))(ie || {}), se = ((e) => (e.None = "", e.Field = "field", e.Button = "button", e.Anchor = "anchor", e))(se || {}), ue = ((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))(ue || {}), 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 || {}), he = ((e) => (e.NotDefined = "", e.Button = "button", e))(he || {}), ke = ((e) => (e.Start = "start", e.End = "end", e))(ke || {}), fe = ((e) => (e.Create = "create", e.Update = "update", e.Read = "read", e))(fe || {}), 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 || {}), Ce = ((e) => (e.Anchor = "anchor", e.Button = "button", e.Entry = "entry", e))(Ce || {}), Be = ((e) => (e.Modal = "modal", e.Confirm = "confirm", e))(Be || {}), 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 || {}), A, Se = (A = class extends re {
|
|
22
22
|
constructor(a = {}) {
|
|
23
23
|
super();
|
|
24
24
|
i(this, "modelValue", "");
|
|
@@ -29,26 +29,26 @@ var te = ((e) => (e.Button = "button", e.Submit = "submit", e.Reset = "reset", e
|
|
|
29
29
|
i(this, "prevButton", {});
|
|
30
30
|
this.feed(a);
|
|
31
31
|
}
|
|
32
|
-
}, i(A, "lktDefaultValues", ["modelValue", "loading", "steps", "header"]), A),
|
|
33
|
-
function
|
|
34
|
-
let a = new e(),
|
|
32
|
+
}, i(A, "lktDefaultValues", ["modelValue", "loading", "steps", "header"]), A), 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 || {}), Oe = ((e) => (e.Asc = "asc", e.Desc = "desc", e))(Oe || {}), je = ((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))(je || {}), 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(), l = {};
|
|
35
35
|
if (!Array.isArray(e.lktDefaultValues)) throw new Error("lktDefaultValues must be a keys array.");
|
|
36
|
-
for (let o of e.lktDefaultValues) o in a && (
|
|
37
|
-
return
|
|
36
|
+
for (let o of e.lktDefaultValues) o in a && (l[o] = a[o]);
|
|
37
|
+
return l;
|
|
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__ */ G({
|
|
43
43
|
__name: "LktStepProcess",
|
|
44
|
-
props: /* @__PURE__ */
|
|
44
|
+
props: /* @__PURE__ */ K({
|
|
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,34 +56,34 @@ 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 o = e, y =
|
|
61
|
-
x(() => o.loading, (t) =>
|
|
62
|
-
const N =
|
|
59
|
+
setup(e, { expose: a, emit: l }) {
|
|
60
|
+
const o = e, y = Q(), k = l, c = f(o.loading), d = f(o.modelValue), v = f(o.steps), P = f(null), S = f(null);
|
|
61
|
+
x(() => o.loading, (t) => c.value = t), x(() => o.modelValue, (t) => d.value = t), x(c, (t) => k("update:loading", t)), x(d, (t) => k("update:modelValue", t));
|
|
62
|
+
const N = u(() => {
|
|
63
63
|
let t = [];
|
|
64
|
-
for (let
|
|
64
|
+
for (let n in y) n.indexOf("step-") !== -1 && t.push(n.substring(5));
|
|
65
65
|
return t;
|
|
66
|
-
}),
|
|
67
|
-
var
|
|
66
|
+
}), m = u(() => v.value.findIndex((t) => t.key === d.value)), r = u(() => v.value[m.value]), T = u(() => m.value === 0), R = u(() => {
|
|
67
|
+
var n, p;
|
|
68
68
|
let t = { ...o.prevButton };
|
|
69
|
-
return (
|
|
70
|
-
}),
|
|
71
|
-
var
|
|
69
|
+
return (n = r.value) != null && n.prevButton && (t = { ...t, ...(p = r.value) == null ? void 0 : p.prevButton }), typeof t.disabled > "u" && (t.disabled = T.value), t;
|
|
70
|
+
}), _ = u(() => {
|
|
71
|
+
var n, p;
|
|
72
72
|
let t = { ...o.nextButton };
|
|
73
|
-
return (
|
|
74
|
-
}),
|
|
75
|
-
var t,
|
|
76
|
-
return typeof ((t =
|
|
77
|
-
}),
|
|
78
|
-
var t,
|
|
79
|
-
return typeof ((t =
|
|
80
|
-
}),
|
|
73
|
+
return (n = r.value) != null && n.nextButton && (t = { ...t, ...(p = r.value) == null ? void 0 : p.nextButton }), t;
|
|
74
|
+
}), V = u(() => {
|
|
75
|
+
var t, n;
|
|
76
|
+
return typeof ((t = r.value) == null ? void 0 : t.prevHidden) == "function" ? r.value.prevHidden(r.value, v.value) : typeof ((n = r.value) == null ? void 0 : n.prevHidden) == "boolean" ? r.value.prevHidden : m.value === 0;
|
|
77
|
+
}), F = u(() => {
|
|
78
|
+
var t, n;
|
|
79
|
+
return typeof ((t = r.value) == null ? void 0 : t.nextHidden) == "function" ? r.value.nextHidden(r.value, v.value) : typeof ((n = r.value) == null ? void 0 : n.nextHidden) == "boolean" ? r.value.nextHidden : r.value.nextButton === !1;
|
|
80
|
+
}), z = u(() => {
|
|
81
81
|
const t = [];
|
|
82
|
-
return
|
|
83
|
-
}),
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
|
|
82
|
+
return d.value && t.push(`step-${d.value}`), t.join(" ");
|
|
83
|
+
}), U = (t) => {
|
|
84
|
+
d.value = v.value[m.value + 1].key, m.value === v.value.length - 1 ? k("finish", t) : k("next", t);
|
|
85
|
+
}, O = (t) => {
|
|
86
|
+
d.value = v.value[m.value - 1].key, k("prev", t);
|
|
87
87
|
};
|
|
88
88
|
return a({
|
|
89
89
|
goNext: () => {
|
|
@@ -92,46 +92,46 @@ const We = { class: "lkt-step-process-buttons" }, Xe = {
|
|
|
92
92
|
goPrev: () => {
|
|
93
93
|
P.value.click();
|
|
94
94
|
},
|
|
95
|
-
startLoader: () =>
|
|
96
|
-
stopLoader: () =>
|
|
97
|
-
}), (t,
|
|
98
|
-
const
|
|
95
|
+
startLoader: () => c.value = !0,
|
|
96
|
+
stopLoader: () => c.value = !1
|
|
97
|
+
}), (t, n) => {
|
|
98
|
+
const p = b("lkt-header"), I = b("lkt-button"), j = b("lkt-loader");
|
|
99
99
|
return h(), g("article", {
|
|
100
|
-
class:
|
|
100
|
+
class: W(["lkt-step-process", z.value])
|
|
101
101
|
}, [
|
|
102
|
-
t.header && Object.keys(t.header).length > 0 ? (h(), E(
|
|
103
|
-
H("div",
|
|
104
|
-
|
|
102
|
+
t.header && Object.keys(t.header).length > 0 ? (h(), E(p, X(C({ key: 0 }, t.header)), null, 16)) : L("", !0),
|
|
103
|
+
H("div", Qe, [
|
|
104
|
+
B(M(I, C({
|
|
105
105
|
ref_key: "prevButtonRef",
|
|
106
106
|
ref: P
|
|
107
|
-
},
|
|
108
|
-
[
|
|
107
|
+
}, R.value, { onClick: O }), null, 16), [
|
|
108
|
+
[w, !c.value && !V.value]
|
|
109
109
|
]),
|
|
110
|
-
|
|
110
|
+
B(M(I, C({
|
|
111
111
|
ref_key: "nextButtonRef",
|
|
112
112
|
ref: S
|
|
113
|
-
},
|
|
114
|
-
[
|
|
113
|
+
}, _.value, { onClick: U }), null, 16), [
|
|
114
|
+
[w, !c.value && !F.value]
|
|
115
115
|
])
|
|
116
116
|
]),
|
|
117
|
-
|
|
118
|
-
H("div",
|
|
119
|
-
(h(!0), g(
|
|
120
|
-
|
|
117
|
+
c.value ? L("", !0) : (h(), g("div", We, [
|
|
118
|
+
H("div", Xe, [
|
|
119
|
+
(h(!0), g(Y, null, Z(N.value, (D) => B((h(), g("div", null, [
|
|
120
|
+
J(t.$slots, "step-" + D, { config: v.value })
|
|
121
121
|
], 512)), [
|
|
122
|
-
[
|
|
122
|
+
[w, D === d.value]
|
|
123
123
|
])), 256))
|
|
124
124
|
])
|
|
125
125
|
])),
|
|
126
|
-
|
|
126
|
+
c.value ? (h(), E(j, { key: 2 })) : L("", !0)
|
|
127
127
|
], 2);
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
|
-
}),
|
|
130
|
+
}), tt = {
|
|
131
131
|
install: (e, a = {}) => {
|
|
132
|
-
e.component("lkt-step-process",
|
|
132
|
+
e.component("lkt-step-process", Ye);
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
135
|
export {
|
|
136
|
-
|
|
136
|
+
tt as default
|
|
137
137
|
};
|
package/package.json
CHANGED
|
@@ -46,9 +46,6 @@
|
|
|
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(() => {
|
|
53
50
|
let r: ButtonConfig = { ...props.prevButton };
|
|
54
51
|
if (currentStepConfig.value?.prevButton) {
|
|
@@ -64,9 +61,6 @@
|
|
|
64
61
|
if (currentStepConfig.value?.nextButton) {
|
|
65
62
|
r = { ...r, ...currentStepConfig.value?.nextButton };
|
|
66
63
|
}
|
|
67
|
-
if (typeof r.disabled === 'undefined') {
|
|
68
|
-
r.disabled = nextDisabled.value;
|
|
69
|
-
}
|
|
70
64
|
return r;
|
|
71
65
|
}),
|
|
72
66
|
prevHidden = computed(() => {
|
|
@@ -85,7 +79,7 @@
|
|
|
85
79
|
if (typeof currentStepConfig.value?.nextHidden === 'boolean') {
|
|
86
80
|
return currentStepConfig.value.nextHidden;
|
|
87
81
|
}
|
|
88
|
-
return
|
|
82
|
+
return currentStepConfig.value.nextButton === false;
|
|
89
83
|
}),
|
|
90
84
|
classes = computed(() => {
|
|
91
85
|
const r = [];
|