@square/maker
Version:
Maker Design System by Square
2 lines • 5.38 kB
JavaScript
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../../components/Icon"),require("../../components/Row"),require("../../components/Text"),require("../../components/TransitionCollapse"),require("lodash/isUndefined"));else if("function"==typeof define&&define.amd)define(["../../components/Icon","../../components/Row","../../components/Text","../../components/TransitionCollapse","lodash/isUndefined"],t);else{var n="object"==typeof exports?t(require("../../components/Icon"),require("../../components/Row"),require("../../components/Text"),require("../../components/TransitionCollapse"),require("lodash/isUndefined")):t(e["../../components/Icon"],e["../../components/Row"],e["../../components/Text"],e["../../components/TransitionCollapse"],e["lodash/isUndefined"]);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(this,(function(e,t,n,o,r){return(()=>{"use strict";var i={20:t=>{t.exports=e},588:e=>{e.exports=t},86:e=>{e.exports=n},96:e=>{e.exports=o},945:e=>{e.exports=r}},s={};function d(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return i[e](n,n.exports,d),n.exports}d.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},d.d=(e,t)=>{for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{d.r(a),d.d(a,{MAccordion:()=>c});var e=d(945),t=d.n(e),n=d(588),o=d(86),r=d(20),i=d(96);const s={components:{MText:o.MText,MIcon:r.MIcon,MRow:n.MRow,MTransitionCollapse:i.MTransitionCollapse},inheritAttrs:!1,model:{prop:"expanded",event:"accordion:update"},props:{expanded:{type:[Boolean,String],default:void 0},expandKey:{type:String,default:void 0},title:{type:String,required:!1,default:""},secondary:{type:String,required:!1,default:""},side:{type:String,required:!1,default:""},sideSecondary:{type:String,required:!1,default:""},id:{type:String,default:()=>"m-accordion-header-".concat(Math.random().toString(36).slice(2,11))}},data(){return{internalExpanded:!!this.expanded}},computed:{isExpanded(){return t()(this.expanded)||!this.$listeners["accordion:update"]?this.internalExpanded:t()(this.expandKey)?!!this.expanded:this.expanded===this.expandKey},iconName(){return this.isExpanded?"chevronUp":"chevronDown"}},methods:{toggleExpanded(){if(this.$listeners["accordion:update"])return t()(this.expanded)?(this.internalExpanded=!this.internalExpanded,void this.$emit("accordion:update",this.internalExpanded)):void(t()(this.expandKey)?this.$emit("accordion:update",!this.expanded):this.expanded!==this.expandKey?this.$emit("accordion:update",this.expandKey):this.$emit("accordion:update",!1));this.internalExpanded=!this.internalExpanded}}},p={AccordionHeader:"📚19-10-2zAswq",ContentWrapper:"📚19-10-2pynEn"};const c=function(e,t,n,o,r,i,s,d){var a,p="function"==typeof e?e.options:e;if(t&&(p.render=t,p.staticRenderFns=n,p._compiled=!0),o&&(p.functional=!0),i&&(p._scopeId="data-v-"+i),s?(a=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},p._ssrRegister=a):r&&(a=d?function(){r.call(this,(p.functional?this.parent:this).$root.$options.shadowRoot)}:r),a)if(p.functional){p._injectStyles=a;var c=p.render;p.render=function(e,t){return a.call(t),c(e,t)}}else{var u=p.beforeCreate;p.beforeCreate=u?[].concat(u,a):[a]}return{exports:e,options:p}}(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",e._g(e._b({},"div",e.$attrs,!1),e.$listeners),[n("m-row",{class:e.$s.AccordionHeader,attrs:{id:e.id,type:"button",element:"button","aria-expanded":e.isExpanded,"aria-controls":e.id+"-content"},on:{click:e.toggleExpanded},scopedSlots:e._u([{key:"default",fn:function(){return[e._t("title",(function(){return[n("m-text",{attrs:{pattern:"title",size:-2,"text-transform":"uppercase"}},[e._v("\n\t\t\t\t\t"+e._s(e.title)+"\n\t\t\t\t")])]}))]},proxy:!0},{key:"secondary",fn:function(){return[e._t("secondary",(function(){return[e.secondary?n("m-text",{attrs:{pattern:"paragraph",size:-1}},[e._v("\n\t\t\t\t\t"+e._s(e.secondary)+"\n\t\t\t\t")]):e._e()]}))]},proxy:!0},{key:"side",fn:function(){return[e._t("side",(function(){return[e.side?n("m-text",{attrs:{pattern:"title",size:-2,"text-transform":"uppercase"}},[e._v("\n\t\t\t\t\t"+e._s(e.side)+"\n\t\t\t\t")]):e._e()]}))]},proxy:!0},{key:"side-secondary",fn:function(){return[e._t("side-secondary",(function(){return[e.sideSecondary?n("m-text",{attrs:{pattern:"paragraph",size:-1}},[e._v("\n\t\t\t\t\t"+e._s(e.sideSecondary)+"\n\t\t\t\t")]):e._e()]}))]},proxy:!0},{key:"suffix",fn:function(){return[e._t("icon",(function(){return[n("m-icon",{attrs:{name:e.iconName}})]}))]},proxy:!0}],null,!0)}),e._v(" "),n("m-transition-collapse",[e.isExpanded?n("div",{class:e.$s.ContentWrapper,attrs:{id:e.id+"-content",role:"region","aria-labelledby":e.id,"aria-hidden":!e.isExpanded}},[e._t("default")],2):e._e()])],1)}),[],!1,(function(e){this.$s=p.locals||p}),null,null).exports})(),a})()}));
//# sourceMappingURL=script.js.map