UNPKG

fast-element-ui

Version:

Vue项目快速开发组件框架,使用element-ui为基础库二次封装构建。

1 lines 13.3 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.FastElementUI=e():t.FastElementUI=e()}(window,(function(){return 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="",n(n.s=181)}([function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function(t,e){return null!=t&&n.call(t,e)}},function(t,e,n){var r=n(8),i=n(18),o=n(34),u=n(17),s=n(20),a=n(22),c=Object.prototype.hasOwnProperty,l=o((function(t,e){if(s(e)||u(e))i(e,a(e),t);else for(var n in e)c.call(e,n)&&r(t,n,e[n])}));t.exports=l},function(t,e,n){var r=n(56);t.exports=function(t,e){return r(t,e)}},function(t,e,n){var r=n(47);t.exports=function(t,e,n){var i=null==t?void 0:r(t,e);return void 0===i?n:i}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(t){0}},function(t,e,n){var r=n(90),i=n(32),o=n(79),u=n(7),s=n(17),a=n(26),c=n(20),l=n(27),f=Object.prototype.hasOwnProperty;t.exports=function(t){if(null==t)return!0;if(s(t)&&(u(t)||"string"==typeof t||"function"==typeof t.splice||a(t)||l(t)||o(t)))return!t.length;var e=i(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(c(t))return!r(t).length;for(var n in t)if(f.call(t,n))return!1;return!0}},function(t,e){t.exports=function(t){return null==t}},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){var r=n(12),i=n(14),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var u=t[e];o.call(t,e)&&i(u,n)&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){var r=n(14);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e,n){var r=n(54);t.exports=function(t,e,n){return null==t?t:r(t,e,n)}},function(t,e,n){var r=n(29);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},,function(t,e,n){var r=n(7);t.exports=function(){if(!arguments.length)return[];var t=arguments[0];return r(t)?t:[t]}},function(t,e,n){var r=n(31),i=n(33);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},function(t,e,n){var r=n(8),i=n(12);t.exports=function(t,e,n,o){var u=!n;n||(n={});for(var s=-1,a=e.length;++s<a;){var c=e[s],l=o?o(n[c],t[c],c,n,t):void 0;void 0===l&&(l=t[c]),u?i(n,c,l):r(n,c,l)}return n}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e){t.exports=function(){return!1}},,function(t,e,n){var r=n(9)(Object.keys,Object);t.exports=r},,,function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){t.exports=function(){return!1}},function(t,e){t.exports=function(){return!1}},function(t,e){t.exports=function(t){return t}},function(t,e,n){var r=n(30),i=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(19),i=n(13);t.exports=function(t){if(!i(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){var r=n(36),i=n(41);t.exports=function(t){return r((function(e,n){var r=-1,o=n.length,u=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(u=t.length>3&&"function"==typeof u?(o--,u):void 0,s&&i(n[0],n[1],s)&&(u=o<3?void 0:u,o=1),e=Object(e);++r<o;){var a=n[r];a&&t(e,a,r,u)}return e}))}},function(t,e){t.exports=function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}},function(t,e,n){var r=n(37),i=n(38),o=n(40);t.exports=function(t,e){return o(i(t,e,r),t+"")}},function(t,e){t.exports=function(t){return t}},function(t,e,n){var r=n(39),i=Math.max;t.exports=function(t,e,n){return e=i(void 0===e?t.length-1:e,0),function(){for(var o=arguments,u=-1,s=i(o.length-e,0),a=Array(s);++u<s;)a[u]=o[e+u];u=-1;for(var c=Array(e+1);++u<e;)c[u]=o[u];return c[e]=n(a),r(t,this,c)}}},function(t,e){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},function(t,e){t.exports=function(t){return t}},function(t,e){t.exports=function(){return!1}},,,,,,function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(49),i=n(50),o=n(51),u=n(52),s=n(53);function a(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}a.prototype.clear=r,a.prototype.delete=i,a.prototype.get=o,a.prototype.has=u,a.prototype.set=s,t.exports=a},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(10),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():i.call(e,n,1),--this.size,!0)}},function(t,e,n){var r=n(10);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var r=n(10);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(10);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(8),i=n(16),o=n(55),u=n(13),s=n(28);t.exports=function(t,e,n,a){if(!u(t))return t;for(var c=-1,l=(e=i(e,t)).length,f=l-1,p=t;null!=p&&++c<l;){var v=s(e[c]),h=n;if(c!=f){var d=p[v];void 0===(h=a?a(d,v,p):void 0)&&(h=u(d)?d:o(e[c+1])?[]:{})}r(p,v,h),p=p[v]}return t}},function(t,e){var n=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&n.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e,n){var r=n(57),i=n(25);t.exports=function t(e,n,o,u,s){return e===n||(null==e||null==n||!i(e)&&!i(n)?e!=e&&n!=n:r(e,n,o,u,t,s))}},function(t,e,n){var r=n(48),i=n(58),o=n(62),u=n(63),s=n(32),a=n(7),c=n(26),l=n(27),f="[object Object]",p=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,v,h,d){var y=a(t),b=a(e),g=y?"[object Array]":s(t),x=b?"[object Array]":s(e),m=(g="[object Arguments]"==g?f:g)==f,_=(x="[object Arguments]"==x?f:x)==f,j=g==x;if(j&&c(t)){if(!c(e))return!1;y=!0,m=!1}if(j&&!m)return d||(d=new r),y||l(t)?i(t,e,n,v,h,d):o(t,e,g,n,v,h,d);if(!(1&n)){var O=m&&p.call(t,"__wrapped__"),w=_&&p.call(e,"__wrapped__");if(O||w){var E=O?t.value():t,P=w?e.value():e;return d||(d=new r),h(E,P,n,v,d)}}return!!j&&(d||(d=new r),u(t,e,n,v,h,d))}},function(t,e,n){var r=n(59),i=n(60),o=n(61);t.exports=function(t,e,n,u,s,a){var c=1&n,l=t.length,f=e.length;if(l!=f&&!(c&&f>l))return!1;var p=a.get(t);if(p&&a.get(e))return p==e;var v=-1,h=!0,d=2&n?new r:void 0;for(a.set(t,e),a.set(e,t);++v<l;){var y=t[v],b=e[v];if(u)var g=c?u(b,y,v,e,t,a):u(y,b,v,t,e,a);if(void 0!==g){if(g)continue;h=!1;break}if(d){if(!i(e,(function(t,e){if(!o(d,e)&&(y===t||s(y,t,n,u,a)))return d.push(e)}))){h=!1;break}}else if(y!==b&&!s(y,b,n,u,a)){h=!1;break}}return a.delete(t),a.delete(e),h}},function(t,e,n){var r=n(7);t.exports=function(){if(!arguments.length)return[];var t=arguments[0];return r(t)?t:[t]}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},function(t,e,n){var r=n(35);t.exports=function(t,e){return!!(null==t?0:t.length)&&r(t,e,0)>-1}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(64),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,o,u,s){var a=1&n,c=r(t),l=c.length;if(l!=r(e).length&&!a)return!1;for(var f=l;f--;){var p=c[f];if(!(a?p in e:i.call(e,p)))return!1}var v=s.get(t);if(v&&s.get(e))return v==e;var h=!0;s.set(t,e),s.set(e,t);for(var d=a;++f<l;){var y=t[p=c[f]],b=e[p];if(o)var g=a?o(b,y,p,e,t,s):o(y,b,p,t,e,s);if(!(void 0===g?y===b||u(y,b,n,o,s):g)){h=!1;break}d||(d="constructor"==p)}if(h&&!d){var x=t.constructor,m=e.constructor;x==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof x&&x instanceof x&&"function"==typeof m&&m instanceof m||(h=!1)}return s.delete(t),s.delete(e),h}},function(t,e,n){var r=n(9)(Object.keys,Object);t.exports=r},,,,,,,,,,,,,,,function(t,e){t.exports=function(){return!1}},,,,,,,,,,,function(t,e,n){var r=n(9)(Object.keys,Object);t.exports=r},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.r(e);var r=n(4),i=n(3),o=n.n(i),u=n(6),s=n.n(u),a=n(11),c=n.n(a),l=n(2),f=n.n(l),p=n(5),v=n.n(p),h=n(1),d=n.n(h),y=n(0),b=n.n(y),g={name:"FastComboBox",inheritAttrs:!1,model:{prop:"value",event:"selectChange"},props:{value:{type:[String,Number,Array],required:!0},api:{type:String,default:""},queryParams:{type:Object,default:function(){return{}}},options:{type:Array,default:function(){return[]}},width:{type:String,default:"auto"},ctStyle:{type:Object,default:function(){return{}}},ctCls:{type:Object,default:function(){return{}}},loadFilter:{type:Function,default:null},displayField:{type:String,default:"name"},valueField:{type:String,default:"id"},slotNode:{type:Object,default:function(){}},isRender:{type:Boolean,default:!0},isDisplay:{type:Boolean,default:!0},listeners:{type:Object,default:function(){}}},data:function(){return this.vQueryParams=v()(this.api)?{}:d()({},this.queryParams),this.vValue=this.multiple?d()([],this.value):this.value,{vOptions:v()(this.api)?d()([],this.options):[]}},computed:{elOptions:function(){for(var t=[],e=0;e<this.vOptions.length;e++){var n=this.vOptions[e];t.push(this.$createElement("el-option",{props:{key:n[this.valueField],label:n[this.displayField],value:n[this.valueField],disabled:n.disabled}}))}return t},slotElement:function(){var t=[];if(!v()(this.slotNode))for(var e in this.slotNode){var n=this.slotNode[e];t.push(this.$createElement("template",{slot:e},[this.$createElement("span",{domProps:{innerHTML:n.template}})]))}return t}},watch:{value:function(t,e){f()(t,e)||f()(this.vValue,t)||(this.vValue=t,this._changeEvent(this.vValue),this._selectChangeEvent(this.vValue))},api:{handler:"_fetchList",immediate:!0}},methods:{_fetchList:function(){var t=this;v()(this.api)||s()(this.$api)||this.$api[this.api](this.vQueryParams).then((function(e){s()(t.loadFilter)||(e=t.loadFilter(e.data)),t.vOptions=e.data})).catch((function(t){console.error(t)}))},_changeEvent:function(t){var e=this.multiple?d()([],t):t;f()(s()(this.listeners),!1)&&b()(this.listeners,"change")?this.listeners.change(e):this.$emit("change",e)},_visibleChangeEvent:function(t){f()(s()(this.listeners),!1)&&b()(this.listeners,"visible-change")?this.listeners["visible-change"](t):this.$emit("visible-change",t)},_removeTag:function(t){f()(s()(this.listeners),!1)&&b()(this.listeners,"remove-tag")?this.listeners["remove-tag"](t):this.$emit("remove-tag",t)},_clearEvent:function(){f()(s()(this.listeners),!1)&&b()(this.listeners,"clear")?this.listeners.clear():this.$emit("clear")},_blurEvent:function(t){f()(s()(this.listeners),!1)&&b()(this.listeners,"blur")?this.listeners.blur(t):this.$emit("blur",t)},_focusEvent:function(t){f()(s()(this.listeners),!1)&&b()(this.listeners,"focus")?this.listeners.focus(t):this.$emit("focus",t)},_selectChangeEvent:function(t){var e=this.multiple?d()([],t):t;f()(s()(this.listeners),!1)&&b()(this.listeners,"selectChange")?this.listeners.selectChange(e):this.$emit("selectChange",e)},reload:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};v()(this.api)||(d()(this.vQueryParams,t),this._fetchList())}},render:function(t){var e=this;if(f()(this.isRender,!1))return t();var n=d()({},o()(this.$props,"ctStyle",{}));return"auto"!==this.width&&(n.width=this.width),f()(this.isDisplay,!1)&&c()(n,"display","none"),t("el-select",{ref:"".concat(this._uid,"-el-select-ref"),class:o()(this.$props,"ctCls",{}),style:n,attrs:{id:this.$attrs.id},props:d()({},this.$attrs,{value:this.vValue}),on:{change:this._changeEvent,"visible-change":this._visibleChangeEvent,"remove-tag":this._removeTag,clear:this._clearEvent,blur:this._blurEvent,focus:this._focusEvent,input:function(t){e.vValue=t,e._selectChangeEvent(e.vValue)}}},[this.elOptions,this.slotElement])},install:function(t,e){Object(r.a)(g.name+"----install----"),e&&t.use(e),t.component(g.name,g)}};e.default=g}]).default}));