h_ui
Version:
A Vue.js 2.0 UI Components Framework
1 lines • 10.2 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("h_ui/dist/lib/util/tools.js"),require("h_ui/dist/lib/util/global.js"),require("h_ui/dist/lib/directives/transfer-dom.js"),require("h_ui/dist/lib/mixins/popper.js")):"function"==typeof define&&define.amd?define("h_ui/lib",["h_ui/dist/lib/util/tools.js","h_ui/dist/lib/util/global.js","h_ui/dist/lib/directives/transfer-dom.js","h_ui/dist/lib/mixins/popper.js"],e):"object"==typeof exports?exports["h_ui/lib"]=e(require("h_ui/dist/lib/util/tools.js"),require("h_ui/dist/lib/util/global.js"),require("h_ui/dist/lib/directives/transfer-dom.js"),require("h_ui/dist/lib/mixins/popper.js")):t["h_ui/lib"]=e(t["h_ui/dist/lib/util/tools.js"],t["h_ui/dist/lib/util/global.js"],t["h_ui/dist/lib/directives/transfer-dom.js"],t["h_ui/dist/lib/mixins/popper.js"])}(window,(function(t,e,n,r){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.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 o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));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/",n(n.s=1129)}({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),o=n(14);t.exports=n(2)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},1129:function(t,e,n){"use strict";var r=n(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=r(n(1130)),i=n(32);o.default.install=function(t,e){(0,i.setGlobal)(t,e),t.component("HTooltip",o.default),t.component("Tooltip",o.default)};var u=o.default;e.default=u},1130:function(t,e,n){"use strict";n.r(e);var r=n(779),o=n(633);for(var i in o)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(i);var u=n(4),s=Object(u.a)(o.default,r.a,r.b,!1,null,null,null);e.default=s.exports},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}},128:function(t,e){t.exports=n},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 r=n(38);t.exports=function(t,e,n){return e in t?r(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 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,o){return t.call(e,n,r,o)}}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,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;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}))},21:function(e,n){e.exports=t},24:function(t,e,n){var r=n(6),o=n(1).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.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),o=n(0),i=n(16),u=n(11),s=n(10),a=function(t,e,n){var l,f,c,d=t&a.F,p=t&a.G,h=t&a.S,v=t&a.P,b=t&a.B,m=t&a.W,y=p?o:o[e]||(o[e]={}),_=y.prototype,x=p?r:h?r[e]:(r[e]||{}).prototype;for(l in p&&(n=e),n)(f=!d&&x&&void 0!==x[l])&&s(y,l)||(c=f?x[l]:n[l],y[l]=p&&"function"!=typeof x[l]?n[l]:b&&f?i(c,r):m&&x[l]==c?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}(c):v&&"function"==typeof c?i(Function.call,c):c,v&&((y.virtual||(y.virtual={}))[l]=c,t&a.R&&_&&!_[l]&&u(_,l,c)))};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,n){t.exports=e},38:function(t,e,n){t.exports=n(39)},39:function(t,e,n){n(40);var r=n(0).Object;t.exports=function(t,e,n){return r.defineProperty(t,e,n)}},4:function(t,e,n){"use strict";function r(t,e,n,r,o,i,u,s){var a,l="function"==typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),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__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(u)},l._ssrRegister=a):o&&(a=s?function(){o.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:o),a)if(l.functional){l._injectStyles=a;var f=l.render;l.render=function(t,e){return a.call(e),f(t,e)}}else{var c=l.beforeCreate;l.beforeCreate=c?[].concat(c,a):[a]}return{exports:t,options:l}}n.d(e,"a",(function(){return r}))},40:function(t,e,n){var r=n(3);r(r.S+r.F*!n(2),"Object",{defineProperty:n(5).f})},5:function(t,e,n){var r=n(12),o=n(25),i=n(17),u=Object.defineProperty;e.f=n(2)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)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}},633:function(t,e,n){"use strict";n.r(e);var r=n(634),o=n.n(r);for(var i in r)["default"].indexOf(i)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(i);e.default=o.a},634:function(t,e,n){"use strict";var r=n(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=r(n(15)),i=r(n(695)),u=r(n(128)),s=n(21),a={name:"Tooltip",directives:{TransferDom:u.default},mixins:[i.default],props:{textWrap:{type:Boolean,default:!1},placement:{validator:function(t){return(0,s.oneOf)(t,["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"])},default:"bottom"},content:{type:[String,Number],default:""},delay:{type:Number,default:0},disabled:{type:Boolean,default:!1},controlled:{type:Boolean,default:!1},always:{type:Boolean,default:!1},transfer:{type:Boolean,default:!1},imdiaClose:{type:Boolean,default:!1},customTransferClassName:{type:String},relativeRoot:{type:Boolean,default:!1}},data:function(){return{prefixCls:"h-tooltip",visible:!1,textWrapStyles:{maxWidth:"250px",maxHeight:"72px",whiteSpace:"normal",overflowWrap:"break-word",overflow:"auto",wordWrap:"break-word"}}},computed:{additionalClass:function(){return[(0,o.default)({},"".concat(this.prefixCls,"-relative"),this.relativeRoot)]},dropCls:function(){var t,e=this.globalMixinInfo&&this.globalMixinInfo.theme?this.globalMixinInfo.theme:"";return["".concat(this.prefixCls,"-popper"),(t={},(0,o.default)(t,"".concat(this.customTransferClassName),this.customTransferClassName),(0,o.default)(t,"v-transfer-dom",this.transfer),(0,o.default)(t,e,this.transfer&&!!this.globalMixinInfo&&this.globalMixinInfo.theme),t)]}},methods:{handleShowPopper:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.imdiaClose&&n||(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout((function(){e.visible=!0}),this.delay))},handleClosePopper:function(){var t=this;this.timeout&&(clearTimeout(this.timeout),this.controlled||(this.timeout=setTimeout((function(){t.visible=!1}),100)))}},mounted:function(){window.$HUI&&window.$HUI.Log&&window.$HUI.Log.debug("h_ui tooltip lifecycle mounted"),this.always&&this.updatePopper()},beforeDestroy:function(){window.$HUI&&window.$HUI.Log&&window.$HUI.Log.debug("h_ui tooltip lifecycle beforeDestroy"),this.timeout&&clearTimeout(this.timeout)}};e.default=a},695:function(t,e){t.exports=r},7:function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},779:function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return o}));var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:[t.prefixCls].concat(t.additionalClass)},[n("div",{ref:"reference",class:[t.prefixCls+"-rel"],on:{mouseenter:t.handleShowPopper,mouseleave:t.handleClosePopper}},[t._t("default")],2),t._v(" "),n("transition",{attrs:{name:"fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:!t.disabled&&(t.visible||t.always),expression:"!disabled && (visible || always)"},{name:"transfer-dom",rawName:"v-transfer-dom"}],ref:"popper",class:t.dropCls,attrs:{"data-transfer":t.transfer},on:{mouseenter:function(e){return t.handleShowPopper(e,!0)},mouseleave:t.handleClosePopper}},[n("div",{class:[t.prefixCls+"-content"]},[n("div",{class:[t.prefixCls+"-arrow"]}),t._v(" "),n("div",{class:[t.prefixCls+"-inner"],style:t.textWrap?t.textWrapStyles:""},[t._t("content",[t._v(t._s(t.content))])],2)])])])],1)},o=[];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}})}));