moorr-react-mui 0.2.96 → 0.2.97

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/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e=require("react"),t=require("moorr-common"),n=require("@material-ui/core/MenuItem"),l=require("@material-ui/core/styles"),o=require("@material-ui/core/TextField"),r=require("@material-ui/core"),i=require("@material-ui/styles"),s=require("uuid"),a=require("react-grid-layout"),c=require("@mui/material/Accordion"),u=require("@mui/material/AccordionSummary"),d=require("@mui/material/AccordionDetails"),m=require("@mui/icons-material/ExpandMore"),p=require("react-dom"),g=require("@mui/material"),h=require("react-toastify"),f=require("@mui/icons-material/Cancel");const v=e=>({root:{"&:hover:not($disabled):not($focused):not($error) $notchedOutline":{},"&$checked":{color:"var(--primary-color)"},"& .vldt-MuiSelect-select.vldt-MuiSelect-select":{color:"var(--grey-color-2)"}},disabled:{},focused:{},error:{},notchedOutline:{},checked:{},notchedOutlineMBRequired:{flex:3,borderColor:"blue",borderWidth:2},fieldSetMBRequired:{"& fieldset":{flex:3,borderColor:"blue",borderWidth:2}},fieldSetErrorField:{"& fieldset":{borderColor:"var(--error-color)"}},blue:{color:"blue"}});l.makeStyles(v);const E=l.makeStyles((()=>l.createStyles({root:{overflow:"hidden",display:"flex",alignItems:"center","&.start":{flexDirection:"row"},"&.top":{flexDirection:"column"},"& .Mui-disabled":{backgroundColor:"var(--grey-color-3)",cursor:"not-allowed",borderRadius:"4px"}},label:{flex:2},field:{flex:3},required:{color:"red"},menuItem:{color:"var(--grey-color-2)","&:hover":{backgroundColor:"var(--primary-color-scale-25)",color:"var(--grey-color-2)"}},menuItemSelected:{color:"var(--grey-color-2)"},mandatory:{border:"red 2px solid",borderRadius:"4px"}})));var x=l.withStyles(v)((({handleChange:t,value:l,disabled:r=!1,name:i,className:s,classes:a,size:c,menuItemLabel:u,options:d,labelPlacement:m="start",label:p,required:g=!1,isMBRequiredField:h,fullWidth:f,selectIconComponent:v})=>{const{root:x,focused:y,error:b,notchedOutline:T,notchedOutlineMBRequired:C}=a,w=E();let N;return v&&(N={IconComponent:v}),e.createElement(o,{fullWidth:!1!==f,id:"outlined-basic",variant:"outlined",value:l,onChange:t,disabled:r,name:i,className:[s].join(" "),InputProps:{classes:{root:x,focused:y,error:b,notchedOutline:!h||l&&0!==(null==l?void 0:l.length)?!g||l&&0!==(null==l?void 0:l.length)?T:w.mandatory:C}},color:"primary",size:c||"small",select:!0,SelectProps:N,defaultValue:""},e.createElement(n,{value:"",disabled:!0},e.createElement("em",null,u)),d&&d.map(((t,l)=>"-separator-"===t?e.createElement(n,{key:`separator-${l}`,value:"",disabled:!0},e.createElement("em",null,"-----------")):e.createElement(n,{key:`menu-item-${l}-${t.value||t}`,value:t.value||t},t.label||t))))}));const y={};const b=({className:n,icon:l,width:o,height:r,fill:i,stroke:s,accent:a,dropShadow:c})=>{if(t.utils.isNullOrUndefined(l))return null;const u=y[l]||null;return u?e.createElement(u,{className:n,fill:i,width:o,height:r,stroke:s,accent:a,dropShadow:c}):null},T={};var C=({stylePrefix:t,children:n})=>{let o;if(t)o=T[t]?T[t]:T[t]=i.createGenerateClassName({seed:t});else{const e=`MoorrStylesProvider-${s.v4()}-`;o=i.createGenerateClassName({seed:e})}return e.createElement(i.StylesProvider,{generateClassName:o,injectFirst:!0},e.createElement(r.StylesProvider,{generateClassName:o,injectFirst:!0},e.createElement(l.StylesProvider,{generateClassName:o},n)))};const w=e.createContext({});function N(){return e.useContext(w)}const M={};function S(e,t){e&&t&&(M[e]=t)}const P=({graphingTile:t,graphingTileIndex:n})=>{var l;if(!(null===(l=null==t?void 0:t.tile)||void 0===l?void 0:l.tileType))return null;const o=M[t.tile.tileType]||null;return o?e.createElement(o,{graphingTile:t,graphingTileIndex:n}):null},k=[20,20],F={lg:600,sm:0},G={lg:8,sm:2},I=({tilePrefix:t,responsive:n,columns:l,containerPadding:o,referenceMargin:r,referenceWidth:i,graphingTiles:s})=>{const[c,u]=e.useState(null),[d,m]=e.useState(null),[p,g]=e.useState(null),[h,f]=e.useState(null),v=e.useRef(null),E=()=>{const e=(null==v?void 0:v.current)?(null==v?void 0:v.current).getBoundingClientRect().width:null;f(e);const t=T(e);u(t)};let x;const y=e=>{E(),clearTimeout(x),x=setTimeout((()=>{E()}),300)};e.useEffect((()=>{E()}),[v]),e.useEffect((()=>(window.addEventListener("resize",y),()=>{window.removeEventListener("resize",y)})),[]),e.useEffect((()=>{if(n){if(!Array.isArray(s)||0===s.length)return void g({lg:[]});g({lg:s.map(((e,n)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${t?t+"_":""}tile_${n}`})))})}else{if(!Array.isArray(s)||0===s.length)return void m([]);m(s.map(((e,n)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${t?t+"_":""}tile_${n}`,static:!0}))))}}),[s]);const b=()=>null==s?void 0:s.map(((n,l)=>{if(!n.tile||!n.visible)return null;let o="graphing-tile-container";!1!==n.border&&(o+=" bordered"),n.autoHeight&&(o+=" auto-height");const r=`${t?t+"_":""}tile_${l}`;return e.createElement("div",{className:o,key:r},e.createElement(P,{graphingTile:n,graphingTileIndex:l}))})),T=e=>{if(!r||isNaN(r)||r<=0||!i||isNaN(i)||i<=0||null==e)return k;const t=e/i*r;return[t,t]};return e.createElement("div",{ref:v,className:"graphing-tiles-container"},(()=>{if(!h||!c)return null;if(!1!==n){if(!p)return null;const t=[o||0,0];return e.createElement(a.Responsive,{width:h,breakpoints:F,cols:l||G,rowHeight:1,layouts:p,containerPadding:t,margin:c,isDraggable:!1},b())}return d?e.createElement(a,{width:h,cols:9,rowHeight:50,margin:c,isDraggable:!1,layout:d},b()):null})())},A={};function L(e,t){A[e]=t}function B(e){const t=A[null==e?void 0:e.tileType];return t?new t(e):null}class q{constructor(e){this.x=e.x,this.y=e.y,this.w=e.w,this.h=e.h,this.border=!0===e.border,this.background=e.background||null,this.autoHeight=!0===e.autoHeight,this.tile=B(e.tile),this.visible=!1!==e.visible}getBackground(){return this.background||"#FFFFFF"}}class D{constructor(e){this.title=e.title||"",this.infoIconUrl=e.infoUrl,this.infoIconHref=e.infoHref,this.responsive=!1!==e.responsive,this.columns=e.columns||{lg:8,sm:2},this.containerPadding=e.containerPadding||0,this.referenceMargin=e.referenceMargin||null,this.referenceWidth=e.referenceWidth||null,this.tiles=[],Array.isArray(e.tiles)&&e.tiles.forEach((e=>{this.tiles.push(new q(e))}))}}const $={};function H(e){const t=$[null==e?void 0:e.controlType];return t?new t(e):null}class O{constructor(e){this.controlType=e.controlType,this.dataKey=e.dataKey}}class _{constructor(e){this.border=e.border,this.background=e.background||null,this.control=H(e.control)}getBackground(e){return this.background||(null==e?void 0:e.background)||"#FFFFFF"}}class z{constructor(e){this.id=e.id||"",this.title=e.title||"",this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new _(e))})),this.add=!0===e.add}}class R{constructor(e){this.tileType=e.tileType}}class W extends R{constructor(e){super(e),this.control=new _(e.control)}}class U extends R{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new _(e))}))}}class j extends R{constructor(e){super(e),t.utils.isArray(e.formGroups)&&e.formGroups.length>0?this.formGroups=e.formGroups.map((e=>new z(e))):this.formGroups=[]}}L("form-groups-tile",j);class V extends U{constructor(e){super(e),this.controlsPerPage=e.controlsPerPage,(isNaN(this.controlsPerPage)||this.controlsPerPage<=1)&&(this.controlsPerPage=1)}}L("horizontal-tile",V);class Z extends U{constructor(e){super(e),this.states={};for(const t in e.states){const n=e.states[t];n&&(this.states[t]=new D(n))}}}L("selectable-states-tile",Z);class K extends R{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new _(e))}))}}L("simple-form-tile",K);class J extends W{constructor(e){super(e)}}L("single-tile",J);class Q extends U{constructor(e){super(e)}}L("vertical-tile",Q);const X={};const Y=({graphingTile:t,graphingTileIndex:n,graphingTileControl:l,ControlProps:o})=>{var r;if(!(null===(r=null==l?void 0:l.control)||void 0===r?void 0:r.controlType))return null;const i=X[l.control.controlType]||null;return i?e.createElement(i,Object.assign({graphingTile:t,graphingTileIndex:n,graphingTileControl:l},o)):null},ee=({graphingTile:t,graphingTileIndex:n,graphingTileControls:l,ControlProps:o})=>{var r,i;let s="graphing-tile-controls-container";return(null===(r=null==t?void 0:t.tile)||void 0===r?void 0:r.tileType)&&(s+=" "+(null===(i=null==t?void 0:t.tile)||void 0===i?void 0:i.tileType)),e.createElement("div",{className:s},null==l?void 0:l.map(((l,r)=>{var i,s;if(!l.control)return null;let a="graphing-tile-control-container";(null===(i=l.control)||void 0===i?void 0:i.controlType)&&(a+=" "+(null===(s=l.control)||void 0===s?void 0:s.controlType)),!1!==l.border&&(a+=" bordered");const c=`control_${n}_${r}`;return e.createElement("div",{className:a,key:c},e.createElement(Y,{graphingTile:t,graphingTileIndex:n,graphingTileControl:l,ControlProps:o}))})))};function te(e,t,n,l){return new(n||(n=Promise))((function(o,r){function i(e){try{a(l.next(e))}catch(e){r(e)}}function s(e){try{a(l.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}a((l=l.apply(e,t||[])).next())}))}const ne=({graphingTile:n,graphingTileIndex:l})=>{const o=null==n?void 0:n.tile;if(!o)return null;const r=N();return e.createElement("div",{className:"form-groups-tile-component"},!t.utils.isArray(o.formGroups)||o.formGroups.length<0?null:o.formGroups.map(((o,i)=>{const s=e.useRef(null),[a,p]=e.useState("normal"),[g,h]=e.useState("form-group-container");e.useEffect((()=>{y()}),[g,a]);const[f,v]=e.useState(0),[E,x]=e.useState(!0);e.useEffect((()=>{if(E){const e=s.current;t.utils.isNullOrUndefined(e)?v(0):setTimeout((()=>{v(e.scrollHeight)}),10)}else v(0)}),[E]);const y=e=>{if(E){const e=s.current;t.utils.isNullOrUndefined(e)?v(0):setTimeout((()=>{v(Math.max(e.clientHeight,e.scrollHeight))}),10)}else v(0)},T=e.useCallback((()=>!0!==o.add?null:e.createElement("button",{type:"button",className:"form-group-tile-add-button",onClick:C,disabled:"add"==a},e.createElement(b,{icon:"add-icon",stroke:"#ffffff"}))),[a]);e.useCallback((()=>"add"===a?null:e.createElement("svg",{viewBox:"0 0 11 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M5.89844 1.1626L10.4688 5.70947C10.6797 5.94385 10.6797 6.29541 10.4688 6.50635L9.92969 7.04541C9.71875 7.25635 9.36719 7.25635 9.13281 7.04541L5.5 3.43603L1.89063 7.04541C1.65625 7.25635 1.30469 7.25635 1.09375 7.04541L0.554688 6.50635C0.34375 6.29541 0.34375 5.94385 0.554688 5.70947L5.125 1.1626C5.33594 0.95166 5.6875 0.95166 5.89844 1.1626Z",fill:"#333333"}))),[a]);const C=e=>{e.stopPropagation(),p("add"),x(!0)},w=e=>te(void 0,void 0,void 0,(function*(){t.utils.isFunction(null==r?void 0:r.handleFormGroupCancel)&&(yield Promise.all([null==r?void 0:r.handleFormGroupCancel({formGroup:o})])),p("normal")})),N=e=>te(void 0,void 0,void 0,(function*(){t.utils.isFunction(null==r?void 0:r.handleFormGroupSave)&&(yield Promise.all([null==r?void 0:r.handleFormGroupSave({formGroup:o})])),p("normal")}));let M="form-group-container";return t.utils.isFunction(r.isFormGroupVisible)&&(r.isFormGroupVisible(o.id)||(M+=" hidden")),M!==g&&h(M),e.createElement(c,{className:M,expanded:E,onChange:e=>{"add"!==a&&x((e=>!e))},TransitionProps:{unmountOnExit:!0}},e.createElement(u,{className:"form-group-title",expandIcon:"add"!==a?e.createElement(m,null):null},e.createElement("span",{className:"form-group-title-text"},o.title),T()),e.createElement("hr",null),e.createElement(d,{className:"form-group-components"},(()=>{if("add"===a){let n;return t.utils.isFunction(r.renderFormGroup)&&(n=r.renderFormGroup(o,"add")),e.createElement(e.Fragment,null,n,e.createElement("hr",null),e.createElement("div",{className:"form-group-add-mode-buttons"},e.createElement("button",{className:"cancel-button",onClick:w},"Cancel"),e.createElement("button",{className:"save-button",onClick:N},"Save")))}{const i=o.controls;let s;return t.utils.isFunction(r.renderFormGroup)&&(s=r.renderFormGroup(o,"normal"),!t.utils.isNullOrUndefined(s))?s:e.createElement(ee,{graphingTile:n,graphingTileIndex:l,graphingTileControls:i,ControlProps:{onUIChange:y}})}})()))})))};S("form-groups-tile",ne);const le=({graphingTile:t,graphingTileIndex:n})=>{const l=null==t?void 0:t.tile;if(!l)return null;const[o,r]=e.useState(null),[i,s]=e.useState(0),[a,c]=e.useState(0),[u,d]=e.useState(null),[m,p]=e.useState(null),[g,h]=e.useState(null),[f,v]=e.useState([]);e.useEffect((()=>{let e=[];const t=Math.ceil(l.controls.length/l.controlsPerPage);if(t>0)for(let n=0;n<t;n++){const t={pageIndex:n,controls:[]};for(let e=0;e<l.controlsPerPage;e++){const o=n*l.controlsPerPage+e;if(o>=l.controls.length)break;t.controls.push(l.controls[o])}e.push(t)}s(t),c(0),d(null),p(null),h(null),v(e)}),l.controls);const E=e=>{let t=e-1;t<0&&(t=i-1),p(t)},x=e=>{e.stopPropagation(),E(a),h(null),d(null)},y=e=>{e.stopPropagation()},b=e=>{e.stopPropagation()},T=e=>{if(e.stopPropagation(),null!==o)return;const t=a;let n=a-1;n<0&&(n=i-1),d(t),c(n),p(null),h(t);const l=setTimeout((()=>{E(n),h(null),d(null),setTimeout((function(){r(null)}),300)}),300);r(l)},C=e=>{let t=e+1;t>=i&&(t=0),h(t)},w=e=>{e.stopPropagation(),p(null),C(a),d(null)},N=e=>{e.stopPropagation()},M=e=>{e.stopPropagation()},S=e=>{if(e.stopPropagation(),null!==o)return;const t=a;let n=a+1;n>=i&&(n=0),d(t),c(n),p(t),h(null);const l=setTimeout((()=>{p(null),C(n),d(null),setTimeout((function(){r(null)}),300)}),300);r(l)},P={background:t.getBackground()};return e.createElement("div",{className:"horizontal-tile-component",style:P},e.createElement("div",{className:"horizontal-tile-pages-container"},f.map(((l,o)=>{let r="horizontal-tile-page-container";return o===a?r+=" active":o===m?r+=" navigating-from-left":o===g&&(r+=" navigating-from-right"),o===u&&(r+=" previous"),e.createElement("div",{className:r},e.createElement(ee,{graphingTile:t,graphingTileIndex:n,graphingTileControls:l.controls}))})),e.createElement("div",{className:"horizontal-tile-page-container background",style:P}),i<=1?null:e.createElement(e.Fragment,null,e.createElement("button",{type:"button",className:"navigate-button navigate-left-button",onMouseEnter:x,onMouseLeave:y,onMouseDown:b,onClick:T},e.createElement("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M7.40991 10.643L2.82991 6.05298L7.40991 1.46298L5.99991 0.0529785L-8.80003e-05 6.05298L5.99991 12.053L7.40991 10.643Z",fill:"#828282"}))),e.createElement("button",{type:"button",className:"navigate-button navigate-right-button",onMouseEnter:w,onMouseLeave:N,onMouseDown:M,onClick:S},e.createElement("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M0.589843 1.46298L5.16984 6.05298L0.589844 10.643L1.99984 12.053L7.99984 6.05298L1.99984 0.0529785L0.589843 1.46298Z",fill:"#828282"}))))),i<=1?null:e.createElement("div",{className:"horizontal-tile-paginators-container"},Array.from(Array(i).keys()).map((t=>{let n="paginator-anchor";return t===a&&(n+=" active"),e.createElement("a",{className:n,onMouseEnter:e=>{e.stopPropagation(),t!==a&&(t<a?(p(t),h(null)):(p(null),h(t)),d(null))},onMouseLeave:e=>{e.stopPropagation()},onMouseDown:e=>{e.stopPropagation()},onClick:e=>{if(e.stopPropagation(),t===a)return;const n=a,l=t;d(n),c(l),n<l?p(n):h(n)}})}))))};S("horizontal-tile",le);const oe=({graphingTile:t})=>{const n=null==t?void 0:t.tile;if(!n)return null;const[l,o]=e.useState(""),[r,i]=e.useState(null),[s,a]=e.useState([]),c=N();e.useEffect((()=>{const e=Object.keys(n.states);if(a(e.map((e=>{var t;return{label:null===(t=n.states[e])||void 0===t?void 0:t.title,value:e}}))),e&&e.length>0){const t=e[0];u(t)}else o(""),i(null)}),[n.states]);const u=e=>{o(e),i(n.states[e])};return e.createElement("div",{className:"selectable-states-tile-component"},e.createElement("div",{className:"selectable-states-tile-header"},e.createElement("div",{className:"selected-state-tile-title"},e.createElement("h6",null,null==r?void 0:r.title)),e.createElement("div",{className:"selectable-states-dropdown-container"},e.createElement(x,{options:s,label:"Select",value:l,handleChange:e=>{var t;u(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value),(null==c?void 0:c.handleSelectableStatesTileChange)&&(null==c||c.handleSelectableStatesTileChange(e))}}))),e.createElement("div",{className:"selected-state-tile-container"},r?e.createElement(I,{tilePrefix:l,graphingTiles:r.tiles,responsive:r.responsive,columns:r.columns,containerPadding:r.containerPadding,referenceMargin:r.referenceMargin,referenceWidth:r.referenceWidth}):null))};S("selectable-states-tile",oe);const re=({graphingTile:n,graphingTileIndex:l})=>{const o=null==n?void 0:n.tile;if(!o)return null;const r=N(),i=e=>{t.utils.isFunction(r.handleUIChange)&&r.handleUIChange(e)};return e.createElement("div",{className:"simple-form-tile-component"},(()=>{if(!t.utils.isArray(o.controls)||o.controls.length<0)return null;const r=o.controls;return e.createElement(ee,{graphingTile:n,graphingTileIndex:l,graphingTileControls:r,ControlProps:{onUIChange:i}})})())};S("simple-form-tile",re);const ie=({graphingTile:t,graphingTileIndex:n})=>{const l=null==t?void 0:t.tile;if(!l)return null;const o=[l.control],r={background:t.getBackground()};return e.createElement("div",{className:"single-tile-component",style:r},e.createElement(ee,{graphingTile:t,graphingTileIndex:n,graphingTileControls:o}))};S("single-tile",ie);const se=({graphingTile:t,graphingTileIndex:n})=>{const l=null==t?void 0:t.tile;if(!l)return null;const o=l.controls;return e.createElement("div",{className:"vertical-tile-component"},e.createElement(ee,{graphingTile:t,graphingTileIndex:n,graphingTileControls:o}))};S("vertical-tile",se);const ae=()=>{const e=ce.pop();e&&(e.classList.add("moorr-modal-container-closing"),setTimeout((()=>{e&&(p.unmountComponentAtNode(e),e.remove())}),300))};const ce=[],ue={},de=l.makeStyles((e=>({modal:{display:"flex",alignItems:"center",justifyContent:"center"},paper:{width:825,backgroundColor:e.palette.background.paper,borderRadius:"5px",boxShadow:e.shadows[5],padding:e.spacing(2,4,3)}}))),me=n=>{const l=de(),o={};n.fixedWidth&&(o.width=n.fixedWidth),n.fixedHeight&&(o.height=n.fixedHeight);let i=l.paper+" moorr-modal-content-container";n.contentClassName&&(i+=" "+n.contentClassName);const[s,a]=e.useState(!1),[c,u]=e.useState(!1);e.useEffect((()=>{u(!s&&!1!==n.showModal)}),[s,c,n.showModal]);const d=e=>{a(!0),(null==n?void 0:n.onDismiss)&&n.onDismiss(e)};let m=l.modal;switch(m+=" moorr-modal-container",n.effect){case"fade":m+=" moorr-fade-modal";break;case"slide":m+=" moorr-slide-modal"}return s&&(m+=" moorr-modal-closing"),e.createElement(r.Modal,{disableEnforceFocus:!0,className:m,open:c,onClose:d,closeAfterTransition:!0,BackdropComponent:r.Backdrop,BackdropProps:{timeout:300,onClick:e=>{e.preventDefault(),e.stopPropagation(),t.utils.isFunction(n.onBackdropClick)?n.onBackdropClick(e):d("backdrop")}}},(()=>{switch(n.effect){case"fade":default:return e.createElement(r.Fade,{in:c},e.createElement("div",{className:i,style:o},n.children));case"slide":return e.createElement(g.Slide,{in:c,direction:"left",timeout:300},e.createElement("div",{className:i},n.children))}})())},pe=e=>{var t,n,l,o,r;const i=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.modal;if(!i||!ue[i])return Promise.reject("invalid-modal");const s=new ue[i]((null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.props)||{}).open();(null===(l=null==e?void 0:e.detail)||void 0===l?void 0:l.then)&&s.then((t=>{var n,l;if(!(null==t?void 0:t.dismissed)&&(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.finally))try{null===(l=null==e?void 0:e.detail)||void 0===l||l.then(null==t?void 0:t.result)}catch(e){console.error(e)}})),(null===(o=null==e?void 0:e.detail)||void 0===o?void 0:o.catch)&&s.catch(null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.catch),s.finally((()=>{var t,n;if(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.finally)try{null===(n=null==e?void 0:e.detail)||void 0===n||n.finally()}catch(e){console.error(e)}})),(null==e?void 0:e.detail)&&((null==e?void 0:e.detail).promise=s)};document&&(document.removeEventListener("openModal",pe),document.addEventListener("openModal",pe)),exports.Button=({type:n,label:l})=>(e.useEffect((()=>(console.log(`Message from moorr-react-mui: ${t.utils.hello()}`),()=>{console.log(`Message from moorr-react-mui: ${t.utils.bye()}`)})),[]),n||(n="button"),e.createElement("button",{type:n,className:"moorr-button"},e.createElement("span",null,l))),exports.Dropdown=x,exports.FadeModal=t=>e.createElement(me,{effect:"fade",contentClassName:`${t.className}-content-container`,fixedWidth:t.widthValue,fixedHeight:t.heightValue,showModal:t.showModal,onClose:t.onClose,onDismiss:t.onDismiss,onBackdropClick:t.onBackdropClick},e.createElement("div",{className:`${t.className} moorr-modal-container`},e.createElement("div",{className:"moorr-modal-header"},t.renderHeader),e.createElement("div",{className:"moorr-modal-body"},t.renderBody),!1===t.hasFooter?null:e.createElement("div",{className:"moorr-modal-footer"},e.createElement("div",{className:"left-buttons"},t.renderLeftButtons),e.createElement("div",{className:"status-message"},t.renderStatusMessage),e.createElement("div",{className:"right-buttons"},t.renderRightButtons)))),exports.FormGroupModel=z,exports.FormGroupsTile=ne,exports.FormGroupsTileModel=j,exports.FormInputModel=class extends O{constructor(e){super(e),this.inputLabel=e.inputLabel||"",this.readOnly=!0===e.readOnly,this.readOnlyBorderless=!0===e.readOnlyBorderless,this.hasAsAtDate=!1===e.hasAsAtDate||!0===e.hasAsAtDate?e.hasAsAtDate:null,this.staticAsAtDate=!0===e.staticAsAtDate,this.validationSchemaPath=(t.utils.isArray(e.validationSchemaPath)?e.validationSchemaPath:[]).filter((e=>t.utils.isString(e))),this.validationErrorMessages=e.validationErrorMessages||{}}},exports.GraphingContext=w,exports.GraphingControl=Y,exports.GraphingControlModel=O,exports.GraphingControlSettingsModel=_,exports.GraphingGrid=({})=>{const{settings:n}=N(),[l,o]=e.useState(null),[r,i]=e.useState(!1);e.useEffect((()=>{setTimeout((()=>{window.dispatchEvent(new Event("resize")),setTimeout((()=>{i(!0)}),300)}),300)}),[]),e.useEffect((()=>{o(n?new D(n):null)}),[n]);const s=()=>(null==n?void 0:n.infoIconUrl)&&n.infoIconHref?e.createElement("a",{className:"information-anchor",href:n.infoIconHref,target:"_blank"},e.createElement("img",{alt:null==n?void 0:n.title,src:null==n?void 0:n.infoIconUrl})):null;if(!l)return null;let a="graphing-grid-container";return r&&(a+=" in"),e.createElement(e.Fragment,null,e.createElement("div",{className:a},t.utils.isNullOrUndefined(null==n?void 0:n.title)?null:e.createElement(e.Fragment,null,e.createElement("h2",{className:"graphing-grid-title"},null==n?void 0:n.title,s()),e.createElement("hr",{className:"graphing-grid-hr"})),e.createElement(I,{graphingTiles:l.tiles,responsive:l.responsive,columns:l.columns,containerPadding:l.containerPadding,referenceMargin:l.referenceMargin,referenceWidth:l.referenceWidth})))},exports.GraphingSettingsModel=D,exports.GraphingTile=P,exports.GraphingTileControls=ee,exports.GraphingTileModel=R,exports.GraphingTileSettingsModel=q,exports.GraphingTiles=I,exports.HorizontalTile=le,exports.HorizontalTileModel=V,exports.Modal=class{constructor(e){this._props=e}open(){const t=this._props;return new Promise(((n,l)=>{let o,r;"function"==typeof t.onClose&&(o=t.onClose),t.onClose=e=>{o&&o(e),n({dismissed:!1,result:e}),t.showModal=!1,ae()},"function"==typeof t.onDismiss&&(r=t.onClose),t.onDismiss=()=>{r&&r(),n({dismissed:!0}),t.showModal=!1,ae()},t.showModal=!0;let i=e.createElement(C,{stylePrefix:"MoorrReactMuiModal"},e.createElement(this.getComponent(),t));ce.push(this._container=document.createElement("div")),this._container.className="moorr-modal-container",document.body.appendChild(this._container),p.render(i,this._container)}))}},exports.MoorrModal=me,exports.MultipleControlsTileModel=U,exports.SelectableStatesTile=oe,exports.SelectableStatesTileModel=Z,exports.SimpleFormTile=re,exports.SimpleFormTileModel=K,exports.SingleControlTileModel=W,exports.SingleTile=ie,exports.SingleTileModel=J,exports.SvgIcon=b,exports.VerticalTile=se,exports.VerticalTileModel=Q,exports.createGraphingControl=H,exports.createGraphingControls=function(e){const t=[];return e.forEach((e=>{const n=H(e);n&&t.push(n)})),t},exports.createGraphingTile=B,exports.createGraphingTiles=function(e){const t=[];return e.forEach((e=>{const n=B(e);n&&t.push(n)})),t},exports.modals=ue,exports.modalsStack=ce,exports.registerGraphingControl=function(e,t){$[e]=t},exports.registerGraphingControlComponent=function(e,t){e&&t&&(X[e]=t)},exports.registerGraphingTile=L,exports.registerGraphingTileComponent=S,exports.registerSvgIconComponent=function(e,t){e&&t&&(y[e]=t)},exports.toastMessage=(t,n)=>{(t=>{h.toast(t,{icon:e.createElement(f,{sx:{color:"#EB5757"}}),style:{color:"#EB5757",backgroundColor:"#FCECEC",border:"2px solid #EB5757",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"}})})(n)},exports.useGraphingContext=N;
1
+ "use strict";var e=require("react"),t=require("moorr-common"),n=require("@material-ui/core/MenuItem"),l=require("@material-ui/core/styles"),o=require("@material-ui/core/TextField"),r=require("@material-ui/core"),i=require("@material-ui/styles"),s=require("uuid"),a=require("react-grid-layout"),c=require("@mui/material/Accordion"),u=require("@mui/material/AccordionSummary"),d=require("@mui/material/AccordionDetails"),m=require("@mui/icons-material/ExpandMore"),p=require("react-dom"),g=require("@mui/material"),h=require("react-toastify"),f=require("@mui/icons-material/Cancel");const v=e=>({root:{"&:hover:not($disabled):not($focused):not($error) $notchedOutline":{},"&$checked":{color:"var(--primary-color)"},"& .vldt-MuiSelect-select.vldt-MuiSelect-select":{color:"var(--grey-color-2)"}},disabled:{},focused:{},error:{},notchedOutline:{},checked:{},notchedOutlineMBRequired:{flex:3,borderColor:"blue",borderWidth:2},fieldSetMBRequired:{"& fieldset":{flex:3,borderColor:"blue",borderWidth:2}},fieldSetErrorField:{"& fieldset":{borderColor:"var(--error-color)"}},blue:{color:"blue"}});l.makeStyles(v);const E=l.makeStyles((()=>l.createStyles({root:{overflow:"hidden",display:"flex",alignItems:"center","&.start":{flexDirection:"row"},"&.top":{flexDirection:"column"},"& .Mui-disabled":{backgroundColor:"var(--grey-color-3)",cursor:"not-allowed",borderRadius:"4px"}},label:{flex:2},field:{flex:3},required:{color:"red"},menuItem:{color:"var(--grey-color-2)","&:hover":{backgroundColor:"var(--primary-color-scale-25)",color:"var(--grey-color-2)"}},menuItemSelected:{color:"var(--grey-color-2)"},mandatory:{border:"red 2px solid",borderRadius:"4px"}})));var x=l.withStyles(v)((({handleChange:t,value:l,disabled:r=!1,name:i,className:s,classes:a,size:c,menuItemLabel:u,options:d,labelPlacement:m="start",label:p,required:g=!1,isMBRequiredField:h,fullWidth:f,selectIconComponent:v})=>{const{root:x,focused:y,error:b,notchedOutline:T,notchedOutlineMBRequired:C}=a,w=E();let N;return v&&(N={IconComponent:v}),e.createElement(o,{fullWidth:!1!==f,id:"outlined-basic",variant:"outlined",value:l,onChange:t,disabled:r,name:i,className:[s].join(" "),InputProps:{classes:{root:x,focused:y,error:b,notchedOutline:!h||l&&0!==(null==l?void 0:l.length)?!g||l&&0!==(null==l?void 0:l.length)?T:w.mandatory:C}},color:"primary",size:c||"small",select:!0,SelectProps:N,defaultValue:""},e.createElement(n,{value:"",disabled:!0},e.createElement("em",null,u)),d&&d.map(((t,l)=>"-separator-"===t?e.createElement(n,{key:`separator-${l}`,value:"",disabled:!0},e.createElement("em",null,"-----------")):e.createElement(n,{key:`menu-item-${l}-${t.value||t}`,value:t.value||t},t.label||t))))}));const y={};const b=({className:n,icon:l,width:o,height:r,fill:i,stroke:s,accent:a,dropShadow:c})=>{if(t.utils.isNullOrUndefined(l))return null;const u=y[l]||null;return u?e.createElement(u,{className:n,fill:i,width:o,height:r,stroke:s,accent:a,dropShadow:c}):null},T={};var C=({stylePrefix:t,children:n})=>{let o;if(t)o=T[t]?T[t]:T[t]=i.createGenerateClassName({seed:t});else{const e=`MoorrStylesProvider-${s.v4()}-`;o=i.createGenerateClassName({seed:e})}return e.createElement(i.StylesProvider,{generateClassName:o,injectFirst:!0},e.createElement(r.StylesProvider,{generateClassName:o,injectFirst:!0},e.createElement(l.StylesProvider,{generateClassName:o},n)))};const w=e.createContext({});function N(){return e.useContext(w)}const M={};function S(e,t){e&&t&&(M[e]=t)}const P=({graphingTile:t,graphingTileIndex:n})=>{var l;if(!(null===(l=null==t?void 0:t.tile)||void 0===l?void 0:l.tileType))return null;const o=M[t.tile.tileType]||null;return o?e.createElement(o,{graphingTile:t,graphingTileIndex:n}):null},k=[20,20],F={lg:600,sm:0},G={lg:8,sm:2},I=({tilePrefix:t,responsive:n,columns:l,containerPadding:o,referenceMargin:r,referenceWidth:i,graphingTiles:s})=>{const[c,u]=e.useState(null),[d,m]=e.useState(null),[p,g]=e.useState(null),[h,f]=e.useState(null),v=e.useRef(null),E=()=>{const e=(null==v?void 0:v.current)?(null==v?void 0:v.current).getBoundingClientRect().width:null;f(e);const t=T(e);u(t)};let x;const y=e=>{E(),clearTimeout(x),x=setTimeout((()=>{E()}),300)};e.useEffect((()=>{E()}),[v]),e.useEffect((()=>(window.addEventListener("resize",y),()=>{window.removeEventListener("resize",y)})),[]),e.useEffect((()=>{if(n){if(!Array.isArray(s)||0===s.length)return void g({lg:[]});g({lg:s.map(((e,n)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${t?t+"_":""}tile_${n}`})))})}else{if(!Array.isArray(s)||0===s.length)return void m([]);m(s.map(((e,n)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${t?t+"_":""}tile_${n}`,static:!0}))))}}),[s]);const b=()=>null==s?void 0:s.map(((n,l)=>{if(!n.tile||!n.visible)return null;let o="graphing-tile-container";!1!==n.border&&(o+=" bordered"),n.autoHeight&&(o+=" auto-height");const r=`${t?t+"_":""}tile_${l}`;return e.createElement("div",{className:o,key:r},e.createElement(P,{graphingTile:n,graphingTileIndex:l}))})),T=e=>{if(!r||isNaN(r)||r<=0||!i||isNaN(i)||i<=0||null==e)return k;const t=e/i*r;return[t,t]};return e.createElement("div",{ref:v,className:"graphing-tiles-container"},(()=>{if(!h||!c)return null;if(!1!==n){if(!p)return null;const t=[o||0,0];return e.createElement(a.Responsive,{width:h,breakpoints:F,cols:l||G,rowHeight:1,layouts:p,containerPadding:t,margin:c,isDraggable:!1},b())}return d?e.createElement(a,{width:h,cols:9,rowHeight:50,margin:c,isDraggable:!1,layout:d},b()):null})())},A={};function L(e,t){A[e]=t}function B(e){const t=A[null==e?void 0:e.tileType];return t?new t(e):null}class q{constructor(e){this.x=e.x,this.y=e.y,this.w=e.w,this.h=e.h,this.border=!0===e.border,this.background=e.background||null,this.autoHeight=!0===e.autoHeight,this.tile=B(e.tile),this.visible=!1!==e.visible}getBackground(){return this.background||"#FFFFFF"}}class D{constructor(e){this.title=e.title||"",this.infoIconUrl=e.infoUrl,this.infoIconHref=e.infoHref,this.responsive=!1!==e.responsive,this.columns=e.columns||{lg:8,sm:2},this.containerPadding=e.containerPadding||0,this.referenceMargin=e.referenceMargin||null,this.referenceWidth=e.referenceWidth||null,this.tiles=[],Array.isArray(e.tiles)&&e.tiles.forEach((e=>{this.tiles.push(new q(e))}))}}const $={};function H(e){const t=$[null==e?void 0:e.controlType];return t?new t(e):null}class O{constructor(e){this.controlType=e.controlType,this.dataKey=e.dataKey}}class _{constructor(e){this.border=e.border,this.background=e.background||null,this.control=H(e.control)}getBackground(e){return this.background||(null==e?void 0:e.background)||"#FFFFFF"}}class z{constructor(e){this.id=e.id||"",this.title=e.title||"",this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new _(e))})),this.add=!0===e.add}}class R{constructor(e){this.tileType=e.tileType}}class W extends R{constructor(e){super(e),this.control=new _(e.control)}}class U extends R{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new _(e))}))}}class j extends R{constructor(e){super(e),t.utils.isArray(e.formGroups)&&e.formGroups.length>0?this.formGroups=e.formGroups.map((e=>new z(e))):this.formGroups=[]}}L("form-groups-tile",j);class V extends U{constructor(e){super(e),this.controlsPerPage=e.controlsPerPage,(isNaN(this.controlsPerPage)||this.controlsPerPage<=1)&&(this.controlsPerPage=1)}}L("horizontal-tile",V);class Z extends U{constructor(e){super(e),this.states={};for(const t in e.states){const n=e.states[t];n&&(this.states[t]=new D(n))}}}L("selectable-states-tile",Z);class K extends R{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new _(e))}))}}L("simple-form-tile",K);class J extends W{constructor(e){super(e)}}L("single-tile",J);class Q extends U{constructor(e){super(e)}}L("vertical-tile",Q);const X={};const Y=({graphingTile:t,graphingTileIndex:n,graphingTileControl:l,ControlProps:o})=>{var r;if(!(null===(r=null==l?void 0:l.control)||void 0===r?void 0:r.controlType))return null;const i=X[l.control.controlType]||null;return i?e.createElement(i,Object.assign({graphingTile:t,graphingTileIndex:n,graphingTileControl:l},o)):null},ee=({graphingTile:t,graphingTileIndex:n,graphingTileControls:l,ControlProps:o})=>{var r,i;let s="graphing-tile-controls-container";return(null===(r=null==t?void 0:t.tile)||void 0===r?void 0:r.tileType)&&(s+=" "+(null===(i=null==t?void 0:t.tile)||void 0===i?void 0:i.tileType)),e.createElement("div",{className:s},null==l?void 0:l.map(((l,r)=>{var i,s;if(!l.control)return null;let a="graphing-tile-control-container";(null===(i=l.control)||void 0===i?void 0:i.controlType)&&(a+=" "+(null===(s=l.control)||void 0===s?void 0:s.controlType)),!1!==l.border&&(a+=" bordered");const c=`control_${n}_${r}`;return e.createElement("div",{className:a,key:c},e.createElement(Y,{graphingTile:t,graphingTileIndex:n,graphingTileControl:l,ControlProps:o}))})))};function te(e,t,n,l){return new(n||(n=Promise))((function(o,r){function i(e){try{a(l.next(e))}catch(e){r(e)}}function s(e){try{a(l.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}a((l=l.apply(e,t||[])).next())}))}const ne=({graphingTile:n,graphingTileIndex:l})=>{const o=null==n?void 0:n.tile;if(!o)return null;const r=N();return e.createElement("div",{className:"form-groups-tile-component"},!t.utils.isArray(o.formGroups)||o.formGroups.length<0?null:o.formGroups.map(((o,i)=>{const s=e.useRef(null),[a,p]=e.useState("normal"),[g,h]=e.useState("form-group-container");e.useEffect((()=>{y()}),[g,a]);const[f,v]=e.useState(0),[E,x]=e.useState(!0);e.useEffect((()=>{if(E){const e=s.current;t.utils.isNullOrUndefined(e)?v(0):setTimeout((()=>{v(e.scrollHeight)}),10)}else v(0)}),[E]);const y=e=>{if(E){const e=s.current;t.utils.isNullOrUndefined(e)?v(0):setTimeout((()=>{v(Math.max(e.clientHeight,e.scrollHeight))}),10)}else v(0)},T=e.useCallback((()=>!0!==o.add?null:e.createElement("button",{type:"button",className:"form-group-tile-add-button",onClick:C,disabled:"add"==a},e.createElement(b,{icon:"add-icon",stroke:"#ffffff"}))),[a]);e.useCallback((()=>"add"===a?null:e.createElement("svg",{viewBox:"0 0 11 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M5.89844 1.1626L10.4688 5.70947C10.6797 5.94385 10.6797 6.29541 10.4688 6.50635L9.92969 7.04541C9.71875 7.25635 9.36719 7.25635 9.13281 7.04541L5.5 3.43603L1.89063 7.04541C1.65625 7.25635 1.30469 7.25635 1.09375 7.04541L0.554688 6.50635C0.34375 6.29541 0.34375 5.94385 0.554688 5.70947L5.125 1.1626C5.33594 0.95166 5.6875 0.95166 5.89844 1.1626Z",fill:"#333333"}))),[a]);const C=e=>{e.stopPropagation(),p("add"),x(!0)},w=e=>te(void 0,void 0,void 0,(function*(){t.utils.isFunction(null==r?void 0:r.handleFormGroupCancel)&&(yield Promise.all([null==r?void 0:r.handleFormGroupCancel({formGroup:o})])),p("normal")})),N=e=>te(void 0,void 0,void 0,(function*(){if(t.utils.isFunction(null==r?void 0:r.handleFormGroupSave)){const[e]=yield Promise.all([null==r?void 0:r.handleFormGroupSave({formGroup:o})]);if(!1===e)return}p("normal")}));let M="form-group-container";return t.utils.isFunction(r.isFormGroupVisible)&&(r.isFormGroupVisible(o.id)||(M+=" hidden")),M!==g&&h(M),e.createElement(c,{className:M,expanded:E,onChange:e=>{"add"!==a&&x((e=>!e))},TransitionProps:{unmountOnExit:!0}},e.createElement(u,{className:"form-group-title",expandIcon:"add"!==a?e.createElement(m,null):null},e.createElement("span",{className:"form-group-title-text"},o.title),T()),e.createElement("hr",null),e.createElement(d,{className:"form-group-components"},(()=>{if("add"===a){let n;return t.utils.isFunction(r.renderFormGroup)&&(n=r.renderFormGroup(o,"add")),e.createElement(e.Fragment,null,n,e.createElement("hr",null),e.createElement("div",{className:"form-group-add-mode-buttons"},e.createElement("button",{className:"cancel-button",onClick:w},"Cancel"),e.createElement("button",{className:"save-button",onClick:N},"Save")))}{const i=o.controls;let s;return t.utils.isFunction(r.renderFormGroup)&&(s=r.renderFormGroup(o,"normal"),!t.utils.isNullOrUndefined(s))?s:e.createElement(ee,{graphingTile:n,graphingTileIndex:l,graphingTileControls:i,ControlProps:{onUIChange:y}})}})()))})))};S("form-groups-tile",ne);const le=({graphingTile:t,graphingTileIndex:n})=>{const l=null==t?void 0:t.tile;if(!l)return null;const[o,r]=e.useState(null),[i,s]=e.useState(0),[a,c]=e.useState(0),[u,d]=e.useState(null),[m,p]=e.useState(null),[g,h]=e.useState(null),[f,v]=e.useState([]);e.useEffect((()=>{let e=[];const t=Math.ceil(l.controls.length/l.controlsPerPage);if(t>0)for(let n=0;n<t;n++){const t={pageIndex:n,controls:[]};for(let e=0;e<l.controlsPerPage;e++){const o=n*l.controlsPerPage+e;if(o>=l.controls.length)break;t.controls.push(l.controls[o])}e.push(t)}s(t),c(0),d(null),p(null),h(null),v(e)}),l.controls);const E=e=>{let t=e-1;t<0&&(t=i-1),p(t)},x=e=>{e.stopPropagation(),E(a),h(null),d(null)},y=e=>{e.stopPropagation()},b=e=>{e.stopPropagation()},T=e=>{if(e.stopPropagation(),null!==o)return;const t=a;let n=a-1;n<0&&(n=i-1),d(t),c(n),p(null),h(t);const l=setTimeout((()=>{E(n),h(null),d(null),setTimeout((function(){r(null)}),300)}),300);r(l)},C=e=>{let t=e+1;t>=i&&(t=0),h(t)},w=e=>{e.stopPropagation(),p(null),C(a),d(null)},N=e=>{e.stopPropagation()},M=e=>{e.stopPropagation()},S=e=>{if(e.stopPropagation(),null!==o)return;const t=a;let n=a+1;n>=i&&(n=0),d(t),c(n),p(t),h(null);const l=setTimeout((()=>{p(null),C(n),d(null),setTimeout((function(){r(null)}),300)}),300);r(l)},P={background:t.getBackground()};return e.createElement("div",{className:"horizontal-tile-component",style:P},e.createElement("div",{className:"horizontal-tile-pages-container"},f.map(((l,o)=>{let r="horizontal-tile-page-container";return o===a?r+=" active":o===m?r+=" navigating-from-left":o===g&&(r+=" navigating-from-right"),o===u&&(r+=" previous"),e.createElement("div",{className:r},e.createElement(ee,{graphingTile:t,graphingTileIndex:n,graphingTileControls:l.controls}))})),e.createElement("div",{className:"horizontal-tile-page-container background",style:P}),i<=1?null:e.createElement(e.Fragment,null,e.createElement("button",{type:"button",className:"navigate-button navigate-left-button",onMouseEnter:x,onMouseLeave:y,onMouseDown:b,onClick:T},e.createElement("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M7.40991 10.643L2.82991 6.05298L7.40991 1.46298L5.99991 0.0529785L-8.80003e-05 6.05298L5.99991 12.053L7.40991 10.643Z",fill:"#828282"}))),e.createElement("button",{type:"button",className:"navigate-button navigate-right-button",onMouseEnter:w,onMouseLeave:N,onMouseDown:M,onClick:S},e.createElement("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M0.589843 1.46298L5.16984 6.05298L0.589844 10.643L1.99984 12.053L7.99984 6.05298L1.99984 0.0529785L0.589843 1.46298Z",fill:"#828282"}))))),i<=1?null:e.createElement("div",{className:"horizontal-tile-paginators-container"},Array.from(Array(i).keys()).map((t=>{let n="paginator-anchor";return t===a&&(n+=" active"),e.createElement("a",{className:n,onMouseEnter:e=>{e.stopPropagation(),t!==a&&(t<a?(p(t),h(null)):(p(null),h(t)),d(null))},onMouseLeave:e=>{e.stopPropagation()},onMouseDown:e=>{e.stopPropagation()},onClick:e=>{if(e.stopPropagation(),t===a)return;const n=a,l=t;d(n),c(l),n<l?p(n):h(n)}})}))))};S("horizontal-tile",le);const oe=({graphingTile:t})=>{const n=null==t?void 0:t.tile;if(!n)return null;const[l,o]=e.useState(""),[r,i]=e.useState(null),[s,a]=e.useState([]),c=N();e.useEffect((()=>{const e=Object.keys(n.states);if(a(e.map((e=>{var t;return{label:null===(t=n.states[e])||void 0===t?void 0:t.title,value:e}}))),e&&e.length>0){const t=e[0];u(t)}else o(""),i(null)}),[n.states]);const u=e=>{o(e),i(n.states[e])};return e.createElement("div",{className:"selectable-states-tile-component"},e.createElement("div",{className:"selectable-states-tile-header"},e.createElement("div",{className:"selected-state-tile-title"},e.createElement("h6",null,null==r?void 0:r.title)),e.createElement("div",{className:"selectable-states-dropdown-container"},e.createElement(x,{options:s,label:"Select",value:l,handleChange:e=>{var t;u(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value),(null==c?void 0:c.handleSelectableStatesTileChange)&&(null==c||c.handleSelectableStatesTileChange(e))}}))),e.createElement("div",{className:"selected-state-tile-container"},r?e.createElement(I,{tilePrefix:l,graphingTiles:r.tiles,responsive:r.responsive,columns:r.columns,containerPadding:r.containerPadding,referenceMargin:r.referenceMargin,referenceWidth:r.referenceWidth}):null))};S("selectable-states-tile",oe);const re=({graphingTile:n,graphingTileIndex:l})=>{const o=null==n?void 0:n.tile;if(!o)return null;const r=N(),i=e=>{t.utils.isFunction(r.handleUIChange)&&r.handleUIChange(e)};return e.createElement("div",{className:"simple-form-tile-component"},(()=>{if(!t.utils.isArray(o.controls)||o.controls.length<0)return null;const r=o.controls;return e.createElement(ee,{graphingTile:n,graphingTileIndex:l,graphingTileControls:r,ControlProps:{onUIChange:i}})})())};S("simple-form-tile",re);const ie=({graphingTile:t,graphingTileIndex:n})=>{const l=null==t?void 0:t.tile;if(!l)return null;const o=[l.control],r={background:t.getBackground()};return e.createElement("div",{className:"single-tile-component",style:r},e.createElement(ee,{graphingTile:t,graphingTileIndex:n,graphingTileControls:o}))};S("single-tile",ie);const se=({graphingTile:t,graphingTileIndex:n})=>{const l=null==t?void 0:t.tile;if(!l)return null;const o=l.controls;return e.createElement("div",{className:"vertical-tile-component"},e.createElement(ee,{graphingTile:t,graphingTileIndex:n,graphingTileControls:o}))};S("vertical-tile",se);const ae=()=>{const e=ce.pop();e&&(e.classList.add("moorr-modal-container-closing"),setTimeout((()=>{e&&(p.unmountComponentAtNode(e),e.remove())}),300))};const ce=[],ue={},de=l.makeStyles((e=>({modal:{display:"flex",alignItems:"center",justifyContent:"center"},paper:{width:825,backgroundColor:e.palette.background.paper,borderRadius:"5px",boxShadow:e.shadows[5],padding:e.spacing(2,4,3)}}))),me=n=>{const l=de(),o={};n.fixedWidth&&(o.width=n.fixedWidth),n.fixedHeight&&(o.height=n.fixedHeight);let i=l.paper+" moorr-modal-content-container";n.contentClassName&&(i+=" "+n.contentClassName);const[s,a]=e.useState(!1),[c,u]=e.useState(!1);e.useEffect((()=>{u(!s&&!1!==n.showModal)}),[s,c,n.showModal]);const d=e=>{a(!0),(null==n?void 0:n.onDismiss)&&n.onDismiss(e)};let m=l.modal;switch(m+=" moorr-modal-container",n.effect){case"fade":m+=" moorr-fade-modal";break;case"slide":m+=" moorr-slide-modal"}return s&&(m+=" moorr-modal-closing"),e.createElement(r.Modal,{disableEnforceFocus:!0,className:m,open:c,onClose:d,closeAfterTransition:!0,BackdropComponent:r.Backdrop,BackdropProps:{timeout:300,onClick:e=>{e.preventDefault(),e.stopPropagation(),t.utils.isFunction(n.onBackdropClick)?n.onBackdropClick(e):d("backdrop")}}},(()=>{switch(n.effect){case"fade":default:return e.createElement(r.Fade,{in:c},e.createElement("div",{className:i,style:o},n.children));case"slide":return e.createElement(g.Slide,{in:c,direction:"left",timeout:300},e.createElement("div",{className:i},n.children))}})())},pe=e=>{var t,n,l,o,r;const i=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.modal;if(!i||!ue[i])return Promise.reject("invalid-modal");const s=new ue[i]((null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.props)||{}).open();(null===(l=null==e?void 0:e.detail)||void 0===l?void 0:l.then)&&s.then((t=>{var n,l;if(!(null==t?void 0:t.dismissed)&&(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.finally))try{null===(l=null==e?void 0:e.detail)||void 0===l||l.then(null==t?void 0:t.result)}catch(e){console.error(e)}})),(null===(o=null==e?void 0:e.detail)||void 0===o?void 0:o.catch)&&s.catch(null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.catch),s.finally((()=>{var t,n;if(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.finally)try{null===(n=null==e?void 0:e.detail)||void 0===n||n.finally()}catch(e){console.error(e)}})),(null==e?void 0:e.detail)&&((null==e?void 0:e.detail).promise=s)};document&&(document.removeEventListener("openModal",pe),document.addEventListener("openModal",pe)),exports.Button=({type:n,label:l})=>(e.useEffect((()=>(console.log(`Message from moorr-react-mui: ${t.utils.hello()}`),()=>{console.log(`Message from moorr-react-mui: ${t.utils.bye()}`)})),[]),n||(n="button"),e.createElement("button",{type:n,className:"moorr-button"},e.createElement("span",null,l))),exports.Dropdown=x,exports.FadeModal=t=>e.createElement(me,{effect:"fade",contentClassName:`${t.className}-content-container`,fixedWidth:t.widthValue,fixedHeight:t.heightValue,showModal:t.showModal,onClose:t.onClose,onDismiss:t.onDismiss,onBackdropClick:t.onBackdropClick},e.createElement("div",{className:`${t.className} moorr-modal-container`},e.createElement("div",{className:"moorr-modal-header"},t.renderHeader),e.createElement("div",{className:"moorr-modal-body"},t.renderBody),!1===t.hasFooter?null:e.createElement("div",{className:"moorr-modal-footer"},e.createElement("div",{className:"left-buttons"},t.renderLeftButtons),e.createElement("div",{className:"status-message"},t.renderStatusMessage),e.createElement("div",{className:"right-buttons"},t.renderRightButtons)))),exports.FormGroupModel=z,exports.FormGroupsTile=ne,exports.FormGroupsTileModel=j,exports.FormInputModel=class extends O{constructor(e){super(e),this.inputLabel=e.inputLabel||"",this.readOnly=!0===e.readOnly,this.readOnlyBorderless=!0===e.readOnlyBorderless,this.hasAsAtDate=!1===e.hasAsAtDate||!0===e.hasAsAtDate?e.hasAsAtDate:null,this.staticAsAtDate=!0===e.staticAsAtDate,this.validationSchemaPath=(t.utils.isArray(e.validationSchemaPath)?e.validationSchemaPath:[]).filter((e=>t.utils.isString(e))),this.validationErrorMessages=e.validationErrorMessages||{}}},exports.GraphingContext=w,exports.GraphingControl=Y,exports.GraphingControlModel=O,exports.GraphingControlSettingsModel=_,exports.GraphingGrid=({})=>{const{settings:n}=N(),[l,o]=e.useState(null),[r,i]=e.useState(!1);e.useEffect((()=>{setTimeout((()=>{window.dispatchEvent(new Event("resize")),setTimeout((()=>{i(!0)}),300)}),300)}),[]),e.useEffect((()=>{o(n?new D(n):null)}),[n]);const s=()=>(null==n?void 0:n.infoIconUrl)&&n.infoIconHref?e.createElement("a",{className:"information-anchor",href:n.infoIconHref,target:"_blank"},e.createElement("img",{alt:null==n?void 0:n.title,src:null==n?void 0:n.infoIconUrl})):null;if(!l)return null;let a="graphing-grid-container";return r&&(a+=" in"),e.createElement(e.Fragment,null,e.createElement("div",{className:a},t.utils.isNullOrUndefined(null==n?void 0:n.title)?null:e.createElement(e.Fragment,null,e.createElement("h2",{className:"graphing-grid-title"},null==n?void 0:n.title,s()),e.createElement("hr",{className:"graphing-grid-hr"})),e.createElement(I,{graphingTiles:l.tiles,responsive:l.responsive,columns:l.columns,containerPadding:l.containerPadding,referenceMargin:l.referenceMargin,referenceWidth:l.referenceWidth})))},exports.GraphingSettingsModel=D,exports.GraphingTile=P,exports.GraphingTileControls=ee,exports.GraphingTileModel=R,exports.GraphingTileSettingsModel=q,exports.GraphingTiles=I,exports.HorizontalTile=le,exports.HorizontalTileModel=V,exports.Modal=class{constructor(e){this._props=e}open(){const t=this._props;return new Promise(((n,l)=>{let o,r;"function"==typeof t.onClose&&(o=t.onClose),t.onClose=e=>{o&&o(e),n({dismissed:!1,result:e}),t.showModal=!1,ae()},"function"==typeof t.onDismiss&&(r=t.onClose),t.onDismiss=()=>{r&&r(),n({dismissed:!0}),t.showModal=!1,ae()},t.showModal=!0;let i=e.createElement(C,{stylePrefix:"MoorrReactMuiModal"},e.createElement(this.getComponent(),t));ce.push(this._container=document.createElement("div")),this._container.className="moorr-modal-container",document.body.appendChild(this._container),p.render(i,this._container)}))}},exports.MoorrModal=me,exports.MultipleControlsTileModel=U,exports.SelectableStatesTile=oe,exports.SelectableStatesTileModel=Z,exports.SimpleFormTile=re,exports.SimpleFormTileModel=K,exports.SingleControlTileModel=W,exports.SingleTile=ie,exports.SingleTileModel=J,exports.SvgIcon=b,exports.VerticalTile=se,exports.VerticalTileModel=Q,exports.createGraphingControl=H,exports.createGraphingControls=function(e){const t=[];return e.forEach((e=>{const n=H(e);n&&t.push(n)})),t},exports.createGraphingTile=B,exports.createGraphingTiles=function(e){const t=[];return e.forEach((e=>{const n=B(e);n&&t.push(n)})),t},exports.modals=ue,exports.modalsStack=ce,exports.registerGraphingControl=function(e,t){$[e]=t},exports.registerGraphingControlComponent=function(e,t){e&&t&&(X[e]=t)},exports.registerGraphingTile=L,exports.registerGraphingTileComponent=S,exports.registerSvgIconComponent=function(e,t){e&&t&&(y[e]=t)},exports.toastMessage=(t,n)=>{(t=>{h.toast(t,{icon:e.createElement(f,{sx:{color:"#EB5757"}}),style:{color:"#EB5757",backgroundColor:"#FCECEC",border:"2px solid #EB5757",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"}})})(n)},exports.useGraphingContext=N;
@@ -43,7 +43,7 @@ export type GraphingContextResult = {
43
43
  isFormGroupVisible?: (id: string) => boolean;
44
44
  renderFormGroup?: (formGroup: FormGroupModel, mode: "normal" | "add") => React.ReactNode;
45
45
  handleFormGroupCancel?: (e: any) => void | Promise<void>;
46
- handleFormGroupSave?: (e: any) => void | Promise<void>;
46
+ handleFormGroupSave?: (e: any) => boolean | Promise<boolean>;
47
47
  handleInputEvent?: (e: InputEventArgs) => Promise<void>;
48
48
  handleInputChange?: (e: InputChangeEventArgs) => Promise<void>;
49
49
  handleInputDataRequired?: (e: InputDataRequiredEventArgs) => Promise<void>;
package/index.d.ts CHANGED
@@ -294,7 +294,7 @@ type GraphingContextResult = {
294
294
  isFormGroupVisible?: (id: string) => boolean;
295
295
  renderFormGroup?: (formGroup: FormGroupModel, mode: "normal" | "add") => React.ReactNode;
296
296
  handleFormGroupCancel?: (e: any) => void | Promise<void>;
297
- handleFormGroupSave?: (e: any) => void | Promise<void>;
297
+ handleFormGroupSave?: (e: any) => boolean | Promise<boolean>;
298
298
  handleInputEvent?: (e: InputEventArgs) => Promise<void>;
299
299
  handleInputChange?: (e: InputChangeEventArgs) => Promise<void>;
300
300
  handleInputDataRequired?: (e: InputDataRequiredEventArgs) => Promise<void>;
package/index.js CHANGED
@@ -1 +1 @@
1
- import e,{useEffect as t,createContext as n,useContext as o,useState as l,useRef as r,useCallback as i}from"react";import{utils as a}from"moorr-common";import s from"@material-ui/core/MenuItem";import{makeStyles as c,createStyles as d,withStyles as u,StylesProvider as m}from"@material-ui/core/styles";import h from"@material-ui/core/TextField";import{StylesProvider as g,Modal as p,Backdrop as f,Fade as v}from"@material-ui/core";import{createGenerateClassName as E,StylesProvider as b}from"@material-ui/styles";import{v4 as y}from"uuid";import w,{Responsive as N}from"react-grid-layout";import T from"@mui/material/Accordion";import x from"@mui/material/AccordionSummary";import C from"@mui/material/AccordionDetails";import P from"@mui/icons-material/ExpandMore";import k from"react-dom";import{Slide as M}from"@mui/material";import{toast as F}from"react-toastify";import I from"@mui/icons-material/Cancel";const A=({type:n,label:o})=>(t((()=>(console.log(`Message from moorr-react-mui: ${a.hello()}`),()=>{console.log(`Message from moorr-react-mui: ${a.bye()}`)})),[]),n||(n="button"),e.createElement("button",{type:n,className:"moorr-button"},e.createElement("span",null,o))),L=e=>({root:{"&:hover:not($disabled):not($focused):not($error) $notchedOutline":{},"&$checked":{color:"var(--primary-color)"},"& .vldt-MuiSelect-select.vldt-MuiSelect-select":{color:"var(--grey-color-2)"}},disabled:{},focused:{},error:{},notchedOutline:{},checked:{},notchedOutlineMBRequired:{flex:3,borderColor:"blue",borderWidth:2},fieldSetMBRequired:{"& fieldset":{flex:3,borderColor:"blue",borderWidth:2}},fieldSetErrorField:{"& fieldset":{borderColor:"var(--error-color)"}},blue:{color:"blue"}});c(L);const S=c((()=>d({root:{overflow:"hidden",display:"flex",alignItems:"center","&.start":{flexDirection:"row"},"&.top":{flexDirection:"column"},"& .Mui-disabled":{backgroundColor:"var(--grey-color-3)",cursor:"not-allowed",borderRadius:"4px"}},label:{flex:2},field:{flex:3},required:{color:"red"},menuItem:{color:"var(--grey-color-2)","&:hover":{backgroundColor:"var(--primary-color-scale-25)",color:"var(--grey-color-2)"}},menuItemSelected:{color:"var(--grey-color-2)"},mandatory:{border:"red 2px solid",borderRadius:"4px"}})));var B=u(L)((({handleChange:t,value:n,disabled:o=!1,name:l,className:r,classes:i,size:a,menuItemLabel:c,options:d,labelPlacement:u="start",label:m,required:g=!1,isMBRequiredField:p,fullWidth:f,selectIconComponent:v})=>{const{root:E,focused:b,error:y,notchedOutline:w,notchedOutlineMBRequired:N}=i,T=S();let x;return v&&(x={IconComponent:v}),e.createElement(h,{fullWidth:!1!==f,id:"outlined-basic",variant:"outlined",value:n,onChange:t,disabled:o,name:l,className:[r].join(" "),InputProps:{classes:{root:E,focused:b,error:y,notchedOutline:!p||n&&0!==(null==n?void 0:n.length)?!g||n&&0!==(null==n?void 0:n.length)?w:T.mandatory:N}},color:"primary",size:a||"small",select:!0,SelectProps:x,defaultValue:""},e.createElement(s,{value:"",disabled:!0},e.createElement("em",null,c)),d&&d.map(((t,n)=>"-separator-"===t?e.createElement(s,{key:`separator-${n}`,value:"",disabled:!0},e.createElement("em",null,"-----------")):e.createElement(s,{key:`menu-item-${n}-${t.value||t}`,value:t.value||t},t.label||t))))}));const D={};function $(e,t){e&&t&&(D[e]=t)}const G=({className:t,icon:n,width:o,height:l,fill:r,stroke:i,accent:s,dropShadow:c})=>{if(a.isNullOrUndefined(n))return null;const d=D[n]||null;return d?e.createElement(d,{className:t,fill:r,width:o,height:l,stroke:i,accent:s,dropShadow:c}):null},O={};var H=({stylePrefix:t,children:n})=>{let o;if(t)o=O[t]?O[t]:O[t]=E({seed:t});else{const e=`MoorrStylesProvider-${y()}-`;o=E({seed:e})}return e.createElement(b,{generateClassName:o,injectFirst:!0},e.createElement(g,{generateClassName:o,injectFirst:!0},e.createElement(m,{generateClassName:o},n)))};const _=n({});function W(){return o(_)}const U={};function z(e,t){e&&t&&(U[e]=t)}const R=({graphingTile:t,graphingTileIndex:n})=>{var o;if(!(null===(o=null==t?void 0:t.tile)||void 0===o?void 0:o.tileType))return null;const l=U[t.tile.tileType]||null;return l?e.createElement(l,{graphingTile:t,graphingTileIndex:n}):null},j=[20,20],q={lg:600,sm:0},V={lg:8,sm:2},Z=({tilePrefix:n,responsive:o,columns:i,containerPadding:a,referenceMargin:s,referenceWidth:c,graphingTiles:d})=>{const[u,m]=l(null),[h,g]=l(null),[p,f]=l(null),[v,E]=l(null),b=r(null),y=()=>{const e=(null==b?void 0:b.current)?(null==b?void 0:b.current).getBoundingClientRect().width:null;E(e);const t=P(e);m(t)};let T;const x=e=>{y(),clearTimeout(T),T=setTimeout((()=>{y()}),300)};t((()=>{y()}),[b]),t((()=>(window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x)})),[]),t((()=>{if(o){if(!Array.isArray(d)||0===d.length)return void f({lg:[]});f({lg:d.map(((e,t)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${n?n+"_":""}tile_${t}`})))})}else{if(!Array.isArray(d)||0===d.length)return void g([]);g(d.map(((e,t)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${n?n+"_":""}tile_${t}`,static:!0}))))}}),[d]);const C=()=>null==d?void 0:d.map(((t,o)=>{if(!t.tile||!t.visible)return null;let l="graphing-tile-container";!1!==t.border&&(l+=" bordered"),t.autoHeight&&(l+=" auto-height");const r=`${n?n+"_":""}tile_${o}`;return e.createElement("div",{className:l,key:r},e.createElement(R,{graphingTile:t,graphingTileIndex:o}))})),P=e=>{if(!s||isNaN(s)||s<=0||!c||isNaN(c)||c<=0||null==e)return j;const t=e/c*s;return[t,t]};return e.createElement("div",{ref:b,className:"graphing-tiles-container"},(()=>{if(!v||!u)return null;if(!1!==o){if(!p)return null;const t=[a||0,0];return e.createElement(N,{width:v,breakpoints:q,cols:i||V,rowHeight:1,layouts:p,containerPadding:t,margin:u,isDraggable:!1},C())}return h?e.createElement(w,{width:v,cols:9,rowHeight:50,margin:u,isDraggable:!1,layout:h},C()):null})())},K={};function J(e,t){K[e]=t}function Q(e){const t=K[null==e?void 0:e.tileType];return t?new t(e):null}function X(e){const t=[];return e.forEach((e=>{const n=Q(e);n&&t.push(n)})),t}class Y{constructor(e){this.x=e.x,this.y=e.y,this.w=e.w,this.h=e.h,this.border=!0===e.border,this.background=e.background||null,this.autoHeight=!0===e.autoHeight,this.tile=Q(e.tile),this.visible=!1!==e.visible}getBackground(){return this.background||"#FFFFFF"}}class ee{constructor(e){this.title=e.title||"",this.infoIconUrl=e.infoUrl,this.infoIconHref=e.infoHref,this.responsive=!1!==e.responsive,this.columns=e.columns||{lg:8,sm:2},this.containerPadding=e.containerPadding||0,this.referenceMargin=e.referenceMargin||null,this.referenceWidth=e.referenceWidth||null,this.tiles=[],Array.isArray(e.tiles)&&e.tiles.forEach((e=>{this.tiles.push(new Y(e))}))}}const te={};function ne(e,t){te[e]=t}function oe(e){const t=te[null==e?void 0:e.controlType];return t?new t(e):null}function le(e){const t=[];return e.forEach((e=>{const n=oe(e);n&&t.push(n)})),t}class re{constructor(e){this.controlType=e.controlType,this.dataKey=e.dataKey}}class ie extends re{constructor(e){super(e),this.inputLabel=e.inputLabel||"",this.readOnly=!0===e.readOnly,this.readOnlyBorderless=!0===e.readOnlyBorderless,this.hasAsAtDate=!1===e.hasAsAtDate||!0===e.hasAsAtDate?e.hasAsAtDate:null,this.staticAsAtDate=!0===e.staticAsAtDate,this.validationSchemaPath=(a.isArray(e.validationSchemaPath)?e.validationSchemaPath:[]).filter((e=>a.isString(e))),this.validationErrorMessages=e.validationErrorMessages||{}}}class ae{constructor(e){this.border=e.border,this.background=e.background||null,this.control=oe(e.control)}getBackground(e){return this.background||(null==e?void 0:e.background)||"#FFFFFF"}}class se{constructor(e){this.id=e.id||"",this.title=e.title||"",this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new ae(e))})),this.add=!0===e.add}}class ce{constructor(e){this.tileType=e.tileType}}class de extends ce{constructor(e){super(e),this.control=new ae(e.control)}}class ue extends ce{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new ae(e))}))}}class me extends ce{constructor(e){super(e),a.isArray(e.formGroups)&&e.formGroups.length>0?this.formGroups=e.formGroups.map((e=>new se(e))):this.formGroups=[]}}J("form-groups-tile",me);class he extends ue{constructor(e){super(e),this.controlsPerPage=e.controlsPerPage,(isNaN(this.controlsPerPage)||this.controlsPerPage<=1)&&(this.controlsPerPage=1)}}J("horizontal-tile",he);class ge extends ue{constructor(e){super(e),this.states={};for(const t in e.states){const n=e.states[t];n&&(this.states[t]=new ee(n))}}}J("selectable-states-tile",ge);class pe extends ce{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new ae(e))}))}}J("simple-form-tile",pe);class fe extends de{constructor(e){super(e)}}J("single-tile",fe);class ve extends ue{constructor(e){super(e)}}J("vertical-tile",ve);const Ee=({})=>{const{settings:n}=W(),[o,r]=l(null),[i,s]=l(!1);t((()=>{setTimeout((()=>{window.dispatchEvent(new Event("resize")),setTimeout((()=>{s(!0)}),300)}),300)}),[]),t((()=>{r(n?new ee(n):null)}),[n]);const c=()=>(null==n?void 0:n.infoIconUrl)&&n.infoIconHref?e.createElement("a",{className:"information-anchor",href:n.infoIconHref,target:"_blank"},e.createElement("img",{alt:null==n?void 0:n.title,src:null==n?void 0:n.infoIconUrl})):null;if(!o)return null;let d="graphing-grid-container";return i&&(d+=" in"),e.createElement(e.Fragment,null,e.createElement("div",{className:d},a.isNullOrUndefined(null==n?void 0:n.title)?null:e.createElement(e.Fragment,null,e.createElement("h2",{className:"graphing-grid-title"},null==n?void 0:n.title,c()),e.createElement("hr",{className:"graphing-grid-hr"})),e.createElement(Z,{graphingTiles:o.tiles,responsive:o.responsive,columns:o.columns,containerPadding:o.containerPadding,referenceMargin:o.referenceMargin,referenceWidth:o.referenceWidth})))},be={};function ye(e,t){e&&t&&(be[e]=t)}const we=({graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:l})=>{var r;if(!(null===(r=null==o?void 0:o.control)||void 0===r?void 0:r.controlType))return null;const i=be[o.control.controlType]||null;return i?e.createElement(i,Object.assign({graphingTile:t,graphingTileIndex:n,graphingTileControl:o},l)):null},Ne=({graphingTile:t,graphingTileIndex:n,graphingTileControls:o,ControlProps:l})=>{var r,i;let a="graphing-tile-controls-container";return(null===(r=null==t?void 0:t.tile)||void 0===r?void 0:r.tileType)&&(a+=" "+(null===(i=null==t?void 0:t.tile)||void 0===i?void 0:i.tileType)),e.createElement("div",{className:a},null==o?void 0:o.map(((o,r)=>{var i,a;if(!o.control)return null;let s="graphing-tile-control-container";(null===(i=o.control)||void 0===i?void 0:i.controlType)&&(s+=" "+(null===(a=o.control)||void 0===a?void 0:a.controlType)),!1!==o.border&&(s+=" bordered");const c=`control_${n}_${r}`;return e.createElement("div",{className:s,key:c},e.createElement(we,{graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:l}))})))};function Te(e,t,n,o){return new(n||(n=Promise))((function(l,r){function i(e){try{s(o.next(e))}catch(e){r(e)}}function a(e){try{s(o.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?l(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}s((o=o.apply(e,t||[])).next())}))}const xe=({graphingTile:n,graphingTileIndex:o})=>{const s=null==n?void 0:n.tile;if(!s)return null;const c=W();return e.createElement("div",{className:"form-groups-tile-component"},!a.isArray(s.formGroups)||s.formGroups.length<0?null:s.formGroups.map(((s,d)=>{const u=r(null),[m,h]=l("normal"),[g,p]=l("form-group-container");t((()=>{y()}),[g,m]);const[f,v]=l(0),[E,b]=l(!0);t((()=>{if(E){const e=u.current;a.isNullOrUndefined(e)?v(0):setTimeout((()=>{v(e.scrollHeight)}),10)}else v(0)}),[E]);const y=e=>{if(E){const e=u.current;a.isNullOrUndefined(e)?v(0):setTimeout((()=>{v(Math.max(e.clientHeight,e.scrollHeight))}),10)}else v(0)},w=i((()=>!0!==s.add?null:e.createElement("button",{type:"button",className:"form-group-tile-add-button",onClick:N,disabled:"add"==m},e.createElement(G,{icon:"add-icon",stroke:"#ffffff"}))),[m]);i((()=>"add"===m?null:e.createElement("svg",{viewBox:"0 0 11 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M5.89844 1.1626L10.4688 5.70947C10.6797 5.94385 10.6797 6.29541 10.4688 6.50635L9.92969 7.04541C9.71875 7.25635 9.36719 7.25635 9.13281 7.04541L5.5 3.43603L1.89063 7.04541C1.65625 7.25635 1.30469 7.25635 1.09375 7.04541L0.554688 6.50635C0.34375 6.29541 0.34375 5.94385 0.554688 5.70947L5.125 1.1626C5.33594 0.95166 5.6875 0.95166 5.89844 1.1626Z",fill:"#333333"}))),[m]);const N=e=>{e.stopPropagation(),h("add"),b(!0)},k=e=>Te(void 0,void 0,void 0,(function*(){a.isFunction(null==c?void 0:c.handleFormGroupCancel)&&(yield Promise.all([null==c?void 0:c.handleFormGroupCancel({formGroup:s})])),h("normal")})),M=e=>Te(void 0,void 0,void 0,(function*(){a.isFunction(null==c?void 0:c.handleFormGroupSave)&&(yield Promise.all([null==c?void 0:c.handleFormGroupSave({formGroup:s})])),h("normal")}));let F="form-group-container";return a.isFunction(c.isFormGroupVisible)&&(c.isFormGroupVisible(s.id)||(F+=" hidden")),F!==g&&p(F),e.createElement(T,{className:F,expanded:E,onChange:e=>{"add"!==m&&b((e=>!e))},TransitionProps:{unmountOnExit:!0}},e.createElement(x,{className:"form-group-title",expandIcon:"add"!==m?e.createElement(P,null):null},e.createElement("span",{className:"form-group-title-text"},s.title),w()),e.createElement("hr",null),e.createElement(C,{className:"form-group-components"},(()=>{if("add"===m){let t;return a.isFunction(c.renderFormGroup)&&(t=c.renderFormGroup(s,"add")),e.createElement(e.Fragment,null,t,e.createElement("hr",null),e.createElement("div",{className:"form-group-add-mode-buttons"},e.createElement("button",{className:"cancel-button",onClick:k},"Cancel"),e.createElement("button",{className:"save-button",onClick:M},"Save")))}{const t=s.controls;let l;return a.isFunction(c.renderFormGroup)&&(l=c.renderFormGroup(s,"normal"),!a.isNullOrUndefined(l))?l:e.createElement(Ne,{graphingTile:n,graphingTileIndex:o,graphingTileControls:t,ControlProps:{onUIChange:y}})}})()))})))};z("form-groups-tile",xe);const Ce=({graphingTile:n,graphingTileIndex:o})=>{const r=null==n?void 0:n.tile;if(!r)return null;const[i,a]=l(null),[s,c]=l(0),[d,u]=l(0),[m,h]=l(null),[g,p]=l(null),[f,v]=l(null),[E,b]=l([]);t((()=>{let e=[];const t=Math.ceil(r.controls.length/r.controlsPerPage);if(t>0)for(let n=0;n<t;n++){const t={pageIndex:n,controls:[]};for(let e=0;e<r.controlsPerPage;e++){const o=n*r.controlsPerPage+e;if(o>=r.controls.length)break;t.controls.push(r.controls[o])}e.push(t)}c(t),u(0),h(null),p(null),v(null),b(e)}),r.controls);const y=e=>{let t=e-1;t<0&&(t=s-1),p(t)},w=e=>{e.stopPropagation(),y(d),v(null),h(null)},N=e=>{e.stopPropagation()},T=e=>{e.stopPropagation()},x=e=>{if(e.stopPropagation(),null!==i)return;const t=d;let n=d-1;n<0&&(n=s-1),h(t),u(n),p(null),v(t);const o=setTimeout((()=>{y(n),v(null),h(null),setTimeout((function(){a(null)}),300)}),300);a(o)},C=e=>{let t=e+1;t>=s&&(t=0),v(t)},P=e=>{e.stopPropagation(),p(null),C(d),h(null)},k=e=>{e.stopPropagation()},M=e=>{e.stopPropagation()},F=e=>{if(e.stopPropagation(),null!==i)return;const t=d;let n=d+1;n>=s&&(n=0),h(t),u(n),p(t),v(null);const o=setTimeout((()=>{p(null),C(n),h(null),setTimeout((function(){a(null)}),300)}),300);a(o)},I={background:n.getBackground()};return e.createElement("div",{className:"horizontal-tile-component",style:I},e.createElement("div",{className:"horizontal-tile-pages-container"},E.map(((t,l)=>{let r="horizontal-tile-page-container";return l===d?r+=" active":l===g?r+=" navigating-from-left":l===f&&(r+=" navigating-from-right"),l===m&&(r+=" previous"),e.createElement("div",{className:r},e.createElement(Ne,{graphingTile:n,graphingTileIndex:o,graphingTileControls:t.controls}))})),e.createElement("div",{className:"horizontal-tile-page-container background",style:I}),s<=1?null:e.createElement(e.Fragment,null,e.createElement("button",{type:"button",className:"navigate-button navigate-left-button",onMouseEnter:w,onMouseLeave:N,onMouseDown:T,onClick:x},e.createElement("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M7.40991 10.643L2.82991 6.05298L7.40991 1.46298L5.99991 0.0529785L-8.80003e-05 6.05298L5.99991 12.053L7.40991 10.643Z",fill:"#828282"}))),e.createElement("button",{type:"button",className:"navigate-button navigate-right-button",onMouseEnter:P,onMouseLeave:k,onMouseDown:M,onClick:F},e.createElement("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M0.589843 1.46298L5.16984 6.05298L0.589844 10.643L1.99984 12.053L7.99984 6.05298L1.99984 0.0529785L0.589843 1.46298Z",fill:"#828282"}))))),s<=1?null:e.createElement("div",{className:"horizontal-tile-paginators-container"},Array.from(Array(s).keys()).map((t=>{let n="paginator-anchor";return t===d&&(n+=" active"),e.createElement("a",{className:n,onMouseEnter:e=>{e.stopPropagation(),t!==d&&(t<d?(p(t),v(null)):(p(null),v(t)),h(null))},onMouseLeave:e=>{e.stopPropagation()},onMouseDown:e=>{e.stopPropagation()},onClick:e=>{if(e.stopPropagation(),t===d)return;const n=d,o=t;h(n),u(o),n<o?p(n):v(n)}})}))))};z("horizontal-tile",Ce);const Pe=({graphingTile:n})=>{const o=null==n?void 0:n.tile;if(!o)return null;const[r,i]=l(""),[a,s]=l(null),[c,d]=l([]),u=W();t((()=>{const e=Object.keys(o.states);if(d(e.map((e=>{var t;return{label:null===(t=o.states[e])||void 0===t?void 0:t.title,value:e}}))),e&&e.length>0){const t=e[0];m(t)}else i(""),s(null)}),[o.states]);const m=e=>{i(e),s(o.states[e])};return e.createElement("div",{className:"selectable-states-tile-component"},e.createElement("div",{className:"selectable-states-tile-header"},e.createElement("div",{className:"selected-state-tile-title"},e.createElement("h6",null,null==a?void 0:a.title)),e.createElement("div",{className:"selectable-states-dropdown-container"},e.createElement(B,{options:c,label:"Select",value:r,handleChange:e=>{var t;m(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value),(null==u?void 0:u.handleSelectableStatesTileChange)&&(null==u||u.handleSelectableStatesTileChange(e))}}))),e.createElement("div",{className:"selected-state-tile-container"},a?e.createElement(Z,{tilePrefix:r,graphingTiles:a.tiles,responsive:a.responsive,columns:a.columns,containerPadding:a.containerPadding,referenceMargin:a.referenceMargin,referenceWidth:a.referenceWidth}):null))};z("selectable-states-tile",Pe);const ke=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const l=W(),r=e=>{a.isFunction(l.handleUIChange)&&l.handleUIChange(e)};return e.createElement("div",{className:"simple-form-tile-component"},(()=>{if(!a.isArray(o.controls)||o.controls.length<0)return null;const l=o.controls;return e.createElement(Ne,{graphingTile:t,graphingTileIndex:n,graphingTileControls:l,ControlProps:{onUIChange:r}})})())};z("simple-form-tile",ke);const Me=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const l=[o.control],r={background:t.getBackground()};return e.createElement("div",{className:"single-tile-component",style:r},e.createElement(Ne,{graphingTile:t,graphingTileIndex:n,graphingTileControls:l}))};z("single-tile",Me);const Fe=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const l=o.controls;return e.createElement("div",{className:"vertical-tile-component"},e.createElement(Ne,{graphingTile:t,graphingTileIndex:n,graphingTileControls:l}))};z("vertical-tile",Fe);const Ie=()=>{const e=Le.pop();e&&(e.classList.add("moorr-modal-container-closing"),setTimeout((()=>{e&&(k.unmountComponentAtNode(e),e.remove())}),300))};let Ae=class{constructor(e){this._props=e}open(){const t=this._props;return new Promise(((n,o)=>{let l,r;"function"==typeof t.onClose&&(l=t.onClose),t.onClose=e=>{l&&l(e),n({dismissed:!1,result:e}),t.showModal=!1,Ie()},"function"==typeof t.onDismiss&&(r=t.onClose),t.onDismiss=()=>{r&&r(),n({dismissed:!0}),t.showModal=!1,Ie()},t.showModal=!0;let i=e.createElement(H,{stylePrefix:"MoorrReactMuiModal"},e.createElement(this.getComponent(),t));Le.push(this._container=document.createElement("div")),this._container.className="moorr-modal-container",document.body.appendChild(this._container),k.render(i,this._container)}))}};const Le=[],Se={},Be=c((e=>({modal:{display:"flex",alignItems:"center",justifyContent:"center"},paper:{width:825,backgroundColor:e.palette.background.paper,borderRadius:"5px",boxShadow:e.shadows[5],padding:e.spacing(2,4,3)}}))),De=n=>{const o=Be(),r={};n.fixedWidth&&(r.width=n.fixedWidth),n.fixedHeight&&(r.height=n.fixedHeight);let i=o.paper+" moorr-modal-content-container";n.contentClassName&&(i+=" "+n.contentClassName);const[s,c]=l(!1),[d,u]=l(!1);t((()=>{u(!s&&!1!==n.showModal)}),[s,d,n.showModal]);const m=e=>{c(!0),(null==n?void 0:n.onDismiss)&&n.onDismiss(e)};let h=o.modal;switch(h+=" moorr-modal-container",n.effect){case"fade":h+=" moorr-fade-modal";break;case"slide":h+=" moorr-slide-modal"}return s&&(h+=" moorr-modal-closing"),e.createElement(p,{disableEnforceFocus:!0,className:h,open:d,onClose:m,closeAfterTransition:!0,BackdropComponent:f,BackdropProps:{timeout:300,onClick:e=>{e.preventDefault(),e.stopPropagation(),a.isFunction(n.onBackdropClick)?n.onBackdropClick(e):m("backdrop")}}},(()=>{switch(n.effect){case"fade":default:return e.createElement(v,{in:d},e.createElement("div",{className:i,style:r},n.children));case"slide":return e.createElement(M,{in:d,direction:"left",timeout:300},e.createElement("div",{className:i},n.children))}})())},$e=(t,n)=>{(t=>{F(t,{icon:e.createElement(I,{sx:{color:"#EB5757"}}),style:{color:"#EB5757",backgroundColor:"#FCECEC",border:"2px solid #EB5757",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"}})})(n)},Ge=t=>e.createElement(De,{effect:"fade",contentClassName:`${t.className}-content-container`,fixedWidth:t.widthValue,fixedHeight:t.heightValue,showModal:t.showModal,onClose:t.onClose,onDismiss:t.onDismiss,onBackdropClick:t.onBackdropClick},e.createElement("div",{className:`${t.className} moorr-modal-container`},e.createElement("div",{className:"moorr-modal-header"},t.renderHeader),e.createElement("div",{className:"moorr-modal-body"},t.renderBody),!1===t.hasFooter?null:e.createElement("div",{className:"moorr-modal-footer"},e.createElement("div",{className:"left-buttons"},t.renderLeftButtons),e.createElement("div",{className:"status-message"},t.renderStatusMessage),e.createElement("div",{className:"right-buttons"},t.renderRightButtons)))),Oe=e=>{var t,n,o,l,r;const i=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.modal;if(!i||!Se[i])return Promise.reject("invalid-modal");const a=new Se[i]((null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.props)||{}).open();(null===(o=null==e?void 0:e.detail)||void 0===o?void 0:o.then)&&a.then((t=>{var n,o;if(!(null==t?void 0:t.dismissed)&&(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.finally))try{null===(o=null==e?void 0:e.detail)||void 0===o||o.then(null==t?void 0:t.result)}catch(e){console.error(e)}})),(null===(l=null==e?void 0:e.detail)||void 0===l?void 0:l.catch)&&a.catch(null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.catch),a.finally((()=>{var t,n;if(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.finally)try{null===(n=null==e?void 0:e.detail)||void 0===n||n.finally()}catch(e){console.error(e)}})),(null==e?void 0:e.detail)&&((null==e?void 0:e.detail).promise=a)};document&&(document.removeEventListener("openModal",Oe),document.addEventListener("openModal",Oe));export{A as Button,B as Dropdown,Ge as FadeModal,se as FormGroupModel,xe as FormGroupsTile,me as FormGroupsTileModel,ie as FormInputModel,_ as GraphingContext,we as GraphingControl,re as GraphingControlModel,ae as GraphingControlSettingsModel,Ee as GraphingGrid,ee as GraphingSettingsModel,R as GraphingTile,Ne as GraphingTileControls,ce as GraphingTileModel,Y as GraphingTileSettingsModel,Z as GraphingTiles,Ce as HorizontalTile,he as HorizontalTileModel,Ae as Modal,De as MoorrModal,ue as MultipleControlsTileModel,Pe as SelectableStatesTile,ge as SelectableStatesTileModel,ke as SimpleFormTile,pe as SimpleFormTileModel,de as SingleControlTileModel,Me as SingleTile,fe as SingleTileModel,G as SvgIcon,Fe as VerticalTile,ve as VerticalTileModel,oe as createGraphingControl,le as createGraphingControls,Q as createGraphingTile,X as createGraphingTiles,Se as modals,Le as modalsStack,ne as registerGraphingControl,ye as registerGraphingControlComponent,J as registerGraphingTile,z as registerGraphingTileComponent,$ as registerSvgIconComponent,$e as toastMessage,W as useGraphingContext};
1
+ import e,{useEffect as t,createContext as n,useContext as o,useState as l,useRef as r,useCallback as i}from"react";import{utils as a}from"moorr-common";import s from"@material-ui/core/MenuItem";import{makeStyles as c,createStyles as d,withStyles as u,StylesProvider as m}from"@material-ui/core/styles";import h from"@material-ui/core/TextField";import{StylesProvider as g,Modal as p,Backdrop as f,Fade as v}from"@material-ui/core";import{createGenerateClassName as E,StylesProvider as b}from"@material-ui/styles";import{v4 as y}from"uuid";import w,{Responsive as N}from"react-grid-layout";import T from"@mui/material/Accordion";import x from"@mui/material/AccordionSummary";import C from"@mui/material/AccordionDetails";import P from"@mui/icons-material/ExpandMore";import k from"react-dom";import{Slide as M}from"@mui/material";import{toast as F}from"react-toastify";import I from"@mui/icons-material/Cancel";const A=({type:n,label:o})=>(t((()=>(console.log(`Message from moorr-react-mui: ${a.hello()}`),()=>{console.log(`Message from moorr-react-mui: ${a.bye()}`)})),[]),n||(n="button"),e.createElement("button",{type:n,className:"moorr-button"},e.createElement("span",null,o))),L=e=>({root:{"&:hover:not($disabled):not($focused):not($error) $notchedOutline":{},"&$checked":{color:"var(--primary-color)"},"& .vldt-MuiSelect-select.vldt-MuiSelect-select":{color:"var(--grey-color-2)"}},disabled:{},focused:{},error:{},notchedOutline:{},checked:{},notchedOutlineMBRequired:{flex:3,borderColor:"blue",borderWidth:2},fieldSetMBRequired:{"& fieldset":{flex:3,borderColor:"blue",borderWidth:2}},fieldSetErrorField:{"& fieldset":{borderColor:"var(--error-color)"}},blue:{color:"blue"}});c(L);const S=c((()=>d({root:{overflow:"hidden",display:"flex",alignItems:"center","&.start":{flexDirection:"row"},"&.top":{flexDirection:"column"},"& .Mui-disabled":{backgroundColor:"var(--grey-color-3)",cursor:"not-allowed",borderRadius:"4px"}},label:{flex:2},field:{flex:3},required:{color:"red"},menuItem:{color:"var(--grey-color-2)","&:hover":{backgroundColor:"var(--primary-color-scale-25)",color:"var(--grey-color-2)"}},menuItemSelected:{color:"var(--grey-color-2)"},mandatory:{border:"red 2px solid",borderRadius:"4px"}})));var B=u(L)((({handleChange:t,value:n,disabled:o=!1,name:l,className:r,classes:i,size:a,menuItemLabel:c,options:d,labelPlacement:u="start",label:m,required:g=!1,isMBRequiredField:p,fullWidth:f,selectIconComponent:v})=>{const{root:E,focused:b,error:y,notchedOutline:w,notchedOutlineMBRequired:N}=i,T=S();let x;return v&&(x={IconComponent:v}),e.createElement(h,{fullWidth:!1!==f,id:"outlined-basic",variant:"outlined",value:n,onChange:t,disabled:o,name:l,className:[r].join(" "),InputProps:{classes:{root:E,focused:b,error:y,notchedOutline:!p||n&&0!==(null==n?void 0:n.length)?!g||n&&0!==(null==n?void 0:n.length)?w:T.mandatory:N}},color:"primary",size:a||"small",select:!0,SelectProps:x,defaultValue:""},e.createElement(s,{value:"",disabled:!0},e.createElement("em",null,c)),d&&d.map(((t,n)=>"-separator-"===t?e.createElement(s,{key:`separator-${n}`,value:"",disabled:!0},e.createElement("em",null,"-----------")):e.createElement(s,{key:`menu-item-${n}-${t.value||t}`,value:t.value||t},t.label||t))))}));const D={};function $(e,t){e&&t&&(D[e]=t)}const G=({className:t,icon:n,width:o,height:l,fill:r,stroke:i,accent:s,dropShadow:c})=>{if(a.isNullOrUndefined(n))return null;const d=D[n]||null;return d?e.createElement(d,{className:t,fill:r,width:o,height:l,stroke:i,accent:s,dropShadow:c}):null},O={};var H=({stylePrefix:t,children:n})=>{let o;if(t)o=O[t]?O[t]:O[t]=E({seed:t});else{const e=`MoorrStylesProvider-${y()}-`;o=E({seed:e})}return e.createElement(b,{generateClassName:o,injectFirst:!0},e.createElement(g,{generateClassName:o,injectFirst:!0},e.createElement(m,{generateClassName:o},n)))};const _=n({});function W(){return o(_)}const U={};function z(e,t){e&&t&&(U[e]=t)}const R=({graphingTile:t,graphingTileIndex:n})=>{var o;if(!(null===(o=null==t?void 0:t.tile)||void 0===o?void 0:o.tileType))return null;const l=U[t.tile.tileType]||null;return l?e.createElement(l,{graphingTile:t,graphingTileIndex:n}):null},j=[20,20],q={lg:600,sm:0},V={lg:8,sm:2},Z=({tilePrefix:n,responsive:o,columns:i,containerPadding:a,referenceMargin:s,referenceWidth:c,graphingTiles:d})=>{const[u,m]=l(null),[h,g]=l(null),[p,f]=l(null),[v,E]=l(null),b=r(null),y=()=>{const e=(null==b?void 0:b.current)?(null==b?void 0:b.current).getBoundingClientRect().width:null;E(e);const t=P(e);m(t)};let T;const x=e=>{y(),clearTimeout(T),T=setTimeout((()=>{y()}),300)};t((()=>{y()}),[b]),t((()=>(window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x)})),[]),t((()=>{if(o){if(!Array.isArray(d)||0===d.length)return void f({lg:[]});f({lg:d.map(((e,t)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${n?n+"_":""}tile_${t}`})))})}else{if(!Array.isArray(d)||0===d.length)return void g([]);g(d.map(((e,t)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${n?n+"_":""}tile_${t}`,static:!0}))))}}),[d]);const C=()=>null==d?void 0:d.map(((t,o)=>{if(!t.tile||!t.visible)return null;let l="graphing-tile-container";!1!==t.border&&(l+=" bordered"),t.autoHeight&&(l+=" auto-height");const r=`${n?n+"_":""}tile_${o}`;return e.createElement("div",{className:l,key:r},e.createElement(R,{graphingTile:t,graphingTileIndex:o}))})),P=e=>{if(!s||isNaN(s)||s<=0||!c||isNaN(c)||c<=0||null==e)return j;const t=e/c*s;return[t,t]};return e.createElement("div",{ref:b,className:"graphing-tiles-container"},(()=>{if(!v||!u)return null;if(!1!==o){if(!p)return null;const t=[a||0,0];return e.createElement(N,{width:v,breakpoints:q,cols:i||V,rowHeight:1,layouts:p,containerPadding:t,margin:u,isDraggable:!1},C())}return h?e.createElement(w,{width:v,cols:9,rowHeight:50,margin:u,isDraggable:!1,layout:h},C()):null})())},K={};function J(e,t){K[e]=t}function Q(e){const t=K[null==e?void 0:e.tileType];return t?new t(e):null}function X(e){const t=[];return e.forEach((e=>{const n=Q(e);n&&t.push(n)})),t}class Y{constructor(e){this.x=e.x,this.y=e.y,this.w=e.w,this.h=e.h,this.border=!0===e.border,this.background=e.background||null,this.autoHeight=!0===e.autoHeight,this.tile=Q(e.tile),this.visible=!1!==e.visible}getBackground(){return this.background||"#FFFFFF"}}class ee{constructor(e){this.title=e.title||"",this.infoIconUrl=e.infoUrl,this.infoIconHref=e.infoHref,this.responsive=!1!==e.responsive,this.columns=e.columns||{lg:8,sm:2},this.containerPadding=e.containerPadding||0,this.referenceMargin=e.referenceMargin||null,this.referenceWidth=e.referenceWidth||null,this.tiles=[],Array.isArray(e.tiles)&&e.tiles.forEach((e=>{this.tiles.push(new Y(e))}))}}const te={};function ne(e,t){te[e]=t}function oe(e){const t=te[null==e?void 0:e.controlType];return t?new t(e):null}function le(e){const t=[];return e.forEach((e=>{const n=oe(e);n&&t.push(n)})),t}class re{constructor(e){this.controlType=e.controlType,this.dataKey=e.dataKey}}class ie extends re{constructor(e){super(e),this.inputLabel=e.inputLabel||"",this.readOnly=!0===e.readOnly,this.readOnlyBorderless=!0===e.readOnlyBorderless,this.hasAsAtDate=!1===e.hasAsAtDate||!0===e.hasAsAtDate?e.hasAsAtDate:null,this.staticAsAtDate=!0===e.staticAsAtDate,this.validationSchemaPath=(a.isArray(e.validationSchemaPath)?e.validationSchemaPath:[]).filter((e=>a.isString(e))),this.validationErrorMessages=e.validationErrorMessages||{}}}class ae{constructor(e){this.border=e.border,this.background=e.background||null,this.control=oe(e.control)}getBackground(e){return this.background||(null==e?void 0:e.background)||"#FFFFFF"}}class se{constructor(e){this.id=e.id||"",this.title=e.title||"",this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new ae(e))})),this.add=!0===e.add}}class ce{constructor(e){this.tileType=e.tileType}}class de extends ce{constructor(e){super(e),this.control=new ae(e.control)}}class ue extends ce{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new ae(e))}))}}class me extends ce{constructor(e){super(e),a.isArray(e.formGroups)&&e.formGroups.length>0?this.formGroups=e.formGroups.map((e=>new se(e))):this.formGroups=[]}}J("form-groups-tile",me);class he extends ue{constructor(e){super(e),this.controlsPerPage=e.controlsPerPage,(isNaN(this.controlsPerPage)||this.controlsPerPage<=1)&&(this.controlsPerPage=1)}}J("horizontal-tile",he);class ge extends ue{constructor(e){super(e),this.states={};for(const t in e.states){const n=e.states[t];n&&(this.states[t]=new ee(n))}}}J("selectable-states-tile",ge);class pe extends ce{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new ae(e))}))}}J("simple-form-tile",pe);class fe extends de{constructor(e){super(e)}}J("single-tile",fe);class ve extends ue{constructor(e){super(e)}}J("vertical-tile",ve);const Ee=({})=>{const{settings:n}=W(),[o,r]=l(null),[i,s]=l(!1);t((()=>{setTimeout((()=>{window.dispatchEvent(new Event("resize")),setTimeout((()=>{s(!0)}),300)}),300)}),[]),t((()=>{r(n?new ee(n):null)}),[n]);const c=()=>(null==n?void 0:n.infoIconUrl)&&n.infoIconHref?e.createElement("a",{className:"information-anchor",href:n.infoIconHref,target:"_blank"},e.createElement("img",{alt:null==n?void 0:n.title,src:null==n?void 0:n.infoIconUrl})):null;if(!o)return null;let d="graphing-grid-container";return i&&(d+=" in"),e.createElement(e.Fragment,null,e.createElement("div",{className:d},a.isNullOrUndefined(null==n?void 0:n.title)?null:e.createElement(e.Fragment,null,e.createElement("h2",{className:"graphing-grid-title"},null==n?void 0:n.title,c()),e.createElement("hr",{className:"graphing-grid-hr"})),e.createElement(Z,{graphingTiles:o.tiles,responsive:o.responsive,columns:o.columns,containerPadding:o.containerPadding,referenceMargin:o.referenceMargin,referenceWidth:o.referenceWidth})))},be={};function ye(e,t){e&&t&&(be[e]=t)}const we=({graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:l})=>{var r;if(!(null===(r=null==o?void 0:o.control)||void 0===r?void 0:r.controlType))return null;const i=be[o.control.controlType]||null;return i?e.createElement(i,Object.assign({graphingTile:t,graphingTileIndex:n,graphingTileControl:o},l)):null},Ne=({graphingTile:t,graphingTileIndex:n,graphingTileControls:o,ControlProps:l})=>{var r,i;let a="graphing-tile-controls-container";return(null===(r=null==t?void 0:t.tile)||void 0===r?void 0:r.tileType)&&(a+=" "+(null===(i=null==t?void 0:t.tile)||void 0===i?void 0:i.tileType)),e.createElement("div",{className:a},null==o?void 0:o.map(((o,r)=>{var i,a;if(!o.control)return null;let s="graphing-tile-control-container";(null===(i=o.control)||void 0===i?void 0:i.controlType)&&(s+=" "+(null===(a=o.control)||void 0===a?void 0:a.controlType)),!1!==o.border&&(s+=" bordered");const c=`control_${n}_${r}`;return e.createElement("div",{className:s,key:c},e.createElement(we,{graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:l}))})))};function Te(e,t,n,o){return new(n||(n=Promise))((function(l,r){function i(e){try{s(o.next(e))}catch(e){r(e)}}function a(e){try{s(o.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?l(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}s((o=o.apply(e,t||[])).next())}))}const xe=({graphingTile:n,graphingTileIndex:o})=>{const s=null==n?void 0:n.tile;if(!s)return null;const c=W();return e.createElement("div",{className:"form-groups-tile-component"},!a.isArray(s.formGroups)||s.formGroups.length<0?null:s.formGroups.map(((s,d)=>{const u=r(null),[m,h]=l("normal"),[g,p]=l("form-group-container");t((()=>{y()}),[g,m]);const[f,v]=l(0),[E,b]=l(!0);t((()=>{if(E){const e=u.current;a.isNullOrUndefined(e)?v(0):setTimeout((()=>{v(e.scrollHeight)}),10)}else v(0)}),[E]);const y=e=>{if(E){const e=u.current;a.isNullOrUndefined(e)?v(0):setTimeout((()=>{v(Math.max(e.clientHeight,e.scrollHeight))}),10)}else v(0)},w=i((()=>!0!==s.add?null:e.createElement("button",{type:"button",className:"form-group-tile-add-button",onClick:N,disabled:"add"==m},e.createElement(G,{icon:"add-icon",stroke:"#ffffff"}))),[m]);i((()=>"add"===m?null:e.createElement("svg",{viewBox:"0 0 11 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M5.89844 1.1626L10.4688 5.70947C10.6797 5.94385 10.6797 6.29541 10.4688 6.50635L9.92969 7.04541C9.71875 7.25635 9.36719 7.25635 9.13281 7.04541L5.5 3.43603L1.89063 7.04541C1.65625 7.25635 1.30469 7.25635 1.09375 7.04541L0.554688 6.50635C0.34375 6.29541 0.34375 5.94385 0.554688 5.70947L5.125 1.1626C5.33594 0.95166 5.6875 0.95166 5.89844 1.1626Z",fill:"#333333"}))),[m]);const N=e=>{e.stopPropagation(),h("add"),b(!0)},k=e=>Te(void 0,void 0,void 0,(function*(){a.isFunction(null==c?void 0:c.handleFormGroupCancel)&&(yield Promise.all([null==c?void 0:c.handleFormGroupCancel({formGroup:s})])),h("normal")})),M=e=>Te(void 0,void 0,void 0,(function*(){if(a.isFunction(null==c?void 0:c.handleFormGroupSave)){const[e]=yield Promise.all([null==c?void 0:c.handleFormGroupSave({formGroup:s})]);if(!1===e)return}h("normal")}));let F="form-group-container";return a.isFunction(c.isFormGroupVisible)&&(c.isFormGroupVisible(s.id)||(F+=" hidden")),F!==g&&p(F),e.createElement(T,{className:F,expanded:E,onChange:e=>{"add"!==m&&b((e=>!e))},TransitionProps:{unmountOnExit:!0}},e.createElement(x,{className:"form-group-title",expandIcon:"add"!==m?e.createElement(P,null):null},e.createElement("span",{className:"form-group-title-text"},s.title),w()),e.createElement("hr",null),e.createElement(C,{className:"form-group-components"},(()=>{if("add"===m){let t;return a.isFunction(c.renderFormGroup)&&(t=c.renderFormGroup(s,"add")),e.createElement(e.Fragment,null,t,e.createElement("hr",null),e.createElement("div",{className:"form-group-add-mode-buttons"},e.createElement("button",{className:"cancel-button",onClick:k},"Cancel"),e.createElement("button",{className:"save-button",onClick:M},"Save")))}{const t=s.controls;let l;return a.isFunction(c.renderFormGroup)&&(l=c.renderFormGroup(s,"normal"),!a.isNullOrUndefined(l))?l:e.createElement(Ne,{graphingTile:n,graphingTileIndex:o,graphingTileControls:t,ControlProps:{onUIChange:y}})}})()))})))};z("form-groups-tile",xe);const Ce=({graphingTile:n,graphingTileIndex:o})=>{const r=null==n?void 0:n.tile;if(!r)return null;const[i,a]=l(null),[s,c]=l(0),[d,u]=l(0),[m,h]=l(null),[g,p]=l(null),[f,v]=l(null),[E,b]=l([]);t((()=>{let e=[];const t=Math.ceil(r.controls.length/r.controlsPerPage);if(t>0)for(let n=0;n<t;n++){const t={pageIndex:n,controls:[]};for(let e=0;e<r.controlsPerPage;e++){const o=n*r.controlsPerPage+e;if(o>=r.controls.length)break;t.controls.push(r.controls[o])}e.push(t)}c(t),u(0),h(null),p(null),v(null),b(e)}),r.controls);const y=e=>{let t=e-1;t<0&&(t=s-1),p(t)},w=e=>{e.stopPropagation(),y(d),v(null),h(null)},N=e=>{e.stopPropagation()},T=e=>{e.stopPropagation()},x=e=>{if(e.stopPropagation(),null!==i)return;const t=d;let n=d-1;n<0&&(n=s-1),h(t),u(n),p(null),v(t);const o=setTimeout((()=>{y(n),v(null),h(null),setTimeout((function(){a(null)}),300)}),300);a(o)},C=e=>{let t=e+1;t>=s&&(t=0),v(t)},P=e=>{e.stopPropagation(),p(null),C(d),h(null)},k=e=>{e.stopPropagation()},M=e=>{e.stopPropagation()},F=e=>{if(e.stopPropagation(),null!==i)return;const t=d;let n=d+1;n>=s&&(n=0),h(t),u(n),p(t),v(null);const o=setTimeout((()=>{p(null),C(n),h(null),setTimeout((function(){a(null)}),300)}),300);a(o)},I={background:n.getBackground()};return e.createElement("div",{className:"horizontal-tile-component",style:I},e.createElement("div",{className:"horizontal-tile-pages-container"},E.map(((t,l)=>{let r="horizontal-tile-page-container";return l===d?r+=" active":l===g?r+=" navigating-from-left":l===f&&(r+=" navigating-from-right"),l===m&&(r+=" previous"),e.createElement("div",{className:r},e.createElement(Ne,{graphingTile:n,graphingTileIndex:o,graphingTileControls:t.controls}))})),e.createElement("div",{className:"horizontal-tile-page-container background",style:I}),s<=1?null:e.createElement(e.Fragment,null,e.createElement("button",{type:"button",className:"navigate-button navigate-left-button",onMouseEnter:w,onMouseLeave:N,onMouseDown:T,onClick:x},e.createElement("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M7.40991 10.643L2.82991 6.05298L7.40991 1.46298L5.99991 0.0529785L-8.80003e-05 6.05298L5.99991 12.053L7.40991 10.643Z",fill:"#828282"}))),e.createElement("button",{type:"button",className:"navigate-button navigate-right-button",onMouseEnter:P,onMouseLeave:k,onMouseDown:M,onClick:F},e.createElement("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M0.589843 1.46298L5.16984 6.05298L0.589844 10.643L1.99984 12.053L7.99984 6.05298L1.99984 0.0529785L0.589843 1.46298Z",fill:"#828282"}))))),s<=1?null:e.createElement("div",{className:"horizontal-tile-paginators-container"},Array.from(Array(s).keys()).map((t=>{let n="paginator-anchor";return t===d&&(n+=" active"),e.createElement("a",{className:n,onMouseEnter:e=>{e.stopPropagation(),t!==d&&(t<d?(p(t),v(null)):(p(null),v(t)),h(null))},onMouseLeave:e=>{e.stopPropagation()},onMouseDown:e=>{e.stopPropagation()},onClick:e=>{if(e.stopPropagation(),t===d)return;const n=d,o=t;h(n),u(o),n<o?p(n):v(n)}})}))))};z("horizontal-tile",Ce);const Pe=({graphingTile:n})=>{const o=null==n?void 0:n.tile;if(!o)return null;const[r,i]=l(""),[a,s]=l(null),[c,d]=l([]),u=W();t((()=>{const e=Object.keys(o.states);if(d(e.map((e=>{var t;return{label:null===(t=o.states[e])||void 0===t?void 0:t.title,value:e}}))),e&&e.length>0){const t=e[0];m(t)}else i(""),s(null)}),[o.states]);const m=e=>{i(e),s(o.states[e])};return e.createElement("div",{className:"selectable-states-tile-component"},e.createElement("div",{className:"selectable-states-tile-header"},e.createElement("div",{className:"selected-state-tile-title"},e.createElement("h6",null,null==a?void 0:a.title)),e.createElement("div",{className:"selectable-states-dropdown-container"},e.createElement(B,{options:c,label:"Select",value:r,handleChange:e=>{var t;m(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value),(null==u?void 0:u.handleSelectableStatesTileChange)&&(null==u||u.handleSelectableStatesTileChange(e))}}))),e.createElement("div",{className:"selected-state-tile-container"},a?e.createElement(Z,{tilePrefix:r,graphingTiles:a.tiles,responsive:a.responsive,columns:a.columns,containerPadding:a.containerPadding,referenceMargin:a.referenceMargin,referenceWidth:a.referenceWidth}):null))};z("selectable-states-tile",Pe);const ke=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const l=W(),r=e=>{a.isFunction(l.handleUIChange)&&l.handleUIChange(e)};return e.createElement("div",{className:"simple-form-tile-component"},(()=>{if(!a.isArray(o.controls)||o.controls.length<0)return null;const l=o.controls;return e.createElement(Ne,{graphingTile:t,graphingTileIndex:n,graphingTileControls:l,ControlProps:{onUIChange:r}})})())};z("simple-form-tile",ke);const Me=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const l=[o.control],r={background:t.getBackground()};return e.createElement("div",{className:"single-tile-component",style:r},e.createElement(Ne,{graphingTile:t,graphingTileIndex:n,graphingTileControls:l}))};z("single-tile",Me);const Fe=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const l=o.controls;return e.createElement("div",{className:"vertical-tile-component"},e.createElement(Ne,{graphingTile:t,graphingTileIndex:n,graphingTileControls:l}))};z("vertical-tile",Fe);const Ie=()=>{const e=Le.pop();e&&(e.classList.add("moorr-modal-container-closing"),setTimeout((()=>{e&&(k.unmountComponentAtNode(e),e.remove())}),300))};let Ae=class{constructor(e){this._props=e}open(){const t=this._props;return new Promise(((n,o)=>{let l,r;"function"==typeof t.onClose&&(l=t.onClose),t.onClose=e=>{l&&l(e),n({dismissed:!1,result:e}),t.showModal=!1,Ie()},"function"==typeof t.onDismiss&&(r=t.onClose),t.onDismiss=()=>{r&&r(),n({dismissed:!0}),t.showModal=!1,Ie()},t.showModal=!0;let i=e.createElement(H,{stylePrefix:"MoorrReactMuiModal"},e.createElement(this.getComponent(),t));Le.push(this._container=document.createElement("div")),this._container.className="moorr-modal-container",document.body.appendChild(this._container),k.render(i,this._container)}))}};const Le=[],Se={},Be=c((e=>({modal:{display:"flex",alignItems:"center",justifyContent:"center"},paper:{width:825,backgroundColor:e.palette.background.paper,borderRadius:"5px",boxShadow:e.shadows[5],padding:e.spacing(2,4,3)}}))),De=n=>{const o=Be(),r={};n.fixedWidth&&(r.width=n.fixedWidth),n.fixedHeight&&(r.height=n.fixedHeight);let i=o.paper+" moorr-modal-content-container";n.contentClassName&&(i+=" "+n.contentClassName);const[s,c]=l(!1),[d,u]=l(!1);t((()=>{u(!s&&!1!==n.showModal)}),[s,d,n.showModal]);const m=e=>{c(!0),(null==n?void 0:n.onDismiss)&&n.onDismiss(e)};let h=o.modal;switch(h+=" moorr-modal-container",n.effect){case"fade":h+=" moorr-fade-modal";break;case"slide":h+=" moorr-slide-modal"}return s&&(h+=" moorr-modal-closing"),e.createElement(p,{disableEnforceFocus:!0,className:h,open:d,onClose:m,closeAfterTransition:!0,BackdropComponent:f,BackdropProps:{timeout:300,onClick:e=>{e.preventDefault(),e.stopPropagation(),a.isFunction(n.onBackdropClick)?n.onBackdropClick(e):m("backdrop")}}},(()=>{switch(n.effect){case"fade":default:return e.createElement(v,{in:d},e.createElement("div",{className:i,style:r},n.children));case"slide":return e.createElement(M,{in:d,direction:"left",timeout:300},e.createElement("div",{className:i},n.children))}})())},$e=(t,n)=>{(t=>{F(t,{icon:e.createElement(I,{sx:{color:"#EB5757"}}),style:{color:"#EB5757",backgroundColor:"#FCECEC",border:"2px solid #EB5757",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"}})})(n)},Ge=t=>e.createElement(De,{effect:"fade",contentClassName:`${t.className}-content-container`,fixedWidth:t.widthValue,fixedHeight:t.heightValue,showModal:t.showModal,onClose:t.onClose,onDismiss:t.onDismiss,onBackdropClick:t.onBackdropClick},e.createElement("div",{className:`${t.className} moorr-modal-container`},e.createElement("div",{className:"moorr-modal-header"},t.renderHeader),e.createElement("div",{className:"moorr-modal-body"},t.renderBody),!1===t.hasFooter?null:e.createElement("div",{className:"moorr-modal-footer"},e.createElement("div",{className:"left-buttons"},t.renderLeftButtons),e.createElement("div",{className:"status-message"},t.renderStatusMessage),e.createElement("div",{className:"right-buttons"},t.renderRightButtons)))),Oe=e=>{var t,n,o,l,r;const i=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.modal;if(!i||!Se[i])return Promise.reject("invalid-modal");const a=new Se[i]((null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.props)||{}).open();(null===(o=null==e?void 0:e.detail)||void 0===o?void 0:o.then)&&a.then((t=>{var n,o;if(!(null==t?void 0:t.dismissed)&&(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.finally))try{null===(o=null==e?void 0:e.detail)||void 0===o||o.then(null==t?void 0:t.result)}catch(e){console.error(e)}})),(null===(l=null==e?void 0:e.detail)||void 0===l?void 0:l.catch)&&a.catch(null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.catch),a.finally((()=>{var t,n;if(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.finally)try{null===(n=null==e?void 0:e.detail)||void 0===n||n.finally()}catch(e){console.error(e)}})),(null==e?void 0:e.detail)&&((null==e?void 0:e.detail).promise=a)};document&&(document.removeEventListener("openModal",Oe),document.addEventListener("openModal",Oe));export{A as Button,B as Dropdown,Ge as FadeModal,se as FormGroupModel,xe as FormGroupsTile,me as FormGroupsTileModel,ie as FormInputModel,_ as GraphingContext,we as GraphingControl,re as GraphingControlModel,ae as GraphingControlSettingsModel,Ee as GraphingGrid,ee as GraphingSettingsModel,R as GraphingTile,Ne as GraphingTileControls,ce as GraphingTileModel,Y as GraphingTileSettingsModel,Z as GraphingTiles,Ce as HorizontalTile,he as HorizontalTileModel,Ae as Modal,De as MoorrModal,ue as MultipleControlsTileModel,Pe as SelectableStatesTile,ge as SelectableStatesTileModel,ke as SimpleFormTile,pe as SimpleFormTileModel,de as SingleControlTileModel,Me as SingleTile,fe as SingleTileModel,G as SvgIcon,Fe as VerticalTile,ve as VerticalTileModel,oe as createGraphingControl,le as createGraphingControls,Q as createGraphingTile,X as createGraphingTiles,Se as modals,Le as modalsStack,ne as registerGraphingControl,ye as registerGraphingControlComponent,J as registerGraphingTile,z as registerGraphingTileComponent,$ as registerSvgIconComponent,$e as toastMessage,W as useGraphingContext};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moorr-react-mui",
3
- "version": "0.2.96",
3
+ "version": "0.2.97",
4
4
  "description": "Moorr React MUI Common Library",
5
5
  "scripts": {
6
6
  "_clear": "rimraf index.* && rimraf typings/* && rimraf cjs/*",