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 CHANGED
@@ -1,4 +1,4 @@
1
- export { at as default };
2
- declare namespace at {
1
+ export { tt as default };
2
+ declare namespace tt {
3
3
  function install(e: any, a?: {}): void;
4
4
  }
package/dist/build.js CHANGED
@@ -1,54 +1,54 @@
1
- var $ = Object.defineProperty;
2
- var G = (e, a, n) => a in e ? $(e, a, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[a] = n;
3
- var i = (e, a, n) => G(e, typeof a != "symbol" ? a + "" : a, n);
4
- import { defineComponent as K, mergeDefaults as Q, useSlots as W, ref as f, watch as x, computed as c, resolveComponent as b, createElementBlock as g, openBlock as h, normalizeClass as X, createBlock as E, createCommentVNode as L, createElementVNode as H, normalizeProps as Y, mergeProps as C, withDirectives as w, createVNode as M, vShow as B, Fragment as Z, renderList as J, renderSlot as ee } 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 te = ((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))(te || {}), ae = ((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))(ae || {}), re = ["lktDateProps", "lktStrictItem", "lktExcludedProps"], s, ne = (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 = {}, n = this) {
10
- if (typeof a == "object") for (let [o, y] of Object.entries(a)) n.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, n) {
13
- if (!(re.includes(a) || s.lktExcludedProps.includes(a))) {
14
- if (s.lktDateProps.includes(a)) {
15
- this[a] = new Date(n);
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] = n;
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), le = ((e) => (e.Auto = "auto", e.Always = "always", e.Lazy = "lazy", e.Ever = "ever", e))(le || {}), oe = ((e) => (e.Transform = "transform", e.Height = "height", e.Display = "display", e))(oe || {}), ie = ((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))(ie || {}), se = ((e) => (e.Static = "static", e.Parallax = "parallax", e))(se || {}), ue = ((e) => (e.None = "", e.Field = "field", e.Button = "button", e.Anchor = "anchor", e))(ue || {}), ce = ((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))(ce || {}), de = ((e) => (e.List = "list", e.Inline = "inline", e.Count = "count", e))(de || {}), ve = ((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))(ve || {}), pe = ((e) => (e.Ok = "ok", e.Ko = "ko", e.Info = "info", e))(pe || {}), me = ((e) => (e.StorageUnit = "unit", e.Directory = "dir", e.Image = "img", e.Video = "vid", e.File = "file", e))(me || {}), he = ((e) => (e.H1 = "h1", e.H2 = "h2", e.H3 = "h3", e.H4 = "h4", e.H5 = "h5", e.H6 = "h6", e))(he || {}), ke = ((e) => (e.NotDefined = "", e.Button = "button", e))(ke || {}), fe = ((e) => (e.Start = "start", e.End = "end", e))(fe || {}), xe = ((e) => (e.Create = "create", e.Update = "update", e.Read = "read", e))(xe || {}), ge = ((e) => (e.Inline = "inline", e.Modal = "modal", e))(ge || {}), ye = ((e) => (e.Top = "top", e.Bottom = "bottom", e))(ye || {}), be = ((e) => (e.Changed = "changed", e.Always = "always", e.Never = "never", e))(be || {}), Le = ((e) => (e.Manual = "manual", e.Auto = "auto", e.Delay = "delay", e))(Le || {}), Ce = ((e) => (e.Toast = "toast", e.Inline = "inline", e))(Ce || {}), we = ((e) => (e.Anchor = "anchor", e.Button = "button", e.Entry = "entry", e))(we || {}), Be = ((e) => (e.Modal = "modal", e.Confirm = "confirm", e))(Be || {}), Ae = ((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))(Ae || {}), Pe = ((e) => (e.None = "", e.Incremental = "incremental", e.Decremental = "decremental", e))(Pe || {}), Se = ((e) => (e.NotDefined = "", e.Hidden = "hidden", e.Integer = "integer", e.Decimal = "decimal", e.Auto = "auto", e))(Se || {}), A, Ie = (A = class extends ne {
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), De = ((e) => (e.Table = "table", e.Item = "item", e.Ul = "ul", e.Ol = "ol", e.Carousel = "carousel", e.Accordion = "accordion", e))(De || {}), Ee = ((e) => (e[e.Auto = 0] = "Auto", e[e.PreferItem = 1] = "PreferItem", e[e.PreferCustomItem = 2] = "PreferCustomItem", e[e.PreferColumns = 3] = "PreferColumns", e))(Ee || {}), He = ((e) => (e.NotDefined = "", e.ActionIcon = "action-icon", e))(He || {}), Me = ((e) => (e.Message = "message", e.Button = "button", e))(Me || {}), Ne = ((e) => (e.Left = "left", e.Center = "center", e.Right = "right", e))(Ne || {}), Te = ((e) => (e.Fixed = "fixed", e.Absolute = "absolute", e))(Te || {}), Re = ((e) => (e.Top = "top", e.Bottom = "bottom", e.Center = "center", e.ReferrerCenter = "referrer-center", e))(Re || {}), _e = ((e) => (e.Left = "left", e.Right = "right", e.Center = "center", e.LeftCorner = "left-corner", e.RightCorner = "right-corner", e))(_e || {}), Ve = ((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))(Ve || {}), Fe = ((e) => (e.Grid = "grid", e.FlexRow = "flex-row", e.FlexRows = "flex-rows", e.FlexColumn = "flex-column", e))(Fe || {}), ze = ((e) => (e.None = "", e.Focus = "focus", e.Blur = "blur", e.Always = "always", e))(ze || {}), Ue = ((e) => (e.Auto = "auto", e.Local = "local", e.Remote = "remote", e))(Ue || {}), Oe = ((e) => (e.Refresh = "refresh", e.Close = "close", e.ReOpen = "reOpen", e.Exec = "exec", e.Open = "open", e))(Oe || {}), je = ((e) => (e.Asc = "asc", e.Desc = "desc", e))(je || {}), qe = ((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))(qe || {}), $e = ((e) => (e.Lazy = "lazy", e.Ever = "ever", e))($e || {}), Ge = ((e) => (e.Page = "page", e.Element = "element", e))(Ge || {}), Ke = ((e) => (e.Quick = "quick", e.Full = "full", e))(Ke || {});
33
- function Qe(e) {
34
- let a = new e(), n = {};
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 o of e.lktDefaultValues) o in a && (n[o] = a[o]);
37
- return n;
36
+ for (let n of e.lktDefaultValues) n in a && (o[n] = a[n]);
37
+ return o;
38
38
  }
39
- const We = { class: "lkt-step-process-buttons" }, Xe = {
39
+ const Qe = { class: "lkt-step-process-buttons" }, We = {
40
40
  key: 1,
41
41
  class: "lkt-step-process_content"
42
- }, Ye = { class: "lkt-grid-1" }, Ze = /* @__PURE__ */ K({
42
+ }, Xe = { class: "lkt-grid-1" }, Ye = /* @__PURE__ */ $({
43
43
  __name: "LktStepProcess",
44
- props: /* @__PURE__ */ Q({
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
- }, Qe(Ie)),
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: n }) {
60
- const o = e, y = W(), k = n, d = f(o.loading), v = f(o.modelValue), u = f(o.steps), P = f(null), S = f(null);
61
- x(() => o.loading, (t) => d.value = t), x(() => o.modelValue, (t) => v.value = t), x(d, (t) => k("update:loading", t)), x(v, (t) => k("update:modelValue", t));
62
- const N = c(() => {
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 r in y) r.indexOf("step-") !== -1 && t.push(r.substring(5));
64
+ for (let l in C) l.indexOf("step-") !== -1 && t.push(l.substring(5));
65
65
  return t;
66
- }), p = c(() => u.value.findIndex((t) => t.key === v.value)), l = c(() => u.value[p.value]), T = c(() => p.value === 0), R = c(() => p.value === u.value.length - 1), _ = c(() => {
67
- var r, m;
68
- let t = { ...o.prevButton };
69
- return (r = l.value) != null && r.prevButton && (t = { ...t, ...(m = l.value) == null ? void 0 : m.prevButton }), typeof t.disabled > "u" && (t.disabled = T.value), t;
70
- }), V = c(() => {
71
- var r, m;
72
- let t = { ...o.nextButton };
73
- return (r = l.value) != null && r.nextButton && (t = { ...t, ...(m = l.value) == null ? void 0 : m.nextButton }), typeof t.disabled > "u" && (t.disabled = R.value), t;
74
- }), F = c(() => {
75
- var t, r;
76
- return typeof ((t = l.value) == null ? void 0 : t.prevHidden) == "function" ? l.value.prevHidden(l.value, u.value) : typeof ((r = l.value) == null ? void 0 : r.prevHidden) == "boolean" ? l.value.prevHidden : p.value === 0;
77
- }), z = c(() => {
78
- var t, r;
79
- return typeof ((t = l.value) == null ? void 0 : t.nextHidden) == "function" ? l.value.nextHidden(l.value, u.value) : typeof ((r = l.value) == null ? void 0 : r.nextHidden) == "boolean" ? l.value.nextHidden : p.value === u.value.length - 1;
80
- }), U = c(() => {
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 v.value && t.push(`step-${v.value}`), t.join(" ");
83
- }), O = (t) => {
84
- v.value = u.value[p.value + 1].key, p.value === u.value.length - 1 ? k("finish", t) : k("next", t);
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
- v.value = u.value[p.value - 1].key, k("prev", 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: () => d.value = !0,
96
- stopLoader: () => d.value = !1
97
- }), (t, r) => {
98
- const m = b("lkt-header"), I = b("lkt-button"), q = b("lkt-loader");
99
- return h(), g("article", {
100
- class: X(["lkt-step-process", U.value])
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 ? (h(), E(m, Y(C({ key: 0 }, t.header)), null, 16)) : L("", !0),
103
- H("div", We, [
104
- w(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
- }, _.value, { onClick: j }), null, 16), [
108
- [B, !d.value && !F.value]
109
- ]),
110
- w(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
- }, V.value, { onClick: O }), null, 16), [
114
- [B, !d.value && !z.value]
115
- ])
126
+ ref: E
127
+ }, M.value, { onClick: U }), null, 16)), [
128
+ [S, !p.value && !F.value]
129
+ ]) : y("", !0)
116
130
  ]),
