lkt-step-process 2.0.3 → 2.0.5

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