UNPKG

8.27 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=284)}({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 p;if(r?(p=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=p):i&&(p=i),p){var l=c.functional,h=l?c.render:c.beforeCreate;l?(c._injectStyles=p,c.render=function(e,t){return p.call(t),h(e,t)}):c.beforeCreate=h?[].concat(h,p):[p]}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}}}},147:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(148),o=n(150);n.d(t,"Checker",function(){return o.a}),n.d(t,"CheckerGroup",function(){return i.a})},148:function(e,t,n){"use strict";var i=n(82),o=n(149),r=n(0),a=r(i.a,o.a,!1,null,null,null);t.a=a.exports},149:function(e,t,n){"use strict";var i=function(){var e=this,t=e.$createElement;return(e._self._c||t)("div",{class:["vx-checker-group",{"is-disabled":e.disabled}]},[e._t("default")],2)},o=[],r={render:i,staticRenderFns:o};t.a=r},150:function(e,t,n){"use strict";var i=n(83),o=n(151),r=n(0),a=r(i.a,o.a,!1,null,null,null);t.a=a.exports},151:function(e,t,n){"use strict";var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("label",{class:["vx-checker",{"is-disabled":e.myDisabled,"is-checked":e.myChecked,"is-icon":e.myIcon,"is-block":e.myBlock}]},[e.fake?e._e():n("input",{attrs:{type:e.myType,name:e.name,disabled:e.disabled},domProps:{checked:e.myChecked,value:e.value},on:{change:function(t){e.handleChange(e.value,t)}}}),e.$slots.default?n("button",{staticClass:"vx-checker-button",attrs:{type:"button",tabindex:"-2"}},[n("span",{staticClass:"vx-checker-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},18:function(e,t){e.exports=require("babel-runtime/core-js/object/assign")},2:function(e,t){e.exports=require("babel-runtime/helpers/extends")},284:function(e,t,n){e.exports=n(147)},82:function(e,t,n){"use strict";var i=n(18),o=n.n(i),r=n(2),a=n.n(r),s=n(1);t.a={name:"CheckerGroup",componentName:"CheckerGroup",mixins:[s.c],props:a()({},s.c.props,{value:{type:[String,Number,Array]},max:{type:Number,default:0},icon:{type:Boolean},block:{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.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])}}}}},83:function(e,t,n){"use strict";var i=n(2),o=n.n(i),r=n(1);t.a={name:"Checker",componentName:"Checker",mixins:[r.c],props:o()({},r.c.props,{value:{type:[String,Number]},icon:{type:Boolean},block:{type:Boolean},exclusive:{type:Boolean},fake:{type:Boolean}}),computed:{myChecked:function(){return this.$parent&&this.$parent.$options&&"CheckerGroup"===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&&"CheckerGroup"===this.$parent.$options.componentName?1===this.$parent.max?"radio":"checkbox":this.type},myDisabled:function(){var e=this.disabled;return this.$parent&&this.$parent.$options&&"CheckerGroup"===this.$parent.$options.componentName&&this.$parent.max>1&&this.$parent.value.length>=this.$parent.max?-1===this.$parent.value.indexOf(this.value):e},myIcon:function(){return this.$parent&&this.$parent.$options&&"CheckerGroup"===this.$parent.$options.componentName?this.$parent.icon:this.icon},myBlock:function(){return this.$parent&&this.$parent.$options&&"CheckerGroup"===this.$parent.$options.componentName?this.$parent.block:this.block}},methods:{handleChange:function(e,t){this.$parent&&this.$parent.$options&&"CheckerGroup"===this.$parent.$options.componentName?this.$parent.handleChange(t,e,this.exclusive):this.$emit("update:checked",t.target.checked).$emit("change",t)}}}}});
\No newline at end of file