UNPKG

shu-c-view

Version:

rollup 打包vue@2.7组件库框架

7 lines (6 loc) 14.7 kB
/*! * shu-c-view v2.0.0 * (c) 2024-04-23 * @license MIT */ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("lodash/assign"),e=require("lodash/omit"),n=require("lodash/keys"),r=require("lodash/has"),o=require("lodash/get"),i=require("lodash/concat"),u=require("vue");function c(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var a=c(t),s=c(e),f=c(n),l=c(r),p=c(o),b=c(i);function y(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h=function(t){return t&&t.Math==Math&&t},v=h("object"==typeof globalThis&&globalThis)||h("object"==typeof window&&window)||h("object"==typeof self&&self)||h("object"==typeof d&&d)||function(){return this}()||Function("return this")(),g={},m=function(t){try{return!!t()}catch(t){return!0}},w=!m((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),S=!m((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),O=S,j=Function.prototype.call,P=O?j.bind(j):function(){return j.apply(j,arguments)},T={},$={}.propertyIsEnumerable,E=Object.getOwnPropertyDescriptor,x=E&&!$.call({1:2},1);T.f=x?function(t){var e=E(this,t);return!!e&&e.enumerable}:$;var C,_,A=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},D=S,M=Function.prototype,F=M.call,I=D&&M.bind.bind(F,F),N=D?I:function(t){return function(){return F.apply(t,arguments)}},L=N,k=L({}.toString),z=L("".slice),q=function(t){return z(k(t),8,-1)},R=m,B=q,G=Object,H=N("".split),U=R((function(){return!G("z").propertyIsEnumerable(0)}))?function(t){return"String"==B(t)?H(t,""):G(t)}:G,W=function(t){return null==t},K=W,V=TypeError,X=function(t){if(K(t))throw V("Can't call method on "+t);return t},Y=U,J=X,Q=function(t){return Y(J(t))},Z="object"==typeof document&&document.all,tt={all:Z,IS_HTMLDDA:void 0===Z&&void 0!==Z},et=tt.all,nt=tt.IS_HTMLDDA?function(t){return"function"==typeof t||t===et}:function(t){return"function"==typeof t},rt=nt,ot=tt.all,it=tt.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:rt(t)||t===ot}:function(t){return"object"==typeof t?null!==t:rt(t)},ut=v,ct=nt,at=function(t){return ct(t)?t:void 0},st=function(t,e){return arguments.length<2?at(ut[t]):ut[t]&&ut[t][e]},ft=N({}.isPrototypeOf),lt=v,pt=st("navigator","userAgent")||"",bt=lt.process,yt=lt.Deno,dt=bt&&bt.versions||yt&&yt.version,ht=dt&&dt.v8;ht&&(_=(C=ht.split("."))[0]>0&&C[0]<4?1:+(C[0]+C[1])),!_&&pt&&(!(C=pt.match(/Edge\/(\d+)/))||C[1]>=74)&&(C=pt.match(/Chrome\/(\d+)/))&&(_=+C[1]);var vt=_,gt=vt,mt=m,wt=!!Object.getOwnPropertySymbols&&!mt((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&gt&&gt<41})),St=wt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ot=st,jt=nt,Pt=ft,Tt=Object,$t=St?function(t){return"symbol"==typeof t}:function(t){var e=Ot("Symbol");return jt(e)&&Pt(e.prototype,Tt(t))},Et=String,xt=nt,Ct=function(t){try{return Et(t)}catch(t){return"Object"}},_t=TypeError,At=function(t){if(xt(t))return t;throw _t(Ct(t)+" is not a function")},Dt=W,Mt=P,Ft=nt,It=it,Nt=TypeError,Lt={exports:{}},kt=v,zt=Object.defineProperty,qt=function(t,e){try{zt(kt,t,{value:e,configurable:!0,writable:!0})}catch(n){kt[t]=e}return e},Rt=qt,Bt=v["__core-js_shared__"]||Rt("__core-js_shared__",{}),Gt=Bt;(Lt.exports=function(t,e){return Gt[t]||(Gt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.26.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ht=X,Ut=Object,Wt=function(t){return Ut(Ht(t))},Kt=Wt,Vt=N({}.hasOwnProperty),Xt=Object.hasOwn||function(t,e){return Vt(Kt(t),e)},Yt=N,Jt=0,Qt=Math.random(),Zt=Yt(1..toString),te=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Zt(++Jt+Qt,36)},ee=v,ne=Lt.exports,re=Xt,oe=te,ie=wt,ue=St,ce=ne("wks"),ae=ee.Symbol,se=ae&&ae.for,fe=ue?ae:ae&&ae.withoutSetter||oe,le=function(t){if(!re(ce,t)||!ie&&"string"!=typeof ce[t]){var e="Symbol."+t;ie&&re(ae,t)?ce[t]=ae[t]:ce[t]=ue&&se?se(e):fe(e)}return ce[t]},pe=P,be=it,ye=$t,de=function(t,e){var n=t[e];return Dt(n)?void 0:At(n)},he=function(t,e){var n,r;if("string"===e&&Ft(n=t.toString)&&!It(r=Mt(n,t)))return r;if(Ft(n=t.valueOf)&&!It(r=Mt(n,t)))return r;if("string"!==e&&Ft(n=t.toString)&&!It(r=Mt(n,t)))return r;throw Nt("Can't convert object to primitive value")},ve=TypeError,ge=le("toPrimitive"),me=function(t,e){if(!be(t)||ye(t))return t;var n,r=de(t,ge);if(r){if(void 0===e&&(e="default"),n=pe(r,t,e),!be(n)||ye(n))return n;throw ve("Can't convert object to primitive value")}return void 0===e&&(e="number"),he(t,e)},we=$t,Se=function(t){var e=me(t,"string");return we(e)?e:e+""},Oe=it,je=v.document,Pe=Oe(je)&&Oe(je.createElement),Te=function(t){return Pe?je.createElement(t):{}},$e=!w&&!m((function(){return 7!=Object.defineProperty(Te("div"),"a",{get:function(){return 7}}).a})),Ee=w,xe=P,Ce=T,_e=A,Ae=Q,De=Se,Me=Xt,Fe=$e,Ie=Object.getOwnPropertyDescriptor;g.f=Ee?Ie:function(t,e){if(t=Ae(t),e=De(e),Fe)try{return Ie(t,e)}catch(t){}if(Me(t,e))return _e(!xe(Ce.f,t,e),t[e])};var Ne={},Le=w&&m((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),ke=it,ze=String,qe=TypeError,Re=function(t){if(ke(t))return t;throw qe(ze(t)+" is not an object")},Be=w,Ge=$e,He=Le,Ue=Re,We=Se,Ke=TypeError,Ve=Object.defineProperty,Xe=Object.getOwnPropertyDescriptor;Ne.f=Be?He?function(t,e,n){if(Ue(t),e=We(e),Ue(n),"function"==typeof t&&"prototype"===e&&"value"in n&&"writable"in n&&!n.writable){var r=Xe(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:"configurable"in n?n.configurable:r.configurable,enumerable:"enumerable"in n?n.enumerable:r.enumerable,writable:!1})}return Ve(t,e,n)}:Ve:function(t,e,n){if(Ue(t),e=We(e),Ue(n),Ge)try{return Ve(t,e,n)}catch(t){}if("get"in n||"set"in n)throw Ke("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var Ye=Ne,Je=A,Qe=w?function(t,e,n){return Ye.f(t,e,Je(1,n))}:function(t,e,n){return t[e]=n,t},Ze={exports:{}},tn=w,en=Xt,nn=Function.prototype,rn=tn&&Object.getOwnPropertyDescriptor,on=en(nn,"name"),un={EXISTS:on,PROPER:on&&"something"===function(){}.name,CONFIGURABLE:on&&(!tn||tn&&rn(nn,"name").configurable)},cn=nt,an=Bt,sn=N(Function.toString);cn(an.inspectSource)||(an.inspectSource=function(t){return sn(t)});var fn,ln,pn,bn=an.inspectSource,yn=nt,dn=v.WeakMap,hn=yn(dn)&&/native code/.test(String(dn)),vn=Lt.exports,gn=te,mn=vn("keys"),wn={},Sn=hn,On=v,jn=it,Pn=Qe,Tn=Xt,$n=Bt,En=function(t){return mn[t]||(mn[t]=gn(t))},xn=wn,Cn=On.TypeError,_n=On.WeakMap;if(Sn||$n.state){var An=$n.state||($n.state=new _n);An.get=An.get,An.has=An.has,An.set=An.set,fn=function(t,e){if(An.has(t))throw Cn("Object already initialized");return e.facade=t,An.set(t,e),e},ln=function(t){return An.get(t)||{}},pn=function(t){return An.has(t)}}else{var Dn=En("state");xn[Dn]=!0,fn=function(t,e){if(Tn(t,Dn))throw Cn("Object already initialized");return e.facade=t,Pn(t,Dn,e),e},ln=function(t){return Tn(t,Dn)?t[Dn]:{}},pn=function(t){return Tn(t,Dn)}}var Mn={set:fn,get:ln,has:pn,enforce:function(t){return pn(t)?ln(t):fn(t,{})},getterFor:function(t){return function(e){var n;if(!jn(e)||(n=ln(e)).type!==t)throw Cn("Incompatible receiver, "+t+" required");return n}}},Fn=m,In=nt,Nn=Xt,Ln=w,kn=un.CONFIGURABLE,zn=bn,qn=Mn.enforce,Rn=Mn.get,Bn=Object.defineProperty,Gn=Ln&&!Fn((function(){return 8!==Bn((function(){}),"length",{value:8}).length})),Hn=String(String).split("String"),Un=Ze.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!Nn(t,"name")||kn&&t.name!==e)&&(Ln?Bn(t,"name",{value:e,configurable:!0}):t.name=e),Gn&&n&&Nn(n,"arity")&&t.length!==n.arity&&Bn(t,"length",{value:n.arity});try{n&&Nn(n,"constructor")&&n.constructor?Ln&&Bn(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=qn(t);return Nn(r,"source")||(r.source=Hn.join("string"==typeof e?e:"")),t};Function.prototype.toString=Un((function(){return In(this)&&Rn(this).source||zn(this)}),"toString");var Wn=nt,Kn=Ne,Vn=Ze.exports,Xn=qt,Yn={},Jn=Math.ceil,Qn=Math.floor,Zn=Math.trunc||function(t){var e=+t;return(e>0?Qn:Jn)(e)},tr=function(t){var e=+t;return e!=e||0===e?0:Zn(e)},er=tr,nr=Math.max,rr=Math.min,or=tr,ir=Math.min,ur=function(t){return t>0?ir(or(t),9007199254740991):0},cr=function(t){return ur(t.length)},ar=Q,sr=function(t,e){var n=er(t);return n<0?nr(n+e,0):rr(n,e)},fr=cr,lr=function(t){return function(e,n,r){var o,i=ar(e),u=fr(i),c=sr(r,u);if(t&&n!=n){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}},pr={includes:lr(!0),indexOf:lr(!1)},br=Xt,yr=Q,dr=pr.indexOf,hr=wn,vr=N([].push),gr=function(t,e){var n,r=yr(t),o=0,i=[];for(n in r)!br(hr,n)&&br(r,n)&&vr(i,n);for(;e.length>o;)br(r,n=e[o++])&&(~dr(i,n)||vr(i,n));return i},mr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");Yn.f=Object.getOwnPropertyNames||function(t){return gr(t,mr)};var wr={};wr.f=Object.getOwnPropertySymbols;var Sr=st,Or=Yn,jr=wr,Pr=Re,Tr=N([].concat),$r=Sr("Reflect","ownKeys")||function(t){var e=Or.f(Pr(t)),n=jr.f;return n?Tr(e,n(t)):e},Er=Xt,xr=$r,Cr=g,_r=Ne,Ar=m,Dr=nt,Mr=/#|\.prototype\./,Fr=function(t,e){var n=Nr[Ir(t)];return n==kr||n!=Lr&&(Dr(e)?Ar(e):!!e)},Ir=Fr.normalize=function(t){return String(t).replace(Mr,".").toLowerCase()},Nr=Fr.data={},Lr=Fr.NATIVE="N",kr=Fr.POLYFILL="P",zr=Fr,qr=v,Rr=g.f,Br=Qe,Gr=function(t,e,n,r){r||(r={});var o=r.enumerable,i=void 0!==r.name?r.name:e;if(Wn(n)&&Vn(n,i,r),r.global)o?t[e]=n:Xn(e,n);else{try{r.unsafe?t[e]&&(o=!0):delete t[e]}catch(t){}o?t[e]=n:Kn.f(t,e,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},Hr=qt,Ur=function(t,e,n){for(var r=xr(e),o=_r.f,i=Cr.f,u=0;u<r.length;u++){var c=r[u];Er(t,c)||n&&Er(n,c)||o(t,c,i(e,c))}},Wr=zr,Kr=q,Vr=Array.isArray||function(t){return"Array"==Kr(t)},Xr=TypeError,Yr=Se,Jr=Ne,Qr=A,Zr={};Zr[le("toStringTag")]="z";var to="[object z]"===String(Zr),eo=nt,no=q,ro=le("toStringTag"),oo=Object,io="Arguments"==no(function(){return arguments}()),uo=N,co=m,ao=nt,so=to?no:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=oo(t),ro))?n:io?no(e):"Object"==(r=no(e))&&eo(e.callee)?"Arguments":r},fo=bn,lo=function(){},po=[],bo=st("Reflect","construct"),yo=/^\s*(?:class|function)\b/,ho=uo(yo.exec),vo=!yo.exec(lo),go=function(t){if(!ao(t))return!1;try{return bo(lo,po,t),!0}catch(t){return!1}},mo=function(t){if(!ao(t))return!1;switch(so(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return vo||!!ho(yo,fo(t))}catch(t){return!0}};mo.sham=!0;var wo=!bo||co((function(){var t;return go(go.call)||!go(Object)||!go((function(){t=!0}))||t}))?mo:go,So=Vr,Oo=wo,jo=it,Po=le("species"),To=Array,$o=function(t){var e;return So(t)&&(e=t.constructor,(Oo(e)&&(e===To||So(e.prototype))||jo(e)&&null===(e=e[Po]))&&(e=void 0)),void 0===e?To:e},Eo=m,xo=vt,Co=le("species"),_o=function(t,e){var n,r,o,i,u,c=t.target,a=t.global,s=t.stat;if(n=a?qr:s?qr[c]||Hr(c,{}):(qr[c]||{}).prototype)for(r in e){if(i=e[r],o=t.dontCallGetSet?(u=Rr(n,r))&&u.value:n[r],!Wr(a?r:c+(s?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Ur(i,o)}(t.sham||o&&o.sham)&&Br(i,"sham",!0),Gr(n,r,i,t)}},Ao=m,Do=Vr,Mo=it,Fo=Wt,Io=cr,No=function(t){if(t>9007199254740991)throw Xr("Maximum allowed index exceeded");return t},Lo=function(t,e,n){var r=Yr(e);r in t?Jr.f(t,r,Qr(0,n)):t[r]=n},ko=function(t,e){return new($o(t))(0===e?0:e)},zo=function(t){return xo>=51||!Eo((function(){var e=[];return(e.constructor={})[Co]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},qo=vt,Ro=le("isConcatSpreadable"),Bo=qo>=51||!Ao((function(){var t=[];return t[Ro]=!1,t.concat()[0]!==t})),Go=zo("concat"),Ho=function(t){if(!Mo(t))return!1;var e=t[Ro];return void 0!==e?!!e:Do(t)};_o({target:"Array",proto:!0,arity:1,forced:!Bo||!Go},{concat:function(t){var e,n,r,o,i,u=Fo(this),c=ko(u,0),a=0;for(e=-1,r=arguments.length;e<r;e++)if(Ho(i=-1===e?u:arguments[e]))for(o=Io(i),No(a+o),n=0;n<o;n++,a++)n in i&&Lo(c,a,i[n]);else No(a+1),Lo(c,a++,i);return c.length=a,c}});exports.BaseDialog=function(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null,r=f(s(e,["$route","$router"])),o=t.extend({provide:function(){return{getBaseDialog:this}},router:e.$router,route:e.$route,props:r,render:function(t){var r=this,o="base-el-dialog";if((l(this.$props,"customClass")||l(this.$props,"custom-class"))&&(o+=" ".concat(p(this.$props,"customClass","")," ").concat(p(this.$props,"custom-class",""))),n=t(),l(e.component,"render"))n=t(e.component);else if(l(e.component(),"el")){var i=e.component();n=t(i.el,s(i,["el"]),[p(i,"children")])}else n=e.component();return t("el-dialog",{class:y({"base-dialog__wrapper":!0},e.ctCls,e.ctCls),props:a({title:"详情",visible:this.visible,customClass:o},s(this.$props,["listeners","customClass"]),{}),on:{open:function(){l(e,"listeners.open")&&e.listeners.open()},opened:function(){l(e,"listeners.opened")&&e.listeners.opened()},close:function(){r.visible=!1,l(e,"listeners.close")&&e.listeners.close()},closed:function(){e.isDestroy?(r.$destroy(),l(r,"$el")&&r.$el.remove()):l(e,"listeners.closed")&&e.listeners.closed()}}},[n,t("template",{slot:"title"},this.appendTitle()),t("template",{slot:"footer"},this.appendFooter())])}}),i=new o({propsData:e,data:function(){return{visible:!1}},created:function(){this.$nextTick((function(){document.body.appendChild(i.$mount().$el)}))},methods:{getContentNode:function(){return n.componentInstance},open:function(){var t=this;setTimeout((function(){t.visible=!0}),0)},close:function(){var t=this;setTimeout((function(){t.visible=!1}),0)},closeDialog:function(){l(e,"listeners.close")&&e.listeners.close(),setTimeout((function(){i.$destroy(),l(i,"$el")&&i.$el.remove()}),0)},appendTitle:function(){return l(this.$props,"slotNode.title")?[this.$props.slotNode.title(u.h)]:[]},appendFooter:function(){for(var t=[],n=0,r=p(e,"buttons",[]).length;n<r;n+=1){var o=e.buttons[n];t.push(u.h("el-button",{props:p(o,"props",(function(){return{}}))(),on:o.on},[o.text]))}return l(this.$props,"slotNode.footer")?b([this.$props.slotNode.footer(u.h)],t):b([],t)}}});return i}};