@hr-components-dev/render 1.4.8 → 1.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -26,4 +26,4 @@ __p += '`),r&&(m+=`' +
26
26
  function print() { __p += __j.call(arguments, '') }
27
27
  `:`;
28
28
  `)+m+`return __p
29
- }`;var v=wf(function(){return Tt(o,g+`return `+m).apply(n,l)});if(v.source=m,Tu(v))throw v;return v}function mf(e){return Q(e).toLowerCase()}function hf(e){return Q(e).toUpperCase()}function gf(e,t,r){if(e=Q(e),e&&(r||t===n))return ar(e);if(!e||!(t=Wa(t)))return e;var i=Dr(e),a=Dr(t);return no(i,lr(i,a),ur(i,a)+1).join(``)}function _f(e,t,r){if(e=Q(e),e&&(r||t===n))return e.slice(0,Or(e)+1);if(!e||!(t=Wa(t)))return e;var i=Dr(e);return no(i,0,ur(i,Dr(t))+1).join(``)}function vf(e,t,r){if(e=Q(e),e&&(r||t===n))return e.replace(st,``);if(!e||!(t=Wa(t)))return e;var i=Dr(e);return no(i,lr(i,Dr(t))).join(``)}function yf(e,t){var r=te,i=ne;if(Y(t)){var a=`separator`in t?t.separator:a;r=`length`in t?Z(t.length):r,i=`omission`in t?Wa(t.omission):i}e=Q(e);var o=e.length;if(gr(e)){var s=Dr(e);o=s.length}if(r>=o)return e;var c=r-Er(i);if(c<1)return i;var l=s?no(s,0,c).join(``):e.slice(0,c);if(a===n)return l+i;if(s&&(c+=l.length-c),zu(a)){if(e.slice(c).search(a)){var u,d=l;for(a.global||(a=Dt(a.source,Q(ht.exec(a))+`g`)),a.lastIndex=0;u=a.exec(d);)var f=u.index;l=l.slice(0,f===n?c:f)}}else if(e.indexOf(Wa(a),c)!=c){var p=l.lastIndexOf(a);p>-1&&(l=l.slice(0,p))}return l+i}function bf(e){return e=Q(e),e&&Ze.test(e)?e.replace(Ye,kr):e}var xf=To(function(e,t,n){return e+(n?` `:``)+t.toUpperCase()}),Sf=wo(`toUpperCase`);function Cf(e,t,r){return e=Q(e),t=r?n:t,t===n?_r(e)?Mr(e):Gn(e):e.match(t)||[]}var wf=U(function(e,t){try{return jn(e,n,t)}catch(e){return Tu(e)?e:new wt(e)}}),Tf=Yo(function(e,t){return Nn(t,function(t){t=zs(t),Oi(e,t,Bl(e[t],e))}),e});function Ef(e){var t=e==null?0:e.length,n=W();return e=t?R(e,function(e){if(typeof e[1]!=`function`)throw new kt(o);return[n(e[0]),e[1]]}):[],U(function(n){for(var r=-1;++r<t;){var i=e[r];if(jn(i[0],this,n))return jn(i[1],this,n)}})}function Df(e){return Mi(ji(e,f))}function Of(e){return function(){return e}}function kf(e,t){return e==null||e!==e?t:e}var Af=ko(),jf=ko(!0);function Mf(e){return e}function Nf(e){return pa(typeof e==`function`?e:ji(e,f))}function Pf(e){return va(ji(e,f))}function Ff(e,t){return ya(e,ji(t,f))}var If=U(function(e,t){return function(n){return ta(n,e,t)}}),Lf=U(function(e,t){return function(n){return ta(e,n,t)}});function Rf(e,t,n){var r=$(t),i=Ki(t,r);n==null&&!(Y(t)&&(i.length||!r.length))&&(n=t,t=e,e=this,i=Ki(t,$(t)));var a=!(Y(n)&&`chain`in n)||!!n.chain,o=Du(e);return Nn(i,function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__);return(n.__actions__=ho(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,zn([this.value()],arguments))})}),e}function zf(){return I._===this&&(I._=zt),this}function Bf(){}function Vf(e){return e=Z(e),U(function(t){return Sa(t,e)})}var Hf=No(R),Uf=No(Fn),Wf=No(Hn);function Gf(e){return gs(e)?Qn(zs(e)):Ea(e)}function Kf(e){return function(t){return e==null?n:qi(e,t)}}var qf=Io(),Jf=Io(!0);function Yf(){return[]}function Xf(){return!1}function Zf(){return{}}function Qf(){return``}function $f(){return!0}function ep(e,t){if(e=Z(e),e<1||e>le)return[];var n=E,r=F(e,E);t=W(t),e-=E;for(var i=rr(r,t);++n<e;)t(n);return i}function tp(e){return q(e)?R(e,zs):Uu(e)?[e]:ho(Rs(Q(e)))}function np(e){var t=++Ft;return Q(e)+t}var rp=Mo(function(e,t){return e+t},0),ip=zo(`ceil`),ap=Mo(function(e,t){return e/t},1),op=zo(`floor`);function sp(e){return e&&e.length?zi(e,Mf,Yi):n}function cp(e,t){return e&&e.length?zi(e,W(t,2),Yi):n}function lp(e){return Zn(e,Mf)}function up(e,t){return Zn(e,W(t,2))}function dp(e){return e&&e.length?zi(e,Mf,ga):n}function fp(e,t){return e&&e.length?zi(e,W(t,2),ga):n}var pp=Mo(function(e,t){return e*t},1),mp=zo(`round`),hp=Mo(function(e,t){return e-t},0);function gp(e){return e&&e.length?nr(e,Mf):0}function _p(e,t){return e&&e.length?nr(e,W(t,2)):0}return z.after=Ll,z.ary=Rl,z.assign=nd,z.assignIn=rd,z.assignInWith=id,z.assignWith=ad,z.at=od,z.before=zl,z.bind=Bl,z.bindAll=Tf,z.bindKey=Vl,z.castArray=ou,z.chain=$c,z.chunk=Us,z.compact=Ws,z.concat=Gs,z.cond=Ef,z.conforms=Df,z.constant=Of,z.countBy=ul,z.create=sd,z.curry=Hl,z.curryRight=Ul,z.debounce=Wl,z.defaults=cd,z.defaultsDeep=ld,z.defer=Gl,z.delay=Kl,z.difference=Ks,z.differenceBy=qs,z.differenceWith=Js,z.drop=Ys,z.dropRight=Xs,z.dropRightWhile=Zs,z.dropWhile=Qs,z.fill=$s,z.filter=fl,z.flatMap=hl,z.flatMapDeep=gl,z.flatMapDepth=_l,z.flatten=nc,z.flattenDeep=rc,z.flattenDepth=ic,z.flip=ql,z.flow=Af,z.flowRight=jf,z.fromPairs=ac,z.functions=gd,z.functionsIn=_d,z.groupBy=bl,z.initial=cc,z.intersection=lc,z.intersectionBy=uc,z.intersectionWith=dc,z.invert=xd,z.invertBy=Sd,z.invokeMap=Sl,z.iteratee=Nf,z.keyBy=Cl,z.keys=$,z.keysIn=wd,z.map=wl,z.mapKeys=Td,z.mapValues=Ed,z.matches=Pf,z.matchesProperty=Ff,z.memoize=Jl,z.merge=Dd,z.mergeWith=Od,z.method=If,z.methodOf=Lf,z.mixin=Rf,z.negate=Yl,z.nthArg=Vf,z.omit=kd,z.omitBy=Ad,z.once=Xl,z.orderBy=Tl,z.over=Hf,z.overArgs=Zl,z.overEvery=Uf,z.overSome=Wf,z.partial=Ql,z.partialRight=$l,z.partition=El,z.pick=jd,z.pickBy=Md,z.property=Gf,z.propertyOf=Kf,z.pull=gc,z.pullAll=_c,z.pullAllBy=vc,z.pullAllWith=yc,z.pullAt=bc,z.range=qf,z.rangeRight=Jf,z.rearg=eu,z.reject=kl,z.remove=xc,z.rest=tu,z.reverse=Sc,z.sampleSize=jl,z.set=Pd,z.setWith=Fd,z.shuffle=Ml,z.slice=Cc,z.sortBy=Fl,z.sortedUniq=Ac,z.sortedUniqBy=jc,z.split=uf,z.spread=nu,z.tail=Mc,z.take=Nc,z.takeRight=Pc,z.takeRightWhile=Fc,z.takeWhile=Ic,z.tap=el,z.throttle=ru,z.thru=tl,z.toArray=Xu,z.toPairs=Id,z.toPairsIn=Ld,z.toPath=tp,z.toPlainObject=ed,z.transform=Rd,z.unary=iu,z.union=Lc,z.unionBy=Rc,z.unionWith=zc,z.uniq=Bc,z.uniqBy=Vc,z.uniqWith=Hc,z.unset=zd,z.unzip=Uc,z.unzipWith=Wc,z.update=Bd,z.updateWith=Vd,z.values=Hd,z.valuesIn=Ud,z.without=Gc,z.words=Cf,z.wrap=au,z.xor=Kc,z.xorBy=qc,z.xorWith=Jc,z.zip=Yc,z.zipObject=Xc,z.zipObjectDeep=Zc,z.zipWith=Qc,z.entries=Id,z.entriesIn=Ld,z.extend=rd,z.extendWith=id,Rf(z,z),z.add=rp,z.attempt=wf,z.camelCase=qd,z.capitalize=Jd,z.ceil=ip,z.clamp=Wd,z.clone=su,z.cloneDeep=lu,z.cloneDeepWith=uu,z.cloneWith=cu,z.conformsTo=du,z.deburr=Yd,z.defaultTo=kf,z.divide=ap,z.endsWith=Xd,z.eq=fu,z.escape=Zd,z.escapeRegExp=Qd,z.every=dl,z.find=pl,z.findIndex=ec,z.findKey=ud,z.findLast=ml,z.findLastIndex=tc,z.findLastKey=dd,z.floor=op,z.forEach=vl,z.forEachRight=yl,z.forIn=fd,z.forInRight=pd,z.forOwn=md,z.forOwnRight=hd,z.get=vd,z.gt=pu,z.gte=mu,z.has=yd,z.hasIn=bd,z.head=oc,z.identity=Mf,z.includes=xl,z.indexOf=sc,z.inRange=Gd,z.invoke=Cd,z.isArguments=hu,z.isArray=q,z.isArrayBuffer=gu,z.isArrayLike=_u,z.isArrayLikeObject=J,z.isBoolean=vu,z.isBuffer=yu,z.isDate=bu,z.isElement=xu,z.isEmpty=Su,z.isEqual=Cu,z.isEqualWith=wu,z.isError=Tu,z.isFinite=Eu,z.isFunction=Du,z.isInteger=Ou,z.isLength=ku,z.isMap=Au,z.isMatch=ju,z.isMatchWith=Mu,z.isNaN=Nu,z.isNative=Pu,z.isNil=Iu,z.isNull=Fu,z.isNumber=Lu,z.isObject=Y,z.isObjectLike=X,z.isPlainObject=Ru,z.isRegExp=zu,z.isSafeInteger=Bu,z.isSet=Vu,z.isString=Hu,z.isSymbol=Uu,z.isTypedArray=Wu,z.isUndefined=Gu,z.isWeakMap=Ku,z.isWeakSet=qu,z.join=fc,z.kebabCase=$d,z.last=pc,z.lastIndexOf=mc,z.lowerCase=ef,z.lowerFirst=tf,z.lt=Ju,z.lte=Yu,z.max=sp,z.maxBy=cp,z.mean=lp,z.meanBy=up,z.min=dp,z.minBy=fp,z.stubArray=Yf,z.stubFalse=Xf,z.stubObject=Zf,z.stubString=Qf,z.stubTrue=$f,z.multiply=pp,z.nth=hc,z.noConflict=zf,z.noop=Bf,z.now=Il,z.pad=nf,z.padEnd=rf,z.padStart=af,z.parseInt=of,z.random=Kd,z.reduce=Dl,z.reduceRight=Ol,z.repeat=sf,z.replace=cf,z.result=Nd,z.round=mp,z.runInContext=e,z.sample=Al,z.size=Nl,z.snakeCase=lf,z.some=Pl,z.sortedIndex=wc,z.sortedIndexBy=Tc,z.sortedIndexOf=Ec,z.sortedLastIndex=Dc,z.sortedLastIndexBy=Oc,z.sortedLastIndexOf=kc,z.startCase=df,z.startsWith=ff,z.subtract=hp,z.sum=gp,z.sumBy=_p,z.template=pf,z.times=ep,z.toFinite=Zu,z.toInteger=Z,z.toLength=Qu,z.toLower=mf,z.toNumber=$u,z.toSafeInteger=td,z.toString=Q,z.toUpper=hf,z.trim=gf,z.trimEnd=_f,z.trimStart=vf,z.truncate=yf,z.unescape=bf,z.uniqueId=np,z.upperCase=xf,z.upperFirst=Sf,z.each=vl,z.eachRight=yl,z.first=oc,Rf(z,function(){var e={};return Wi(z,function(t,n){j.call(z.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),z.VERSION=r,Nn([`bind`,`bindKey`,`curry`,`curryRight`,`partial`,`partialRight`],function(e){z[e].placeholder=z}),Nn([`drop`,`take`],function(e,t){B.prototype[e]=function(r){r=r===n?1:M(Z(r),0);var i=this.__filtered__&&!t?new B(this):this.clone();return i.__filtered__?i.__takeCount__=F(r,i.__takeCount__):i.__views__.push({size:F(r,E),type:e+(i.__dir__<0?`Right`:``)}),i},B.prototype[e+`Right`]=function(t){return this.reverse()[e](t).reverse()}}),Nn([`filter`,`map`,`takeWhile`],function(e,t){var n=t+1,r=n==ae||n==se;B.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:W(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),Nn([`head`,`last`],function(e,t){var n=`take`+(t?`Right`:``);B.prototype[e]=function(){return this[n](1).value()[0]}}),Nn([`initial`,`tail`],function(e,t){var n=`drop`+(t?``:`Right`);B.prototype[e]=function(){return this.__filtered__?new B(this):this[n](1)}}),B.prototype.compact=function(){return this.filter(Mf)},B.prototype.find=function(e){return this.filter(e).head()},B.prototype.findLast=function(e){return this.reverse().find(e)},B.prototype.invokeMap=U(function(e,t){return typeof e==`function`?new B(this):this.map(function(n){return ta(n,e,t)})}),B.prototype.reject=function(e){return this.filter(Yl(W(e)))},B.prototype.slice=function(e,t){e=Z(e);var r=this;return r.__filtered__&&(e>0||t<0)?new B(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(t=Z(t),r=t<0?r.dropRight(-t):r.take(t-e)),r)},B.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},B.prototype.toArray=function(){return this.take(E)},Wi(B.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=z[i?`take`+(t==`last`?`Right`:``):t],o=i||/^find/.test(t);a&&(z.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof B,l=s[0],u=c||q(t),d=function(e){var t=a.apply(z,zn([e],s));return i&&f?t[0]:t};u&&r&&typeof l==`function`&&l.length!=1&&(c=u=!1);var f=this.__chain__,p=!!this.__actions__.length,m=o&&!f,h=c&&!p;if(!o&&u){t=h?t:new B(this);var g=e.apply(t,s);return g.__actions__.push({func:tl,args:[d],thisArg:n}),new Vr(g,f)}return m&&h?e.apply(this,s):(g=this.thru(d),m?i?g.value()[0]:g.value():g)})}),Nn([`pop`,`push`,`shift`,`sort`,`splice`,`unshift`],function(e){var t=At[e],n=/^(?:push|sort|unshift)$/.test(e)?`tap`:`thru`,r=/^(?:pop|shift)$/.test(e);z.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(q(i)?i:[],e)}return this[n](function(n){return t.apply(q(n)?n:[],e)})}}),Wi(B.prototype,function(e,t){var n=z[t];if(n){var r=n.name+``;j.call($n,r)||($n[r]=[]),$n[r].push({name:t,func:n})}}),$n[Ao(n,v).name]=[{name:`wrapper`,func:n}],B.prototype.clone=Hr,B.prototype.reverse=Ur,B.prototype.value=Wr,z.prototype.at=nl,z.prototype.chain=rl,z.prototype.commit=il,z.prototype.next=al,z.prototype.plant=sl,z.prototype.reverse=cl,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=ll,z.prototype.first=z.prototype.head,Xt&&(z.prototype[Xt]=ol),z})();typeof define==`function`&&typeof define.amd==`object`&&define.amd?(I._=Nr,define(function(){return Nr})):Sn?((Sn.exports=Nr)._=Nr,xn._=Nr):I._=Nr}).call(e)}));Qe(),$e();var et=(0,l.defineComponent)({name:`AmisRenderer`,__name:`amis`,props:{schema:{default:void 0},data:{default:void 0},context:{default:void 0},env:{default:void 0},debug:{type:Boolean}},emits:[`ready`,`doRegister`],setup(e,{expose:t,emit:n}){let r=n,i=e=>{r(`ready`,e)},a=(0,l.ref)(),o=(0,l.computed)(()=>localStorage.getItem(`SOY_darkMode`)==`true`?`dark`:`antd`),s=l.useTemplateRef(`containerRef`),c=e,{schema:u,data:d,context:f,env:p}=(0,l.toRefs)(c),m=async()=>{if(window.amisRequire||(new ne,await Xe()),!s.value)return;let e=window.amisRequire(`amis/embed`).embed(s.value,u.value,{data:d.value,context:f.value,location:window.location,locale:`zh-CN`},{toastPosition:`bottom-right`,theme:o.value,enableAMISDebug:c.debug,...p.value},()=>{window.amisRequire([`amis`,`react`,`amis-ui`],(...t)=>{let[n,i,a]=t;r(`doRegister`,Ze({vue:l,react:i,amislib:n,amisUI:a,scoped:e,locale:`zh-CN`,theme:o.value}))}),i(e)});return a.value=e,e},h=(e={})=>{a.value?.updateProps({data:d.value,context:f.value,...e},e=>T.error(e))},g=e=>{a.value?.updateSchema(e,{data:d.value,context:f.value},e=>{T.error(e)})};return(0,l.watch)(u,()=>{u.value&&g(u.value)}),(0,l.onMounted)(async()=>{try{await m()}catch(e){T.error(`amis 初始化失败:`,e)}}),(0,l.onUnmounted)(()=>{a.value?.unmount()}),t({refresh:async()=>{u.value&&a.value?a.value.updateSchema(u.value):await m()},updateProps:h}),(e,t)=>((0,l.openBlock)(),(0,l.createElementBlock)(`div`,{class:`amis_root relative`,ref_key:`containerRef`,ref:s},[(0,l.renderSlot)(e.$slots,`default`)],512))}});module.exports=et;
29
+ }`;var v=wf(function(){return Tt(o,g+`return `+m).apply(n,l)});if(v.source=m,Tu(v))throw v;return v}function mf(e){return Q(e).toLowerCase()}function hf(e){return Q(e).toUpperCase()}function gf(e,t,r){if(e=Q(e),e&&(r||t===n))return ar(e);if(!e||!(t=Wa(t)))return e;var i=Dr(e),a=Dr(t);return no(i,lr(i,a),ur(i,a)+1).join(``)}function _f(e,t,r){if(e=Q(e),e&&(r||t===n))return e.slice(0,Or(e)+1);if(!e||!(t=Wa(t)))return e;var i=Dr(e);return no(i,0,ur(i,Dr(t))+1).join(``)}function vf(e,t,r){if(e=Q(e),e&&(r||t===n))return e.replace(st,``);if(!e||!(t=Wa(t)))return e;var i=Dr(e);return no(i,lr(i,Dr(t))).join(``)}function yf(e,t){var r=te,i=ne;if(Y(t)){var a=`separator`in t?t.separator:a;r=`length`in t?Z(t.length):r,i=`omission`in t?Wa(t.omission):i}e=Q(e);var o=e.length;if(gr(e)){var s=Dr(e);o=s.length}if(r>=o)return e;var c=r-Er(i);if(c<1)return i;var l=s?no(s,0,c).join(``):e.slice(0,c);if(a===n)return l+i;if(s&&(c+=l.length-c),zu(a)){if(e.slice(c).search(a)){var u,d=l;for(a.global||(a=Dt(a.source,Q(ht.exec(a))+`g`)),a.lastIndex=0;u=a.exec(d);)var f=u.index;l=l.slice(0,f===n?c:f)}}else if(e.indexOf(Wa(a),c)!=c){var p=l.lastIndexOf(a);p>-1&&(l=l.slice(0,p))}return l+i}function bf(e){return e=Q(e),e&&Ze.test(e)?e.replace(Ye,kr):e}var xf=To(function(e,t,n){return e+(n?` `:``)+t.toUpperCase()}),Sf=wo(`toUpperCase`);function Cf(e,t,r){return e=Q(e),t=r?n:t,t===n?_r(e)?Mr(e):Gn(e):e.match(t)||[]}var wf=U(function(e,t){try{return jn(e,n,t)}catch(e){return Tu(e)?e:new wt(e)}}),Tf=Yo(function(e,t){return Nn(t,function(t){t=zs(t),Oi(e,t,Bl(e[t],e))}),e});function Ef(e){var t=e==null?0:e.length,n=W();return e=t?R(e,function(e){if(typeof e[1]!=`function`)throw new kt(o);return[n(e[0]),e[1]]}):[],U(function(n){for(var r=-1;++r<t;){var i=e[r];if(jn(i[0],this,n))return jn(i[1],this,n)}})}function Df(e){return Mi(ji(e,f))}function Of(e){return function(){return e}}function kf(e,t){return e==null||e!==e?t:e}var Af=ko(),jf=ko(!0);function Mf(e){return e}function Nf(e){return pa(typeof e==`function`?e:ji(e,f))}function Pf(e){return va(ji(e,f))}function Ff(e,t){return ya(e,ji(t,f))}var If=U(function(e,t){return function(n){return ta(n,e,t)}}),Lf=U(function(e,t){return function(n){return ta(e,n,t)}});function Rf(e,t,n){var r=$(t),i=Ki(t,r);n==null&&!(Y(t)&&(i.length||!r.length))&&(n=t,t=e,e=this,i=Ki(t,$(t)));var a=!(Y(n)&&`chain`in n)||!!n.chain,o=Du(e);return Nn(i,function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__);return(n.__actions__=ho(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,zn([this.value()],arguments))})}),e}function zf(){return I._===this&&(I._=zt),this}function Bf(){}function Vf(e){return e=Z(e),U(function(t){return Sa(t,e)})}var Hf=No(R),Uf=No(Fn),Wf=No(Hn);function Gf(e){return gs(e)?Qn(zs(e)):Ea(e)}function Kf(e){return function(t){return e==null?n:qi(e,t)}}var qf=Io(),Jf=Io(!0);function Yf(){return[]}function Xf(){return!1}function Zf(){return{}}function Qf(){return``}function $f(){return!0}function ep(e,t){if(e=Z(e),e<1||e>le)return[];var n=E,r=F(e,E);t=W(t),e-=E;for(var i=rr(r,t);++n<e;)t(n);return i}function tp(e){return q(e)?R(e,zs):Uu(e)?[e]:ho(Rs(Q(e)))}function np(e){var t=++Ft;return Q(e)+t}var rp=Mo(function(e,t){return e+t},0),ip=zo(`ceil`),ap=Mo(function(e,t){return e/t},1),op=zo(`floor`);function sp(e){return e&&e.length?zi(e,Mf,Yi):n}function cp(e,t){return e&&e.length?zi(e,W(t,2),Yi):n}function lp(e){return Zn(e,Mf)}function up(e,t){return Zn(e,W(t,2))}function dp(e){return e&&e.length?zi(e,Mf,ga):n}function fp(e,t){return e&&e.length?zi(e,W(t,2),ga):n}var pp=Mo(function(e,t){return e*t},1),mp=zo(`round`),hp=Mo(function(e,t){return e-t},0);function gp(e){return e&&e.length?nr(e,Mf):0}function _p(e,t){return e&&e.length?nr(e,W(t,2)):0}return z.after=Ll,z.ary=Rl,z.assign=nd,z.assignIn=rd,z.assignInWith=id,z.assignWith=ad,z.at=od,z.before=zl,z.bind=Bl,z.bindAll=Tf,z.bindKey=Vl,z.castArray=ou,z.chain=$c,z.chunk=Us,z.compact=Ws,z.concat=Gs,z.cond=Ef,z.conforms=Df,z.constant=Of,z.countBy=ul,z.create=sd,z.curry=Hl,z.curryRight=Ul,z.debounce=Wl,z.defaults=cd,z.defaultsDeep=ld,z.defer=Gl,z.delay=Kl,z.difference=Ks,z.differenceBy=qs,z.differenceWith=Js,z.drop=Ys,z.dropRight=Xs,z.dropRightWhile=Zs,z.dropWhile=Qs,z.fill=$s,z.filter=fl,z.flatMap=hl,z.flatMapDeep=gl,z.flatMapDepth=_l,z.flatten=nc,z.flattenDeep=rc,z.flattenDepth=ic,z.flip=ql,z.flow=Af,z.flowRight=jf,z.fromPairs=ac,z.functions=gd,z.functionsIn=_d,z.groupBy=bl,z.initial=cc,z.intersection=lc,z.intersectionBy=uc,z.intersectionWith=dc,z.invert=xd,z.invertBy=Sd,z.invokeMap=Sl,z.iteratee=Nf,z.keyBy=Cl,z.keys=$,z.keysIn=wd,z.map=wl,z.mapKeys=Td,z.mapValues=Ed,z.matches=Pf,z.matchesProperty=Ff,z.memoize=Jl,z.merge=Dd,z.mergeWith=Od,z.method=If,z.methodOf=Lf,z.mixin=Rf,z.negate=Yl,z.nthArg=Vf,z.omit=kd,z.omitBy=Ad,z.once=Xl,z.orderBy=Tl,z.over=Hf,z.overArgs=Zl,z.overEvery=Uf,z.overSome=Wf,z.partial=Ql,z.partialRight=$l,z.partition=El,z.pick=jd,z.pickBy=Md,z.property=Gf,z.propertyOf=Kf,z.pull=gc,z.pullAll=_c,z.pullAllBy=vc,z.pullAllWith=yc,z.pullAt=bc,z.range=qf,z.rangeRight=Jf,z.rearg=eu,z.reject=kl,z.remove=xc,z.rest=tu,z.reverse=Sc,z.sampleSize=jl,z.set=Pd,z.setWith=Fd,z.shuffle=Ml,z.slice=Cc,z.sortBy=Fl,z.sortedUniq=Ac,z.sortedUniqBy=jc,z.split=uf,z.spread=nu,z.tail=Mc,z.take=Nc,z.takeRight=Pc,z.takeRightWhile=Fc,z.takeWhile=Ic,z.tap=el,z.throttle=ru,z.thru=tl,z.toArray=Xu,z.toPairs=Id,z.toPairsIn=Ld,z.toPath=tp,z.toPlainObject=ed,z.transform=Rd,z.unary=iu,z.union=Lc,z.unionBy=Rc,z.unionWith=zc,z.uniq=Bc,z.uniqBy=Vc,z.uniqWith=Hc,z.unset=zd,z.unzip=Uc,z.unzipWith=Wc,z.update=Bd,z.updateWith=Vd,z.values=Hd,z.valuesIn=Ud,z.without=Gc,z.words=Cf,z.wrap=au,z.xor=Kc,z.xorBy=qc,z.xorWith=Jc,z.zip=Yc,z.zipObject=Xc,z.zipObjectDeep=Zc,z.zipWith=Qc,z.entries=Id,z.entriesIn=Ld,z.extend=rd,z.extendWith=id,Rf(z,z),z.add=rp,z.attempt=wf,z.camelCase=qd,z.capitalize=Jd,z.ceil=ip,z.clamp=Wd,z.clone=su,z.cloneDeep=lu,z.cloneDeepWith=uu,z.cloneWith=cu,z.conformsTo=du,z.deburr=Yd,z.defaultTo=kf,z.divide=ap,z.endsWith=Xd,z.eq=fu,z.escape=Zd,z.escapeRegExp=Qd,z.every=dl,z.find=pl,z.findIndex=ec,z.findKey=ud,z.findLast=ml,z.findLastIndex=tc,z.findLastKey=dd,z.floor=op,z.forEach=vl,z.forEachRight=yl,z.forIn=fd,z.forInRight=pd,z.forOwn=md,z.forOwnRight=hd,z.get=vd,z.gt=pu,z.gte=mu,z.has=yd,z.hasIn=bd,z.head=oc,z.identity=Mf,z.includes=xl,z.indexOf=sc,z.inRange=Gd,z.invoke=Cd,z.isArguments=hu,z.isArray=q,z.isArrayBuffer=gu,z.isArrayLike=_u,z.isArrayLikeObject=J,z.isBoolean=vu,z.isBuffer=yu,z.isDate=bu,z.isElement=xu,z.isEmpty=Su,z.isEqual=Cu,z.isEqualWith=wu,z.isError=Tu,z.isFinite=Eu,z.isFunction=Du,z.isInteger=Ou,z.isLength=ku,z.isMap=Au,z.isMatch=ju,z.isMatchWith=Mu,z.isNaN=Nu,z.isNative=Pu,z.isNil=Iu,z.isNull=Fu,z.isNumber=Lu,z.isObject=Y,z.isObjectLike=X,z.isPlainObject=Ru,z.isRegExp=zu,z.isSafeInteger=Bu,z.isSet=Vu,z.isString=Hu,z.isSymbol=Uu,z.isTypedArray=Wu,z.isUndefined=Gu,z.isWeakMap=Ku,z.isWeakSet=qu,z.join=fc,z.kebabCase=$d,z.last=pc,z.lastIndexOf=mc,z.lowerCase=ef,z.lowerFirst=tf,z.lt=Ju,z.lte=Yu,z.max=sp,z.maxBy=cp,z.mean=lp,z.meanBy=up,z.min=dp,z.minBy=fp,z.stubArray=Yf,z.stubFalse=Xf,z.stubObject=Zf,z.stubString=Qf,z.stubTrue=$f,z.multiply=pp,z.nth=hc,z.noConflict=zf,z.noop=Bf,z.now=Il,z.pad=nf,z.padEnd=rf,z.padStart=af,z.parseInt=of,z.random=Kd,z.reduce=Dl,z.reduceRight=Ol,z.repeat=sf,z.replace=cf,z.result=Nd,z.round=mp,z.runInContext=e,z.sample=Al,z.size=Nl,z.snakeCase=lf,z.some=Pl,z.sortedIndex=wc,z.sortedIndexBy=Tc,z.sortedIndexOf=Ec,z.sortedLastIndex=Dc,z.sortedLastIndexBy=Oc,z.sortedLastIndexOf=kc,z.startCase=df,z.startsWith=ff,z.subtract=hp,z.sum=gp,z.sumBy=_p,z.template=pf,z.times=ep,z.toFinite=Zu,z.toInteger=Z,z.toLength=Qu,z.toLower=mf,z.toNumber=$u,z.toSafeInteger=td,z.toString=Q,z.toUpper=hf,z.trim=gf,z.trimEnd=_f,z.trimStart=vf,z.truncate=yf,z.unescape=bf,z.uniqueId=np,z.upperCase=xf,z.upperFirst=Sf,z.each=vl,z.eachRight=yl,z.first=oc,Rf(z,function(){var e={};return Wi(z,function(t,n){j.call(z.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),z.VERSION=r,Nn([`bind`,`bindKey`,`curry`,`curryRight`,`partial`,`partialRight`],function(e){z[e].placeholder=z}),Nn([`drop`,`take`],function(e,t){B.prototype[e]=function(r){r=r===n?1:M(Z(r),0);var i=this.__filtered__&&!t?new B(this):this.clone();return i.__filtered__?i.__takeCount__=F(r,i.__takeCount__):i.__views__.push({size:F(r,E),type:e+(i.__dir__<0?`Right`:``)}),i},B.prototype[e+`Right`]=function(t){return this.reverse()[e](t).reverse()}}),Nn([`filter`,`map`,`takeWhile`],function(e,t){var n=t+1,r=n==ae||n==se;B.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:W(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),Nn([`head`,`last`],function(e,t){var n=`take`+(t?`Right`:``);B.prototype[e]=function(){return this[n](1).value()[0]}}),Nn([`initial`,`tail`],function(e,t){var n=`drop`+(t?``:`Right`);B.prototype[e]=function(){return this.__filtered__?new B(this):this[n](1)}}),B.prototype.compact=function(){return this.filter(Mf)},B.prototype.find=function(e){return this.filter(e).head()},B.prototype.findLast=function(e){return this.reverse().find(e)},B.prototype.invokeMap=U(function(e,t){return typeof e==`function`?new B(this):this.map(function(n){return ta(n,e,t)})}),B.prototype.reject=function(e){return this.filter(Yl(W(e)))},B.prototype.slice=function(e,t){e=Z(e);var r=this;return r.__filtered__&&(e>0||t<0)?new B(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(t=Z(t),r=t<0?r.dropRight(-t):r.take(t-e)),r)},B.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},B.prototype.toArray=function(){return this.take(E)},Wi(B.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=z[i?`take`+(t==`last`?`Right`:``):t],o=i||/^find/.test(t);a&&(z.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof B,l=s[0],u=c||q(t),d=function(e){var t=a.apply(z,zn([e],s));return i&&f?t[0]:t};u&&r&&typeof l==`function`&&l.length!=1&&(c=u=!1);var f=this.__chain__,p=!!this.__actions__.length,m=o&&!f,h=c&&!p;if(!o&&u){t=h?t:new B(this);var g=e.apply(t,s);return g.__actions__.push({func:tl,args:[d],thisArg:n}),new Vr(g,f)}return m&&h?e.apply(this,s):(g=this.thru(d),m?i?g.value()[0]:g.value():g)})}),Nn([`pop`,`push`,`shift`,`sort`,`splice`,`unshift`],function(e){var t=At[e],n=/^(?:push|sort|unshift)$/.test(e)?`tap`:`thru`,r=/^(?:pop|shift)$/.test(e);z.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(q(i)?i:[],e)}return this[n](function(n){return t.apply(q(n)?n:[],e)})}}),Wi(B.prototype,function(e,t){var n=z[t];if(n){var r=n.name+``;j.call($n,r)||($n[r]=[]),$n[r].push({name:t,func:n})}}),$n[Ao(n,v).name]=[{name:`wrapper`,func:n}],B.prototype.clone=Hr,B.prototype.reverse=Ur,B.prototype.value=Wr,z.prototype.at=nl,z.prototype.chain=rl,z.prototype.commit=il,z.prototype.next=al,z.prototype.plant=sl,z.prototype.reverse=cl,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=ll,z.prototype.first=z.prototype.head,Xt&&(z.prototype[Xt]=ol),z})();typeof define==`function`&&typeof define.amd==`object`&&define.amd?(I._=Nr,define(function(){return Nr})):Sn?((Sn.exports=Nr)._=Nr,xn._=Nr):I._=Nr}).call(e)}));Qe(),$e();var et=(0,l.defineComponent)({name:`AmisRenderer`,__name:`amis`,props:{schema:{default:void 0},data:{default:void 0},context:{default:void 0},env:{default:void 0},fetcher:{type:Function,default:void 0},debug:{type:Boolean}},emits:[`ready`,`doRegister`],setup(e,{expose:t,emit:n}){let r=n,i=e=>{r(`ready`,e)},a=(0,l.ref)(),o=(0,l.computed)(()=>localStorage.getItem(`SOY_darkMode`)==`true`?`dark`:`antd`),s=l.useTemplateRef(`containerRef`),c=e,{schema:u,data:d,context:f,env:p}=(0,l.toRefs)(c),m=async()=>{if(window.amisRequire||(new ne,await Xe()),!s.value)return;let e=window.amisRequire(`amis/embed`).embed(s.value,u.value,{data:d.value,context:f.value,location:window.location,locale:`zh-CN`},{toastPosition:`bottom-right`,theme:o.value,enableAMISDebug:c.debug,fetcher:c.fetcher,...p.value},()=>{window.amisRequire([`amis`,`react`,`amis-ui`],(...t)=>{let[n,i,a]=t;r(`doRegister`,Ze({vue:l,react:i,amislib:n,amisUI:a,scoped:e,locale:`zh-CN`,theme:o.value}))}),i(e)});return a.value=e,e},h=(e={})=>{a.value?.updateProps({data:d.value,context:f.value,...e},e=>T.error(e))},g=e=>{a.value?.updateSchema(e,{data:d.value,context:f.value},e=>{T.error(e)})};return(0,l.watch)(u,()=>{u.value&&g(u.value)}),(0,l.onMounted)(async()=>{try{await m()}catch(e){T.error(`amis 初始化失败:`,e)}}),(0,l.onUnmounted)(()=>{a.value?.unmount()}),t({refresh:async()=>{u.value&&a.value?a.value.updateSchema(u.value):await m()},updateProps:h}),(e,t)=>((0,l.openBlock)(),(0,l.createElementBlock)(`div`,{class:`amis_root relative`,ref_key:`containerRef`,ref:s},[(0,l.renderSlot)(e.$slots,`default`)],512))}});module.exports=et;
package/dist/index.es.js CHANGED
@@ -4386,6 +4386,10 @@ var nt = /* @__PURE__ */ r({
4386
4386
  data: { default: void 0 },
4387
4387
  context: { default: void 0 },
4388
4388
  env: { default: void 0 },
4389
+ fetcher: {
4390
+ type: Function,
4391
+ default: void 0
4392
+ },
4389
4393
  debug: { type: Boolean }
4390
4394
  },
4391
4395
  emits: ["ready", "doRegister"],
@@ -4403,6 +4407,7 @@ var nt = /* @__PURE__ */ r({
4403
4407
  toastPosition: "bottom-right",
4404
4408
  theme: g.value,
4405
4409
  enableAMISDebug: v.debug,
4410
+ fetcher: v.fetcher,
4406
4411
  ...S.value
4407
4412
  }, () => {
4408
4413
  window.amisRequire([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hr-components-dev/render",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
4
4
  "description": "Standalone AmisRenderer component for Vue 3",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",
@@ -25,7 +25,7 @@
25
25
  "vue": "^3.5.44"
26
26
  },
27
27
  "devDependencies": {
28
- "@types/lodash": "^4.17.24",
28
+ "@types/lodash": "^4.17.27",
29
29
  "@types/node": "^25.9.2",
30
30
  "@vitejs/plugin-vue": "^6.0.7",
31
31
  "typescript": "~6.0.3",
@@ -35,9 +35,9 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@maita/amis-tools": "^0.1.7",
38
- "axios": "^1.17.0",
38
+ "axios": "^1.21.0",
39
39
  "consola": "^3.4.2",
40
- "dayjs": "^1.11.21",
40
+ "dayjs": "^1.11.23",
41
41
  "lodash": "^4.18.1"
42
42
  },
43
43
  "scripts": {