react-luminus-components 1.2.69 → 1.2.71

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.
@@ -1,16 +1,16 @@
1
- import { useContext as l, useCallback as u } from "react";
2
- import { aj as p, ak as h } from "./NoInputContainer-BL5lK_1n.js";
1
+ import { useContext as u, useCallback as l } from "react";
2
+ import { ak as p, al as h } from "./NoInputContainer-BnAPYzCz.js";
3
3
  const P = () => {
4
- const { isShown: e, text: s, showPrompt: t, hidePrompt: r, resolveRef: o, setOptions: c } = l(p), C = u((n) => {
4
+ const { isShown: e, text: s, showPrompt: t, hidePrompt: r, resolveRef: o, setOptions: c } = u(p), C = l((n) => {
5
5
  r(), o.current(n);
6
- }, [r, o]), f = u(async (n, m) => (c((i) => ({ ...i, ...m })), t(n), new Promise((i) => {
6
+ }, [r, o]), f = l(async (n, m) => (c((i) => ({ ...i, ...m })), t(n), new Promise((i) => {
7
7
  o.current = i;
8
8
  })), [o, c, t]);
9
9
  return { isShown: e, text: s, prompt: f, onFinish: C };
10
10
  };
11
11
  let a;
12
12
  const k = () => {
13
- const { show: e, text: s, showConfirm: t, hideConfirm: r } = l(h), o = () => {
13
+ const { show: e, text: s, showConfirm: t, hideConfirm: r } = u(h), o = () => {
14
14
  r();
15
15
  };
16
16
  return { confirm: async (n) => (t(n), new Promise((m) => {
@@ -1,5 +1,5 @@
1
1
  import { useContext as t, useCallback as i } from "react";
2
- import { a9 as n } from "./NoInputContainer-BL5lK_1n.js";
2
+ import { aa as n } from "./NoInputContainer-BnAPYzCz.js";
3
3
  import "react-hook-form";
4
4
  const p = () => {
5
5
  const { user: s } = t(n);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-luminus-components",
3
- "version": "1.2.69",
3
+ "version": "1.2.71",
4
4
  "description": "Library of React Components reusable in Luminus projects (Fleetman, CAFM)",
5
5
  "type": "module",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- "use strict";const s=require("./NoInputContainer-CAwCEVT5.cjs"),c=require("react"),Le=require("react-dom");function De(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const u=De(c),Fe="_loading_14qfh_1",Ue="_spinner-grow_14qfh_10",We="_second_14qfh_14",Ge="_third_14qfh_17",b={loading:Fe,"spinner-grow":"_spinner-grow_14qfh_10",spinnerGrow:Ue,second:We,third:Ge},Ke=()=>s.jsxRuntimeExports.jsxs("div",{className:s.classNames("luminus-loading",b.loading),children:[s.jsxRuntimeExports.jsx("div",{className:s.classNames("spinner-grow",b.spinnerGrow,"text-primary"),role:"status"}),s.jsxRuntimeExports.jsx("div",{className:s.classNames("spinner-grow",b.spinnerGrow,"text-primary",b.second),role:"status"}),s.jsxRuntimeExports.jsx("div",{className:s.classNames("spinner-grow",b.spinnerGrow,"text-primary",b.third),role:"status"})]}),qe=t=>u.forwardRef((e,n)=>s.jsxRuntimeExports.jsx("div",{...e,ref:n,className:s.classNames(e.className,t)}));function xe(t){const e=c.useRef(null);return c.useEffect(()=>{e.current=t}),e.current}const He={"aria-label":s.PropTypes.string,onClick:s.PropTypes.func,variant:s.PropTypes.oneOf(["white"])},me=u.forwardRef(({className:t,variant:e,"aria-label":n="Close",...o},r)=>s.jsxRuntimeExports.jsx("button",{ref:r,type:"button",className:s.classNames("btn-close",e&&`btn-close-${e}`,t),"aria-label":n,...o}));me.displayName="CloseButton";me.propTypes=He;var $e=Function.prototype.bind.call(Function.prototype.call,[].slice);function v(t,e){return $e(t.querySelectorAll(e))}const Pe="data-rr-ui-";function ve(t){return`${Pe}${t}`}var X;function ge(t){if((!X&&X!==0||t)&&s.canUseDOM){var e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),X=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return X}function ce(t){t===void 0&&(t=s.ownerDocument());try{var e=t.activeElement;return!e||!e.nodeName?null:e}catch{return t.body}}function ze(t=document){const e=t.defaultView;return Math.abs(e.innerWidth-t.documentElement.clientWidth)}const Re=ve("modal-open");class fe{constructor({ownerDocument:e,handleContainerOverflow:n=!0,isRTL:o=!1}={}){this.handleContainerOverflow=n,this.isRTL=o,this.modals=[],this.ownerDocument=e}getScrollbarWidth(){return ze(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(e){}removeModalAttributes(e){}setContainerStyle(e){const n={overflow:"hidden"},o=this.isRTL?"paddingLeft":"paddingRight",r=this.getElement();e.style={overflow:r.style.overflow,[o]:r.style[o]},e.scrollBarWidth&&(n[o]=`${parseInt(s.style(r,o)||"0",10)+e.scrollBarWidth}px`),r.setAttribute(Re,""),s.style(r,n)}reset(){[...this.modals].forEach(e=>this.remove(e))}removeContainerStyle(e){const n=this.getElement();n.removeAttribute(Re),Object.assign(n.style,e.style)}add(e){let n=this.modals.indexOf(e);return n!==-1||(n=this.modals.length,this.modals.push(e),this.setModalAttributes(e),n!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),n}remove(e){const n=this.modals.indexOf(e);n!==-1&&(this.modals.splice(n,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(e))}isTopModal(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e}}const Ve=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];function Qe(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&(n[r]=t[r]);return n}let de;function Ye(t){return de||(de=new fe({ownerDocument:t==null?void 0:t.document})),de}function Xe(t){const e=s.useWindow(),n=t||Ye(e),o=c.useRef({dialog:null,backdrop:null});return Object.assign(o.current,{add:()=>n.add(o.current),remove:()=>n.remove(o.current),isTopModal:()=>n.isTopModal(o.current),setDialogRef:c.useCallback(r=>{o.current.dialog=r},[]),setBackdropRef:c.useCallback(r=>{o.current.backdrop=r},[])})}const Ce=c.forwardRef((t,e)=>{let{show:n=!1,role:o="dialog",className:r,style:i,children:g,backdrop:f=!0,keyboard:R=!0,onBackdropClick:C,onEscapeKeyDown:E,transition:k,runTransition:T,backdropTransition:N,runBackdropTransition:Z,autoFocus:W=!0,enforceFocus:J=!0,restoreFocus:y=!0,restoreFocusOptions:ee,renderDialog:G,renderBackdrop:te=l=>s.jsxRuntimeExports.jsx("div",Object.assign({},l)),manager:se,container:ne,onShow:K,onHide:I=()=>{},onExit:oe,onExited:B,onExiting:q,onEnter:H,onEntering:$,onEntered:P}=t,re=Qe(t,Ve);const p=s.useWindow(),S=s.useWaitForDOMRef(ne),d=Xe(se),ae=s.useMounted(),z=xe(n),[x,O]=c.useState(!n),m=c.useRef(null);c.useImperativeHandle(e,()=>d,[d]),s.canUseDOM&&!z&&n&&(m.current=ce(p==null?void 0:p.document)),n&&x&&O(!1);const h=s.useEventCallback(()=>{if(d.add(),_.current=s.listen(document,"keydown",le),D.current=s.listen(document,"focus",()=>setTimeout(ie),!0),K&&K(),W){var l,Y;const U=ce((l=(Y=d.dialog)==null?void 0:Y.ownerDocument)!=null?l:p==null?void 0:p.document);d.dialog&&U&&!s.contains(d.dialog,U)&&(m.current=U,d.dialog.focus())}}),L=s.useEventCallback(()=>{if(d.remove(),_.current==null||_.current(),D.current==null||D.current(),y){var l;(l=m.current)==null||l.focus==null||l.focus(ee),m.current=null}});c.useEffect(()=>{!n||!S||h()},[n,S,h]),c.useEffect(()=>{x&&L()},[x,L]),s.useWillUnmount(()=>{L()});const ie=s.useEventCallback(()=>{if(!J||!ae()||!d.isTopModal())return;const l=ce(p==null?void 0:p.document);d.dialog&&l&&!s.contains(d.dialog,l)&&d.dialog.focus()}),V=s.useEventCallback(l=>{l.target===l.currentTarget&&(C==null||C(l),f===!0&&I())}),le=s.useEventCallback(l=>{R&&s.isEscKey(l)&&d.isTopModal()&&(E==null||E(l),l.defaultPrevented||I())}),D=c.useRef(),_=c.useRef(),Q=(...l)=>{O(!0),B==null||B(...l)};if(!S)return null;const w=Object.assign({role:o,ref:d.setDialogRef,"aria-modal":o==="dialog"?!0:void 0},re,{style:i,className:r,tabIndex:-1});let F=G?G(w):s.jsxRuntimeExports.jsx("div",Object.assign({},w,{children:u.cloneElement(g,{role:"document"})}));F=s.renderTransition(k,T,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:oe,onExiting:q,onExited:Q,onEnter:H,onEntering:$,onEntered:P,children:F});let A=null;return f&&(A=te({ref:d.setBackdropRef,onClick:V}),A=s.renderTransition(N,Z,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:A})),s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:Le.createPortal(s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[A,F]}),S)})});Ce.displayName="Modal";const Ze=Object.assign(Ce,{Manager:fe});function Je(t,e){t.classList?t.classList.add(e):s.hasClass(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function Te(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function et(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=Te(t.className,e):t.setAttribute("class",Te(t.className&&t.className.baseVal||"",e))}const M={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};class tt extends fe{adjustAndStore(e,n,o){const r=n.style[e];n.dataset[e]=r,s.style(n,{[e]:`${parseFloat(s.style(n,e))+o}px`})}restore(e,n){const o=n.dataset[e];o!==void 0&&(delete n.dataset[e],s.style(n,{[e]:o}))}setContainerStyle(e){super.setContainerStyle(e);const n=this.getElement();if(Je(n,"modal-open"),!e.scrollBarWidth)return;const o=this.isRTL?"paddingLeft":"paddingRight",r=this.isRTL?"marginLeft":"marginRight";v(n,M.FIXED_CONTENT).forEach(i=>this.adjustAndStore(o,i,e.scrollBarWidth)),v(n,M.STICKY_CONTENT).forEach(i=>this.adjustAndStore(r,i,-e.scrollBarWidth)),v(n,M.NAVBAR_TOGGLER).forEach(i=>this.adjustAndStore(r,i,e.scrollBarWidth))}removeContainerStyle(e){super.removeContainerStyle(e);const n=this.getElement();et(n,"modal-open");const o=this.isRTL?"paddingLeft":"paddingRight",r=this.isRTL?"marginLeft":"marginRight";v(n,M.FIXED_CONTENT).forEach(i=>this.restore(o,i)),v(n,M.STICKY_CONTENT).forEach(i=>this.restore(r,i)),v(n,M.NAVBAR_TOGGLER).forEach(i=>this.restore(r,i))}}let ue;function st(t){return ue||(ue=new tt(t)),ue}const Ne=u.forwardRef(({className:t,bsPrefix:e,as:n="div",...o},r)=>(e=s.useBootstrapPrefix(e,"modal-body"),s.jsxRuntimeExports.jsx(n,{ref:r,className:s.classNames(t,e),...o})));Ne.displayName="ModalBody";const ye=u.createContext({onHide(){}}),Ee=u.forwardRef(({bsPrefix:t,className:e,contentClassName:n,centered:o,size:r,fullscreen:i,children:g,scrollable:f,...R},C)=>{t=s.useBootstrapPrefix(t,"modal");const E=`${t}-dialog`,k=typeof i=="string"?`${t}-fullscreen-${i}`:`${t}-fullscreen`;return s.jsxRuntimeExports.jsx("div",{...R,ref:C,className:s.classNames(E,e,r&&`${t}-${r}`,o&&`${E}-centered`,f&&`${E}-scrollable`,i&&k),children:s.jsxRuntimeExports.jsx("div",{className:s.classNames(`${t}-content`,n),children:g})})});Ee.displayName="ModalDialog";const Se=u.forwardRef(({className:t,bsPrefix:e,as:n="div",...o},r)=>(e=s.useBootstrapPrefix(e,"modal-footer"),s.jsxRuntimeExports.jsx(n,{ref:r,className:s.classNames(t,e),...o})));Se.displayName="ModalFooter";const nt=u.forwardRef(({closeLabel:t="Close",closeVariant:e,closeButton:n=!1,onHide:o,children:r,...i},g)=>{const f=c.useContext(ye),R=s.useEventCallback(()=>{f==null||f.onHide(),o==null||o()});return s.jsxRuntimeExports.jsxs("div",{ref:g,...i,children:[r,n&&s.jsxRuntimeExports.jsx(me,{"aria-label":t,variant:e,onClick:R})]})}),Oe=u.forwardRef(({bsPrefix:t,className:e,closeLabel:n="Close",closeButton:o=!1,...r},i)=>(t=s.useBootstrapPrefix(t,"modal-header"),s.jsxRuntimeExports.jsx(nt,{ref:i,...r,className:s.classNames(e,t),closeLabel:n,closeButton:o})));Oe.displayName="ModalHeader";const ot=qe("h4"),_e=u.forwardRef(({className:t,bsPrefix:e,as:n=ot,...o},r)=>(e=s.useBootstrapPrefix(e,"modal-title"),s.jsxRuntimeExports.jsx(n,{ref:r,className:s.classNames(t,e),...o})));_e.displayName="ModalTitle";function rt(t){return s.jsxRuntimeExports.jsx(s.Fade,{...t,timeout:null})}function at(t){return s.jsxRuntimeExports.jsx(s.Fade,{...t,timeout:null})}const we=u.forwardRef(({bsPrefix:t,className:e,style:n,dialogClassName:o,contentClassName:r,children:i,dialogAs:g=Ee,"data-bs-theme":f,"aria-labelledby":R,"aria-describedby":C,"aria-label":E,show:k=!1,animation:T=!0,backdrop:N=!0,keyboard:Z=!0,onEscapeKeyDown:W,onShow:J,onHide:y,container:ee,autoFocus:G=!0,enforceFocus:te=!0,restoreFocus:se=!0,restoreFocusOptions:ne,onEntered:K,onExit:I,onExiting:oe,onEnter:B,onEntering:q,onExited:H,backdropClassName:$,manager:P,...re},p)=>{const[S,d]=c.useState({}),[ae,z]=c.useState(!1),x=c.useRef(!1),O=c.useRef(!1),m=c.useRef(null),[h,L]=s.useCallbackRef(),ie=s.useMergedRefs(p,L),V=s.useEventCallback(y),le=s.useIsRTL();t=s.useBootstrapPrefix(t,"modal");const D=c.useMemo(()=>({onHide:V}),[V]);function _(){return P||st({isRTL:le})}function Q(a){if(!s.canUseDOM)return;const j=_().getScrollbarWidth()>0,he=a.scrollHeight>s.ownerDocument(a).documentElement.clientHeight;d({paddingRight:j&&!he?ge():void 0,paddingLeft:!j&&he?ge():void 0})}const w=s.useEventCallback(()=>{h&&Q(h.dialog)});s.useWillUnmount(()=>{s.removeEventListener(window,"resize",w),m.current==null||m.current()});const F=()=>{x.current=!0},A=a=>{x.current&&h&&a.target===h.dialog&&(O.current=!0),x.current=!1},l=()=>{z(!0),m.current=s.transitionEnd(h.dialog,()=>{z(!1)})},Y=a=>{a.target===a.currentTarget&&l()},U=a=>{if(N==="static"){Y(a);return}if(O.current||a.target!==a.currentTarget){O.current=!1;return}y==null||y()},Ae=a=>{Z?W==null||W(a):(a.preventDefault(),N==="static"&&l())},je=(a,j)=>{a&&Q(a),B==null||B(a,j)},be=a=>{m.current==null||m.current(),I==null||I(a)},Me=(a,j)=>{q==null||q(a,j),s.addEventListener(window,"resize",w)},ke=a=>{a&&(a.style.display=""),H==null||H(a),s.removeEventListener(window,"resize",w)},Ie=c.useCallback(a=>s.jsxRuntimeExports.jsx("div",{...a,className:s.classNames(`${t}-backdrop`,$,!T&&"show")}),[T,$,t]),pe={...n,...S};pe.display="block";const Be=a=>s.jsxRuntimeExports.jsx("div",{role:"dialog",...a,style:pe,className:s.classNames(e,t,ae&&`${t}-static`,!T&&"show"),onClick:N?U:void 0,onMouseUp:A,"data-bs-theme":f,"aria-label":E,"aria-labelledby":R,"aria-describedby":C,children:s.jsxRuntimeExports.jsx(g,{...re,onMouseDown:F,className:o,contentClassName:r,children:i})});return s.jsxRuntimeExports.jsx(ye.Provider,{value:D,children:s.jsxRuntimeExports.jsx(Ze,{show:k,ref:ie,backdrop:N,container:ee,keyboard:!0,autoFocus:G,enforceFocus:te,restoreFocus:se,restoreFocusOptions:ne,onEscapeKeyDown:Ae,onShow:J,onHide:y,onEnter:je,onEntering:Me,onEntered:K,onExit:be,onExiting:oe,onExited:ke,manager:_(),transition:T?rt:void 0,backdropTransition:T?at:void 0,renderBackdrop:Ie,renderDialog:Be})})});we.displayName="Modal";const it=Object.assign(we,{Body:Ne,Header:Oe,Title:_e,Footer:Se,Dialog:Ee,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150});/*! @azure/msal-browser v3.14.0 2024-05-07 */const lt={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"};exports.EventType=lt;exports.Loading=Ke;exports.Modal=it;exports.dataAttr=ve;exports.qsa=v;exports.usePrevious=xe;
@@ -1,5 +0,0 @@
1
- import { j as o, aa as i, ai as t } from "./NoInputContainer-BL5lK_1n.js";
2
- const l = ({ text: s, placement: a, children: r }) => /* @__PURE__ */ o.jsx(i, { placement: a, overlay: /* @__PURE__ */ o.jsx(t, { className: "luminus-tooltip", children: s }), children: r });
3
- export {
4
- l as S
5
- };