@square/maker
Version:
📚 Maker Design System by Square
2 lines • 4.3 kB
JavaScript
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../../utils/InlineFormControlLayout"));else if("function"==typeof define&&define.amd)define(["../../utils/InlineFormControlLayout"],t);else{var n="object"==typeof exports?t(require("../../utils/InlineFormControlLayout")):t(e["../../utils/InlineFormControlLayout"]);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(this,(function(e){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){e.exports={CheckboxContainer:"📚4-7-0160dX",Checkbox:"📚4-7-03oxtH",Check:"📚4-7-01Rfli"}},function(e,t,n){"use strict";var o=n(0),r=n.n(o);n.d(t,"default",(function(){return r.a}))},function(t,n){t.exports=e},function(e,t,n){"use strict";n.r(t),n.d(t,"MCheckbox",(function(){return a}));var o=n(2),r={inheritAttrs:!1,model:{prop:"checked",event:"checkbox:update"},props:{checked:{type:[Boolean,Array],default:void 0},value:{type:void 0,default:void 0},invalid:{type:Boolean,default:!1}},computed:{checkVal:{get(){return this.checked},set(e){this.$emit("checkbox:update",e)}}},watch:{invalid:"setCustomValidity"},mounted(){this.setCustomValidity()},methods:{setCustomValidity(){this.$refs.checkbox.setCustomValidity(this.invalid?"invalid":"")}}},i=n(1);function c(e,t,n,o,r,i,c,l){var a,u="function"==typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),o&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),c?(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(c)},u._ssrRegister=a):r&&(a=l?function(){r.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:r),a)if(u.functional){u._injectStyles=a;var s=u.render;u.render=function(e,t){return a.call(t),s(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,a):[a]}return{exports:e,options:u}}var l=c(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.$s.CheckboxContainer},[n("input",e._g(e._b({directives:[{name:"model",rawName:"v-model",value:e.checkVal,expression:"checkVal"}],ref:"checkbox",class:e.$s.Checkbox,attrs:{type:"checkbox"},domProps:{value:e.value,checked:Array.isArray(e.checkVal)?e._i(e.checkVal,e.value)>-1:e.checkVal},on:{change:function(t){var n=e.checkVal,o=t.target,r=!!o.checked;if(Array.isArray(n)){var i=e.value,c=e._i(n,i);o.checked?c<0&&(e.checkVal=n.concat([i])):c>-1&&(e.checkVal=n.slice(0,c).concat(n.slice(c+1)))}else e.checkVal=r}}},"input",e.$attrs,!1),e.$listeners)),e._v(" "),n("svg",{class:e.$s.Check},[n("path",{attrs:{d:"M1 4L5.5 8.5L13 1"}})])])}),[],!1,(function(e){this.$s=i.default.locals||i.default}),null,null),a=c({components:{CheckboxControl:l.exports,MInlineFormControlLayout:o.MInlineFormControlLayout},inheritAttrs:!1,model:{prop:"checked",event:"checkbox:update"}},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("m-inline-form-control-layout",{scopedSlots:e._u([{key:"control",fn:function(){return[n("checkbox-control",e._g(e._b({},"checkbox-control",e.$attrs,!1),e.$listeners))]},proxy:!0},{key:"label",fn:function(){return[e._t("default")]},proxy:!0},{key:"sublabel",fn:function(){return[e._t("sublabel")]},proxy:!0}],null,!0)})}),[],!1,null,null,null).exports}])}));
//# sourceMappingURL=script.js.map