@bobbykim/manguito-theme 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +34 -17
- package/dist/composable.cjs +1 -1
- package/dist/composable.js +1 -1
- package/dist/core.cjs +2 -4
- package/dist/core.d.ts +5 -0
- package/dist/core.js +703 -1699
- package/dist/directives.cjs +1 -1
- package/dist/directives.d.ts +13 -10
- package/dist/directives.js +47 -41
- package/dist/{getGlassmorphismClass-C8vZx0NK.cjs → getGlassmorphismClass-DqCdKnYl.cjs} +1 -1
- package/dist/{getGlassmorphismClass-M90JAjcf.js → getGlassmorphismClass-d_Ji96-u.js} +1 -1
- package/dist/index-BjeE_nEZ.cjs +1 -0
- package/dist/{index-Ds9xkbnl.js → index-CDXrm85l.js} +186 -227
- package/dist/index-CsKLajvY.cjs +1 -0
- package/dist/index-CzXHE-4G.js +108 -0
- package/dist/useModalScrollLock-ONrBOk5v.js +56 -0
- package/dist/useModalScrollLock-X2enYbzG.cjs +1 -0
- package/dist/util.cjs +1 -1
- package/dist/util.d.ts +7 -0
- package/dist/util.js +1 -1
- package/package.json +4 -2
- package/dist/index-CCmGUrkn.cjs +0 -2
- package/dist/index-Dh_YZ5el.js +0 -703
- package/dist/index-DsWyi0z9.cjs +0 -1
- package/dist/useModalScrollLock-BbvxlEaZ.cjs +0 -1
- package/dist/useModalScrollLock-CPlcveJr.js +0 -58
package/dist/directives.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-BjeE_nEZ.cjs"),a=require("vue"),v=(t,e)=>{if(t.tagName==="A"){const o=t.getAttribute("href");return o?o.charAt(0)==="#"?o.substring(1):o:null}return e||null},p=t=>t?document.getElementById(t):null,f=t=>t.hasAttribute("visible"),u=t=>{const o=t.getAttribute("visible")==="true"?"false":"true";t.setAttribute("visible",o)},b=t=>{const e=`div[accordion="${t}"]`;return Array.from(document.querySelectorAll(e))},C=(t,e)=>{b(e).forEach(r=>{r.id===t.id?u(r):r.getAttribute("visible")==="true"&&r.setAttribute("visible","false")})},A=t=>{u(t)},h=t=>e=>{e.preventDefault();const o=e.target,r=v(o,t),l=p(r);if(!l){console.warn(`[v-collapse] Target element not found: ${r}`);return}if(!f(l)){console.warn(`[v-collapse] Target element missing 'visible' attribute: ${r}`);return}const n=l.getAttribute("accordion");n?C(l,n):A(l)};let d=!1;const H=()=>{d||(d=!0,console.warn("[v-collapse] v-collapse is sunsetted: no collapse component reacts to it, including the base Collapse. Call toggle() on a Collapse template ref or bind :visible, and wrap accordions in <AccordionGroup>. It will be removed in the next major release."))},k={mounted(t,e){H(),t.__HandleToggler=h(e.arg),t.addEventListener("click",t.__HandleToggler)},unmounted(t){t.__HandleToggler&&(t.removeEventListener("click",t.__HandleToggler),delete t.__HandleToggler)}},w=t=>e=>{e.preventDefault();const o=e.target,r=v(o,t),l=p(r);if(!l){console.warn(`[v-toggle] Target element not found: ${r}`);return}if(!f(l)){console.warn(`[v-toggle] Target element mission visible 'visible' attribute: ${r}`);return}u(l)},y={mounted(t,e){t.__ClickToggleHandler=w(e.arg),t.addEventListener("click",t.__ClickToggleHandler)},unmounted(t){t.__ClickToggleHandler&&(t.removeEventListener("click",t.__ClickToggleHandler),delete t.__ClickToggleHandler)}};let I=0;const c=(t,e,o,r)=>{if(t.hasAttribute(o))return t.getAttribute(o);if(typeof e.value=="object"&&e.value!==null&&r in e.value)return e.value[r]},E=(t,e)=>{if(t.hasAttribute("title"))return t.getAttribute("title")||void 0;if(typeof e.value=="string")return e.value;if(typeof e.value=="object"&&e.value?.title)return e.value.title},x=t=>{const e=Object.keys(t.modifiers);return e.length>0?e[0]:void 0},V=(t,e)=>{t.classList.add("relative","group","overflow-visible"),t.__TooltipId||(t.__TooltipId=`mcl-tooltip-${++I}`);const o=t.__TooltipId,r=E(t,e),l=c(t,e,"color","color"),n=c(t,e,"text-color","textColor"),s=c(t,e,"tooltip-width","width"),i=typeof e.value=="object"?e.value.customClass:void 0,m=x(e),T=a.createVNode(g.tooltip,{id:o,direction:m,content:r,color:l,textColor:n,width:s,customClass:i});a.render(T,t),t.setAttribute("aria-describedby",o)},$=t=>{a.render(null,t),t.removeAttribute("aria-describedby"),delete t.__TooltipId},_={mounted(t,e){t.__HandleTooltip=o=>V(t,o),t.__UnmountTooltip=()=>$(t),t.__HandleTooltip(e)},updated(t,e,o,r){const l=e.value!==e.oldValue;let n=!1;const s=r.dirs?.find(i=>i.dir===_);if(s){const i=s.arg;e.arg!==i&&(n=!0)}(l||n)&&t.__HandleTooltip(e)},unmounted(t){t.__UnmountTooltip()}};exports.vClickOutside=g.vClickOutside;exports.vCollapse=k;exports.vToggle=y;exports.vTooltip=_;
|
package/dist/directives.d.ts
CHANGED
|
@@ -77,14 +77,22 @@ export declare const vClickOutside: Directive<ClickOutsideElement, ClickOutsideV
|
|
|
77
77
|
/**
|
|
78
78
|
* Vue directive for collapsible elements with accordion support.
|
|
79
79
|
*
|
|
80
|
-
* @deprecated
|
|
81
|
-
*
|
|
82
|
-
*
|
|
80
|
+
* @deprecated Sunsetted. No collapse component reacts to this directive,
|
|
81
|
+
* including the base `Collapse`, `MclCollapseA`, and `MclCollapseB`: they manage
|
|
82
|
+
* state internally via the `useCollapseState` composable. Mounting it logs a
|
|
83
|
+
* warning once per page. It will be removed in the next major release.
|
|
83
84
|
*
|
|
84
|
-
*
|
|
85
|
+
* - `v-collapse:<id>` on a trigger → call `toggle()` on a `Collapse` template ref,
|
|
86
|
+
* or bind `:visible`.
|
|
87
|
+
* - `accordion="<name>"` on a panel → wrap the panels in `<AccordionGroup>`.
|
|
85
88
|
*
|
|
86
89
|
* @example
|
|
87
|
-
* //
|
|
90
|
+
* // Standalone base Collapse
|
|
91
|
+
* <button @click="collapseRef?.toggle()">Toggle</button>
|
|
92
|
+
* <Collapse ref="collapseRef" id="panel-1">...</Collapse>
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* // Accordion
|
|
88
96
|
* import { AccordionGroup } from '@bobbykim/manguito-theme'
|
|
89
97
|
* import { MclCollapseA } from '@bobbykim/mcl-collapse'
|
|
90
98
|
*
|
|
@@ -92,11 +100,6 @@ export declare const vClickOutside: Directive<ClickOutsideElement, ClickOutsideV
|
|
|
92
100
|
* <MclCollapseA collapse-id="item1" title="Item 1">...</MclCollapseA>
|
|
93
101
|
* <MclCollapseA collapse-id="item2" title="Item 2">...</MclCollapseA>
|
|
94
102
|
* </AccordionGroup>
|
|
95
|
-
*
|
|
96
|
-
* @example
|
|
97
|
-
* // Preferred: standalone collapse (no wrapper needed)
|
|
98
|
-
* <MclCollapseA collapse-id="item1" title="Item 1">...</MclCollapseA>
|
|
99
|
-
*
|
|
100
103
|
*/
|
|
101
104
|
export declare const vCollapse: Directive<CollapseElement>;
|
|
102
105
|
|
package/dist/directives.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { t as _ } from "./index-
|
|
2
|
-
import { v as
|
|
3
|
-
import { createVNode as
|
|
4
|
-
const
|
|
1
|
+
import { t as _ } from "./index-CzXHE-4G.js";
|
|
2
|
+
import { v as O } from "./index-CzXHE-4G.js";
|
|
3
|
+
import { createVNode as T, render as d } from "vue";
|
|
4
|
+
const g = (t, e) => {
|
|
5
5
|
if (t.tagName === "A") {
|
|
6
6
|
const o = t.getAttribute("href");
|
|
7
7
|
return o ? o.charAt(0) === "#" ? o.substring(1) : o : null;
|
|
8
8
|
}
|
|
9
9
|
return e || null;
|
|
10
|
-
},
|
|
10
|
+
}, v = (t) => t ? document.getElementById(t) : null, p = (t) => t.hasAttribute("visible"), c = (t) => {
|
|
11
11
|
const o = t.getAttribute("visible") === "true" ? "false" : "true";
|
|
12
12
|
t.setAttribute("visible", o);
|
|
13
|
-
},
|
|
13
|
+
}, b = (t) => {
|
|
14
14
|
const e = `div[accordion="${t}"]`;
|
|
15
15
|
return Array.from(document.querySelectorAll(e));
|
|
16
16
|
}, A = (t, e) => {
|
|
17
|
-
|
|
18
|
-
r.id === t.id ?
|
|
17
|
+
b(e).forEach((r) => {
|
|
18
|
+
r.id === t.id ? c(r) : r.getAttribute("visible") === "true" && r.setAttribute("visible", "false");
|
|
19
19
|
});
|
|
20
20
|
}, C = (t) => {
|
|
21
|
-
|
|
22
|
-
},
|
|
21
|
+
c(t);
|
|
22
|
+
}, h = (t) => (e) => {
|
|
23
23
|
e.preventDefault();
|
|
24
|
-
const o = e.target, r =
|
|
24
|
+
const o = e.target, r = g(o, t), l = v(r);
|
|
25
25
|
if (!l) {
|
|
26
26
|
console.warn(`[v-collapse] Target element not found: ${r}`);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
if (!
|
|
29
|
+
if (!p(l)) {
|
|
30
30
|
console.warn(
|
|
31
31
|
`[v-collapse] Target element missing 'visible' attribute: ${r}`
|
|
32
32
|
);
|
|
@@ -34,42 +34,48 @@ const d = (t, e) => {
|
|
|
34
34
|
}
|
|
35
35
|
const n = l.getAttribute("accordion");
|
|
36
36
|
n ? A(l, n) : C(l);
|
|
37
|
-
}
|
|
37
|
+
};
|
|
38
|
+
let u = !1;
|
|
39
|
+
const H = () => {
|
|
40
|
+
u || (u = !0, console.warn(
|
|
41
|
+
"[v-collapse] v-collapse is sunsetted: no collapse component reacts to it, including the base Collapse. Call toggle() on a Collapse template ref or bind :visible, and wrap accordions in <AccordionGroup>. It will be removed in the next major release."
|
|
42
|
+
));
|
|
43
|
+
}, L = {
|
|
38
44
|
mounted(t, e) {
|
|
39
|
-
t.__HandleToggler =
|
|
45
|
+
H(), t.__HandleToggler = h(e.arg), t.addEventListener("click", t.__HandleToggler);
|
|
40
46
|
},
|
|
41
47
|
unmounted(t) {
|
|
42
48
|
t.__HandleToggler && (t.removeEventListener("click", t.__HandleToggler), delete t.__HandleToggler);
|
|
43
49
|
}
|
|
44
|
-
},
|
|
50
|
+
}, k = (t) => (e) => {
|
|
45
51
|
e.preventDefault();
|
|
46
|
-
const o = e.target, r =
|
|
52
|
+
const o = e.target, r = g(o, t), l = v(r);
|
|
47
53
|
if (!l) {
|
|
48
54
|
console.warn(`[v-toggle] Target element not found: ${r}`);
|
|
49
55
|
return;
|
|
50
56
|
}
|
|
51
|
-
if (!
|
|
57
|
+
if (!p(l)) {
|
|
52
58
|
console.warn(
|
|
53
59
|
`[v-toggle] Target element mission visible 'visible' attribute: ${r}`
|
|
54
60
|
);
|
|
55
61
|
return;
|
|
56
62
|
}
|
|
57
|
-
|
|
58
|
-
},
|
|
63
|
+
c(l);
|
|
64
|
+
}, j = {
|
|
59
65
|
mounted(t, e) {
|
|
60
|
-
t.__ClickToggleHandler =
|
|
66
|
+
t.__ClickToggleHandler = k(e.arg), t.addEventListener("click", t.__ClickToggleHandler);
|
|
61
67
|
},
|
|
62
68
|
unmounted(t) {
|
|
63
69
|
t.__ClickToggleHandler && (t.removeEventListener("click", t.__ClickToggleHandler), delete t.__ClickToggleHandler);
|
|
64
70
|
}
|
|
65
71
|
};
|
|
66
|
-
let
|
|
67
|
-
const
|
|
72
|
+
let w = 0;
|
|
73
|
+
const a = (t, e, o, r) => {
|
|
68
74
|
if (t.hasAttribute(o))
|
|
69
75
|
return t.getAttribute(o);
|
|
70
76
|
if (typeof e.value == "object" && e.value !== null && r in e.value)
|
|
71
77
|
return e.value[r];
|
|
72
|
-
},
|
|
78
|
+
}, I = (t, e) => {
|
|
73
79
|
if (t.hasAttribute("title"))
|
|
74
80
|
return t.getAttribute("title") || void 0;
|
|
75
81
|
if (typeof e.value == "string")
|
|
@@ -79,40 +85,40 @@ const s = (t, e, o, r) => {
|
|
|
79
85
|
}, E = (t) => {
|
|
80
86
|
const e = Object.keys(t.modifiers);
|
|
81
87
|
return e.length > 0 ? e[0] : void 0;
|
|
82
|
-
},
|
|
83
|
-
t.classList.add("relative", "group", "overflow-visible"), t.__TooltipId || (t.__TooltipId = `mcl-tooltip-${++
|
|
84
|
-
const o = t.__TooltipId, r =
|
|
88
|
+
}, x = (t, e) => {
|
|
89
|
+
t.classList.add("relative", "group", "overflow-visible"), t.__TooltipId || (t.__TooltipId = `mcl-tooltip-${++w}`);
|
|
90
|
+
const o = t.__TooltipId, r = I(t, e), l = a(t, e, "color", "color"), n = a(
|
|
85
91
|
t,
|
|
86
92
|
e,
|
|
87
93
|
"text-color",
|
|
88
94
|
"textColor"
|
|
89
|
-
),
|
|
95
|
+
), s = a(
|
|
90
96
|
t,
|
|
91
97
|
e,
|
|
92
98
|
"tooltip-width",
|
|
93
99
|
"width"
|
|
94
|
-
), i = typeof e.value == "object" ? e.value.customClass : void 0,
|
|
100
|
+
), i = typeof e.value == "object" ? e.value.customClass : void 0, f = E(e), m = T(_, {
|
|
95
101
|
id: o,
|
|
96
|
-
direction:
|
|
102
|
+
direction: f,
|
|
97
103
|
content: r,
|
|
98
104
|
color: l,
|
|
99
105
|
textColor: n,
|
|
100
|
-
width:
|
|
106
|
+
width: s,
|
|
101
107
|
customClass: i
|
|
102
108
|
});
|
|
103
|
-
|
|
109
|
+
d(m, t), t.setAttribute("aria-describedby", o);
|
|
104
110
|
}, y = (t) => {
|
|
105
|
-
|
|
106
|
-
},
|
|
111
|
+
d(null, t), t.removeAttribute("aria-describedby"), delete t.__TooltipId;
|
|
112
|
+
}, V = {
|
|
107
113
|
mounted(t, e) {
|
|
108
|
-
t.__HandleTooltip = (o) =>
|
|
114
|
+
t.__HandleTooltip = (o) => x(t, o), t.__UnmountTooltip = () => y(t), t.__HandleTooltip(e);
|
|
109
115
|
},
|
|
110
116
|
updated(t, e, o, r) {
|
|
111
117
|
const l = e.value !== e.oldValue;
|
|
112
118
|
let n = !1;
|
|
113
|
-
const
|
|
114
|
-
if (
|
|
115
|
-
const i =
|
|
119
|
+
const s = r.dirs?.find((i) => i.dir === V);
|
|
120
|
+
if (s) {
|
|
121
|
+
const i = s.arg;
|
|
116
122
|
e.arg !== i && (n = !0);
|
|
117
123
|
}
|
|
118
124
|
(l || n) && t.__HandleTooltip(e);
|
|
@@ -122,8 +128,8 @@ const s = (t, e, o, r) => {
|
|
|
122
128
|
}
|
|
123
129
|
};
|
|
124
130
|
export {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
131
|
+
O as vClickOutside,
|
|
132
|
+
L as vCollapse,
|
|
133
|
+
j as vToggle,
|
|
134
|
+
V as vTooltip
|
|
129
135
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const a=require("vue"),c=require("./index-
|
|
1
|
+
"use strict";const a=require("vue"),c=require("./index-CsKLajvY.cjs"),t=a.defineComponent({setup(e,{slots:l}){const s=a.ref(!1);return a.onMounted(()=>{s.value=!0}),()=>s.value&&l.default?l.default():null}}),m={xs:"backdrop-blur-xs",sm:"backdrop-blur-sm",md:"backdrop-blur-md",lg:"backdrop-blur-lg",xl:"backdrop-blur-xl"},n={primary:"mcl-glass-primary",secondary:"mcl-glass-secondary",success:"mcl-glass-success",info:"mcl-glass-info",danger:"mcl-glass-danger",warning:"mcl-glass-warning","light-1":"mcl-glass-light-1","light-2":"mcl-glass-light-2","light-3":"mcl-glass-light-3","light-4":"mcl-glass-light-4","dark-1":"mcl-glass-dark-1","dark-2":"mcl-glass-dark-2","dark-3":"mcl-glass-dark-3","dark-4":"mcl-glass-dark-4",black:"mcl-glass-black",white:"mcl-glass-white",transparent:"mcl-glass-transparent"},d={10:"mcl-depth-10",20:"mcl-depth-20",30:"mcl-depth-30",40:"mcl-depth-40",50:"mcl-depth-50",60:"mcl-depth-60",70:"mcl-depth-70",80:"mcl-depth-80",90:"mcl-depth-90",100:"mcl-depth-100"},g=(e,l,s,r=10)=>["mcl-glassmorphism",n[e],m[l],c.generateClass.bgOpacityVariant({opacity:s}),d[r]].filter(Boolean).join(" ");exports.ClientSideRender=t;exports.getGlassmorphismClass=g;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const v=require("isomorphic-dompurify"),l=require("vue"),c=require("./index-CsKLajvY.cjs"),f=(e,t,o)=>!t||!(t instanceof Node)||e===t||e.contains(t)?!1:o?.length?!o.some(n=>n===t||n.contains(t)):!0,u=e=>typeof e.value=="function"?{handler:e.value,events:["click"]}:{handler:e.value.handler,events:e.value.events||["click"],excludeElements:e.value.excludeElements},p=(e,t)=>{const o=(n=[],r=[])=>n.length===r.length&&n.every((i,s)=>i===r[s]);return e.handler===t.handler&&o(e.events,t.events)&&o(e.excludeElements,t.excludeElements)},d=(e,t,o)=>n=>{f(e,n.target,o)&&t(n)},m={mounted(e,t){const{handler:o,events:n,excludeElements:r}=u(t);e.__ClickOutsideHandler=d(e,o,r),n.forEach(i=>{document.addEventListener(i,e.__ClickOutsideHandler,!0)})},updated(e,t){const o=u({...t,value:t.oldValue});if(e.__ClickOutsideHandler&&p(o,u(t)))return;e.__ClickOutsideHandler&&o.events.forEach(s=>{document.removeEventListener(s,e.__ClickOutsideHandler,!0)});const{handler:n,events:r,excludeElements:i}=u(t);e.__ClickOutsideHandler=d(e,n,i),r.forEach(s=>{document.addEventListener(s,e.__ClickOutsideHandler,!0)})},unmounted(e,t){if(e.__ClickOutsideHandler){const{events:o}=u(t);o.forEach(n=>{document.removeEventListener(n,e.__ClickOutsideHandler,!0)}),delete e.__ClickOutsideHandler}}},a={left:"tooltip-left",top:"tooltip-top",bottom:"tooltip-bottom",right:"tooltip-right"},h=l.defineComponent({name:"Tooltip",props:{id:{type:String,default:void 0},direction:{type:String,default:"right"},color:{type:String,default:"dark-3"},textColor:{type:String,default:"white"},width:{type:[Number,String],default:80},customClass:{type:String,default:""},content:{type:String,required:!0}},setup(e){const t="invisible opacity-0 group-hover:visible group-hover:opacity-100 group-focus:visible group-focus:opacity-100 z-[100] tooltip",o=l.computed(()=>[c.generateClass.bgColorVariant({color:e.color}),c.generateClass.textColorVariant({color:e.textColor})].join(" ")),n=l.computed(()=>({width:`${e.width}px`})),r=l.computed(()=>a[e.direction]||a.right),i=l.computed(()=>[t,r.value,o.value,e.customClass]);return()=>l.h("div",{id:e.id,class:i.value,role:"tooltip",innerHTML:v.sanitize(e.content),style:[n.value]})}});exports.tooltip=h;exports.vClickOutside=m;
|