@bobbykim/mcl-collapse 0.7.1 → 0.7.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/dist/mcl-collapse.js
CHANGED
|
@@ -54,7 +54,7 @@ const D = { class: "flex justify-between items-center" }, G = /* @__PURE__ */ c(
|
|
|
54
54
|
c("h3", {
|
|
55
55
|
class: r(o(e.titleSize, e.titleColor))
|
|
56
56
|
}, A(e.title), 3),
|
|
57
|
-
|
|
57
|
+
f.tab ? (n(), d("div", {
|
|
58
58
|
key: 0,
|
|
59
59
|
onClick: t[0] || (t[0] = $(() => {
|
|
60
60
|
}, ["stop"])),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(r,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("@bobbykim/manguito-theme")):typeof define=="function"&&define.amd?define(["exports","vue","@bobbykim/manguito-theme"],o):(r=typeof globalThis<"u"?globalThis:r||self,o(r.MclCollapse={},r.Vue,r.ManguitoTheme))})(this,function(r,o,t){"use strict";const u={class:"flex justify-between items-center"},b=[o.createElementVNode("path",{d:"M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z"},null,-1)],B=o.defineComponent({__name:"MclCollapseA",props:{collapseId:{},borderColor:{default:"light-4"},rounded:{type:Boolean,default:!1},displayHighlight:{type:Boolean,default:!0},highlightColor:{default:"secondary"},title:{},titleSize:{default:"sm"},titleColor:{default:"dark-3"},visible:{type:Boolean,default:!1},iconColor:{default:"dark-3"},bgColor:{default:"white"},slotBgColor:{default:"light-2"},accordion:{}},emits:["collapse-open","collapse-close"],setup(m,{emit:h}){const d=m,i=o.ref(d.visible),c=o.useSlots(),a=h,p=e=>{const{title:s}=d;i.value=e,a(e===!0?"collapse-open":"collapse-close",e,s)},C=(e,s,f)=>{const n=["border",t("BORDER",e)];return s&&[t("BORDERL",f)].forEach(k=>{n.push(k),n.push("border-l-8")}),n.join(" ")},l=(e,s)=>[t("H3",e),t("TEXTCOLOR",s)].join(" ");return o.watch(()=>d.visible,e=>{i.value=e}),(e,s)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["overflow-hidden w-full",[e.rounded?"rounded-lg":"rounded-sm",C(e.borderColor,e.displayHighlight,e.highlightColor)]])},[o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["py-xs px-sm cursor-pointer transition-[border] duration-500",[i.value?`border-b ${o.unref(t)("BORDERB",e.borderColor)} ease-in`:"ease-out",o.unref(t)("BGCOLOR",e.bgColor)]])},[o.createElementVNode("div",u,[o.createElementVNode("h3",{class:o.normalizeClass(l(e.titleSize,e.titleColor))},o.toDisplayString(e.title),3),c.tab?(o.openBlock(),o.createElementBlock("div",{key:0,onClick:s[0]||(s[0]=o.withModifiers(()=>{},["stop"])),class:"cursor-default"},[o.renderSlot(e.$slots,"tab")])):o.createCommentVNode("",!0)])],2)),[[o.unref(t.vCollapse),void 0,e.collapseId]]),o.createElementVNode("div",{class:o.normalizeClass(["overflow-hidden",o.unref(t)("BGCOLOR",e.slotBgColor)])},[o.createVNode(o.unref(t.Collapse),{id:e.collapseId,visible:e.visible,"class-name":"py-sm px-xs",onOpen:p,onClose:p,accordion:e.accordion},{default:o.withCtx(()=>[o.renderSlot(e.$slots,"content")]),_:3},8,["id","visible","accordion"])],2),o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["py-1.5 px-sm cursor-pointer transition-all duration-500 flex justify-center items-center border-t",[o.unref(t)("BGCOLOR",e.bgColor),o.unref(t)("BORDERT",e.borderColor)]])},[(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",class:o.normalizeClass(["h-xs",[i.value?"rotate-180":"rotate-0","transition-transform duration-300 ease-in",o.unref(t)("SVGFILL",e.iconColor)]])},b,2))],2)),[[o.unref(t.vCollapse),void 0,e.collapseId]])],2))}}),y={class:"flex justify-center items-center ml-xs md:ml-sm lg:ml-md"},w=[o.createElementVNode("path",{d:"M224 416c-8.188 0-16.38-3.125-22.62-9.375l-192-192c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L224 338.8l169.4-169.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-192 192C240.4 412.9 232.2 416 224 416z"},null,-1)],g={class:"overflow-hidden"},E=o.defineComponent({__name:"MclCollapseB",props:{collapseId:{},title:{},titleColor:{default:"light-1"},titleSize:{default:"md"},borderColor:{default:"light-3"},bgColor:{default:"light-1"},btnColor:{default:"primary"},iconColor:{default:"light-1"},rounded:{type:Boolean,default:!0},displayShadow:{type:Boolean,default:!0},visible:{type:Boolean,default:!1},accordion:{}},emits:["collapse-open","collapse-close"],setup(m,{emit:h}){const d=m;o.useSlots();const i=o.ref(d.visible),c=h,a=l=>{const{title:e}=d;i.value=l,c(l===!0?"collapse-open":"collapse-close",l,e)},p=(l,e,s,f)=>{let n=["border",t("BORDER",l),t("BGCOLOR",e)];return f&&n.push("shadow-md"),s?n.push("rounded-2xl"):n.push("rounded-sm"),n.join(" ")},C=(l,e)=>[t("H3",l),t("TEXTCOLOR",e)].join(" ");return o.watch(()=>d.visible,l=>{i.value=l}),(l,e)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["w-full overflow-hidden p-2xs",p(l.borderColor,l.bgColor,l.rounded,l.displayShadow)])},[o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex justify-between items-center w-full px-4 py-2 cursor-pointer hover:bg-opacity-70 transition duration-200 ease-in",[l.rounded?"rounded-lg":"rounded-sm",o.unref(t)("BGCOLOR",l.btnColor)]])},[o.createElementVNode("h3",{class:o.normalizeClass(C(l.titleSize,l.titleColor))},o.toDisplayString(l.title),3),o.createElementVNode("div",y,[(o.openBlock(),o.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",class:o.normalizeClass(["h-xs transition-transform duration-300 ease-in",[i.value?"rotate-180":"rotate-0",o.unref(t)("SVGFILL",l.iconColor)]])},w,2))])],2)),[[o.unref(t.vCollapse),void 0,l.collapseId]]),o.createElementVNode("div",g,[o.createVNode(o.unref(t.Collapse),{id:l.collapseId,visible:l.visible,"class-name":"px-xs pt-xs pb-2xs",accordion:l.accordion,onOpen:a,onClose:a},{default:o.withCtx(()=>[o.renderSlot(l.$slots,"default")]),_:3},8,["id","visible","accordion"])])],2))}});r.MclCollapseA=B,r.MclCollapseB=E,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobbykim/mcl-collapse",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "collapse component built on top of @bobbykim/manguito-theme",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@bobbykim/manguito-theme": "0.
|
|
36
|
+
"@bobbykim/manguito-theme": "0.21.0",
|
|
37
37
|
"vue": "^3.3.10"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"vite-plugin-dts": "^3.8.3",
|
|
45
45
|
"vue-tsc": "^1.8.25"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "e2e70414089db93125eaa4855b0c0a33f1c0ecbf"
|
|
48
48
|
}
|