@ukpc-lib/react 0.16.5-dev.1 → 0.16.5-dev.3
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/index.cjs +1 -1
- package/dist/components/index.js +2 -2
- package/dist/{index.esm2017-DG9eBQda.js → index.esm2017-BwI0O2pm.js} +1 -1
- package/dist/{index.esm2017-In102Vka.cjs → index.esm2017-ihzMISQV.cjs} +1 -1
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +2 -2
- package/package.json +1 -1
- package/web-components-bundle/{SaasThemeProvider-DUpoV8xb.js → SaasThemeProvider-A_eMJWqw.js} +1 -1
- package/web-components-bundle/access-denied/index.js +6 -6
- package/web-components-bundle/base-breadcrumbs/index.js +3 -3
- package/web-components-bundle/favorite-menu/index.js +6 -6
- package/web-components-bundle/global-menu/index.js +5 -5
- package/web-components-bundle/global-topbar/index.js +6 -6
- package/web-components-bundle/has-permission/index.js +2 -2
- package/web-components-bundle/{index-N6zjI_u_.js → index-BwEhsh9S.js} +2 -2
- package/web-components-bundle/{index-pbpRN1TP.js → index-DnQ4tn_A.js} +493 -493
- package/web-components-bundle/{index-Db8shxub.js → index-HP_t9kgC.js} +6 -6
- package/web-components-bundle/page-not-found/index.js +3 -3
- package/web-components-bundle/{react-to-web-component-w5r1Fs9q.js → react-to-web-component-BOygDorD.js} +1535 -1527
- package/web-components-bundle/{react-toastify.esm-H_Xdunfj.js → react-toastify.esm-DnABvuky.js} +1 -1
- package/web-components-bundle/toast-config/index.js +2 -2
- package/web-components-bundle/toast-config-notification/index.js +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),S=require("react"),p=require("../index.esm2017-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),S=require("react"),p=require("../index.esm2017-ihzMISQV.cjs"),$=require("@mui/material");require("axios");const St=require("react-router-dom");require("@r2wc/react-to-web-component");require("react-query");require("react-dom");const ce=require("moment");function Lo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const N=Lo(S),zo=({color:e="#fff"})=>l.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M3 12H21M3 6H21M3 18H21",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),kr=e=>{var r,o;const{tabs:t}=e,n=i=>{e.setCurrentTab(i.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),l.jsxs(l.Fragment,{children:[l.jsx("style",{children:`
|
|
2
2
|
.tab-title {
|
|
3
3
|
${e.fullWidthTabs?"flex: 1;":""}
|
|
4
4
|
min-width: 90px;
|
package/dist/components/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import pi, { jsx as u, jsxs as O, Fragment as ue } from "react/jsx-runtime";
|
|
2
2
|
import * as N from "react";
|
|
3
3
|
import Ce, { createElement as sn, PureComponent as gi, useState as R, useEffect as X, useRef as pe, useContext as Ve, useCallback as dt, forwardRef as yi } from "react";
|
|
4
|
-
import { c as Me, a as ht, _ as bi, b as Qn, d as G, C as nt, t as Le, I as Qr, N as vi, p as xi, Q as eo, h as Rn, l as to, L as wi, G as Si, F as _i, e as er, U as Ei, f as Ci, u as Ti, g as no, S as ro, i as Ii, j as Mi, k as Tt, s as tr, m as Pn, P, n as _e, o as ki, q as Oi, r as Fe, v as Ai, w as Ot, x as nr, y as $i, z as rr, D as Ni, A as oo, B as io, E as Ri, H as Pi, J as zi } from "../index.esm2017-
|
|
5
|
-
import { T as hu, R as mu, K as pu, M as gu, O as yu } from "../index.esm2017-
|
|
4
|
+
import { c as Me, a as ht, _ as bi, b as Qn, d as G, C as nt, t as Le, I as Qr, N as vi, p as xi, Q as eo, h as Rn, l as to, L as wi, G as Si, F as _i, e as er, U as Ei, f as Ci, u as Ti, g as no, S as ro, i as Ii, j as Mi, k as Tt, s as tr, m as Pn, P, n as _e, o as ki, q as Oi, r as Fe, v as Ai, w as Ot, x as nr, y as $i, z as rr, D as Ni, A as oo, B as io, E as Ri, H as Pi, J as zi } from "../index.esm2017-BwI0O2pm.js";
|
|
5
|
+
import { T as hu, R as mu, K as pu, M as gu, O as yu } from "../index.esm2017-BwI0O2pm.js";
|
|
6
6
|
import { Box as ao, CircularProgress as so, Typography as ke, Stack as Se, Dialog as Li, DialogTitle as Di, DialogContent as Fi, DialogActions as ji, Button as gn, ClickAwayListener as Hi, TextField as lo, IconButton as Bi, Fade as Wi, Paper as Vi, Checkbox as Ui, Breadcrumbs as Ki } from "@mui/material";
|
|
7
7
|
import "axios";
|
|
8
8
|
import { useLocation as Gi, useParams as Yi, Link as co } from "react-router-dom";
|
|
@@ -19815,7 +19815,7 @@ function n6(t) {
|
|
|
19815
19815
|
children: e({ maxHeight: f })
|
|
19816
19816
|
}
|
|
19817
19817
|
),
|
|
19818
|
-
|
|
19818
|
+
document.body
|
|
19819
19819
|
);
|
|
19820
19820
|
}
|
|
19821
19821
|
const Hf = /* @__PURE__ */ new Map();
|
|
@@ -28,7 +28,7 @@ object-assign
|
|
|
28
28
|
(c) Sindre Sorhus
|
|
29
29
|
@license MIT
|
|
30
30
|
*/var vm,x1;function F4(){if(x1)return vm;x1=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var a={},c=0;c<10;c++)a["_"+String.fromCharCode(c)]=c;var f=Object.getOwnPropertyNames(a).map(function(y){return a[y]});if(f.join("")!=="0123456789")return!1;var p={};return"abcdefghijklmnopqrst".split("").forEach(function(y){p[y]=y}),Object.keys(Object.assign({},p)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return vm=i()?Object.assign:function(o,a){for(var c,f=r(o),p,y=1;y<arguments.length;y++){c=Object(arguments[y]);for(var g in c)e.call(c,g)&&(f[g]=c[g]);if(t){p=t(c);for(var T=0;T<p.length;T++)n.call(c,p[T])&&(f[p[T]]=c[p[T]])}}return f},vm}var ym,S1;function lb(){if(S1)return ym;S1=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ym=t,ym}var bm,T1;function QD(){return T1||(T1=1,bm=Function.call.bind(Object.prototype.hasOwnProperty)),bm}var wm,C1;function N4(){if(C1)return wm;C1=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=lb(),n={},r=QD();t=function(o){var a="Warning: "+o;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function i(o,a,c,f,p){if(process.env.NODE_ENV!=="production"){for(var y in o)if(r(o,y)){var g;try{if(typeof o[y]!="function"){var T=Error((f||"React class")+": "+c+" type `"+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}g=o[y](a,y,f,c,null,e)}catch(I){g=I}if(g&&!(g instanceof Error)&&t((f||"React class")+": type specification of "+c+" `"+y+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof g+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),g instanceof Error&&!(g.message in n)){n[g.message]=!0;var E=p?p():"";t("Failed "+c+" type: "+g.message+(E??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},wm=i,wm}var xm,E1;function j4(){if(E1)return xm;E1=1;var t=JD(),e=F4(),n=lb(),r=QD(),i=N4(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(c){var f="Warning: "+c;typeof console<"u"&&console.error(f);try{throw new Error(f)}catch{}});function a(){return null}return xm=function(c,f){var p=typeof Symbol=="function"&&Symbol.iterator,y="@@iterator";function g(ye){var ue=ye&&(p&&ye[p]||ye[y]);if(typeof ue=="function")return ue}var T="<<anonymous>>",E={array:R("array"),bigint:R("bigint"),bool:R("boolean"),func:R("function"),number:R("number"),object:R("object"),string:R("string"),symbol:R("symbol"),any:U(),arrayOf:H,element:ne(),elementType:Z(),instanceOf:ce,node:Pe(),objectOf:re,oneOf:S,oneOfType:ie,shape:$e,exact:tt};function I(ye,ue){return ye===ue?ye!==0||1/ye===1/ue:ye!==ye&&ue!==ue}function A(ye,ue){this.message=ye,this.data=ue&&typeof ue=="object"?ue:{},this.stack=""}A.prototype=Error.prototype;function F(ye){if(process.env.NODE_ENV!=="production")var ue={},ke=0;function je(Be,Ue,it,rt,st,Qe,ft){if(rt=rt||T,Qe=Qe||it,ft!==n){if(f){var Xe=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw Xe.name="Invariant Violation",Xe}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var It=rt+":"+it;!ue[It]&&ke<3&&(o("You are manually calling a React.PropTypes validation function for the `"+Qe+"` prop on `"+rt+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),ue[It]=!0,ke++)}}return Ue[it]==null?Be?Ue[it]===null?new A("The "+st+" `"+Qe+"` is marked as required "+("in `"+rt+"`, but its value is `null`.")):new A("The "+st+" `"+Qe+"` is marked as required in "+("`"+rt+"`, but its value is `undefined`.")):null:ye(Ue,it,rt,st,Qe)}var Ie=je.bind(null,!1);return Ie.isRequired=je.bind(null,!0),Ie}function R(ye){function ue(ke,je,Ie,Be,Ue,it){var rt=ke[je],st=_e(rt);if(st!==ye){var Qe=Re(rt);return new A("Invalid "+Be+" `"+Ue+"` of type "+("`"+Qe+"` supplied to `"+Ie+"`, expected ")+("`"+ye+"`."),{expectedType:ye})}return null}return F(ue)}function U(){return F(a)}function H(ye){function ue(ke,je,Ie,Be,Ue){if(typeof ye!="function")return new A("Property `"+Ue+"` of component `"+Ie+"` has invalid PropType notation inside arrayOf.");var it=ke[je];if(!Array.isArray(it)){var rt=_e(it);return new A("Invalid "+Be+" `"+Ue+"` of type "+("`"+rt+"` supplied to `"+Ie+"`, expected an array."))}for(var st=0;st<it.length;st++){var Qe=ye(it,st,Ie,Be,Ue+"["+st+"]",n);if(Qe instanceof Error)return Qe}return null}return F(ue)}function ne(){function ye(ue,ke,je,Ie,Be){var Ue=ue[ke];if(!c(Ue)){var it=_e(Ue);return new A("Invalid "+Ie+" `"+Be+"` of type "+("`"+it+"` supplied to `"+je+"`, expected a single ReactElement."))}return null}return F(ye)}function Z(){function ye(ue,ke,je,Ie,Be){var Ue=ue[ke];if(!t.isValidElementType(Ue)){var it=_e(Ue);return new A("Invalid "+Ie+" `"+Be+"` of type "+("`"+it+"` supplied to `"+je+"`, expected a single ReactElement type."))}return null}return F(ye)}function ce(ye){function ue(ke,je,Ie,Be,Ue){if(!(ke[je]instanceof ye)){var it=ye.name||T,rt=et(ke[je]);return new A("Invalid "+Be+" `"+Ue+"` of type "+("`"+rt+"` supplied to `"+Ie+"`, expected ")+("instance of `"+it+"`."))}return null}return F(ue)}function S(ye){if(!Array.isArray(ye))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),a;function ue(ke,je,Ie,Be,Ue){for(var it=ke[je],rt=0;rt<ye.length;rt++)if(I(it,ye[rt]))return null;var st=JSON.stringify(ye,function(ft,Xe){var It=Re(Xe);return It==="symbol"?String(Xe):Xe});return new A("Invalid "+Be+" `"+Ue+"` of value `"+String(it)+"` "+("supplied to `"+Ie+"`, expected one of "+st+"."))}return F(ue)}function re(ye){function ue(ke,je,Ie,Be,Ue){if(typeof ye!="function")return new A("Property `"+Ue+"` of component `"+Ie+"` has invalid PropType notation inside objectOf.");var it=ke[je],rt=_e(it);if(rt!=="object")return new A("Invalid "+Be+" `"+Ue+"` of type "+("`"+rt+"` supplied to `"+Ie+"`, expected an object."));for(var st in it)if(r(it,st)){var Qe=ye(it,st,Ie,Be,Ue+"."+st,n);if(Qe instanceof Error)return Qe}return null}return F(ue)}function ie(ye){if(!Array.isArray(ye))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var ue=0;ue<ye.length;ue++){var ke=ye[ue];if(typeof ke!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Ae(ke)+" at index "+ue+"."),a}function je(Ie,Be,Ue,it,rt){for(var st=[],Qe=0;Qe<ye.length;Qe++){var ft=ye[Qe],Xe=ft(Ie,Be,Ue,it,rt,n);if(Xe==null)return null;Xe.data&&r(Xe.data,"expectedType")&&st.push(Xe.data.expectedType)}var It=st.length>0?", expected one of type ["+st.join(", ")+"]":"";return new A("Invalid "+it+" `"+rt+"` supplied to "+("`"+Ue+"`"+It+"."))}return F(je)}function Pe(){function ye(ue,ke,je,Ie,Be){return nt(ue[ke])?null:new A("Invalid "+Ie+" `"+Be+"` supplied to "+("`"+je+"`, expected a ReactNode."))}return F(ye)}function Ke(ye,ue,ke,je,Ie){return new A((ye||"React class")+": "+ue+" type `"+ke+"."+je+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+Ie+"`.")}function $e(ye){function ue(ke,je,Ie,Be,Ue){var it=ke[je],rt=_e(it);if(rt!=="object")return new A("Invalid "+Be+" `"+Ue+"` of type `"+rt+"` "+("supplied to `"+Ie+"`, expected `object`."));for(var st in ye){var Qe=ye[st];if(typeof Qe!="function")return Ke(Ie,Be,Ue,st,Re(Qe));var ft=Qe(it,st,Ie,Be,Ue+"."+st,n);if(ft)return ft}return null}return F(ue)}function tt(ye){function ue(ke,je,Ie,Be,Ue){var it=ke[je],rt=_e(it);if(rt!=="object")return new A("Invalid "+Be+" `"+Ue+"` of type `"+rt+"` "+("supplied to `"+Ie+"`, expected `object`."));var st=e({},ke[je],ye);for(var Qe in st){var ft=ye[Qe];if(r(ye,Qe)&&typeof ft!="function")return Ke(Ie,Be,Ue,Qe,Re(ft));if(!ft)return new A("Invalid "+Be+" `"+Ue+"` key `"+Qe+"` supplied to `"+Ie+"`.\nBad object: "+JSON.stringify(ke[je],null," ")+`
|
|
31
|
-
Valid keys: `+JSON.stringify(Object.keys(ye),null," "));var Xe=ft(it,Qe,Ie,Be,Ue+"."+Qe,n);if(Xe)return Xe}return null}return F(ue)}function nt(ye){switch(typeof ye){case"number":case"string":case"undefined":return!0;case"boolean":return!ye;case"object":if(Array.isArray(ye))return ye.every(nt);if(ye===null||c(ye))return!0;var ue=g(ye);if(ue){var ke=ue.call(ye),je;if(ue!==ye.entries){for(;!(je=ke.next()).done;)if(!nt(je.value))return!1}else for(;!(je=ke.next()).done;){var Ie=je.value;if(Ie&&!nt(Ie[1]))return!1}}else return!1;return!0;default:return!1}}function ge(ye,ue){return ye==="symbol"?!0:ue?ue["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&ue instanceof Symbol:!1}function _e(ye){var ue=typeof ye;return Array.isArray(ye)?"array":ye instanceof RegExp?"object":ge(ue,ye)?"symbol":ue}function Re(ye){if(typeof ye>"u"||ye===null)return""+ye;var ue=_e(ye);if(ue==="object"){if(ye instanceof Date)return"date";if(ye instanceof RegExp)return"regexp"}return ue}function Ae(ye){var ue=Re(ye);switch(ue){case"array":case"object":return"an "+ue;case"boolean":case"date":case"regexp":return"a "+ue;default:return ue}}function et(ye){return!ye.constructor||!ye.constructor.name?T:ye.constructor.name}return E.checkPropTypes=i,E.resetWarningCache=i.resetWarningCache,E.PropTypes=E,E},xm}var Sm,k1;function B4(){if(k1)return Sm;k1=1;var t=lb();function e(){}function n(){}return n.resetWarningCache=e,Sm=function(){function r(a,c,f,p,y,g){if(g!==t){var T=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw T.name="Invariant Violation",T}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},Sm}if(process.env.NODE_ENV!=="production"){var $4=JD(),V4=!0;Av.exports=j4()($4.isElement,V4)}else Av.exports=B4()();var Er=Av.exports;const Rs=Eu(Er);var H4=function(e){var n=(e==null?void 0:e.ownerDocument)||document;return n.defaultView||window},U4=function(e,n){for(var r in e)if(!(r in n))return!0;for(var i in n)if(e[i]!==n[i])return!0;return!1},W4=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Fh="http://www.w3.org/2000/svg",D1="http://www.w3.org/1999/xlink",eg=function(t){function e(){for(var r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=t.call.apply(t,[this].concat(o))||this,r.initialState={hasError:!1,isLoading:!0},r.state=r.initialState,r._isMounted=!1,r.reactWrapper=void 0,r.nonReactWrapper=void 0,r.refCallback=function(c){r.reactWrapper=c},r}WT(e,t);var n=e.prototype;return n.renderSVG=function(){var i=this;if(this.reactWrapper instanceof H4(this.reactWrapper).Node){var o=this.props,a=o.desc,c=o.evalScripts,f=o.httpRequestWithCredentials,p=o.renumerateIRIElements,y=o.src,g=o.title,T=o.useRequestCache,E=this.props.onError,I=this.props.beforeInjection,A=this.props.afterInjection,F=this.props.wrapper,R,U;F==="svg"?(R=document.createElementNS(Fh,F),R.setAttribute("xmlns",Fh),R.setAttribute("xmlns:xlink",D1),U=document.createElementNS(Fh,F)):(R=document.createElement(F),U=document.createElement(F)),R.appendChild(U),U.dataset.src=y,this.nonReactWrapper=this.reactWrapper.appendChild(R);var H=function(S){if(i.removeSVG(),!i._isMounted){E(S);return}i.setState(function(){return{hasError:!0,isLoading:!1}},function(){E(S)})},ne=function(S,re){if(S){H(S);return}i._isMounted&&i.setState(function(){return{isLoading:!1}},function(){try{A(re)}catch(ie){H(ie)}})},Z=function(S){if(S.setAttribute("role","img"),a){var re=S.querySelector(":scope > desc");re&&S.removeChild(re);var ie=document.createElement("desc");ie.innerHTML=a,S.prepend(ie)}if(g){var Pe=S.querySelector(":scope > title");Pe&&S.removeChild(Pe);var Ke=document.createElement("title");Ke.innerHTML=g,S.prepend(Ke)}try{I(S)}catch($e){H($e)}};A4(U,{afterEach:ne,beforeEach:Z,cacheRequests:T,evalScripts:c,httpRequestWithCredentials:f,renumerateIRIElements:p})}},n.removeSVG=function(){var i;(i=this.nonReactWrapper)!=null&&i.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},n.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},n.componentDidUpdate=function(i){var o=this;U4(Df({},i),this.props)&&this.setState(function(){return o.initialState},function(){o.removeSVG(),o.renderSVG()})},n.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},n.render=function(){var i=this.props;i.afterInjection,i.beforeInjection,i.desc,i.evalScripts;var o=i.fallback;i.httpRequestWithCredentials;var a=i.loading;i.renumerateIRIElements,i.src,i.title,i.useRequestCache;var c=i.wrapper,f=qv(i,W4),p=c;return kn.createElement(p,Df({},f,{ref:this.refCallback},c==="svg"?{xmlns:Fh,xmlnsXlink:D1}:{}),this.state.isLoading&&a&&kn.createElement(a,null),this.state.hasError&&o&&kn.createElement(o,null))},e}(kn.Component);eg.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};eg.propTypes={afterInjection:Er.func,beforeInjection:Er.func,desc:Er.string,evalScripts:Er.oneOf(["always","once","never"]),fallback:Er.oneOfType([Er.func,Er.object,Er.string]),httpRequestWithCredentials:Er.bool,loading:Er.oneOfType([Er.func,Er.object,Er.string]),onError:Er.func,renumerateIRIElements:Er.bool,src:Er.string.isRequired,title:Er.string,useRequestCache:Er.bool,wrapper:Er.oneOf(["div","span","svg"])};const Af=new Map;Af.set("text",t=>{var e,n;return de.jsx("div",{style:{width:24,height:24,backgroundColor:"#dadada",borderRadius:"5px",display:"flex",justifyContent:"center",alignItems:"center",lineHeight:"24px"},children:(n=(e=t==null?void 0:t.name)==null?void 0:e.trim().at(0))==null?void 0:n.toUpperCase()})});Af.set("svgHtml",t=>{function e(n){function r(o){const c=new DOMParser().parseFromString(o,"image/svg+xml").querySelector("svg");return c?(c.querySelectorAll("path").forEach(p=>{p.hasAttribute("fill")&&p.setAttribute("fill","currentColor"),p.hasAttribute("stroke")&&p.setAttribute("stroke","currentColor")}),c.outerHTML):""}const i=r(n.svgString);return de.jsx("div",{dangerouslySetInnerHTML:{__html:i},style:{width:24,height:24,margin:"0 auto"}})}return de.jsx(e,{svgString:t.icon})});Af.set("svgHttp",t=>de.jsx(eg,{src:t.icon,beforeInjection:e=>{e.setAttribute("style","margin: 0 auto;"),e.querySelectorAll("path").forEach(r=>{r.hasAttribute("fill")&&r.setAttribute("fill","currentColor"),r.hasAttribute("stroke")&&r.setAttribute("stroke","currentColor")})}}));Af.set("img",t=>de.jsx("img",{src:t.icon||"/",alt:t.name,style:{height:24,maxHeight:24,maxWidth:24}}));function z4(t){return t.icon=(t.icon||"").trim(),t.icon?t.icon.startsWith("<svg")?"svgHtml":t.icon.endsWith(".svg")?"svgHttp":"img":"text"}function e_({item:t}){return(Af.get(z4(t))||Af.get("text"))(t)}function Y4(t){return de.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...t,children:de.jsx("path",{fill:"currenColor",d:"M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"})})}function G4(t){const{renderChildren:e,parentRef:n,onlyChild:r,dropdownLevel:i}=t,[o,a]=z.useState({top:0,left:0}),c=z.useRef(null),[f,p]=z.useState("auto"),y=typeof window<"u"&&Number(getComputedStyle(document.documentElement).getPropertyValue("--menu-z-index").trim())||1304;return z.useLayoutEffect(()=>{if(n.current&&c.current){const g=n.current.getBoundingClientRect(),T=c.current.getBoundingClientRect();let E,I;if(i===1)E=g.bottom,I=g.left,T.height+E>window.innerHeight?(p(window.innerHeight-E-50),E=g.bottom-T.height):E=g.bottom;else if(i>1){E=g.top,I=g.left+g.width;const A=T.height+(window.innerHeight-g.top)>window.innerHeight;A&&(console.log("DropDown-fav overtop"),p(window.innerHeight-g.top-50)),g.top+T.height>window.innerHeight&&!A&&(E=g.top-T.height+g.height)}a({top:E-64,left:I})}},[n,c,i]),r?e({maxHeight:f}):zv.createPortal(de.jsx("div",{ref:c,style:{position:"fixed",top:o.top,left:`calc(${o.left}px - var(--global-menu-width))`,zIndex:y+2},children:e({maxHeight:f})}),n.current)}const Mf=new Map;Mf.set("text",t=>{var e,n;return de.jsx("div",{style:{width:24,height:24,backgroundColor:"#dadada",borderRadius:"5px",display:"flex",justifyContent:"center",alignItems:"center",lineHeight:"24px"},children:(n=(e=t==null?void 0:t.name)==null?void 0:e.trim().at(0))==null?void 0:n.toUpperCase()})});Mf.set("svgHtml",t=>{function e(n){function r(o){const c=new DOMParser().parseFromString(o,"image/svg+xml").querySelector("svg");return c?(c.querySelectorAll("path").forEach(p=>{p.hasAttribute("fill")&&p.setAttribute("fill","currentColor"),p.hasAttribute("stroke")&&p.setAttribute("stroke","currentColor")}),c.outerHTML):""}const i=r(n.svgString);return de.jsx("div",{dangerouslySetInnerHTML:{__html:i},style:{width:24,height:24,margin:"0 auto"}})}return de.jsx(e,{svgString:t.icon})});Mf.set("svgHttp",t=>de.jsx(eg,{src:t.icon,beforeInjection:e=>{e.setAttribute("style","margin: 0 auto;"),e.querySelectorAll("path").forEach(r=>{r.hasAttribute("fill")&&r.setAttribute("fill","currentColor"),r.hasAttribute("stroke")&&r.setAttribute("stroke","currentColor")})}}));Mf.set("img",t=>de.jsx("img",{src:t.icon||"/",alt:t.name,style:{height:24,maxHeight:24,maxWidth:24}}));function q4(t){return t.icon=(t.icon||"").trim(),t.icon?t.icon.startsWith("<svg")?"svgHtml":t.icon.endsWith(".svg")?"svgHttp":"img":"text"}function X4({item:t}){return(Mf.get(q4(t))||Mf.get("text"))(t)}function t_({...t}){var ge,_e,Re;const e=t.item,n=t.level||0,r=!!((ge=t.item.children)!=null&&ge.length),i=`level-${n}`,o=(Ae,et=i)=>`${Ae} ${et} `,[a,c]=z.useState(!1),[f,p]=z.useState(e.isFavorite||!1),[y,g]=z.useState(window.innerWidth<600),[T,E]=z.useState(!1);z.useEffect(()=>{const Ae=()=>{g(window.innerWidth<600)};return window.addEventListener("resize",Ae),()=>window.removeEventListener("resize",Ae)},[]);const I=z.useRef(),A=z.useRef();A!=null&&A.current&&((_e=A==null?void 0:A.current)==null?void 0:_e.scrollWidth)>((Re=A==null?void 0:A.current)==null?void 0:Re.clientWidth);const F=window.location.origin,R=e.path&&e.path.includes("http")?new URL(e.path):{origin:"",pathname:""},U=window.location.pathname.split("/")[1],H=R.pathname.split("/")[1],ne=t.ssr||!F.includes("local")&&F!==R.origin||H!==U,Z=r||n===0?"div":t.item.redirectUrl?Pd.Link:ne?"a":Pd.Link,ce=e.redirectUrl||(e.path&&e.path.includes("http")?new URL(e.path).pathname:e.path)||"#",S=n+1,re=r&&a&&n>0,ie=()=>{t.isDrop||c(!0)},Pe=()=>{c(!1)},Ke="/global-menu-config/api/v1/menu-items/user/set-favorite",$e=Ae=>{Ae.stopPropagation()},tt=F!==R.origin||t.item.redirectUrl?"_blank":"_self",nt=Object.entries(t.brandColors||{}).reduce((Ae,[et,ye])=>(ye&&(Ae[`--${et}`]=ye),Ae),{});return de.jsxs("div",{ref:I,className:o("menu-item__wrapper tree-node"),style:{borderRadius:"8px",transition:"all 0.3s",...nt},onMouseOver:ie,onMouseOut:Pe,onDragStart:Ae=>{n>1&&Ae.preventDefault(),c(!1)},onDragEnd:()=>{console.log("drag end 1223"),c(!1)},children:[de.jsxs(Z,{target:tt,to:ce,draggable:"true",className:o("menu-item__link"),style:{width:"100%",transition:"all 0.3s"},onClick:Ae=>{var et,ye;if(!(Z==="a"&&tt==="_blank")){if(r&&y){E(!T),Ae.preventDefault();return}!r&&e.path&&((et=t.onClickItem)==null||et.call(t,e),$e(Ae)),ce!=="#"&&((ye=t.onClick)==null||ye.call(t,e),$e(Ae))}},onDragStart:Ae=>{console.log("onDragStart component",Ae.target)},onDragEnd:()=>{console.log("onDragEnd menu item"),c(!1)},children:[de.jsx(K4,{cls:o,item:e}),de.jsx("span",{className:o("menu-item__label"),ref:A,children:e.name}),de.jsx(Z4,{menuLevel:n,hasChildren:r,isHovered:a,isFavorite:f,onClick:Ae=>{const et={menuConfigId:e.id,isFavorite:Ae},ye=t.baseUrl+Ke;As.post(ye,et).then(ue=>{var ke;p(Ae),Qv(Dr("components.menu.pushSuccess.menuSuccess",{defaultValue:"Set favorite menu item successful"})),(ke=t.onSetFavoriteSuccess)==null||ke.call(t,t.item.id,Ae)}).catch(ue=>{var ke,je;console.log(" MenuItem.tsx ~ error:",ue),Gd(((je=(ke=ue.response)==null?void 0:ke.data)==null?void 0:je.errorMessage)||ue.message||Dr("components.menu.pushError.menuError",{defaultValue:"Have error when set favorite menu item"}))})}}),r&&de.jsx("div",{className:o("menu-item__icon-arrow__wrapper"),children:de.jsx(Y4,{className:o("menu-item__icon-arrow__icon")})})]}),re&&de.jsx(G4,{parentRef:I,onlyChild:S<2,dropdownLevel:n,renderChildren:({maxHeight:Ae})=>{var et;return de.jsx(GD.div,{className:o("menu-item__dropdown dropdown-favorite ? 'menu-item__dropdown--open' : 'menu-item__dropdown--close'}",`level-${S}`),style:ab({maxHeight:Ae,overflowY:"auto",paddingRight:3},Ae!=="auto"&&!!S),children:(et=e.children)==null?void 0:et.map(ye=>z.createElement(t_,{...t,key:ye.id,item:ye,level:S,onClickItem:t.onClickItem}))})}})]})}function K4({item:t,cls:e}){return de.jsx("div",{className:e("menu-item__icon"),children:de.jsx(X4,{item:t})})}function Z4(t){const[e,n]=z.useState(window.innerWidth<600);z.useEffect(()=>{const o=()=>{n(window.innerWidth<600)};return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]);const r={marginRight:t.hasChildren?10:0,fontSize:22,fill:mr.warning,minWidth:16},i=e||t.isHovered;if(t.menuLevel!==0)return de.jsxs(de.Fragment,{children:[i&&!t.isFavorite&&de.jsx(aa.Tooltip,{title:"Add to favorites",children:de.jsx(qD,{style:r,onClick:o=>{var a;o.preventDefault(),o.stopPropagation(),(a=t.onClick)==null||a.call(t,!0)}})}),t.isFavorite&&de.jsx(aa.Tooltip,{title:"Remove from favorites",children:de.jsx(XD,{style:r,onClick:o=>{var a;o.preventDefault(),o.stopPropagation(),(a=t.onClick)==null||a.call(t,!1)}})})]})}const J4='.flex-col-center{display:flex;flex-direction:column;justify-content:center}.wrap-section{transition:all .3s;padding:0 4px}.favorite-menu{display:flex;height:56px;border-right:1px solid #ddd;background-color:#fafafa;transition:height .3s cubic-bezier(.4,0,.2,1),background .2s,border .2s;width:100%}.favorite-menu.favorite-menu--empty{height:0!important;overflow:hidden;border-right:none;background:transparent}.scrollbar-hidden::-webkit-scrollbar{width:2px;background:transparent}.favorite-menu__wrap-btn-logout,.favorite-menu__btn-logout{margin:40px 0}.favorite-menu__logout-btn__text{margin-left:12px;font-size:.875rem;opacity:0;transition:ease-in-out .2s;transition-delay:.15s}.favorite-menu__wrapper-toggle-btn{display:flex;flex-direction:row;justify-content:flex-end;transition:all .3s;margin-right:-8px;margin-top:40px;justify-content:center;width:100%}.favorite-menu__toggle-btn{margin-top:-6px;color:#85858a}.favorite-menu__logout-btn{width:100%;text-align:left;display:flex;flex-direction:row;align-items:center;padding:8px 16px 8px 18.6665px;min-height:48px;border-radius:.375rem;overflow:hidden;transition:all .3s ease-in-out;background-color:initial}.favorite-menu__logout-btn:hover{background-color:#919eab14}.favorite-menu__icon-logout{flex-shrink:0}.menu-item__wrapper{display:flex;position:relative;width:100%}.menu-item__link{display:flex;flex-direction:row;border-radius:.375rem;align-items:center;padding:.5rem;position:relative;height:48px;cursor:pointer}.menu-item__link:hover{background-color:#919eab14}.menu-item__link.active{background-color:#009d4f1a;color:inherit}.menu-item__link.active.level-2,.menu-item__link.active.level-3,.menu-item__link.active.level-4,.menu-item__link.active.level-5,.menu-item__link.active.level-6,.menu-item__link.active.level-7,.menu-item__link.active.level-8,.menu-item__link.active.level-9,.menu-item__link.active.level-10{background-color:inherit;color:inherit}.menu-item__link.active.level-2:hover,.menu-item__link.active.level-3:hover,.menu-item__link.active.level-4:hover,.menu-item__link.active.level-5:hover,.menu-item__link.active.level-6:hover,.menu-item__link.active.level-7:hover,.menu-item__link.active.level-8:hover,.menu-item__link.active.level-9:hover,.menu-item__link.active.level-10:hover{background-color:#919eab14}.menu-item__link.menu-item__link.level-0{padding:0;background-color:#919eab14;transition:all .15s}.menu-item__icon{width:1.5rem;height:1.5rem;flex-shrink:0;display:grid;place-items:center}.menu-item__icon.level-1>*{margin:0 auto}.menu-item__label{font-size:.875rem;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%;flex-shrink:1;margin-left:12px;padding-right:12px;color:#292929;opacity:1}.menu-item__label.level-1{text-overflow:unset}.menu-item__label.active{color:inherit}.menu-item__label{margin-left:8px;font-size:.75rem;line-height:1rem}.menu-item__label.level-0,.menu-item__label.level-1{font-size:.875rem;transition-delay:.15s}.menu-item__label.level-0{margin-left:8px}.menu-item__icon-arrow__wrapper{display:grid;place-items:center;position:absolute;top:50%;transform:translateY(-50%);right:0}.menu-item__icon-arrow__icon{transition:all .3s!important;transform:rotate(-90deg)!important}.menu-item__icon-arrow__icon.active{color:inherit}.menu-item__icon-arrow__icon.open{transform:rotate(0)!important}.menu-item__dropdown{background-color:#fafafa;border:1px solid #ddd;box-shadow:#0000001a 0 10px 15px -3px,#0000000d 0 4px 6px -2px;border-radius:4px;width:210px;max-width:210px;padding:4px;z-index:1200}.menu-item__dropdown.dropdown-favorite{width:auto;min-width:180px;max-width:350px}.menu-item__dropdown::-webkit-scrollbar{width:4px}.menu-item__dropdown::-webkit-scrollbar-thumb{background-color:#9b9b9b99;border-radius:2px}.menu-item__dropdown,.menu-item__dropdown>*{margin-top:4px}.menu-item__dropdown:first-of-type{margin-top:0}.menu-item__dropdown>*:first-child{margin-top:0}.menu-item__dropdown .menu-item__link{height:40px}.menu-item__dropdown .menu-item__link.level-1{height:48px}.menu-item__dropdown.level-1{width:auto;max-width:unset;box-shadow:none;border:none;padding:0;background-color:unset}.icon-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px;border-radius:50%;background-color:transparent;transition:background-color .3s ease;border:none}.icon-btn:hover{background-color:var(--btn-bg-hover)}.simplebar-scrollbar:before{background-color:#0000002d}.favorite-menu__menu .simplebar-track.simplebar-vertical{display:none}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.treeFavorited{display:flex;align-items:center;margin:0 -5px}.treeFavorited li{margin:0 5px}.item.hover-on:before{content:"";position:absolute;top:0;left:0;height:100%;width:2px;background-color:var(--primary300)}.simplebar-placeholder{width:auto!important}@media (min-width: 600px){.menu-item__label.level-0,.menu-item__link{color:#85858a}.menu-item__icon-arrow__wrapper.level-0{display:none}}@media (max-width: 599px){.menu-item__label.active{color:inherit}.menu-item__label.level-0{margin-left:8px;font-weight:500;font-size:.951rem}.menu-item__icon{width:1.5rem;height:1.5rem;flex-shrink:0;display:grid;place-items:center;color:#85858a}.menu-item__wrapper{display:flex;flex-direction:column;position:relative;width:100%;color:#292929!important}.menu-item__link.expanded.level-0{padding:.5rem 10px}.menu-item__link.active{background-color:#009d4f1a;color:inherit}.menu-item__link.active.level-0,.menu-item__link.active.level-1,.menu-item__link.active.level-2,.menu-item__link.active.level-3,.menu-item__link.active.level-4,.menu-item__link.active.level-5,.menu-item__link.active.level-6,.menu-item__link.active.level-7,.menu-item__link.active.level-8,.menu-item__link.active.level-9{background-color:inherit;color:inherit}.menu-item__link.active.level-1:hover,.menu-item__link.active.level-2:hover,.menu-item__link.active.level-3:hover,.menu-item__link.active.level-4:hover,.menu-item__link.active.level-5:hover,.menu-item__link.active.level-6:hover,.menu-item__link.active.level-7:hover,.menu-item__link.active.level-8:hover,.menu-item__link.active.level-9:hover,.menu-item__link.active.level-0:hover{background-color:#919eab14}.menu-item__link.level-0{transition:padding .2s}.menu-item__icon-arrow__wrapper{display:grid;place-items:center;position:absolute;top:50%;transform:translateY(-50%);right:0}.menu-item__icon-arrow__wrapper.expanded{right:4px}.menu-item__icon-arrow__icon{transition:transform .3s!important;transform:rotate(-90deg)!important}.menu-item__icon-arrow__icon.active{color:inherit}.menu-item__icon-arrow__icon.expanded.open{transform:rotate(0)!important}.menu-item__dropdown::-webkit-scrollbar{width:4px}.menu-item__dropdown::-webkit-scrollbar-thumb{background-color:#9b9b9b99;border-radius:2px}.menu-item__dropdown,.menu-item__dropdown>*{margin-top:4px}.menu-item__dropdown.expanded.menu-item__dropdown--close{margin-top:0;transition:margin-top .3s}.menu-item__dropdown:first-of-type{margin-top:0}.menu-item__dropdown>*:first-child{margin-top:0}.menu-item__dropdown.expanded{overflow:hidden}.icon-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px;border-radius:50%;background-color:transparent;transition:background-color .3s ease;border:none}.icon-btn:hover{background-color:var(--btn-bg-hover)}.simplebar-scrollbar:before{background-color:#0000002d}}';var uc={};/**
|
|
31
|
+
Valid keys: `+JSON.stringify(Object.keys(ye),null," "));var Xe=ft(it,Qe,Ie,Be,Ue+"."+Qe,n);if(Xe)return Xe}return null}return F(ue)}function nt(ye){switch(typeof ye){case"number":case"string":case"undefined":return!0;case"boolean":return!ye;case"object":if(Array.isArray(ye))return ye.every(nt);if(ye===null||c(ye))return!0;var ue=g(ye);if(ue){var ke=ue.call(ye),je;if(ue!==ye.entries){for(;!(je=ke.next()).done;)if(!nt(je.value))return!1}else for(;!(je=ke.next()).done;){var Ie=je.value;if(Ie&&!nt(Ie[1]))return!1}}else return!1;return!0;default:return!1}}function ge(ye,ue){return ye==="symbol"?!0:ue?ue["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&ue instanceof Symbol:!1}function _e(ye){var ue=typeof ye;return Array.isArray(ye)?"array":ye instanceof RegExp?"object":ge(ue,ye)?"symbol":ue}function Re(ye){if(typeof ye>"u"||ye===null)return""+ye;var ue=_e(ye);if(ue==="object"){if(ye instanceof Date)return"date";if(ye instanceof RegExp)return"regexp"}return ue}function Ae(ye){var ue=Re(ye);switch(ue){case"array":case"object":return"an "+ue;case"boolean":case"date":case"regexp":return"a "+ue;default:return ue}}function et(ye){return!ye.constructor||!ye.constructor.name?T:ye.constructor.name}return E.checkPropTypes=i,E.resetWarningCache=i.resetWarningCache,E.PropTypes=E,E},xm}var Sm,k1;function B4(){if(k1)return Sm;k1=1;var t=lb();function e(){}function n(){}return n.resetWarningCache=e,Sm=function(){function r(a,c,f,p,y,g){if(g!==t){var T=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw T.name="Invariant Violation",T}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},Sm}if(process.env.NODE_ENV!=="production"){var $4=JD(),V4=!0;Av.exports=j4()($4.isElement,V4)}else Av.exports=B4()();var Er=Av.exports;const Rs=Eu(Er);var H4=function(e){var n=(e==null?void 0:e.ownerDocument)||document;return n.defaultView||window},U4=function(e,n){for(var r in e)if(!(r in n))return!0;for(var i in n)if(e[i]!==n[i])return!0;return!1},W4=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Fh="http://www.w3.org/2000/svg",D1="http://www.w3.org/1999/xlink",eg=function(t){function e(){for(var r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=t.call.apply(t,[this].concat(o))||this,r.initialState={hasError:!1,isLoading:!0},r.state=r.initialState,r._isMounted=!1,r.reactWrapper=void 0,r.nonReactWrapper=void 0,r.refCallback=function(c){r.reactWrapper=c},r}WT(e,t);var n=e.prototype;return n.renderSVG=function(){var i=this;if(this.reactWrapper instanceof H4(this.reactWrapper).Node){var o=this.props,a=o.desc,c=o.evalScripts,f=o.httpRequestWithCredentials,p=o.renumerateIRIElements,y=o.src,g=o.title,T=o.useRequestCache,E=this.props.onError,I=this.props.beforeInjection,A=this.props.afterInjection,F=this.props.wrapper,R,U;F==="svg"?(R=document.createElementNS(Fh,F),R.setAttribute("xmlns",Fh),R.setAttribute("xmlns:xlink",D1),U=document.createElementNS(Fh,F)):(R=document.createElement(F),U=document.createElement(F)),R.appendChild(U),U.dataset.src=y,this.nonReactWrapper=this.reactWrapper.appendChild(R);var H=function(S){if(i.removeSVG(),!i._isMounted){E(S);return}i.setState(function(){return{hasError:!0,isLoading:!1}},function(){E(S)})},ne=function(S,re){if(S){H(S);return}i._isMounted&&i.setState(function(){return{isLoading:!1}},function(){try{A(re)}catch(ie){H(ie)}})},Z=function(S){if(S.setAttribute("role","img"),a){var re=S.querySelector(":scope > desc");re&&S.removeChild(re);var ie=document.createElement("desc");ie.innerHTML=a,S.prepend(ie)}if(g){var Pe=S.querySelector(":scope > title");Pe&&S.removeChild(Pe);var Ke=document.createElement("title");Ke.innerHTML=g,S.prepend(Ke)}try{I(S)}catch($e){H($e)}};A4(U,{afterEach:ne,beforeEach:Z,cacheRequests:T,evalScripts:c,httpRequestWithCredentials:f,renumerateIRIElements:p})}},n.removeSVG=function(){var i;(i=this.nonReactWrapper)!=null&&i.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},n.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},n.componentDidUpdate=function(i){var o=this;U4(Df({},i),this.props)&&this.setState(function(){return o.initialState},function(){o.removeSVG(),o.renderSVG()})},n.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},n.render=function(){var i=this.props;i.afterInjection,i.beforeInjection,i.desc,i.evalScripts;var o=i.fallback;i.httpRequestWithCredentials;var a=i.loading;i.renumerateIRIElements,i.src,i.title,i.useRequestCache;var c=i.wrapper,f=qv(i,W4),p=c;return kn.createElement(p,Df({},f,{ref:this.refCallback},c==="svg"?{xmlns:Fh,xmlnsXlink:D1}:{}),this.state.isLoading&&a&&kn.createElement(a,null),this.state.hasError&&o&&kn.createElement(o,null))},e}(kn.Component);eg.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};eg.propTypes={afterInjection:Er.func,beforeInjection:Er.func,desc:Er.string,evalScripts:Er.oneOf(["always","once","never"]),fallback:Er.oneOfType([Er.func,Er.object,Er.string]),httpRequestWithCredentials:Er.bool,loading:Er.oneOfType([Er.func,Er.object,Er.string]),onError:Er.func,renumerateIRIElements:Er.bool,src:Er.string.isRequired,title:Er.string,useRequestCache:Er.bool,wrapper:Er.oneOf(["div","span","svg"])};const Af=new Map;Af.set("text",t=>{var e,n;return de.jsx("div",{style:{width:24,height:24,backgroundColor:"#dadada",borderRadius:"5px",display:"flex",justifyContent:"center",alignItems:"center",lineHeight:"24px"},children:(n=(e=t==null?void 0:t.name)==null?void 0:e.trim().at(0))==null?void 0:n.toUpperCase()})});Af.set("svgHtml",t=>{function e(n){function r(o){const c=new DOMParser().parseFromString(o,"image/svg+xml").querySelector("svg");return c?(c.querySelectorAll("path").forEach(p=>{p.hasAttribute("fill")&&p.setAttribute("fill","currentColor"),p.hasAttribute("stroke")&&p.setAttribute("stroke","currentColor")}),c.outerHTML):""}const i=r(n.svgString);return de.jsx("div",{dangerouslySetInnerHTML:{__html:i},style:{width:24,height:24,margin:"0 auto"}})}return de.jsx(e,{svgString:t.icon})});Af.set("svgHttp",t=>de.jsx(eg,{src:t.icon,beforeInjection:e=>{e.setAttribute("style","margin: 0 auto;"),e.querySelectorAll("path").forEach(r=>{r.hasAttribute("fill")&&r.setAttribute("fill","currentColor"),r.hasAttribute("stroke")&&r.setAttribute("stroke","currentColor")})}}));Af.set("img",t=>de.jsx("img",{src:t.icon||"/",alt:t.name,style:{height:24,maxHeight:24,maxWidth:24}}));function z4(t){return t.icon=(t.icon||"").trim(),t.icon?t.icon.startsWith("<svg")?"svgHtml":t.icon.endsWith(".svg")?"svgHttp":"img":"text"}function e_({item:t}){return(Af.get(z4(t))||Af.get("text"))(t)}function Y4(t){return de.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...t,children:de.jsx("path",{fill:"currenColor",d:"M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"})})}function G4(t){const{renderChildren:e,parentRef:n,onlyChild:r,dropdownLevel:i}=t,[o,a]=z.useState({top:0,left:0}),c=z.useRef(null),[f,p]=z.useState("auto"),y=typeof window<"u"&&Number(getComputedStyle(document.documentElement).getPropertyValue("--menu-z-index").trim())||1304;return z.useLayoutEffect(()=>{if(n.current&&c.current){const g=n.current.getBoundingClientRect(),T=c.current.getBoundingClientRect();let E,I;if(i===1)E=g.bottom,I=g.left,T.height+E>window.innerHeight?(p(window.innerHeight-E-50),E=g.bottom-T.height):E=g.bottom;else if(i>1){E=g.top,I=g.left+g.width;const A=T.height+(window.innerHeight-g.top)>window.innerHeight;A&&(console.log("DropDown-fav overtop"),p(window.innerHeight-g.top-50)),g.top+T.height>window.innerHeight&&!A&&(E=g.top-T.height+g.height)}a({top:E-64,left:I})}},[n,c,i]),r?e({maxHeight:f}):zv.createPortal(de.jsx("div",{ref:c,style:{position:"fixed",top:o.top,left:`calc(${o.left}px - var(--global-menu-width))`,zIndex:y+2},children:e({maxHeight:f})}),document.body)}const Mf=new Map;Mf.set("text",t=>{var e,n;return de.jsx("div",{style:{width:24,height:24,backgroundColor:"#dadada",borderRadius:"5px",display:"flex",justifyContent:"center",alignItems:"center",lineHeight:"24px"},children:(n=(e=t==null?void 0:t.name)==null?void 0:e.trim().at(0))==null?void 0:n.toUpperCase()})});Mf.set("svgHtml",t=>{function e(n){function r(o){const c=new DOMParser().parseFromString(o,"image/svg+xml").querySelector("svg");return c?(c.querySelectorAll("path").forEach(p=>{p.hasAttribute("fill")&&p.setAttribute("fill","currentColor"),p.hasAttribute("stroke")&&p.setAttribute("stroke","currentColor")}),c.outerHTML):""}const i=r(n.svgString);return de.jsx("div",{dangerouslySetInnerHTML:{__html:i},style:{width:24,height:24,margin:"0 auto"}})}return de.jsx(e,{svgString:t.icon})});Mf.set("svgHttp",t=>de.jsx(eg,{src:t.icon,beforeInjection:e=>{e.setAttribute("style","margin: 0 auto;"),e.querySelectorAll("path").forEach(r=>{r.hasAttribute("fill")&&r.setAttribute("fill","currentColor"),r.hasAttribute("stroke")&&r.setAttribute("stroke","currentColor")})}}));Mf.set("img",t=>de.jsx("img",{src:t.icon||"/",alt:t.name,style:{height:24,maxHeight:24,maxWidth:24}}));function q4(t){return t.icon=(t.icon||"").trim(),t.icon?t.icon.startsWith("<svg")?"svgHtml":t.icon.endsWith(".svg")?"svgHttp":"img":"text"}function X4({item:t}){return(Mf.get(q4(t))||Mf.get("text"))(t)}function t_({...t}){var ge,_e,Re;const e=t.item,n=t.level||0,r=!!((ge=t.item.children)!=null&&ge.length),i=`level-${n}`,o=(Ae,et=i)=>`${Ae} ${et} `,[a,c]=z.useState(!1),[f,p]=z.useState(e.isFavorite||!1),[y,g]=z.useState(window.innerWidth<600),[T,E]=z.useState(!1);z.useEffect(()=>{const Ae=()=>{g(window.innerWidth<600)};return window.addEventListener("resize",Ae),()=>window.removeEventListener("resize",Ae)},[]);const I=z.useRef(),A=z.useRef();A!=null&&A.current&&((_e=A==null?void 0:A.current)==null?void 0:_e.scrollWidth)>((Re=A==null?void 0:A.current)==null?void 0:Re.clientWidth);const F=window.location.origin,R=e.path&&e.path.includes("http")?new URL(e.path):{origin:"",pathname:""},U=window.location.pathname.split("/")[1],H=R.pathname.split("/")[1],ne=t.ssr||!F.includes("local")&&F!==R.origin||H!==U,Z=r||n===0?"div":t.item.redirectUrl?Pd.Link:ne?"a":Pd.Link,ce=e.redirectUrl||(e.path&&e.path.includes("http")?new URL(e.path).pathname:e.path)||"#",S=n+1,re=r&&a&&n>0,ie=()=>{t.isDrop||c(!0)},Pe=()=>{c(!1)},Ke="/global-menu-config/api/v1/menu-items/user/set-favorite",$e=Ae=>{Ae.stopPropagation()},tt=F!==R.origin||t.item.redirectUrl?"_blank":"_self",nt=Object.entries(t.brandColors||{}).reduce((Ae,[et,ye])=>(ye&&(Ae[`--${et}`]=ye),Ae),{});return de.jsxs("div",{ref:I,className:o("menu-item__wrapper tree-node"),style:{borderRadius:"8px",transition:"all 0.3s",...nt},onMouseOver:ie,onMouseOut:Pe,onDragStart:Ae=>{n>1&&Ae.preventDefault(),c(!1)},onDragEnd:()=>{console.log("drag end 1223"),c(!1)},children:[de.jsxs(Z,{target:tt,to:ce,draggable:"true",className:o("menu-item__link"),style:{width:"100%",transition:"all 0.3s"},onClick:Ae=>{var et,ye;if(!(Z==="a"&&tt==="_blank")){if(r&&y){E(!T),Ae.preventDefault();return}!r&&e.path&&((et=t.onClickItem)==null||et.call(t,e),$e(Ae)),ce!=="#"&&((ye=t.onClick)==null||ye.call(t,e),$e(Ae))}},onDragStart:Ae=>{console.log("onDragStart component",Ae.target)},onDragEnd:()=>{console.log("onDragEnd menu item"),c(!1)},children:[de.jsx(K4,{cls:o,item:e}),de.jsx("span",{className:o("menu-item__label"),ref:A,children:e.name}),de.jsx(Z4,{menuLevel:n,hasChildren:r,isHovered:a,isFavorite:f,onClick:Ae=>{const et={menuConfigId:e.id,isFavorite:Ae},ye=t.baseUrl+Ke;As.post(ye,et).then(ue=>{var ke;p(Ae),Qv(Dr("components.menu.pushSuccess.menuSuccess",{defaultValue:"Set favorite menu item successful"})),(ke=t.onSetFavoriteSuccess)==null||ke.call(t,t.item.id,Ae)}).catch(ue=>{var ke,je;console.log(" MenuItem.tsx ~ error:",ue),Gd(((je=(ke=ue.response)==null?void 0:ke.data)==null?void 0:je.errorMessage)||ue.message||Dr("components.menu.pushError.menuError",{defaultValue:"Have error when set favorite menu item"}))})}}),r&&de.jsx("div",{className:o("menu-item__icon-arrow__wrapper"),children:de.jsx(Y4,{className:o("menu-item__icon-arrow__icon")})})]}),re&&de.jsx(G4,{parentRef:I,onlyChild:S<2,dropdownLevel:n,renderChildren:({maxHeight:Ae})=>{var et;return de.jsx(GD.div,{className:o("menu-item__dropdown dropdown-favorite ? 'menu-item__dropdown--open' : 'menu-item__dropdown--close'}",`level-${S}`),style:ab({maxHeight:Ae,overflowY:"auto",paddingRight:3},Ae!=="auto"&&!!S),children:(et=e.children)==null?void 0:et.map(ye=>z.createElement(t_,{...t,key:ye.id,item:ye,level:S,onClickItem:t.onClickItem}))})}})]})}function K4({item:t,cls:e}){return de.jsx("div",{className:e("menu-item__icon"),children:de.jsx(X4,{item:t})})}function Z4(t){const[e,n]=z.useState(window.innerWidth<600);z.useEffect(()=>{const o=()=>{n(window.innerWidth<600)};return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]);const r={marginRight:t.hasChildren?10:0,fontSize:22,fill:mr.warning,minWidth:16},i=e||t.isHovered;if(t.menuLevel!==0)return de.jsxs(de.Fragment,{children:[i&&!t.isFavorite&&de.jsx(aa.Tooltip,{title:"Add to favorites",children:de.jsx(qD,{style:r,onClick:o=>{var a;o.preventDefault(),o.stopPropagation(),(a=t.onClick)==null||a.call(t,!0)}})}),t.isFavorite&&de.jsx(aa.Tooltip,{title:"Remove from favorites",children:de.jsx(XD,{style:r,onClick:o=>{var a;o.preventDefault(),o.stopPropagation(),(a=t.onClick)==null||a.call(t,!1)}})})]})}const J4='.flex-col-center{display:flex;flex-direction:column;justify-content:center}.wrap-section{transition:all .3s;padding:0 4px}.favorite-menu{display:flex;height:56px;border-right:1px solid #ddd;background-color:#fafafa;transition:height .3s cubic-bezier(.4,0,.2,1),background .2s,border .2s;width:100%}.favorite-menu.favorite-menu--empty{height:0!important;overflow:hidden;border-right:none;background:transparent}.scrollbar-hidden::-webkit-scrollbar{width:2px;background:transparent}.favorite-menu__wrap-btn-logout,.favorite-menu__btn-logout{margin:40px 0}.favorite-menu__logout-btn__text{margin-left:12px;font-size:.875rem;opacity:0;transition:ease-in-out .2s;transition-delay:.15s}.favorite-menu__wrapper-toggle-btn{display:flex;flex-direction:row;justify-content:flex-end;transition:all .3s;margin-right:-8px;margin-top:40px;justify-content:center;width:100%}.favorite-menu__toggle-btn{margin-top:-6px;color:#85858a}.favorite-menu__logout-btn{width:100%;text-align:left;display:flex;flex-direction:row;align-items:center;padding:8px 16px 8px 18.6665px;min-height:48px;border-radius:.375rem;overflow:hidden;transition:all .3s ease-in-out;background-color:initial}.favorite-menu__logout-btn:hover{background-color:#919eab14}.favorite-menu__icon-logout{flex-shrink:0}.menu-item__wrapper{display:flex;position:relative;width:100%}.menu-item__link{display:flex;flex-direction:row;border-radius:.375rem;align-items:center;padding:.5rem;position:relative;height:48px;cursor:pointer}.menu-item__link:hover{background-color:#919eab14}.menu-item__link.active{background-color:#009d4f1a;color:inherit}.menu-item__link.active.level-2,.menu-item__link.active.level-3,.menu-item__link.active.level-4,.menu-item__link.active.level-5,.menu-item__link.active.level-6,.menu-item__link.active.level-7,.menu-item__link.active.level-8,.menu-item__link.active.level-9,.menu-item__link.active.level-10{background-color:inherit;color:inherit}.menu-item__link.active.level-2:hover,.menu-item__link.active.level-3:hover,.menu-item__link.active.level-4:hover,.menu-item__link.active.level-5:hover,.menu-item__link.active.level-6:hover,.menu-item__link.active.level-7:hover,.menu-item__link.active.level-8:hover,.menu-item__link.active.level-9:hover,.menu-item__link.active.level-10:hover{background-color:#919eab14}.menu-item__link.menu-item__link.level-0{padding:0;background-color:#919eab14;transition:all .15s}.menu-item__icon{width:1.5rem;height:1.5rem;flex-shrink:0;display:grid;place-items:center}.menu-item__icon.level-1>*{margin:0 auto}.menu-item__label{font-size:.875rem;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%;flex-shrink:1;margin-left:12px;padding-right:12px;color:#292929;opacity:1}.menu-item__label.level-1{text-overflow:unset}.menu-item__label.active{color:inherit}.menu-item__label{margin-left:8px;font-size:.75rem;line-height:1rem}.menu-item__label.level-0,.menu-item__label.level-1{font-size:.875rem;transition-delay:.15s}.menu-item__label.level-0{margin-left:8px}.menu-item__icon-arrow__wrapper{display:grid;place-items:center;position:absolute;top:50%;transform:translateY(-50%);right:0}.menu-item__icon-arrow__icon{transition:all .3s!important;transform:rotate(-90deg)!important}.menu-item__icon-arrow__icon.active{color:inherit}.menu-item__icon-arrow__icon.open{transform:rotate(0)!important}.menu-item__dropdown{background-color:#fafafa;border:1px solid #ddd;box-shadow:#0000001a 0 10px 15px -3px,#0000000d 0 4px 6px -2px;border-radius:4px;width:210px;max-width:210px;padding:4px;z-index:1200}.menu-item__dropdown.dropdown-favorite{width:auto;min-width:180px;max-width:350px}.menu-item__dropdown::-webkit-scrollbar{width:4px}.menu-item__dropdown::-webkit-scrollbar-thumb{background-color:#9b9b9b99;border-radius:2px}.menu-item__dropdown,.menu-item__dropdown>*{margin-top:4px}.menu-item__dropdown:first-of-type{margin-top:0}.menu-item__dropdown>*:first-child{margin-top:0}.menu-item__dropdown .menu-item__link{height:40px}.menu-item__dropdown .menu-item__link.level-1{height:48px}.menu-item__dropdown.level-1{width:auto;max-width:unset;box-shadow:none;border:none;padding:0;background-color:unset}.icon-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px;border-radius:50%;background-color:transparent;transition:background-color .3s ease;border:none}.icon-btn:hover{background-color:var(--btn-bg-hover)}.simplebar-scrollbar:before{background-color:#0000002d}.favorite-menu__menu .simplebar-track.simplebar-vertical{display:none}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.treeFavorited{display:flex;align-items:center;margin:0 -5px}.treeFavorited li{margin:0 5px}.item.hover-on:before{content:"";position:absolute;top:0;left:0;height:100%;width:2px;background-color:var(--primary300)}.simplebar-placeholder{width:auto!important}@media (min-width: 600px){.menu-item__label.level-0,.menu-item__link{color:#85858a}.menu-item__icon-arrow__wrapper.level-0{display:none}}@media (max-width: 599px){.menu-item__label.active{color:inherit}.menu-item__label.level-0{margin-left:8px;font-weight:500;font-size:.951rem}.menu-item__icon{width:1.5rem;height:1.5rem;flex-shrink:0;display:grid;place-items:center;color:#85858a}.menu-item__wrapper{display:flex;flex-direction:column;position:relative;width:100%;color:#292929!important}.menu-item__link.expanded.level-0{padding:.5rem 10px}.menu-item__link.active{background-color:#009d4f1a;color:inherit}.menu-item__link.active.level-0,.menu-item__link.active.level-1,.menu-item__link.active.level-2,.menu-item__link.active.level-3,.menu-item__link.active.level-4,.menu-item__link.active.level-5,.menu-item__link.active.level-6,.menu-item__link.active.level-7,.menu-item__link.active.level-8,.menu-item__link.active.level-9{background-color:inherit;color:inherit}.menu-item__link.active.level-1:hover,.menu-item__link.active.level-2:hover,.menu-item__link.active.level-3:hover,.menu-item__link.active.level-4:hover,.menu-item__link.active.level-5:hover,.menu-item__link.active.level-6:hover,.menu-item__link.active.level-7:hover,.menu-item__link.active.level-8:hover,.menu-item__link.active.level-9:hover,.menu-item__link.active.level-0:hover{background-color:#919eab14}.menu-item__link.level-0{transition:padding .2s}.menu-item__icon-arrow__wrapper{display:grid;place-items:center;position:absolute;top:50%;transform:translateY(-50%);right:0}.menu-item__icon-arrow__wrapper.expanded{right:4px}.menu-item__icon-arrow__icon{transition:transform .3s!important;transform:rotate(-90deg)!important}.menu-item__icon-arrow__icon.active{color:inherit}.menu-item__icon-arrow__icon.expanded.open{transform:rotate(0)!important}.menu-item__dropdown::-webkit-scrollbar{width:4px}.menu-item__dropdown::-webkit-scrollbar-thumb{background-color:#9b9b9b99;border-radius:2px}.menu-item__dropdown,.menu-item__dropdown>*{margin-top:4px}.menu-item__dropdown.expanded.menu-item__dropdown--close{margin-top:0;transition:margin-top .3s}.menu-item__dropdown:first-of-type{margin-top:0}.menu-item__dropdown>*:first-child{margin-top:0}.menu-item__dropdown.expanded{overflow:hidden}.icon-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px;border-radius:50%;background-color:transparent;transition:background-color .3s ease;border:none}.icon-btn:hover{background-color:var(--btn-bg-hover)}.simplebar-scrollbar:before{background-color:#0000002d}}';var uc={};/**
|
|
32
32
|
* @license React
|
|
33
33
|
* react-dom-server-legacy.browser.production.min.js
|
|
34
34
|
*
|
package/dist/share/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../index.esm2017-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../index.esm2017-ihzMISQV.cjs"),R=require("axios"),y=require("react"),U=require("react-router-dom"),g=require("react/jsx-runtime");require("@r2wc/react-to-web-component");require("@mui/material");require("react-query");require("react-dom");require("moment");const D=r=>{const[t,e]=y.useState([]);return y.useEffect(()=>{R.get(`${r}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(i=>e(i.data)).catch(i=>{console.error("Getting user permission error:",i)})},[r]),t},H=r=>{const t=U.useLocation();if(y.useEffect(()=>{var i,c;let e=t.pathname+t.search+t.hash;r&&!e.includes(r)&&(e=r+e),console.log("🚀 ~ PrivateLayout.tsx ~ fullPath:",e),(c=(i=window.top)==null?void 0:i.shellNavigate)==null||c.call(i,"/app"+e,{replace:!0})},[t,r]),window.self===window.top){console.log("useSyncRouter: Navigate to /app path"),window.location.href=window.location.href.replace(window.origin,`${window.origin}/app`);return}};function $({open:r,disabled:t}){y.useMemo(()=>{var e,i,c,u;t||(r?(i=(e=window.top)==null?void 0:e.HostBridge)==null||i.openBackdrop(!0):(u=(c=window.top)==null?void 0:c.HostBridge)==null||u.openBackdrop(!1))},[r,t])}const k=(r,t)=>(e,i)=>{const u=o.useUserPermissions({axiosInstance:t,baseUrl:r}).data;return u?i?e.every(f=>u==null?void 0:u.includes(f)):e.some(f=>u==null?void 0:u.includes(f)):!1},M=({baseUrl:r,accessWith:t,requireAll:e,children:i})=>k(r)(t,e)?g.jsx(g.Fragment,{children:i}):null,q=({accessWith:r,requireAll:t,baseUrl:e,children:i})=>k(e)(r,t)?g.jsx(g.Fragment,{children:i}):g.jsx(o.UnauthorizedPage,{});var p={},I;function z(){if(I)return p;I=1,Object.defineProperty(p,"__esModule",{value:!0}),p.parse=f,p.serialize=_;const r=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,e=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,i=/^[\u0020-\u003A\u003D-\u007E]*$/,c=Object.prototype.toString,u=(()=>{const s=function(){};return s.prototype=Object.create(null),s})();function f(s,l){const n=new u,h=s.length;if(h<2)return n;const w=(l==null?void 0:l.decode)||b;let a=0;do{const d=s.indexOf("=",a);if(d===-1)break;const E=s.indexOf(";",a),S=E===-1?h:E;if(d>S){a=s.lastIndexOf(";",d-1)+1;continue}const v=m(s,a,d),j=x(s,d,v),T=s.slice(v,j);if(n[T]===void 0){let P=m(s,d+1,S),L=x(s,S,P);const N=w(s.slice(P,L));n[T]=N}a=S+1}while(a<h);return n}function m(s,l,n){do{const h=s.charCodeAt(l);if(h!==32&&h!==9)return l}while(++l<n);return n}function x(s,l,n){for(;l>n;){const h=s.charCodeAt(--l);if(h!==32&&h!==9)return l+1}return n}function _(s,l,n){const h=(n==null?void 0:n.encode)||encodeURIComponent;if(!r.test(s))throw new TypeError(`argument name is invalid: ${s}`);const w=h(l);if(!t.test(w))throw new TypeError(`argument val is invalid: ${l}`);let a=s+"="+w;if(!n)return a;if(n.maxAge!==void 0){if(!Number.isInteger(n.maxAge))throw new TypeError(`option maxAge is invalid: ${n.maxAge}`);a+="; Max-Age="+n.maxAge}if(n.domain){if(!e.test(n.domain))throw new TypeError(`option domain is invalid: ${n.domain}`);a+="; Domain="+n.domain}if(n.path){if(!i.test(n.path))throw new TypeError(`option path is invalid: ${n.path}`);a+="; Path="+n.path}if(n.expires){if(!A(n.expires)||!Number.isFinite(n.expires.valueOf()))throw new TypeError(`option expires is invalid: ${n.expires}`);a+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(a+="; HttpOnly"),n.secure&&(a+="; Secure"),n.partitioned&&(a+="; Partitioned"),n.priority)switch(typeof n.priority=="string"?n.priority.toLowerCase():void 0){case"low":a+="; Priority=Low";break;case"medium":a+="; Priority=Medium";break;case"high":a+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${n.priority}`)}if(n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"none":a+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${n.sameSite}`)}return a}function b(s){if(s.indexOf("%")===-1)return s;try{return decodeURIComponent(s)}catch{return s}}function A(s){return c.call(s)==="[object Date]"}return p}var O=z();function B(){const r=typeof global>"u"?void 0:global.TEST_HAS_DOCUMENT_COOKIE;return typeof r=="boolean"?r:typeof document=="object"&&typeof document.cookie=="string"}function K(r){return typeof r=="string"?O.parse(r):typeof r=="object"&&r!==null?r:{}}function C(r,t={}){const e=V(r);if(!t.doNotParse)try{return JSON.parse(e)}catch{}return r}function V(r){return r&&r[0]==="j"&&r[1]===":"?r.substr(2):r}class F{constructor(t,e={}){this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.update=()=>{if(!this.HAS_DOCUMENT_COOKIE)return;const c=this.cookies;this.cookies=O.parse(document.cookie),this._checkChanges(c)};const i=typeof document>"u"?"":document.cookie;this.cookies=K(t||i),this.defaultSetOptions=e,this.HAS_DOCUMENT_COOKIE=B()}_emitChange(t){for(let e=0;e<this.changeListeners.length;++e)this.changeListeners[e](t)}_checkChanges(t){new Set(Object.keys(t).concat(Object.keys(this.cookies))).forEach(i=>{t[i]!==this.cookies[i]&&this._emitChange({name:i,value:C(this.cookies[i])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(t,e={}){return e.doNotUpdate||this.update(),C(this.cookies[t],e)}getAll(t={}){t.doNotUpdate||this.update();const e={};for(let i in this.cookies)e[i]=C(this.cookies[i],t);return e}set(t,e,i){i?i=Object.assign(Object.assign({},this.defaultSetOptions),i):i=this.defaultSetOptions;const c=typeof e=="string"?e:JSON.stringify(e);this.cookies=Object.assign(Object.assign({},this.cookies),{[t]:c}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=O.serialize(t,c,i)),this._emitChange({name:t,value:e,options:i})}remove(t,e){const i=e=Object.assign(Object.assign(Object.assign({},this.defaultSetOptions),e),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[t],this.HAS_DOCUMENT_COOKIE&&(document.cookie=O.serialize(t,"",i)),this._emitChange({name:t,value:void 0,options:e})}addChangeListener(t){this.changeListeners.push(t),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===1&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(t){const e=this.changeListeners.indexOf(t);e>=0&&this.changeListeners.splice(e,1),this.HAS_DOCUMENT_COOKIE&&this.changeListeners.length===0&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}removeAllChangeListeners(){for(;this.changeListeners.length>0;)this.removeChangeListener(this.changeListeners[0])}}const G=r=>{const t=new F;let i=new URLSearchParams(window.location.search).get("tenantId")||t.get("tenantId");const c=t.get("accessToken")||null;if(console.log("ThemeProvider1:tenantId",i),!i&&c){const f=atob(c.split(".")[1]),m=JSON.parse(f);i=m.tenantId?m.tenantId.toString():null}console.log("ThemeProvider2:tenantId",i);const u=r.isBrand||i!=null?r.viteThemeUrl:"";return console.log("themeUrl",u),g.jsx(o.SaasThemeProvider,{brandTheme:{enabled:!!u,url:u},children:r.children})};exports.AuthContext=o.AuthContext;exports.AuthProvider=o.AuthProvider;exports.ERROR_MESSAGE=o.ERROR_MESSAGE;exports.SaasThemeProvider=o.SaasThemeProvider;exports.TranslationProvider=o.TranslationProvider;exports.axiosInstance=o.axiosInstance;exports.color=o.color;exports.createCustomTheme=o.createCustomTheme;exports.handleErrorAxios=o.handleErrorAxios;exports.login=o.login;exports.logout=o.logout;exports.responseInterceptor=o.responseInterceptor;exports.search=o.search;exports.setFavicon=o.setFavicon;exports.setShellBackdrop=o.setShellBackdrop;exports.translate=o.translate;exports.translationConfig=o.translationConfig;exports.useAuth=o.useAuth;exports.useCustomTranslation=o.useCustomTranslation;exports.useTheme=o.useTheme;exports.useTranslation=o.useTranslation;exports.HasPermission=M;exports.PermissionRoute=q;exports.ThemeProvider=G;exports.getUseHasPermission=k;exports.useGetPermission=D;exports.useSyncBackdrop=$;exports.useSyncRouter=H;
|
package/dist/share/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as U, R as D, W as R } from "../index.esm2017-
|
|
2
|
-
import { X as he, Y as de, Z as fe, a5 as ge, a as me, c as pe, a6 as we, a1 as Oe, $ as Se, a0 as ye, a2 as ke, y as Ce, a7 as xe, s as Ee, t as ve, a3 as Ie, g as Te, u as _e, m as be, a4 as Pe } from "../index.esm2017-
|
|
1
|
+
import { V as U, R as D, W as R } from "../index.esm2017-BwI0O2pm.js";
|
|
2
|
+
import { X as he, Y as de, Z as fe, a5 as ge, a as me, c as pe, a6 as we, a1 as Oe, $ as Se, a0 as ye, a2 as ke, y as Ce, a7 as xe, s as Ee, t as ve, a3 as Ie, g as Te, u as _e, m as be, a4 as Pe } from "../index.esm2017-BwI0O2pm.js";
|
|
3
3
|
import $ from "axios";
|
|
4
4
|
import { useState as H, useEffect as I, useMemo as M } from "react";
|
|
5
5
|
import { useLocation as z } from "react-router-dom";
|
package/package.json
CHANGED
package/web-components-bundle/{SaasThemeProvider-DUpoV8xb.js → SaasThemeProvider-A_eMJWqw.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as j, r as b } from "./react-to-web-component-
|
|
1
|
+
import { a as j, r as b } from "./react-to-web-component-BOygDorD.js";
|
|
2
2
|
function c() {
|
|
3
3
|
return c = Object.assign ? Object.assign.bind() : function(t) {
|
|
4
4
|
for (var e = 1; e < arguments.length; e++) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "../react-to-web-component-
|
|
2
|
-
import { U as d } from "../index-
|
|
3
|
-
import "../react-toastify.esm-
|
|
1
|
+
import "../react-to-web-component-BOygDorD.js";
|
|
2
|
+
import { U as d } from "../index-HP_t9kgC.js";
|
|
3
|
+
import "../react-toastify.esm-DnABvuky.js";
|
|
4
4
|
import "../toast-config/index.js";
|
|
5
5
|
import "../toast-config-notification/index.js";
|
|
6
|
-
import "../SaasThemeProvider-
|
|
7
|
-
import "../index-
|
|
8
|
-
import "../index-
|
|
6
|
+
import "../SaasThemeProvider-A_eMJWqw.js";
|
|
7
|
+
import "../index-BwEhsh9S.js";
|
|
8
|
+
import "../index-DnQ4tn_A.js";
|
|
9
9
|
export {
|
|
10
10
|
d as UnauthorizedPage
|
|
11
11
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../react-to-web-component-
|
|
2
|
-
import { X as e } from "../index-
|
|
3
|
-
import "../SaasThemeProvider-
|
|
1
|
+
import "../react-to-web-component-BOygDorD.js";
|
|
2
|
+
import { X as e } from "../index-DnQ4tn_A.js";
|
|
3
|
+
import "../SaasThemeProvider-A_eMJWqw.js";
|
|
4
4
|
export {
|
|
5
5
|
e as BaseBreadcrumbs
|
|
6
6
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "../react-to-web-component-
|
|
2
|
-
import { F as u, u as F } from "../index-
|
|
3
|
-
import "../index-
|
|
4
|
-
import "../index-
|
|
5
|
-
import "../react-toastify.esm-
|
|
1
|
+
import "../react-to-web-component-BOygDorD.js";
|
|
2
|
+
import { F as u, u as F } from "../index-HP_t9kgC.js";
|
|
3
|
+
import "../index-BwEhsh9S.js";
|
|
4
|
+
import "../index-DnQ4tn_A.js";
|
|
5
|
+
import "../react-toastify.esm-DnABvuky.js";
|
|
6
6
|
import "../toast-config/index.js";
|
|
7
7
|
import "../toast-config-notification/index.js";
|
|
8
|
-
import "../SaasThemeProvider-
|
|
8
|
+
import "../SaasThemeProvider-A_eMJWqw.js";
|
|
9
9
|
export {
|
|
10
10
|
u as FavoriteMenu,
|
|
11
11
|
F as updateFavoriteItems
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../react-to-web-component-
|
|
2
|
-
import { G as i, a as e } from "../index-
|
|
3
|
-
import "../index-
|
|
4
|
-
import "../index-
|
|
5
|
-
import "../SaasThemeProvider-
|
|
1
|
+
import "../react-to-web-component-BOygDorD.js";
|
|
2
|
+
import { G as i, a as e } from "../index-HP_t9kgC.js";
|
|
3
|
+
import "../index-BwEhsh9S.js";
|
|
4
|
+
import "../index-DnQ4tn_A.js";
|
|
5
|
+
import "../SaasThemeProvider-A_eMJWqw.js";
|
|
6
6
|
export {
|
|
7
7
|
i as GlobalMenu,
|
|
8
8
|
e as LanguageDropdown
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../react-to-web-component-
|
|
2
|
-
import { L as n, T as s } from "../index-
|
|
3
|
-
import "../index-
|
|
4
|
-
import "../index-
|
|
5
|
-
import "../SaasThemeProvider-
|
|
6
|
-
import "../react-toastify.esm-
|
|
1
|
+
import "../react-to-web-component-BOygDorD.js";
|
|
2
|
+
import { L as n, T as s } from "../index-HP_t9kgC.js";
|
|
3
|
+
import "../index-BwEhsh9S.js";
|
|
4
|
+
import "../index-DnQ4tn_A.js";
|
|
5
|
+
import "../SaasThemeProvider-A_eMJWqw.js";
|
|
6
|
+
import "../react-toastify.esm-DnABvuky.js";
|
|
7
7
|
import "../toast-config/index.js";
|
|
8
8
|
import "../toast-config-notification/index.js";
|
|
9
9
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../react-to-web-component-
|
|
2
|
-
import { H as o, g as r } from "../index-
|
|
1
|
+
import "../react-to-web-component-BOygDorD.js";
|
|
2
|
+
import { H as o, g as r } from "../index-HP_t9kgC.js";
|
|
3
3
|
export {
|
|
4
4
|
o as HasPermission,
|
|
5
5
|
r as getUseHasPermission
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as e, s as a } from "./react-to-web-component-
|
|
2
|
-
import { u as s } from "./SaasThemeProvider-
|
|
1
|
+
import { j as e, s as a } from "./react-to-web-component-BOygDorD.js";
|
|
2
|
+
import { u as s } from "./SaasThemeProvider-A_eMJWqw.js";
|
|
3
3
|
const l = "*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}";
|
|
4
4
|
function d({ children: t, styles: o = [], ...i }) {
|
|
5
5
|
return /* @__PURE__ */ e.jsxs("div", { ...i, children: [
|