shu-c-view
Version:
rollup 打包vue组件库框架
7 lines (6 loc) • 15 kB
JavaScript
/*!
* shu-c-view v1.2.37
* (c) 2022-09-22
* @license MIT
*/
"use strict";function t(t,e){for(var r=0;r<e.length;r++)if(t===e[r])return!0;return!1}Object.defineProperty(exports,"__esModule",{value:!0});function e(t,e,r,n,i,o,s,u,c,a){"boolean"!=typeof s&&(c=u,u=s,s=!1);const f="function"==typeof r?r.options:r;let l;if(t&&t.render&&(f.render=t.render,f.staticRenderFns=t.staticRenderFns,f._compiled=!0,i&&(f.functional=!0)),n&&(f._scopeId=n),o?(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__),e&&e.call(this,c(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},f._ssrRegister=l):e&&(l=s?function(t){e.call(this,a(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,u(t))}),l)if(f.functional){const t=f.render;f.render=function(e,r){return l.call(r),t(e,r)}}else{const t=f.beforeCreate;f.beforeCreate=t?[].concat(t,l):[l]}return r}const r={name:"BaseCustomSteps",props:{current:{type:Number,default:0},status:{validator:e=>t(e,["wait","process","finish","error"]),default:"process"},size:{validator:e=>t(e,["small"])},direction:{validator:e=>t(e,["horizontal","vertical"]),default:"horizontal"}},computed:{classes(){return["ivu-steps",`ivu-steps-${this.direction}`,{[`ivu-steps-${this.size}`]:!!this.size}]}},watch:{current(){this.updateChildProps()},status(){this.updateCurrent()}},mounted(){this.updateSteps(),this.$on("append",this.debouncedAppendRemove()),this.$on("remove",this.debouncedAppendRemove())},methods:{updateChildProps(t){const e=this.$children.length;this.$children.forEach(((r,n)=>{r.stepNumber=n+1,"horizontal"===this.direction&&(r.total=e),t&&r.currentStatus||(n===this.current?"error"!==this.status&&(r.currentStatus="process"):n<this.current?r.currentStatus="finish":r.currentStatus="wait"),"error"!==r.currentStatus&&0!==n&&(this.$children[n-1].nextError=!1)}))},setNextError(){this.$children.forEach(((t,e)=>{"error"===t.currentStatus&&0!==e&&(this.$children[e-1].nextError=!0)}))},updateCurrent(t){if(!(this.current<0||this.current>=this.$children.length))if(t){this.$children[this.current].currentStatus||(this.$children[this.current].currentStatus=this.status)}else this.$children[this.current].currentStatus=this.status},debouncedAppendRemove:()=>function(t){let e;return function(){if(e)return;e=!0;const r=this,n=arguments,i=function(){e=!1,t.apply(r,n)};this.$nextTick(i)}}((function(){this.updateSteps()})),updateSteps(){this.updateChildProps(!0),this.setNextError(),this.updateCurrent(!0)}}};var n=function(){var t=this,e=t.$createElement;return(t._self._c||e)("div",{class:t.classes},[t._t("default")],2)};n._withStripped=!0;const i=e({render:n,staticRenderFns:[]},undefined,r,undefined,false,undefined,!1,void 0,void 0,void 0);var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s=function(t){return t&&t.Math==Math&&t},u=s("object"==typeof globalThis&&globalThis)||s("object"==typeof window&&window)||s("object"==typeof self&&self)||s("object"==typeof o&&o)||function(){return this}()||Function("return this")(),c=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},a=function(t){try{return!!t()}catch(t){return!0}},f={}.toString,l=function(t){return f.call(t).slice(8,-1)},p=l,h="".split,d=a((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==p(t)?h.call(t,""):Object(t)}:Object,v=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},y=v,m=function(t){return Object(y(t))},S=Math.ceil,g=Math.floor,b=function(t){return isNaN(t=+t)?0:(t>0?g:S)(t)},_=b,w=Math.min,x=function(t){return t>0?w(_(t),9007199254740991):0},C=function(t){return"object"==typeof t?null!==t:"function"==typeof t},E=l,$=Array.isArray||function(t){return"Array"==E(t)},T={exports:{}},L=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),O={},j=C,M=u.document,P=j(M)&&j(M.createElement),N=function(t){return P?M.createElement(t):{}},R=!L&&!a((function(){return 7!=Object.defineProperty(N("div"),"a",{get:function(){return 7}}).a})),A=C,k=function(t){if(!A(t))throw TypeError(String(t)+" is not an object");return t},F=C,V=function(t,e){if(!F(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!F(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!F(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!F(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},z=L,D=R,I=k,G=V,B=Object.defineProperty;O.f=z?B:function(t,e,r){if(I(t),e=G(e,!0),I(r),D)try{return B(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var H=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},q=O,U=H,W=L?function(t,e,r){return q.f(t,e,U(1,r))}:function(t,e,r){return t[e]=r,t},X=u,K=W,Y=function(t,e){try{K(X,t,e)}catch(r){X[t]=e}return e},J=Y,Q=u["__core-js_shared__"]||J("__core-js_shared__",{}),Z=Q;(T.exports=function(t,e){return Z[t]||(Z[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.9.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var tt,et,rt={}.hasOwnProperty,nt=function(t,e){return rt.call(t,e)},it=0,ot=Math.random(),st=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++it+ot).toString(36)},ut="process"==l(u.process),ct=u,at=u,ft=function(t){return"function"==typeof t?t:void 0},lt=function(t,e){return arguments.length<2?ft(ct[t])||ft(at[t]):ct[t]&&ct[t][e]||at[t]&&at[t][e]},pt=lt("navigator","userAgent")||"",ht=u.process,dt=ht&&ht.versions,vt=dt&&dt.v8;vt?et=(tt=vt.split("."))[0]+tt[1]:pt&&(!(tt=pt.match(/Edge\/(\d+)/))||tt[1]>=74)&&(tt=pt.match(/Chrome\/(\d+)/))&&(et=tt[1]);var yt=et&&+et,mt=ut,St=yt,gt=a,bt=!!Object.getOwnPropertySymbols&&!gt((function(){return!Symbol.sham&&(mt?38===St:St>37&&St<41)})),_t=bt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,wt=u,xt=T.exports,Ct=nt,Et=st,$t=bt,Tt=_t,Lt=xt("wks"),Ot=wt.Symbol,jt=Tt?Ot:Ot&&Ot.withoutSetter||Et,Mt=function(t){return Ct(Lt,t)&&($t||"string"==typeof Lt[t])||($t&&Ct(Ot,t)?Lt[t]=Ot[t]:Lt[t]=jt("Symbol."+t)),Lt[t]},Pt=C,Nt=$,Rt=Mt("species"),At=function(t,e){var r;return Nt(t)&&("function"!=typeof(r=t.constructor)||r!==Array&&!Nt(r.prototype)?Pt(r)&&null===(r=r[Rt])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===e?0:e)},kt=function(t,e,r){if(c(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)}}return function(){return t.apply(e,arguments)}},Ft=d,Vt=m,zt=x,Dt=At,It=[].push,Gt=function(t){var e=1==t,r=2==t,n=3==t,i=4==t,o=6==t,s=7==t,u=5==t||o;return function(c,a,f,l){for(var p,h,d=Vt(c),v=Ft(d),y=kt(a,f,3),m=zt(v.length),S=0,g=l||Dt,b=e?g(c,m):r||s?g(c,0):void 0;m>S;S++)if((u||S in v)&&(h=y(p=v[S],S,d),t))if(e)b[S]=h;else if(h)switch(t){case 3:return!0;case 5:return p;case 6:return S;case 2:It.call(b,p)}else switch(t){case 4:return!1;case 7:It.call(b,p)}return o?-1:n||i?i:b}},Bt={forEach:Gt(0),map:Gt(1),filter:Gt(2),some:Gt(3),every:Gt(4),find:Gt(5),findIndex:Gt(6),filterOut:Gt(7)},Ht=a,qt=Bt.forEach,Ut=u,Wt={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Xt=function(t,e){var r=[][t];return!!r&&Ht((function(){r.call(null,e||function(){throw 1},1)}))}("forEach")?[].forEach:function(t){return qt(this,t,arguments.length>1?arguments[1]:void 0)},Kt=W;for(var Yt in Wt){var Jt=Ut[Yt],Qt=Jt&&Jt.prototype;if(Qt&&Qt.forEach!==Xt)try{Kt(Qt,"forEach",Xt)}catch(t){Qt.forEach=Xt}}var Zt=L,te=O.f,ee=Function.prototype,re=ee.toString,ne=/^\s*function ([^ (]*)/;Zt&&!("name"in ee)&&te(ee,"name",{configurable:!0,get:function(){try{return re.call(this).match(ne)[1]}catch(t){return""}}});var ie={},oe={},se={}.propertyIsEnumerable,ue=Object.getOwnPropertyDescriptor,ce=ue&&!se.call({1:2},1);oe.f=ce?function(t){var e=ue(this,t);return!!e&&e.enumerable}:se;var ae=d,fe=v,le=function(t){return ae(fe(t))},pe=L,he=oe,de=H,ve=le,ye=V,me=nt,Se=R,ge=Object.getOwnPropertyDescriptor;ie.f=pe?ge:function(t,e){if(t=ve(t),e=ye(e,!0),Se)try{return ge(t,e)}catch(t){}if(me(t,e))return de(!he.f.call(t,e),t[e])};var be={exports:{}},_e=Q,we=Function.toString;"function"!=typeof _e.inspectSource&&(_e.inspectSource=function(t){return we.call(t)});var xe,Ce,Ee,$e=_e.inspectSource,Te=$e,Le=u.WeakMap,Oe="function"==typeof Le&&/native code/.test(Te(Le)),je=T.exports,Me=st,Pe=je("keys"),Ne={},Re=Oe,Ae=C,ke=W,Fe=nt,Ve=Q,ze=function(t){return Pe[t]||(Pe[t]=Me(t))},De=Ne,Ie=u.WeakMap;if(Re){var Ge=Ve.state||(Ve.state=new Ie),Be=Ge.get,He=Ge.has,qe=Ge.set;xe=function(t,e){return e.facade=t,qe.call(Ge,t,e),e},Ce=function(t){return Be.call(Ge,t)||{}},Ee=function(t){return He.call(Ge,t)}}else{var Ue=ze("state");De[Ue]=!0,xe=function(t,e){return e.facade=t,ke(t,Ue,e),e},Ce=function(t){return Fe(t,Ue)?t[Ue]:{}},Ee=function(t){return Fe(t,Ue)}}var We={set:xe,get:Ce,has:Ee,enforce:function(t){return Ee(t)?Ce(t):xe(t,{})},getterFor:function(t){return function(e){var r;if(!Ae(e)||(r=Ce(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},Xe=u,Ke=W,Ye=nt,Je=Y,Qe=$e,Ze=We.get,tr=We.enforce,er=String(String).split("String");(be.exports=function(t,e,r,n){var i,o=!!n&&!!n.unsafe,s=!!n&&!!n.enumerable,u=!!n&&!!n.noTargetGet;"function"==typeof r&&("string"!=typeof e||Ye(r,"name")||Ke(r,"name",e),(i=tr(r)).source||(i.source=er.join("string"==typeof e?e:""))),t!==Xe?(o?!u&&t[e]&&(s=!0):delete t[e],s?t[e]=r:Ke(t,e,r)):s?t[e]=r:Je(e,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&Ze(this).source||Qe(this)}));var rr={},nr=b,ir=Math.max,or=Math.min,sr=le,ur=x,cr=function(t,e){var r=nr(t);return r<0?ir(r+e,0):or(r,e)},ar=function(t){return function(e,r,n){var i,o=sr(e),s=ur(o.length),u=cr(n,s);if(t&&r!=r){for(;s>u;)if((i=o[u++])!=i)return!0}else for(;s>u;u++)if((t||u in o)&&o[u]===r)return t||u||0;return!t&&-1}},fr={includes:ar(!0),indexOf:ar(!1)},lr=nt,pr=le,hr=fr.indexOf,dr=Ne,vr=function(t,e){var r,n=pr(t),i=0,o=[];for(r in n)!lr(dr,r)&&lr(n,r)&&o.push(r);for(;e.length>i;)lr(n,r=e[i++])&&(~hr(o,r)||o.push(r));return o},yr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"].concat("length","prototype");rr.f=Object.getOwnPropertyNames||function(t){return vr(t,yr)};var mr={};mr.f=Object.getOwnPropertySymbols;var Sr=rr,gr=mr,br=k,_r=lt("Reflect","ownKeys")||function(t){var e=Sr.f(br(t)),r=gr.f;return r?e.concat(r(t)):e},wr=nt,xr=_r,Cr=ie,Er=O,$r=a,Tr=/#|\.prototype\./,Lr=function(t,e){var r=jr[Or(t)];return r==Pr||r!=Mr&&("function"==typeof e?$r(e):!!e)},Or=Lr.normalize=function(t){return String(t).replace(Tr,".").toLowerCase()},jr=Lr.data={},Mr=Lr.NATIVE="N",Pr=Lr.POLYFILL="P",Nr=Lr,Rr=u,Ar=ie.f,kr=W,Fr=be.exports,Vr=Y,zr=function(t,e){for(var r=xr(e),n=Er.f,i=Cr.f,o=0;o<r.length;o++){var s=r[o];wr(t,s)||n(t,s,i(e,s))}},Dr=Nr,Ir=V,Gr=O,Br=H,Hr=a,qr=yt,Ur=Mt("species"),Wr=function(t,e){var r,n,i,o,s,u=t.target,c=t.global,a=t.stat;if(r=c?Rr:a?Rr[u]||Vr(u,{}):(Rr[u]||{}).prototype)for(n in e){if(o=e[n],i=t.noTargetGet?(s=Ar(r,n))&&s.value:r[n],!Dr(c?n:u+(a?".":"#")+n,t.forced)&&void 0!==i){if(typeof o==typeof i)continue;zr(o,i)}(t.sham||i&&i.sham)&&kr(o,"sham",!0),Fr(r,n,o,t)}},Xr=a,Kr=$,Yr=C,Jr=m,Qr=x,Zr=function(t,e,r){var n=Ir(e);n in t?Gr.f(t,n,Br(0,r)):t[n]=r},tn=At,en=function(t){return qr>=51||!Hr((function(){var e=[];return(e.constructor={})[Ur]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},rn=yt,nn=Mt("isConcatSpreadable"),on=rn>=51||!Xr((function(){var t=[];return t[nn]=!1,t.concat()[0]!==t})),sn=en("concat"),un=function(t){if(!Yr(t))return!1;var e=t[nn];return void 0!==e?!!e:Kr(t)};function cn(t,e,r){this.$children.forEach((function(n){n.$options.name===t?n.$emit.apply(n,[e].concat(r)):cn.apply(n,[t,e].concat([r]))}))}Wr({target:"Array",proto:!0,forced:!on||!sn},{concat:function(t){var e,r,n,i,o,s=Jr(this),u=tn(s,0),c=0;for(e=-1,n=arguments.length;e<n;e++)if(un(o=-1===e?s:arguments[e])){if(c+(i=Qr(o.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(r=0;r<i;r++,c++)r in o&&Zr(u,c,o[r])}else{if(c>=9007199254740991)throw TypeError("Maximum allowed index exceeded");Zr(u,c++,o)}return u.length=c,u}});const an={name:"BaseCustomStep",mixins:[{methods:{dispatch:function(t,e,r){for(var n=this.$parent||this.$root,i=n.$options.name;n&&(!i||i!==t);)(n=n.$parent)&&(i=n.$options.name);n&&n.$emit.apply(n,[e].concat(r))},broadcast:function(t,e,r){cn.call(this,t,e,r)}}}],props:{status:{validator:e=>t(e,["wait","process","finish","error"])},title:{type:String,default:""},content:{type:String},icon:{type:String}},data:()=>({prefixCls:"ivu-steps",stepNumber:"",nextError:!1,total:1,currentStatus:""}),computed:{wrapClasses(){return["ivu-steps-item",`ivu-steps-status-${this.currentStatus}`,{"ivu-steps-custom":!!this.icon,"ivu-steps-next-error":this.nextError}]},iconClasses(){let t="";this.icon?t=this.icon:"finish"===this.currentStatus?t="ios-checkmark":"error"===this.currentStatus&&(t="ios-close");const e=["ivu-steps-icon","ivu-icon"];return this.icon?e.push({[t]:""!==t}):e.push({[`ivu-icon-${t}`]:""!==t}),e},styles(){return{width:1/this.total*100+"%"}}},watch:{status(t){this.currentStatus=t,"error"===this.currentStatus&&this.$parent.setNextError()}},created(){this.currentStatus=this.status,this.$slots},mounted(){this.dispatch("Steps","append")},beforeDestroy(){this.dispatch("Steps","remove")}};var fn=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:t.wrapClasses,style:t.styles},[r("div",{class:[t.prefixCls+"-tail"]},[r("i")]),t._v(" "),r("div",{class:[t.prefixCls+"-head"]},[r("div",{class:[t.prefixCls+"-head-inner"]},[t.icon||"finish"==t.currentStatus||"error"==t.currentStatus?r("span",{class:t.iconClasses}):r("span",[t._v(t._s(t.stepNumber))])])]),t._v(" "),r("div",{class:[t.prefixCls+"-main"]},[r("div",{class:[t.prefixCls+"-title"]},[t.$slots.title?t._t("title"):[t._v(t._s(t.title))]],2),t._v(" "),t._t("default",(function(){return[t.content?r("div",{class:[t.prefixCls+"-content"]},[t._v("\n "+t._s(t.content)+"\n ")]):t._e()]}))],2)])};fn._withStripped=!0;const ln=e({render:fn,staticRenderFns:[]},undefined,an,undefined,false,undefined,!1,void 0,void 0,void 0);exports.BaseCustomStep=ln,exports.BaseCustomSteps=i;