UNPKG

h_ui

Version:

A Vue.js 2.0 UI Components Framework

1 lines 11 kB
!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/Icon.js"),require("h_ui/dist/lib/Tooltip.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/Icon.js","h_ui/dist/lib/Tooltip.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/Icon.js"),require("h_ui/dist/lib/Tooltip.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/Icon.js"],t["h_ui/dist/lib/Tooltip.js"])}(window,(function(t,e,o,n){return function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/dist/lib/",o(o.s=1120)}({0:function(t,e){var o=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=o)},1:function(t,e){var o=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=o)},10:function(t,e){var o={}.hasOwnProperty;t.exports=function(t,e){return o.call(t,e)}},11:function(t,e,o){var n=o(5),r=o(14);t.exports=o(2)?function(t,e,o){return n.f(t,e,r(1,o))}:function(t,e,o){return t[e]=o,t}},1120:function(t,e,o){"use strict";var n=o(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(o(1121)),i=o(32);r.default.install=function(t,e){(0,i.setGlobal)(t,e),t.component("HTag",r.default),t.component("Tag",r.default)};var u=r.default;e.default=u},1121:function(t,e,o){"use strict";o.r(e);var n=o(775),r=o(625);for(var i in r)["default"].indexOf(i)<0&&function(t){o.d(e,t,(function(){return r[t]}))}(i);var u=o(4),c=Object(u.a)(r.default,n.a,n.b,!1,null,null,null);e.default=c.exports},12:function(t,e,o){var n=o(6);t.exports=function(t){if(!n(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,o){var n=o(38);t.exports=function(t,e,o){return e in t?n(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t},t.exports.__esModule=!0,t.exports.default=t.exports},16:function(t,e,o){var n=o(27);t.exports=function(t,e,o){if(n(t),void 0===e)return t;switch(o){case 1:return function(o){return t.call(e,o)};case 2:return function(o,n){return t.call(e,o,n)};case 3:return function(o,n,r){return t.call(e,o,n,r)}}return function(){return t.apply(e,arguments)}}},17:function(t,e,o){var n=o(6);t.exports=function(t,e){if(!n(t))return t;var o,r;if(e&&"function"==typeof(o=t.toString)&&!n(r=o.call(t)))return r;if("function"==typeof(o=t.valueOf)&&!n(r=o.call(t)))return r;if(!e&&"function"==typeof(o=t.toString)&&!n(r=o.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},2:function(t,e,o){t.exports=!o(7)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},21:function(e,o){e.exports=t},24:function(t,e,o){var n=o(6),r=o(1).document,i=n(r)&&n(r.createElement);t.exports=function(t){return i?r.createElement(t):{}}},25:function(t,e,o){t.exports=!o(2)&&!o(7)((function(){return 7!=Object.defineProperty(o(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,o){var n=o(1),r=o(0),i=o(16),u=o(11),c=o(10),l=function(t,e,o){var s,a,f,d=t&l.F,p=t&l.G,h=t&l.S,b=t&l.P,y=t&l.B,v=t&l.W,_=p?r:r[e]||(r[e]={}),x=_.prototype,g=p?n:h?n[e]:(n[e]||{}).prototype;for(s in p&&(o=e),o)(a=!d&&g&&void 0!==g[s])&&c(_,s)||(f=a?g[s]:o[s],_[s]=p&&"function"!=typeof g[s]?o[s]:y&&a?i(f,n):v&&g[s]==f?function(t){var e=function(e,o,n){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,o)}return new t(e,o,n)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(f):b&&"function"==typeof f?i(Function.call,f):f,b&&((_.virtual||(_.virtual={}))[s]=f,t&l.R&&x&&!x[s]&&u(x,s,f)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},32:function(t,o){t.exports=e},335:function(t,e){t.exports=n},38:function(t,e,o){t.exports=o(39)},39:function(t,e,o){o(40);var n=o(0).Object;t.exports=function(t,e,o){return n.defineProperty(t,e,o)}},4:function(t,e,o){"use strict";function n(t,e,o,n,r,i,u,c){var l,s="function"==typeof t?t.options:t;if(e&&(s.render=e,s.staticRenderFns=o,s._compiled=!0),n&&(s.functional=!0),i&&(s._scopeId="data-v-"+i),u?(l=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)},s._ssrRegister=l):r&&(l=c?function(){r.call(this,(s.functional?this.parent:this).$root.$options.shadowRoot)}:r),l)if(s.functional){s._injectStyles=l;var a=s.render;s.render=function(t,e){return l.call(e),a(t,e)}}else{var f=s.beforeCreate;s.beforeCreate=f?[].concat(f,l):[l]}return{exports:t,options:s}}o.d(e,"a",(function(){return n}))},40:function(t,e,o){var n=o(3);n(n.S+n.F*!o(2),"Object",{defineProperty:o(5).f})},47:function(t,e){t.exports=o},5:function(t,e,o){var n=o(12),r=o(25),i=o(17),u=Object.defineProperty;e.f=o(2)?Object.defineProperty:function(t,e,o){if(n(t),e=i(e,!0),n(o),r)try{return u(t,e,o)}catch(t){}if("get"in o||"set"in o)throw TypeError("Accessors not supported!");return"value"in o&&(t[e]=o.value),t}},6:function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},625:function(t,e,o){"use strict";o.r(e);var n=o(626),r=o.n(n);for(var i in n)["default"].indexOf(i)<0&&function(t){o.d(e,t,(function(){return n[t]}))}(i);e.default=r.a},626:function(t,e,o){"use strict";var n=o(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(o(15)),i=n(o(47)),u=o(21),c=n(o(335)),l="h-tag",s=["default","primary","success","warning","error","blue","green","red","yellow","pink","magenta","volcano","orange","gold","lime","cyan","geekblue","purple"],a=["pink","magenta","volcano","orange","gold","lime","cyan","geekblue","purple"],f={name:"Tag",components:{Icon:i.default,Tooltip:c.default},props:{closable:{type:Boolean,default:!1},checkable:{type:Boolean,default:!1},checked:{type:Boolean,default:!0},color:{type:String,default:"default"},type:{validator:function(t){return(0,u.oneOf)(t,["border","dot"])}},name:{type:[String,Number]},fade:{type:Boolean,default:!0},showTitle:{type:Boolean,default:!1},title:String,placement:String,width:{type:[String,Number],default:null}},data:function(){return{isChecked:this.checked}},computed:{tranName:function(){return this.fade?"fade":""},content:function(){return this.showTitle?this.title||this.$slots.default[0].text:void 0},classes:function(){var t;return["".concat(l),(t={},(0,r.default)(t,"".concat(l,"-").concat(this.color),!!this.color&&(0,u.oneOf)(this.color,s)),(0,r.default)(t,"".concat(l,"-").concat(this.type),!!this.type),(0,r.default)(t,"".concat(l,"-closable"),this.closable),(0,r.default)(t,"".concat(l,"-checked"),this.isChecked),t)]},wraperStyles:function(){return(0,u.oneOf)(this.color,s)?{}:{background:this.isChecked?this.defaultTypeColor:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"dot"!==this.type&&"border"!==this.type&&this.isChecked?this.borderColor:this.lineColor,color:this.lineColor}},textClasses:function(){return["".concat(l,"-text"),"border"===this.type&&(0,u.oneOf)(this.color,s)?"".concat(l,"-color-").concat(this.color):"","dot"!==this.type&&"border"!==this.type&&"default"!==this.color&&this.isChecked&&a.indexOf(this.color)<0?"".concat(l,"-color-white"):""]},dotClasses:function(){return"".concat(l,"-dot-inner")},iconClass:function(){return"dot"===this.type?"":"border"===this.type?(0,u.oneOf)(this.color,s)?"".concat(l,"-color-").concat(this.color):"":void 0!==this.color?"default"===this.color?"":"rgb(255, 255, 255)":""},showDot:function(){return!!this.type&&"dot"===this.type},lineColor:function(){return"dot"===this.type?"":"border"===this.type?void 0!==this.color?(0,u.oneOf)(this.color,s)?"":this.color:"":void 0!==this.color?"default"===this.color?"":"rgb(255, 255, 255)":""},borderColor:function(){return void 0!==this.color?"default"===this.color?"":this.color:""},dotColor:function(){return void 0!==this.color?(0,u.oneOf)(this.color,s)?"":this.color:""},textColorStyle:function(){var t={};return this.color||s||("dot"!==this.type&&"border"!==this.type?this.this.isChecked&&(t.color=this.lineColor):t.color=this.lineColor),null!==this.width&&(t.width=this.width+"px"),t},bgColorStyle:function(){return(0,u.oneOf)(this.color,s)?{}:{background:this.dotColor}},defaultTypeColor:function(){return"dot"!==this.type&&"border"!==this.type&&void 0!==this.color?(0,u.oneOf)(this.color,s)?"":this.color:""}},methods:{close:function(t){void 0===this.name?this.$emit("on-close",t):this.$emit("on-close",t,this.name)},check:function(){if(this.checkable){var t=!this.isChecked;this.isChecked=t,void 0===this.name?this.$emit("on-change",t):this.$emit("on-change",t,this.name)}}}};e.default=f},7:function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},775:function(t,e,o){"use strict";o.d(e,"a",(function(){return n})),o.d(e,"b",(function(){return r}));var n=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("transition",{attrs:{name:t.tranName}},[o("Tooltip",{attrs:{content:t.content,disabled:!t.showTitle,placement:t.placement}},[o("div",{class:t.classes,style:t.wraperStyles,on:{click:t.check}},[t.showDot?o("span",{class:t.dotClasses,style:t.bgColorStyle}):t._e(),t._v(" "),o("span",{class:t.textClasses,style:t.textColorStyle},[t._t("default")],2),t._v(" "),t.closable?o("Icon",{class:t.iconClass,attrs:{color:t.lineColor,name:"close"},nativeOn:{click:function(e){return e.stopPropagation(),t.close(e)}}}):t._e()],1)])],1)},r=[];n._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}})}));