-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
1 lines (1 loc) · 2.88 KB
/
index.js
1
(function(){"use strict";function s(i,e,t,n,o,r,F,R){var a=typeof i=="function"?i.options:i;return e&&(a.render=e,a.staticRenderFns=t,a._compiled=!0),{exports:i,options:a}}const c={extends:"k-checkboxes-field",props:{fit:String,mobile:Boolean,ratio:Number,back:[Boolean,String]}};var l=function(){var n;var e=this,t=e._self._c;return t("k-field",e._b({staticClass:"k-checkboxes-field k-imageboxes-field",attrs:{input:e.id+"-0",counter:e.counterOptions}},"k-field",e.$props,!1),[(n=e.options)!=null&&n.length?t("k-imageboxes-input",e._g(e._b({ref:"input"},"k-imageboxes-input",e.$props,!1),e.$listeners)):t("k-empty",{attrs:{text:e.$t("options.none"),icon:"checklist"}})],1)},u=[],d=s(c,l,u);const p=d.exports,_={extends:"k-checkboxes-input",props:{fit:String,ratio:Number,mobile:Boolean,back:[Boolean,String]},computed:{choices(){return this.options.map((i,e)=>({autofocus:this.autofocus&&e===0,checked:this.selected.includes(i.value),disabled:this.disabled||i.disabled,id:`${this.id}-${e}`,info:i.info,label:i.text,name:this.name??this.id,type:"checkbox",value:i.value,image:i.image,fit:this.fit,ratio:this.ratio,mobile:this.mobile,back:this.back}))}},methods:{}};var m=function(){var e=this,t=e._self._c;return t("ul",{staticClass:"k-checkboxes-input k-imageboxes-input k-grid",style:{"--columns":e.columns},attrs:{"data-variant":"choices"}},e._l(e.choices,function(n,o){return t("li",{key:o},[t("k-imagebox-input",e._b({on:{input:function(r){return e.input(n.value,r)}}},"k-imagebox-input",n,!1))],1)}),0)},f=[],b=s(_,m,f);const k=b.exports,g={extends:"k-choice-input",props:{image:String,fit:String,ratio:Number,mobile:Boolean,back:[Boolean,String]},computed:{padding(){return this.$helper.ratio(this.ratio,"auto",!0)},background(){return this.back||!1}}};var h=function(){var e=this,t=e._self._c;return t("label",{staticClass:"k-choice-input k-imagebox-input",attrs:{"aria-disabled":e.disabled}},[t("figure",{staticClass:"k-imagebox-image",style:[{"padding-top":e.padding},{background:e.background}],attrs:{"data-mobile":e.mobile}},[t("img",{class:e.fit,attrs:{src:e.image}})]),t("div",{staticClass:"k-imagebox-wrapper"},[t("input",e._b({class:{"sr-only":e.variant==="invisible"},attrs:{"data-variant":e.variant},on:{input:function(n){return e.$emit("input",n.target.checked)}}},"input",{autofocus:e.autofocus,id:e.id,checked:e.checked,disabled:e.disabled,name:e.name,required:e.required,type:e.type,value:e.value},!1)),e.label||e.info?t("span",{staticClass:"k-choice-input-label"},[t("span",{staticClass:"k-choice-input-label-text",domProps:{innerHTML:e._s(e.label)}}),e.info?t("span",{staticClass:"k-choice-input-label-info",domProps:{innerHTML:e._s(e.info)}}):e._e()]):e._e()])])},v=[],x=s(g,h,v);const $=x.exports;var y=s({extends:"k-radio-field-preview"},null,null);const B=y.exports;panel.plugin("sylvainjule/imageboxes",{fields:{imageboxes:p},components:{"k-imageboxes-input":k,"k-imagebox-input":$,"k-imageboxes-field-preview":B}})})();