@todovue/tv-demo 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/dist/ToastContainer-B-rxasZF.cjs +1 -0
- package/dist/{ToastContainer-NkcFPXPf.js → ToastContainer-CE5R5EYY.js} +33 -37
- package/dist/TvNestedEditor-C6zgg9gF.cjs +1 -0
- package/dist/TvNestedEditor-CKecNU0_.js +102 -0
- package/dist/TvPreviewFrame-DrvEF6dP.js +134 -0
- package/dist/TvPreviewFrame-wX7qsqM6.cjs +1 -0
- package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/tv-demo.cjs.js +1 -1
- package/dist/tv-demo.css +1 -1
- package/dist/tv-demo.es.js +600 -515
- package/package.json +3 -3
- package/dist/ToastContainer-Cx0oFM8l.cjs +0 -1
package/README.md
CHANGED
|
@@ -27,7 +27,6 @@ A flexible, framework-agnostic Vue 3 component catalog for demos, documentation,
|
|
|
27
27
|
- [Events](#events)
|
|
28
28
|
- [Customization (Styles)](#customization-styles)
|
|
29
29
|
- [SSR Notes](#ssr-notes)
|
|
30
|
-
- [Roadmap](#roadmap)
|
|
31
30
|
- [Development](#development)
|
|
32
31
|
- [Contributing](#contributing)
|
|
33
32
|
- [License](#license)
|
|
@@ -153,6 +152,7 @@ import { TvDemo } from '@todovue/tv-demo'
|
|
|
153
152
|
| readmePath | String | `./README.md` | Path to the README file of the component | `false` |
|
|
154
153
|
| showDocumentation | Boolean | `true` | Show or hide the documentation tab | `false` |
|
|
155
154
|
| showChangelog | Boolean | `true` | Show or hide the changelog tab | `false` |
|
|
155
|
+
| manualEmits | Array | `[]` | List of event names to listen relative to the component | `false` |
|
|
156
156
|
|
|
157
157
|
---
|
|
158
158
|
## Events
|
|
@@ -165,6 +165,15 @@ Usage:
|
|
|
165
165
|
<TvDemo @select-demo="onSelectDemo" />
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
+
Manual Emits (for async components):
|
|
169
|
+
```vue
|
|
170
|
+
<TvDemo
|
|
171
|
+
:component="AsyncComponent"
|
|
172
|
+
:manual-emits="['click', 'submit']"
|
|
173
|
+
:variants="demos"
|
|
174
|
+
/>
|
|
175
|
+
```
|
|
176
|
+
|
|
168
177
|
---
|
|
169
178
|
## Customization (Styles)
|
|
170
179
|
- All global and highlight.js styles are injected automatically.
|
|
@@ -196,15 +205,6 @@ You can provide colors for both `dark` and `light` themes, or just one. Defaults
|
|
|
196
205
|
- Code highlighting works in both Vite and Nuxt.
|
|
197
206
|
- Markdown documentation is supported by placing your `README.md` in the `public/` folder and referencing it via the `readmePath` prop.
|
|
198
207
|
|
|
199
|
-
---
|
|
200
|
-
## Roadmap
|
|
201
|
-
| Item | Status |
|
|
202
|
-
|--------------------------------------|-------------|
|
|
203
|
-
| More highlight.js themes | Planned |
|
|
204
|
-
| Advanced integration examples | Planned |
|
|
205
|
-
| Accessibility improvements | Planned |
|
|
206
|
-
| Dark mode support | Considering |
|
|
207
|
-
|
|
208
208
|
---
|
|
209
209
|
## Development
|
|
210
210
|
```bash
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),d={class:"toast-content"},m={class:"toast-message"},p={__name:"ToastNotification",props:{id:{type:String,required:!0},message:{type:String,required:!0},type:{type:String,default:"success"},duration:{type:Number,default:3e3}},emits:["remove"],setup(s,{emit:n}){const o=s,a=n,r=e.ref(!1),c=e.ref(!1);e.onMounted(()=>{setTimeout(()=>{r.value=!0},10),setTimeout(()=>{t()},o.duration)});const t=()=>{c.value=!0,setTimeout(()=>{a("remove",o.id)},300)},l=()=>{switch(o.type){case"success":return"✓";case"error":return"✕";case"warning":return"⚠";case"info":return"ℹ";default:return"✓"}},i=()=>{switch(o.type){case"success":return"#22c55e";case"error":return"#ef4444";case"warning":return"#f59e0b";case"info":return"#3b82f6";default:return"#22c55e"}};return(y,T)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["toast-notification",[s.type,{visible:r.value,leaving:c.value}]])},[e.createElementVNode("div",{class:"toast-icon",style:e.normalizeStyle({backgroundColor:`${i()}20`,color:i()})},e.toDisplayString(l()),5),e.createElementVNode("div",d,[e.createElementVNode("p",m,e.toDisplayString(s.message),1)]),e.createElementVNode("button",{class:"toast-close",onClick:t,"aria-label":"Cerrar notificación"}," ✕ ")],2))}},_=u._export_sfc(p,[["__scopeId","data-v-84ed156b"]]),f={class:"toast-container"},g={__name:"ToastContainer",props:{toasts:{type:Array,required:!0}},emits:["removeToast"],setup(s,{emit:n}){const o=n,a=r=>{o("removeToast",r)};return(r,c)=>(e.openBlock(),e.createElementBlock("div",f,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.toasts,t=>(e.openBlock(),e.createBlock(_,{key:t.id,id:t.id,message:t.message,type:t.type,duration:t.duration,onRemove:a},null,8,["id","message","type","duration"]))),128))]))}},v=u._export_sfc(g,[["__scopeId","data-v-25add11c"]]);exports.default=v;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { ref as d, onMounted as _, createElementBlock as u, openBlock as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
for (const [n, o] of r)
|
|
5
|
-
e[n] = o;
|
|
6
|
-
return e;
|
|
7
|
-
}, h = { class: "toast-content" }, k = { class: "toast-message" }, C = {
|
|
1
|
+
import { ref as d, onMounted as _, createElementBlock as u, openBlock as a, normalizeClass as v, createElementVNode as r, normalizeStyle as g, toDisplayString as m, Fragment as y, renderList as T, createBlock as b } from "vue";
|
|
2
|
+
import { _ as p } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const h = { class: "toast-content" }, C = { class: "toast-message" }, k = {
|
|
8
4
|
__name: "ToastNotification",
|
|
9
5
|
props: {
|
|
10
6
|
id: { type: String, required: !0 },
|
|
@@ -13,21 +9,21 @@ const p = (t, r) => {
|
|
|
13
9
|
duration: { type: Number, default: 3e3 }
|
|
14
10
|
},
|
|
15
11
|
emits: ["remove"],
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
12
|
+
setup(s, { emit: n }) {
|
|
13
|
+
const t = s, i = n, o = d(!1), c = d(!1);
|
|
18
14
|
_(() => {
|
|
19
15
|
setTimeout(() => {
|
|
20
16
|
o.value = !0;
|
|
21
17
|
}, 10), setTimeout(() => {
|
|
22
|
-
|
|
23
|
-
},
|
|
18
|
+
e();
|
|
19
|
+
}, t.duration);
|
|
24
20
|
});
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
const e = () => {
|
|
22
|
+
c.value = !0, setTimeout(() => {
|
|
23
|
+
i("remove", t.id);
|
|
28
24
|
}, 300);
|
|
29
25
|
}, f = () => {
|
|
30
|
-
switch (
|
|
26
|
+
switch (t.type) {
|
|
31
27
|
case "success":
|
|
32
28
|
return "✓";
|
|
33
29
|
case "error":
|
|
@@ -40,7 +36,7 @@ const p = (t, r) => {
|
|
|
40
36
|
return "✓";
|
|
41
37
|
}
|
|
42
38
|
}, l = () => {
|
|
43
|
-
switch (
|
|
39
|
+
switch (t.type) {
|
|
44
40
|
case "success":
|
|
45
41
|
return "#22c55e";
|
|
46
42
|
case "error":
|
|
@@ -53,45 +49,45 @@ const p = (t, r) => {
|
|
|
53
49
|
return "#22c55e";
|
|
54
50
|
}
|
|
55
51
|
};
|
|
56
|
-
return (I, N) => (
|
|
57
|
-
class: v(["toast-notification", [
|
|
52
|
+
return (I, N) => (a(), u("div", {
|
|
53
|
+
class: v(["toast-notification", [s.type, { visible: o.value, leaving: c.value }]])
|
|
58
54
|
}, [
|
|
59
|
-
|
|
55
|
+
r("div", {
|
|
60
56
|
class: "toast-icon",
|
|
61
57
|
style: g({ backgroundColor: `${l()}20`, color: l() })
|
|
62
58
|
}, m(f()), 5),
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
r("div", h, [
|
|
60
|
+
r("p", C, m(s.message), 1)
|
|
65
61
|
]),
|
|
66
|
-
|
|
62
|
+
r("button", {
|
|
67
63
|
class: "toast-close",
|
|
68
|
-
onClick:
|
|
64
|
+
onClick: e,
|
|
69
65
|
"aria-label": "Cerrar notificación"
|
|
70
66
|
}, " ✕ ")
|
|
71
67
|
], 2));
|
|
72
68
|
}
|
|
73
|
-
}, S = /* @__PURE__ */ p(
|
|
69
|
+
}, S = /* @__PURE__ */ p(k, [["__scopeId", "data-v-84ed156b"]]), w = { class: "toast-container" }, x = {
|
|
74
70
|
__name: "ToastContainer",
|
|
75
71
|
props: {
|
|
76
72
|
toasts: { type: Array, required: !0 }
|
|
77
73
|
},
|
|
78
74
|
emits: ["removeToast"],
|
|
79
|
-
setup(
|
|
80
|
-
const
|
|
81
|
-
|
|
75
|
+
setup(s, { emit: n }) {
|
|
76
|
+
const t = n, i = (o) => {
|
|
77
|
+
t("removeToast", o);
|
|
82
78
|
};
|
|
83
|
-
return (o,
|
|
84
|
-
(
|
|
85
|
-
key:
|
|
86
|
-
id:
|
|
87
|
-
message:
|
|
88
|
-
type:
|
|
89
|
-
duration:
|
|
90
|
-
onRemove:
|
|
79
|
+
return (o, c) => (a(), u("div", w, [
|
|
80
|
+
(a(!0), u(y, null, T(s.toasts, (e) => (a(), b(S, {
|
|
81
|
+
key: e.id,
|
|
82
|
+
id: e.id,
|
|
83
|
+
message: e.message,
|
|
84
|
+
type: e.type,
|
|
85
|
+
duration: e.duration,
|
|
86
|
+
onRemove: i
|
|
91
87
|
}, null, 8, ["id", "message", "type", "duration"]))), 128))
|
|
92
88
|
]));
|
|
93
89
|
}
|
|
94
|
-
},
|
|
90
|
+
}, $ = /* @__PURE__ */ p(x, [["__scopeId", "data-v-25add11c"]]);
|
|
95
91
|
export {
|
|
96
|
-
|
|
92
|
+
$ as default
|
|
97
93
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),y={key:0,class:"tv-nested-row"},B=["title"],E={class:"tv-nested-input-wrapper"},g={key:0,class:"switch small"},h=["checked"],b=["value"],N=["value"],f={key:3,class:"tv-nested-null"},S={key:1,class:"tv-nested-complex"},C={class:"tv-nested-label"},A={class:"tv-nested-type"},w={key:0,class:"tv-nested-children"},x={__name:"TvNestedEditor",props:{modelValue:{type:[Object,Array,String,Number,Boolean,null],default:void 0},name:{type:[String,Number],required:!0},depth:{type:Number,default:0}},emits:["update:modelValue"],setup(l,{emit:v}){const o=l,i=v,s=e.ref(!1),a=e.computed(()=>o.modelValue===null?"null":Array.isArray(o.modelValue)?"array":typeof o.modelValue),m=e.computed(()=>["string","number","boolean","null","undefined"].includes(a.value)),p=()=>{m.value||(s.value=!s.value)},r=d=>{i("update:modelValue",d)},k=(d,t)=>{const u=Array.isArray(o.modelValue)?[...o.modelValue]:{...o.modelValue};u[d]=t,i("update:modelValue",u)};return(d,t)=>{const u=e.resolveComponent("TvNestedEditor",!0);return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tv-nested-editor",{"is-root":l.depth===0}])},[m.value?(e.openBlock(),e.createElementBlock("div",y,[e.createElementVNode("span",{class:"tv-nested-label",title:String(l.name)},e.toDisplayString(l.name),9,B),e.createElementVNode("div",E,[a.value==="boolean"?(e.openBlock(),e.createElementBlock("label",g,[e.createElementVNode("input",{type:"checkbox",checked:l.modelValue,onChange:t[0]||(t[0]=n=>r(n.target.checked))},null,40,h),t[3]||(t[3]=e.createElementVNode("span",{class:"slider round"},null,-1))])):a.value==="number"?(e.openBlock(),e.createElementBlock("input",{key:1,type:"number",value:l.modelValue,onInput:t[1]||(t[1]=n=>r(Number(n.target.value))),class:"tv-demo-input"},null,40,b)):a.value==="string"?(e.openBlock(),e.createElementBlock("input",{key:2,type:"text",value:l.modelValue,onInput:t[2]||(t[2]=n=>r(n.target.value)),class:"tv-demo-input"},null,40,N)):(e.openBlock(),e.createElementBlock("span",f,"null"))])])):(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("div",{class:e.normalizeClass(["tv-nested-header",{"is-open":s.value}]),onClick:p},[t[4]||(t[4]=e.createElementVNode("span",{class:"tv-nested-arrow"},"▶",-1)),e.createElementVNode("span",C,[e.createTextVNode(e.toDisplayString(l.name)+" ",1),e.createElementVNode("span",A,e.toDisplayString(a.value==="array"?`Array[${l.modelValue.length}]`:"Object"),1)])],2),s.value?(e.openBlock(),e.createElementBlock("div",w,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.modelValue,(n,c)=>(e.openBlock(),e.createBlock(u,{key:c,name:c,"model-value":n,depth:l.depth+1,"onUpdate:modelValue":V=>k(c,V)},null,8,["name","model-value","depth","onUpdate:modelValue"]))),128))])):e.createCommentVNode("",!0)]))],2)}}};exports.default=x;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { ref as N, computed as V, resolveComponent as x, createElementBlock as n, openBlock as l, normalizeClass as h, createElementVNode as a, toDisplayString as v, createCommentVNode as A, createTextVNode as C, Fragment as w, renderList as E, createBlock as B } from "vue";
|
|
2
|
+
const S = {
|
|
3
|
+
key: 0,
|
|
4
|
+
class: "tv-nested-row"
|
|
5
|
+
}, T = ["title"], O = { class: "tv-nested-input-wrapper" }, U = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "switch small"
|
|
8
|
+
}, j = ["checked"], I = ["value"], _ = ["value"], q = {
|
|
9
|
+
key: 3,
|
|
10
|
+
class: "tv-nested-null"
|
|
11
|
+
}, z = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "tv-nested-complex"
|
|
14
|
+
}, D = { class: "tv-nested-label" }, F = { class: "tv-nested-type" }, L = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "tv-nested-children"
|
|
17
|
+
}, $ = {
|
|
18
|
+
__name: "TvNestedEditor",
|
|
19
|
+
props: {
|
|
20
|
+
modelValue: {
|
|
21
|
+
type: [Object, Array, String, Number, Boolean, null],
|
|
22
|
+
default: void 0
|
|
23
|
+
},
|
|
24
|
+
name: {
|
|
25
|
+
type: [String, Number],
|
|
26
|
+
required: !0
|
|
27
|
+
},
|
|
28
|
+
depth: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: 0
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
emits: ["update:modelValue"],
|
|
34
|
+
setup(t, { emit: b }) {
|
|
35
|
+
const o = t, p = b, u = N(!1), d = V(() => o.modelValue === null ? "null" : Array.isArray(o.modelValue) ? "array" : typeof o.modelValue), y = V(() => ["string", "number", "boolean", "null", "undefined"].includes(d.value)), g = () => {
|
|
36
|
+
y.value || (u.value = !u.value);
|
|
37
|
+
}, m = (r) => {
|
|
38
|
+
p("update:modelValue", r);
|
|
39
|
+
}, k = (r, e) => {
|
|
40
|
+
const i = Array.isArray(o.modelValue) ? [...o.modelValue] : { ...o.modelValue };
|
|
41
|
+
i[r] = e, p("update:modelValue", i);
|
|
42
|
+
};
|
|
43
|
+
return (r, e) => {
|
|
44
|
+
const i = x("TvNestedEditor", !0);
|
|
45
|
+
return l(), n("div", {
|
|
46
|
+
class: h(["tv-nested-editor", { "is-root": t.depth === 0 }])
|
|
47
|
+
}, [
|
|
48
|
+
y.value ? (l(), n("div", S, [
|
|
49
|
+
a("span", {
|
|
50
|
+
class: "tv-nested-label",
|
|
51
|
+
title: String(t.name)
|
|
52
|
+
}, v(t.name), 9, T),
|
|
53
|
+
a("div", O, [
|
|
54
|
+
d.value === "boolean" ? (l(), n("label", U, [
|
|
55
|
+
a("input", {
|
|
56
|
+
type: "checkbox",
|
|
57
|
+
checked: t.modelValue,
|
|
58
|
+
onChange: e[0] || (e[0] = (s) => m(s.target.checked))
|
|
59
|
+
}, null, 40, j),
|
|
60
|
+
e[3] || (e[3] = a("span", { class: "slider round" }, null, -1))
|
|
61
|
+
])) : d.value === "number" ? (l(), n("input", {
|
|
62
|
+
key: 1,
|
|
63
|
+
type: "number",
|
|
64
|
+
value: t.modelValue,
|
|
65
|
+
onInput: e[1] || (e[1] = (s) => m(Number(s.target.value))),
|
|
66
|
+
class: "tv-demo-input"
|
|
67
|
+
}, null, 40, I)) : d.value === "string" ? (l(), n("input", {
|
|
68
|
+
key: 2,
|
|
69
|
+
type: "text",
|
|
70
|
+
value: t.modelValue,
|
|
71
|
+
onInput: e[2] || (e[2] = (s) => m(s.target.value)),
|
|
72
|
+
class: "tv-demo-input"
|
|
73
|
+
}, null, 40, _)) : (l(), n("span", q, "null"))
|
|
74
|
+
])
|
|
75
|
+
])) : (l(), n("div", z, [
|
|
76
|
+
a("div", {
|
|
77
|
+
class: h(["tv-nested-header", { "is-open": u.value }]),
|
|
78
|
+
onClick: g
|
|
79
|
+
}, [
|
|
80
|
+
e[4] || (e[4] = a("span", { class: "tv-nested-arrow" }, "▶", -1)),
|
|
81
|
+
a("span", D, [
|
|
82
|
+
C(v(t.name) + " ", 1),
|
|
83
|
+
a("span", F, v(d.value === "array" ? `Array[${t.modelValue.length}]` : "Object"), 1)
|
|
84
|
+
])
|
|
85
|
+
], 2),
|
|
86
|
+
u.value ? (l(), n("div", L, [
|
|
87
|
+
(l(!0), n(w, null, E(t.modelValue, (s, c) => (l(), B(i, {
|
|
88
|
+
key: c,
|
|
89
|
+
name: c,
|
|
90
|
+
"model-value": s,
|
|
91
|
+
depth: t.depth + 1,
|
|
92
|
+
"onUpdate:modelValue": (f) => k(c, f)
|
|
93
|
+
}, null, 8, ["name", "model-value", "depth", "onUpdate:modelValue"]))), 128))
|
|
94
|
+
])) : A("", !0)
|
|
95
|
+
]))
|
|
96
|
+
], 2);
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
export {
|
|
101
|
+
$ as default
|
|
102
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { ref as C, onMounted as O, onBeforeUnmount as _, watch as S, createElementBlock as B, openBlock as I, normalizeStyle as k, createElementVNode as A, createApp as h, h as v, nextTick as g } from "vue";
|
|
2
|
+
import { _ as P } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const N = ["title"], D = {
|
|
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
|
+
},
|
|
31
|
+
emits: [],
|
|
32
|
+
setup(a, { emit: L }) {
|
|
33
|
+
const o = a, s = C(null);
|
|
34
|
+
let r = null, l = null, c = null;
|
|
35
|
+
const d = (e, t) => {
|
|
36
|
+
if (e.tagName === "LINK" && (e.rel === "stylesheet" || e.href.includes(".css"))) {
|
|
37
|
+
const n = t.createElement("link");
|
|
38
|
+
return n.rel = "stylesheet", n.href = e.href, n;
|
|
39
|
+
}
|
|
40
|
+
if (e.tagName === "STYLE") {
|
|
41
|
+
const n = t.createElement("style");
|
|
42
|
+
return n.textContent = e.textContent, new MutationObserver(() => {
|
|
43
|
+
n.textContent = e.textContent;
|
|
44
|
+
}).observe(e, { characterData: !0, childList: !0 }), n;
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}, w = (e) => {
|
|
48
|
+
c && c.disconnect(), Array.from(document.querySelectorAll('link[rel="stylesheet"], link[href*=".css"], style')).forEach((n) => {
|
|
49
|
+
const i = d(n, e);
|
|
50
|
+
i && e.head.appendChild(i);
|
|
51
|
+
}), c = new MutationObserver((n) => {
|
|
52
|
+
n.forEach((i) => {
|
|
53
|
+
i.addedNodes.forEach((x) => {
|
|
54
|
+
const b = d(x, e);
|
|
55
|
+
b && e.head.appendChild(b);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}), c.observe(document.head, { childList: !0, subtree: !1 });
|
|
59
|
+
}, y = (e) => {
|
|
60
|
+
!e || !e.body || (e.body.className = o.bodyClass, Object.assign(e.body.style, o.bodyStyle), e.body.style.margin = "0", e.body.style.display = "flex", e.body.style.flexDirection = "column", e.body.style.alignItems = "stretch", e.body.style.boxSizing = "border-box", e.body.style.padding = "0");
|
|
61
|
+
}, m = (e) => {
|
|
62
|
+
if (!e) return;
|
|
63
|
+
const t = e.getElementById("app");
|
|
64
|
+
t && (t.style.display = "grid", t.style.width = "100%");
|
|
65
|
+
}, p = () => {
|
|
66
|
+
if (!s.value) return;
|
|
67
|
+
const e = s.value.contentDocument;
|
|
68
|
+
if (!e || !e.body) return;
|
|
69
|
+
const t = e.getElementById("app");
|
|
70
|
+
let n = 0;
|
|
71
|
+
t && (n = t.getBoundingClientRect().height);
|
|
72
|
+
const i = n + 40;
|
|
73
|
+
s.value.style.height = `${i + 50}px`;
|
|
74
|
+
}, f = (e) => {
|
|
75
|
+
if (l && l.disconnect(), l = new ResizeObserver(() => {
|
|
76
|
+
p();
|
|
77
|
+
}), e.body) {
|
|
78
|
+
l.observe(e.body);
|
|
79
|
+
const t = e.getElementById("app");
|
|
80
|
+
t && l.observe(t);
|
|
81
|
+
}
|
|
82
|
+
}, u = () => {
|
|
83
|
+
if (!s.value) return;
|
|
84
|
+
const e = s.value.contentDocument || s.value.contentWindow.document;
|
|
85
|
+
e.open(), e.write('<!DOCTYPE html><html><head></head><body><div id="app"></div></body></html>'), e.close(), w(e), y(e), m(e);
|
|
86
|
+
const t = e.getElementById("app");
|
|
87
|
+
r && r.unmount(), r = h({
|
|
88
|
+
render() {
|
|
89
|
+
return v(o.component, o.componentProps);
|
|
90
|
+
}
|
|
91
|
+
}), r.mount(t), g(() => {
|
|
92
|
+
f(e), p();
|
|
93
|
+
});
|
|
94
|
+
}, E = () => {
|
|
95
|
+
if (!s.value) return;
|
|
96
|
+
const e = s.value.contentDocument;
|
|
97
|
+
if (!e) return;
|
|
98
|
+
y(e), m(e);
|
|
99
|
+
let t = e.getElementById("app");
|
|
100
|
+
if (!t) {
|
|
101
|
+
u();
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
r && r.unmount(), r = h({
|
|
105
|
+
render() {
|
|
106
|
+
return v(o.component, o.componentProps);
|
|
107
|
+
}
|
|
108
|
+
}), r.mount(t), g(() => {
|
|
109
|
+
f(e), p();
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
return O(() => {
|
|
113
|
+
u();
|
|
114
|
+
}), _(() => {
|
|
115
|
+
r && r.unmount(), l && l.disconnect(), c && c.disconnect();
|
|
116
|
+
}), S(() => [o.component, o.componentProps, o.viewportWidth, o.bodyClass, o.bodyStyle], () => {
|
|
117
|
+
E();
|
|
118
|
+
}, { deep: !0 }), (e, t) => (I(), B("div", {
|
|
119
|
+
class: "tv-preview-frame-container",
|
|
120
|
+
style: k({ width: a.viewportWidth })
|
|
121
|
+
}, [
|
|
122
|
+
A("iframe", {
|
|
123
|
+
ref_key: "iframeRef",
|
|
124
|
+
ref: s,
|
|
125
|
+
title: a.title,
|
|
126
|
+
class: "tv-preview-frame",
|
|
127
|
+
onLoad: u
|
|
128
|
+
}, null, 40, N)
|
|
129
|
+
], 4));
|
|
130
|
+
}
|
|
131
|
+
}, T = /* @__PURE__ */ P(D, [["__scopeId", "data-v-e3820137"]]);
|
|
132
|
+
export {
|
|
133
|
+
T as default
|
|
134
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),E=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),x=["title"],O={__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:()=>({})}},emits:[],setup(u,{emit:_}){const r=u,s=o.ref(null);let l=null,i=null,a=null;const y=(e,t)=>{if(e.tagName==="LINK"&&(e.rel==="stylesheet"||e.href.includes(".css"))){const n=t.createElement("link");return n.rel="stylesheet",n.href=e.href,n}if(e.tagName==="STYLE"){const n=t.createElement("style");return n.textContent=e.textContent,new MutationObserver(()=>{n.textContent=e.textContent}).observe(e,{characterData:!0,childList:!0}),n}return null},v=e=>{a&&a.disconnect(),Array.from(document.querySelectorAll('link[rel="stylesheet"], link[href*=".css"], style')).forEach(n=>{const c=y(n,e);c&&e.head.appendChild(c)}),a=new MutationObserver(n=>{n.forEach(c=>{c.addedNodes.forEach(w=>{const h=y(w,e);h&&e.head.appendChild(h)})})}),a.observe(document.head,{childList:!0,subtree:!1})},m=e=>{!e||!e.body||(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="stretch",e.body.style.boxSizing="border-box",e.body.style.padding="0")},f=e=>{if(!e)return;const t=e.getElementById("app");t&&(t.style.display="grid",t.style.width="100%")},p=()=>{if(!s.value)return;const e=s.value.contentDocument;if(!e||!e.body)return;const t=e.getElementById("app");let n=0;t&&(n=t.getBoundingClientRect().height);const c=n+40;s.value.style.height=`${c+50}px`},b=e=>{if(i&&i.disconnect(),i=new ResizeObserver(()=>{p()}),e.body){i.observe(e.body);const t=e.getElementById("app");t&&i.observe(t)}},d=()=>{if(!s.value)return;const e=s.value.contentDocument||s.value.contentWindow.document;e.open(),e.write('<!DOCTYPE html><html><head></head><body><div id="app"></div></body></html>'),e.close(),v(e),m(e),f(e);const t=e.getElementById("app");l&&l.unmount(),l=o.createApp({render(){return o.h(r.component,r.componentProps)}}),l.mount(t),o.nextTick(()=>{b(e),p()})},g=()=>{if(!s.value)return;const e=s.value.contentDocument;if(!e)return;m(e),f(e);let t=e.getElementById("app");if(!t){d();return}l&&l.unmount(),l=o.createApp({render(){return o.h(r.component,r.componentProps)}}),l.mount(t),o.nextTick(()=>{b(e),p()})};return o.onMounted(()=>{d()}),o.onBeforeUnmount(()=>{l&&l.unmount(),i&&i.disconnect(),a&&a.disconnect()}),o.watch(()=>[r.component,r.componentProps,r.viewportWidth,r.bodyClass,r.bodyStyle],()=>{g()},{deep:!0}),(e,t)=>(o.openBlock(),o.createElementBlock("div",{class:"tv-preview-frame-container",style:o.normalizeStyle({width:u.viewportWidth})},[o.createElementVNode("iframe",{ref_key:"iframeRef",ref:s,title:u.title,class:"tv-preview-frame",onLoad:d},null,40,x)],4))}},S=E._export_sfc(O,[["__scopeId","data-v-e3820137"]]);exports.default=S;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=(t,o)=>{const c=t.__vccOpts||t;for(const[r,s]of o)c[r]=s;return c};exports._export_sfc=e;
|
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"),se=require("vue-highlight-code"),Y=require("vue3-markdown-it"),P=72,X=6,ce=(a,y)=>a?.id??a?.title??`variant-${y}`,ie=(a={})=>`${a.title??""} ${a.description??""}`.toLowerCase(),de=a=>{const y=e.ref("dark"),x=e.ref([]),g=e.ref(""),T=e.ref(""),N=e.ref("demo"),f=e.ref(""),r=e.ref(null),E=e.ref(null),w=e.ref(360),p=e.ref("100%"),h=e.ref(0);let m=null,$=!1;const b=e.computed(()=>(a.variants||[]).map((t,l)=>({variant:t,index:l,key:ce(t,l),searchableText:ie(t)}))),I=e.computed(()=>b.value.length),c=e.computed(()=>{const t=f.value.trim().toLowerCase();return t?b.value.filter(l=>l.searchableText.includes(t)):b.value}),F=e.computed(()=>c.value.length),O=e.computed(()=>!!f.value.trim()&&c.value.length===0),L=()=>{w.value=E.value?.clientHeight||w.value},u=()=>{$&&(window.removeEventListener("resize",L),$=!1)};e.watch(()=>E.value,t=>{if(m&&(m.disconnect(),m=null),!t){u();return}e.nextTick(()=>{L(),typeof ResizeObserver<"u"?(m=new ResizeObserver(l=>{const i=l?.[0];i&&(w.value=i.contentRect.height)}),m.observe(t)):$||(window.addEventListener("resize",L),$=!0)})});const V=e.ref(!1);let R=null;const A=()=>{if(typeof window>"u")return;const t=new URL(window.location.href);N.value&&N.value!=="demo"?t.searchParams.set("tab",N.value):t.searchParams.delete("tab"),f.value?t.searchParams.set("search",f.value):t.searchParams.delete("search"),r.value?t.searchParams.set("variant",r.value):t.searchParams.delete("variant"),t.href!==window.location.href&&window.history.replaceState(window.history.state,"",t.href)};e.watch([N,f,r],()=>{V.value&&(clearTimeout(R),R=setTimeout(A,300))}),e.onMounted(()=>{const t=localStorage.getItem("theme");if(t&&(y.value=t),typeof window<"u"){const l=new URLSearchParams(window.location.search),i=l.get("tab");i&&(N.value=i);const C=l.get("search");C&&(f.value=C);const q=l.get("variant");if(q){const W=b.value.find(re=>String(re.key)===q);r.value=W?W.key:q}V.value=!0}e.nextTick(L)}),e.onBeforeUnmount(()=>{m&&(m.disconnect(),m=null),u()});const U=async()=>{try{const t=await fetch(a.readmePath);if(!t.ok)throw new Error("README.md not found");g.value=await t.text()}catch{g.value="Documentation not found."}},K=async()=>{try{const t=await fetch(a.changelogPath);if(!t.ok)throw new Error("CHANGELOG.md not found");T.value=await t.text()}catch{T.value="Changelog not found."}},z=()=>{y.value=y.value==="dark"?"light":"dark",localStorage.setItem("theme",y.value)};e.watch(()=>b.value,t=>{if(!t.length){r.value=null;return}t.some(l=>l.key===r.value)||(r.value=t[0].key)},{immediate:!0}),e.watch(()=>c.value,t=>{if(!t.length){r.value=null;return}t.some(l=>l.key===r.value)||(r.value=t[0].key)});const d=t=>{E.value&&(E.value.scrollTop=t,h.value=t)};e.watch(f,()=>{d(0)});const B=e.computed(()=>c.value.findIndex(t=>t.key===r.value)),H=e.computed(()=>Math.max(1,Math.ceil(w.value/P))),S=e.computed(()=>Math.max(0,Math.floor(h.value/P)-X)),k=e.computed(()=>Math.min(c.value.length,S.value+H.value+X*2)),j=e.computed(()=>c.value.slice(S.value,k.value)),D=e.computed(()=>S.value*P),o=e.computed(()=>Math.max(0,(c.value.length-k.value)*P)),n=()=>{if(!E.value)return;const t=B.value;if(t<0)return;const l=S.value+2,i=k.value-3;if(t<l)d(Math.max(0,t*P));else if(t>i){const C=Math.max(0,t-H.value+1);d(C*P)}};e.watch(r,n);const s=e.computed(()=>O.value?{}:(c.value.find(l=>l.key===r.value)||b.value.find(l=>l.key===r.value)||c.value[0]||b.value[0])?.variant||{}),v=e.ref({});e.watch(()=>s.value,t=>{if(t?.propsData)try{v.value=JSON.parse(JSON.stringify(t.propsData))}catch{v.value={...t.propsData}}else v.value={}},{immediate:!0});const M=e.ref([]),Z=(t,l)=>{const i=new Date().toLocaleTimeString();M.value.unshift({id:Date.now()+Math.random(),timestamp:i,eventName:t,payload:l}),M.value.length>50&&(M.value=M.value.slice(0,50))},J=()=>{M.value=[]};e.watch(r,()=>{J()});const ee=t=>{h.value=t.target.scrollTop},Q=t=>{const l=c.value;if(!l.length)return;const i=B.value<0?0:B.value,C=Math.min(l.length-1,Math.max(0,i+t));r.value=l[C].key},te=t=>{switch(t.key){case"ArrowDown":t.preventDefault(),Q(1);break;case"ArrowUp":t.preventDefault(),Q(-1);break;case"Home":t.preventDefault(),c.value.length&&(r.value=c.value[0].key);break;case"End":t.preventDefault(),c.value.length&&(r.value=c.value[c.value.length-1].key);break}},oe=t=>{r.value=t},ne=e.computed(()=>{const t=y.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(()=>{G(`Copied to clipboard: ${l}`,"success",3e3)}).catch(i=>{G(`Failed to copy: ${i}`,"error",3e3)})},G=(t,l="success",i=3e3)=>{const C=`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;x.value.push({id:C,message:t,type:l,duration:i})},le=t=>{const l=x.value.findIndex(i=>i.id===t);l>-1&&x.value.splice(l,1)};return e.watchEffect(async()=>{await U(),await K()}),{customStyle:ne,toasts:x,readmeContent:g,changelogContent:T,selectedTab:N,searchQuery:f,selectedVariantKey:r,totalVariantsCount:I,filteredVariantsCount:F,variantsListRef:E,virtualizedVariants:j,virtualPaddingTop:D,virtualPaddingBottom:o,emptySearchState:O,theme:y,variant:s,addToast:G,removeToast:le,selectVariant:oe,setClickItem:ae,toggleTheme:z,handleVariantsScroll:ee,handleVariantsKeydown:te,reactiveProps:v,eventLogs:M,addLog:Z,clearLogs:J,viewportWidth:p}},me={key:0,class:"tv-demo-back-row"},ue={class:"tv-demo-case"},ve={class:"tv-demo-header"},fe={class:"tv-demo-links"},pe=["href"],he={key:1},ke={key:3},ye={class:"tv-demo-theme"},ge={class:"switch"},Ee=["checked"],be={class:"tv-demo-tabs"},Ve={key:0,class:"tv-demo-layout"},Ne={class:"tv-demo-sidebar-header"},Ce={class:"tv-demo-sidebar-meta"},we=["aria-activedescendant"],Be=["id","aria-selected","onClick"],Se={class:"tv-demo-variant-card-content"},De={class:"tv-demo-variant-card-title"},xe={class:"tv-demo-variant-card-description"},Te={key:1,class:"tv-demo-empty-state"},$e={class:"tv-demo-content","aria-live":"polite"},Le={class:"tv-demo-content-header"},Me={class:"tv-demo-viewport-controls"},Pe={class:"tv-demo-description"},ze={key:1,class:"tv-demo-empty-component"},_e={key:0,class:"tv-demo-controls-section"},Ie={class:"tv-demo-controls-grid"},Oe=["title"],Re={class:"tv-demo-control-input-wrapper"},Ae={key:0,class:"switch small"},Ue=["onUpdate:modelValue","id"],He=["onUpdate:modelValue","id"],Fe=["onUpdate:modelValue","id"],Ke=["value","onChange"],je={class:"tv-demo-controls-section"},Ge={class:"tv-demo-logs-header"},qe={class:"tv-demo-logs-container"},Je={key:0,class:"tv-demo-logs-empty"},Qe={class:"tv-demo-log-time"},We={class:"tv-demo-log-name"},Ye={key:0,class:"tv-demo-log-payload"},Xe={key:2,class:"tv-demo-empty-code"},Ze={key:1,class:"tv-demo-content"},et={key:0,class:"markdown-body"},tt={key:1},ot={key:2,class:"tv-demo-content"},nt={key:0,class:"markdown-body"},at={key:1},lt={class:"tv-demo-footer-content"},rt={class:"tv-demo-footer-main"},st={class:"tv-demo-footer-brand"},ct={class:"tv-demo-footer-brand-text"},it={class:"tv-demo-footer-brand-version"},dt={class:"tv-demo-footer-bottom"},mt={class:"tv-demo-footer-copyright"},_={__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}},setup(a){const y=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./ToastContainer-Cx0oFM8l.cjs"))),x=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./ToUp-CJUZN3du.cjs"))),g=a,T=e.ref(!1),N=()=>{typeof window>"u"||window.history.back()};e.onMounted(()=>{const D=window.history.length>1,o=typeof document<"u"&&!!document.referrer;T.value=D||o});const{customStyle:f,toasts:r,readmeContent:E,changelogContent:w,selectedTab:p,searchQuery:h,selectedVariantKey:m,totalVariantsCount:$,filteredVariantsCount:b,variantsListRef:I,virtualizedVariants:c,virtualPaddingTop:F,virtualPaddingBottom:O,emptySearchState:L,theme:u,variant:V,removeToast:R,setClickItem:A,toggleTheme:U,selectVariant:K,handleVariantsKeydown:z,reactiveProps:d,eventLogs:B,addLog:H,clearLogs:S,viewportWidth:k}=de(g),j=e.computed(()=>{const D={};return g.component&&g.component.emits&&(Array.isArray(g.component.emits)?g.component.emits:Object.keys(g.component.emits)).forEach(n=>{D[`on${n.charAt(0).toUpperCase()+n.slice(1)}`]=s=>{H(n,s)}}),D});return(D,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(u)}-mode tv-demo`),style:e.normalizeStyle(e.unref(f).body)},[e.createElementVNode("div",{class:e.normalizeClass(["tv-demo-body",{[`${e.unref(u)}-mode`]:!a.hideBackground}]),style:e.normalizeStyle(e.unref(f).content)},[T.value?(e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("button",{type:"button",class:"tv-demo-back-button","aria-label":"Back",onClick:N},"← Back")])):e.createCommentVNode("",!0),e.createElementVNode("div",ue,[e.createElementVNode("div",ve,[e.createElementVNode("div",null,[e.createElementVNode("div",fe,[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,pe)):e.createCommentVNode("",!0),a.sourceLink&&(a.npmInstall||a.urlClone)?(e.openBlock(),e.createElementBlock("span",he," | ")):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(A)("npm"))}," Copy install command ")):e.createCommentVNode("",!0),a.npmInstall&&a.urlClone?(e.openBlock(),e.createElementBlock("span",ke," | ")):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(A)("clone"))}," Copy repository clone URL ")):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[e.createElementVNode("div",ye,[o[17]||(o[17]=e.createElementVNode("span",{style:{"font-size":"0.9rem",opacity:"0.8"}},"Theme",-1)),e.createElementVNode("label",ge,[e.createElementVNode("input",{type:"checkbox",checked:e.unref(u)==="dark",onChange:o[2]||(o[2]=(...n)=>e.unref(U)&&e.unref(U)(...n))},null,40,Ee),o[16]||(o[16]=e.createElementVNode("span",{class:"slider round"},null,-1))])])])]),e.createElementVNode("div",be,[e.createElementVNode("button",{class:e.normalizeClass({active:e.unref(p)==="demo"}),onClick:o[3]||(o[3]=n=>p.value="demo")},"Demo",2),a.showDocumentation?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass({active:e.unref(p)==="docs"}),onClick:o[4]||(o[4]=n=>p.value="docs")},"Documentation",2)):e.createCommentVNode("",!0),a.showChangelog?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass({active:e.unref(p)==="changelog"}),onClick:o[5]||(o[5]=n=>p.value="changelog")},"Changelog",2)):e.createCommentVNode("",!0)]),e.unref(p)==="demo"?(e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("aside",{class:e.normalizeClass(["tv-demo-sidebar",`${e.unref(u)}-mode`])},[e.createElementVNode("div",Ne,[e.createElementVNode("div",null,[e.createElementVNode("p",Ce,e.toDisplayString(e.unref(b))+" / "+e.toDisplayString(e.unref($))+" variants",1),o[18]||(o[18]=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(I)?.scrollTo({top:0,behavior:"smooth"}))}," ⬆️ ")]),e.createElementVNode("label",{class:e.normalizeClass(["tv-demo-search",`${e.unref(u)}-mode`])},[o[19]||(o[19]=e.createElementVNode("span",{class:"tv-demo-search-icon"},"🔍",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[7]||(o[7]=n=>e.isRef(h)?h.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(z)(n),["prevent"]),["down"]))},null,544),[[e.vModelText,e.unref(h)]]),e.unref(h)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"tv-demo-search-clear","aria-label":"Clear search",onClick:o[9]||(o[9]=n=>h.value="")},"✕")):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(["tv-demo-variants",`${e.unref(u)}-mode`]),role:"listbox",tabindex:"0","aria-label":"Available variants","aria-activedescendant":e.unref(m)?`variant-${e.unref(m)}`:null,onKeydown:o[11]||(o[11]=(...n)=>e.unref(z)&&e.unref(z)(...n)),ref_key:"variantsListRef",ref:I},[e.createElementVNode("div",{style:e.normalizeStyle({paddingTop:`${e.unref(F)}px`,paddingBottom:`${e.unref(O)}px`})},[e.unref(L)?(e.openBlock(),e.createElementBlock("div",Te,[e.createElementVNode("p",null,'No matches for "'+e.toDisplayString(e.unref(h))+'".',1),e.createElementVNode("button",{class:"tv-demo-reset",type:"button",onClick:o[10]||(o[10]=n=>h.value="")},"Clear filter")])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(c),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(m)}]),role:"option","aria-selected":n.key===e.unref(m),onClick:s=>e.unref(K)(n.key)},[e.createElementVNode("span",Se,[e.createElementVNode("span",De,e.toDisplayString(n.variant.title),1),e.createElementVNode("span",xe,e.toDisplayString(n.variant.description),1)]),o[20]||(o[20]=e.createElementVNode("span",{class:"tv-demo-variant-card-icon"},"→",-1))],10,Be))),128))],4)],42,we)],2),e.createElementVNode("section",$e,[e.createElementVNode("div",Le,[e.createElementVNode("div",null,[o[21]||(o[21]=e.createElementVNode("p",{class:"tv-demo-content-label"},"Preview",-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(V).title||"Select a variant"),1)]),e.createElementVNode("div",Me,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["tv-demo-viewport-btn",{active:e.unref(k)==="375px"}]),onClick:o[12]||(o[12]=n=>k.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(k)==="768px"}]),onClick:o[13]||(o[13]=n=>k.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(k)==="100%"}]),onClick:o[14]||(o[14]=n=>k.value="100%"),"aria-label":"Desktop view (100%)",title:"Desktop (100%)"}," Desktop ",2)])]),e.createElementVNode("p",Pe,e.toDisplayString(e.unref(V).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(k)})},[e.unref(V)&&a.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.component),e.normalizeProps(e.mergeProps({key:0},{...e.unref(d),...j.value})),null,16)):(e.openBlock(),e.createElementBlock("p",ze,"No component to render."))],4),Object.keys(e.unref(d)).length>0?(e.openBlock(),e.createElementBlock("div",_e,[o[23]||(o[23]=e.createElementVNode("h3",null,"Playground",-1)),e.createElementVNode("div",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),(n,s)=>(e.openBlock(),e.createElementBlock("div",{key:s,class:"tv-demo-control-item"},[e.createElementVNode("span",{class:"tv-demo-control-label",title:s},e.toDisplayString(s),9,Oe),e.createElementVNode("div",Re,[typeof n=="boolean"?(e.openBlock(),e.createElementBlock("label",Ae,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":v=>e.unref(d)[s]=v,id:`control-${s}`},null,8,Ue),[[e.vModelCheckbox,e.unref(d)[s]]]),o[22]||(o[22]=e.createElementVNode("span",{class:"slider round"},null,-1))])):typeof n=="number"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":v=>e.unref(d)[s]=v,type:"number",class:"tv-demo-input",id:`control-${s}`},null,8,He)),[[e.vModelText,e.unref(d)[s],void 0,{number:!0}]]):typeof n=="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":v=>e.unref(d)[s]=v,type:"text",class:"tv-demo-input",id:`control-${s}`},null,8,Fe)),[[e.vModelText,e.unref(d)[s]]]):(e.openBlock(),e.createElementBlock("textarea",{key:3,value:JSON.stringify(n),onChange:v=>{try{e.unref(d)[s]=JSON.parse(v.target.value)}catch{}},class:"tv-demo-textarea",rows:"1"},null,40,Ke))])]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",je,[e.createElementVNode("div",Ge,[o[24]||(o[24]=e.createElementVNode("h3",null,"Event Logger",-1)),e.unref(B).length>0?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:o[15]||(o[15]=(...n)=>e.unref(S)&&e.unref(S)(...n)),class:"tv-demo-reset is-small"},"Clear")):e.createCommentVNode("",!0)]),e.createElementVNode("div",qe,[e.unref(B).length===0?(e.openBlock(),e.createElementBlock("div",Je," Listening for events... ")):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(B),n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,class:"tv-demo-log-item"},[e.createElementVNode("span",Qe,e.toDisplayString(n.timestamp),1),e.createElementVNode("span",We,e.toDisplayString(n.eventName),1),n.payload!==void 0?(e.openBlock(),e.createElementBlock("span",Ye,e.toDisplayString(JSON.stringify(n.payload)),1)):e.createCommentVNode("",!0)]))),128))])]),o[25]||(o[25]=e.createElementVNode("h3",null,"Code:",-1)),e.unref(V)?.html?(e.openBlock(),e.createBlock(e.unref(se.HighCode),{class:"tv-demo-code",codeValue:e.unref(V).html,theme:e.unref(u),lang:"html",codeLines:"",key:e.unref(V).title,height:"auto"},null,8,["codeValue","theme"])):(e.openBlock(),e.createElementBlock("p",Xe,"No snippet available."))])])):e.createCommentVNode("",!0),e.unref(p)==="docs"&&a.showDocumentation?(e.openBlock(),e.createElementBlock("div",Ze,[e.unref(E)?(e.openBlock(),e.createElementBlock("div",et,[e.createVNode(e.unref(Y),{source:e.unref(E),html:""},null,8,["source"])])):(e.openBlock(),e.createElementBlock("div",tt,"No documentation available."))])):e.createCommentVNode("",!0),e.unref(p)==="changelog"&&a.showChangelog?(e.openBlock(),e.createElementBlock("div",ot,[e.unref(w)?(e.openBlock(),e.createElementBlock("div",nt,[e.createVNode(e.unref(Y),{source:e.unref(w),html:""},null,8,["source"])])):(e.openBlock(),e.createElementBlock("div",at,"No changelog available."))])):e.createCommentVNode("",!0)])],6)],6),e.createElementVNode("footer",{class:e.normalizeClass(["tv-demo-footer",`${e.unref(u)}-mode`])},[e.createElementVNode("div",lt,[e.createElementVNode("div",rt,[e.createElementVNode("div",st,[o[26]||(o[26]=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",ct,e.toDisplayString(a.componentName),1),e.createElementVNode("span",it,"v"+e.toDisplayString(a.version),1)]),o[27]||(o[27]=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",dt,[e.createElementVNode("p",mt," © "+e.toDisplayString(new Date().getFullYear())+" TODOvue. All rights reserved. ",1)])])],2),e.createVNode(e.unref(y),{toasts:e.unref(r),onRemoveToast:e.unref(R)},null,8,["toasts","onRemoveToast"]),e.createVNode(e.unref(x),{theme:e.unref(u),"scroll-target":".tv-demo-body","aria-label":"Back to top"},null,8,["theme"])],64))}};_.install=a=>{a.component("TvDemo",_)};const ut={install(a){a.component("TvDemo",_)}};exports.TvDemo=_;exports.TvDemoPlugin=ut;exports.default=_;
|
|
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;
|