UNPKG

h_ui

Version:

A Vue.js 2.0 UI Components Framework

1 lines 12.4 kB
module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/lib/cjs/",n(n.s=871)}({0:function(t,e){var n=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},1:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},10:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},11:function(t,e,n){var r=n(5),i=n(14);t.exports=n(2)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},12:function(t,e,n){var r=n(6);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},14:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},16:function(t,e,n){var r=n(27);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},17:function(t,e,n){var r=n(6);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},18:function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},2:function(t,e,n){t.exports=!n(7)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},21:function(t,e){t.exports=require("h_ui/dist/lib/util/tools.js")},24:function(t,e,n){var r=n(6),i=n(1).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},25:function(t,e,n){t.exports=!n(2)&&!n(7)((function(){return 7!=Object.defineProperty(n(24)("div"),"a",{get:function(){return 7}}).a}))},27:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},3:function(t,e,n){var r=n(1),i=n(0),o=n(16),u=n(11),s=n(10),a=function(t,e,n){var c,f,l,d=t&a.F,p=t&a.G,h=t&a.S,v=t&a.P,y=t&a.B,x=t&a.W,m=p?i:i[e]||(i[e]={}),g=m.prototype,_=p?r:h?r[e]:(r[e]||{}).prototype;for(c in p&&(n=e),n)(f=!d&&_&&void 0!==_[c])&&s(m,c)||(l=f?_[c]:n[c],m[c]=p&&"function"!=typeof _[c]?n[c]:y&&f?o(l,r):x&&_[c]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):v&&"function"==typeof l?o(Function.call,l):l,v&&((m.virtual||(m.virtual={}))[c]=l,t&a.R&&g&&!g[c]&&u(g,c,l)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},32:function(t,e){t.exports=require("h_ui/dist/lib/util/global.js")},35:function(t,e){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},4:function(t,e,n){"use strict";function r(t,e,n,r,i,o,u,s){var a,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),u?(a=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(u)},c._ssrRegister=a):i&&(a=s?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),a)if(c.functional){c._injectStyles=a;var f=c.render;c.render=function(t,e){return a.call(e),f(t,e)}}else{var l=c.beforeCreate;c.beforeCreate=l?[].concat(l,a):[a]}return{exports:t,options:c}}n.d(e,"a",(function(){return r}))},441:function(t,e,n){"use strict";n.r(e);var r=n(442),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e.default=i.a},442:function(t,e,n){"use strict";var r=n(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n(53)),o=r(n(47)),u=n(21),s="h-carousel",a={name:"Carousel",components:{Icon:o.default},props:{arrow:{type:String,default:"hover",validator:function(t){return(0,u.oneOf)(t,["hover","always","never"])}},autoplay:{type:Boolean,default:!1},autoplaySpeed:{type:Number,default:2e3},easing:{type:String,default:"ease"},loop:{type:Boolean,default:!1},dots:{type:String,default:"inside",validator:function(t){return(0,u.oneOf)(t,["inside","outside","none"])}},trigger:{type:String,default:"click",validator:function(t){return(0,u.oneOf)(t,["click","hover"])}},value:{type:Number,default:0},height:{type:[String,Number],default:"auto",validator:function(t){return"auto"===t||"[object Number]"===Object.prototype.toString.call(t)}}},data:function(){return{prefixCls:s,listWidth:0,trackWidth:0,trackOffset:0,slides:[],slideInstances:[],timer:null,ready:!1,currentIndex:this.value}},computed:{classes:function(){return["".concat(s)]},trackStyles:function(){return{width:"".concat(this.trackWidth,"px"),transform:"translate3d(-".concat(this.trackOffset,"px, 0px, 0px)"),transition:"transform 500ms ".concat(this.easing)}},arrowClasses:function(){return["".concat(s,"-arrow"),"".concat(s,"-arrow-").concat(this.arrow)]},dotsClasses:function(){return["".concat(s,"-dots"),"".concat(s,"-dots-").concat(this.dots)]}},methods:{findChild:function(t){var e=function e(n){n.$options.componentName?t(n):n.$children.length&&n.$children.forEach((function(t){e(t)}))};this.slideInstances.length||!this.$children?this.slideInstances.forEach((function(t){e(t)})):this.$children.forEach((function(t){e(t)}))},updateSlides:function(t){var e=this,n=[],r=1;this.findChild((function(i){n.push({$el:i.$el}),i.index=r++,t&&e.slideInstances.push(i)})),this.slides=n,this.updatePos()},updatePos:function(){var t=this;this.findChild((function(e){e.width=t.listWidth,e.height="number"==typeof t.height?"".concat(t.height,"px"):t.height})),this.trackWidth=(this.slides.length||0)*this.listWidth},slotChange:function(){var t=this;this.$nextTick((function(){t.slides=[],t.slideInstances=[],t.updateSlides(!0,!0),t.updatePos(),t.updateOffset()}))},handleResize:function(){this.listWidth=(0,i.default)((0,u.getStyle)(this.$el,"width"),10),this.updatePos(),this.updateOffset()},add:function(t){var e=this.currentIndex;for(e+=t;e<0;)e+=this.slides.length;e%=this.slides.length,this.currentIndex=e,this.$emit("input",e)},arrowEvent:function(t){this.setAutoplay(),this.add(t)},dotsEvent:function(t,e){t===this.trigger&&this.currentIndex!==e&&(this.currentIndex=e,this.$emit("input",e),this.setAutoplay())},setAutoplay:function(){var t=this;window.clearInterval(this.timer),this.autoplay&&(this.timer=window.setInterval((function(){t.add(1)}),this.autoplaySpeed))},updateOffset:function(){var t=this;this.$nextTick((function(){t.trackOffset=t.currentIndex*t.listWidth}))}},watch:{autoplay:function(){this.setAutoplay()},autoplaySpeed:function(){this.setAutoplay()},currentIndex:function(t,e){this.$emit("on-change",e,t),this.updateOffset()},height:function(){this.updatePos()},value:function(t){this.currentIndex=t}},mounted:function(){this.updateSlides(!0),this.handleResize(),this.setAutoplay(),window.addEventListener("resize",this.handleResize,!1)},beforeDestroy:function(){window.removeEventListener("resize",this.handleResize,!1)}};e.default=a},443:function(t,e,n){"use strict";n.r(e);var r=n(444),i=n.n(r);for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e.default=i.a},444:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r={componentName:"carousel-item",name:"CarouselItem",data:function(){return{prefixCls:"h-carousel-item",width:0,height:"auto",left:0}},computed:{styles:function(){return{width:"".concat(this.width,"px"),height:"".concat(this.height),left:"".concat(this.left,"px")}}},mounted:function(){this.$parent.slotChange()},beforeDestroy:function(){this.$parent.slotChange()}};e.default=r},47:function(t,e){t.exports=require("h_ui/dist/lib/cjs/Icon.js")},5:function(t,e,n){var r=n(12),i=n(25),o=n(17),u=Object.defineProperty;e.f=n(2)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return u(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},51:function(t,e,n){var r=n(3),i=n(18),o=n(7),u=n(35),s="["+u+"]",a=RegExp("^"+s+s+"*"),c=RegExp(s+s+"*$"),f=function(t,e,n){var i={},s=o((function(){return!!u[t]()||"​…"!="​…"[t]()})),a=i[t]=s?e(l):u[t];n&&(i[n]=a),r(r.P+r.F*s,"String",i)},l=f.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(a,"")),2&e&&(t=t.replace(c,"")),t};t.exports=f},53:function(t,e,n){t.exports=n(69)},6:function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},69:function(t,e,n){n(70),t.exports=n(0).parseInt},7:function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},70:function(t,e,n){var r=n(3),i=n(71);r(r.G+r.F*(parseInt!=i),{parseInt:i})},71:function(t,e,n){var r=n(1).parseInt,i=n(51).trim,o=n(35),u=/^[-+]?0[xX]/;t.exports=8!==r(o+"08")||22!==r(o+"0x16")?function(t,e){var n=i(String(t),3);return r(n,e>>>0||(u.test(n)?16:10))}:r},716:function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:t.classes},[n("button",{staticClass:"left",class:t.arrowClasses,on:{click:function(e){return t.arrowEvent(-1)}}},[n("Icon",{attrs:{name:"return"}})],1),t._v(" "),n("div",{class:[t.prefixCls+"-list"]},[n("div",{class:[t.prefixCls+"-track"],style:t.trackStyles},[t._t("default")],2)]),t._v(" "),n("button",{staticClass:"right",class:t.arrowClasses,on:{click:function(e){return t.arrowEvent(1)}}},[n("Icon",{attrs:{name:"enter"}})],1),t._v(" "),n("ul",{class:t.dotsClasses},[t._l(t.slides.length,(function(e,r){return[n("li",{key:r,class:[e-1===t.currentIndex?t.prefixCls+"-active":""],on:{click:function(n){return t.dotsEvent("click",e-1)},mouseover:function(n){return t.dotsEvent("hover",e-1)}}},[n("button")])]}))],2)])},i=[];r._withStripped=!0},717:function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var r=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{class:t.prefixCls,style:t.styles},[t._t("default")],2)},i=[];r._withStripped=!0},8:function(t,e){t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.__esModule=!0,t.exports.default=t.exports},871:function(t,e,n){"use strict";var r=n(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n(872)),o=r(n(873)),u=n(32);i.default.install=function(t,e){(0,u.setGlobal)(t,e),t.component("HCarousel",i.default),t.component("Carousel",i.default),t.component("HCarouselitem",o.default),t.component("Carouselitem",o.default)},i.default.Item=o.default;var s=i.default;e.default=s},872:function(t,e,n){"use strict";n.r(e);var r=n(716),i=n(441);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);var u=n(4),s=Object(u.a)(i.default,r.a,r.b,!1,null,null,null);e.default=s.exports},873:function(t,e,n){"use strict";n.r(e);var r=n(717),i=n(443);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);var u=n(4),s=Object(u.a)(i.default,r.a,r.b,!1,null,null,null);e.default=s.exports}});