lkt-tabs 1.0.7 → 1.1.0

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.
@@ -1,14 +1,17 @@
1
- import { defineComponent as H, ref as g, computed as i, watch as $, openBlock as l, createElementBlock as r, unref as u, renderSlot as h, createCommentVNode as P, getCurrentInstance as q, normalizeClass as C, withDirectives as F, createElementVNode as y, Fragment as _, renderList as b, withModifiers as V, vShow as M, normalizeStyle as x, createBlock as z, withCtx as D } from "vue";
2
- import { generateRandomString as E, isString as K, getSlots as S } from "lkt-tools";
3
- import { getSessionStorage as U, setSessionStorage as R } from "lkt-session";
4
- const B = (a) => `lkt-tabs.${window.location.host}${window.location.pathname}.${a}`, Y = (a) => U(B(a)), G = (a, c, e) => {
5
- R(B(a), c, e * 60);
6
- }, J = ["id"], Q = {
7
- name: "LktTab",
8
- inheritAttrs: !1,
9
- customOptions: {}
10
- }, A = /* @__PURE__ */ H({
11
- ...Q,
1
+ import { defineComponent as H, ref as $, computed as c, watch as k, createElementBlock as u, createCommentVNode as A, openBlock as i, renderSlot as v, getCurrentInstance as P, useSlots as j, nextTick as q, normalizeClass as C, withDirectives as y, createElementVNode as L, Fragment as S, renderList as g, withModifiers as V, vShow as F, normalizeStyle as z, createBlock as D, withCtx as E } from "vue";
2
+ import { getSessionStorage as K, setSessionStorage as N } from "lkt-session";
3
+ function U(a = 10) {
4
+ let r = "";
5
+ const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", d = t.length;
6
+ for (let s = 0; s < a; s++)
7
+ r += t.charAt(Math.floor(Math.random() * d));
8
+ return r;
9
+ }
10
+ function Y(a) {
11
+ return typeof a == "string";
12
+ }
13
+ const G = ["id"], J = /* @__PURE__ */ H({
14
+ __name: "LktTab",
12
15
  props: {
13
16
  id: { type: String, default: "" },
14
17
  name: { type: String, required: !0 },
@@ -17,128 +20,129 @@ const B = (a) => `lkt-tabs.${window.location.host}${window.location.pathname}.${
17
20
  isDisabled: { type: Boolean, default: !1 }
18
21
  },
19
22
  emits: ["is-active"],
20
- setup(a, { emit: c }) {
21
- const e = a, n = g(!1), o = g(E(8)), m = i(() => e.id ? e.id : K(e.name) && e.name.length > 0 ? e.name.toLowerCase().replace(/ /g, "-") : o.value), p = () => {
22
- n.value = e.activeHash === e.hash, c("is-active", n.value);
23
+ setup(a, { emit: r }) {
24
+ const t = a, d = r, s = $(!1), p = $(U(8)), o = c(() => t.id ? t.id : Y(t.name) && t.name.length > 0 ? t.name.toLowerCase().replace(/ /g, "-") : p.value), h = () => {
25
+ s.value = t.activeHash === t.hash, d("is-active", s.value);
23
26
  };
24
- return $(() => e.activeHash, p), p(), (d, T) => n.value ? (l(), r("section", {
27
+ return k(() => t.activeHash, h), h(), (m, f) => s.value ? (i(), u("section", {
25
28
  key: 0,
26
29
  "data-lkt": "tab-content",
27
- id: u(m),
30
+ id: o.value,
28
31
  role: "tabpanel"
29
32
  }, [
30
- h(d.$slots, "default")
31
- ], 8, J)) : P("", !0);
33
+ v(m.$slots, "default")
34
+ ], 8, G)) : A("", !0);
32
35
  }
33
- }), W = { class: "lkt-tabs__list" }, X = ["href", "onClick"], Z = ["innerHTML", "onClick", "href"], tt = { "data-lkt": "tab" }, et = {
34
- name: "LktTabs",
35
- inheritAttrs: !1,
36
- customOptions: {},
37
- components: { LktTab: A }
38
- }, st = /* @__PURE__ */ H({
39
- ...et,
36
+ }), B = (a) => `lkt-tabs.${window.location.host}${window.location.pathname}.${a}`, Q = (a) => K(B(a)), R = (a, r, t) => {
37
+ N(B(a), r, t * 60);
38
+ }, W = { class: "lkt-tabs__list" }, X = ["href", "onClick"], Z = ["innerHTML", "onClick", "href"], ee = { "data-lkt": "tab" }, te = /* @__PURE__ */ H({
39
+ __name: "LktTabs",
40
40
  props: {
41
- id: { type: String, default: "" },
42
- modelValue: { type: [String, Number], default: "" },
41
+ modelValue: { default: "" },
42
+ id: { default: "" },
43
43
  useSession: { type: Boolean, default: !1 },
44
- cacheLifetime: { type: Number, default: 5 },
45
- contentPad: { type: String, default: void 0 },
46
- palette: { type: String, default: void 0 },
47
- titles: {
48
- type: Object,
49
- default() {
50
- return {};
51
- }
52
- }
44
+ cacheLifetime: { default: 5 },
45
+ contentPad: { default: "" },
46
+ titles: { default: () => ({}) }
53
47
  },
54
- emits: ["update:modelValue"],
55
- setup(a, { emit: c }) {
56
- const e = a, { ctx: n } = q(), o = g("");
57
- if (e.useSession) {
58
- n.id || console.warn("[LKT Tabs] You're trying to use session provided tabs without the required id. Please, add id attr");
59
- let t = Y(n.id);
60
- t && (o.value = t);
48
+ emits: [
49
+ "update:modelValue"
50
+ ],
51
+ setup(a, { emit: r }) {
52
+ const { ctx: t } = P(), d = j(), s = a, p = r, o = $("");
53
+ if (s.useSession) {
54
+ s.id || console.warn("[LKT Tabs] You're trying to use session provided tabs without the required id. Please, add id attr");
55
+ let e = Q(s.id);
56
+ e && (o.value = e);
61
57
  }
62
- $(() => e.modelValue, (t, f) => {
63
- typeof t == "string" && (o.value = t);
64
- }), $(o, (t, f) => {
65
- c("update:modelValue"), n.$nextTick(() => {
66
- n.$forceUpdate();
67
- }), e.useSession && G(n.id, t, e.cacheLifetime);
58
+ k(() => s.modelValue, (e, l) => {
59
+ typeof e == "string" && (o.value = e);
60
+ }), k(o, (e, l) => {
61
+ p("update:modelValue"), q(() => {
62
+ t.$forceUpdate();
63
+ }), s.useSession && R(t.id, e, s.cacheLifetime);
68
64
  });
69
- const m = i(() => {
70
- let t = [];
71
- return e.palette && t.push(`lkt-tabs--${e.palette}`), t.join(" ");
72
- }), p = i(() => {
73
- let t = [];
74
- return e.contentPad && t.push(`padding: ${e.contentPad}`), t.join(";");
75
- }), d = i(() => S(n.$slots, "tab-")), T = i(() => S(n.$slots, "title-")), I = i(() => S(n.$slots, "li-")), v = i(() => {
76
- let t = {};
77
- for (let f in n.$refs)
78
- t[f] = n.$refs[f].hash;
79
- return t;
80
- }), j = i(() => Object.keys(d.value).length > 1), k = (t = "") => v.value.length > 0 && v.value[t] ? "#" + v.value[t] : "#", w = (t = "") => e.titles && e.titles[t] ? e.titles[t] : t, N = () => {
81
- n.$forceUpdate();
65
+ const h = c(() => [].join(" ")), m = c(() => {
66
+ let e = [];
67
+ return s.contentPad && e.push(`padding: ${s.contentPad}`), e.join(";");
68
+ }), f = c(() => {
69
+ let e = [];
70
+ for (let l in d) l.indexOf("tab-") !== -1 && e.push(l);
71
+ return e;
72
+ }), x = c(() => {
73
+ let e = [];
74
+ for (let l in d) l.indexOf("title-") !== -1 && e.push(l);
75
+ return e;
76
+ }), I = c(() => {
77
+ let e = [];
78
+ for (let l in d) l.indexOf("li-") !== -1 && e.push(l);
79
+ return e;
80
+ }), b = c(() => {
81
+ let e = {};
82
+ for (let l in t.$refs)
83
+ e[l] = t.$refs[l].hash;
84
+ return e;
85
+ }), M = c(() => Object.keys(f.value).length > 1), T = (e = "") => b.value.length > 0 && b.value[e] ? "#" + b.value[e] : "#", w = (e = "") => s.titles && s.titles[e] ? s.titles[e] : e, O = () => {
86
+ t.$forceUpdate();
82
87
  };
83
- for (let t in d.value)
84
- o.value === "" && (o.value = t);
85
- return (t, f) => (l(), r("div", {
86
- class: C(["lkt-tabs", u(m)])
88
+ for (let e in f.value)
89
+ o.value === "" && (o.value = e);
90
+ return (e, l) => (i(), u("div", {
91
+ class: C(["lkt-tabs", h.value])
87
92
  }, [
88
- F(y("ul", W, [
89
- (l(!0), r(_, null, b(u(d), (L, s) => (l(), r("li", {
90
- key: s,
91
- class: C(["lkt-tab", { "is-active": s === o.value }]),
93
+ y(L("ul", W, [
94
+ (i(!0), u(S, null, g(f.value, (n) => (i(), u("li", {
95
+ key: n,
96
+ class: C(["lkt-tab", { "is-active": n === o.value }]),
92
97
  role: "presentation"
93
98
  }, [
94
- u(T)[s] ? (l(), r("a", {
99
+ x.value.includes(n) ? (i(), u("a", {
95
100
  key: 0,
96
- href: k(s),
97
- onClick: V((O) => o.value = s, ["prevent"]),
101
+ href: T(n),
102
+ onClick: V((_) => o.value = n, ["prevent"]),
98
103
  role: "tab"
99
104
  }, [
100
- h(t.$slots, "title-" + s)
101
- ], 8, X)) : (l(), r("a", {
105
+ v(e.$slots, "title-" + n)
106
+ ], 8, X)) : (i(), u("a", {
102
107
  key: 1,
103
- innerHTML: w(s),
104
- onClick: V((O) => o.value = s, ["prevent"]),
105
- href: k(s),
108
+ innerHTML: w(n),
109
+ onClick: V((_) => o.value = n, ["prevent"]),
110
+ href: T(n),
106
111
  role: "tab"
107
112
  }, null, 8, Z))
108
113
  ], 2))), 128)),
109
- (l(!0), r(_, null, b(u(I), (L, s) => (l(), r("li", tt, [
110
- h(t.$slots, "li-" + s)
114
+ (i(!0), u(S, null, g(I.value, (n, _) => (i(), u("li", ee, [
115
+ v(e.$slots, "li-" + _)
111
116
  ]))), 256))
112
117
  ], 512), [
113
- [M, u(j)]
118
+ [F, M.value]
114
119
  ]),
115
- y("div", {
120
+ L("div", {
116
121
  class: "lkt-tabs__content",
117
- style: x(u(p))
122
+ style: z(m.value)
118
123
  }, [
119
- (l(!0), r(_, null, b(u(d), (L, s) => (l(), z(A, {
124
+ (i(!0), u(S, null, g(f.value, (n) => (i(), D(J, {
120
125
  ref_for: !0,
121
- ref: s,
122
- hash: s,
123
- id: s,
124
- name: w(s),
126
+ ref: n,
127
+ hash: n,
128
+ id: n,
129
+ name: w(n),
125
130
  "active-hash": o.value,
126
- onIsActive: N
131
+ onIsActive: O
127
132
  }, {
128
- default: D(() => [
129
- h(t.$slots, "tab-" + s)
133
+ default: E(() => [
134
+ v(e.$slots, "tab-" + n)
130
135
  ]),
131
136
  _: 2
132
137
  }, 1032, ["hash", "id", "name", "active-hash"]))), 256))
133
138
  ], 4)
134
139
  ], 2));
135
140
  }
136
- });
137
- const lt = {
138
- install: (a, c) => {
139
- a.component("lkt-tabs", st);
141
+ }), ae = {
142
+ install: (a, r) => {
143
+ a.component("lkt-tabs", te);
140
144
  }
141
145
  };
142
146
  export {
143
- lt as default
147
+ ae as default
144
148
  };
@@ -1 +1 @@
1
- (function(t,a){typeof exports=="object"&&typeof module<"u"?module.exports=a(require("vue"),require("lkt-tools"),require("lkt-session")):typeof define=="function"&&define.amd?define(["vue","lkt-tools","lkt-session"],a):(t=typeof globalThis<"u"?globalThis:t||self,t.LktTabs=a(t.Vue,t.LktTools,t.LktSession))})(this,function(t,a,u){"use strict";const h=r=>`lkt-tabs.${window.location.host}${window.location.pathname}.${r}`,B=r=>u.getSessionStorage(h(r)),$=(r,i,n)=>{u.setSessionStorage(h(r),i,n*60)},L=["id"],T={name:"LktTab",inheritAttrs:!1,customOptions:{}},S=t.defineComponent({...T,props:{id:{type:String,default:""},name:{type:String,required:!0},hash:{type:String,default:""},activeHash:{type:String,default:""},isDisabled:{type:Boolean,default:!1}},emits:["is-active"],setup(r,{emit:i}){const n=r,o=t.ref(!1),l=t.ref(a.generateRandomString(8)),p=t.computed(()=>n.id?n.id:a.isString(n.name)&&n.name.length>0?n.name.toLowerCase().replace(/ /g,"-"):l.value),f=()=>{o.value=n.activeHash===n.hash,i("is-active",o.value)};return t.watch(()=>n.activeHash,f),f(),(c,k)=>o.value?(t.openBlock(),t.createElementBlock("section",{key:0,"data-lkt":"tab-content",id:t.unref(p),role:"tabpanel"},[t.renderSlot(c.$slots,"default")],8,L)):t.createCommentVNode("",!0)}}),w={class:"lkt-tabs__list"},C=["href","onClick"],y=["innerHTML","onClick","href"],E={"data-lkt":"tab"},V={name:"LktTabs",inheritAttrs:!1,customOptions:{},components:{LktTab:S}},H=t.defineComponent({...V,props:{id:{type:String,default:""},modelValue:{type:[String,Number],default:""},useSession:{type:Boolean,default:!1},cacheLifetime:{type:Number,default:5},contentPad:{type:String,default:void 0},palette:{type:String,default:void 0},titles:{type:Object,default(){return{}}}},emits:["update:modelValue"],setup(r,{emit:i}){const n=r,{ctx:o}=t.getCurrentInstance(),l=t.ref("");if(n.useSession){o.id||console.warn("[LKT Tabs] You're trying to use session provided tabs without the required id. Please, add id attr");let e=B(o.id);e&&(l.value=e)}t.watch(()=>n.modelValue,(e,d)=>{typeof e=="string"&&(l.value=e)}),t.watch(l,(e,d)=>{i("update:modelValue"),o.$nextTick(()=>{o.$forceUpdate()}),n.useSession&&$(o.id,e,n.cacheLifetime)});const p=t.computed(()=>{let e=[];return n.palette&&e.push(`lkt-tabs--${n.palette}`),e.join(" ")}),f=t.computed(()=>{let e=[];return n.contentPad&&e.push(`padding: ${n.contentPad}`),e.join(";")}),c=t.computed(()=>a.getSlots(o.$slots,"tab-")),k=t.computed(()=>a.getSlots(o.$slots,"title-")),q=t.computed(()=>a.getSlots(o.$slots,"li-")),m=t.computed(()=>{let e={};for(let d in o.$refs)e[d]=o.$refs[d].hash;return e}),j=t.computed(()=>Object.keys(c.value).length>1),_=(e="")=>m.value.length>0&&m.value[e]?"#"+m.value[e]:"#",b=(e="")=>n.titles&&n.titles[e]?n.titles[e]:e,A=()=>{o.$forceUpdate()};for(let e in c.value)l.value===""&&(l.value=e);return(e,d)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["lkt-tabs",t.unref(p)])},[t.withDirectives(t.createElementVNode("ul",w,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(c),(g,s)=>(t.openBlock(),t.createElementBlock("li",{key:s,class:t.normalizeClass(["lkt-tab",{"is-active":s===l.value}]),role:"presentation"},[t.unref(k)[s]?(t.openBlock(),t.createElementBlock("a",{key:0,href:_(s),onClick:t.withModifiers(F=>l.value=s,["prevent"]),role:"tab"},[t.renderSlot(e.$slots,"title-"+s)],8,C)):(t.openBlock(),t.createElementBlock("a",{key:1,innerHTML:b(s),onClick:t.withModifiers(F=>l.value=s,["prevent"]),href:_(s),role:"tab"},null,8,y))],2))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(q),(g,s)=>(t.openBlock(),t.createElementBlock("li",E,[t.renderSlot(e.$slots,"li-"+s)]))),256))],512),[[t.vShow,t.unref(j)]]),t.createElementVNode("div",{class:"lkt-tabs__content",style:t.normalizeStyle(t.unref(f))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(c),(g,s)=>(t.openBlock(),t.createBlock(S,{ref_for:!0,ref:s,hash:s,id:s,name:b(s),"active-hash":l.value,onIsActive:A},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"tab-"+s)]),_:2},1032,["hash","id","name","active-hash"]))),256))],4)],2))}}),I="";return{install:(r,i)=>{r.component("lkt-tabs",H)}}});
1
+ (function(e,d){typeof exports=="object"&&typeof module<"u"?module.exports=d(require("vue"),require("lkt-session")):typeof define=="function"&&define.amd?define(["vue","lkt-session"],d):(e=typeof globalThis<"u"?globalThis:e||self,e.LktTabs=d(e.Vue,e.LktSession))})(this,function(e,d){"use strict";function B(l=10){let i="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",c=n.length;for(let o=0;o<l;o++)i+=n.charAt(Math.floor(Math.random()*c));return i}function g(l){return typeof l=="string"}const T=["id"],L=e.defineComponent({__name:"LktTab",props:{id:{type:String,default:""},name:{type:String,required:!0},hash:{type:String,default:""},activeHash:{type:String,default:""},isDisabled:{type:Boolean,default:!1}},emits:["is-active"],setup(l,{emit:i}){const n=l,c=i,o=e.ref(!1),p=e.ref(B(8)),r=e.computed(()=>n.id?n.id:g(n.name)&&n.name.length>0?n.name.toLowerCase().replace(/ /g,"-"):p.value),u=()=>{o.value=n.activeHash===n.hash,c("is-active",o.value)};return e.watch(()=>n.activeHash,u),u(),(m,f)=>o.value?(e.openBlock(),e.createElementBlock("section",{key:0,"data-lkt":"tab-content",id:r.value,role:"tabpanel"},[e.renderSlot(m.$slots,"default")],8,T)):e.createCommentVNode("",!0)}}),b=l=>`lkt-tabs.${window.location.host}${window.location.pathname}.${l}`,$=l=>d.getSessionStorage(b(l)),w=(l,i,n)=>{d.setSessionStorage(b(l),i,n*60)},C={class:"lkt-tabs__list"},E=["href","onClick"],V=["innerHTML","onClick","href"],H={"data-lkt":"tab"},x=e.defineComponent({__name:"LktTabs",props:{modelValue:{default:""},id:{default:""},useSession:{type:Boolean,default:!1},cacheLifetime:{default:5},contentPad:{default:""},titles:{default:()=>({})}},emits:["update:modelValue"],setup(l,{emit:i}){const{ctx:n}=e.getCurrentInstance(),c=e.useSlots(),o=l,p=i,r=e.ref("");if(o.useSession){o.id||console.warn("[LKT Tabs] You're trying to use session provided tabs without the required id. Please, add id attr");let t=$(o.id);t&&(r.value=t)}e.watch(()=>o.modelValue,(t,a)=>{typeof t=="string"&&(r.value=t)}),e.watch(r,(t,a)=>{p("update:modelValue"),e.nextTick(()=>{n.$forceUpdate()}),o.useSession&&w(n.id,t,o.cacheLifetime)});const u=e.computed(()=>[].join(" ")),m=e.computed(()=>{let t=[];return o.contentPad&&t.push(`padding: ${o.contentPad}`),t.join(";")}),f=e.computed(()=>{let t=[];for(let a in c)a.indexOf("tab-")!==-1&&t.push(a);return t}),M=e.computed(()=>{let t=[];for(let a in c)a.indexOf("title-")!==-1&&t.push(a);return t}),q=e.computed(()=>{let t=[];for(let a in c)a.indexOf("li-")!==-1&&t.push(a);return t}),h=e.computed(()=>{let t={};for(let a in n.$refs)t[a]=n.$refs[a].hash;return t}),y=e.computed(()=>Object.keys(f.value).length>1),S=(t="")=>h.value.length>0&&h.value[t]?"#"+h.value[t]:"#",_=(t="")=>o.titles&&o.titles[t]?o.titles[t]:t,F=()=>{n.$forceUpdate()};for(let t in f.value)r.value===""&&(r.value=t);return(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["lkt-tabs",u.value])},[e.withDirectives(e.createElementVNode("ul",C,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,s=>(e.openBlock(),e.createElementBlock("li",{key:s,class:e.normalizeClass(["lkt-tab",{"is-active":s===r.value}]),role:"presentation"},[M.value.includes(s)?(e.openBlock(),e.createElementBlock("a",{key:0,href:S(s),onClick:e.withModifiers(k=>r.value=s,["prevent"]),role:"tab"},[e.renderSlot(t.$slots,"title-"+s)],8,E)):(e.openBlock(),e.createElementBlock("a",{key:1,innerHTML:_(s),onClick:e.withModifiers(k=>r.value=s,["prevent"]),href:S(s),role:"tab"},null,8,V))],2))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,(s,k)=>(e.openBlock(),e.createElementBlock("li",H,[e.renderSlot(t.$slots,"li-"+k)]))),256))],512),[[e.vShow,y.value]]),e.createElementVNode("div",{class:"lkt-tabs__content",style:e.normalizeStyle(m.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,s=>(e.openBlock(),e.createBlock(L,{ref_for:!0,ref:s,hash:s,id:s,name:_(s),"active-hash":r.value,onIsActive:F},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"tab-"+s)]),_:2},1032,["hash","id","name","active-hash"]))),256))],4)],2))}});return{install:(l,i)=>{l.component("lkt-tabs",x)}}});
@@ -0,0 +1,121 @@
1
+ declare const isActive: import("vue").Ref<boolean, boolean>;
2
+ declare const computedId: import("vue").ComputedRef<string>;
3
+ declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
4
+ declare var __VLS_1: {};
5
+ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
6
+ default?: (props: typeof __VLS_1) => any;
7
+ }>;
8
+ declare const __VLS_self: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
9
+ id: {
10
+ type: StringConstructor;
11
+ default: string;
12
+ };
13
+ name: {
14
+ type: StringConstructor;
15
+ required: true;
16
+ };
17
+ hash: {
18
+ type: StringConstructor;
19
+ default: string;
20
+ };
21
+ activeHash: {
22
+ type: StringConstructor;
23
+ default: string;
24
+ };
25
+ isDisabled: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ }>, {
30
+ isActive: typeof isActive;
31
+ computedId: typeof computedId;
32
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
33
+ "is-active": (...args: any[]) => void;
34
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
35
+ id: {
36
+ type: StringConstructor;
37
+ default: string;
38
+ };
39
+ name: {
40
+ type: StringConstructor;
41
+ required: true;
42
+ };
43
+ hash: {
44
+ type: StringConstructor;
45
+ default: string;
46
+ };
47
+ activeHash: {
48
+ type: StringConstructor;
49
+ default: string;
50
+ };
51
+ isDisabled: {
52
+ type: BooleanConstructor;
53
+ default: boolean;
54
+ };
55
+ }>> & Readonly<{
56
+ "onIs-active"?: ((...args: any[]) => any) | undefined;
57
+ }>, {
58
+ id: string;
59
+ hash: string;
60
+ activeHash: string;
61
+ isDisabled: boolean;
62
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
63
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
64
+ id: {
65
+ type: StringConstructor;
66
+ default: string;
67
+ };
68
+ name: {
69
+ type: StringConstructor;
70
+ required: true;
71
+ };
72
+ hash: {
73
+ type: StringConstructor;
74
+ default: string;
75
+ };
76
+ activeHash: {
77
+ type: StringConstructor;
78
+ default: string;
79
+ };
80
+ isDisabled: {
81
+ type: BooleanConstructor;
82
+ default: boolean;
83
+ };
84
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
85
+ "is-active": (...args: any[]) => void;
86
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
87
+ id: {
88
+ type: StringConstructor;
89
+ default: string;
90
+ };
91
+ name: {
92
+ type: StringConstructor;
93
+ required: true;
94
+ };
95
+ hash: {
96
+ type: StringConstructor;
97
+ default: string;
98
+ };
99
+ activeHash: {
100
+ type: StringConstructor;
101
+ default: string;
102
+ };
103
+ isDisabled: {
104
+ type: BooleanConstructor;
105
+ default: boolean;
106
+ };
107
+ }>> & Readonly<{
108
+ "onIs-active"?: ((...args: any[]) => any) | undefined;
109
+ }>, {
110
+ id: string;
111
+ hash: string;
112
+ activeHash: string;
113
+ isDisabled: boolean;
114
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
115
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
116
+ export default _default;
117
+ type __VLS_WithSlots<T, S> = T & {
118
+ new (): {
119
+ $slots: S;
120
+ };
121
+ };
@@ -0,0 +1,72 @@
1
+ import LktTab from "../components/LktTab.vue";
2
+ import { LktObject } from "lkt-vue-kernel";
3
+ type __VLS_Props = {
4
+ modelValue: string | number;
5
+ id?: string;
6
+ useSession?: boolean;
7
+ cacheLifetime?: number;
8
+ contentPad?: string;
9
+ titles?: LktObject;
10
+ };
11
+ declare const Value: import("vue").Ref<string, string>;
12
+ declare const classes: import("vue").ComputedRef<string>;
13
+ declare const contentStyles: import("vue").ComputedRef<string>;
14
+ declare const tabsSlots: import("vue").ComputedRef<string[]>;
15
+ declare const titlesSlots: import("vue").ComputedRef<string[]>;
16
+ declare const liSlots: import("vue").ComputedRef<string[]>;
17
+ declare const displayButtons: import("vue").ComputedRef<boolean>;
18
+ declare const getTabHref: (key?: string | number) => string;
19
+ declare const getTabTitle: (key?: string | number) => any;
20
+ declare const refresh: () => void;
21
+ declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
22
+ declare var __VLS_2: string, __VLS_3: {}, __VLS_6: string, __VLS_7: {}, __VLS_17: string, __VLS_18: {};
23
+ type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
24
+ [K in NonNullable<typeof __VLS_2>]?: (props: typeof __VLS_3) => any;
25
+ } & {
26
+ [K in NonNullable<typeof __VLS_6>]?: (props: typeof __VLS_7) => any;
27
+ } & {
28
+ [K in NonNullable<typeof __VLS_17>]?: (props: typeof __VLS_18) => any;
29
+ }>;
30
+ declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
31
+ LktTab: typeof LktTab;
32
+ Value: typeof Value;
33
+ classes: typeof classes;
34
+ contentStyles: typeof contentStyles;
35
+ tabsSlots: typeof tabsSlots;
36
+ titlesSlots: typeof titlesSlots;
37
+ liSlots: typeof liSlots;
38
+ displayButtons: typeof displayButtons;
39
+ getTabHref: typeof getTabHref;
40
+ getTabTitle: typeof getTabTitle;
41
+ refresh: typeof refresh;
42
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
43
+ "update:modelValue": (...args: any[]) => void;
44
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
45
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
46
+ }>, {
47
+ id: string;
48
+ modelValue: string | number;
49
+ useSession: boolean;
50
+ cacheLifetime: number;
51
+ contentPad: string;
52
+ titles: LktObject;
53
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
54
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
55
+ "update:modelValue": (...args: any[]) => void;
56
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
57
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
58
+ }>, {
59
+ id: string;
60
+ modelValue: string | number;
61
+ useSession: boolean;
62
+ cacheLifetime: number;
63
+ contentPad: string;
64
+ titles: LktObject;
65
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
66
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
67
+ export default _default;
68
+ type __VLS_WithSlots<T, S> = T & {
69
+ new (): {
70
+ $slots: S;
71
+ };
72
+ };
@@ -1,35 +1,35 @@
1
1
  declare namespace _default {
2
- const plugins: import("vite").Plugin[];
2
+ let plugins: import("vite").Plugin<import("@vitejs/plugin-vue").Api>[];
3
3
  namespace resolve {
4
- const alias: {
4
+ let alias: {
5
5
  '@': string;
6
6
  '@test': string;
7
7
  };
8
8
  }
9
9
  namespace build {
10
10
  export namespace lib {
11
- const entry: string;
12
- const name: string;
11
+ let entry: string;
12
+ let name: string;
13
13
  function fileName(format: any): string;
14
14
  }
15
15
  export { outDir };
16
- export const minify: boolean;
16
+ export let minify: boolean;
17
17
  export namespace rollupOptions {
18
- const external: string[];
18
+ let external: string[];
19
19
  namespace output {
20
- const globals: {
20
+ let globals: {
21
21
  vue: string;
22
22
  "lkt-tools": string;
23
23
  "lkt-events": string;
24
24
  "lkt-session": string;
25
25
  };
26
- const sourcemapExcludeSources: boolean;
26
+ let sourcemapExcludeSources: boolean;
27
27
  }
28
28
  }
29
29
  }
30
30
  namespace test {
31
31
  namespace coverage {
32
- const reporter: string[];
32
+ let reporter: string[];
33
33
  }
34
34
  function resolveSnapshotPath(testPath: any, snapExtension: any): string;
35
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-tabs",
3
- "version": "1.0.7",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "module": "src/index.ts",
@@ -15,7 +15,7 @@
15
15
  "import": "./dist/lkt-tabs.es.js",
16
16
  "require": "./dist/lkt-tabs.umd.js"
17
17
  },
18
- "./dist/style.css": "./dist/style.css",
18
+ "./dist/style.css": "./dist/lkt-tabs.css",
19
19
  "./theme": "./theme/default.css",
20
20
  "./theme/default": "./theme/default.css"
21
21
  },
@@ -29,19 +29,24 @@
29
29
  "test-coverage": "vitest run --coverage"
30
30
  },
31
31
  "author": "Antonio Ibáñez",
32
+ "engines": {
33
+ "node": ">=18"
34
+ },
32
35
  "devDependencies": {
33
- "@babel/types": "^7.18.9",
34
- "@types/node": "^18.0.6",
35
- "@vitejs/plugin-vue": "^3.0.1",
36
- "vue-tsc": "^0.38.9"
36
+ "@babel/types": "^7.23.6",
37
+ "@types/node": "^20.11.19",
38
+ "@types/rollup": "^0.54.0",
39
+ "@vitejs/plugin-vue": "^5.0.4",
40
+ "rollup": "^4.34.8",
41
+ "typescript": "^5.7.3",
42
+ "vite": "^6.1.1",
43
+ "vue": "^3.3.0",
44
+ "vue-tsc": "^2.2.0"
37
45
  },
38
- "dependencies": {
39
- "lkt-events": "^1.0.4",
46
+ "peerDependencies": {
40
47
  "lkt-session": "^1.0.6",
41
- "lkt-tools": "^1.0.10",
48
+ "lkt-string-tools": "^1.0.8",
49
+ "lkt-vue-kernel": "^1.0.32",
42
50
  "vue": "^3.0.5"
43
- },
44
- "engines": {
45
- "node": ">=12"
46
51
  }
47
52
  }
@@ -1,14 +1,6 @@
1
- <script lang="ts">
2
- export default {
3
- name: "LktTab",
4
- inheritAttrs: false,
5
- customOptions: {},
6
- };
7
- </script>
8
-
9
1
  <script lang="ts" setup>
10
2
  import {computed, ref, watch} from "vue";
11
- import {generateRandomString, isString} from "lkt-tools";
3
+ import {generateRandomString, isString} from "lkt-string-tools";
12
4
 
13
5
  const props = defineProps({
14
6
  id: {type: String, default: ''},
@@ -1,46 +1,41 @@
1
- <script lang="ts">
2
- import LktTab from "../components/LktTab.vue";
3
-
4
- export default {
5
- name: 'LktTabs',
6
- inheritAttrs: false,
7
- customOptions: {},
8
- components: {LktTab}
9
- };
10
- </script>
11
-
12
1
  <script lang="ts" setup>
13
- import {computed, getCurrentInstance, ref, watch} from 'vue';
14
- import {getSlots, ILktObject} from "lkt-tools";
2
+ import LktTab from "../components/LktTab.vue";
3
+ import {computed, getCurrentInstance, nextTick, ref, useSlots, watch} from 'vue';
15
4
  import {loadSelectedTabFromSession, setSelectedTabFromSession} from "../functions/functions";
5
+ import {LktObject} from "lkt-vue-kernel";
16
6
 
17
7
  const {ctx: _this}: any = getCurrentInstance();
18
8
 
19
- const props = defineProps({
20
- id: {type: String, default: ''},
21
- modelValue: {type: [String, Number], default: ''},
22
- useSession: {type: Boolean, default: false},
23
- cacheLifetime: {type: Number, default: 5,},
24
- contentPad: {type: String, default: undefined,},
25
- palette: {type: String, default: undefined,},
26
- titles: {
27
- type: Object,
28
- default() {
29
- return {};
30
- }
31
- },
9
+ const slots = useSlots();
10
+
11
+ const props = withDefaults(defineProps<{
12
+ modelValue: string|number
13
+ id?: string
14
+ useSession?: boolean
15
+ cacheLifetime?: number
16
+ contentPad?: string
17
+ titles?: LktObject
18
+ }>(), {
19
+ modelValue: '',
20
+ id: '',
21
+ useSession: false,
22
+ cacheLifetime: 5,
23
+ contentPad: '',
24
+ titles: () => ({}),
32
25
  });
33
26
 
34
- const emit = defineEmits(['update:modelValue'])
27
+ const emit = defineEmits([
28
+ 'update:modelValue'
29
+ ])
35
30
 
36
31
  const Value = ref('');
37
32
 
38
33
  if (props.useSession) {
39
- if (!_this.id) {
34
+ if (!props.id) {
40
35
  console.warn('[LKT Tabs] You\'re trying to use session provided tabs without the required id. Please, add id attr');
41
36
  }
42
37
 
43
- let sessionVal = loadSelectedTabFromSession(_this.id);
38
+ let sessionVal = loadSelectedTabFromSession(props.id);
44
39
  if (sessionVal) Value.value = sessionVal;
45
40
  }
46
41
 
@@ -52,7 +47,7 @@ watch(() => props.modelValue, (newVal, oldVal) => {
52
47
 
53
48
  watch(Value, (newVal, oldVal) => {
54
49
  emit('update:modelValue');
55
- _this.$nextTick(() => {
50
+ nextTick(() => {
56
51
  _this.$forceUpdate()
57
52
  });
58
53
  if (props.useSession) {
@@ -61,8 +56,7 @@ watch(Value, (newVal, oldVal) => {
61
56
  })
62
57
 
63
58
  const classes = computed(() => {
64
- let r = [];
65
- if (!!props.palette) r.push(`lkt-tabs--${props.palette}`);
59
+ let r: Array<string> = [];
66
60
  return r.join(' ');
67
61
  });
68
62
 
@@ -73,19 +67,25 @@ const contentStyles = computed(() => {
73
67
  });
74
68
 
75
69
  const tabsSlots = computed(() => {
76
- return getSlots(_this.$slots, 'tab-');
70
+ let r: string[] = [];
71
+ for (let k in slots) if (k.indexOf('tab-') !== -1) r.push(k);
72
+ return r;
77
73
  });
78
74
 
79
75
  const titlesSlots = computed(() => {
80
- return getSlots(_this.$slots, 'title-');
76
+ let r: string[] = [];
77
+ for (let k in slots) if (k.indexOf('title-') !== -1) r.push(k);
78
+ return r;
81
79
  });
82
80
 
83
81
  const liSlots = computed(() => {
84
- return getSlots(_this.$slots, 'li-');
82
+ let r: string[] = [];
83
+ for (let k in slots) if (k.indexOf('li-') !== -1) r.push(k);
84
+ return r;
85
85
  });
86
86
 
87
87
  const tabsHref = computed(() => {
88
- let r: ILktObject = {};
88
+ let r: LktObject = {};
89
89
  for (let k in _this.$refs) {
90
90
  r[k] = _this.$refs[k].hash;
91
91
  }
@@ -97,14 +97,14 @@ const displayButtons = computed(() => {
97
97
  return Object.keys(tabsSlots.value).length > 1;
98
98
  });
99
99
 
100
- const getTabHref = (key: string = '') => {
100
+ const getTabHref = (key: string|number = '') => {
101
101
  if (tabsHref.value.length > 0 && tabsHref.value[key]) {
102
102
  return '#' + tabsHref.value[key];
103
103
  }
104
104
  return '#';
105
105
  }
106
106
 
107
- const getTabTitle = (key: string = '') => {
107
+ const getTabTitle = (key: string|number = '') => {
108
108
  if (props.titles && props.titles[key]) return props.titles[key];
109
109
  return key;
110
110
  }
@@ -123,18 +123,18 @@ for (let k in tabsSlots.value) {
123
123
  <div class="lkt-tabs" v-bind:class="classes">
124
124
  <ul class="lkt-tabs__list" v-show="displayButtons">
125
125
  <li
126
- v-for="(_, key) in tabsSlots"
126
+ v-for="key in tabsSlots"
127
127
  v-bind:key="key"
128
128
  class="lkt-tab"
129
129
  v-bind:class="{'is-active': key === Value}"
130
130
  role="presentation"
131
131
  >
132
- <template v-if="!!titlesSlots[key]">
132
+ <template v-if="titlesSlots.includes(key)">
133
133
  <a v-bind:href="getTabHref(key)"
134
134
  v-on:click.prevent="Value = key"
135
135
  role="tab"
136
136
  >
137
- <slot v-bind:name="'title-' + key"></slot>
137
+ <slot v-bind:name="'title-' + key"/>
138
138
  </a>
139
139
  </template>
140
140
  <template v-else>
@@ -151,7 +151,7 @@ for (let k in tabsSlots.value) {
151
151
  </ul>
152
152
  <div class="lkt-tabs__content" v-bind:style="contentStyles">
153
153
  <lkt-tab
154
- v-for="(_, key) in tabsSlots"
154
+ v-for="key in tabsSlots"
155
155
  v-bind:ref="key"
156
156
  v-bind:hash="key"
157
157
  v-bind:id="key"
@@ -159,7 +159,7 @@ for (let k in tabsSlots.value) {
159
159
  v-bind:active-hash="Value"
160
160
  v-on:is-active="refresh"
161
161
  >
162
- <slot v-bind:name="'tab-' + key"></slot>
162
+ <slot v-bind:name="'tab-' + key"/>
163
163
  </lkt-tab>
164
164
  </div>
165
165
  </div>
@@ -1,155 +0,0 @@
1
- declare const _default: {
2
- new (...args: any[]): {
3
- $: import("vue").ComponentInternalInstance;
4
- $data: {};
5
- $props: Partial<{
6
- id: string;
7
- hash: string;
8
- activeHash: string;
9
- isDisabled: boolean;
10
- }> & Omit<Readonly<import("vue").ExtractPropTypes<{
11
- id: {
12
- type: StringConstructor;
13
- default: string;
14
- };
15
- name: {
16
- type: StringConstructor;
17
- required: true;
18
- };
19
- hash: {
20
- type: StringConstructor;
21
- default: string;
22
- };
23
- activeHash: {
24
- type: StringConstructor;
25
- default: string;
26
- };
27
- isDisabled: {
28
- type: BooleanConstructor;
29
- default: boolean;
30
- };
31
- }>> & {
32
- "onIs-active"?: ((...args: any[]) => any) | undefined;
33
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "id" | "hash" | "activeHash" | "isDisabled">;
34
- $attrs: {
35
- [x: string]: unknown;
36
- };
37
- $refs: {
38
- [x: string]: unknown;
39
- };
40
- $slots: Readonly<{
41
- [name: string]: import("vue").Slot | undefined;
42
- }>;
43
- $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
44
- $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
45
- $emit: (event: "is-active", ...args: any[]) => void;
46
- $el: any;
47
- $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
48
- id: {
49
- type: StringConstructor;
50
- default: string;
51
- };
52
- name: {
53
- type: StringConstructor;
54
- required: true;
55
- };
56
- hash: {
57
- type: StringConstructor;
58
- default: string;
59
- };
60
- activeHash: {
61
- type: StringConstructor;
62
- default: string;
63
- };
64
- isDisabled: {
65
- type: BooleanConstructor;
66
- default: boolean;
67
- };
68
- }>> & {
69
- "onIs-active"?: ((...args: any[]) => any) | undefined;
70
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "is-active"[], string, {
71
- id: string;
72
- hash: string;
73
- activeHash: string;
74
- isDisabled: boolean;
75
- }> & {
76
- beforeCreate?: ((() => void) | (() => void)[]) | undefined;
77
- created?: ((() => void) | (() => void)[]) | undefined;
78
- beforeMount?: ((() => void) | (() => void)[]) | undefined;
79
- mounted?: ((() => void) | (() => void)[]) | undefined;
80
- beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
81
- updated?: ((() => void) | (() => void)[]) | undefined;
82
- activated?: ((() => void) | (() => void)[]) | undefined;
83
- deactivated?: ((() => void) | (() => void)[]) | undefined;
84
- beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
85
- beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
86
- destroyed?: ((() => void) | (() => void)[]) | undefined;
87
- unmounted?: ((() => void) | (() => void)[]) | undefined;
88
- renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
89
- renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
90
- errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
91
- };
92
- $forceUpdate: () => void;
93
- $nextTick: typeof import("vue").nextTick;
94
- $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
95
- } & Readonly<import("vue").ExtractPropTypes<{
96
- id: {
97
- type: StringConstructor;
98
- default: string;
99
- };
100
- name: {
101
- type: StringConstructor;
102
- required: true;
103
- };
104
- hash: {
105
- type: StringConstructor;
106
- default: string;
107
- };
108
- activeHash: {
109
- type: StringConstructor;
110
- default: string;
111
- };
112
- isDisabled: {
113
- type: BooleanConstructor;
114
- default: boolean;
115
- };
116
- }>> & {
117
- "onIs-active"?: ((...args: any[]) => any) | undefined;
118
- } & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
119
- __isFragment?: undefined;
120
- __isTeleport?: undefined;
121
- __isSuspense?: undefined;
122
- } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
123
- id: {
124
- type: StringConstructor;
125
- default: string;
126
- };
127
- name: {
128
- type: StringConstructor;
129
- required: true;
130
- };
131
- hash: {
132
- type: StringConstructor;
133
- default: string;
134
- };
135
- activeHash: {
136
- type: StringConstructor;
137
- default: string;
138
- };
139
- isDisabled: {
140
- type: BooleanConstructor;
141
- default: boolean;
142
- };
143
- }>> & {
144
- "onIs-active"?: ((...args: any[]) => any) | undefined;
145
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "is-active"[], "is-active", {
146
- id: string;
147
- hash: string;
148
- activeHash: string;
149
- isDisabled: boolean;
150
- }> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
151
- $slots: {
152
- default: (_: {}) => any;
153
- };
154
- });
155
- export default _default;
@@ -1,194 +0,0 @@
1
- declare const _default: {
2
- new (...args: any[]): {
3
- $: import("vue").ComponentInternalInstance;
4
- $data: {};
5
- $props: Partial<{
6
- id: string;
7
- modelValue: string | number;
8
- useSession: boolean;
9
- cacheLifetime: number;
10
- contentPad: string;
11
- palette: string;
12
- titles: Record<string, any>;
13
- }> & Omit<Readonly<import("vue").ExtractPropTypes<{
14
- id: {
15
- type: StringConstructor;
16
- default: string;
17
- };
18
- modelValue: {
19
- type: (StringConstructor | NumberConstructor)[];
20
- default: string;
21
- };
22
- useSession: {
23
- type: BooleanConstructor;
24
- default: boolean;
25
- };
26
- cacheLifetime: {
27
- type: NumberConstructor;
28
- default: number;
29
- };
30
- contentPad: {
31
- type: StringConstructor;
32
- default: undefined;
33
- };
34
- palette: {
35
- type: StringConstructor;
36
- default: undefined;
37
- };
38
- titles: {
39
- type: ObjectConstructor;
40
- default(): {};
41
- };
42
- }>> & {
43
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
44
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "id" | "modelValue" | "useSession" | "cacheLifetime" | "contentPad" | "palette" | "titles">;
45
- $attrs: {
46
- [x: string]: unknown;
47
- };
48
- $refs: {
49
- [x: string]: unknown;
50
- };
51
- $slots: Readonly<{
52
- [name: string]: import("vue").Slot | undefined;
53
- }>;
54
- $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
55
- $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
56
- $emit: (event: "update:modelValue", ...args: any[]) => void;
57
- $el: any;
58
- $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
59
- id: {
60
- type: StringConstructor;
61
- default: string;
62
- };
63
- modelValue: {
64
- type: (StringConstructor | NumberConstructor)[];
65
- default: string;
66
- };
67
- useSession: {
68
- type: BooleanConstructor;
69
- default: boolean;
70
- };
71
- cacheLifetime: {
72
- type: NumberConstructor;
73
- default: number;
74
- };
75
- contentPad: {
76
- type: StringConstructor;
77
- default: undefined;
78
- };
79
- palette: {
80
- type: StringConstructor;
81
- default: undefined;
82
- };
83
- titles: {
84
- type: ObjectConstructor;
85
- default(): {};
86
- };
87
- }>> & {
88
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
89
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], string, {
90
- id: string;
91
- modelValue: string | number;
92
- useSession: boolean;
93
- cacheLifetime: number;
94
- contentPad: string;
95
- palette: string;
96
- titles: Record<string, any>;
97
- }> & {
98
- beforeCreate?: ((() => void) | (() => void)[]) | undefined;
99
- created?: ((() => void) | (() => void)[]) | undefined;
100
- beforeMount?: ((() => void) | (() => void)[]) | undefined;
101
- mounted?: ((() => void) | (() => void)[]) | undefined;
102
- beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
103
- updated?: ((() => void) | (() => void)[]) | undefined;
104
- activated?: ((() => void) | (() => void)[]) | undefined;
105
- deactivated?: ((() => void) | (() => void)[]) | undefined;
106
- beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
107
- beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
108
- destroyed?: ((() => void) | (() => void)[]) | undefined;
109
- unmounted?: ((() => void) | (() => void)[]) | undefined;
110
- renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
111
- renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
112
- errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
113
- };
114
- $forceUpdate: () => void;
115
- $nextTick: typeof import("vue").nextTick;
116
- $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
117
- } & Readonly<import("vue").ExtractPropTypes<{
118
- id: {
119
- type: StringConstructor;
120
- default: string;
121
- };
122
- modelValue: {
123
- type: (StringConstructor | NumberConstructor)[];
124
- default: string;
125
- };
126
- useSession: {
127
- type: BooleanConstructor;
128
- default: boolean;
129
- };
130
- cacheLifetime: {
131
- type: NumberConstructor;
132
- default: number;
133
- };
134
- contentPad: {
135
- type: StringConstructor;
136
- default: undefined;
137
- };
138
- palette: {
139
- type: StringConstructor;
140
- default: undefined;
141
- };
142
- titles: {
143
- type: ObjectConstructor;
144
- default(): {};
145
- };
146
- }>> & {
147
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
148
- } & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
149
- __isFragment?: undefined;
150
- __isTeleport?: undefined;
151
- __isSuspense?: undefined;
152
- } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
153
- id: {
154
- type: StringConstructor;
155
- default: string;
156
- };
157
- modelValue: {
158
- type: (StringConstructor | NumberConstructor)[];
159
- default: string;
160
- };
161
- useSession: {
162
- type: BooleanConstructor;
163
- default: boolean;
164
- };
165
- cacheLifetime: {
166
- type: NumberConstructor;
167
- default: number;
168
- };
169
- contentPad: {
170
- type: StringConstructor;
171
- default: undefined;
172
- };
173
- palette: {
174
- type: StringConstructor;
175
- default: undefined;
176
- };
177
- titles: {
178
- type: ObjectConstructor;
179
- default(): {};
180
- };
181
- }>> & {
182
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
183
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", {
184
- id: string;
185
- modelValue: string | number;
186
- useSession: boolean;
187
- cacheLifetime: number;
188
- contentPad: string;
189
- palette: string;
190
- titles: Record<string, any>;
191
- }> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
192
- $slots: Record<string, {}> & Record<string, {}> & Record<string, {}>;
193
- });
194
- export default _default;
File without changes
File without changes
File without changes
File without changes