UNPKG

8.65 kBJavaScriptView Raw
1module.exports=function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=281)}({0:function(e,t){e.exports=function(e,t,n,i,o,r){var a,s=e=e||{},u=typeof e.default;"object"!==u&&"function"!==u||(a=e,s=e.default);var c="function"==typeof s?s.options:s;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),o&&(c._scopeId=o);var l;if(r?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=l):i&&(l=i),l){var p=c.functional,h=p?c.render:c.beforeCreate;p?(c._injectStyles=l,c.render=function(e,t){return l.call(t),h(e,t)}):c.beforeCreate=h?[].concat(h,l):[l]}return{esModule:a,exports:s,options:c}}},1:function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"c",function(){return o}),n.d(t,"d",function(){return r}),n.d(t,"b",function(){return a});var i={props:{disabled:{type:Boolean},type:{type:String,default:"default"},size:{type:String,default:"default"},nativeType:{type:String,default:"button"},plain:{type:Boolean},loadingColor:{type:Object,default:function(){return{default:"#d6d6d6",danger:"#e04b00",warning:"#ff9900"}}},loading:{type:Boolean},ripple:{type:Boolean}}},o={inject:{vxFormItem:{default:"vxFormItem"}},props:{disabled:{type:Boolean},clearable:{type:Boolean,default:!0},nativeType:{type:String,default:"text"},readonly:{type:Boolean},value:{type:[String,Number]},placeholder:{type:String},autocomplete:{type:String},autofocus:{type:String},maxlength:{type:Number},name:{type:String,default:function(){return Math.random().toString(36).substr(2)}},checked:{type:Boolean},validateEvent:{type:Boolean,default:!0},arrow:{type:Boolean,default:!1},arrowProps:{type:Object},border:{type:Boolean,default:!0},autoIntoView:{type:Boolean,default:!0},size:{type:String,default:"default"}},data:function(){return{isFocus:!1}},methods:{handleFocusIn:function(e){this.isFocus=!0;var t=e.target;this.autoIntoView&&void 0!==t.ontouchstart&&window.addEventListener("resize",function(){t.scrollIntoView&&t.scrollIntoView()},{once:!0})},handleFocusOut:function(e){this.isFocus=!1,this.eDispatch("ElFormItem","el.form.blur",[e.target.value])},handleChange:function(e){this.$emit("change",e.target.value)},handleInput:function(e){var t=e.target?e.target.value:e;this.$emit("input",t),this.eDispatch("ElFormItem","el.form.change",[t])},eDispatch:function(){this.validateEvent&&this.dispatch&&this.dispatch.apply(this,arguments)}}},r={methods:{change:function(e){this.active!==e&&this.$emit("update:active",e).$emit("change",e)}},props:{active:{type:[Number,String,Object],required:!0},layout:{type:String,default:"default"}}},a={props:{history:{type:Boolean,default:!0}},methods:{getPushURL:function(){var e=window.location.hash;this.pushString="popup="+Math.random().toString(36).substr(2);var t=[window.location.href.split("#")[0],e];return t.push(e?-1===e.indexOf("?")&&-1===e.indexOf("=")?"?":"&":"#"),t.push(this.pushString),t.join("")},pushState:function(){var e=this;this.history&&(this.pushString&&this.isCurrentPopup()&&window.history.back(),setTimeout(function(){window.history.pushState({},"",e.getPushURL()),window.addEventListener("popstate",e.handlePopstate)},16))},handlePopstate:function(){-1===window.location.href.indexOf(this.pushString)&&(this.$emit("update:open",!1).$emit("close"),this.popStateBack&&this.popStateBack(),window.removeEventListener("popstate",this.handlePopstate))},goBack:function(){this.history&&this.isCurrentPopup()&&(window.removeEventListener("popstate",this.handlePopstate),history.back())},isCurrentPopup:function(){return window.location.href.indexOf(this.pushString)===window.location.href.length-this.pushString.length}}}},18:function(e,t){e.exports=require("babel-runtime/core-js/object/assign")},2:function(e,t){e.exports=require("babel-runtime/helpers/extends")},281:function(e,t,n){e.exports=n(62)},51:function(e,t,n){"use strict";var i=n(52),o=n(73),r=n(0),a=r(i.a,o.a,!1,null,null,null);t.a=a.exports},52:function(e,t,n){"use strict";var i=n(2),o=n.n(i),r=n(1);t.a={name:"Checkbox",componentName:"Checkbox",mixins:[r.c],props:o()({},r.c.props,{iconPosition:{type:String,default:"left"},type:{type:String,default:"checkbox"},iconStyle:{type:String},onValue:{type:String},offValue:{type:String},inline:{type:Boolean},exclusive:{type:Boolean}}),computed:{classes:function(){return["vx-checkbox",{"is-checked":this.myChecked,"is-disabled":this.myDisabled,"is-inline":this.myInline,"is-icon-position-right":"right"===this.iconPosition||"right"===this.$parent.iconPosition}]},getIconStyle:function(){return this.iconStyle||this.$parent.iconStyle},myChecked:function(){return this.$parent&&this.$parent.$options&&"CheckboxGroup"===this.$parent.$options.componentName?this.$parent.value instanceof Array?this.$parent.value.indexOf(this.value)>-1:this.$parent.value===this.value:this.checked},myType:function(){return this.$parent&&this.$parent.$options&&"CheckboxGroup"===this.$parent.$options.componentName?1===this.$parent.max?"radio":"checkbox":this.type},myDisabled:function(){var e=this.disabled;return this.$parent&&this.$parent.$options&&"CheckboxGroup"===this.$parent.$options.componentName&&this.$parent.max>1&&this.$parent.value.length>=this.$parent.max?-1===this.$parent.value.indexOf(this.value):e},myInline:function(){return this.$parent&&this.$parent.$options&&"CheckboxGroup"===this.$parent.$options.componentName?this.inline||this.$parent.inline:this.inline}},methods:{handleChange:function(e,t){this.$parent&&this.$parent.$options&&"CheckboxGroup"===this.$parent.$options.componentName?this.$parent.handleChange(t,e,this.exclusive):(this.$emit("update:checked",t.target.checked).$emit("change",t),void 0!==this.offValue&&void 0!==this.onValue&&this.$emit("input",t.target.checked?this.onValue:this.offValue))}}}},53:function(e,t,n){"use strict";var i=n(18),o=n.n(i),r=n(2),a=n.n(r),s=n(1),u=n(51);t.a={name:"CheckboxGroup",componentName:"CheckboxGroup",mixins:[s.c],components:{Checkbox:u.a},props:a()({},s.c.props,{value:{type:[String,Number,Array]},divider:{type:Boolean,default:!0},iconPosition:{type:String,default:"left"},max:{type:Number,default:0},iconStyle:{type:String},inline:{type:Boolean}}),methods:{handleChange:function(e,t,n){if(1===this.max){var i=this.value instanceof Array?[t]:t;this.$emit("input",i).$emit("change",i),this.eDispatch("ElFormItem","el.form.blur",[i]),this.eDispatch("ElFormItem","el.form.change",[i])}else if(e.target.checked&&0!==this.max&&this.value.length===this.max)e.target.checked=!1;else{var r=o()([],this.value);if(e.target.checked)if(n)r=[t];else{-1===r.indexOf(t)&&r.push(t);var a=[];this.$children&&this.$children.forEach&&(this.$children.forEach(function(e){e.$props.exclusive&&a.push(e.value)}),a.length>0&&(r=r.filter(function(e){return-1===a.indexOf(e)})))}else r&&r.indexOf&&r.splice(r.indexOf(t),1);this.$emit("input",r).$emit("change",r),this.eDispatch("ElFormItem","el.form.blur",[r]),this.eDispatch("ElFormItem","el.form.change",[r])}}}}},62:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(51),o=n(74);n.d(t,"Checkbox",function(){return i.a}),n.d(t,"CheckboxGroup",function(){return o.a})},73:function(e,t,n){"use strict";var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("label",{class:e.classes},[n("input",{attrs:{type:e.myType,name:e.name},domProps:{value:e.value,checked:e.myChecked},on:{change:function(t){e.handleChange(e.value,t)}}}),e.$slots.default?[n("i",{class:["vx-checkbox--icon",e.getIconStyle?"is-"+e.getIconStyle:""]}),n("span",{staticClass:"vx-checkbox--text"},[e._t("default")],2)]:e._t("default",null,null,{checked:e.myChecked,disabled:e.myDisabled})],2)},o=[],r={render:i,staticRenderFns:o};t.a=r},74:function(e,t,n){"use strict";var i=n(53),o=n(75),r=n(0),a=r(i.a,o.a,!1,null,null,null);t.a=a.exports},75:function(e,t,n){"use strict";var i=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{class:["vx-checkbox-group",{"is-divider":e.divider&&!e.inline,"is-disabled":e.disabled}]},[e._t("default")],2)},o=[],r={render:i,staticRenderFns:o};t.a=r}});
\No newline at end of file