@ukpc-lib/react 0.5.5 → 0.5.7
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/components/FavoriteMenu/index.d.ts +0 -4
- package/dist/components/index.cjs +25 -25
- package/dist/components/index.js +1720 -1761
- package/dist/{index.module-9941a53b.cjs → index.module-deeaebfb.cjs} +1 -1
- package/dist/{index.module-f854a289.js → index.module-f34dfa18.js} +11 -11
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +1 -1
- package/package.json +1 -1
- package/web-components-bundle/favorite-menu/index.js +5 -0
- package/web-components-bundle/global-menu/index.js +1 -1
- package/web-components-bundle/global-topbar/index.js +1 -1
- package/web-components-bundle/has-permission/index.js +1 -1
- package/web-components-bundle/{index-627bf80a.js → index-0d90cafb.js} +10143 -10179
|
@@ -138,7 +138,7 @@ Incoming: %s`,Di,"["+g.join(", ")+"]","["+w.join(", ")+"]");for(var A=0;A<w.leng
|
|
|
138
138
|
Error generating stack: `+$.message+`
|
|
139
139
|
`+$.stack}}var ru=n.ReactCurrentDispatcher,xs=n.ReactDebugCurrentFrame,Jl=0,Pi=1,iu=2,Ju=3,Ga=4,Ss=0,Ql=1,qa=2,ec=12800;function tc(g){return console.error(g),null}function So(){}function Wf(g,w,A,$,K,se,ge,Ae,h){var b=[],D=new Set,M={destination:null,responseState:w,progressiveChunkSize:$===void 0?ec:$,status:Ss,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:D,pingedTasks:b,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:K===void 0?tc:K,onAllReady:se===void 0?So:se,onShellReady:ge===void 0?So:ge,onShellError:Ae===void 0?So:Ae,onFatalError:h===void 0?So:h},Y=Qu(M,0,null,A,!1,!1);Y.parentFlushed=!0;var ie=ou(M,g,null,Y,D,Fn,Wc,$f);return b.push(ie),M}function zf(g,w){var A=g.pingedTasks;A.push(w),A.length===1&&s(function(){return hu(g)})}function Ts(g,w){return{id:Hi,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:w,errorDigest:null}}function ou(g,w,A,$,K,se,ge,Ae){g.allPendingTasks++,A===null?g.pendingRootTasks++:A.pendingTasks++;var h={node:w,ping:function(){return zf(g,h)},blockedBoundary:A,blockedSegment:$,abortSet:K,legacyContext:se,context:ge,treeContext:Ae};return h.componentStack=null,K.add(h),h}function Qu(g,w,A,$,K,se){return{status:Jl,id:-1,index:w,parentFlushed:!1,chunks:[],children:[],formatContext:$,boundary:A,lastPushedText:K,textEmbedded:se}}var Ji=null;function Cs(){return Ji===null||Ji.componentStack===null?"":Qc(Ji.componentStack)}function Uo(g,w){g.componentStack={tag:0,parent:g.componentStack,type:w}}function Qi(g,w){g.componentStack={tag:1,parent:g.componentStack,type:w}}function Es(g,w){g.componentStack={tag:2,parent:g.componentStack,type:w}}function _i(g){g.componentStack===null?i("Unexpectedly popped too many stack frames. This is a bug in React."):g.componentStack=g.componentStack.parent}var Xa=null;function el(g,w){{var A;typeof w=="string"?A=w:w&&typeof w.message=="string"?A=w.message:A=String(w);var $=Xa||Cs();Xa=null,g.errorMessage=A,g.errorComponentStack=$}}function Ri(g,w){var A=g.onError(w);if(A!=null&&typeof A!="string")throw new Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof A+'" instead');return A}function Wo(g,w){var A=g.onShellError;A(w);var $=g.onFatalError;$(w),g.destination!==null?(g.status=qa,U(g.destination,w)):(g.status=Ql,g.fatalError=w)}function nc(g,w,A){Uo(w,"Suspense");var $=w.blockedBoundary,K=w.blockedSegment,se=A.fallback,ge=A.children,Ae=new Set,h=Ts(g,Ae),b=K.chunks.length,D=Qu(g,b,h,K.formatContext,!1,!1);K.children.push(D),K.lastPushedText=!1;var M=Qu(g,0,null,K.formatContext,!1,!1);M.parentFlushed=!0,w.blockedBoundary=h,w.blockedSegment=M;try{if(fu(g,w,ge),Nr(M.chunks,g.responseState,M.lastPushedText,M.textEmbedded),M.status=Pi,du(h,M),h.pendingTasks===0){_i(w);return}}catch(ie){M.status=Ga,h.forceClientRender=!0,h.errorDigest=Ri(g,ie),el(h,ie)}finally{w.blockedBoundary=$,w.blockedSegment=K}var Y=ou(g,se,$,D,Ae,w.legacyContext,w.context,w.treeContext);Y.componentStack=w.componentStack,g.pingedTasks.push(Y),_i(w)}function Ka(g,w,A,$){Uo(w,A);var K=w.blockedSegment,se=ia(K.chunks,A,$,g.responseState,K.formatContext);K.lastPushedText=!1;var ge=K.formatContext;K.formatContext=ni(ge,A,$),fu(g,w,se),K.formatContext=ge,Lo(K.chunks,A),K.lastPushedText=!1,_i(w)}function au(g){return g.prototype&&g.prototype.isReactComponent}function tl(g,w,A,$,K){var se={};zl(w,se);var ge=A($,K);return va(A,$,ge,K)}function ef(g,w,A,$,K){var se=A.render();A.props!==K&&(ks||i("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",Dn($)||"a component"),ks=!0);{var ge=$.childContextTypes;if(ge!=null){var Ae=w.legacyContext,h=Hl(A,$,Ae,ge);w.legacyContext=h,si(g,w,se),w.legacyContext=Ae;return}}si(g,w,se)}function rc(g,w,A,$){Es(w,A);var K=Vl(A,w.legacyContext),se=wo(A,$,K);Xc(se,A,$,K),ef(g,w,se,A,$),_i(w)}var Gt={},su={},tf={},Za={},ks=!1,ic=!1,oc=!1,oi=!1;function nf(g,w,A,$){var K;if(K=Vl(A,w.legacyContext),Qi(w,A),A.prototype&&typeof A.prototype.render=="function"){var se=Dn(A)||"Unknown";Gt[se]||(i("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",se,se),Gt[se]=!0)}var ge=tl(g,w,A,$,K),Ae=zr();if(typeof ge=="object"&&ge!==null&&typeof ge.render=="function"&&ge.$$typeof===void 0){var h=Dn(A)||"Unknown";su[h]||(i("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",h,h,h),su[h]=!0)}if(typeof ge=="object"&&ge!==null&&typeof ge.render=="function"&&ge.$$typeof===void 0){{var b=Dn(A)||"Unknown";su[b]||(i("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",b,b,b),su[b]=!0)}Xc(ge,A,$,K),ef(g,w,ge,A,$)}else if(uu(A),Ae){var D=w.treeContext,M=1,Y=0;w.treeContext=zu(D,M,Y);try{si(g,w,ge)}finally{w.treeContext=D}}else si(g,w,ge);_i(w)}function uu(g){{if(g&&g.childContextTypes&&i("%s(...): childContextTypes cannot be defined on a function component.",g.displayName||g.name||"Component"),typeof g.getDerivedStateFromProps=="function"){var w=Dn(g)||"Unknown";Za[w]||(i("%s: Function components do not support getDerivedStateFromProps.",w),Za[w]=!0)}if(typeof g.contextType=="object"&&g.contextType!==null){var A=Dn(g)||"Unknown";tf[A]||(i("%s: Function components do not support contextType.",A),tf[A]=!0)}}}function lu(g,w){if(g&&g.defaultProps){var A=ee({},w),$=g.defaultProps;for(var K in $)A[K]===void 0&&(A[K]=$[K]);return A}return w}function rf(g,w,A,$,K){Qi(w,A.render);var se=tl(g,w,A.render,$,K),ge=zr();if(ge){var Ae=w.treeContext,h=1,b=0;w.treeContext=zu(Ae,h,b);try{si(g,w,se)}finally{w.treeContext=Ae}}else si(g,w,se);_i(w)}function of(g,w,A,$,K){var se=A.type,ge=lu(se,$);nl(g,w,se,ge,K)}function ai(g,w,A,$){A._context===void 0?A!==A.Consumer&&(oi||(oi=!0,i("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))):A=A._context;var K=$.children;typeof K!="function"&&i("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it.");var se=Zs(A),ge=K(se);si(g,w,ge)}function ya(g,w,A,$){var K=A._context,se=$.value,ge=$.children,Ae;Ae=w.context,w.context=zc(K,se),si(g,w,ge),w.context=Yc(K),Ae!==w.context&&i("Popping the context provider did not return back to the original snapshot. This is a bug in React.")}function ac(g,w,A,$,K){Uo(w,"Lazy");var se=A._payload,ge=A._init,Ae=ge(se),h=lu(Ae,$);nl(g,w,Ae,h,K),_i(w)}function nl(g,w,A,$,K){if(typeof A=="function")if(au(A)){rc(g,w,A,$);return}else{nf(g,w,A,$);return}if(typeof A=="string"){Ka(g,w,A,$);return}switch(A){case Ln:case Yt:case J:case pe:case ke:{si(g,w,$.children);return}case dt:{Uo(w,"SuspenseList"),si(g,w,$.children),_i(w);return}case kt:throw new Error("ReactDOMServer does not yet support scope components.");case ft:{nc(g,w,$);return}}if(typeof A=="object"&&A!==null)switch(A.$$typeof){case ze:{rf(g,w,A,$,K);return}case ut:{of(g,w,A,$,K);return}case de:{ya(g,w,A,$);return}case $e:{ai(g,w,A,$);return}case At:{ac(g,w,A,$);return}}var se="";throw(A===void 0||typeof A=="object"&&A!==null&&Object.keys(A).length===0)&&(se+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) "+("but got: "+(A==null?A:typeof A)+"."+se))}function rl(g,w){typeof Symbol=="function"&&g[Symbol.toStringTag]==="Generator"&&(ic||i("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."),ic=!0),g.entries===w&&(oc||i("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),oc=!0)}function si(g,w,A){try{return cu(g,w,A)}catch($){throw typeof $=="object"&&$!==null&&typeof $.then=="function"||(Xa=Xa!==null?Xa:Cs()),$}}function cu(g,w,A){if(w.node=A,typeof A=="object"&&A!==null){switch(A.$$typeof){case me:{var $=A,K=$.type,se=$.props,ge=$.ref;nl(g,w,K,se,ge);return}case _e:throw new Error("Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.");case At:{var Ae=A,h=Ae._payload,b=Ae._init,D;try{D=b(h)}catch(St){throw typeof St=="object"&&St!==null&&typeof St.then=="function"&&Uo(w,"Lazy"),St}si(g,w,D);return}}if(Ti(A)){sc(g,w,A);return}var M=Gi(A);if(M){rl(A,M);var Y=M.call(A);if(Y){var ie=Y.next();if(!ie.done){var fe=[];do fe.push(ie.value),ie=Y.next();while(!ie.done);sc(g,w,fe);return}return}}var Ie=Object.prototype.toString.call(A);throw new Error("Objects are not valid as a React child (found: "+(Ie==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":Ie)+"). If you meant to render a collection of children, use an array instead.")}if(typeof A=="string"){var Ze=w.blockedSegment;Ze.lastPushedText=Ui(w.blockedSegment.chunks,A,g.responseState,Ze.lastPushedText);return}if(typeof A=="number"){var ht=w.blockedSegment;ht.lastPushedText=Ui(w.blockedSegment.chunks,""+A,g.responseState,ht.lastPushedText);return}typeof A=="function"&&i("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.")}function sc(g,w,A){for(var $=A.length,K=0;K<$;K++){var se=w.treeContext;w.treeContext=zu(se,$,K);try{fu(g,w,A[K])}finally{w.treeContext=se}}}function Yr(g,w,A){var $=w.blockedSegment,K=$.chunks.length,se=Qu(g,K,null,$.formatContext,$.lastPushedText,!0);$.children.push(se),$.lastPushedText=!1;var ge=ou(g,w.node,w.blockedBoundary,se,w.abortSet,w.legacyContext,w.context,w.treeContext);w.componentStack!==null&&(ge.componentStack=w.componentStack.parent);var Ae=ge.ping;A.then(Ae,Ae)}function fu(g,w,A){var $=w.blockedSegment.formatContext,K=w.legacyContext,se=w.context,ge=null;ge=w.componentStack;try{return si(g,w,A)}catch(Ae){if(Yl(),typeof Ae=="object"&&Ae!==null&&typeof Ae.then=="function"){Yr(g,w,Ae),w.blockedSegment.formatContext=$,w.legacyContext=K,w.context=se,Ks(se),w.componentStack=ge;return}else throw w.blockedSegment.formatContext=$,w.legacyContext=K,w.context=se,Ks(se),w.componentStack=ge,Ae}}function zo(g,w,A,$){var K=Ri(g,$);if(w===null?Wo(g,$):(w.pendingTasks--,w.forceClientRender||(w.forceClientRender=!0,w.errorDigest=K,el(w,$),w.parentFlushed&&g.clientRenderedBoundaries.push(w))),g.allPendingTasks--,g.allPendingTasks===0){var se=g.onAllReady;se()}}function Yf(g){var w=this,A=g.blockedBoundary,$=g.blockedSegment;$.status=Ju,uc(w,A,$)}function eo(g,w,A){var $=g.blockedBoundary,K=g.blockedSegment;if(K.status=Ju,$===null)w.allPendingTasks--,w.status!==qa&&(w.status=qa,w.destination!==null&&_(w.destination));else{if($.pendingTasks--,!$.forceClientRender){$.forceClientRender=!0;var se=A===void 0?new Error("The render was aborted by the server without a reason."):A;$.errorDigest=w.onError(se);{var ge="The server did not finish this Suspense boundary: ";se&&typeof se.message=="string"?se=ge+se.message:se=ge+String(se);var Ae=Ji;Ji=g;try{el($,se)}finally{Ji=Ae}}$.parentFlushed&&w.clientRenderedBoundaries.push($)}if($.fallbackAbortableTasks.forEach(function(b){return eo(b,w,A)}),$.fallbackAbortableTasks.clear(),w.allPendingTasks--,w.allPendingTasks===0){var h=w.onAllReady;h()}}}function du(g,w){if(w.chunks.length===0&&w.children.length===1&&w.children[0].boundary===null){var A=w.children[0];A.id=w.id,A.parentFlushed=!0,A.status===Pi&&du(g,A)}else{var $=g.completedSegments;$.push(w)}}function uc(g,w,A){if(w===null){if(A.parentFlushed){if(g.completedRootSegment!==null)throw new Error("There can only be one root segment. This is a bug in React.");g.completedRootSegment=A}if(g.pendingRootTasks--,g.pendingRootTasks===0){g.onShellError=So;var $=g.onShellReady;$()}}else if(w.pendingTasks--,!w.forceClientRender){if(w.pendingTasks===0)A.parentFlushed&&A.status===Pi&&du(w,A),w.parentFlushed&&g.completedBoundaries.push(w),w.fallbackAbortableTasks.forEach(Yf,g),w.fallbackAbortableTasks.clear();else if(A.parentFlushed&&A.status===Pi){du(w,A);var K=w.completedSegments;K.length===1&&w.parentFlushed&&g.partialBoundaries.push(w)}}if(g.allPendingTasks--,g.allPendingTasks===0){var se=g.onAllReady;se()}}function il(g,w){var A=w.blockedSegment;if(A.status===Jl){Ks(w.context);var $=null;$=Ji,Ji=w;try{si(g,w,w.node),Nr(A.chunks,g.responseState,A.lastPushedText,A.textEmbedded),w.abortSet.delete(w),A.status=Pi,uc(g,w.blockedBoundary,A)}catch(se){if(Yl(),typeof se=="object"&&se!==null&&typeof se.then=="function"){var K=w.ping;se.then(K,K)}else w.abortSet.delete(w),A.status=Ga,zo(g,w.blockedBoundary,A,se)}finally{Ji=$}}}function hu(g){if(g.status!==qa){var w=$u(),A=ru.current;ru.current=kr;var $;$=xs.getCurrentStack,xs.getCurrentStack=Cs;var K=tu;nu(g.responseState);try{var se=g.pingedTasks,ge;for(ge=0;ge<se.length;ge++){var Ae=se[ge];il(g,Ae)}se.splice(0,ge),g.destination!==null&&vr(g,g.destination)}catch(h){Ri(g,h),Wo(g,h)}finally{nu(K),ru.current=A,xs.getCurrentStack=$,A===kr&&Ks(w)}}}function pu(g,w,A){switch(A.parentFlushed=!0,A.status){case Jl:{var $=A.id=g.nextSegmentId++;return A.lastPushedText=!1,A.textEmbedded=!1,er(w,g.responseState,$)}case Pi:{A.status=iu;for(var K=!0,se=A.chunks,ge=0,Ae=A.children,h=0;h<Ae.length;h++){for(var b=Ae[h];ge<b.index;ge++)p(w,se[ge]);K=ol(g,w,b)}for(;ge<se.length-1;ge++)p(w,se[ge]);return ge<se.length&&(K=S(w,se[ge])),K}default:throw new Error("Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React.")}}function ol(g,w,A){var $=A.boundary;if($===null)return pu(g,w,A);if($.parentFlushed=!0,$.forceClientRender)return Ye(w,g.responseState,$.errorDigest,$.errorMessage,$.errorComponentStack),pu(g,w,A),It(w,g.responseState);if($.pendingTasks>0){$.rootSegmentID=g.nextSegmentId++,$.completedSegments.length>0&&g.partialBoundaries.push($);var K=$.id=_n(g.responseState);return Ee(w,g.responseState,K),pu(g,w,A),Pt(w,g.responseState)}else{if($.byteSize>g.progressiveChunkSize)return $.rootSegmentID=g.nextSegmentId++,g.completedBoundaries.push($),Ee(w,g.responseState,$.id),pu(g,w,A),Pt(w,g.responseState);Fe(w,g.responseState);var se=$.completedSegments;if(se.length!==1)throw new Error("A previously unvisited boundary must have exactly one root segment. This is a bug in React.");var ge=se[0];return ol(g,w,ge),ct(w,g.responseState)}}function lc(g,w,A){return Ws(w,g.responseState,A.id,A.errorDigest,A.errorMessage,A.errorComponentStack)}function Os(g,w,A){return Dt(w,g.responseState,A.formatContext,A.id),ol(g,w,A),Ct(w,A.formatContext)}function gu(g,w,A){for(var $=A.completedSegments,K=0;K<$.length;K++){var se=$[K];al(g,w,A,se)}return $.length=0,Yi(w,g.responseState,A.id,A.rootSegmentID)}function af(g,w,A){for(var $=A.completedSegments,K=0;K<$.length;K++){var se=$[K];if(!al(g,w,A,se))return K++,$.splice(0,K),!1}return $.splice(0,K),!0}function al(g,w,A,$){if($.status===iu)return!0;var K=$.id;if(K===-1){var se=$.id=A.rootSegmentID;if(se===-1)throw new Error("A root segment ID must have been assigned by now. This is a bug in React.");return Os(g,w,$)}else return Os(g,w,$),Hs(w,g.responseState,K)}function vr(g,w){v();try{var A=g.completedRootSegment;A!==null&&g.pendingRootTasks===0&&(ol(g,w,A),g.completedRootSegment=null,wi(w,g.responseState));var $=g.clientRenderedBoundaries,K;for(K=0;K<$.length;K++){var se=$[K];lc(g,w,se)}$.splice(0,K);var ge=g.completedBoundaries;for(K=0;K<ge.length;K++){var Ae=ge[K];gu(g,w,Ae)}ge.splice(0,K),T(w),v(w);var h=g.partialBoundaries;for(K=0;K<h.length;K++){var b=h[K];if(!af(g,w,b)){g.destination=null,K++,h.splice(0,K);return}}h.splice(0,K);var D=g.completedBoundaries;for(K=0;K<D.length;K++){var M=D[K];gu(g,w,M)}D.splice(0,K)}finally{T(w),g.allPendingTasks===0&&g.pingedTasks.length===0&&g.clientRenderedBoundaries.length===0&&g.completedBoundaries.length===0&&(g.abortableTasks.size!==0&&i("There was still abortable task at the root when we closed. This is a bug in React."),_(w))}}function To(g){s(function(){return hu(g)})}function sf(g,w){if(g.status===Ql){g.status=qa,U(w,g.fatalError);return}if(g.status!==qa&&g.destination===null){g.destination=w;try{vr(g,w)}catch(A){Ri(g,A),Wo(g,A)}}}function sl(g,w){try{var A=g.abortableTasks;A.forEach(function($){return eo($,g,w)}),A.clear(),g.destination!==null&&vr(g,g.destination)}catch($){Ri(g,$),Wo(g,$)}}function ul(g,w){return new Promise(function(A,$){var K,se,ge=new Promise(function(Y,ie){se=Y,K=ie});function Ae(){var Y=new ReadableStream({type:"bytes",pull:function(ie){sf(b,ie)},cancel:function(ie){sl(b)}},{highWaterMark:0});Y.allReady=ge,A(Y)}function h(Y){ge.catch(function(){}),$(Y)}var b=Wf(g,Ar(w?w.identifierPrefix:void 0,w?w.nonce:void 0,w?w.bootstrapScriptContent:void 0,w?w.bootstrapScripts:void 0,w?w.bootstrapModules:void 0),ti(w?w.namespaceURI:void 0),w?w.progressiveChunkSize:void 0,w?w.onError:void 0,se,Ae,h,K);if(w&&w.signal){var D=w.signal,M=function(){sl(b,D.reason),D.removeEventListener("abort",M)};D.addEventListener("abort",M)}To(b)})}jh.renderToReadableStream=ul,jh.version=t}()),jh}var Ac,Im;process.env.NODE_ENV==="production"?(Ac=j5(),Im=B5()):(Ac=$5(),Im=V5());Ac.version;var H5=Ac.renderToString;Ac.renderToStaticMarkup;Ac.renderToNodeStream;Ac.renderToStaticNodeStream;Im.renderToReadableStream;var U5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lO(e,t){return e(t={exports:{}},t.exports),t.exports}var W5=lO(function(e){(function(t){var n=function(L,I,U){if(!c(I)||v(I)||p(I)||S(I)||l(I))return I;var z,re=0,Z=0;if(d(I))for(z=[],Z=I.length;re<Z;re++)z.push(n(L,I[re],U));else for(var he in z={},I)Object.prototype.hasOwnProperty.call(I,he)&&(z[L(he,U)]=n(L,I[he],U));return z},r=function(L){return T(L)?L:(L=L.replace(/[\-_\s]+(.)?/g,function(I,U){return U?U.toUpperCase():""})).substr(0,1).toLowerCase()+L.substr(1)},i=function(L){var I=r(L);return I.substr(0,1).toUpperCase()+I.substr(1)},o=function(L,I){return function(U,z){var re=(z=z||{}).separator||"_",Z=z.split||/(?=[A-Z])/;return U.split(Z).join(re)}(L,I).toLowerCase()},s=Object.prototype.toString,l=function(L){return typeof L=="function"},c=function(L){return L===Object(L)},d=function(L){return s.call(L)=="[object Array]"},v=function(L){return s.call(L)=="[object Date]"},p=function(L){return s.call(L)=="[object RegExp]"},S=function(L){return s.call(L)=="[object Boolean]"},T=function(L){return(L-=0)==L},_=function(L,I){var U=I&&"process"in I?I.process:I;return typeof U!="function"?L:function(z,re){return U(z,L,re)}},R={camelize:r,decamelize:o,pascalize:i,depascalize:o,camelizeKeys:function(L,I){return n(_(r,I),L)},decamelizeKeys:function(L,I){return n(_(o,I),L,I)},pascalizeKeys:function(L,I){return n(_(i,I),L)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};e.exports?e.exports=R:t.humps=R})(U5)}).decamelize,z5=function(e){if(Array.isArray(e))return e},Y5=function(e,t){if(typeof Symbol<"u"&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var s,l=e[Symbol.iterator]();!(r=(s=l.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(c){i=!0,o=c}finally{try{r||l.return==null||l.return()}finally{if(i)throw o}}return n}},e1=function(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},G5=function(e,t){if(e){if(typeof e=="string")return e1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e1(e,t):void 0}},q5=function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
140
140
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)},X5=function(e,t){return z5(e)||Y5(e,t)||G5(e,t)||q5()},cO=lO(function(e){function t(){return e.exports=t=Object.assign||function(n){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},t.apply(this,arguments)}e.exports=t}),K5=function(e,t){if(e==null)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i},fO=function(e,t){if(e==null)return{};var n,r,i=K5(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},Z5=Q.createContext(null);function Am(e){var t=e.children,n=fO(e,["children"]);return typeof t!="string"&&(t=H5(t)),Q.createElement("template",cO({},n,{dangerouslySetInnerHTML:{__html:t}}))}function Mm(e){var t=e.root,n=e.children;return S1.createPortal(n,t)}function J5(e){var t=Q.forwardRef(function(n,r){var i,o,s=n.mode,l=n.delegatesFocus,c=n.styleSheets,d=n.ssr,v=n.children,p=fO(n,["mode","delegatesFocus","styleSheets","ssr","children"]),S=(o=Q.useRef((i=r)&&i.current),Q.useEffect(function(){i&&(i.current=o.current)},[i]),o),T=Q.useState(null),_=X5(T,2),R=_[0],L=_[1],I="node_".concat(s).concat(l);return Q.useLayoutEffect(function(){if(S.current)try{if(typeof r=="function"&&r(S.current),d){var U=S.current.shadowRoot;return void L(U)}var z=S.current.attachShadow({mode:s,delegatesFocus:l});c.length>0&&(z.adoptedStyleSheets=c),L(z)}catch(re){(function(Z){var he=Z.error,x=Z.styleSheets,ce=Z.root;switch(he.name){case"NotSupportedError":x.length>0&&(ce.adoptedStyleSheets=x);break;default:throw he}})({error:re,styleSheets:c,root:R})}},[r,S,c]),Q.createElement(Q.Fragment,null,Q.createElement(e.tag,cO({key:I,ref:S},p),(R||d)&&Q.createElement(Z5.Provider,{value:R},d?Q.createElement(Am,{shadowroot:s,shadowrootmode:s},e.render({root:R,ssr:d,children:v})):Q.createElement(Mm,{root:R},e.render({root:R,ssr:d,children:v})))))});return t.propTypes={mode:ka.oneOf(["open","closed"]),delegatesFocus:ka.bool,styleSheets:ka.arrayOf(ka.instanceOf(globalThis.CSSStyleSheet)),ssr:ka.bool,children:ka.node},t.defaultProps={mode:"open",delegatesFocus:!1,styleSheets:[],ssr:!1,children:null},t}Am.propTypes={children:ka.oneOfType([ka.string,ka.node])},Am.defaultProps={children:""},Mm.propTypes={root:ka.object.isRequired,children:ka.node},Mm.defaultProps={children:null};var Ev=new Map;function Q5(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"core",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(r){return r.children};return new Proxy(e,{get:function(r,i){var o=W5(i,{separator:"-"}),s="".concat(t,"-").concat(o);return Ev.has(s)||Ev.set(s,J5({tag:o,render:n})),Ev.get(s)}})}var dO=Q5();const e4=e=>{const t=e.isCollapsed?0:e.depth*16;return st.jsx("div",{style:{backgroundColor:e.color||"#93D500",height:"2px",position:"absolute",right:"0",top:"0",left:t}})};function t4(){const e=JSON.parse(localStorage.getItem("menuOpenIds")||"[]");function t(i){localStorage.setItem("menuOpenIds",JSON.stringify(i))}const n=JSON.parse(localStorage.getItem("prevMenuOpenIds")||"[]");function r(){localStorage.setItem("prevMenuOpenIds",localStorage.getItem("menuOpenIds"))}return{menuOpenIds:e,setMenuOpenIds:t,prevMenuOpenIds:n,setPrevMenuOpenIds:r}}const n4=`.app,.treeRoot{height:100%}.draggingSource{opacity:.3}.placeholderContainer{position:relative}.dropTarget{background-color:#8d878711}
|
|
141
|
-
`,t1=localStorage.getItem("isCollapsed");function r4(e){window.favoriteMenus=e;const t=new CustomEvent("favoriteMenusChange",{detail:{favoriteMenus:e}});window.dispatchEvent(t)}function i4(e){const t=x1.useLocation(),[n,r]=Q.useState([]),i=n.map(ce=>ce.data),[o,s]=Q.useState(!1);console.log("isSubmitting:",o),Q.useMemo(()=>{const ce=new Map;return n.forEach(ae=>{ce.set(ae.id,ae)}),ce},[n]);const{menuOpenIds:l,prevMenuOpenIds:c,setMenuOpenIds:d,setPrevMenuOpenIds:v}=t4();console.log("🚀 ~ GlobalMenuContent ~ menuItems:",i);const[p,S]=Q.useState(t1===null?!0:t1==="true"),[T,_]=Q.useState(window.location.href),R=Q.useRef(null);Q.useEffect(()=>{
|
|
141
|
+
`,t1=localStorage.getItem("isCollapsed");function r4(e){window.favoriteMenus=e;const t=new CustomEvent("favoriteMenusChange",{detail:{favoriteMenus:e}});window.dispatchEvent(t)}function i4(e){const t=x1.useLocation(),[n,r]=Q.useState([]),i=n.map(ce=>ce.data),[o,s]=Q.useState(!1);console.log("isSubmitting:",o),Q.useMemo(()=>{const ce=new Map;return n.forEach(ae=>{ce.set(ae.id,ae)}),ce},[n]);const{menuOpenIds:l,prevMenuOpenIds:c,setMenuOpenIds:d,setPrevMenuOpenIds:v}=t4();console.log("🚀 ~ GlobalMenuContent ~ menuItems:",i);const[p,S]=Q.useState(t1===null?!0:t1==="true"),[T,_]=Q.useState(window.location.href),R=Q.useRef(null);Q.useEffect(()=>{var ce;(ce=e.handleCallback)==null||ce.call(e,i)},[i,e.handleCallback]),Q.useEffect(()=>{_(window.location.href)},[t]);const L=a4(i,T).filter(ce=>ce.parentKey!==0);console.log("matchPaths:",T,t,L);const I=()=>{var ce,ae;if(p)c&&((ae=R.current)==null||ae.open(c));else{const je=n.filter(We=>We.parent!==0).map(We=>We.id);console.log("closeIds:",je);const qe=n.filter(We=>We.parent===0).map(We=>We.id);v(),(ce=R.current)==null||ce.close(je),setTimeout(()=>{var We;console.log("openIds:",qe),(We=R.current)==null||We.open(qe)},1)}S(!p),localStorage.setItem("isCollapsed",JSON.stringify(!p))},[U,z]=Q.useState(!1),re=p?"collapsed":"expanded",Z=ce=>`${ce} ${re}`,he=Q.useRef(null);Q.useLayoutEffect(()=>{(async()=>{var ae,je;try{const qe=e.menuPath||"/global-menu-config/api/v1/menu-items/user",We=e.baseUrl+qe,{data:rt}=await Ls.get(We);let nt=rt.map(De=>({...De,parentKey:De.parentKey||0}));nt=pO(nt),e.replacePath&&(nt=hO(nt,e.replacePath));const ye=nt.map(De=>({id:De.id,parent:De.parentKey,text:De.name,data:De}));r(ye)}catch(qe){console.error(qe),Rp(((je=(ae=qe.response)==null?void 0:ae.data)==null?void 0:je.errorMessage)||"Have error when get menu items")}})()},[e.baseUrl,e.menuPath,e.replacePath]),Q.useEffect(()=>{const ce=i.filter(qe=>qe.isFavorite);function ae(qe){return n.every(We=>We.parent!==qe.id)?qe:{...qe,children:n.filter(We=>We.parent===qe.id).map(We=>ae(We.data))}}const je=ce.map(qe=>ae(qe));r4(je)},[i,n]),Q.useLayoutEffect(()=>{var qe;const ce=localStorage.getItem("scrollPos");ce&&he.current&&setTimeout(()=>{const We=he.current.getScrollElement();We.scrollTop=parseInt(ce)},0);const ae=()=>{if(he.current){const We=he.current.getScrollElement();localStorage.setItem("scrollPos",We.scrollTop.toString())}},je=(qe=he.current)==null?void 0:qe.getScrollElement();return je==null||je.addEventListener("scroll",ae),()=>{je==null||je.removeEventListener("scroll",ae)}},[i]);function x(ce){s(!0);const ae=[...n];r(ce);const je=ce.map((qe,We)=>({menuItemId:qe.id,order:We}));Ls.post("/global-menu-config/api/v1/menu-items/user",je,{baseURL:e.baseUrl}).then(()=>{}).catch(qe=>{console.error(qe),r(ae)}).finally(()=>{s(!1)})}return st.jsxs("div",{className:Z("side-bar"),children:[st.jsx("div",{className:Z("wrap-section side-bar__wrapper-toggle-btn"),children:st.jsx("button",{className:"icon-btn side-bar__toggle-btn",onClick:I,children:p?st.jsx(L5,{}):st.jsx(M5,{})})}),st.jsx(fT,{ref:he,className:Z("wrap-section side-bar__menu"),style:{marginTop:24,flex:1,overflow:"auto",height:"100%",overflowX:"hidden"},children:st.jsx(nz,{backend:Uz,options:f5(),children:st.jsx(R5,{ref:R,classes:{root:"treeRoot",draggingSource:"draggingSource",placeholder:"placeholderContainer"},tree:n,rootId:0,sort:!1,insertDroppableFirst:!1,enableAnimateExpand:!0,dropTargetOffset:10,onDrop:x,render:(ce,ae)=>{function je(nt){return n.every(ye=>ye.parent!==nt.id)?nt:{...nt,children:n.filter(ye=>ye.parent===nt.id).map(ye=>je(ye.data))}}const qe=je(ce.data),We=nt=>L.some(ye=>ye.id===nt);function rt(nt,ye){r(De=>De.map(He=>He.id===nt?{...He,data:{...He.data,isFavorite:ye}}:He))}return st.jsx(uO,{isActive:We,isCollapsed:p,replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors,baseUrl:e.baseUrl,node:ce,params:ae,nodes:n,item:qe,expanded:()=>!1,toggleExpand:()=>{},level:ae.depth,onSetFavoriteSuccess:rt})},placeholderRender:(ce,{depth:ae})=>{var je;return st.jsx(e4,{node:ce,depth:ae,color:(je=e.brandColors)==null?void 0:je.primary300,isCollapsed:p})},canDrag:ce=>!o&&!!(ce!=null&&ce.parent),canDrop:(ce,{dragSource:ae,dropTargetId:je,dropTarget:qe})=>(console.log("dragSource",ae,qe),!((ae==null?void 0:ae.parent)!==0&&je===0||(ae==null?void 0:ae.parent)===0&&je!==0||(qe==null?void 0:qe.id)!==(ae==null?void 0:ae.parent)||s4(ce,ae==null?void 0:ae.id,je))),onDragStart:ce=>{console.log("onDragStart",ce)},onChangeOpen:ce=>{console.log("onChangeOpen:",ce),d(ce)},initialOpen:l.length?l:[1]})})}),st.jsxs("div",{className:Z("wrap-section side-bar__wrap-btn-logout"),children:[st.jsxs("button",{className:Z("side-bar__logout-btn"),onClick:()=>z(!0),children:[st.jsx(N5,{className:Z("side-bar__icon-logout")}),st.jsx("span",{className:Z("side-bar__logout-btn__text"),children:"Logout"})]}),st.jsx(T1,{isOpen:U,onClose:()=>z(!1),onConfirm:()=>e.logout?e.logout():A1(e.baseUrl)})]})]})}function o4(e,t){const n=new URL(e).searchParams,r=new URL(t).searchParams;return Array.from(r).filter(([i,o])=>o===n.get(i)).length}function a4(e,t){var c;console.log("menuItems:",e);const n=new URL(t);let r=e.filter(d=>d.path&&d.path.includes("http")).map(d=>({item:d,itemUrl:new URL(d.path),matchingParamsCount:o4(t,d.path)})).sort((d,v)=>{const p=new URL(d.itemUrl).searchParams,S=new URL(v.itemUrl).searchParams;return Array.from(p).length-Array.from(S).length}).filter(({itemUrl:d})=>n.origin===d.origin);const i=r.filter(({itemUrl:d})=>n.pathname===d.pathname),o=r.filter(({itemUrl:d})=>n.pathname.includes(d.pathname));r=i.length>0?i:o,r=r.sort((d,v)=>v.matchingParamsCount-d.matchingParamsCount);let s=r.length>0?(c=r.find(d=>d.item.parentKey))==null?void 0:c.item:null;console.log("matchingItems:",r);let l=[];for(;s;)l=[s,...l],s=e.find(d=>d.id===(s==null?void 0:s.parentKey))||null;return console.log("parents:",l),l}function hO(e,t){return e.map(n=>{var r;return(r=n.children)!=null&&r.length?(n.path="",n.children=hO(n.children,t)):n.path=t(n.path),n})}function pO(e){return e.map(n=>n.path&&!n.path.includes("http")&&n.path.includes("/")?{...n,path:window.location.origin+n.path}:(n.children&&(n.children=pO(n.children)),n))}function n1(e,t){return e.find(n=>n.id===t)}function s4(e,t,n){let r=n1(e,n);for(;r;){if(r.id===t)return!0;r=n1(e,r.parent)}return!1}function u4(e){return st.jsx(dO.div,{children:st.jsx($1,{styles:[dT,F5,n4],style:{position:"sticky",zIndex:20},children:st.jsx(i4,{...e})})})}const l4={"page-container":"_page-container_1pwo1_1","page-main-content":"_page-main-content_1pwo1_8","page-title":"_page-title_1pwo1_19","text-base":"_text-base_1pwo1_26","mt-4":"_mt-4_1pwo1_33"};var Tp={exports:{}};/**
|
|
142
142
|
* @license
|
|
143
143
|
* Lodash <https://lodash.com/>
|
|
144
144
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
@@ -28855,16 +28855,6 @@ function u4(e) {
|
|
|
28855
28855
|
f1 === null ? !0 : f1 === "true"
|
|
28856
28856
|
), [T, _] = An(window.location.href), R = En(null);
|
|
28857
28857
|
zt(() => {
|
|
28858
|
-
const ue = i.filter((Ge) => Ge.isFavorite);
|
|
28859
|
-
function oe(Ge) {
|
|
28860
|
-
return n.every((Ue) => Ue.parent !== Ge.id) ? Ge : {
|
|
28861
|
-
...Ge,
|
|
28862
|
-
children: n.filter((Ue) => Ue.parent === Ge.id).map((Ue) => oe(Ue.data))
|
|
28863
|
-
};
|
|
28864
|
-
}
|
|
28865
|
-
const Fe = ue.map((Ge) => oe(Ge));
|
|
28866
|
-
l4(Fe);
|
|
28867
|
-
}, [i]), zt(() => {
|
|
28868
28858
|
var ue;
|
|
28869
28859
|
(ue = e.handleCallback) == null || ue.call(e, i);
|
|
28870
28860
|
}, [i, e.handleCallback]), zt(() => {
|
|
@@ -28912,7 +28902,17 @@ function u4(e) {
|
|
|
28912
28902
|
);
|
|
28913
28903
|
}
|
|
28914
28904
|
})();
|
|
28915
|
-
}, [e.baseUrl, e.menuPath, e.replacePath]),
|
|
28905
|
+
}, [e.baseUrl, e.menuPath, e.replacePath]), zt(() => {
|
|
28906
|
+
const ue = i.filter((Ge) => Ge.isFavorite);
|
|
28907
|
+
function oe(Ge) {
|
|
28908
|
+
return n.every((Ue) => Ue.parent !== Ge.id) ? Ge : {
|
|
28909
|
+
...Ge,
|
|
28910
|
+
children: n.filter((Ue) => Ue.parent === Ge.id).map((Ue) => oe(Ue.data))
|
|
28911
|
+
};
|
|
28912
|
+
}
|
|
28913
|
+
const Fe = ue.map((Ge) => oe(Ge));
|
|
28914
|
+
l4(Fe);
|
|
28915
|
+
}, [i, n]), Fl(() => {
|
|
28916
28916
|
var Ge;
|
|
28917
28917
|
const ue = localStorage.getItem("scrollPos");
|
|
28918
28918
|
ue && de.current && setTimeout(() => {
|
package/dist/share/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.module-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.module-deeaebfb.cjs"),m=require("axios"),u=require("react"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");const l=require("react-router-dom");require("@mui/material");const c=s=>{const[t,o]=u.useState([]);return u.useEffect(()=>{m.get(`${s}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(r=>o(r.data)).catch(r=>{console.error("Getting user permission error:",r)})},[s]),t},a=s=>(t,o)=>{const r=c(s);return o?t.every(n=>r==null?void 0:r.includes(n)):t.some(n=>r==null?void 0:r.includes(n))},h=({baseUrl:s,accessWith:t,requireAll:o,children:r})=>a(s)(t,o)?i.jsx(i.Fragment,{children:r}):null,P=({accessWith:s,requireAll:t,baseUrl:o,unAuthorizedPath:r,children:n})=>a(o)(s,t)?i.jsx(i.Fragment,{children:n}):i.jsx(l.Navigate,{to:r,replace:!0});exports.AuthContext=e.AuthContext;exports.AuthProvider=e.AuthProvider;exports.ERROR_MESSAGE=e.ERROR_MESSAGE;exports.SaasThemeProvider=e.SaasThemeProvider;exports.TranslationProvider=e.TranslationProvider;exports.axiosInstance=e.axiosInstance;exports.color=e.color;exports.createCustomTheme=e.createCustomTheme;exports.handleErrorAxios=e.handleErrorAxios;exports.login=e.login;exports.logout=e.logout;exports.responseInterceptor=e.responseInterceptor;exports.search=e.search;exports.translate=e.translate;exports.translationConfig=e.translationConfig;exports.useAuth=e.useAuth;exports.useCustomTranslation=e.useCustomTranslation;exports.useTheme=e.useTheme;exports.useTranslation=e.useTranslation$1;exports.HasPermission=h;exports.PermissionRoute=P;exports.getUseHasPermission=a;exports.useGetPermission=c;
|
package/dist/share/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as R, U as S, V as G, a4 as y, a2 as H, a as I, c as $, a3 as j, Y as k, W as w, X as F, Z as M, A as N, a0 as O, $ as U, u as V, e as X, k as Y, a1 as Z } from "../index.module-
|
|
1
|
+
import { T as R, U as S, V as G, a4 as y, a2 as H, a as I, c as $, a3 as j, Y as k, W as w, X as F, Z as M, A as N, a0 as O, $ as U, u as V, e as X, k as Y, a1 as Z } from "../index.module-f34dfa18.js";
|
|
2
2
|
import u from "axios";
|
|
3
3
|
import { useState as m, useEffect as c } from "react";
|
|
4
4
|
import { jsx as o, Fragment as n } from "react/jsx-runtime";
|
package/package.json
CHANGED