@todovue/tv-demo 1.3.2 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/TvPreviewFrame-B88YHYHU.js +151 -0
- package/dist/TvPreviewFrame-COIIvDUA.cjs +9 -0
- package/dist/tv-demo.cjs.js +1 -1
- package/dist/tv-demo.css +1 -1
- package/dist/tv-demo.es.js +827 -541
- package/package.json +1 -1
- package/dist/TvPreviewFrame-DrvEF6dP.js +0 -134
- package/dist/TvPreviewFrame-wX7qsqM6.cjs +0 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { ref as E, onMounted as C, onBeforeUnmount as I, watch as S, createElementBlock as B, openBlock as O, normalizeStyle as _, createElementVNode as T, createApp as g, h, nextTick as v } from "vue";
|
|
2
|
+
import { _ as P } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const z = ["title"], A = {
|
|
4
|
+
__name: "TvPreviewFrame",
|
|
5
|
+
props: {
|
|
6
|
+
component: {
|
|
7
|
+
type: [Object, Function],
|
|
8
|
+
required: !0
|
|
9
|
+
},
|
|
10
|
+
componentProps: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default: () => ({})
|
|
13
|
+
},
|
|
14
|
+
title: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "Component Preview"
|
|
17
|
+
},
|
|
18
|
+
viewportWidth: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "100%"
|
|
21
|
+
},
|
|
22
|
+
bodyClass: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ""
|
|
25
|
+
},
|
|
26
|
+
bodyStyle: {
|
|
27
|
+
type: Object,
|
|
28
|
+
default: () => ({})
|
|
29
|
+
},
|
|
30
|
+
isRtl: Boolean,
|
|
31
|
+
backgroundType: { type: String, default: "default" },
|
|
32
|
+
isGrid: Boolean
|
|
33
|
+
},
|
|
34
|
+
emits: [],
|
|
35
|
+
setup(c, { emit: R }) {
|
|
36
|
+
const r = c, l = E(null);
|
|
37
|
+
let o = null, i = null, a = null;
|
|
38
|
+
const y = (e, n) => {
|
|
39
|
+
if (e.tagName === "LINK" && (e.rel === "stylesheet" || e.href.includes(".css"))) {
|
|
40
|
+
const t = n.createElement("link");
|
|
41
|
+
return t.rel = "stylesheet", t.href = e.href, t;
|
|
42
|
+
}
|
|
43
|
+
if (e.tagName === "STYLE") {
|
|
44
|
+
const t = n.createElement("style");
|
|
45
|
+
return t.textContent = e.textContent, new MutationObserver(() => {
|
|
46
|
+
t.textContent = e.textContent;
|
|
47
|
+
}).observe(e, { characterData: !0, childList: !0 }), t;
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}, x = (e) => {
|
|
51
|
+
a && a.disconnect(), Array.from(document.querySelectorAll('link[rel="stylesheet"], link[href*=".css"], style')).forEach((t) => {
|
|
52
|
+
const s = y(t, e);
|
|
53
|
+
s && e.head.appendChild(s);
|
|
54
|
+
}), a = new MutationObserver((t) => {
|
|
55
|
+
t.forEach((s) => {
|
|
56
|
+
s.addedNodes.forEach((w) => {
|
|
57
|
+
const m = y(w, e);
|
|
58
|
+
m && e.head.appendChild(m);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}), a.observe(document.head, { childList: !0, subtree: !1 });
|
|
62
|
+
}, u = (e) => {
|
|
63
|
+
if (!e || !e.body) return;
|
|
64
|
+
e.body.className = r.bodyClass, Object.assign(e.body.style, r.bodyStyle), e.body.style.margin = "0", e.body.style.display = "flex", e.body.style.flexDirection = "column", e.body.style.alignItems = "center", e.body.style.boxSizing = "border-box", e.body.style.padding = "0", e.body.dir = r.isRtl ? "rtl" : "ltr", e.body.style.backgroundImage = "", e.body.style.backgroundColor = "", r.backgroundType === "checkered" ? (e.body.style.backgroundImage = `
|
|
65
|
+
linear-gradient(45deg, #ccc 25%, transparent 25%),
|
|
66
|
+
linear-gradient(-45deg, #ccc 25%, transparent 25%),
|
|
67
|
+
linear-gradient(45deg, transparent 75%, #ccc 75%),
|
|
68
|
+
linear-gradient(-45deg, transparent 75%, #ccc 75%)
|
|
69
|
+
`, e.body.style.backgroundSize = "20px 20px", e.body.style.backgroundPosition = "0 0, 0 10px, 10px -10px, -10px 0px", e.body.style.backgroundColor = "#fff") : r.backgroundType === "white" ? e.body.style.backgroundColor = "#ffffff" : r.backgroundType === "dark" && (e.body.style.backgroundColor = "#1a1a1a");
|
|
70
|
+
const n = e.getElementById("tv-preview-grid-overlay");
|
|
71
|
+
if (n && n.remove(), r.isGrid) {
|
|
72
|
+
const t = e.createElement("div");
|
|
73
|
+
t.id = "tv-preview-grid-overlay", t.style.position = "fixed", t.style.top = "0", t.style.left = "0", t.style.width = "100vw", t.style.height = "100vh", t.style.pointerEvents = "none", t.style.zIndex = "9999", t.style.backgroundImage = `
|
|
74
|
+
linear-gradient(to right, rgba(255, 0, 0, 0.1) 1px, transparent 1px),
|
|
75
|
+
linear-gradient(to bottom, rgba(255, 0, 0, 0.1) 1px, transparent 1px)
|
|
76
|
+
`, t.style.backgroundSize = "8px 8px", e.body.appendChild(t);
|
|
77
|
+
}
|
|
78
|
+
}, f = (e) => {
|
|
79
|
+
if (!e) return;
|
|
80
|
+
const n = e.getElementById("app");
|
|
81
|
+
n && (n.style.display = "flex", n.style.justifyContent = "center", n.style.width = "100%");
|
|
82
|
+
}, d = () => {
|
|
83
|
+
if (!l.value) return;
|
|
84
|
+
const e = l.value.contentDocument;
|
|
85
|
+
if (!e || !e.body) return;
|
|
86
|
+
const n = e.getElementById("app");
|
|
87
|
+
let t = 0;
|
|
88
|
+
n && (t = n.getBoundingClientRect().height);
|
|
89
|
+
const s = t + 40;
|
|
90
|
+
l.value.style.height = `${s + 50}px`;
|
|
91
|
+
}, b = (e) => {
|
|
92
|
+
if (i && i.disconnect(), i = new ResizeObserver(() => {
|
|
93
|
+
d();
|
|
94
|
+
}), e.body) {
|
|
95
|
+
i.observe(e.body);
|
|
96
|
+
const n = e.getElementById("app");
|
|
97
|
+
n && i.observe(n);
|
|
98
|
+
}
|
|
99
|
+
}, p = () => {
|
|
100
|
+
if (!l.value) return;
|
|
101
|
+
const e = l.value.contentDocument || l.value.contentWindow.document;
|
|
102
|
+
e.open(), e.write('<!DOCTYPE html><html><head></head><body><div id="app"></div></body></html>'), e.close(), x(e), u(e), f(e);
|
|
103
|
+
const n = e.getElementById("app");
|
|
104
|
+
o && o.unmount(), o = g({
|
|
105
|
+
render() {
|
|
106
|
+
return h(r.component, r.componentProps);
|
|
107
|
+
}
|
|
108
|
+
}), o.mount(n), v(() => {
|
|
109
|
+
b(e), d();
|
|
110
|
+
});
|
|
111
|
+
}, k = () => {
|
|
112
|
+
if (!l.value) return;
|
|
113
|
+
const e = l.value.contentDocument;
|
|
114
|
+
if (!e) return;
|
|
115
|
+
u(e), f(e);
|
|
116
|
+
let n = e.getElementById("app");
|
|
117
|
+
if (!n) {
|
|
118
|
+
p();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
o && o.unmount(), o = g({
|
|
122
|
+
render() {
|
|
123
|
+
return h(r.component, r.componentProps);
|
|
124
|
+
}
|
|
125
|
+
}), o.mount(n), v(() => {
|
|
126
|
+
b(e), d();
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
return C(() => {
|
|
130
|
+
p();
|
|
131
|
+
}), I(() => {
|
|
132
|
+
o && o.unmount(), i && i.disconnect(), a && a.disconnect();
|
|
133
|
+
}), S(() => [r.component, r.componentProps, r.viewportWidth, r.bodyClass, r.bodyStyle, r.isRtl, r.backgroundType, r.isGrid], () => {
|
|
134
|
+
k();
|
|
135
|
+
}, { deep: !0 }), (e, n) => (O(), B("div", {
|
|
136
|
+
class: "tv-preview-frame-container",
|
|
137
|
+
style: _({ width: c.viewportWidth })
|
|
138
|
+
}, [
|
|
139
|
+
T("iframe", {
|
|
140
|
+
ref_key: "iframeRef",
|
|
141
|
+
ref: l,
|
|
142
|
+
title: c.title,
|
|
143
|
+
class: "tv-preview-frame",
|
|
144
|
+
onLoad: p
|
|
145
|
+
}, null, 40, z)
|
|
146
|
+
], 4));
|
|
147
|
+
}
|
|
148
|
+
}, L = /* @__PURE__ */ P(A, [["__scopeId", "data-v-a46ef617"]]);
|
|
149
|
+
export {
|
|
150
|
+
L as default
|
|
151
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),k=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),w=["title"],E={__name:"TvPreviewFrame",props:{component:{type:[Object,Function],required:!0},componentProps:{type:Object,default:()=>({})},title:{type:String,default:"Component Preview"},viewportWidth:{type:String,default:"100%"},bodyClass:{type:String,default:""},bodyStyle:{type:Object,default:()=>({})},isRtl:Boolean,backgroundType:{type:String,default:"default"},isGrid:Boolean},emits:[],setup(d,{emit:S}){const r=d,i=o.ref(null);let l=null,s=null,c=null;const u=(e,n)=>{if(e.tagName==="LINK"&&(e.rel==="stylesheet"||e.href.includes(".css"))){const t=n.createElement("link");return t.rel="stylesheet",t.href=e.href,t}if(e.tagName==="STYLE"){const t=n.createElement("style");return t.textContent=e.textContent,new MutationObserver(()=>{t.textContent=e.textContent}).observe(e,{characterData:!0,childList:!0}),t}return null},v=e=>{c&&c.disconnect(),Array.from(document.querySelectorAll('link[rel="stylesheet"], link[href*=".css"], style')).forEach(t=>{const a=u(t,e);a&&e.head.appendChild(a)}),c=new MutationObserver(t=>{t.forEach(a=>{a.addedNodes.forEach(x=>{const m=u(x,e);m&&e.head.appendChild(m)})})}),c.observe(document.head,{childList:!0,subtree:!1})},f=e=>{if(!e||!e.body)return;e.body.className=r.bodyClass,Object.assign(e.body.style,r.bodyStyle),e.body.style.margin="0",e.body.style.display="flex",e.body.style.flexDirection="column",e.body.style.alignItems="center",e.body.style.boxSizing="border-box",e.body.style.padding="0",e.body.dir=r.isRtl?"rtl":"ltr",e.body.style.backgroundImage="",e.body.style.backgroundColor="",r.backgroundType==="checkered"?(e.body.style.backgroundImage=`
|
|
2
|
+
linear-gradient(45deg, #ccc 25%, transparent 25%),
|
|
3
|
+
linear-gradient(-45deg, #ccc 25%, transparent 25%),
|
|
4
|
+
linear-gradient(45deg, transparent 75%, #ccc 75%),
|
|
5
|
+
linear-gradient(-45deg, transparent 75%, #ccc 75%)
|
|
6
|
+
`,e.body.style.backgroundSize="20px 20px",e.body.style.backgroundPosition="0 0, 0 10px, 10px -10px, -10px 0px",e.body.style.backgroundColor="#fff"):r.backgroundType==="white"?e.body.style.backgroundColor="#ffffff":r.backgroundType==="dark"&&(e.body.style.backgroundColor="#1a1a1a");const n=e.getElementById("tv-preview-grid-overlay");if(n&&n.remove(),r.isGrid){const t=e.createElement("div");t.id="tv-preview-grid-overlay",t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.width="100vw",t.style.height="100vh",t.style.pointerEvents="none",t.style.zIndex="9999",t.style.backgroundImage=`
|
|
7
|
+
linear-gradient(to right, rgba(255, 0, 0, 0.1) 1px, transparent 1px),
|
|
8
|
+
linear-gradient(to bottom, rgba(255, 0, 0, 0.1) 1px, transparent 1px)
|
|
9
|
+
`,t.style.backgroundSize="8px 8px",e.body.appendChild(t)}},b=e=>{if(!e)return;const n=e.getElementById("app");n&&(n.style.display="flex",n.style.justifyContent="center",n.style.width="100%")},p=()=>{if(!i.value)return;const e=i.value.contentDocument;if(!e||!e.body)return;const n=e.getElementById("app");let t=0;n&&(t=n.getBoundingClientRect().height);const a=t+40;i.value.style.height=`${a+50}px`},g=e=>{if(s&&s.disconnect(),s=new ResizeObserver(()=>{p()}),e.body){s.observe(e.body);const n=e.getElementById("app");n&&s.observe(n)}},y=()=>{if(!i.value)return;const e=i.value.contentDocument||i.value.contentWindow.document;e.open(),e.write('<!DOCTYPE html><html><head></head><body><div id="app"></div></body></html>'),e.close(),v(e),f(e),b(e);const n=e.getElementById("app");l&&l.unmount(),l=o.createApp({render(){return o.h(r.component,r.componentProps)}}),l.mount(n),o.nextTick(()=>{g(e),p()})},h=()=>{if(!i.value)return;const e=i.value.contentDocument;if(!e)return;f(e),b(e);let n=e.getElementById("app");if(!n){y();return}l&&l.unmount(),l=o.createApp({render(){return o.h(r.component,r.componentProps)}}),l.mount(n),o.nextTick(()=>{g(e),p()})};return o.onMounted(()=>{y()}),o.onBeforeUnmount(()=>{l&&l.unmount(),s&&s.disconnect(),c&&c.disconnect()}),o.watch(()=>[r.component,r.componentProps,r.viewportWidth,r.bodyClass,r.bodyStyle,r.isRtl,r.backgroundType,r.isGrid],()=>{h()},{deep:!0}),(e,n)=>(o.openBlock(),o.createElementBlock("div",{class:"tv-preview-frame-container",style:o.normalizeStyle({width:d.viewportWidth})},[o.createElementVNode("iframe",{ref_key:"iframeRef",ref:i,title:d.title,class:"tv-preview-frame",onLoad:y},null,40,w)],4))}},C=k._export_sfc(E,[["__scopeId","data-v-a46ef617"]]);exports.default=C;
|
package/dist/tv-demo.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),ce=require("vue-highlight-code"),te=require("vue3-markdown-it"),M=72,oe=6,ie=(a,b)=>a?.id??a?.title??`variant-${b}`,de=(a={})=>`${a.title??""} ${a.description??""}`.toLowerCase(),me=a=>{const b=e.ref("dark"),$=e.ref([]),_=e.ref(""),I=e.ref(""),m=e.ref("demo"),h=e.ref(""),s=e.ref(null),E=e.ref(null),P=e.ref(360),U=e.ref("100%"),L=e.ref(0);let c=null,f=!1;const p=e.computed(()=>(a.variants||[]).map((t,l)=>({variant:t,index:l,key:ie(t,l),searchableText:de(t)}))),Q=e.computed(()=>p.value.length),i=e.computed(()=>{const t=h.value.trim().toLowerCase();return t?p.value.filter(l=>l.searchableText.includes(t)):p.value}),F=e.computed(()=>i.value.length),H=e.computed(()=>!!h.value.trim()&&i.value.length===0),z=()=>{P.value=E.value?.clientHeight||P.value},j=()=>{f&&(window.removeEventListener("resize",z),f=!1)};e.watch(()=>E.value,t=>{if(c&&(c.disconnect(),c=null),!t){j();return}e.nextTick(()=>{z(),typeof ResizeObserver<"u"?(c=new ResizeObserver(l=>{const d=l?.[0];d&&(P.value=d.contentRect.height)}),c.observe(t)):f||(window.addEventListener("resize",z),f=!0)})});const K=e.ref(!1);let v=null;const S=()=>{if(typeof window>"u")return;const t=new URL(window.location.href);m.value&&m.value!=="demo"?t.searchParams.set("tab",m.value):t.searchParams.delete("tab"),h.value?t.searchParams.set("search",h.value):t.searchParams.delete("search"),s.value?t.searchParams.set("variant",s.value):t.searchParams.delete("variant"),t.href!==window.location.href&&window.history.replaceState(window.history.state,"",t.href)};e.watch([m,h,s],()=>{K.value&&(clearTimeout(v),v=setTimeout(S,300))}),e.onMounted(()=>{const t=localStorage.getItem("theme");if(t&&(b.value=t),typeof window<"u"){const l=new URLSearchParams(window.location.search),d=l.get("tab");d&&(m.value=d);const B=l.get("search");B&&(h.value=B);const Z=l.get("variant");if(Z){const ee=p.value.find(re=>String(re.key)===Z);s.value=ee?ee.key:Z}K.value=!0}e.nextTick(z)}),e.onBeforeUnmount(()=>{c&&(c.disconnect(),c=null),j()});const Y=async()=>{try{const t=await fetch(a.readmePath);if(!t.ok)throw new Error("README.md not found");_.value=await t.text()}catch{_.value="Documentation not found."}},q=async()=>{try{const t=await fetch(a.changelogPath);if(!t.ok)throw new Error("CHANGELOG.md not found");I.value=await t.text()}catch{I.value="Changelog not found."}},G=()=>{b.value=b.value==="dark"?"light":"dark",localStorage.setItem("theme",b.value)};e.watch(()=>p.value,t=>{if(!t.length){s.value=null;return}t.some(l=>l.key===s.value)||(s.value=t[0].key)},{immediate:!0}),e.watch(()=>i.value,t=>{if(!t.length){s.value=null;return}t.some(l=>l.key===s.value)||(s.value=t[0].key)});const O=t=>{E.value&&(E.value.scrollTop=t,L.value=t)};e.watch(h,()=>{O(0)});const D=e.computed(()=>i.value.findIndex(t=>t.key===s.value)),u=e.computed(()=>Math.max(1,Math.ceil(P.value/M))),V=e.computed(()=>Math.max(0,Math.floor(L.value/M)-oe)),A=e.computed(()=>Math.min(i.value.length,V.value+u.value+oe*2)),W=e.computed(()=>i.value.slice(V.value,A.value)),w=e.computed(()=>V.value*M),k=e.computed(()=>Math.max(0,(i.value.length-A.value)*M)),J=()=>{if(!E.value)return;const t=D.value;if(t<0)return;const l=V.value+2,d=A.value-3;if(t<l)O(Math.max(0,t*M));else if(t>d){const B=Math.max(0,t-u.value+1);O(B*M)}};e.watch(s,J);const T=e.computed(()=>H.value?{}:(i.value.find(l=>l.key===s.value)||p.value.find(l=>l.key===s.value)||i.value[0]||p.value[0])?.variant||{}),y=e.ref({});e.watch(()=>T.value,t=>{if(t?.propsData)try{y.value=JSON.parse(JSON.stringify(t.propsData))}catch{y.value={...t.propsData}}else y.value={}},{immediate:!0});const N=e.ref([]),X=(t,l)=>{const d=new Date().toLocaleTimeString();N.value.unshift({id:Date.now()+Math.random(),timestamp:d,eventName:t,payload:l}),N.value.length>50&&(N.value=N.value.slice(0,50))},C=(t=!0)=>{N.value=[],t&&x("Event logs cleared","success",2e3)};e.watch(s,()=>{C(!1)});const o=t=>{L.value=t.target.scrollTop},n=t=>{const l=i.value;if(!l.length)return;const d=D.value<0?0:D.value,B=Math.min(l.length-1,Math.max(0,d+t));s.value=l[B].key},r=t=>{switch(t.key){case"ArrowDown":t.preventDefault(),n(1);break;case"ArrowUp":t.preventDefault(),n(-1);break;case"Home":t.preventDefault(),i.value.length&&(s.value=i.value[0].key);break;case"End":t.preventDefault(),i.value.length&&(s.value=i.value[i.value.length-1].key);break}},g=t=>{s.value=t},ne=e.computed(()=>{const t=b.value==="dark"?a.demoStyle?.dark:a.demoStyle?.light;return{body:{backgroundColor:t?.backgroundBody||"",color:t?.color||""},content:{backgroundColor:t?.backgroundContent||"",color:t?.color||""}}}),ae=t=>{let l="";t==="npm"?l=`npm install ${a.isDevComponent?"-D ":""}${a.npmInstall}`:l=`git clone ${a.urlClone}`,navigator.clipboard.writeText(l).then(()=>{x(`Copied to clipboard: ${l}`,"success",2e3)}).catch(d=>{x(`Failed to copy: ${d}`,"error",2e3)})},x=(t,l="success",d=3e3)=>{const B=`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;$.value.push({id:B,message:t,type:l,duration:d})},le=t=>{const l=$.value.findIndex(d=>d.id===t);l>-1&&$.value.splice(l,1)};e.watchEffect(async()=>{await Y(),await q()});const se=e.ref("playground");return{customStyle:ne,toasts:$,readmeContent:_,changelogContent:I,selectedTab:m,searchQuery:h,selectedVariantKey:s,totalVariantsCount:Q,filteredVariantsCount:F,variantsListRef:E,virtualizedVariants:W,virtualPaddingTop:w,virtualPaddingBottom:k,emptySearchState:H,theme:b,variant:T,addToast:x,removeToast:le,selectVariant:g,setClickItem:ae,toggleTheme:G,handleVariantsScroll:o,handleVariantsKeydown:r,reactiveProps:y,eventLogs:N,addLog:X,clearLogs:C,viewportWidth:U,activeToolTab:se,resetProps:()=>{if(T.value?.propsData)try{y.value=JSON.parse(JSON.stringify(T.value.propsData))}catch{y.value={...T.value.propsData}}else y.value={};x("Props reset to default","success",2e3)},copyCode:t=>{navigator.clipboard.writeText(t).then(()=>{x("Code copied to clipboard","success",2e3)}).catch(l=>{x(`Failed to copy: ${l}`,"error",2e3)})}}},ue={key:0,class:"tv-demo-back-row"},ve={class:"tv-demo-case"},fe={class:"tv-demo-header"},pe={class:"tv-demo-links"},he=["href"],ke={key:1},ye={key:3},ge={class:"tv-demo-theme"},be={class:"switch"},Ee=["checked"],Ve={class:"tv-demo-tools main-tabs"},we={class:"tv-demo-tools-tabs"},Ne={class:"tv-demo-tools-content main-content"},Ce={class:"tv-demo-layout"},Be={class:"tv-demo-sidebar-header"},Se={class:"tv-demo-sidebar-meta"},De=["aria-activedescendant"],Te=["id","aria-selected","onClick"],xe={class:"tv-demo-variant-card-content"},$e={class:"tv-demo-variant-card-title"},Pe={class:"tv-demo-variant-card-description"},Le={key:1,class:"tv-demo-empty-state"},ze={class:"tv-demo-content","aria-live":"polite"},Me={class:"tv-demo-content-header"},_e={class:"tv-demo-viewport-controls"},Ie={class:"tv-demo-description"},Oe={key:1,class:"tv-demo-empty-component"},Ae={class:"tv-demo-tools"},Re={class:"tv-demo-tools-tabs"},Ue={key:0,class:"tv-demo-badge"},Fe={class:"tv-demo-tools-content"},He={class:"tv-demo-tool-pane"},je={class:"tv-demo-toolbar"},Ke={key:0,class:"tv-demo-controls-grid"},qe=["title"],Ge={class:"tv-demo-control-input-wrapper"},We={key:0,class:"switch small"},Je=["onUpdate:modelValue","id"],Qe=["onUpdate:modelValue","id"],Ye=["onUpdate:modelValue","id"],Xe={key:1,class:"tv-demo-empty-state small"},Ze={class:"tv-demo-tool-pane"},et={class:"tv-demo-toolbar"},tt={class:"tv-demo-logs-container"},ot={key:0,class:"tv-demo-logs-empty"},nt={class:"tv-demo-log-time"},at={class:"tv-demo-log-name"},lt={key:0,class:"tv-demo-log-payload"},st={class:"tv-demo-tool-pane"},rt={class:"tv-demo-toolbar"},ct={key:0},it={key:0,class:"markdown-body"},dt={key:1},mt={key:1},ut={key:0,class:"markdown-body"},vt={key:1},ft={class:"tv-demo-footer-content"},pt={class:"tv-demo-footer-main"},ht={class:"tv-demo-footer-brand"},kt={class:"tv-demo-footer-brand-text"},yt={class:"tv-demo-footer-brand-version"},gt={class:"tv-demo-footer-bottom"},bt={class:"tv-demo-footer-copyright"},R={__name:"TvDemo",props:{demoStyle:{type:Object,default:()=>({body:{},content:{}})},hideBackground:Boolean,component:Object,variants:Array,componentName:{type:String,default:"Component Demo"},sourceLink:{type:String,default:null},urlClone:{type:String,default:null},npmInstall:{type:String,default:null},isDevComponent:{type:Boolean,default:!1},version:{type:String,default:"0.0.0"},readmePath:{type:String,default:"./README.md"},changelogPath:{type:String,default:"./CHANGELOG.md"},showDocumentation:{type:Boolean,default:!0},showChangelog:{type:Boolean,default:!0},manualEmits:{type:Array,default:()=>[]}},setup(a){const b=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./ToastContainer-B-rxasZF.cjs"))),$=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./ToUp-CJUZN3du.cjs"))),_=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./TvPreviewFrame-wX7qsqM6.cjs"))),I=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./TvNestedEditor-C6zgg9gF.cjs"))),m=a,h=e.ref(!1),s=()=>{typeof window>"u"||window.history.back()};e.onMounted(()=>{const C=window.history.length>1,o=typeof document<"u"&&!!document.referrer;h.value=C||o});const{customStyle:E,toasts:P,readmeContent:U,changelogContent:L,selectedTab:c,searchQuery:f,selectedVariantKey:p,totalVariantsCount:Q,filteredVariantsCount:i,variantsListRef:F,virtualizedVariants:H,virtualPaddingTop:z,virtualPaddingBottom:j,emptySearchState:K,theme:v,variant:S,removeToast:Y,setClickItem:q,toggleTheme:G,selectVariant:O,handleVariantsKeydown:D,reactiveProps:u,eventLogs:V,addLog:A,clearLogs:W,viewportWidth:w,activeToolTab:k,resetProps:J,copyCode:T}=me(m),y=e.ref(typeof window<"u"?window.innerWidth:1200),N=()=>{y.value=window.innerWidth};e.onMounted(()=>{typeof window<"u"&&window.addEventListener("resize",N)}),e.onBeforeUnmount(()=>{typeof window<"u"&&window.removeEventListener("resize",N)});const X=e.computed(()=>{const C={},o=m.component&&m.component.emits?Array.isArray(m.component.emits)?m.component.emits:Object.keys(m.component.emits):[],n=[...new Set([...o,...m.manualEmits])];return n.length>0&&n.forEach(r=>{C[`on${r.charAt(0).toUpperCase()+r.slice(1)}`]=g=>{A(r,g)}}),C});return(C,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(v)}-mode tv-demo`),style:e.normalizeStyle(e.unref(E).body)},[e.createElementVNode("div",{class:e.normalizeClass(["tv-demo-body",{[`${e.unref(v)}-mode`]:!a.hideBackground}]),style:e.normalizeStyle(e.unref(E).content)},[h.value?(e.openBlock(),e.createElementBlock("div",ue,[e.createElementVNode("button",{type:"button",class:"tv-demo-back-button","aria-label":"Back",onClick:s},"← Back")])):e.createCommentVNode("",!0),e.createElementVNode("div",ve,[e.createElementVNode("div",fe,[e.createElementVNode("div",null,[e.createElementVNode("div",pe,[a.sourceLink||a.npmInstall||a.urlClone?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a.sourceLink?(e.openBlock(),e.createElementBlock("a",{key:0,href:a.sourceLink,target:"_blank",class:"tv-demo-links-item"}," View source code ",8,he)):e.createCommentVNode("",!0),a.sourceLink&&(a.npmInstall||a.urlClone)?(e.openBlock(),e.createElementBlock("span",ke," | ")):e.createCommentVNode("",!0),a.npmInstall?(e.openBlock(),e.createElementBlock("div",{key:2,class:"tv-demo-links-item",onClick:o[0]||(o[0]=n=>e.unref(q)("npm"))}," Copy install command ")):e.createCommentVNode("",!0),a.npmInstall&&a.urlClone?(e.openBlock(),e.createElementBlock("span",ye," | ")):e.createCommentVNode("",!0),a.urlClone?(e.openBlock(),e.createElementBlock("div",{key:4,class:"tv-demo-links-item",onClick:o[1]||(o[1]=n=>e.unref(q)("clone"))}," Copy repository clone URL ")):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[e.createElementVNode("div",ge,[o[22]||(o[22]=e.createElementVNode("span",{style:{"font-size":"0.9rem",opacity:"0.8"}},"Theme",-1)),e.createElementVNode("label",be,[e.createElementVNode("input",{type:"checkbox",checked:e.unref(v)==="dark",onChange:o[2]||(o[2]=(...n)=>e.unref(G)&&e.unref(G)(...n))},null,40,Ee),o[21]||(o[21]=e.createElementVNode("span",{class:"slider round"},null,-1))])])])]),e.createElementVNode("div",Ve,[e.createElementVNode("div",we,[e.createElementVNode("button",{class:e.normalizeClass(["tv-demo-tools-tab",{active:e.unref(c)==="demo"}]),onClick:o[3]||(o[3]=n=>c.value="demo")}," Demo ",2),a.showDocumentation?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["tv-demo-tools-tab",{active:e.unref(c)==="docs"}]),onClick:o[4]||(o[4]=n=>c.value="docs")}," Documentation ",2)):e.createCommentVNode("",!0),a.showChangelog?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["tv-demo-tools-tab",{active:e.unref(c)==="changelog"}]),onClick:o[5]||(o[5]=n=>c.value="changelog")}," Changelog ",2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ne,[e.withDirectives(e.createElementVNode("div",Ce,[e.createElementVNode("aside",{class:e.normalizeClass(["tv-demo-sidebar",`${e.unref(v)}-mode`])},[e.createElementVNode("div",Be,[e.createElementVNode("div",null,[e.createElementVNode("p",Se,e.toDisplayString(e.unref(i))+" / "+e.toDisplayString(e.unref(Q))+" variants",1),o[23]||(o[23]=e.createElementVNode("h3",null,"Variants",-1))]),e.createElementVNode("button",{class:"tv-demo-sidebar-collapse","aria-label":"Scroll to top",onClick:o[6]||(o[6]=n=>e.unref(F)?.scrollTo({top:0,behavior:"smooth"}))}," ⬆️ ")]),e.createElementVNode("label",{class:e.normalizeClass(["tv-demo-search",`${e.unref(v)}-mode`])},[o[24]||(o[24]=e.createElementVNode("span",{class:"tv-demo-search-icon"},"🔍",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[7]||(o[7]=n=>e.isRef(f)?f.value=n:null),type:"search",placeholder:"Search variants...",class:"tv-demo-search-input","aria-label":"Search variants",onKeydown:o[8]||(o[8]=e.withKeys(e.withModifiers(n=>e.unref(D)(n),["prevent"]),["down"]))},null,544),[[e.vModelText,e.unref(f)]]),e.unref(f)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"tv-demo-search-clear","aria-label":"Clear search",onClick:o[9]||(o[9]=n=>f.value="")},"✕")):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(["tv-demo-variants",`${e.unref(v)}-mode`]),role:"listbox",tabindex:"0","aria-label":"Available variants","aria-activedescendant":e.unref(p)?`variant-${e.unref(p)}`:null,onKeydown:o[11]||(o[11]=(...n)=>e.unref(D)&&e.unref(D)(...n)),ref_key:"variantsListRef",ref:F},[e.createElementVNode("div",{style:e.normalizeStyle({paddingTop:`${e.unref(z)}px`,paddingBottom:`${e.unref(j)}px`})},[e.unref(K)?(e.openBlock(),e.createElementBlock("div",Le,[e.createElementVNode("p",null,'No matches for "'+e.toDisplayString(e.unref(f))+'".',1),e.createElementVNode("button",{class:"tv-demo-reset",type:"button",onClick:o[10]||(o[10]=n=>f.value="")},"Clear filter")])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(H),n=>(e.openBlock(),e.createElementBlock("button",{key:n.key,id:`variant-${n.key}`,type:"button",class:e.normalizeClass(["tv-demo-variant-card",{active:n.key===e.unref(p)}]),role:"option","aria-selected":n.key===e.unref(p),onClick:r=>e.unref(O)(n.key)},[e.createElementVNode("span",xe,[e.createElementVNode("span",$e,e.toDisplayString(n.variant.title),1),e.createElementVNode("span",Pe,e.toDisplayString(n.variant.description),1)]),o[25]||(o[25]=e.createElementVNode("span",{class:"tv-demo-variant-card-icon"},"→",-1))],10,Te))),128))],4)],42,De)],2),e.createElementVNode("section",ze,[e.createElementVNode("div",Me,[e.createElementVNode("div",null,[o[26]||(o[26]=e.createElementVNode("p",{class:"tv-demo-content-label"},"Preview",-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(S).title||"Select a variant"),1)]),e.createElementVNode("div",_e,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tv-demo-viewport-btn",{active:e.unref(w)==="375px"}]),onClick:o[12]||(o[12]=n=>w.value="375px"),"aria-label":"Mobile view (375px)",title:"Mobile (375px)"}," Mobile ",2),y.value>=600?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["tv-demo-viewport-btn",{active:e.unref(w)==="768px"}]),onClick:o[13]||(o[13]=n=>w.value="768px"),"aria-label":"Tablet view (768px)",title:"Tablet (768px)"}," Tablet ",2)):e.createCommentVNode("",!0),y.value>=1024?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(["tv-demo-viewport-btn",{active:e.unref(w)==="100%"}]),onClick:o[14]||(o[14]=n=>w.value="100%"),"aria-label":"Desktop view (100%)",title:"Desktop (100%)"}," Desktop ",2)):e.createCommentVNode("",!0)])]),e.createElementVNode("p",Ie,e.toDisplayString(e.unref(S).description||"Select a variant from the list to view its details."),1),e.createElementVNode("div",{class:"tv-demo-component-content",style:e.normalizeStyle({width:e.unref(w)})},[e.unref(S)&&a.component?(e.openBlock(),e.createBlock(e.unref(_),{key:0,component:a.component,"component-props":{...e.unref(u),...X.value},"viewport-width":e.unref(w),"body-class":`${e.unref(v)}-mode`,"body-style":a.hideBackground?{}:e.unref(E).content},null,8,["component","component-props","viewport-width","body-class","body-style"])):(e.openBlock(),e.createElementBlock("p",Oe,"No component to render."))],4),e.createElementVNode("div",Ae,[e.createElementVNode("div",Re,[e.createElementVNode("button",{class:e.normalizeClass(["tv-demo-tools-tab",{active:e.unref(k)==="playground"}]),onClick:o[15]||(o[15]=n=>k.value="playground")}," Playground ",2),e.createElementVNode("button",{class:e.normalizeClass(["tv-demo-tools-tab",{active:e.unref(k)==="events"}]),onClick:o[16]||(o[16]=n=>k.value="events")},[o[27]||(o[27]=e.createTextVNode(" Events ",-1)),e.unref(V).length>0?(e.openBlock(),e.createElementBlock("span",Ue,e.toDisplayString(e.unref(V).length),1)):e.createCommentVNode("",!0)],2),e.createElementVNode("button",{class:e.normalizeClass(["tv-demo-tools-tab",{active:e.unref(k)==="code"}]),onClick:o[17]||(o[17]=n=>k.value="code")}," Code ",2)]),e.createElementVNode("div",Fe,[e.withDirectives(e.createElementVNode("div",He,[e.createElementVNode("div",je,[o[28]||(o[28]=e.createElementVNode("h3",{class:"tv-demo-tool-title"},"Props",-1)),e.createElementVNode("button",{class:"tv-demo-btn-secondary is-small",onClick:o[18]||(o[18]=(...n)=>e.unref(J)&&e.unref(J)(...n))}," Reset Props ")]),Object.keys(e.unref(u)).length>0?(e.openBlock(),e.createElementBlock("div",Ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:e.normalizeClass(["tv-demo-control-item",{"is-complex":typeof n=="object"&&n!==null}])},[typeof n!="object"||n===null?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",{class:"tv-demo-control-label",title:r},e.toDisplayString(r),9,qe),e.createElementVNode("div",Ge,[typeof n=="boolean"?(e.openBlock(),e.createElementBlock("label",We,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":g=>e.unref(u)[r]=g,id:`control-${r}`},null,8,Je),[[e.vModelCheckbox,e.unref(u)[r]]]),o[29]||(o[29]=e.createElementVNode("span",{class:"slider round"},null,-1))])):typeof n=="number"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":g=>e.unref(u)[r]=g,type:"number",class:"tv-demo-input",id:`control-${r}`},null,8,Qe)),[[e.vModelText,e.unref(u)[r],void 0,{number:!0}]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":g=>e.unref(u)[r]=g,type:"text",class:"tv-demo-input",id:`control-${r}`},null,8,Ye)),[[e.vModelText,e.unref(u)[r]]])])],64)):(e.openBlock(),e.createBlock(e.unref(I),{key:1,modelValue:e.unref(u)[r],"onUpdate:modelValue":g=>e.unref(u)[r]=g,name:r},null,8,["modelValue","onUpdate:modelValue","name"]))],2))),128))])):(e.openBlock(),e.createElementBlock("div",Xe," No props available for this component. "))],512),[[e.vShow,e.unref(k)==="playground"]]),e.withDirectives(e.createElementVNode("div",Ze,[e.createElementVNode("div",et,[o[30]||(o[30]=e.createElementVNode("h3",{class:"tv-demo-tool-title"},"Event Logger",-1)),e.unref(V).length>0?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:o[19]||(o[19]=(...n)=>e.unref(W)&&e.unref(W)(...n)),class:"tv-demo-btn-secondary is-small"},"Clear")):e.createCommentVNode("",!0)]),e.createElementVNode("div",tt,[e.unref(V).length===0?(e.openBlock(),e.createElementBlock("div",ot," Listening for events... ")):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(V),n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,class:"tv-demo-log-item"},[e.createElementVNode("span",nt,e.toDisplayString(n.timestamp),1),e.createElementVNode("span",at,e.toDisplayString(n.eventName),1),n.payload!==void 0?(e.openBlock(),e.createElementBlock("span",lt,e.toDisplayString(JSON.stringify(n.payload)),1)):e.createCommentVNode("",!0)]))),128))])],512),[[e.vShow,e.unref(k)==="events"]]),e.withDirectives(e.createElementVNode("div",st,[e.createElementVNode("div",rt,[o[31]||(o[31]=e.createElementVNode("h3",{class:"tv-demo-tool-title"},"Generated Code",-1)),e.createElementVNode("button",{class:"tv-demo-btn-secondary is-small",onClick:o[20]||(o[20]=n=>e.unref(T)(e.unref(S).html))}," Copy Code ")]),e.createVNode(e.unref(ce.HighCode),{class:"tv-demo-code",codeValue:e.unref(S).html,theme:e.unref(v),lang:"html",codeLines:"",height:"auto",copy:!1},null,8,["codeValue","theme"])],512),[[e.vShow,e.unref(k)==="code"]])])])])],512),[[e.vShow,e.unref(c)==="demo"]]),e.unref(c)==="docs"&&a.showDocumentation?(e.openBlock(),e.createElementBlock("div",ct,[e.unref(U)?(e.openBlock(),e.createElementBlock("div",it,[e.createVNode(e.unref(te),{source:e.unref(U),html:""},null,8,["source"])])):(e.openBlock(),e.createElementBlock("div",dt,"No documentation available."))])):e.createCommentVNode("",!0),e.unref(c)==="changelog"&&a.showChangelog?(e.openBlock(),e.createElementBlock("div",mt,[e.unref(L)?(e.openBlock(),e.createElementBlock("div",ut,[e.createVNode(e.unref(te),{source:e.unref(L),html:""},null,8,["source"])])):(e.openBlock(),e.createElementBlock("div",vt,"No changelog available."))])):e.createCommentVNode("",!0)])])])],6)],6),e.createElementVNode("footer",{class:e.normalizeClass(["tv-demo-footer",`${e.unref(v)}-mode`])},[e.createElementVNode("div",ft,[e.createElementVNode("div",pt,[e.createElementVNode("div",ht,[o[32]||(o[32]=e.createElementVNode("span",{class:"tv-demo-footer-logo"},[e.createElementVNode("img",{src:"https://res.cloudinary.com/denj4fg7f/image/upload/v1766183906/icono_git_bvxian.png",alt:"Icon TODOvue"})],-1)),e.createElementVNode("span",kt,e.toDisplayString(a.componentName),1),e.createElementVNode("span",yt,"v"+e.toDisplayString(a.version),1)]),o[33]||(o[33]=e.createStaticVNode('<div class="tv-demo-footer-info"><p class="tv-demo-footer-text"> Designed & Developed by <a href="https://cris-dev.com/" target="_blank" rel="noopener noreferrer" class="tv-demo-footer-link"> cris-dev.com </a></p><div class="tv-demo-footer-divider"></div><p class="tv-demo-footer-text"> Made with <span class="tv-demo-footer-heart">💙</span> using Vue.js </p></div>',1))]),e.createElementVNode("div",gt,[e.createElementVNode("p",bt," © "+e.toDisplayString(new Date().getFullYear())+" TODOvue. All rights reserved. ",1)])])],2),e.createVNode(e.unref(b),{toasts:e.unref(P),onRemoveToast:e.unref(Y)},null,8,["toasts","onRemoveToast"]),e.createVNode(e.unref($),{theme:e.unref(v),"scroll-target":".tv-demo-body","aria-label":"Back to top"},null,8,["theme"])],64))}};R.install=a=>{a.component("TvDemo",R)};const Et={install(a){a.component("TvDemo",R)}};exports.TvDemo=R;exports.TvDemoPlugin=Et;exports.default=R;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),Ee=require("vue-highlight-code"),ke=require("vue3-markdown-it"),F=72,we=6,Ve=(a,V)=>a?.id??a?.title??`variant-${V}`,Ce=(a={})=>`${a.title??""} ${a.description??""}`.toLowerCase(),Ne=a=>{const V=e.ref("dark"),I=e.ref([]),G=e.ref(""),H=e.ref(""),f=e.ref("demo"),h=e.ref(""),s=e.ref(null),y=e.ref(null),C=e.ref(360),v=e.ref("100%"),ne=e.ref("default"),le=e.ref(!1),b=e.ref(!1),x=e.ref(!1),N=e.ref(0);let B=null,R=!1;const ae=e.computed(()=>N.value>0),T=e.computed(()=>(a.variants||[]).map((o,l)=>({variant:o,index:l,key:Ve(o,l),searchableText:Ce(o)}))),ie=e.computed(()=>T.value.length),c=e.computed(()=>{const o=h.value.trim().toLowerCase();return o?T.value.filter(l=>l.searchableText.includes(o)):T.value}),de=e.computed(()=>c.value.length),k=e.computed(()=>!!h.value.trim()&&c.value.length===0),L=()=>{C.value=y.value?.clientHeight||C.value},re=()=>{R&&(window.removeEventListener("resize",L),R=!1)};e.watch(()=>y.value,o=>{if(B&&(B.disconnect(),B=null),!o){re();return}e.nextTick(()=>{L(),typeof ResizeObserver<"u"?(B=new ResizeObserver(l=>{const i=l?.[0];i&&(C.value=i.contentRect.height)}),B.observe(o)):R||(window.addEventListener("resize",L),R=!0)})});const M=e.ref(!1);let j=null;const ce=()=>{if(typeof window>"u")return;const o=new URL(window.location.href);if(f.value&&f.value!=="demo"?o.searchParams.set("tab",f.value):o.searchParams.delete("tab"),h.value?o.searchParams.set("search",h.value):o.searchParams.delete("search"),s.value?o.searchParams.set("variant",s.value):o.searchParams.delete("variant"),v.value&&v.value!=="100%"){let l="";v.value==="375px"?l="mobile":v.value==="768px"?l="tablet":v.value==="1280px"&&(l="desktop"),l?o.searchParams.set("viewport",l):o.searchParams.delete("viewport")}else o.searchParams.delete("viewport");o.href!==window.location.href&&window.history.replaceState(window.history.state,"",o.href)};e.watch([f,h,s,v],()=>{M.value&&(clearTimeout(j),j=setTimeout(ce,300))}),e.onMounted(()=>{const o=localStorage.getItem("theme");if(o&&(V.value=o),typeof window<"u"){const l=new URLSearchParams(window.location.search),i=l.get("tab");i&&(f.value=i);const z=l.get("search");z&&(h.value=z);const ee=l.get("variant");if(ee){const te=T.value.find(be=>String(be.key)===ee);s.value=te?te.key:ee}const se=l.get("viewport");if(se)se==="mobile"?v.value="375px":se==="tablet"?v.value="768px":se==="desktop"&&(v.value="1280px");else{const te=window.innerWidth;te<768?v.value="375px":te<1280?v.value="768px":v.value="1280px"}M.value=!0}e.nextTick(L)}),e.onBeforeUnmount(()=>{B&&(B.disconnect(),B=null),re()});const W=async()=>{try{const o=await fetch(a.readmePath);if(!o.ok)throw new Error("README.md not found");G.value=await o.text()}catch{G.value="Documentation not found."}},u=async()=>{try{const o=await fetch(a.changelogPath);if(!o.ok)throw new Error("CHANGELOG.md not found");H.value=await o.text()}catch{H.value="Changelog not found."}},A=()=>{V.value=V.value==="dark"?"light":"dark",localStorage.setItem("theme",V.value)};e.watch(()=>T.value,o=>{if(!o.length){s.value=null;return}o.some(l=>l.key===s.value)||(s.value=o[0].key)},{immediate:!0}),e.watch(()=>c.value,o=>{if(!o.length){s.value=null;return}o.some(l=>l.key===s.value)||(s.value=o[0].key)});const q=o=>{y.value&&(y.value.scrollTop=o,N.value=o)};e.watch(h,()=>{q(0)});const U=e.computed(()=>c.value.findIndex(o=>o.key===s.value)),D=e.computed(()=>Math.max(1,Math.ceil(C.value/F))),w=e.computed(()=>Math.max(0,Math.floor(N.value/F)-we)),K=e.computed(()=>Math.min(c.value.length,w.value+D.value+we*2)),ue=e.computed(()=>c.value.slice(w.value,K.value)),E=e.computed(()=>w.value*F),O=e.computed(()=>Math.max(0,(c.value.length-K.value)*F)),_=()=>{if(!y.value)return;const o=U.value;if(o<0)return;const l=o*F,i=l+F,z=N.value,ee=z+C.value;l<z?q(l):i>ee&&q(i-C.value)};e.watch(s,_);const d=e.computed(()=>k.value?{}:(c.value.find(l=>l.key===s.value)||T.value.find(l=>l.key===s.value)||c.value[0]||T.value[0])?.variant||{}),m=e.ref({});e.watch(()=>d.value,o=>{if(o?.propsData)try{m.value=JSON.parse(JSON.stringify(o.propsData))}catch{m.value={...o.propsData}}else m.value={}},{immediate:!0});const P=e.ref([]),me=(o,l)=>{const i=new Date().toLocaleTimeString();P.value.unshift({id:Date.now()+Math.random(),timestamp:i,eventName:o,payload:l}),P.value.length>50&&(P.value=P.value.slice(0,50))},S=(o=!0)=>{P.value=[],o&&$("Event logs cleared","success",2e3)};e.watch(s,()=>{S(!1)});const Z=o=>{N.value=o.target.scrollTop},J=o=>{const l=c.value;if(!l.length)return;const i=U.value<0?0:U.value,z=Math.min(l.length-1,Math.max(0,i+o));s.value=l[z].key},Q=o=>{switch(o.key){case"ArrowDown":o.preventDefault(),J(1);break;case"ArrowUp":o.preventDefault(),J(-1);break;case"Home":o.preventDefault(),c.value.length&&(s.value=c.value[0].key);break;case"End":o.preventDefault(),c.value.length&&(s.value=c.value[c.value.length-1].key);break}},ve=o=>{s.value=o},pe=e.computed(()=>{const o=V.value==="dark"?a.demoStyle?.dark:a.demoStyle?.light;return{body:{backgroundColor:o?.backgroundBody||"",color:o?.color||""},content:{backgroundColor:o?.backgroundContent||"",color:o?.color||""}}}),Y=o=>{let l="";switch(o){case"npm":l=`npm install ${a.isDevComponent?"-D ":""}${a.npmInstall}`;break;case"yarn":l=`yarn add ${a.isDevComponent?"-D ":""}${a.npmInstall}`;break;case"pnpm":l=`pnpm add ${a.isDevComponent?"-D ":""}${a.npmInstall}`;break;case"bun":l=`bun add ${a.isDevComponent?"-D ":""}${a.npmInstall}`;break;default:l=`git clone ${a.urlClone}`;break}navigator.clipboard.writeText(l).then(()=>{$(`Copied to clipboard: ${l}`,"success",2e3)}).catch(i=>{$(`Failed to copy: ${i}`,"error",2e3)})},$=(o,l="success",i=3e3)=>{const z=`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;I.value.push({id:z,message:o,type:l,duration:i})},g=e.ref(!1),t=()=>{g.value=!g.value},n=()=>{g.value&&(g.value=!1)};e.onMounted(()=>{typeof window<"u"&&window.addEventListener("click",o=>{const l=document.querySelector(".install-dropdown");l&&!l.contains(o.target)&&n()})});const r=o=>{const l=I.value.findIndex(i=>i.id===o);l>-1&&I.value.splice(l,1)};e.watchEffect(async()=>{await W(),await u()});const p=e.ref("playground"),ge=()=>{if(d.value?.propsData)try{m.value=JSON.parse(JSON.stringify(d.value.propsData))}catch{m.value={...d.value.propsData}}else m.value={};$("Props reset to default","success",2e3)},X=e.ref("Vue 3 Setup"),fe=e.computed(()=>d.value?.code&&Array.isArray(d.value.code)?d.value.code.map(o=>o.type):[]),he=e.computed(()=>{if(d.value?.code&&Array.isArray(d.value.code)){const o=d.value.code.find(l=>l.type===X.value);return o?o.content:""}return d.value?.html||""}),ye=e.computed(()=>d.value?.code&&Array.isArray(d.value.code)&&d.value.code.find(l=>l.type===X.value)?.lang||"html");return e.watch(()=>fe.value,o=>{o.length>0&&!o.includes(X.value)&&(X.value=o[0])},{immediate:!0}),{customStyle:pe,toasts:I,readmeContent:G,changelogContent:H,selectedTab:f,searchQuery:h,selectedVariantKey:s,totalVariantsCount:ie,filteredVariantsCount:de,variantsListRef:y,virtualizedVariants:ue,virtualPaddingTop:E,virtualPaddingBottom:O,emptySearchState:k,theme:V,variant:d,addToast:$,removeToast:r,selectVariant:ve,setClickItem:Y,toggleTheme:A,handleVariantsScroll:Z,handleVariantsKeydown:Q,reactiveProps:m,eventLogs:P,addLog:me,clearLogs:S,viewportWidth:v,activeToolTab:p,resetProps:ge,copyCode:o=>{const l=o||he.value;navigator.clipboard.writeText(l).then(()=>{$("Code copied to clipboard","success",2e3)}).catch(i=>{$(`Failed to copy: ${i}`,"error",2e3)})},backgroundType:ne,isRtl:le,isGrid:b,isSidebarCompressed:x,showScrollToTop:ae,isInstallDropdownOpen:g,toggleInstallDropdown:t,selectedCodeType:X,availableCodeTypes:fe,currentCode:he,currentLang:ye}},Be={key:0,class:"tv-demo-back-row"},xe={class:"tv-demo-case"},Te={class:"tv-demo-header"},De={class:"tv-demo-links"},Se=["href"],$e={class:"tv-demo-dropdown-content"},ze={class:"tv-demo-theme"},Le={class:"switch"},Me=["checked"],Pe={class:"tv-demo-tools main-tabs"},Ae={class:"tv-demo-tools-tabs"},Ie={class:"tv-demo-tools-content main-content"},Re={class:"tv-demo-sidebar-header"},Ue={class:"tv-demo-sidebar-meta"},Oe={class:"tv-demo-sidebar-actions"},_e=["aria-label"],Fe={class:"tv-demo-sidebar-content-wrapper"},Ge=["aria-activedescendant"],He=["id","aria-selected","onClick"],je={class:"tv-demo-variant-card-content"},We={class:"tv-demo-variant-card-title"},qe={class:"tv-demo-variant-card-description"},Ke={key:1,class:"tv-demo-empty-state"},Ze={class:"tv-demo-content","aria-live":"polite"},Je={class:"tv-demo-content-header"},Qe={class:"tv-demo-viewport-controls"},Ye={class:"tv-demo-dropdown"},Xe={class:"tv-demo-dropdown-content"},et={class:"tv-demo-description"},tt={class:"tv-demo-component-content"},ot={key:1,class:"tv-demo-empty-component"},nt={class:"tv-demo-tools"},lt={class:"tv-demo-tools-tabs"},at={key:0,class:"tv-demo-badge"},rt={class:"tv-demo-tools-content"},st={class:"tv-demo-tool-pane"},it={class:"tv-demo-toolbar"},dt={key:0,class:"tv-demo-controls-grid"},ct=["title"],ut={class:"tv-demo-control-input-wrapper"},mt={key:0,class:"switch small"},vt=["onUpdate:modelValue","id"],pt=["onUpdate:modelValue","id"],ft=["onUpdate:modelValue","id"],ht={key:0,class:"tv-demo-control-input-wrapper color-wrapper"},kt=["onUpdate:modelValue","id"],wt=["onUpdate:modelValue","id"],gt={key:1,class:"tv-demo-empty-state small"},yt={key:0,class:"tv-demo-tool-pane"},bt={class:"tv-demo-toolbar"},Et={class:"tv-demo-logs-container"},Vt={key:0,class:"tv-demo-logs-empty"},Ct={class:"tv-demo-log-time"},Nt={class:"tv-demo-log-name"},Bt={key:0,class:"tv-demo-log-payload"},xt={key:1,class:"tv-demo-tool-pane"},Tt={class:"tv-demo-toolbar"},Dt={class:"tv-demo-code-header"},St={key:0,class:"tv-demo-code-switcher"},$t=["onClick"],zt={key:1,class:"tv-demo-empty-state small"},Lt={key:0},Mt={key:0,class:"markdown-body"},Pt={key:1},At={key:1},It={key:0,class:"markdown-body"},Rt={key:1},Ut={class:"tv-demo-footer-content"},Ot={class:"tv-demo-footer-main"},_t={class:"tv-demo-footer-brand"},Ft={class:"tv-demo-footer-brand-text"},Gt={class:"tv-demo-footer-brand-version"},Ht={class:"tv-demo-footer-bottom"},jt={class:"tv-demo-footer-copyright"},oe={__name:"TvDemo",props:{demoStyle:{type:Object,default:()=>({body:{},content:{}})},hideBackground:Boolean,component:Object,variants:Array,componentName:{type:String,default:"Component Demo"},sourceLink:{type:String,default:null},urlClone:{type:String,default:null},npmInstall:{type:String,default:null},isDevComponent:{type:Boolean,default:!1},version:{type:String,default:"0.0.0"},readmePath:{type:String,default:"./README.md"},changelogPath:{type:String,default:"./CHANGELOG.md"},showDocumentation:{type:Boolean,default:!0},showChangelog:{type:Boolean,default:!0},manualEmits:{type:Array,default:()=>[]}},setup(a){const V=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./ToastContainer-B-rxasZF.cjs"))),I=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./ToUp-CJUZN3du.cjs"))),G=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./TvPreviewFrame-COIIvDUA.cjs"))),H=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./TvNestedEditor-C6zgg9gF.cjs"))),f=a,h=e.ref(!1),s=()=>{typeof window>"u"||window.history.back()},y=()=>{if(typeof window>"u")return;const g=typeof document<"u"&&!!document.referrer;window.navigation&&typeof window.navigation.canGoBack=="boolean"?h.value=window.navigation.canGoBack||g:window.history.state&&typeof window.history.state.position=="number"?h.value=window.history.state.position>0||g:h.value=g};e.onMounted(()=>{y(),typeof window<"u"&&(window.addEventListener("popstate",y),window.navigation&&window.navigation.addEventListener("currententrychange",y))}),e.onBeforeUnmount(()=>{typeof window<"u"&&(window.removeEventListener("popstate",y),window.navigation&&window.navigation.removeEventListener("currententrychange",y),window.removeEventListener("resize",Y))});const{customStyle:C,toasts:v,readmeContent:ne,changelogContent:le,selectedTab:b,searchQuery:x,selectedVariantKey:N,totalVariantsCount:B,filteredVariantsCount:R,variantsListRef:ae,virtualizedVariants:T,virtualPaddingTop:ie,virtualPaddingBottom:c,emptySearchState:de,theme:k,variant:L,removeToast:re,setClickItem:M,toggleTheme:j,selectVariant:ce,handleVariantsKeydown:W,reactiveProps:u,eventLogs:A,addLog:q,clearLogs:U,viewportWidth:D,activeToolTab:w,resetProps:K,copyCode:ue,backgroundType:E,isRtl:O,isGrid:_,handleVariantsScroll:d,isSidebarCompressed:m,showScrollToTop:P,isInstallDropdownOpen:me,toggleInstallDropdown:S,selectedCodeType:Z,availableCodeTypes:J,currentCode:Q,currentLang:ve}=Ne(f),pe=e.ref(typeof window<"u"?window.innerWidth:1200),Y=()=>{pe.value=window.innerWidth};e.onMounted(()=>{typeof window<"u"&&window.addEventListener("resize",Y)}),e.onBeforeUnmount(()=>{typeof window<"u"&&window.removeEventListener("resize",Y)});const $=e.computed(()=>{const g={},t=f.component&&f.component.emits?Array.isArray(f.component.emits)?f.component.emits:Object.keys(f.component.emits):[],n=[...new Set([...t,...f.manualEmits])];return n.length>0&&n.forEach(r=>{g[`on${r.charAt(0).toUpperCase()+r.slice(1)}`]=p=>{q(r,p)}}),g});return(g,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(k)}-mode tv-demo`),style:e.normalizeStyle(e.unref(C).body)},[e.createElementVNode("div",{class:e.normalizeClass(["tv-demo-body",{[`${e.unref(k)}-mode`]:!a.hideBackground}]),style:e.normalizeStyle(e.unref(C).content)},[h.value?(e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("button",{type:"button",class:"tv-demo-btn-secondary","aria-label":"Back",onClick:s},"← Back")])):e.createCommentVNode("",!0),e.createElementVNode("div",xe,[e.createElementVNode("div",Te,[e.createElementVNode("div",null,[e.createElementVNode("div",De,[a.sourceLink||a.npmInstall||a.urlClone?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a.sourceLink?(e.openBlock(),e.createElementBlock("a",{key:0,href:a.sourceLink,target:"_blank",class:"tv-demo-btn-secondary is-small",style:{"text-decoration":"none",display:"inline-flex","align-items":"center"}}," View source code ",8,Se)):e.createCommentVNode("",!0),a.npmInstall?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["tv-demo-dropdown click-mode install-dropdown",{"is-open":e.unref(me)}])},[e.createElementVNode("button",{class:"tv-demo-btn-secondary is-small",onClick:t[0]||(t[0]=e.withModifiers((...n)=>e.unref(S)&&e.unref(S)(...n),["stop"]))}," Copy install command "),e.createElementVNode("div",$e,[e.createElementVNode("button",{onClick:t[1]||(t[1]=n=>{e.unref(M)("npm"),e.unref(S)()})},[...t[33]||(t[33]=[e.createElementVNode("svg",{role:"img",viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z"})],-1),e.createTextVNode(" npm ",-1)])]),e.createElementVNode("button",{onClick:t[2]||(t[2]=n=>{e.unref(M)("yarn"),e.unref(S)()})},[...t[34]||(t[34]=[e.createElementVNode("svg",{role:"img",viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M12 0C5.375 0 0 5.375 0 12s5.375 12 12 12 12-5.375 12-12S18.625 0 12 0zm.768 4.105c.183 0 .363.053.525.157.125.083.287.185.755 1.154.31-.088.468-.042.551-.019.204.056.366.19.463.375.477.917.542 2.553.334 3.605-.241 1.232-.755 2.029-1.131 2.576.324.329.778.899 1.117 1.825.278.774.31 1.478.273 2.015a5.51 5.51 0 0 0 .602-.329c.593-.366 1.487-.917 2.553-.931.714-.009 1.269.445 1.353 1.103a1.23 1.23 0 0 1-.945 1.362c-.649.158-.95.278-1.821.843-1.232.797-2.539 1.242-3.012 1.39a1.686 1.686 0 0 1-.704.343c-.737.181-3.266.315-3.466.315h-.046c-.783 0-1.214-.241-1.45-.491-.658.329-1.51.19-2.122-.134a1.078 1.078 0 0 1-.58-1.153 1.243 1.243 0 0 1-.153-.195c-.162-.25-.528-.936-.454-1.946.056-.723.556-1.367.88-1.71a5.522 5.522 0 0 1 .408-2.256c.306-.727.885-1.348 1.32-1.737-.32-.537-.644-1.367-.329-2.21.227-.602.412-.936.82-1.08h-.005c.199-.074.389-.153.486-.259a3.418 3.418 0 0 1 2.298-1.103c.037-.093.079-.185.125-.283.31-.658.639-1.029 1.024-1.168a.94.94 0 0 1 .328-.06zm.006.7c-.507.016-1.001 1.519-1.001 1.519s-1.27-.204-2.266.871c-.199.218-.468.334-.746.44-.079.028-.176.023-.417.672-.371.991.625 2.094.625 2.094s-1.186.839-1.626 1.881c-.486 1.144-.338 2.261-.338 2.261s-.843.732-.899 1.487c-.051.663.139 1.2.343 1.515.227.343.51.176.51.176s-.561.653-.037.931c.477.25 1.283.394 1.71-.037.31-.31.371-1.001.486-1.283.028-.065.12.111.209.199.097.093.264.195.264.195s-.755.324-.445 1.066c.102.246.468.403 1.066.398.222-.005 2.664-.139 3.313-.296.375-.088.505-.283.505-.283s1.566-.431 2.998-1.357c.917-.598 1.293-.76 2.034-.936.612-.148.57-1.098-.241-1.084-.839.009-1.575.44-2.196.825-1.163.718-1.742.672-1.742.672l-.018-.032c-.079-.13.371-1.293-.134-2.678-.547-1.515-1.413-1.881-1.344-1.997.297-.5 1.038-1.297 1.334-2.78.176-.899.13-2.377-.269-3.151-.074-.144-.732.241-.732.241s-.616-1.371-.788-1.483a.271.271 0 0 0-.157-.046z"})],-1),e.createTextVNode(" yarn ",-1)])]),e.createElementVNode("button",{onClick:t[3]||(t[3]=n=>{e.unref(M)("pnpm"),e.unref(S)()})},[...t[35]||(t[35]=[e.createElementVNode("svg",{role:"img",viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 0v7.5h7.5V0zm8.25 0v7.5h7.498V0zm8.25 0v7.5H24V0zM8.25 8.25v7.5h7.498v-7.5zm8.25 0v7.5H24v-7.5zM0 16.5V24h7.5v-7.5zm8.25 0V24h7.498v-7.5zm8.25 0V24H24v-7.5z"})],-1),e.createTextVNode(" pnpm ",-1)])]),e.createElementVNode("button",{onClick:t[4]||(t[4]=n=>{e.unref(M)("bun"),e.unref(S)()})},[...t[36]||(t[36]=[e.createElementVNode("svg",{role:"img",viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M12 22.596c6.628 0 12-4.338 12-9.688 0-3.318-2.057-6.248-5.219-7.986-1.286-.715-2.297-1.357-3.139-1.89C14.058 2.025 13.08 1.404 12 1.404c-1.097 0-2.334.785-3.966 1.821a49.92 49.92 0 0 1-2.816 1.697C2.057 6.66 0 9.59 0 12.908c0 5.35 5.372 9.687 12 9.687v.001ZM10.599 4.715c.334-.759.503-1.58.498-2.409 0-.145.202-.187.23-.029.658 2.783-.902 4.162-2.057 4.624-.124.048-.199-.121-.103-.209a5.763 5.763 0 0 0 1.432-1.977Zm2.058-.102a5.82 5.82 0 0 0-.782-2.306v-.016c-.069-.123.086-.263.185-.172 1.962 2.111 1.307 4.067.556 5.051-.082.103-.23-.003-.189-.126a5.85 5.85 0 0 0 .23-2.431Zm1.776-.561a5.727 5.727 0 0 0-1.612-1.806v-.014c-.112-.085-.024-.274.114-.218 2.595 1.087 2.774 3.18 2.459 4.407a.116.116 0 0 1-.049.071.11.11 0 0 1-.153-.026.122.122 0 0 1-.022-.083 5.891 5.891 0 0 0-.737-2.331Zm-5.087.561c-.617.546-1.282.76-2.063 1-.117 0-.195-.078-.156-.181 1.752-.909 2.376-1.649 2.999-2.778 0 0 .155-.118.188.085 0 .304-.349 1.329-.968 1.874Zm4.945 11.237a2.957 2.957 0 0 1-.937 1.553c-.346.346-.8.565-1.286.62a2.178 2.178 0 0 1-1.327-.62 2.955 2.955 0 0 1-.925-1.553.244.244 0 0 1 .064-.198.234.234 0 0 1 .193-.069h3.965a.226.226 0 0 1 .19.07c.05.053.073.125.063.197Zm-5.458-2.176a1.862 1.862 0 0 1-2.384-.245 1.98 1.98 0 0 1-.233-2.447c.207-.319.503-.566.848-.713a1.84 1.84 0 0 1 1.092-.11c.366.075.703.261.967.531a1.98 1.98 0 0 1 .408 2.114 1.931 1.931 0 0 1-.698.869v.001Zm8.495.005a1.86 1.86 0 0 1-2.381-.253 1.964 1.964 0 0 1-.547-1.366c0-.384.11-.76.32-1.079.207-.319.503-.567.849-.713a1.844 1.844 0 0 1 1.093-.108c.367.076.704.262.968.534a1.98 1.98 0 0 1 .4 2.117 1.932 1.932 0 0 1-.702.868Z"})],-1),e.createTextVNode(" bun ",-1)])])])],2)):e.createCommentVNode("",!0),a.urlClone?(e.openBlock(),e.createElementBlock("button",{key:2,class:"tv-demo-btn-secondary is-small",onClick:t[5]||(t[5]=n=>e.unref(M)("clone"))}," Copy repository clone URL ")):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[e.createElementVNode("div",ze,[t[38]||(t[38]=e.createElementVNode("span",{style:{"font-size":"0.9rem",opacity:"0.8"}},"Theme",-1)),e.createElementVNode("label",Le,[e.createElementVNode("input",{type:"checkbox",checked:e.unref(k)==="dark",onChange:t[6]||(t[6]=(...n)=>e.unref(j)&&e.unref(j)(...n))},null,40,Me),t[37]||(t[37]=e.createElementVNode("span",{class:"slider round"},null,-1))])])])]),e.createElementVNode("div",Pe,[e.createElementVNode("div",Ae,[e.createElementVNode("button",{class:e.normalizeClass(["tv-demo-tools-tab",{active:e.unref(b)==="demo"}]),onClick:t[7]||(t[7]=n=>b.value="demo")}," Demo ",2),a.showDocumentation?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["tv-demo-tools-tab",{active:e.unref(b)==="docs"}]),onClick:t[8]||(t[8]=n=>b.value="docs")}," Documentation ",2)):e.createCommentVNode("",!0),a.showChangelog?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["tv-demo-tools-tab",{active:e.unref(b)==="changelog"}]),onClick:t[9]||(t[9]=n=>b.value="changelog")}," Changelog ",2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ie,[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["tv-demo-layout",{"is-compressed":e.unref(m)}])},[e.createElementVNode("aside",{class:e.normalizeClass(["tv-demo-sidebar",[`${e.unref(k)}-mode`,{"is-compressed":e.unref(m)}]])},[e.createElementVNode("div",Re,[e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("p",Ue,e.toDisplayString(e.unref(R))+" / "+e.toDisplayString(e.unref(B))+" variants",1),t[39]||(t[39]=e.createElementVNode("h3",null,"Variants",-1))],512),[[e.vShow,!e.unref(m)]]),e.createElementVNode("div",Oe,[e.withDirectives(e.createElementVNode("button",{class:"tv-demo-sidebar-collapse","aria-label":"Scroll to top",onClick:t[10]||(t[10]=n=>e.unref(ae)?.scrollTo({top:0,behavior:"smooth"}))},[...t[40]||(t[40]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"12",y1:"19",x2:"12",y2:"5"}),e.createElementVNode("polyline",{points:"5 12 12 5 19 12"})],-1)])],512),[[e.vShow,!e.unref(m)&&e.unref(P)]]),e.createElementVNode("button",{class:e.normalizeClass(["tv-demo-sidebar-collapse",{"is-rotated":e.unref(m)}]),"aria-label":e.unref(m)?"Expand sidebar":"Collapse sidebar",onClick:t[11]||(t[11]=n=>m.value=!e.unref(m))},[...t[41]||(t[41]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),e.createElementVNode("polyline",{points:"12 19 5 12 12 5"})],-1)])],10,_e)])]),e.withDirectives(e.createElementVNode("div",Fe,[e.createElementVNode("label",{class:e.normalizeClass(["tv-demo-search",`${e.unref(k)}-mode`])},[t[42]||(t[42]=e.createElementVNode("span",{class:"tv-demo-search-icon"},"🔍",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":t[12]||(t[12]=n=>e.isRef(x)?x.value=n:null),type:"search",placeholder:"Search variants...",class:"tv-demo-search-input","aria-label":"Search variants",onKeydown:t[13]||(t[13]=e.withKeys(e.withModifiers(n=>e.unref(W)(n),["prevent"]),["down"]))},null,544),[[e.vModelText,e.unref(x)]]),e.unref(x)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"tv-demo-search-clear","aria-label":"Clear search",onClick:t[14]||(t[14]=n=>x.value="")},"✕")):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(["tv-demo-variants",`${e.unref(k)}-mode`]),role:"listbox",tabindex:"0","aria-label":"Available variants","aria-activedescendant":e.unref(N)?`variant-${e.unref(N)}`:null,onKeydown:t[16]||(t[16]=(...n)=>e.unref(W)&&e.unref(W)(...n)),onScroll:t[17]||(t[17]=(...n)=>e.unref(d)&&e.unref(d)(...n)),ref_key:"variantsListRef",ref:ae},[e.createElementVNode("div",{style:e.normalizeStyle({paddingTop:`${e.unref(ie)}px`,paddingBottom:`${e.unref(c)}px`})},[e.unref(de)?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("p",null,'No matches for "'+e.toDisplayString(e.unref(x))+'".',1),e.createElementVNode("button",{class:"tv-demo-reset",type:"button",onClick:t[15]||(t[15]=n=>x.value="")},"Clear filter")])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(T),n=>(e.openBlock(),e.createElementBlock("button",{key:n.key,id:`variant-${n.key}`,type:"button",class:e.normalizeClass(["tv-demo-variant-card",{active:n.key===e.unref(N)}]),role:"option","aria-selected":n.key===e.unref(N),onClick:r=>e.unref(ce)(n.key)},[e.createElementVNode("span",je,[e.createElementVNode("span",We,e.toDisplayString(n.variant.title),1),e.createElementVNode("span",qe,e.toDisplayString(n.variant.description),1)]),t[43]||(t[43]=e.createElementVNode("span",{class:"tv-demo-variant-card-icon"},"→",-1))],10,He))),128))],4)],42,Ge)],512),[[e.vShow,!e.unref(m)]])],2),e.createElementVNode("section",Ze,[e.createElementVNode("div",Je,[e.createElementVNode("div",null,[t[44]||(t[44]=e.createElementVNode("p",{class:"tv-demo-content-label"},"Preview",-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(L).title||"Select a variant"),1)]),e.createElementVNode("div",Qe,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tv-demo-viewport-btn",{active:e.unref(D)==="375px"}]),onClick:t[18]||(t[18]=n=>D.value="375px"),"aria-label":"Mobile view (375px)",title:"Mobile (375px)"}," Mobile ",2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tv-demo-viewport-btn",{active:e.unref(D)==="768px"}]),onClick:t[19]||(t[19]=n=>D.value="768px"),"aria-label":"Tablet view (768px)",title:"Tablet (768px)"}," Tablet ",2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tv-demo-viewport-btn",{active:e.unref(D)==="1280px"}]),onClick:t[20]||(t[20]=n=>D.value="1280px"),"aria-label":"Desktop view (1280px)",title:"Desktop (1280px)"}," Desktop ",2),t[46]||(t[46]=e.createElementVNode("div",{class:"tv-demo-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tv-demo-icon-btn",{active:e.unref(O)}]),onClick:t[21]||(t[21]=n=>O.value=!e.unref(O)),title:"Toggle RTL","aria-label":"Toggle RTL"}," ⇄ ",2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tv-demo-icon-btn",{active:e.unref(_)}]),onClick:t[22]||(t[22]=n=>_.value=!e.unref(_)),title:"Toggle Grid","aria-label":"Toggle Grid"}," # ",2),e.createElementVNode("div",Ye,[t[45]||(t[45]=e.createElementVNode("button",{type:"button",class:"tv-demo-icon-btn",title:"Background Color","aria-label":"Change Background"}," 🎨 ",-1)),e.createElementVNode("div",Xe,[e.createElementVNode("button",{onClick:t[23]||(t[23]=n=>E.value="default"),class:e.normalizeClass({active:e.unref(E)==="default"})},"Default",2),e.createElementVNode("button",{onClick:t[24]||(t[24]=n=>E.value="checkered"),class:e.normalizeClass({active:e.unref(E)==="checkered"})},"Checkered",2),e.createElementVNode("button",{onClick:t[25]||(t[25]=n=>E.value="white"),class:e.normalizeClass({active:e.unref(E)==="white"})},"White",2),e.createElementVNode("button",{onClick:t[26]||(t[26]=n=>E.value="dark"),class:e.normalizeClass({active:e.unref(E)==="dark"})},"Dark",2)])])])]),e.createElementVNode("p",et,e.toDisplayString(e.unref(L).description||"Select a variant from the list to view its details."),1),e.createElementVNode("div",tt,[e.unref(L)&&a.component?(e.openBlock(),e.createBlock(e.unref(G),{key:0,component:a.component,"component-props":{...e.unref(u),...$.value},"viewport-width":e.unref(D),"body-class":`${e.unref(k)}-mode`,"body-style":a.hideBackground?{}:e.unref(C).content,"is-rtl":e.unref(O),"background-type":e.unref(E),"is-grid":e.unref(_)},null,8,["component","component-props","viewport-width","body-class","body-style","is-rtl","background-type","is-grid"])):(e.openBlock(),e.createElementBlock("p",ot,"No component to render."))]),e.createElementVNode("div",nt,[e.createElementVNode("div",lt,[e.createElementVNode("button",{class:e.normalizeClass(["tv-demo-tools-tab",{active:e.unref(w)==="playground"}]),onClick:t[27]||(t[27]=n=>w.value="playground")}," Playground ",2),e.createElementVNode("button",{class:e.normalizeClass(["tv-demo-tools-tab",{active:e.unref(w)==="events"}]),onClick:t[28]||(t[28]=n=>w.value="events")},[t[47]||(t[47]=e.createTextVNode(" Events ",-1)),e.unref(A).length>0?(e.openBlock(),e.createElementBlock("span",at,e.toDisplayString(e.unref(A).length),1)):e.createCommentVNode("",!0)],2),e.createElementVNode("button",{class:e.normalizeClass(["tv-demo-tools-tab",{active:e.unref(w)==="code"}]),onClick:t[29]||(t[29]=n=>w.value="code")}," Code ",2)]),e.createElementVNode("div",rt,[e.withDirectives(e.createElementVNode("div",st,[e.createElementVNode("div",it,[t[48]||(t[48]=e.createElementVNode("h3",{class:"tv-demo-tool-title"},"Props",-1)),e.createElementVNode("button",{class:"tv-demo-btn-secondary is-small",onClick:t[30]||(t[30]=(...n)=>e.unref(K)&&e.unref(K)(...n))}," Reset Props ")]),Object.keys(e.unref(u)).length>0?(e.openBlock(),e.createElementBlock("div",dt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:e.normalizeClass(["tv-demo-control-item",{"is-complex":typeof n=="object"&&n!==null}])},[typeof n!="object"||n===null?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",{class:"tv-demo-control-label",title:r},e.toDisplayString(r),9,ct),e.createElementVNode("div",ut,[typeof n=="boolean"?(e.openBlock(),e.createElementBlock("label",mt,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":p=>e.unref(u)[r]=p,id:`control-${r}`},null,8,vt),[[e.vModelCheckbox,e.unref(u)[r]]]),t[49]||(t[49]=e.createElementVNode("span",{class:"slider round"},null,-1))])):typeof n=="number"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":p=>e.unref(u)[r]=p,type:"number",class:"tv-demo-input",id:`control-${r}`},null,8,pt)),[[e.vModelText,e.unref(u)[r],void 0,{number:!0}]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":p=>e.unref(u)[r]=p,type:"text",class:"tv-demo-input",id:`control-${r}`},null,8,ft)),[[e.vModelText,e.unref(u)[r]]])])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[typeof n=="string"&&(r.toLowerCase().includes("color")||r.toLowerCase().includes("background")||/^#([0-9A-F]{3}){1,2}$/i.test(n))?(e.openBlock(),e.createElementBlock("div",ht,[e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":p=>e.unref(u)[r]=p,id:`control-color-${r}`,class:"tv-demo-color-picker"},null,8,kt),[[e.vModelText,e.unref(u)[r]]]),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p=>e.unref(u)[r]=p,type:"text",class:"tv-demo-input",id:`control-${r}`},null,8,wt),[[e.vModelText,e.unref(u)[r]]])])):(e.openBlock(),e.createBlock(e.unref(H),{key:1,modelValue:e.unref(u)[r],"onUpdate:modelValue":p=>e.unref(u)[r]=p,name:r},null,8,["modelValue","onUpdate:modelValue","name"]))],64))],2))),128))])):(e.openBlock(),e.createElementBlock("div",gt," No props available for this component. "))],512),[[e.vShow,e.unref(w)==="playground"]]),e.unref(w)==="events"?(e.openBlock(),e.createElementBlock("div",yt,[e.createElementVNode("div",bt,[t[50]||(t[50]=e.createElementVNode("h3",{class:"tv-demo-tool-title"},"Event Logger",-1)),e.unref(A).length>0?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:t[31]||(t[31]=(...n)=>e.unref(U)&&e.unref(U)(...n)),class:"tv-demo-btn-secondary is-small"},"Clear")):e.createCommentVNode("",!0)]),e.createElementVNode("div",Et,[e.unref(A).length===0?(e.openBlock(),e.createElementBlock("div",Vt," Listening for events... ")):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(A),n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,class:"tv-demo-log-item"},[e.createElementVNode("span",Ct,e.toDisplayString(n.timestamp),1),e.createElementVNode("span",Nt,e.toDisplayString(n.eventName),1),n.payload!==void 0?(e.openBlock(),e.createElementBlock("span",Bt,e.toDisplayString(JSON.stringify(n.payload)),1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.unref(w)==="code"?(e.openBlock(),e.createElementBlock("div",xt,[e.createElementVNode("div",Tt,[e.createElementVNode("div",Dt,[t[51]||(t[51]=e.createElementVNode("h3",{class:"tv-demo-tool-title"},"Generated Code",-1)),e.unref(J).length>1?(e.openBlock(),e.createElementBlock("div",St,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(J),n=>(e.openBlock(),e.createElementBlock("button",{key:n,class:e.normalizeClass(["tv-demo-code-tab",{active:e.unref(Z)===n}]),onClick:r=>Z.value=n},e.toDisplayString(n),11,$t))),128))])):e.createCommentVNode("",!0)]),e.createElementVNode("button",{class:"tv-demo-btn-secondary is-small",onClick:t[32]||(t[32]=n=>e.unref(ue)(e.unref(Q)))}," Copy Code ")]),e.unref(Q)?(e.openBlock(),e.createBlock(e.unref(Ee.HighCode),{class:"tv-demo-code",key:e.unref(Z),codeValue:e.unref(Q),theme:e.unref(k),lang:e.unref(ve),codeLines:"",height:"auto",copy:!1},null,8,["codeValue","theme","lang"])):(e.openBlock(),e.createElementBlock("div",zt," No code available for this variant. "))])):e.createCommentVNode("",!0)])])])],2),[[e.vShow,e.unref(b)==="demo"]]),e.unref(b)==="docs"&&a.showDocumentation?(e.openBlock(),e.createElementBlock("div",Lt,[e.unref(ne)?(e.openBlock(),e.createElementBlock("div",Mt,[e.createVNode(e.unref(ke),{source:e.unref(ne),html:""},null,8,["source"])])):(e.openBlock(),e.createElementBlock("div",Pt,"No documentation available."))])):e.createCommentVNode("",!0),e.unref(b)==="changelog"&&a.showChangelog?(e.openBlock(),e.createElementBlock("div",At,[e.unref(le)?(e.openBlock(),e.createElementBlock("div",It,[e.createVNode(e.unref(ke),{source:e.unref(le),html:""},null,8,["source"])])):(e.openBlock(),e.createElementBlock("div",Rt,"No changelog available."))])):e.createCommentVNode("",!0)])])])],6)],6),e.createElementVNode("footer",{class:e.normalizeClass(["tv-demo-footer",`${e.unref(k)}-mode`])},[e.createElementVNode("div",Ut,[e.createElementVNode("div",Ot,[e.createElementVNode("div",_t,[t[52]||(t[52]=e.createElementVNode("span",{class:"tv-demo-footer-logo"},[e.createElementVNode("img",{src:"https://res.cloudinary.com/denj4fg7f/image/upload/v1766183906/icono_git_bvxian.png",alt:"Icon TODOvue"})],-1)),e.createElementVNode("span",Ft,e.toDisplayString(a.componentName),1),e.createElementVNode("span",Gt,"v"+e.toDisplayString(a.version),1)]),t[53]||(t[53]=e.createStaticVNode('<div class="tv-demo-footer-info"><p class="tv-demo-footer-text"> Designed & Developed by <a href="https://cris-dev.com/" target="_blank" rel="noopener noreferrer" class="tv-demo-footer-link"> cris-dev.com </a></p><div class="tv-demo-footer-divider"></div><p class="tv-demo-footer-text"> Made with <span class="tv-demo-footer-heart">💙</span> using Vue.js </p></div>',1))]),e.createElementVNode("div",Ht,[e.createElementVNode("p",jt," © "+e.toDisplayString(new Date().getFullYear())+" TODOvue. All rights reserved. ",1)])])],2),e.createVNode(e.unref(V),{toasts:e.unref(v),onRemoveToast:e.unref(re)},null,8,["toasts","onRemoveToast"]),e.createVNode(e.unref(I),{theme:e.unref(k),"scroll-target":".tv-demo-body","aria-label":"Back to top"},null,8,["theme"])],64))}};oe.install=a=>{a.component("TvDemo",oe)};const Wt={install(a){a.component("TvDemo",oe)}};exports.TvDemo=oe;exports.TvDemoPlugin=Wt;exports.default=oe;
|