lkt-step-process 2.0.1 → 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.js CHANGED
@@ -1,47 +1,47 @@
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";
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 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 {
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 = {}, l = this) {
10
- if (typeof a == "object") for (let [o, y] of Object.entries(a)) l.assignProp(o, y);
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, l) {
13
- if (!(ae.includes(a) || s.lktExcludedProps.includes(a))) {
14
- if (s.lktDateProps.includes(a)) {
15
- this[a] = new Date(l);
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] = l;
18
+ this[a] = o;
19
19
  }
20
20
  }
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 {
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
- i(this, "modelValue", "");
25
- i(this, "loading", !1);
26
- i(this, "steps", []);
27
- i(this, "header", {});
28
- i(this, "nextButton", {});
29
- i(this, "prevButton", {});
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
- }, 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 || {});
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
33
  function Ke(e) {
34
- let a = new e(), l = {};
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 o of e.lktDefaultValues) o in a && (l[o] = a[o]);
37
- return l;
36
+ for (let n of e.lktDefaultValues) n in a && (o[n] = a[n]);
37
+ return o;
38
38
  }
39
39
  const Qe = { class: "lkt-step-process-buttons" }, We = {
40
40
  key: 1,
41
41
  class: "lkt-step-process_content"
42
- }, Xe = { class: "lkt-grid-1" }, Ye = /* @__PURE__ */ G({
42
+ }, Xe = { class: "lkt-grid-1" }, Ye = /* @__PURE__ */ $({
43
43
  __name: "LktStepProcess",
44
- props: /* @__PURE__ */ K({
44
+ props: /* @__PURE__ */ G({
45
45
  modelValue: {},
46
46
  loading: { type: Boolean },
47
47
  steps: {},
@@ -56,74 +56,88 @@ const Qe = { class: "lkt-step-process-buttons" }, We = {
56
56
  "update:modelValue",
57
57
  "update:loading"
58
58
  ],
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(() => {
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 n in y) n.indexOf("step-") !== -1 && t.push(n.substring(5));
64
+ for (let l in C) l.indexOf("step-") !== -1 && t.push(l.substring(5));
65
65
  return t;
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
- let t = { ...o.prevButton };
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
- let t = { ...o.nextButton };
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(() => {
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 d.value && t.push(`step-${d.value}`), t.join(" ");
92
+ return s.value && t.push(`step-${s.value}`), t.join(" ");
83
93
  }), 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);
94
+ s.value = c.value[k.value + 1].key, k.value === c.value.length - 1 ? x("finish", t) : x("next", t);
95
+ }, j = (t) => {
96
+ s.value = c.value[k.value - 1].key, x("prev", t);
87
97
  };
88
98
  return a({
89
99
  goNext: () => {
90
- S.value.click();
100
+ E.value.click();
91
101
  },
92
102
  goPrev: () => {
93
- P.value.click();
103
+ D.value.click();
94
104
  },
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
- return h(), g("article", {
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", {
100
112
  class: W(["lkt-step-process", z.value])
101
113
  }, [
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({
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: P
107
- }, R.value, { onClick: O }), null, 16), [
108
- [w, !c.value && !V.value]
109
- ]),
110
- B(M(I, C({
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: S
113
- }, _.value, { onClick: U }), null, 16), [
114
- [w, !c.value && !F.value]
115
- ])
126
+ ref: E
127
+ }, M.value, { onClick: U }), null, 16)), [
128
+ [S, !p.value && !F.value]
129
+ ]) : y("", !0)
116
130
  ]),
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 })
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
- [w, D === d.value]
136
+ [S, N === s.value]
123
137
  ])), 256))
124
138
  ])
125
139
  ])),
126
- c.value ? (h(), E(j, { key: 2 })) : L("", !0)
140
+ p.value ? (f(), B(h, { key: 2 })) : y("", !0)
127
141
  ], 2);
128
142
  };
129
143
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-step-process",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "module": "./dist/build.js",
@@ -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,
@@ -47,8 +47,16 @@
47
47
  return currentStepIndex.value === 0;
48
48
  }),
49
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
+
50
58
  let r: ButtonConfig = { ...props.prevButton };
51
- if (currentStepConfig.value?.prevButton) {
59
+ if (typeof currentStepConfig.value?.prevButton === 'object') {
52
60
  r = { ...r, ...currentStepConfig.value?.prevButton };
53
61
  }
54
62
  if (typeof r.disabled === 'undefined') {
@@ -57,29 +65,42 @@
57
65
  return r;
58
66
  }),
59
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
+
60
76
  let r: ButtonConfig = { ...props.nextButton };
61
- if (currentStepConfig.value?.nextButton) {
77
+ if (typeof currentStepConfig.value?.nextButton === 'object') {
62
78
  r = { ...r, ...currentStepConfig.value?.nextButton };
63
79
  }
64
80
  return r;
65
81
  }),
66
82
  prevHidden = computed(() => {
67
- if (typeof currentStepConfig.value?.prevHidden === 'function') {
68
- return currentStepConfig.value.prevHidden(currentStepConfig.value, stepsHaystack.value);
69
- }
70
- if (typeof currentStepConfig.value?.prevHidden === 'boolean') {
71
- return currentStepConfig.value.prevHidden;
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
+ }
72
90
  }
73
91
  return currentStepIndex.value === 0;
74
92
  }),
75
93
  nextHidden = computed(() => {
76
- if (typeof currentStepConfig.value?.nextHidden === 'function') {
77
- return currentStepConfig.value.nextHidden(currentStepConfig.value, stepsHaystack.value);
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;
78
102
  }
79
- if (typeof currentStepConfig.value?.nextHidden === 'boolean') {
80
- return currentStepConfig.value.nextHidden;
81
- }
82
- return currentStepConfig.value.nextButton === false;
103
+ return true;
83
104
  }),
84
105
  classes = computed(() => {
85
106
  const r = [];
@@ -114,6 +135,10 @@
114
135
  startLoader: () => isLoading.value = true,
115
136
  stopLoader: () => isLoading.value = false,
116
137
  });
138
+
139
+ onMounted(() => {
140
+ if (!currentStep.value && stepsHaystack.value.length > 0) currentStep.value = stepsHaystack.value[0].key
141
+ })
117
142
  </script>
118
143
 
119
144
  <template>
@@ -123,12 +148,14 @@
123
148
  <div class="lkt-step-process-buttons">
124
149
  <lkt-button
125
150
  ref="prevButtonRef"
151
+ v-if="computedPrevButton"
126
152
  v-show="!isLoading && !prevHidden"
127
153
  v-bind="computedPrevButton"
128
154
  v-on:click="onPrev"
129
155
  />
130
156
  <lkt-button
131
157
  ref="nextButtonRef"
158
+ v-if="computedNextButton"
132
159
  v-show="!isLoading && !nextHidden"
133
160
  v-bind="computedNextButton"
134
161
  v-on:click="onNext"