h_ui
Version:
A Vue.js 2.0 UI Components Framework
1 lines • 8.68 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("h_ui/dist/lib/util/global.js"),require("h_ui/dist/lib/util/dom.js")):"function"==typeof define&&define.amd?define("h_ui/lib",["h_ui/dist/lib/util/global.js","h_ui/dist/lib/util/dom.js"],e):"object"==typeof exports?exports["h_ui/lib"]=e(require("h_ui/dist/lib/util/global.js"),require("h_ui/dist/lib/util/dom.js")):t["h_ui/lib"]=e(t["h_ui/dist/lib/util/global.js"],t["h_ui/dist/lib/util/dom.js"])}(window,(function(t,e){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},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/",n(n.s=841)}({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 o=n(5),r=n(14);t.exports=n(2)?function(t,e,n){return o.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},12:function(t,e,n){var o=n(6);t.exports=function(t){if(!o(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}}},15:function(t,e,n){var o=n(38);t.exports=function(t,e,n){return e in t?o(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports},16:function(t,e,n){var o=n(27);t.exports=function(t,e,n){if(o(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,o){return t.call(e,n,o)};case 3:return function(n,o,r){return t.call(e,n,o,r)}}return function(){return t.apply(e,arguments)}}},17:function(t,e,n){var o=n(6);t.exports=function(t,e){if(!o(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!o(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!o(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!o(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},2:function(t,e,n){t.exports=!n(7)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},24:function(t,e,n){var o=n(6),r=n(1).document,i=o(r)&&o(r.createElement);t.exports=function(t){return i?r.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 o=n(1),r=n(0),i=n(16),u=n(11),f=n(10),s=function(t,e,n){var c,l,a,p=t&s.F,d=t&s.G,h=t&s.S,v=t&s.P,y=t&s.B,b=t&s.W,x=d?r:r[e]||(r[e]={}),_=x.prototype,m=d?o:h?o[e]:(o[e]||{}).prototype;for(c in d&&(n=e),n)(l=!p&&m&&void 0!==m[c])&&f(x,c)||(a=l?m[c]:n[c],x[c]=d&&"function"!=typeof m[c]?n[c]:y&&l?i(a,o):b&&m[c]==a?function(t){var e=function(e,n,o){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,o)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(a):v&&"function"==typeof a?i(Function.call,a):a,v&&((x.virtual||(x.virtual={}))[c]=a,t&s.R&&_&&!_[c]&&u(_,c,a)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},32:function(e,n){e.exports=t},38:function(t,e,n){t.exports=n(39)},39:function(t,e,n){n(40);var o=n(0).Object;t.exports=function(t,e,n){return o.defineProperty(t,e,n)}},4:function(t,e,n){"use strict";function o(t,e,n,o,r,i,u,f){var s,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),o&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),u?(s=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__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(u)},c._ssrRegister=s):r&&(s=f?function(){r.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:r),s)if(c.functional){c._injectStyles=s;var l=c.render;c.render=function(t,e){return s.call(e),l(t,e)}}else{var a=c.beforeCreate;c.beforeCreate=a?[].concat(a,s):[s]}return{exports:t,options:c}}n.d(e,"a",(function(){return o}))},40:function(t,e,n){var o=n(3);o(o.S+o.F*!n(2),"Object",{defineProperty:n(5).f})},405:function(t,e,n){"use strict";n.r(e);var o=n(406),r=n.n(o);for(var i in o)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(i);e.default=r.a},406:function(t,e,n){"use strict";var o=n(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(n(15)),i=n(84);function u(t,e){var n=e?"scrollTop":"scrollLeft",o=t[e?"pageYOffset":"pageXOffset"];return"number"!=typeof o&&(o=window.document.documentElement[n]),o}function f(t){var e=t.getBoundingClientRect(),n=u(window,!0),o=u(window),r=window.document.body,i=r.clientTop||0,f=r.clientLeft||0;return{top:e.top+n-i,left:e.left+o-f}}var s={name:"Affix",props:{offsetTop:{type:Number,default:0},offsetBottom:{type:Number}},data:function(){return{affix:!1,styles:{}}},computed:{offsetType:function(){var t="top";return this.offsetBottom>=0&&(t="bottom"),t},classes:function(){return[(0,r.default)({},"".concat("h-affix"),this.affix)]}},mounted:function(){var t=this;(0,i.on)(window,"scroll",this.handleScroll),(0,i.on)(window,"resize",(function(){var e=u(window,!0);f(t.$el).top-t.offsetTop<=e&&(t.affix=!1),t.handleScroll()}))},beforeDestroy:function(){(0,i.off)(window,"scroll",this.handleScroll),(0,i.off)(window,"resize",this.handleScroll)},methods:{handleScroll:function(){var t=this.affix,e=u(window,!0),n=f(this.$el),o=window.innerHeight,r=this.$el.getElementsByTagName("div")[0].offsetHeight;n.top-this.offsetTop<=e&&"top"==this.offsetType&&!t?(this.affix=!0,this.styles={top:"".concat(this.offsetTop,"px"),left:"".concat(n.left,"px")},this.$emit("on-change",!0)):n.top-this.offsetTop>e&&"top"==this.offsetType&&t&&(this.affix=!1,this.styles=null,this.$emit("on-change",!1)),n.top+this.offsetBottom+r>e+o&&"bottom"==this.offsetType&&!t?(this.affix=!0,this.styles={bottom:"".concat(this.offsetBottom,"px"),left:"".concat(n.left,"px")},this.$emit("on-change",!0)):n.top+this.offsetBottom+r<e+o&&"bottom"==this.offsetType&&t&&(this.affix=!1,this.styles=null,this.$emit("on-change",!1))}}};e.default=s},5:function(t,e,n){var o=n(12),r=n(25),i=n(17),u=Object.defineProperty;e.f=n(2)?Object.defineProperty:function(t,e,n){if(o(t),e=i(e,!0),o(n),r)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}},6:function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},7:function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},704:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return r}));var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{class:t.classes,style:t.styles},[t._t("default")],2)])},r=[];o._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},84:function(t,n){t.exports=e},841:function(t,e,n){"use strict";var o=n(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(n(842)),i=n(32);r.default.install=function(t,e){(0,i.setGlobal)(t,e),t.component("HAffix",r.default),t.component("Affix",r.default)};var u=r.default;e.default=u},842:function(t,e,n){"use strict";n.r(e);var o=n(704),r=n(405);for(var i in r)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(i);var u=n(4),f=Object(u.a)(r.default,o.a,o.b,!1,null,null,null);e.default=f.exports}})}));