117
- d.value ? L("", !0) : (h(), g("div", Xe, [
118
- H("div", Ye, [
119
- (h(!0), g(Z, null, J(N.value, (D) => w((h(), g("div", null, [
120
- ee(t.$slots, "step-" + D, { config: u.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
- [B, D === v.value]
136
+ [S, N === s.value]
123
137
  ])), 256))
124
138
  ])
125
139
  ])),
126
- d.value ? (h(), E(q, { key: 2 })) : L("", !0)
140
+ p.value ? (f(), B(h, { key: 2 })) : y("", !0)
127
141
  ], 2);
128
142
  };
129
143
  }
130
- }), at = {
144
+ }), tt = {
131
145
  install: (e, a = {}) => {
132
- e.component("lkt-step-process", Ze);
146
+ e.component("lkt-step-process", Ye);
133
147
  }
134
148
  };
135
149
  export {
136
- at as default
150
+ tt as default
137
151
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-step-process",
3
- "version": "2.0.0",
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,
@@ -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?.prevHidden === 'function') {
74
- return currentStepConfig.value.prevHidden(currentStepConfig.value, stepsHaystack.value);
75
- }
76
- if (typeof currentStepConfig.value?.prevHidden === 'boolean') {
77
- 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
+ }
78
90
  }
79
91
  return currentStepIndex.value === 0;
80
92
  }),
81
93
  nextHidden = computed(() => {
82
- if (typeof currentStepConfig.value?.nextHidden === 'function') {
83
- return currentStepConfig.value.nextHidden(currentStepConfig.value, stepsHaystack.value);
84
- }
85
- if (typeof currentStepConfig.value?.nextHidden === 'boolean') {
86
- return currentStepConfig.value.nextHidden;
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 currentStepIndex.value === (stepsHaystack.value.length - 1);
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"