moorr-react-mui 0.2.106 → 0.2.107
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/index.js +1 -1
- package/package.json +1 -1
- package/cjs/index.css +0 -12
- package/cjs/index.js +0 -1
- package/cjs/typings/components/buttons/button.component.d.ts +0 -16
- package/cjs/typings/components/buttons/index.d.ts +0 -1
- package/cjs/typings/components/component.props.d.ts +0 -10
- package/cjs/typings/components/component.styles.d.ts +0 -39
- package/cjs/typings/components/dropdowns/dropdown.component.d.ts +0 -24
- package/cjs/typings/components/dropdowns/index.d.ts +0 -1
- package/cjs/typings/components/icons/index.d.ts +0 -1
- package/cjs/typings/components/icons/svg-icon.component.d.ts +0 -25
- package/cjs/typings/components/index.d.ts +0 -4
- package/cjs/typings/components/styles-provider.component.d.ts +0 -7
- package/cjs/typings/graphings/components/controls/graphing-control.component.d.ts +0 -22
- package/cjs/typings/graphings/components/controls/index.d.ts +0 -1
- package/cjs/typings/graphings/components/graphing-grid.component.d.ts +0 -14
- package/cjs/typings/graphings/components/graphing-tile-controls.component.d.ts +0 -20
- package/cjs/typings/graphings/components/graphing-tiles.component.d.ts +0 -24
- package/cjs/typings/graphings/components/graphing.context.d.ts +0 -64
- package/cjs/typings/graphings/components/index.d.ts +0 -6
- package/cjs/typings/graphings/components/tiles/form-groups-tile.component.d.ts +0 -15
- package/cjs/typings/graphings/components/tiles/graphing-tile.component.d.ts +0 -18
- package/cjs/typings/graphings/components/tiles/horizontal-tile.component.d.ts +0 -15
- package/cjs/typings/graphings/components/tiles/index.d.ts +0 -7
- package/cjs/typings/graphings/components/tiles/selectable-states-tile.component.d.ts +0 -15
- package/cjs/typings/graphings/components/tiles/simple-form-tile.component.d.ts +0 -15
- package/cjs/typings/graphings/components/tiles/single-tile.component.d.ts +0 -15
- package/cjs/typings/graphings/components/tiles/vertical-tile.component.d.ts +0 -15
- package/cjs/typings/graphings/index.d.ts +0 -2
- package/cjs/typings/graphings/models/controls/graphing-control.factory.d.ts +0 -8
- package/cjs/typings/graphings/models/controls/graphing-control.model.d.ts +0 -9
- package/cjs/typings/graphings/models/controls/index.d.ts +0 -3
- package/cjs/typings/graphings/models/controls/inputs/form-input.model.d.ts +0 -17
- package/cjs/typings/graphings/models/controls/inputs/index.d.ts +0 -1
- package/cjs/typings/graphings/models/graphing-control-settings.model.d.ts +0 -16
- package/cjs/typings/graphings/models/graphing-settings.model.d.ts +0 -19
- package/cjs/typings/graphings/models/graphing-tile-settings.model.d.ts +0 -22
- package/cjs/typings/graphings/models/index.d.ts +0 -5
- package/cjs/typings/graphings/models/tiles/form-group.model.d.ts +0 -12
- package/cjs/typings/graphings/models/tiles/form-groups-tile.model.d.ts +0 -10
- package/cjs/typings/graphings/models/tiles/graphing-tile.factory.d.ts +0 -8
- package/cjs/typings/graphings/models/tiles/graphing-tile.model.d.ts +0 -17
- package/cjs/typings/graphings/models/tiles/horizontal-tile.model.d.ts +0 -9
- package/cjs/typings/graphings/models/tiles/index.d.ts +0 -9
- package/cjs/typings/graphings/models/tiles/selectable-states-tile.model.d.ts +0 -12
- package/cjs/typings/graphings/models/tiles/simple-form-tile.model.d.ts +0 -10
- package/cjs/typings/graphings/models/tiles/single-tile.model.d.ts +0 -8
- package/cjs/typings/graphings/models/tiles/vertical-tile.model.d.ts +0 -8
- package/cjs/typings/index.d.ts +0 -3
- package/cjs/typings/modals/fade-modal.component.d.ts +0 -21
- package/cjs/typings/modals/index.d.ts +0 -4
- package/cjs/typings/modals/modal.component.d.ts +0 -15
- package/cjs/typings/modals/modal.d.ts +0 -26
- package/cjs/typings/modals/toast.helper.d.ts +0 -6
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 M from"react-dom";import{Slide as k}from"@mui/material";import{toast as F}from"react-toastify";import A from"@mui/icons-material/Cancel";import I from"@mui/icons-material/Close";const L=({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))),B=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(B);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 G=u(B)((({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 H=({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 _=({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 W=n({});function U(){return o(W)}const z={};function R(e,t){e&&t&&(z[e]=t)}const j=({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=z[t.tile.tileType]||null;return l?e.createElement(l,{graphingTile:t,graphingTileIndex:n}):null},q=[20,20],V={lg:600,sm:0},Z={lg:8,sm:2},K=({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(j,{graphingTile:t,graphingTileIndex:o}))})),P=e=>{if(!s||isNaN(s)||s<=0||!c||isNaN(c)||c<=0||null==e)return q;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:V,cols:i||Z,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})())},J={};function Q(e,t){J[e]=t}function X(e){const t=J[null==e?void 0:e.tileType];return t?new t(e):null}function Y(e){const t=[];return e.forEach((e=>{const n=X(e);n&&t.push(n)})),t}class ee{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=X(e.tile),this.visible=!1!==e.visible}getBackground(){return this.background||"#FFFFFF"}}class te{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 ee(e))}))}}const ne={};function oe(e,t){ne[e]=t}function le(e){const t=ne[null==e?void 0:e.controlType];return t?new t(e):null}function re(e){const t=[];return e.forEach((e=>{const n=le(e);n&&t.push(n)})),t}class ie{constructor(e){this.controlType=e.controlType,this.dataKey=e.dataKey}}class ae extends ie{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 se{constructor(e){this.border=e.border,this.background=e.background||null,this.control=le(e.control)}getBackground(e){return this.background||(null==e?void 0:e.background)||"#FFFFFF"}}class ce{constructor(e){this.id=e.id||"",this.title=e.title||"",this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new se(e))})),this.add=!0===e.add}}class de{constructor(e){this.tileType=e.tileType}}class ue extends de{constructor(e){super(e),this.control=new se(e.control)}}class me extends de{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new se(e))}))}}class he extends de{constructor(e){super(e),a.isArray(e.formGroups)&&e.formGroups.length>0?this.formGroups=e.formGroups.map((e=>new ce(e))):this.formGroups=[]}}Q("form-groups-tile",he);class ge extends me{constructor(e){super(e),this.controlsPerPage=e.controlsPerPage,(isNaN(this.controlsPerPage)||this.controlsPerPage<=1)&&(this.controlsPerPage=1)}}Q("horizontal-tile",ge);class pe extends me{constructor(e){super(e),this.states={};for(const t in e.states){const n=e.states[t];n&&(this.states[t]=new te(n))}}}Q("selectable-states-tile",pe);class fe extends de{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new se(e))}))}}Q("simple-form-tile",fe);class ve extends ue{constructor(e){super(e)}}Q("single-tile",ve);class Ee extends me{constructor(e){super(e)}}Q("vertical-tile",Ee);const be=({})=>{const{settings:n}=U(),[o,r]=l(null),[i,s]=l(!1);t((()=>{setTimeout((()=>{window.dispatchEvent(new Event("resize")),setTimeout((()=>{s(!0)}),300)}),300)}),[]),t((()=>{r(n?new te(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(K,{graphingTiles:o.tiles,responsive:o.responsive,columns:o.columns,containerPadding:o.containerPadding,referenceMargin:o.referenceMargin,referenceWidth:o.referenceWidth})))},ye={};function we(e,t){e&&t&&(ye[e]=t)}const Ne=({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=ye[o.control.controlType]||null;return i?e.createElement(i,Object.assign({graphingTile:t,graphingTileIndex:n,graphingTileControl:o},l)):null},Te=({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(Ne,{graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:l}))})))};function xe(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 Ce=({graphingTile:n,graphingTileIndex:o})=>{const s=null==n?void 0:n.tile;if(!s)return null;const c=U();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||a.isFunction(c.formGroupHasAddMode)&&!c.formGroupHasAddMode(s.id)?null:e.createElement("button",{type:"button",className:"form-group-tile-add-button",onClick:N,disabled:"add"==m},e.createElement(H,{icon:"add-icon",stroke:"#ffffff"}))),[m,c.formGroupHasAddMode]);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)},M=e=>xe(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")})),[k,F]=l(!1),A=e=>xe(void 0,void 0,void 0,(function*(){if(a.isFunction(null==c?void 0:c.handleFormGroupSave))try{F(!0);const[e]=yield Promise.all([null==c?void 0:c.handleFormGroupSave({formGroup:s})]);if(!1===e)return}finally{F(!1)}h("normal")}));let I="form-group-container";return a.isFunction(c.isFormGroupVisible)&&(c.isFormGroupVisible(s.id)||(I+=" hidden")),I!==g&&p(I),e.createElement(T,{className:I,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",disabled:k,onClick:M},"Cancel"),e.createElement("button",{className:"save-button",disabled:k,onClick:A},"Save")))}{const t=s.controls;let l;return a.isFunction(c.renderFormGroup)&&(l=c.renderFormGroup(s,"normal"),!a.isNullOrUndefined(l))?l:e.createElement(Te,{graphingTile:n,graphingTileIndex:o,graphingTileControls:t,ControlProps:{onUIChange:y}})}})()))})))};R("form-groups-tile",Ce);const Pe=({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)},M=e=>{e.stopPropagation()},k=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)},A={background:n.getBackground()};return e.createElement("div",{className:"horizontal-tile-component",style:A},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(Te,{graphingTile:n,graphingTileIndex:o,graphingTileControls:t.controls}))})),e.createElement("div",{className:"horizontal-tile-page-container background",style:A}),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:M,onMouseDown:k,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)}})}))))};R("horizontal-tile",Pe);const Me=({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=U();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(G,{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(K,{tilePrefix:r,graphingTiles:a.tiles,responsive:a.responsive,columns:a.columns,containerPadding:a.containerPadding,referenceMargin:a.referenceMargin,referenceWidth:a.referenceWidth}):null))};R("selectable-states-tile",Me);const ke=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const l=U(),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(Te,{graphingTile:t,graphingTileIndex:n,graphingTileControls:l,ControlProps:{onUIChange:r}})})())};R("simple-form-tile",ke);const Fe=({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(Te,{graphingTile:t,graphingTileIndex:n,graphingTileControls:l}))};R("single-tile",Fe);const Ae=({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(Te,{graphingTile:t,graphingTileIndex:n,graphingTileControls:l}))};R("vertical-tile",Ae);const Ie=()=>{const e=Be.pop();e&&(e.classList.add("moorr-modal-container-closing"),setTimeout((()=>{e&&(M.unmountComponentAtNode(e),e.remove())}),300))};let Le=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(_,{stylePrefix:"MoorrReactMuiModal"},e.createElement(this.getComponent(),t));Be.push(this._container=document.createElement("div")),this._container.className="moorr-modal-container",document.body.appendChild(this._container),M.render(i,this._container)}))}};const Be=[],Se={},Ge=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=Ge(),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(k,{in:d,direction:"left",timeout:300},e.createElement("div",{className:i},n.children))}})())},$e=(t,n)=>{(t=>{F(t,{icon:e.createElement(A,{sx:{color:"#EB5757"}}),style:{color:"#EB5757",backgroundColor:"#FCECEC",border:"2px solid #EB5757",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"},closeButton:()=>e.createElement(I,{sx:{color:"#EB5757"}})})})(n)},He=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{L as Button,G as Dropdown,He as FadeModal,ce as FormGroupModel,Ce as FormGroupsTile,he as FormGroupsTileModel,ae as FormInputModel,W as GraphingContext,Ne as GraphingControl,ie as GraphingControlModel,se as GraphingControlSettingsModel,be as GraphingGrid,te as GraphingSettingsModel,j as GraphingTile,Te as GraphingTileControls,de as GraphingTileModel,ee as GraphingTileSettingsModel,K as GraphingTiles,Pe as HorizontalTile,ge as HorizontalTileModel,Le as Modal,De as MoorrModal,me as MultipleControlsTileModel,Me as SelectableStatesTile,pe as SelectableStatesTileModel,ke as SimpleFormTile,fe as SimpleFormTileModel,ue as SingleControlTileModel,Fe as SingleTile,ve as SingleTileModel,_ as StylesProvider,H as SvgIcon,Ae as VerticalTile,Ee as VerticalTileModel,le as createGraphingControl,re as createGraphingControls,X as createGraphingTile,Y as createGraphingTiles,Se as modals,Be as modalsStack,oe as registerGraphingControl,we as registerGraphingControlComponent,Q as registerGraphingTile,R as registerGraphingTileComponent,$ as registerSvgIconComponent,$e as toastMessage,U 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 C}from"react-grid-layout";import N from"@mui/material/Accordion";import T from"@mui/material/AccordionSummary";import x from"@mui/material/AccordionDetails";import P from"@mui/icons-material/ExpandMore";import M from"react-dom";import{Slide as k}from"@mui/material";import{toast as F}from"react-toastify";import A from"@mui/icons-material/Cancel";import I from"@mui/icons-material/Close";const L=({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))),B=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(B);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 G=u(B)((({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:C}=i,N=S();let T;return v&&(T={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:N.mandatory:C}},color:"primary",size:a||"small",select:!0,SelectProps:T,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 H=({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 _=({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 W=n({});function U(){return o(W)}const z={};function R(e,t){e&&t&&(z[e]=t)}const j=({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=z[t.tile.tileType]||null;return l?e.createElement(l,{graphingTile:t,graphingTileIndex:n}):null},q=[20,20],V={lg:600,sm:0},Z={lg:8,sm:2},K=({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 N;const T=e=>{y(),clearTimeout(N),N=setTimeout((()=>{y()}),300)};t((()=>{y()}),[b]),t((()=>(window.addEventListener("resize",T),()=>{window.removeEventListener("resize",T)})),[]),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 x=()=>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(j,{graphingTile:t,graphingTileIndex:o}))})),P=e=>{if(!s||isNaN(s)||s<=0||!c||isNaN(c)||c<=0||null==e)return q;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(C,{width:v,breakpoints:V,cols:i||Z,rowHeight:1,layouts:p,containerPadding:t,margin:u,isDraggable:!1},x())}return h?e.createElement(w,{width:v,cols:9,rowHeight:50,margin:u,isDraggable:!1,layout:h},x()):null})())},J={};function Q(e,t){J[e]=t}function X(e){const t=J[null==e?void 0:e.tileType];return t?new t(e):null}function Y(e){const t=[];return e.forEach((e=>{const n=X(e);n&&t.push(n)})),t}class ee{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=X(e.tile),this.visible=!1!==e.visible}getBackground(){return this.background||"#FFFFFF"}}class te{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 ee(e))}))}}const ne={};function oe(e,t){ne[e]=t}function le(e){const t=ne[null==e?void 0:e.controlType];return t?new t(e):null}function re(e){const t=[];return e.forEach((e=>{const n=le(e);n&&t.push(n)})),t}class ie{constructor(e){this.controlType=e.controlType,this.dataKey=e.dataKey}}class ae extends ie{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 se{constructor(e){this.border=e.border,this.background=e.background||null,this.control=le(e.control)}getBackground(e){return this.background||(null==e?void 0:e.background)||"#FFFFFF"}}class ce{constructor(e){this.id=e.id||"",this.title=e.title||"",this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new se(e))})),this.add=!0===e.add}}class de{constructor(e){this.tileType=e.tileType}}class ue extends de{constructor(e){super(e),this.control=new se(e.control)}}class me extends de{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new se(e))}))}}class he extends de{constructor(e){super(e),a.isArray(e.formGroups)&&e.formGroups.length>0?this.formGroups=e.formGroups.map((e=>new ce(e))):this.formGroups=[]}}Q("form-groups-tile",he);class ge extends me{constructor(e){super(e),this.controlsPerPage=e.controlsPerPage,(isNaN(this.controlsPerPage)||this.controlsPerPage<=1)&&(this.controlsPerPage=1)}}Q("horizontal-tile",ge);class pe extends me{constructor(e){super(e),this.states={};for(const t in e.states){const n=e.states[t];n&&(this.states[t]=new te(n))}}}Q("selectable-states-tile",pe);class fe extends de{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new se(e))}))}}Q("simple-form-tile",fe);class ve extends ue{constructor(e){super(e)}}Q("single-tile",ve);class Ee extends me{constructor(e){super(e)}}Q("vertical-tile",Ee);const be=({})=>{const{settings:n}=U(),[o,r]=l(null),[i,s]=l(!1);t((()=>{setTimeout((()=>{window.dispatchEvent(new Event("resize")),setTimeout((()=>{s(!0)}),300)}),300)}),[]),t((()=>{r(n?new te(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(K,{graphingTiles:o.tiles,responsive:o.responsive,columns:o.columns,containerPadding:o.containerPadding,referenceMargin:o.referenceMargin,referenceWidth:o.referenceWidth})))},ye={};function we(e,t){e&&t&&(ye[e]=t)}const Ce=({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=ye[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(Ce,{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=U();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||a.isFunction(c.formGroupHasAddMode)&&!c.formGroupHasAddMode(s.id)?null:e.createElement("button",{type:"button",className:"form-group-tile-add-button",onClick:C,disabled:"add"==m},e.createElement(H,{icon:"add-icon",stroke:"#ffffff"}))),[m,c.formGroupHasAddMode]);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 C=e=>{e.stopPropagation(),h("add"),b(!0)},M=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")})),[k,F]=l(!1),A=e=>Te(void 0,void 0,void 0,(function*(){if(a.isFunction(null==c?void 0:c.handleFormGroupSave))try{F(!0);const[e]=yield Promise.all([null==c?void 0:c.handleFormGroupSave({formGroup:s})]);if(!1===e)return}finally{F(!1)}h("normal")}));let I="form-group-container";return a.isFunction(c.isFormGroupVisible)&&(c.isFormGroupVisible(s.id)||(I+=" hidden")),I!==g&&p(I),e.createElement(N,{className:I,expanded:E,onChange:e=>{"add"!==m&&b((e=>!e))},TransitionProps:{unmountOnExit:!0}},e.createElement(T,{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(x,{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",disabled:k,onClick:M},"Cancel"),e.createElement("button",{className:"save-button",disabled:k,onClick:A},"Create")))}{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}})}})()))})))};R("form-groups-tile",xe);const Pe=({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)},C=e=>{e.stopPropagation()},N=e=>{e.stopPropagation()},T=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)},x=e=>{let t=e+1;t>=s&&(t=0),v(t)},P=e=>{e.stopPropagation(),p(null),x(d),h(null)},M=e=>{e.stopPropagation()},k=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),x(n),h(null),setTimeout((function(){a(null)}),300)}),300);a(o)},A={background:n.getBackground()};return e.createElement("div",{className:"horizontal-tile-component",style:A},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:A}),s<=1?null:e.createElement(e.Fragment,null,e.createElement("button",{type:"button",className:"navigate-button navigate-left-button",onMouseEnter:w,onMouseLeave:C,onMouseDown:N,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:P,onMouseLeave:M,onMouseDown:k,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)}})}))))};R("horizontal-tile",Pe);const Me=({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=U();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(G,{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(K,{tilePrefix:r,graphingTiles:a.tiles,responsive:a.responsive,columns:a.columns,containerPadding:a.containerPadding,referenceMargin:a.referenceMargin,referenceWidth:a.referenceWidth}):null))};R("selectable-states-tile",Me);const ke=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const l=U(),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}})})())};R("simple-form-tile",ke);const Fe=({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}))};R("single-tile",Fe);const Ae=({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}))};R("vertical-tile",Ae);const Ie=()=>{const e=Be.pop();e&&(e.classList.add("moorr-modal-container-closing"),setTimeout((()=>{e&&(M.unmountComponentAtNode(e),e.remove())}),300))};let Le=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(_,{stylePrefix:"MoorrReactMuiModal"},e.createElement(this.getComponent(),t));Be.push(this._container=document.createElement("div")),this._container.className="moorr-modal-container",document.body.appendChild(this._container),M.render(i,this._container)}))}};const Be=[],Se={},Ge=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=Ge(),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(k,{in:d,direction:"left",timeout:300},e.createElement("div",{className:i},n.children))}})())},$e=(t,n)=>{(t=>{F(t,{icon:e.createElement(A,{sx:{color:"#EB5757"}}),style:{color:"#EB5757",backgroundColor:"#FCECEC",border:"2px solid #EB5757",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"},closeButton:()=>e.createElement(I,{sx:{color:"#EB5757"}})})})(n)},He=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{L as Button,G as Dropdown,He as FadeModal,ce as FormGroupModel,xe as FormGroupsTile,he as FormGroupsTileModel,ae as FormInputModel,W as GraphingContext,Ce as GraphingControl,ie as GraphingControlModel,se as GraphingControlSettingsModel,be as GraphingGrid,te as GraphingSettingsModel,j as GraphingTile,Ne as GraphingTileControls,de as GraphingTileModel,ee as GraphingTileSettingsModel,K as GraphingTiles,Pe as HorizontalTile,ge as HorizontalTileModel,Le as Modal,De as MoorrModal,me as MultipleControlsTileModel,Me as SelectableStatesTile,pe as SelectableStatesTileModel,ke as SimpleFormTile,fe as SimpleFormTileModel,ue as SingleControlTileModel,Fe as SingleTile,ve as SingleTileModel,_ as StylesProvider,H as SvgIcon,Ae as VerticalTile,Ee as VerticalTileModel,le as createGraphingControl,re as createGraphingControls,X as createGraphingTile,Y as createGraphingTiles,Se as modals,Be as modalsStack,oe as registerGraphingControl,we as registerGraphingControlComponent,Q as registerGraphingTile,R as registerGraphingTileComponent,$ as registerSvgIconComponent,$e as toastMessage,U as useGraphingContext};
|
package/package.json
CHANGED
package/cjs/index.css
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
.moorr-button{display:inline-block;background-color:pink;}
|
|
2
|
-
.graphing-tiles-container{box-sizing:border-box;margin:0;padding:0;width:100%;position:relative;}.graphing-tiles-container>.react-grid-layout{width:100%;position:relative;}.graphing-tiles-container .react-grid-placeholder{background:#E3E3E3;z-index:0;}.graphing-tiles-container .graphing-tile-container.react-draggable-dragging{z-index:1;}.graphing-tiles-container .graphing-tile-container{margin:0;padding:0;background-color:#FFFFFF;}.graphing-tiles-container .graphing-tile-container.bordered{border:1px solid #E3E3E3;border-radius:0.5rem;box-shadow:0 0 2px 1px #F4F4F4;}.graphing-tiles-container .graphing-tile-container.auto-height{height:100%!important;}
|
|
3
|
-
.graphing-grid-container{margin-top:1em;padding:0 24px;opacity:0;transition:opacity 500ms cubic-bezier(0.4,0,0.2,1) 0ms;}.graphing-grid-container.in{opacity:1;}.graphing-grid-container > .graphing-grid-title{font-size:32px!important;margin-bottom:0;margin-top:0;display:flex;}.graphing-grid-container > .graphing-grid-title > a{margin-left:0.5rem;margin-top:0.5rem;}.graphing-grid-container > .graphing-grid-hr{margin-top:0!important;}
|
|
4
|
-
.graphing-tile-controls-container{box-sizing:border-box;margin:0;padding:0;}.graphing-tile-controls-container>.graphing-tile-control-container{margin:0;padding:0;background-color:transparent;}.graphing-tile-controls-container>.graphing-tile-control-container:empty{display:none;}.graphing-tile-controls-container>.graphing-tile-control-container.bordered{border:1px solid #E3E3E3;border-radius:0.5rem;box-shadow:0 0 2px 1px #F4F4F4;}
|
|
5
|
-
.form-groups-tile-component{display:flex;flex-direction:column;gap:20px;width:100%;height:100%;border-radius:0.5rem;background-color:transparent;}.form-groups-tile-component > .form-group-container{box-shadow:0 3px 3px rgba(0,0,0,0.025);background-color:#ffffff;border-radius:10px!important;}.form-groups-tile-component > .form-group-container.hidden{display:none!important;}.form-groups-tile-component > .form-group-container.Mui-expanded{margin:0;}.form-groups-tile-component > .form-group-container::before{display:none;height:0;}.form-groups-tile-component > .form-group-container > .form-group-title{display:flex;padding:1.5rem;user-select:none;cursor:pointer;gap:0.5rem;}.form-groups-tile-component > .form-group-container > .form-group-title > div{display:flex;align-items:baseline;gap:0.5rem;margin:0;}.form-groups-tile-component > .form-group-container > .form-group-title span.form-group-title-text{display:inline-block;width:calc(100% - 22px);font-family:"Poppins";font-style:normal;font-weight:400;font-size:18px;line-height:25px;color:#333333;}.form-groups-tile-component > .form-group-container .MuiAccordion-region > hr{margin:0 1.5rem;}.form-groups-tile-component > .form-group-container > .form-group-title > div > button.form-group-tile-add-button{border:0;background-color:#541868;border:none;width:30px;height:30px;display:flex;border-radius:30px;padding:0;justify-content:center;align-items:center;transition:background-color 300ms cubic-bezier(0.4,0,0.2,1) 0ms;cursor:pointer;flex-shrink:0;}.form-groups-tile-component > .form-group-container > .form-group-title > div > button.form-group-tile-add-button:disabled{background-color:#dcdcdc;}.form-groups-tile-component > .form-group-container .form-group-components{padding:0 1.5rem;margin:1.5rem 0;}.form-groups-tile-component > .form-group-container .form-group-components > .graphing-tile-controls-container.form-groups-tile{display:flex;flex-direction:column;gap:2rem;}.form-groups-tile-component > .form-group-container .form-group-add-mode-buttons{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:1rem;}.form-groups-tile-component > .form-group-container .form-group-add-mode-buttons > hr{margin:1rem 0;}.form-groups-tile-component > .form-group-container .form-group-add-mode-buttons > button{display:flex;justify-content:center;align-items:center;padding:12px 15px;gap:10px;border-radius:100px;width:110px;height:33px;font-family:"Poppins";font-style:normal;font-weight:400;font-size:14px;line-height:14px;text-align:center;border:none;}.form-groups-tile-component > .form-group-container .form-group-add-mode-buttons > button.cancel-button{background:#d4c5d9;color:#541868;}.form-groups-tile-component > .form-group-container .form-group-add-mode-buttons > button.save-button{background:#541868;color:#ffffff;}.form-groups-tile-component > .form-group-container .form-group-add-mode-buttons > button:disabled{background:#dcdcdc!important;color:#ffffff!important;}
|
|
6
|
-
.horizontal-tile-component{display:flex;width:100%;height:100%;position:relative;flex-direction:column;border-radius:.5rem;}.horizontal-tile-component>.horizontal-tile-pages-container{display:block;width:100%;height:100%;position:relative;overflow:hidden;flex-grow:1;border-radius:0.5rem;}.horizontal-tile-component>.horizontal-tile-pages-container>.horizontal-tile-page-container{display:block;width:100%;height:100%;position:absolute;left:0;top:0;z-index:0;background-color:transparent;transition:left 300ms ease-in-out;}.horizontal-tile-component>.horizontal-tile-pages-container>.horizontal-tile-page-container.active{z-index:3;}.horizontal-tile-component>.horizontal-tile-pages-container>.horizontal-tile-page-container.previous{z-index:2;}.horizontal-tile-component>.horizontal-tile-pages-container>.horizontal-tile-page-container.navigating-from-left{left:-100%;}.horizontal-tile-component>.horizontal-tile-pages-container>.horizontal-tile-page-container.navigating-from-right{left:100%;}.horizontal-tile-component>.horizontal-tile-pages-container>.horizontal-tile-page-container>.graphing-tile-controls-container.horizontal-tile{display:flex;width:100%;height:100%;flex-direction:row;justify-content:space-evenly;align-items:center;padding:.5rem;}.horizontal-tile-component>.horizontal-tile-pages-container>.horizontal-tile-page-container>.graphing-tile-controls-container.horizontal-tile>.graphing-tile-control-container{height:100%;}.horizontal-tile-component>.horizontal-tile-pages-container>.horizontal-tile-page-container.background{z-index:1;}.horizontal-tile-component>.horizontal-tile-pages-container>button.navigate-button{position:absolute;border:none;background-color:transparent;opacity:0;z-index:3;}.horizontal-tile-component:hover>.horizontal-tile-pages-container>button.navigate-button{opacity:1;}.horizontal-tile-component>.horizontal-tile-pages-container>button.navigate-button.navigate-left-button{left:15px;top:50%;margin-top:-11px;transition:left 300ms ease-in-out,opacity 300ms ease-in-out;}.horizontal-tile-component:hover>.horizontal-tile-pages-container>button.navigate-button.navigate-left-button{left:5px;}.horizontal-tile-component>.horizontal-tile-pages-container>button.navigate-button.navigate-right-button{right:15px;top:50%;margin-top:-11px;transition:right 300ms ease-in-out,opacity 300ms ease-in-out;}.horizontal-tile-component:hover>.horizontal-tile-pages-container>button.navigate-button.navigate-right-button{right:5px;}.horizontal-tile-component>.horizontal-tile-paginators-container{display:flex;flex-direction:row;justify-content:center;padding:0.25rem;opacity:0;transition:opacity 300ms ease-in-out;}.horizontal-tile-component:hover>.horizontal-tile-paginators-container{opacity:1;}.horizontal-tile-component>.horizontal-tile-paginators-container>.paginator-anchor{display:block;width:8px;height:8px;border-radius:4px;border:none;background-color:#D4C5D9;cursor:pointer;transition:width 300ms ease-in-out,background-color 300ms ease-in-out;}.horizontal-tile-component>.horizontal-tile-paginators-container>.paginator-anchor+.paginator-anchor{margin-left:4px;}.horizontal-tile-component>.horizontal-tile-paginators-container>.paginator-anchor.active{width:20px;background-color:#541868;}.horizontal-tile-component>.horizontal-tile-paginators-container>.paginator-anchor:hover{background-color:#946EA0;}.horizontal-tile-component>.horizontal-tile-paginators-container>.paginator-anchor.active:hover{background-color:#541868;}
|
|
7
|
-
.selectable-states-tile-component{display:flex;width:100%;height:100%;flex-direction:column;}.selectable-states-tile-component>.selectable-states-tile-header{display:flex;flex-direction:row;}.selectable-states-tile-component>.selectable-states-tile-header>.selected-state-tile-title{flex-grow:1;padding:0.5rem 1rem;font-size:1.2rem;line-height:1.2rem;}.selectable-states-tile-component>.selectable-states-tile-header>.selected-state-tile-title>h6{text-align:center;}.selectable-states-tile-component>.selectable-states-tile-header>.selectable-states-dropdown-container{padding:0.5rem;}.selectable-states-tile-component>.selected-state-tile-container{display:flex;flex-grow:1;padding:0 1rem 1rem 1rem;}.selectable-states-tile-component>.selected-state-tile-container>.graphing-tiles-container{padding:0;}.selectable-states-tile-component>.selected-state-tile-container>.graphing-tiles-container>.react-grid-layout{height:100%!important;overflow:hidden;}
|
|
8
|
-
.simple-form-tile-component{display:block;width:100%;height:100%;border-radius:0.5rem;background-color:transparent;}.simple-form-tile-component > .graphing-tile-controls-container.simple-form-tile > .graphing-tile-control-container + .graphing-tile-control-container{margin-top:2rem;}.simple-form-tile-component > .graphing-tile-controls-container.simple-form-tile > .graphing-tile-control-container:last-child{margin-bottom:1.5rem;}
|
|
9
|
-
.single-tile-component{display:block;width:100%;height:100%;border-radius:0.5rem;}.single-tile-component>.graphing-tile-controls-container.single-tile{display:block;width:100%;height:100%;}.single-tile-component>.graphing-tile-controls-container.single-tile>.graphing-tile-control-container{display:flex;width:100%;height:100%;flex-wrap:wrap;align-content:center;justify-content:center;}
|
|
10
|
-
.vertical-tile-component{display:block;width:100%;height:100%;border-radius:0.5rem;}.vertical-tile-component>.graphing-tile-controls-container.vertical-tile{display:flex;width:100%;height:100%;flex-direction:column;overflow-x:hidden;overflow-y:auto;justify-content:space-between;}
|
|
11
|
-
.moorr-modal-container > .moorr-modal-content-container{padding:0;display:flex;flex-direction:column;}.moorr-modal-container > .moorr-modal-content-container:focus-visible{border:none;outline:none;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #e3e3e3;border-radius:5px 5px 0 0;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-header > .moorr-modal-header-color-bar{width:0.25rem;height:100%;background-color:#aeaeae;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-header > h6{padding:1rem;flex-grow:1;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body{display:block;flex-grow:1;overflow-y:auto;padding:1rem;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body:last-child{border-radius:0 0 5px 5px;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body::-webkit-scrollbar{width:6px;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body::-webkit-scrollbar-thumb{background-color:#a98bb3;border-radius:6px;transition:background-color 300ms cubic-bezier(0.4,0,0.2,1) 0ms;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body::-webkit-scrollbar-thumb:hover{background-color:rgb(118,70,134);}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body::-webkit-scrollbar-track{background:rgba(118,70,134,0.15);border-radius:6px;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline{border-color:rgba(0,0,0,0.23);}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body input[text] + .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .Mui-focused > .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline{border-color:var(--primary-color);}.moorr-modal-container.moorr-slide-modal{align-items:flex-start;justify-content:flex-end;}.moorr-modal-container.moorr-slide-modal > .moorr-modal-content-container{height:100%;}.moorr-modal-container .MuiButton-root.MuiButton-text{font-family:"Poppins";font-size:0.9em;}
|
|
12
|
-
.moorr-modal-container{width:100%;height:100%;}.moorr-modal-container + .moorr-modal-container.moorr-fade-modal{opacity:1;transition:opacity 300ms cubic-bezier(0.4,0,0.2,1) 0ms;}.moorr-modal-container.moorr-modal-container-closing + .moorr-modal-container.moorr-fade-modal{opacity:0;}.moorr-modal-container > .moorr-modal-body{padding:1rem;flex-grow:1;overflow:auto;}.moorr-modal-container > .moorr-modal-body:last-child{border-radius:0 0 5px 5px;}.moorr-modal-container > .moorr-modal-body::-webkit-scrollbar{width:6px;}.moorr-modal-container > .moorr-modal-body::-webkit-scrollbar-thumb{background-color:#a98bb3;border-radius:6px;transition:background-color 300ms cubic-bezier(0.4,0,0.2,1) 0ms;}.moorr-modal-container > .moorr-modal-body::-webkit-scrollbar-thumb:hover{background:rgb(118,70,134);}.moorr-modal-container > .moorr-modal-body::-webkit-scrollbar-track{background:rgba(118,70,134,0.15);border-radius:6px;}.moorr-modal-container > .moorr-modal-body .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline{border-color:rgba(0,0,0,0.23);}.moorr-modal-container > .moorr-modal-body input[text] + .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .Mui-focused > .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline{border-color:var(--primary-color);}.moorr-modal-container > .moorr-modal-header{padding:1rem;border-radius:5px 5px 0 0;}.moorr-modal-container > .moorr-modal-header > .tabs{margin-bottom:-1rem;}.moorr-modal-container > .moorr-modal-footer{display:flex;justify-content:space-between;flex-direction:row;padding:1rem;}.moorr-modal-container > .moorr-modal-footer > .left-buttons{display:flex;justify-content:flex-start;flex-direction:row;}.moorr-modal-container > .moorr-modal-footer > .status-message{flex-grow:1;}.moorr-modal-container > .moorr-modal-footer > .right-buttons{display:flex;justify-content:flex-end;flex-direction:row;}.moorr-modal-container > .moorr-modal-footer > .left-buttons button + button,.moorr-modal-container > .moorr-modal-footer > .right-buttons button + button{margin-left:0.5rem;}.moorr-modal-container > .moorr-modal-footer > div > .MuiButtonBase-root.MuiButton-contained{display:flex;justify-content:center;align-items:center;padding:12px 15px;gap:10px;border-radius:100px;width:110px;height:33px;font-family:"Poppins";font-style:normal;font-weight:400;font-size:14px;line-height:14px;text-align:center;border:none;text-transform:capitalize;}.moorr-modal-container > .moorr-modal-footer > div > .MuiButtonBase-root.MuiButton-contained.MuiButton-containedSecondary{background:#d4c5d9;color:#541868;}.moorr-modal-container > .moorr-modal-footer > div > .MuiButtonBase-root.MuiButton-contained.MuiButton-containedPrimary{background:#541868;color:#ffffff;}
|
package/cjs/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("moorr-common"),n=require("@material-ui/core/MenuItem"),o=require("@material-ui/core/styles"),l=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"),v=require("@mui/icons-material/Close");const E=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"}});o.makeStyles(E);const x=o.makeStyles((()=>o.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 y=o.withStyles(E)((({handleChange:t,value:o,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:E,focused:y,error:b,notchedOutline:T,notchedOutlineMBRequired:C}=a,w=x();let N;return v&&(N={IconComponent:v}),e.createElement(l,{fullWidth:!1!==f,id:"outlined-basic",variant:"outlined",value:o,onChange:t,disabled:r,name:i,className:[s].join(" "),InputProps:{classes:{root:E,focused:y,error:b,notchedOutline:!h||o&&0!==(null==o?void 0:o.length)?!g||o&&0!==(null==o?void 0:o.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,o)=>"-separator-"===t?e.createElement(n,{key:`separator-${o}`,value:"",disabled:!0},e.createElement("em",null,"-----------")):e.createElement(n,{key:`menu-item-${o}-${t.value||t}`,value:t.value||t},t.label||t))))}));const b={};const T=({className:n,icon:o,width:l,height:r,fill:i,stroke:s,accent:a,dropShadow:c})=>{if(t.utils.isNullOrUndefined(o))return null;const u=b[o]||null;return u?e.createElement(u,{className:n,fill:i,width:l,height:r,stroke:s,accent:a,dropShadow:c}):null},C={};var w=({stylePrefix:t,children:n})=>{let l;if(t)l=C[t]?C[t]:C[t]=i.createGenerateClassName({seed:t});else{const e=`MoorrStylesProvider-${s.v4()}-`;l=i.createGenerateClassName({seed:e})}return e.createElement(i.StylesProvider,{generateClassName:l,injectFirst:!0},e.createElement(r.StylesProvider,{generateClassName:l,injectFirst:!0},e.createElement(o.StylesProvider,{generateClassName:l},n)))};const N=e.createContext({});function M(){return e.useContext(N)}const S={};function P(e,t){e&&t&&(S[e]=t)}const k=({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=S[t.tile.tileType]||null;return l?e.createElement(l,{graphingTile:t,graphingTileIndex:n}):null},F=[20,20],G={lg:600,sm:0},I={lg:8,sm:2},A=({tilePrefix:t,responsive:n,columns:o,containerPadding:l,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,o)=>{if(!n.tile||!n.visible)return null;let l="graphing-tile-container";!1!==n.border&&(l+=" bordered"),n.autoHeight&&(l+=" auto-height");const r=`${t?t+"_":""}tile_${o}`;return e.createElement("div",{className:l,key:r},e.createElement(k,{graphingTile:n,graphingTileIndex:o}))})),T=e=>{if(!r||isNaN(r)||r<=0||!i||isNaN(i)||i<=0||null==e)return F;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=[l||0,0];return e.createElement(a.Responsive,{width:h,breakpoints:G,cols:o||I,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})())},L={};function B(e,t){L[e]=t}function q(e){const t=L[null==e?void 0:e.tileType];return t?new t(e):null}class D{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 H{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 D(e))}))}}const $={};function O(e){const t=$[null==e?void 0:e.controlType];return t?new t(e):null}class _{constructor(e){this.controlType=e.controlType,this.dataKey=e.dataKey}}class z{constructor(e){this.border=e.border,this.background=e.background||null,this.control=O(e.control)}getBackground(e){return this.background||(null==e?void 0:e.background)||"#FFFFFF"}}class R{constructor(e){this.id=e.id||"",this.title=e.title||"",this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new z(e))})),this.add=!0===e.add}}class W{constructor(e){this.tileType=e.tileType}}class U extends W{constructor(e){super(e),this.control=new z(e.control)}}class j extends W{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new z(e))}))}}class V extends W{constructor(e){super(e),t.utils.isArray(e.formGroups)&&e.formGroups.length>0?this.formGroups=e.formGroups.map((e=>new R(e))):this.formGroups=[]}}B("form-groups-tile",V);class Z extends j{constructor(e){super(e),this.controlsPerPage=e.controlsPerPage,(isNaN(this.controlsPerPage)||this.controlsPerPage<=1)&&(this.controlsPerPage=1)}}B("horizontal-tile",Z);class K extends j{constructor(e){super(e),this.states={};for(const t in e.states){const n=e.states[t];n&&(this.states[t]=new H(n))}}}B("selectable-states-tile",K);class J extends W{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new z(e))}))}}B("simple-form-tile",J);class Q extends U{constructor(e){super(e)}}B("single-tile",Q);class X extends j{constructor(e){super(e)}}B("vertical-tile",X);const Y={};const ee=({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=Y[o.control.controlType]||null;return i?e.createElement(i,Object.assign({graphingTile:t,graphingTileIndex:n,graphingTileControl:o},l)):null},te=({graphingTile:t,graphingTileIndex:n,graphingTileControls:o,ControlProps:l})=>{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==o?void 0:o.map(((o,r)=>{var i,s;if(!o.control)return null;let a="graphing-tile-control-container";(null===(i=o.control)||void 0===i?void 0:i.controlType)&&(a+=" "+(null===(s=o.control)||void 0===s?void 0:s.controlType)),!1!==o.border&&(a+=" bordered");const c=`control_${n}_${r}`;return e.createElement("div",{className:a,key:c},e.createElement(ee,{graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:l}))})))};function ne(e,t,n,o){return new(n||(n=Promise))((function(l,r){function i(e){try{a(o.next(e))}catch(e){r(e)}}function s(e){try{a(o.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?l(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}a((o=o.apply(e,t||[])).next())}))}const oe=({graphingTile:n,graphingTileIndex:o})=>{const l=null==n?void 0:n.tile;if(!l)return null;const r=M();return e.createElement("div",{className:"form-groups-tile-component"},!t.utils.isArray(l.formGroups)||l.formGroups.length<0?null:l.formGroups.map(((l,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)},b=e.useCallback((()=>!0!==l.add||t.utils.isFunction(r.formGroupHasAddMode)&&!r.formGroupHasAddMode(l.id)?null:e.createElement("button",{type:"button",className:"form-group-tile-add-button",onClick:C,disabled:"add"==a},e.createElement(T,{icon:"add-icon",stroke:"#ffffff"}))),[a,r.formGroupHasAddMode]);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=>ne(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:l})])),p("normal")})),[N,M]=e.useState(!1),S=e=>ne(void 0,void 0,void 0,(function*(){if(t.utils.isFunction(null==r?void 0:r.handleFormGroupSave))try{M(!0);const[e]=yield Promise.all([null==r?void 0:r.handleFormGroupSave({formGroup:l})]);if(!1===e)return}finally{M(!1)}p("normal")}));let P="form-group-container";return t.utils.isFunction(r.isFormGroupVisible)&&(r.isFormGroupVisible(l.id)||(P+=" hidden")),P!==g&&h(P),e.createElement(c,{className:P,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"},l.title),b()),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(l,"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",disabled:N,onClick:w},"Cancel"),e.createElement("button",{className:"save-button",disabled:N,onClick:S},"Save")))}{const i=l.controls;let s;return t.utils.isFunction(r.renderFormGroup)&&(s=r.renderFormGroup(l,"normal"),!t.utils.isNullOrUndefined(s))?s:e.createElement(te,{graphingTile:n,graphingTileIndex:o,graphingTileControls:i,ControlProps:{onUIChange:y}})}})()))})))};P("form-groups-tile",oe);const le=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const[l,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(o.controls.length/o.controlsPerPage);if(t>0)for(let n=0;n<t;n++){const t={pageIndex:n,controls:[]};for(let e=0;e<o.controlsPerPage;e++){const l=n*o.controlsPerPage+e;if(l>=o.controls.length)break;t.controls.push(o.controls[l])}e.push(t)}s(t),c(0),d(null),p(null),h(null),v(e)}),o.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!==l)return;const t=a;let n=a-1;n<0&&(n=i-1),d(t),c(n),p(null),h(t);const o=setTimeout((()=>{E(n),h(null),d(null),setTimeout((function(){r(null)}),300)}),300);r(o)},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!==l)return;const t=a;let n=a+1;n>=i&&(n=0),d(t),c(n),p(t),h(null);const o=setTimeout((()=>{p(null),C(n),d(null),setTimeout((function(){r(null)}),300)}),300);r(o)},P={background:t.getBackground()};return e.createElement("div",{className:"horizontal-tile-component",style:P},e.createElement("div",{className:"horizontal-tile-pages-container"},f.map(((o,l)=>{let r="horizontal-tile-page-container";return l===a?r+=" active":l===m?r+=" navigating-from-left":l===g&&(r+=" navigating-from-right"),l===u&&(r+=" previous"),e.createElement("div",{className:r},e.createElement(te,{graphingTile:t,graphingTileIndex:n,graphingTileControls:o.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,o=t;d(n),c(o),n<o?p(n):h(n)}})}))))};P("horizontal-tile",le);const re=({graphingTile:t})=>{const n=null==t?void 0:t.tile;if(!n)return null;const[o,l]=e.useState(""),[r,i]=e.useState(null),[s,a]=e.useState([]),c=M();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 l(""),i(null)}),[n.states]);const u=e=>{l(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(y,{options:s,label:"Select",value:o,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(A,{tilePrefix:o,graphingTiles:r.tiles,responsive:r.responsive,columns:r.columns,containerPadding:r.containerPadding,referenceMargin:r.referenceMargin,referenceWidth:r.referenceWidth}):null))};P("selectable-states-tile",re);const ie=({graphingTile:n,graphingTileIndex:o})=>{const l=null==n?void 0:n.tile;if(!l)return null;const r=M(),i=e=>{t.utils.isFunction(r.handleUIChange)&&r.handleUIChange(e)};return e.createElement("div",{className:"simple-form-tile-component"},(()=>{if(!t.utils.isArray(l.controls)||l.controls.length<0)return null;const r=l.controls;return e.createElement(te,{graphingTile:n,graphingTileIndex:o,graphingTileControls:r,ControlProps:{onUIChange:i}})})())};P("simple-form-tile",ie);const se=({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(te,{graphingTile:t,graphingTileIndex:n,graphingTileControls:l}))};P("single-tile",se);const ae=({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(te,{graphingTile:t,graphingTileIndex:n,graphingTileControls:l}))};P("vertical-tile",ae);const ce=()=>{const e=ue.pop();e&&(e.classList.add("moorr-modal-container-closing"),setTimeout((()=>{e&&(p.unmountComponentAtNode(e),e.remove())}),300))};const ue=[],de={},me=o.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)}}))),pe=n=>{const o=me(),l={};n.fixedWidth&&(l.width=n.fixedWidth),n.fixedHeight&&(l.height=n.fixedHeight);let i=o.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=o.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:l},n.children));case"slide":return e.createElement(g.Slide,{in:c,direction:"left",timeout:300},e.createElement("div",{className:i},n.children))}})())},ge=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||!de[i])return Promise.reject("invalid-modal");const s=new de[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)&&s.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)&&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",ge),document.addEventListener("openModal",ge)),exports.Button=({type:n,label:o})=>(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,o))),exports.Dropdown=y,exports.FadeModal=t=>e.createElement(pe,{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=R,exports.FormGroupsTile=oe,exports.FormGroupsTileModel=V,exports.FormInputModel=class extends _{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=N,exports.GraphingControl=ee,exports.GraphingControlModel=_,exports.GraphingControlSettingsModel=z,exports.GraphingGrid=({})=>{const{settings:n}=M(),[o,l]=e.useState(null),[r,i]=e.useState(!1);e.useEffect((()=>{setTimeout((()=>{window.dispatchEvent(new Event("resize")),setTimeout((()=>{i(!0)}),300)}),300)}),[]),e.useEffect((()=>{l(n?new H(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(!o)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(A,{graphingTiles:o.tiles,responsive:o.responsive,columns:o.columns,containerPadding:o.containerPadding,referenceMargin:o.referenceMargin,referenceWidth:o.referenceWidth})))},exports.GraphingSettingsModel=H,exports.GraphingTile=k,exports.GraphingTileControls=te,exports.GraphingTileModel=W,exports.GraphingTileSettingsModel=D,exports.GraphingTiles=A,exports.HorizontalTile=le,exports.HorizontalTileModel=Z,exports.Modal=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,ce()},"function"==typeof t.onDismiss&&(r=t.onClose),t.onDismiss=()=>{r&&r(),n({dismissed:!0}),t.showModal=!1,ce()},t.showModal=!0;let i=e.createElement(w,{stylePrefix:"MoorrReactMuiModal"},e.createElement(this.getComponent(),t));ue.push(this._container=document.createElement("div")),this._container.className="moorr-modal-container",document.body.appendChild(this._container),p.render(i,this._container)}))}},exports.MoorrModal=pe,exports.MultipleControlsTileModel=j,exports.SelectableStatesTile=re,exports.SelectableStatesTileModel=K,exports.SimpleFormTile=ie,exports.SimpleFormTileModel=J,exports.SingleControlTileModel=U,exports.SingleTile=se,exports.SingleTileModel=Q,exports.StylesProvider=w,exports.SvgIcon=T,exports.VerticalTile=ae,exports.VerticalTileModel=X,exports.createGraphingControl=O,exports.createGraphingControls=function(e){const t=[];return e.forEach((e=>{const n=O(e);n&&t.push(n)})),t},exports.createGraphingTile=q,exports.createGraphingTiles=function(e){const t=[];return e.forEach((e=>{const n=q(e);n&&t.push(n)})),t},exports.modals=de,exports.modalsStack=ue,exports.registerGraphingControl=function(e,t){$[e]=t},exports.registerGraphingControlComponent=function(e,t){e&&t&&(Y[e]=t)},exports.registerGraphingTile=B,exports.registerGraphingTileComponent=P,exports.registerSvgIconComponent=function(e,t){e&&t&&(b[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"},closeButton:()=>e.createElement(v,{sx:{color:"#EB5757"}})})})(n)},exports.useGraphingContext=M;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import "./button.styles.css";
|
|
3
|
-
/** ---------------------------------------------------------------------------
|
|
4
|
-
* Private
|
|
5
|
-
* ----------------------------------------------------------------------------
|
|
6
|
-
*/
|
|
7
|
-
export interface Props {
|
|
8
|
-
type?: "button" | "submit" | "reset" | undefined;
|
|
9
|
-
label: string;
|
|
10
|
-
}
|
|
11
|
-
/** ---------------------------------------------------------------------------
|
|
12
|
-
* Component
|
|
13
|
-
* ----------------------------------------------------------------------------
|
|
14
|
-
*/
|
|
15
|
-
declare const Button: ({ type, label }: Props) => JSX.Element;
|
|
16
|
-
export default Button;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./button.component";
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Theme } from "@material-ui/core/styles";
|
|
2
|
-
declare const styles: (theme: Theme) => {
|
|
3
|
-
root: {
|
|
4
|
-
"&:hover:not($disabled):not($focused):not($error) $notchedOutline": {};
|
|
5
|
-
"&$checked": {
|
|
6
|
-
color: string;
|
|
7
|
-
};
|
|
8
|
-
"& .vldt-MuiSelect-select.vldt-MuiSelect-select": {
|
|
9
|
-
color: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
disabled: {};
|
|
13
|
-
focused: {};
|
|
14
|
-
error: {};
|
|
15
|
-
notchedOutline: {};
|
|
16
|
-
checked: {};
|
|
17
|
-
notchedOutlineMBRequired: {
|
|
18
|
-
flex: number;
|
|
19
|
-
borderColor: string;
|
|
20
|
-
borderWidth: number;
|
|
21
|
-
};
|
|
22
|
-
fieldSetMBRequired: {
|
|
23
|
-
"& fieldset": {
|
|
24
|
-
flex: number;
|
|
25
|
-
borderColor: string;
|
|
26
|
-
borderWidth: number;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
fieldSetErrorField: {
|
|
30
|
-
"& fieldset": {
|
|
31
|
-
borderColor: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
blue: {
|
|
35
|
-
color: string;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
export default styles;
|
|
39
|
-
export declare const useGlobalStyles: (props?: any) => import("@material-ui/styles").ClassNameMap<"blue" | "root" | "disabled" | "focused" | "error" | "notchedOutline" | "checked" | "notchedOutlineMBRequired" | "fieldSetMBRequired" | "fieldSetErrorField">;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* * Dropdown Field Component
|
|
3
|
-
*/
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { InputFieldClassesProp as InputFieldClassesProperty } from "../component.props";
|
|
6
|
-
export interface DropdownProps {
|
|
7
|
-
handleChange?: (input: any) => void;
|
|
8
|
-
value?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
name?: string;
|
|
11
|
-
className?: string;
|
|
12
|
-
classes: InputFieldClassesProperty;
|
|
13
|
-
size?: any;
|
|
14
|
-
menuItemLabel?: string;
|
|
15
|
-
options?: string[];
|
|
16
|
-
labelPlacement?: "start" | "end" | "top" | "bottom" | undefined;
|
|
17
|
-
label?: string;
|
|
18
|
-
required?: boolean;
|
|
19
|
-
isMBRequiredField?: boolean;
|
|
20
|
-
fullWidth?: boolean;
|
|
21
|
-
selectIconComponent?: React.ElementType<any> | undefined;
|
|
22
|
-
}
|
|
23
|
-
declare const _default: React.ComponentType<Pick<DropdownProps, "label" | "className" | "disabled" | "size" | "required" | "handleChange" | "value" | "name" | "menuItemLabel" | "options" | "labelPlacement" | "isMBRequiredField" | "fullWidth" | "selectIconComponent"> & import("@material-ui/core/styles").StyledComponentProps<"blue" | "root" | "disabled" | "focused" | "error" | "notchedOutline" | "checked" | "notchedOutlineMBRequired" | "fieldSetMBRequired" | "fieldSetErrorField">>;
|
|
24
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./dropdown.component";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./svg-icon.component";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
/** ---------------------------------------------------------------------------
|
|
3
|
-
* Private
|
|
4
|
-
* ----------------------------------------------------------------------------
|
|
5
|
-
*/
|
|
6
|
-
export interface SvgIconProps {
|
|
7
|
-
className?: string;
|
|
8
|
-
width?: number;
|
|
9
|
-
height?: number;
|
|
10
|
-
fill?: string;
|
|
11
|
-
stroke?: string;
|
|
12
|
-
accent?: string;
|
|
13
|
-
dropShadow?: boolean;
|
|
14
|
-
}
|
|
15
|
-
type SvgIconComponent = (props: SvgIconProps) => JSX.Element | null;
|
|
16
|
-
export declare function registerSvgIconComponent(key: string, component: SvgIconComponent): void;
|
|
17
|
-
interface Props extends SvgIconProps {
|
|
18
|
-
icon: string;
|
|
19
|
-
}
|
|
20
|
-
/** ---------------------------------------------------------------------------
|
|
21
|
-
* Component
|
|
22
|
-
* ----------------------------------------------------------------------------
|
|
23
|
-
*/
|
|
24
|
-
export declare const SvgIcon: ({ className, icon, width, height, fill, stroke, accent, dropShadow, }: Props) => JSX.Element | null;
|
|
25
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { GraphingTileSettingsModel, GraphingControlSettingsModel } from "../../models";
|
|
3
|
-
/** ---------------------------------------------------------------------------
|
|
4
|
-
* Private
|
|
5
|
-
* ----------------------------------------------------------------------------
|
|
6
|
-
*/
|
|
7
|
-
export interface GraphingControlProps {
|
|
8
|
-
graphingTile?: GraphingTileSettingsModel;
|
|
9
|
-
graphingTileIndex?: number;
|
|
10
|
-
graphingTileControl: GraphingControlSettingsModel;
|
|
11
|
-
controlData?: any;
|
|
12
|
-
gtagSource?: string;
|
|
13
|
-
ControlProps?: any;
|
|
14
|
-
}
|
|
15
|
-
type GraphingControlComponent = (props: GraphingControlProps) => JSX.Element | null;
|
|
16
|
-
export declare function registerGraphingControlComponent(key: string, component: GraphingControlComponent): void;
|
|
17
|
-
/** ---------------------------------------------------------------------------
|
|
18
|
-
* Component
|
|
19
|
-
* ----------------------------------------------------------------------------
|
|
20
|
-
*/
|
|
21
|
-
export declare const GraphingControl: ({ graphingTile, graphingTileIndex, graphingTileControl, ControlProps }: GraphingControlProps) => JSX.Element | null;
|
|
22
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./graphing-control.component";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import "./graphing-grid.styles.css";
|
|
3
|
-
/** ---------------------------------------------------------------------------
|
|
4
|
-
* Private
|
|
5
|
-
* ----------------------------------------------------------------------------
|
|
6
|
-
*/
|
|
7
|
-
interface Props {
|
|
8
|
-
}
|
|
9
|
-
/** ---------------------------------------------------------------------------
|
|
10
|
-
* Component
|
|
11
|
-
* ----------------------------------------------------------------------------
|
|
12
|
-
*/
|
|
13
|
-
export declare const GraphingGrid: ({}: Props) => JSX.Element | null;
|
|
14
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { GraphingTileSettingsModel } from "../models/graphing-tile-settings.model";
|
|
3
|
-
import { GraphingControlSettingsModel } from "../models/graphing-control-settings.model";
|
|
4
|
-
import "./graphing-tile-controls.styles.css";
|
|
5
|
-
/** ---------------------------------------------------------------------------
|
|
6
|
-
* Private
|
|
7
|
-
* ----------------------------------------------------------------------------
|
|
8
|
-
*/
|
|
9
|
-
interface Props {
|
|
10
|
-
graphingTile: GraphingTileSettingsModel;
|
|
11
|
-
graphingTileIndex: number;
|
|
12
|
-
graphingTileControls: GraphingControlSettingsModel[];
|
|
13
|
-
ControlProps?: any;
|
|
14
|
-
}
|
|
15
|
-
/** ---------------------------------------------------------------------------
|
|
16
|
-
* Component
|
|
17
|
-
* ----------------------------------------------------------------------------
|
|
18
|
-
*/
|
|
19
|
-
export declare const GraphingTileControls: ({ graphingTile, graphingTileIndex, graphingTileControls, ControlProps }: Props) => JSX.Element;
|
|
20
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { GraphingTileSettingsModel } from "../models/graphing-tile-settings.model";
|
|
3
|
-
import "./graphing-tiles.styles.css";
|
|
4
|
-
/** ---------------------------------------------------------------------------
|
|
5
|
-
* Private
|
|
6
|
-
* ----------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
interface Props {
|
|
9
|
-
tilePrefix?: string | null;
|
|
10
|
-
graphingTiles: GraphingTileSettingsModel[];
|
|
11
|
-
responsive?: boolean;
|
|
12
|
-
columns?: {
|
|
13
|
-
[P: string]: number;
|
|
14
|
-
};
|
|
15
|
-
containerPadding?: number;
|
|
16
|
-
referenceMargin?: number;
|
|
17
|
-
referenceWidth?: number;
|
|
18
|
-
}
|
|
19
|
-
/** ---------------------------------------------------------------------------
|
|
20
|
-
* Component
|
|
21
|
-
* ----------------------------------------------------------------------------
|
|
22
|
-
*/
|
|
23
|
-
export declare const GraphingTiles: ({ tilePrefix, responsive, columns, containerPadding, referenceMargin, referenceWidth, graphingTiles }: Props) => JSX.Element;
|
|
24
|
-
export {};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { FormGroupModel, FormInputModel, GraphingSettingsModel } from "../models";
|
|
3
|
-
/** ---------------------------------------------------------------------------
|
|
4
|
-
* Private
|
|
5
|
-
* ----------------------------------------------------------------------------
|
|
6
|
-
*/
|
|
7
|
-
export interface InputEventArgs {
|
|
8
|
-
originalEvent: any;
|
|
9
|
-
control: FormInputModel;
|
|
10
|
-
type: string;
|
|
11
|
-
inputSchema: any;
|
|
12
|
-
}
|
|
13
|
-
export interface InputChangeEventArgs {
|
|
14
|
-
originalEvent: any;
|
|
15
|
-
control: FormInputModel;
|
|
16
|
-
key: string;
|
|
17
|
-
value: any;
|
|
18
|
-
frequency?: string;
|
|
19
|
-
asAtDate?: Date;
|
|
20
|
-
}
|
|
21
|
-
export interface LinkClickEventArgs {
|
|
22
|
-
originalEvent: any;
|
|
23
|
-
control: FormInputModel;
|
|
24
|
-
payload: any;
|
|
25
|
-
}
|
|
26
|
-
export interface InputDataRequiredEventArgs {
|
|
27
|
-
key: string;
|
|
28
|
-
}
|
|
29
|
-
export type GraphingContextResult = {
|
|
30
|
-
settings?: GraphingSettingsModel;
|
|
31
|
-
flags?: {
|
|
32
|
-
[key: string]: boolean;
|
|
33
|
-
};
|
|
34
|
-
data: {
|
|
35
|
-
[key: string]: any;
|
|
36
|
-
};
|
|
37
|
-
selectableRanges?: {
|
|
38
|
-
label: string;
|
|
39
|
-
value: string;
|
|
40
|
-
}[];
|
|
41
|
-
selectedRange?: string;
|
|
42
|
-
dropdownValues?: any;
|
|
43
|
-
inputSchemas?: any;
|
|
44
|
-
handleSelectableStatesTileChange?: (e: any) => void;
|
|
45
|
-
handleRangeSelectChange?: (e: any) => void;
|
|
46
|
-
isFormGroupVisible?: (id: string) => boolean;
|
|
47
|
-
formGroupHasAddMode?: (id: string) => boolean;
|
|
48
|
-
renderFormGroup?: (formGroup: FormGroupModel, mode: "normal" | "add") => React.ReactNode;
|
|
49
|
-
handleFormGroupCancel?: (e: any) => void | Promise<void>;
|
|
50
|
-
handleFormGroupSave?: (e: any) => boolean | Promise<boolean>;
|
|
51
|
-
handleInputEvent?: (e: InputEventArgs) => Promise<void>;
|
|
52
|
-
handleInputChange?: (e: InputChangeEventArgs) => Promise<void>;
|
|
53
|
-
handleInputDataRequired?: (e: InputDataRequiredEventArgs) => Promise<void>;
|
|
54
|
-
handleLinkClick?: (e: LinkClickEventArgs) => Promise<void>;
|
|
55
|
-
handleUIChange?: (e?: any) => void;
|
|
56
|
-
navigate?: (path: any) => void;
|
|
57
|
-
};
|
|
58
|
-
/** ---------------------------------------------------------------------------
|
|
59
|
-
* Context
|
|
60
|
-
* ----------------------------------------------------------------------------
|
|
61
|
-
*/
|
|
62
|
-
declare const GraphingContext: React.Context<GraphingContextResult>;
|
|
63
|
-
export default GraphingContext;
|
|
64
|
-
export declare function useGraphingContext(): GraphingContextResult;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { default as GraphingContext, GraphingContextResult, useGraphingContext, InputEventArgs, InputChangeEventArgs, InputDataRequiredEventArgs, LinkClickEventArgs, } from "./graphing.context";
|
|
2
|
-
export { GraphingGrid } from "./graphing-grid.component";
|
|
3
|
-
export { GraphingTileControls } from "./graphing-tile-controls.component";
|
|
4
|
-
export { GraphingTiles } from "./graphing-tiles.component";
|
|
5
|
-
export * from "./controls";
|
|
6
|
-
export * from "./tiles";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { GraphingTileProps } from "./graphing-tile.component";
|
|
3
|
-
import "./form-groups-tile.styles.css";
|
|
4
|
-
/** ---------------------------------------------------------------------------
|
|
5
|
-
* Private
|
|
6
|
-
* ----------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
interface Props extends GraphingTileProps {
|
|
9
|
-
}
|
|
10
|
-
/** ---------------------------------------------------------------------------
|
|
11
|
-
* Component
|
|
12
|
-
* ----------------------------------------------------------------------------
|
|
13
|
-
*/
|
|
14
|
-
export declare const FormGroupsTile: ({ graphingTile, graphingTileIndex }: Props) => JSX.Element | null;
|
|
15
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { GraphingTileSettingsModel } from "../../models/graphing-tile-settings.model";
|
|
3
|
-
/** ---------------------------------------------------------------------------
|
|
4
|
-
* Private
|
|
5
|
-
* ----------------------------------------------------------------------------
|
|
6
|
-
*/
|
|
7
|
-
export interface GraphingTileProps {
|
|
8
|
-
graphingTile: GraphingTileSettingsModel;
|
|
9
|
-
graphingTileIndex: number;
|
|
10
|
-
}
|
|
11
|
-
type GraphingTileComponent = (props: GraphingTileProps) => JSX.Element | null;
|
|
12
|
-
export declare function registerGraphingTileComponent(key: string, component: GraphingTileComponent): void;
|
|
13
|
-
/** ---------------------------------------------------------------------------
|
|
14
|
-
* Component
|
|
15
|
-
* ----------------------------------------------------------------------------
|
|
16
|
-
*/
|
|
17
|
-
export declare const GraphingTile: ({ graphingTile, graphingTileIndex, }: GraphingTileProps) => JSX.Element | null;
|
|
18
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { GraphingTileProps } from "./graphing-tile.component";
|
|
3
|
-
import "./horizontal-tile.styles.css";
|
|
4
|
-
/** ---------------------------------------------------------------------------
|
|
5
|
-
* Private
|
|
6
|
-
* ----------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
interface Props extends GraphingTileProps {
|
|
9
|
-
}
|
|
10
|
-
/** ---------------------------------------------------------------------------
|
|
11
|
-
* Component
|
|
12
|
-
* ----------------------------------------------------------------------------
|
|
13
|
-
*/
|
|
14
|
-
export declare const HorizontalTile: ({ graphingTile, graphingTileIndex }: Props) => JSX.Element | null;
|
|
15
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from "./form-groups-tile.component";
|
|
2
|
-
export * from "./graphing-tile.component";
|
|
3
|
-
export * from "./horizontal-tile.component";
|
|
4
|
-
export * from "./selectable-states-tile.component";
|
|
5
|
-
export * from "./simple-form-tile.component";
|
|
6
|
-
export * from "./single-tile.component";
|
|
7
|
-
export * from "./vertical-tile.component";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { GraphingTileProps } from "./graphing-tile.component";
|
|
3
|
-
import "./selectable-states-tile.styles.css";
|
|
4
|
-
/** ---------------------------------------------------------------------------
|
|
5
|
-
* Private
|
|
6
|
-
* ----------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
interface Props extends GraphingTileProps {
|
|
9
|
-
}
|
|
10
|
-
/** ---------------------------------------------------------------------------
|
|
11
|
-
* Component
|
|
12
|
-
* ----------------------------------------------------------------------------
|
|
13
|
-
*/
|
|
14
|
-
export declare const SelectableStatesTile: ({ graphingTile }: Props) => JSX.Element | null;
|
|
15
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { GraphingTileProps } from "./graphing-tile.component";
|
|
3
|
-
import "./simple-form-tile.styles.css";
|
|
4
|
-
/** ---------------------------------------------------------------------------
|
|
5
|
-
* Private
|
|
6
|
-
* ----------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
interface Props extends GraphingTileProps {
|
|
9
|
-
}
|
|
10
|
-
/** ---------------------------------------------------------------------------
|
|
11
|
-
* Component
|
|
12
|
-
* ----------------------------------------------------------------------------
|
|
13
|
-
*/
|
|
14
|
-
export declare const SimpleFormTile: ({ graphingTile, graphingTileIndex }: Props) => JSX.Element | null;
|
|
15
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { GraphingTileProps } from "./graphing-tile.component";
|
|
3
|
-
import "./single-tile.styles.css";
|
|
4
|
-
/** ---------------------------------------------------------------------------
|
|
5
|
-
* Private
|
|
6
|
-
* ----------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
interface Props extends GraphingTileProps {
|
|
9
|
-
}
|
|
10
|
-
/** ---------------------------------------------------------------------------
|
|
11
|
-
* Component
|
|
12
|
-
* ----------------------------------------------------------------------------
|
|
13
|
-
*/
|
|
14
|
-
export declare const SingleTile: ({ graphingTile, graphingTileIndex }: Props) => JSX.Element | null;
|
|
15
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { GraphingTileProps } from "./graphing-tile.component";
|
|
3
|
-
import "./vertical-tile.styles.css";
|
|
4
|
-
/** ---------------------------------------------------------------------------
|
|
5
|
-
* Private
|
|
6
|
-
* ----------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
interface Props extends GraphingTileProps {
|
|
9
|
-
}
|
|
10
|
-
/** ---------------------------------------------------------------------------
|
|
11
|
-
* Component
|
|
12
|
-
* ----------------------------------------------------------------------------
|
|
13
|
-
*/
|
|
14
|
-
export declare const VerticalTile: ({ graphingTile, graphingTileIndex }: Props) => JSX.Element | null;
|
|
15
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { GraphingControlModel } from "./graphing-control.model";
|
|
2
|
-
interface GraphingControlConstructor {
|
|
3
|
-
new (json: any): GraphingControlModel;
|
|
4
|
-
}
|
|
5
|
-
export declare function registerGraphingControl(key: string, constructor: GraphingControlConstructor): void;
|
|
6
|
-
export declare function createGraphingControl(json: any): GraphingControlModel | null;
|
|
7
|
-
export declare function createGraphingControls(jsons: any[]): GraphingControlModel[];
|
|
8
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** ---------------------------------------------------------------------------
|
|
2
|
-
* Model
|
|
3
|
-
* ----------------------------------------------------------------------------
|
|
4
|
-
*/
|
|
5
|
-
export declare abstract class GraphingControlModel {
|
|
6
|
-
controlType: string;
|
|
7
|
-
dataKey: string;
|
|
8
|
-
constructor(json: any);
|
|
9
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { GraphingControlModel } from "../graphing-control.model";
|
|
2
|
-
/** ---------------------------------------------------------------------------
|
|
3
|
-
* Model
|
|
4
|
-
* ----------------------------------------------------------------------------
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class FormInputModel extends GraphingControlModel {
|
|
7
|
-
inputLabel: string;
|
|
8
|
-
readOnly: boolean;
|
|
9
|
-
readOnlyBorderless: boolean;
|
|
10
|
-
hasAsAtDate: boolean;
|
|
11
|
-
staticAsAtDate: boolean;
|
|
12
|
-
validationSchemaPath: string[];
|
|
13
|
-
validationErrorMessages: {
|
|
14
|
-
[key: string]: string;
|
|
15
|
-
};
|
|
16
|
-
constructor(json: any);
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./form-input.model";
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { GraphingControlModel } from "./controls";
|
|
2
|
-
import { GraphingTileSettingsModel } from "./graphing-tile-settings.model";
|
|
3
|
-
/** ---------------------------------------------------------------------------
|
|
4
|
-
* Model
|
|
5
|
-
* ----------------------------------------------------------------------------
|
|
6
|
-
*/
|
|
7
|
-
export declare class GraphingControlSettingsModel {
|
|
8
|
-
border: boolean;
|
|
9
|
-
background: string;
|
|
10
|
-
control: GraphingControlModel | null;
|
|
11
|
-
constructor(json: any);
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
getBackground(parent?: GraphingTileSettingsModel): string;
|
|
16
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { GraphingTileSettingsModel } from "./graphing-tile-settings.model";
|
|
2
|
-
/** ---------------------------------------------------------------------------
|
|
3
|
-
* Model
|
|
4
|
-
* ----------------------------------------------------------------------------
|
|
5
|
-
*/
|
|
6
|
-
export declare class GraphingSettingsModel {
|
|
7
|
-
title: string;
|
|
8
|
-
infoIconUrl: string;
|
|
9
|
-
infoIconHref: string;
|
|
10
|
-
responsive: boolean;
|
|
11
|
-
columns: {
|
|
12
|
-
[P: string]: number;
|
|
13
|
-
};
|
|
14
|
-
containerPadding: number;
|
|
15
|
-
referenceMargin?: number;
|
|
16
|
-
referenceWidth?: number;
|
|
17
|
-
tiles: GraphingTileSettingsModel[];
|
|
18
|
-
constructor(json: any);
|
|
19
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { GraphingTileModel } from "./tiles/graphing-tile.model";
|
|
2
|
-
/** ---------------------------------------------------------------------------
|
|
3
|
-
* Model
|
|
4
|
-
* ----------------------------------------------------------------------------
|
|
5
|
-
*/
|
|
6
|
-
export declare class GraphingTileSettingsModel {
|
|
7
|
-
title?: string;
|
|
8
|
-
x: number;
|
|
9
|
-
y: number;
|
|
10
|
-
w: number;
|
|
11
|
-
h: number;
|
|
12
|
-
border: boolean;
|
|
13
|
-
background: string;
|
|
14
|
-
autoHeight: boolean;
|
|
15
|
-
tile: GraphingTileModel | null;
|
|
16
|
-
visible: boolean;
|
|
17
|
-
constructor(json: any);
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
getBackground(): string;
|
|
22
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** ---------------------------------------------------------------------------
|
|
2
|
-
* Model
|
|
3
|
-
* ----------------------------------------------------------------------------
|
|
4
|
-
*/
|
|
5
|
-
import { GraphingControlSettingsModel } from "../graphing-control-settings.model";
|
|
6
|
-
export declare class FormGroupModel {
|
|
7
|
-
id: string;
|
|
8
|
-
title: string;
|
|
9
|
-
controls: GraphingControlSettingsModel[];
|
|
10
|
-
add: boolean;
|
|
11
|
-
constructor(json: any);
|
|
12
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { GraphingTileModel } from "./graphing-tile.model";
|
|
2
|
-
import { FormGroupModel } from "./form-group.model";
|
|
3
|
-
/** ---------------------------------------------------------------------------
|
|
4
|
-
* Model
|
|
5
|
-
* ----------------------------------------------------------------------------
|
|
6
|
-
*/
|
|
7
|
-
export declare class FormGroupsTileModel extends GraphingTileModel {
|
|
8
|
-
formGroups: FormGroupModel[];
|
|
9
|
-
constructor(json: any);
|
|
10
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { GraphingTileModel } from "./graphing-tile.model";
|
|
2
|
-
interface TileConstructor {
|
|
3
|
-
new (json: any): GraphingTileModel;
|
|
4
|
-
}
|
|
5
|
-
export declare function registerGraphingTile(key: string, constructor: TileConstructor): void;
|
|
6
|
-
export declare function createGraphingTile(json: any): GraphingTileModel | null;
|
|
7
|
-
export declare function createGraphingTiles(jsons: any[]): GraphingTileModel[];
|
|
8
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { GraphingControlSettingsModel } from "../graphing-control-settings.model";
|
|
2
|
-
/** ---------------------------------------------------------------------------
|
|
3
|
-
* Model
|
|
4
|
-
* ----------------------------------------------------------------------------
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class GraphingTileModel {
|
|
7
|
-
tileType: string;
|
|
8
|
-
constructor(json: any);
|
|
9
|
-
}
|
|
10
|
-
export declare abstract class SingleControlTileModel extends GraphingTileModel {
|
|
11
|
-
control: GraphingControlSettingsModel;
|
|
12
|
-
constructor(json: any);
|
|
13
|
-
}
|
|
14
|
-
export declare abstract class MultipleControlsTileModel extends GraphingTileModel {
|
|
15
|
-
controls: GraphingControlSettingsModel[];
|
|
16
|
-
constructor(json: any);
|
|
17
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MultipleControlsTileModel } from "./graphing-tile.model";
|
|
2
|
-
/** ---------------------------------------------------------------------------
|
|
3
|
-
* Model
|
|
4
|
-
* ----------------------------------------------------------------------------
|
|
5
|
-
*/
|
|
6
|
-
export declare class HorizontalTileModel extends MultipleControlsTileModel {
|
|
7
|
-
controlsPerPage: number;
|
|
8
|
-
constructor(json: any);
|
|
9
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from "./form-group.model";
|
|
2
|
-
export * from "./form-groups-tile.model";
|
|
3
|
-
export * from "./graphing-tile.factory";
|
|
4
|
-
export * from "./graphing-tile.model";
|
|
5
|
-
export * from "./horizontal-tile.model";
|
|
6
|
-
export * from "./selectable-states-tile.model";
|
|
7
|
-
export * from "./simple-form-tile.model";
|
|
8
|
-
export * from "./single-tile.model";
|
|
9
|
-
export * from "./vertical-tile.model";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { GraphingSettingsModel } from "../graphing-settings.model";
|
|
2
|
-
import { MultipleControlsTileModel } from "./graphing-tile.model";
|
|
3
|
-
/** ---------------------------------------------------------------------------
|
|
4
|
-
* Model
|
|
5
|
-
* ----------------------------------------------------------------------------
|
|
6
|
-
*/
|
|
7
|
-
export declare class SelectableStatesTileModel extends MultipleControlsTileModel {
|
|
8
|
-
states: {
|
|
9
|
-
[key: string]: GraphingSettingsModel;
|
|
10
|
-
};
|
|
11
|
-
constructor(json: any);
|
|
12
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { GraphingTileModel } from "./graphing-tile.model";
|
|
2
|
-
import { GraphingControlSettingsModel } from "../graphing-control-settings.model";
|
|
3
|
-
/** ---------------------------------------------------------------------------
|
|
4
|
-
* Model
|
|
5
|
-
* ----------------------------------------------------------------------------
|
|
6
|
-
*/
|
|
7
|
-
export declare class SimpleFormTileModel extends GraphingTileModel {
|
|
8
|
-
controls: GraphingControlSettingsModel[];
|
|
9
|
-
constructor(json: any);
|
|
10
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SingleControlTileModel } from "./graphing-tile.model";
|
|
2
|
-
/** ---------------------------------------------------------------------------
|
|
3
|
-
* Model
|
|
4
|
-
* ----------------------------------------------------------------------------
|
|
5
|
-
*/
|
|
6
|
-
export declare class SingleTileModel extends SingleControlTileModel {
|
|
7
|
-
constructor(json: any);
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { MultipleControlsTileModel } from "./graphing-tile.model";
|
|
2
|
-
/** ---------------------------------------------------------------------------
|
|
3
|
-
* Model
|
|
4
|
-
* ----------------------------------------------------------------------------
|
|
5
|
-
*/
|
|
6
|
-
export declare class VerticalTileModel extends MultipleControlsTileModel {
|
|
7
|
-
constructor(json: any);
|
|
8
|
-
}
|
package/cjs/typings/index.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./fade-modal.styles.css";
|
|
3
|
-
export interface FadeModalProps {
|
|
4
|
-
onClose?: (modalResult?: any) => void | undefined;
|
|
5
|
-
onDismiss?: (modalResult?: any) => void | undefined;
|
|
6
|
-
onBackdropClick?: (event: any) => void;
|
|
7
|
-
className?: string;
|
|
8
|
-
widthValue?: string;
|
|
9
|
-
heightValue?: string;
|
|
10
|
-
paddingValue?: string;
|
|
11
|
-
showModal: boolean;
|
|
12
|
-
innerModal?: boolean;
|
|
13
|
-
renderHeader?: React.ReactNode;
|
|
14
|
-
renderBody?: React.ReactNode;
|
|
15
|
-
hasFooter?: boolean;
|
|
16
|
-
renderLeftButtons?: React.ReactNode;
|
|
17
|
-
renderStatusMessage?: React.ReactNode;
|
|
18
|
-
renderRightButtons?: React.ReactNode;
|
|
19
|
-
}
|
|
20
|
-
declare const FadeModal: React.FC<FadeModalProps>;
|
|
21
|
-
export default FadeModal;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./modal.styles.css";
|
|
3
|
-
interface ModalProps {
|
|
4
|
-
onClose?: (modalResult?: any) => void | undefined;
|
|
5
|
-
onDismiss?: (modalResult?: any) => void | undefined;
|
|
6
|
-
onBackdropClick?: (event: any) => void;
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
showModal?: boolean;
|
|
9
|
-
fixedHeight?: string;
|
|
10
|
-
fixedWidth?: string;
|
|
11
|
-
contentClassName?: string;
|
|
12
|
-
effect?: string;
|
|
13
|
-
}
|
|
14
|
-
declare const Modal: (props: ModalProps) => JSX.Element;
|
|
15
|
-
export default Modal;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export interface ModalProps {
|
|
2
|
-
showModal?: boolean;
|
|
3
|
-
onClose: (modalResult?: any) => void | undefined;
|
|
4
|
-
onDismiss: (modalResult?: any) => void | undefined;
|
|
5
|
-
}
|
|
6
|
-
export interface ModalContructor {
|
|
7
|
-
new (props: ModalProps): Modal;
|
|
8
|
-
}
|
|
9
|
-
export declare abstract class Modal {
|
|
10
|
-
_props: ModalProps;
|
|
11
|
-
_container?: HTMLDivElement;
|
|
12
|
-
constructor(props?: any);
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
abstract getComponent(): any;
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @returns
|
|
20
|
-
*/
|
|
21
|
-
open(): Promise<any>;
|
|
22
|
-
}
|
|
23
|
-
export declare const modalsStack: HTMLDivElement[];
|
|
24
|
-
export declare const modals: {
|
|
25
|
-
[key: string]: ModalContructor;
|
|
26
|
-
};
|