UNPKG

@lan-ui/lan-ui

Version:

A fantastic mobile ui lib implement by Vue

1 lines 8.1 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["radio-group"]=e():(t.lan=t.lan||{},t.lan["radio-group"]=e())}("undefined"!=typeof self?self:this,function(){return function(t){function e(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var o={};return e.m=t,e.c=o,e.d=function(t,o,n){e.o(t,o)||Object.defineProperty(t,o,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="./",e(e.s=421)}({171:function(t,e,o){var n,r,a;!function(i,u){r=[t,e,o(74)],n=u,void 0!==(a="function"==typeof n?n.apply(e,r):n)&&(t.exports=a)}(0,function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=(0,o.prefixStyle)("flexBasis");e.default={props:{colNum:{type:Number,default:1}},watch:{colNum:{immediate:!0,handler:function(t){var e=this;if(t<=1)return"";this.$nextTick(function(){var o=100/t+"%";Array.prototype.forEach.call(e.$refs.group.children,function(t){t.style[n]=o})})}}}},t.exports=e.default})},172:function(t,e,o){function n(t){o(192)}var r=o(4)(o(193),o(194),n,null,null);t.exports=r.exports},192:function(t,e){},193:function(t,e,o){var n,r,a;!function(o,i){r=[t,e],n=i,void 0!==(a="function"==typeof n?n.apply(e,r):n)&&(t.exports=a)}(0,function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={name:"cube-radio",inject:{radioGroup:{default:null}},props:{value:[String,Number],option:{type:[String,Object],required:!0},position:{type:String,default:"left"},hollowStyle:{type:Boolean,default:!1}},data:function(){return{radioValue:this.value}},created:function(){var t=this,e=this.radioGroup;e&&(this.radioValue=e.radioValue,this._cancelWatchGroup=this.$watch(function(){return e.radioValue},function(e){t.radioValue=e}))},beforeDestroy:function(){this._cancelWatchGroup&&this._cancelWatchGroup(),this._cancelWatchGroup=null},watch:{value:function(t){this.radioValue=t},radioValue:function(t){"number"==typeof this.value&&(t=Number(t)),this.$emit("input",t),this.radioGroup&&(this.radioGroup.radioValue=t)}},computed:{computedOption:function(){var t=this.option;return"string"==typeof t?{value:t,label:t}:t},_containerClass:function(){var t=this.computedOption;return{"cube-radio-hollow":this.hollowStyle,"cube-radio_selected":this.radioValue===t.value,"cube-radio_disabled":t.disabled,"border-right-1px":this.$parent.horizontal}},_wrapClass:function(){var t=this.$parent;if(!(t.horizontal||t.$props.colNum>1))return"border-bottom-1px"}}},t.exports=e.default})},194:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"cube-radio",class:t._containerClass,attrs:{"data-pos":t.position}},[o("label",{staticClass:"cube-radio-wrap",class:t._wrapClass},[o("input",{directives:[{name:"model",rawName:"v-model",value:t.radioValue,expression:"radioValue"}],staticClass:"cube-radio-input",attrs:{type:"radio",disabled:t.option.disabled},domProps:{value:t.computedOption.value,checked:t._q(t.radioValue,t.computedOption.value)},on:{change:function(e){t.radioValue=t.computedOption.value}}}),t._v(" "),t._m(0),t._v(" "),t._t("default",[o("span",{staticClass:"cube-radio-label"},[t._v(t._s(t.computedOption.label))])])],2)])},staticRenderFns:[function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("span",{staticClass:"cube-radio-ui cubeic-round-border"},[o("i")])}]}},195:function(t,e,o){function n(t){o(196)}var r=o(4)(o(197),o(198),n,null,null);t.exports=r.exports},196:function(t,e){},197:function(t,e,o){var n,r,a;!function(i,u){r=[t,e,o(172),o(171)],n=u,void 0!==(a="function"==typeof n?n.apply(e,r):n)&&(t.exports=a)}(0,function(t,e,o,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=r(o),i=r(n);e.default={name:"cube-radio-group",mixins:[i.default],provide:function(){return{radioGroup:this}},props:{value:[String,Number],options:{type:Array,default:function(){return[]}},position:{type:String,default:"left"},horizontal:{type:Boolean,default:!1},hollowStyle:{type:Boolean,default:!1}},data:function(){return{radioValue:this.value}},watch:{value:function(t){this.radioValue=t},radioValue:function(t){this.$emit("input",t)}},computed:{_groupClass:function(){if(!this.horizontal)return"border-top-1px border-bottom-1px"}},components:{CubeRadio:a.default}},t.exports=e.default})},198:function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{ref:"group",staticClass:"cube-radio-group",class:t._groupClass,attrs:{"data-horz":t.horizontal,"data-col":t.colNum>1}},[t._t("default",t._l(t.options,function(e,n){return o("cube-radio",{key:n,attrs:{option:e,position:t.position,"hollow-style":t.hollowStyle},model:{value:t.radioValue,callback:function(e){t.radioValue=e},expression:"radioValue"}})}))],2)},staticRenderFns:[]}},4:function(t,e){t.exports=function(t,e,o,n,r){var a,i=t=t||{},u=typeof t.default;"object"!==u&&"function"!==u||(a=t,i=t.default);var s="function"==typeof i?i.options:i;e&&(s.render=e.render,s.staticRenderFns=e.staticRenderFns),n&&(s._scopeId=n);var l;if(r?(l=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},s._ssrRegister=l):o&&(l=o),l){var c=s.functional,d=c?s.render:s.beforeCreate;c?s.render=function(t,e){return l.call(e),d(t,e)}:s.beforeCreate=d?[].concat(d,l):[l]}return{esModule:a,exports:i,options:s}}},421:function(t,e,o){var n,r,a;!function(i,u){r=[t,e,o(195),o(172)],n=u,void 0!==(a="function"==typeof n?n.apply(e,r):n)&&(t.exports=a)}(0,function(t,e,o,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=r(o),i=r(n);a.default.install=function(t){t.component(a.default.name,a.default),t.component(i.default.name,i.default)},a.default.Radio=i.default,e.default=a.default,t.exports=e.default})},74:function(t,e,o){var n,r,a;!function(i,u){r=[e,o(75)],n=u,void 0!==(a="function"==typeof n?n.apply(e,r):n)&&(t.exports=a)}(0,function(t,e){"use strict";function o(t,e){return new RegExp("(^|\\s)"+e+"(\\s|$)").test(t.className)}function n(t,e){if(!o(t,e)){var n=t.className.split(" ");n.push(e),t.className=n.join(" ")}}function r(t,e){if(o(t,e)){var n=new RegExp("(^|\\s)"+e+"(\\s|$)","g");t.className=t.className.replace(n," ")}}function a(t,e){return t.getAttribute("data-"+e)}function i(t){return{top:t.offsetTop,left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight}}function u(t){return!1!==c&&("standard"===c?"transitionEnd"===t?"transitionend":t:c+t.charAt(0).toUpperCase()+t.substr(1))}function s(t,e){for(var n=t.target;n&&!o(n,e);){if(n===t.currentTarget)return null;n=n.parentNode}return n}function l(t,e){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=o.type,r=void 0===n?"Event":n,a=o.bubbles,i=void 0===a||a,u=o.cancelable,s=void 0===u||u,l=document.createEvent(r);l.initEvent(e,i,s),t.dispatchEvent(l)}Object.defineProperty(t,"__esModule",{value:!0}),t.hasClass=o,t.addClass=n,t.removeClass=r,t.getData=a,t.getRect=i,t.prefixStyle=u,t.getMatchedTarget=s,t.dispatchEvent=l;var c=function(){if(!e.inBrowser)return!1;var t=document.createElement("div").style,o={standard:"transform",webkit:"webkitTransform",Moz:"MozTransform",O:"OTransform",ms:"msTransform"};for(var n in o)if(void 0!==t[o[n]])return n;return!1}()})},75:function(t,e,o){var n,r,a;!function(o,i){r=[e],n=i,void 0!==(a="function"==typeof n?n.apply(e,r):n)&&(t.exports=a)}(0,function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=t.inBrowser="undefined"!=typeof window,o=t.ua=e&&navigator.userAgent.toLowerCase();t.isAndroid=o&&o.indexOf("android")>0})}})});