moorr-react-mui 0.2.119 → 0.2.121
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.css +2 -1
- package/index.d.ts +101 -21
- package/index.js +1 -1
- package/package.json +1 -1
package/index.css
CHANGED
|
@@ -9,4 +9,5 @@
|
|
|
9
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
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
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-container-closing + .moorr-modal-container.moorr-slide-modal > div:first-child{opacity:0!important;}.moorr-modal-container.moorr-modal-container-closing + .moorr-modal-container.moorr-slide-modal > .moorr-modal-content-container{transform:translate(100%,0px)!important;}.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;}
|
|
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-container-closing + .moorr-modal-container.moorr-slide-modal > div:first-child{opacity:0!important;}.moorr-modal-container.moorr-modal-container-closing + .moorr-modal-container.moorr-slide-modal > .moorr-modal-content-container{transform:translate(100%,0px)!important;}.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;}
|
|
13
|
+
.moorr-modal-container.confirm-modal{padding:18px;}.moorr-modal-container.confirm-modal > .moorr-modal-header{padding:0;}.moorr-modal-container.confirm-modal > .moorr-modal-body{padding:0;}.moorr-modal-container.confirm-modal > .moorr-modal-footer{padding:0;}
|
package/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ButtonProps } from '@mui/material/Button';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import React__default, { ReactNode } from 'react';
|
|
2
5
|
import * as _material_ui_core_styles from '@material-ui/core/styles';
|
|
3
|
-
import React, { ReactNode } from 'react';
|
|
4
6
|
|
|
5
7
|
/** ---------------------------------------------------------------------------
|
|
6
8
|
* Private
|
|
7
9
|
* ----------------------------------------------------------------------------
|
|
8
10
|
*/
|
|
9
|
-
interface Props$
|
|
11
|
+
interface Props$e {
|
|
10
12
|
type?: "button" | "submit" | "reset" | undefined;
|
|
11
13
|
label: string;
|
|
12
14
|
}
|
|
@@ -14,7 +16,68 @@ interface Props$a {
|
|
|
14
16
|
* Component
|
|
15
17
|
* ----------------------------------------------------------------------------
|
|
16
18
|
*/
|
|
17
|
-
declare const Button: ({ type, label }: Props$
|
|
19
|
+
declare const Button: ({ type, label }: Props$e) => JSX.Element;
|
|
20
|
+
|
|
21
|
+
/** ---------------------------------------------------------------------------
|
|
22
|
+
* Private
|
|
23
|
+
* ----------------------------------------------------------------------------
|
|
24
|
+
*/
|
|
25
|
+
interface Props$d extends ButtonProps {
|
|
26
|
+
handleClick: any;
|
|
27
|
+
label: string;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** ---------------------------------------------------------------------------
|
|
31
|
+
* Component
|
|
32
|
+
* ----------------------------------------------------------------------------
|
|
33
|
+
*/
|
|
34
|
+
declare const PrimaryButton: ({ style, handleClick, label, disabled, ...buttonProps }: Props$d) => JSX.Element;
|
|
35
|
+
|
|
36
|
+
/** ---------------------------------------------------------------------------
|
|
37
|
+
* Private
|
|
38
|
+
* ----------------------------------------------------------------------------
|
|
39
|
+
*/
|
|
40
|
+
interface Props$c extends ButtonProps {
|
|
41
|
+
item: string;
|
|
42
|
+
qty: number;
|
|
43
|
+
highlight?: boolean;
|
|
44
|
+
onSelectItem: (item: string, qty: number) => void | Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
/** ---------------------------------------------------------------------------
|
|
47
|
+
* Component
|
|
48
|
+
* ----------------------------------------------------------------------------
|
|
49
|
+
*/
|
|
50
|
+
declare const QtyButton: React__default.ForwardRefExoticComponent<Pick<Props$c, "type" | "form" | "slot" | "style" | "title" | "children" | "className" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "href" | "size" | "startIcon" | "variant" | "key" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "item" | "qty" | "highlight" | "onSelectItem"> & React__default.RefAttributes<HTMLButtonElement>>;
|
|
51
|
+
|
|
52
|
+
/** ---------------------------------------------------------------------------
|
|
53
|
+
* Private
|
|
54
|
+
* ----------------------------------------------------------------------------
|
|
55
|
+
*/
|
|
56
|
+
interface Props$b extends ButtonProps {
|
|
57
|
+
handleClick: any;
|
|
58
|
+
label: string;
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
}
|
|
61
|
+
/** ---------------------------------------------------------------------------
|
|
62
|
+
* Component
|
|
63
|
+
* ----------------------------------------------------------------------------
|
|
64
|
+
*/
|
|
65
|
+
declare const SecondaryButton: ({ style, handleClick, label, disabled, ...buttonProps }: Props$b) => JSX.Element;
|
|
66
|
+
|
|
67
|
+
/** ---------------------------------------------------------------------------
|
|
68
|
+
* Private
|
|
69
|
+
* ----------------------------------------------------------------------------
|
|
70
|
+
*/
|
|
71
|
+
interface Props$a extends ButtonProps {
|
|
72
|
+
item: string;
|
|
73
|
+
itemSelected?: boolean;
|
|
74
|
+
onSelectItem: (item: string) => void | Promise<void>;
|
|
75
|
+
}
|
|
76
|
+
/** ---------------------------------------------------------------------------
|
|
77
|
+
* Component
|
|
78
|
+
* ----------------------------------------------------------------------------
|
|
79
|
+
*/
|
|
80
|
+
declare const SelectButton: React__default.ForwardRefExoticComponent<Pick<Props$a, "type" | "form" | "slot" | "style" | "title" | "children" | "className" | "classes" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "href" | "size" | "startIcon" | "variant" | "key" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "value" | "item" | "onSelectItem" | "itemSelected"> & React__default.RefAttributes<HTMLButtonElement>>;
|
|
18
81
|
|
|
19
82
|
/**
|
|
20
83
|
* * Interface for Reusable Components
|
|
@@ -42,9 +105,9 @@ interface DropdownProps {
|
|
|
42
105
|
required?: boolean;
|
|
43
106
|
isMBRequiredField?: boolean;
|
|
44
107
|
fullWidth?: boolean;
|
|
45
|
-
selectIconComponent?:
|
|
108
|
+
selectIconComponent?: React__default.ElementType<any> | undefined;
|
|
46
109
|
}
|
|
47
|
-
declare const _default$1:
|
|
110
|
+
declare const _default$1: React__default.ComponentType<Pick<DropdownProps, "label" | "className" | "disabled" | "fullWidth" | "size" | "name" | "value" | "required" | "handleChange" | "menuItemLabel" | "options" | "labelPlacement" | "isMBRequiredField" | "selectIconComponent"> & _material_ui_core_styles.StyledComponentProps<"disabled" | "root" | "blue" | "checked" | "error" | "focused" | "notchedOutline" | "notchedOutlineMBRequired" | "fieldSetMBRequired" | "fieldSetErrorField">>;
|
|
48
111
|
|
|
49
112
|
/** ---------------------------------------------------------------------------
|
|
50
113
|
* Private
|
|
@@ -303,7 +366,7 @@ type GraphingContextResult = {
|
|
|
303
366
|
handleRangeSelectChange?: (e: any) => void;
|
|
304
367
|
isFormGroupVisible?: (id: string) => boolean;
|
|
305
368
|
formGroupHasAddMode?: (id: string) => boolean;
|
|
306
|
-
renderFormGroup?: (formGroup: FormGroupModel, mode: "normal" | "add") =>
|
|
369
|
+
renderFormGroup?: (formGroup: FormGroupModel, mode: "normal" | "add") => React__default.ReactNode;
|
|
307
370
|
handleFormGroupCancel?: (e: any) => void | Promise<void>;
|
|
308
371
|
handleFormGroupSave?: (e: any) => boolean | Promise<boolean>;
|
|
309
372
|
handleInputEvent?: (e: InputEventArgs) => Promise<void>;
|
|
@@ -317,7 +380,7 @@ type GraphingContextResult = {
|
|
|
317
380
|
* Context
|
|
318
381
|
* ----------------------------------------------------------------------------
|
|
319
382
|
*/
|
|
320
|
-
declare const GraphingContext:
|
|
383
|
+
declare const GraphingContext: React__default.Context<GraphingContextResult>;
|
|
321
384
|
|
|
322
385
|
declare function useGraphingContext(): GraphingContextResult;
|
|
323
386
|
|
|
@@ -479,10 +542,10 @@ interface Props extends GraphingTileProps {
|
|
|
479
542
|
declare const VerticalTile: ({ graphingTile, graphingTileIndex }: Props) => JSX.Element | null;
|
|
480
543
|
|
|
481
544
|
interface ModalProps$1 {
|
|
482
|
-
onClose?: (modalResult?: any) => void |
|
|
483
|
-
onDismiss?: (modalResult?: any) => void |
|
|
484
|
-
onBackdropClick?: (event: any) => void;
|
|
485
|
-
children:
|
|
545
|
+
onClose?: (modalResult?: any) => Promise<void> | void;
|
|
546
|
+
onDismiss?: (modalResult?: any) => Promise<void> | void;
|
|
547
|
+
onBackdropClick?: (event: any) => Promise<void> | void;
|
|
548
|
+
children: React__default.ReactNode;
|
|
486
549
|
showModal?: boolean;
|
|
487
550
|
fixedHeight?: string;
|
|
488
551
|
fixedWidth?: string;
|
|
@@ -526,22 +589,39 @@ declare const modals: {
|
|
|
526
589
|
declare const toastMessage: (color: "info" | "success" | "warning" | "error", message: string) => void;
|
|
527
590
|
|
|
528
591
|
interface FadeModalProps {
|
|
529
|
-
onClose?: (modalResult?: any) => void |
|
|
530
|
-
onDismiss?: (modalResult?: any) => void |
|
|
531
|
-
onBackdropClick?: (event: any) => void;
|
|
592
|
+
onClose?: (modalResult?: any) => Promise<void> | void;
|
|
593
|
+
onDismiss?: (modalResult?: any) => Promise<void> | void;
|
|
594
|
+
onBackdropClick?: (event: any) => Promise<void> | void;
|
|
532
595
|
className?: string;
|
|
533
596
|
widthValue?: string;
|
|
534
597
|
heightValue?: string;
|
|
535
598
|
paddingValue?: string;
|
|
536
599
|
showModal: boolean;
|
|
537
600
|
innerModal?: boolean;
|
|
538
|
-
renderHeader?:
|
|
539
|
-
renderBody?:
|
|
601
|
+
renderHeader?: React__default.ReactNode;
|
|
602
|
+
renderBody?: React__default.ReactNode;
|
|
540
603
|
hasFooter?: boolean;
|
|
541
|
-
renderLeftButtons?:
|
|
542
|
-
renderStatusMessage?:
|
|
543
|
-
renderRightButtons?:
|
|
604
|
+
renderLeftButtons?: React__default.ReactNode;
|
|
605
|
+
renderStatusMessage?: React__default.ReactNode;
|
|
606
|
+
renderRightButtons?: React__default.ReactNode;
|
|
607
|
+
}
|
|
608
|
+
declare const FadeModal: React__default.FC<FadeModalProps>;
|
|
609
|
+
|
|
610
|
+
interface ConfirmModalProps extends ModalProps {
|
|
611
|
+
icon?: React__default.ReactNode;
|
|
612
|
+
title?: string | React__default.ReactNode;
|
|
613
|
+
body?: string | React__default.ReactNode | (string | React__default.ReactNode)[];
|
|
614
|
+
cancelLabel?: string;
|
|
615
|
+
confirmLabel?: string;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
declare class ConfirmModal extends Modal {
|
|
619
|
+
constructor(props: any);
|
|
620
|
+
/**
|
|
621
|
+
*
|
|
622
|
+
* @returns
|
|
623
|
+
*/
|
|
624
|
+
getComponent(): React.FC<ConfirmModalProps>;
|
|
544
625
|
}
|
|
545
|
-
declare const FadeModal: React.FC<FadeModalProps>;
|
|
546
626
|
|
|
547
|
-
export { Button, _default$1 as Dropdown, FadeModal, FormGroupModel, FormGroupsTile, FormGroupsTileModel, FormInputModel, GraphingContext, GraphingContextResult, GraphingControl, GraphingControlModel, GraphingControlProps, GraphingControlSettingsModel, GraphingGrid, GraphingSettingsModel, GraphingTile, GraphingTileControls, GraphingTileModel, GraphingTileProps, GraphingTileSettingsModel, GraphingTiles, HorizontalTile, HorizontalTileModel, InputChangeEventArgs, InputDataRequiredEventArgs, InputEventArgs, LinkClickEventArgs, Modal, ModalContructor, ModalProps, Modal$1 as MoorrModal, MultipleControlsTileModel, SelectableStatesTile, SelectableStatesTileModel, SimpleFormTile, SimpleFormTileModel, SingleControlTileModel, SingleTile, SingleTileModel, _default as StylesProvider, SvgIcon, SvgIconProps, VerticalTile, VerticalTileModel, createGraphingControl, createGraphingControls, createGraphingTile, createGraphingTiles, modals, modalsStack, registerGraphingControl, registerGraphingControlComponent, registerGraphingTile, registerGraphingTileComponent, registerSvgIconComponent, toastMessage, useGraphingContext };
|
|
627
|
+
export { Button, ConfirmModal, _default$1 as Dropdown, FadeModal, FormGroupModel, FormGroupsTile, FormGroupsTileModel, FormInputModel, GraphingContext, GraphingContextResult, GraphingControl, GraphingControlModel, GraphingControlProps, GraphingControlSettingsModel, GraphingGrid, GraphingSettingsModel, GraphingTile, GraphingTileControls, GraphingTileModel, GraphingTileProps, GraphingTileSettingsModel, GraphingTiles, HorizontalTile, HorizontalTileModel, InputChangeEventArgs, InputDataRequiredEventArgs, InputEventArgs, LinkClickEventArgs, Modal, ModalContructor, ModalProps, Modal$1 as MoorrModal, MultipleControlsTileModel, PrimaryButton, Props$e as Props, QtyButton, SecondaryButton, SelectButton, SelectableStatesTile, SelectableStatesTileModel, SimpleFormTile, SimpleFormTileModel, SingleControlTileModel, SingleTile, SingleTileModel, _default as StylesProvider, SvgIcon, SvgIconProps, VerticalTile, VerticalTileModel, createGraphingControl, createGraphingControls, createGraphingTile, createGraphingTiles, modals, modalsStack, registerGraphingControl, registerGraphingControlComponent, registerGraphingTile, registerGraphingTileComponent, registerSvgIconComponent, toastMessage, useGraphingContext };
|
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 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 $={};function D(e,t){e&&t&&($[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=$[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,{key:`${s.id}-{${d}}`,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)}}))),$e=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))}})())},De=(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($e,{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;try{null===(n=null==e?void 0:e.detail)||void 0===n||n.then(t)}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,$e 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,D as registerSvgIconComponent,De as toastMessage,U as useGraphingContext};
|
|
1
|
+
import e,{useMemo as t,forwardRef as o,useCallback as n,createContext as r,useContext as l,useState as i,useRef as a,useEffect as s}from"react";import c from"@mui/material/Button";import{useMediaQuery as d,Typography as u,Slide as m,Box as p,IconButton as g}from"@mui/material";import{integers as h,utils as f}from"moorr-common";import v from"@mui/material/IconButton";import b from"@material-ui/core/MenuItem";import{makeStyles as E,createStyles as y,withStyles as x,StylesProvider as C}from"@material-ui/core/styles";import T from"@material-ui/core/TextField";import{StylesProvider as w,Modal as k,Backdrop as N,Fade as P}from"@material-ui/core";import{createGenerateClassName as F,StylesProvider as M}from"@material-ui/styles";import{v4 as O}from"uuid";import S,{Responsive as I}from"react-grid-layout";import D from"@mui/material/Accordion";import A from"@mui/material/AccordionSummary";import B from"@mui/material/AccordionDetails";import j from"@mui/icons-material/ExpandMore";import L from"react-dom";import{toast as H}from"react-toastify";import R from"@mui/icons-material/Cancel";import G from"@mui/icons-material/Close";import z from"@mui/icons-material/Help";const W=({type:t,label:o})=>(t||(t="button"),e.createElement("button",{type:t,className:"moorr-button"},e.createElement("span",null,o)));function $(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o}function U(e,t,o,n){return new(o||(o=Promise))((function(r,l){function i(e){try{s(n.next(e))}catch(e){l(e)}}function a(e){try{s(n.throw(e))}catch(e){l(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}s((n=n.apply(e,t||[])).next())}))}const _=o=>{var{style:n={},handleClick:r,label:l,disabled:i}=o,a=$(o,["style","handleClick","label","disabled"]);const s=d("(max-width: 600px)"),u=t((()=>s?"8rem":"172px"),[s]);return e.createElement(c,Object.assign({},a,{disabled:i,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,style:Object.assign(Object.assign(Object.assign({},!i&&{backgroundColor:"#541868"}),{color:"#FFFFFF",fontWeight:400,fontSize:"14px",width:u,height:"39px",borderRadius:"48px",textTransform:"capitalize"}),n),onClick:r,variant:"contained"}),l)},V=o(((o,r)=>{var{sx:l,item:i,qty:a,disabled:s,highlight:d,onSelectItem:m}=o,p=$(o,["sx","item","qty","disabled","highlight","onSelectItem"]);const g=t((()=>({width:"27px",height:"27px",color:"#FFFFFF",flexShrink:0})),[]),b=t((()=>{const e=Object.assign(Object.assign({},l),{flexGrow:1,fontFamily:"Poppins",fontSize:"14px",fontWeight:400,lineHeight:"9px",minHeight:"42px",border:"1px solid #EDEDEE",borderRadius:"10rem",textTransform:"none",gap:"0.5rem","&:hover > button":{opacity:1}});return a>0?Object.assign(Object.assign({},e),{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868","&:hover":{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868"}}):Object.assign(Object.assign({},e),{backgroundColor:"#FBFBFD",borderColor:!0===d?"#541868":"#EDEDEE",color:"#000000","&:hover":{backgroundColor:"#66e84b",borderColor:"#66e84b",color:"#ffffff"}})}),[a,l]),E=n((e=>U(void 0,void 0,void 0,(function*(){e.stopPropagation(),e.preventDefault(),f.isFunction(m)&&a<=0&&(yield Promise.all([m(i,1)]))}))),[a,m]),y=n((()=>!h.isValid(a)||a<=0?null:e.createElement(v,{disabled:s,sx:Object.assign(Object.assign({},g),{backgroundColor:"#E37D7D",opacity:0,"&:hover":{backgroundColor:"#E37D7D"},"&:active":{backgroundColor:"#E37D7D"}}),onClick:()=>m&&m(i,Math.max(0,a-1))},"-")),[s,g,a,m]),x=n((()=>!h.isValid(a)||a<=0?null:e.createElement(v,{disabled:s,sx:Object.assign(Object.assign({},g),{backgroundColor:"#541868",opacity:0,"&:hover":{backgroundColor:"#541868"},"&:active":{backgroundColor:"#541868"}}),onClick:()=>m&&m(i,a+1)},"+")),[s,g,a,m]),C=n((()=>{let t,o;return!h.isValid(a)||a<=0?(t=1,o=0):(t=`${a}`,o=1),e.createElement(u,{variant:"body1",component:"span",sx:{color:"#541868",fontWeight:700,fontSize:"14px",lineHeight:"20px",flexShrink:0,opacity:o}},t)}),[a]);return e.createElement(c,Object.assign({},p,{ref:r,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,disabled:s,sx:b,onClick:E}),y(),e.createElement(u,{variant:"body1",component:"span",sx:{flexGrow:1}},i),x(),C())})),q=o=>{var{style:n={},handleClick:r,label:l,disabled:i}=o,a=$(o,["style","handleClick","label","disabled"]);const s=d("(max-width: 600px)"),u=t((()=>s?"8rem":"172px"),[s]);return e.createElement(c,Object.assign({},a,{disabled:i,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,style:Object.assign(Object.assign(Object.assign({},!i&&{backgroundColor:"#D4C5D9"}),{color:"#541868",fontWeight:400,fontSize:"14px",width:u,height:"39px",borderRadius:"48px"}),n),onClick:r,variant:"contained"}),l)},Z=o(((o,r)=>{var{sx:l,item:i,itemSelected:a,onSelectItem:s}=o,d=$(o,["sx","item","itemSelected","onSelectItem"]);const m=t((()=>{const e=Object.assign(Object.assign({},l),{flexGrow:1,fontFamily:"Poppins",fontSize:"13px",fontWeight:400,lineHeight:"18px",border:"1px solid #EDEDEE",borderRadius:"10rem",textTransform:"none"});return a?Object.assign(Object.assign({},e),{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868","&:hover":{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868"}}):Object.assign(Object.assign({},e),{backgroundColor:"#fbfbfd",borderColor:"#EDEDEE",color:"#000000","&:hover":{backgroundColor:"#66e84b",borderColor:"#66e84b",color:"#ffffff"}})}),[a,l]),p=n((e=>U(void 0,void 0,void 0,(function*(){e.stopPropagation(),e.preventDefault(),f.isFunction(s)&&(yield Promise.all([s(i)]))}))),[s]);return e.createElement(c,Object.assign({},d,{ref:r,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,sx:m,onClick:p}),e.createElement(u,{variant:"body1",component:"span",sx:{flexGrow:1}},i))})),K=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"}});E(K);const J=E((()=>y({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 Q=x(K)((({handleChange:t,value:o,disabled:n=!1,name:r,className:l,classes:i,size:a,menuItemLabel:s,options:c,labelPlacement:d="start",label:u,required:m=!1,isMBRequiredField:p,fullWidth:g,selectIconComponent:h})=>{const{root:f,focused:v,error:E,notchedOutline:y,notchedOutlineMBRequired:x}=i,C=J();let w;return h&&(w={IconComponent:h}),e.createElement(T,{fullWidth:!1!==g,id:"outlined-basic",variant:"outlined",value:o,onChange:t,disabled:n,name:r,className:[l].join(" "),InputProps:{classes:{root:f,focused:v,error:E,notchedOutline:!p||o&&0!==(null==o?void 0:o.length)?!m||o&&0!==(null==o?void 0:o.length)?y:C.mandatory:x}},color:"primary",size:a||"small",select:!0,SelectProps:w,defaultValue:""},e.createElement(b,{value:"",disabled:!0},e.createElement("em",null,s)),c&&c.map(((t,o)=>"-separator-"===t?e.createElement(b,{key:`separator-${o}`,value:"",disabled:!0},e.createElement("em",null,"-----------")):e.createElement(b,{key:`menu-item-${o}-${t.value||t}`,value:t.value||t},t.label||t))))}));const X={};function Y(e,t){e&&t&&(X[e]=t)}const ee=({className:t,icon:o,width:n,height:r,fill:l,stroke:i,accent:a,dropShadow:s})=>{if(f.isNullOrUndefined(o))return null;const c=X[o]||null;return c?e.createElement(c,{className:t,fill:l,width:n,height:r,stroke:i,accent:a,dropShadow:s}):null},te={};var oe=({stylePrefix:t,children:o})=>{let n;if(t)n=te[t]?te[t]:te[t]=F({seed:t});else{const e=`MoorrStylesProvider-${O()}-`;n=F({seed:e})}return e.createElement(M,{generateClassName:n,injectFirst:!0},e.createElement(w,{generateClassName:n,injectFirst:!0},e.createElement(C,{generateClassName:n},o)))};const ne=r({});function re(){return l(ne)}const le={};function ie(e,t){e&&t&&(le[e]=t)}const ae=({graphingTile:t,graphingTileIndex:o})=>{var n;if(!(null===(n=null==t?void 0:t.tile)||void 0===n?void 0:n.tileType))return null;const r=le[t.tile.tileType]||null;return r?e.createElement(r,{graphingTile:t,graphingTileIndex:o}):null},se=[20,20],ce={lg:600,sm:0},de={lg:8,sm:2},ue=({tilePrefix:t,responsive:o,columns:n,containerPadding:r,referenceMargin:l,referenceWidth:c,graphingTiles:d})=>{const[u,m]=i(null),[p,g]=i(null),[h,f]=i(null),[v,b]=i(null),E=a(null),y=()=>{const e=(null==E?void 0:E.current)?(null==E?void 0:E.current).getBoundingClientRect().width:null;b(e);const t=w(e);m(t)};let x;const C=e=>{y(),clearTimeout(x),x=setTimeout((()=>{y()}),300)};s((()=>{y()}),[E]),s((()=>(window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)})),[]),s((()=>{if(o){if(!Array.isArray(d)||0===d.length)return void f({lg:[]});f({lg:d.map(((e,o)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${t?t+"_":""}tile_${o}`})))})}else{if(!Array.isArray(d)||0===d.length)return void g([]);g(d.map(((e,o)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${t?t+"_":""}tile_${o}`,static:!0}))))}}),[d]);const T=()=>null==d?void 0:d.map(((o,n)=>{if(!o.tile||!o.visible)return null;let r="graphing-tile-container";!1!==o.border&&(r+=" bordered"),o.autoHeight&&(r+=" auto-height");const l=`${t?t+"_":""}tile_${n}`;return e.createElement("div",{className:r,key:l},e.createElement(ae,{graphingTile:o,graphingTileIndex:n}))})),w=e=>{if(!l||isNaN(l)||l<=0||!c||isNaN(c)||c<=0||null==e)return se;const t=e/c*l;return[t,t]};return e.createElement("div",{ref:E,className:"graphing-tiles-container"},(()=>{if(!v||!u)return null;if(!1!==o){if(!h)return null;const t=[r||0,0];return e.createElement(I,{width:v,breakpoints:ce,cols:n||de,rowHeight:1,layouts:h,containerPadding:t,margin:u,isDraggable:!1},T())}return p?e.createElement(S,{width:v,cols:9,rowHeight:50,margin:u,isDraggable:!1,layout:p},T()):null})())},me={};function pe(e,t){me[e]=t}function ge(e){const t=me[null==e?void 0:e.tileType];return t?new t(e):null}function he(e){const t=[];return e.forEach((e=>{const o=ge(e);o&&t.push(o)})),t}class fe{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=ge(e.tile),this.visible=!1!==e.visible}getBackground(){return this.background||"#FFFFFF"}}class ve{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 fe(e))}))}}const be={};function Ee(e,t){be[e]=t}function ye(e){const t=be[null==e?void 0:e.controlType];return t?new t(e):null}function xe(e){const t=[];return e.forEach((e=>{const o=ye(e);o&&t.push(o)})),t}class Ce{constructor(e){this.controlType=e.controlType,this.dataKey=e.dataKey}}class Te extends Ce{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=(f.isArray(e.validationSchemaPath)?e.validationSchemaPath:[]).filter((e=>f.isString(e))),this.validationErrorMessages=e.validationErrorMessages||{}}}class we{constructor(e){this.border=e.border,this.background=e.background||null,this.control=ye(e.control)}getBackground(e){return this.background||(null==e?void 0:e.background)||"#FFFFFF"}}class ke{constructor(e){this.id=e.id||"",this.title=e.title||"",this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new we(e))})),this.add=!0===e.add}}class Ne{constructor(e){this.tileType=e.tileType}}class Pe extends Ne{constructor(e){super(e),this.control=new we(e.control)}}class Fe extends Ne{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new we(e))}))}}class Me extends Ne{constructor(e){super(e),f.isArray(e.formGroups)&&e.formGroups.length>0?this.formGroups=e.formGroups.map((e=>new ke(e))):this.formGroups=[]}}pe("form-groups-tile",Me);class Oe extends Fe{constructor(e){super(e),this.controlsPerPage=e.controlsPerPage,(isNaN(this.controlsPerPage)||this.controlsPerPage<=1)&&(this.controlsPerPage=1)}}pe("horizontal-tile",Oe);class Se extends Fe{constructor(e){super(e),this.states={};for(const t in e.states){const o=e.states[t];o&&(this.states[t]=new ve(o))}}}pe("selectable-states-tile",Se);class Ie extends Ne{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new we(e))}))}}pe("simple-form-tile",Ie);class De extends Pe{constructor(e){super(e)}}pe("single-tile",De);class Ae extends Fe{constructor(e){super(e)}}pe("vertical-tile",Ae);const Be=({})=>{const{settings:t}=re(),[o,n]=i(null),[r,l]=i(!1);s((()=>{setTimeout((()=>{window.dispatchEvent(new Event("resize")),setTimeout((()=>{l(!0)}),300)}),300)}),[]),s((()=>{n(t?new ve(t):null)}),[t]);const a=()=>(null==t?void 0:t.infoIconUrl)&&t.infoIconHref?e.createElement("a",{className:"information-anchor",href:t.infoIconHref,target:"_blank"},e.createElement("img",{alt:null==t?void 0:t.title,src:null==t?void 0:t.infoIconUrl})):null;if(!o)return null;let c="graphing-grid-container";return r&&(c+=" in"),e.createElement(e.Fragment,null,e.createElement("div",{className:c},f.isNullOrUndefined(null==t?void 0:t.title)?null:e.createElement(e.Fragment,null,e.createElement("h2",{className:"graphing-grid-title"},null==t?void 0:t.title,a()),e.createElement("hr",{className:"graphing-grid-hr"})),e.createElement(ue,{graphingTiles:o.tiles,responsive:o.responsive,columns:o.columns,containerPadding:o.containerPadding,referenceMargin:o.referenceMargin,referenceWidth:o.referenceWidth})))},je={};function Le(e,t){e&&t&&(je[e]=t)}const He=({graphingTile:t,graphingTileIndex:o,graphingTileControl:n,ControlProps:r})=>{var l;if(!(null===(l=null==n?void 0:n.control)||void 0===l?void 0:l.controlType))return null;const i=je[n.control.controlType]||null;return i?e.createElement(i,Object.assign({graphingTile:t,graphingTileIndex:o,graphingTileControl:n},r)):null},Re=({graphingTile:t,graphingTileIndex:o,graphingTileControls:n,ControlProps:r})=>{var l,i;let a="graphing-tile-controls-container";return(null===(l=null==t?void 0:t.tile)||void 0===l?void 0:l.tileType)&&(a+=" "+(null===(i=null==t?void 0:t.tile)||void 0===i?void 0:i.tileType)),e.createElement("div",{className:a},null==n?void 0:n.map(((n,l)=>{var i,a;if(!n.control)return null;let s="graphing-tile-control-container";(null===(i=n.control)||void 0===i?void 0:i.controlType)&&(s+=" "+(null===(a=n.control)||void 0===a?void 0:a.controlType)),!1!==n.border&&(s+=" bordered");const c=`control_${o}_${l}`;return e.createElement("div",{className:s,key:c},e.createElement(He,{graphingTile:t,graphingTileIndex:o,graphingTileControl:n,ControlProps:r}))})))},Ge=({graphingTile:t,graphingTileIndex:o})=>{const r=null==t?void 0:t.tile;if(!r)return null;const l=re();return e.createElement("div",{className:"form-groups-tile-component"},!f.isArray(r.formGroups)||r.formGroups.length<0?null:r.formGroups.map(((r,c)=>{const d=a(null),[u,m]=i("normal"),[p,g]=i("form-group-container");s((()=>{y()}),[p,u]);const[h,v]=i(0),[b,E]=i(!0);s((()=>{if(b){const e=d.current;f.isNullOrUndefined(e)?v(0):setTimeout((()=>{v(e.scrollHeight)}),10)}else v(0)}),[b]);const y=e=>{if(b){const e=d.current;f.isNullOrUndefined(e)?v(0):setTimeout((()=>{v(Math.max(e.clientHeight,e.scrollHeight))}),10)}else v(0)},x=n((()=>!0!==r.add||f.isFunction(l.formGroupHasAddMode)&&!l.formGroupHasAddMode(r.id)?null:e.createElement("button",{type:"button",className:"form-group-tile-add-button",onClick:C,disabled:"add"==u},e.createElement(ee,{icon:"add-icon",stroke:"#ffffff"}))),[u,l.formGroupHasAddMode]);n((()=>"add"===u?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"}))),[u]);const C=e=>{e.stopPropagation(),m("add"),E(!0)},T=e=>U(void 0,void 0,void 0,(function*(){f.isFunction(null==l?void 0:l.handleFormGroupCancel)&&(yield Promise.all([null==l?void 0:l.handleFormGroupCancel({formGroup:r})])),m("normal")})),[w,k]=i(!1),N=e=>U(void 0,void 0,void 0,(function*(){if(f.isFunction(null==l?void 0:l.handleFormGroupSave))try{k(!0);const[e]=yield Promise.all([null==l?void 0:l.handleFormGroupSave({formGroup:r})]);if(!1===e)return}finally{k(!1)}m("normal")}));let P="form-group-container";return f.isFunction(l.isFormGroupVisible)&&(l.isFormGroupVisible(r.id)||(P+=" hidden")),P!==p&&g(P),e.createElement(D,{key:`${r.id}-{${c}}`,className:P,expanded:b,onChange:e=>{"add"!==u&&E((e=>!e))},TransitionProps:{unmountOnExit:!0}},e.createElement(A,{className:"form-group-title",expandIcon:"add"!==u?e.createElement(j,null):null},e.createElement("span",{className:"form-group-title-text"},r.title),x()),e.createElement("hr",null),e.createElement(B,{className:"form-group-components"},(()=>{if("add"===u){let t;return f.isFunction(l.renderFormGroup)&&(t=l.renderFormGroup(r,"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:w,onClick:T},"Cancel"),e.createElement("button",{className:"save-button",disabled:w,onClick:N},"Create")))}{const n=r.controls;let i;return f.isFunction(l.renderFormGroup)&&(i=l.renderFormGroup(r,"normal"),!f.isNullOrUndefined(i))?i:e.createElement(Re,{graphingTile:t,graphingTileIndex:o,graphingTileControls:n,ControlProps:{onUIChange:y}})}})()))})))};ie("form-groups-tile",Ge);const ze=({graphingTile:t,graphingTileIndex:o})=>{const n=null==t?void 0:t.tile;if(!n)return null;const[r,l]=i(null),[a,c]=i(0),[d,u]=i(0),[m,p]=i(null),[g,h]=i(null),[f,v]=i(null),[b,E]=i([]);s((()=>{let e=[];const t=Math.ceil(n.controls.length/n.controlsPerPage);if(t>0)for(let o=0;o<t;o++){const t={pageIndex:o,controls:[]};for(let e=0;e<n.controlsPerPage;e++){const r=o*n.controlsPerPage+e;if(r>=n.controls.length)break;t.controls.push(n.controls[r])}e.push(t)}c(t),u(0),p(null),h(null),v(null),E(e)}),n.controls);const y=e=>{let t=e-1;t<0&&(t=a-1),h(t)},x=e=>{e.stopPropagation(),y(d),v(null),p(null)},C=e=>{e.stopPropagation()},T=e=>{e.stopPropagation()},w=e=>{if(e.stopPropagation(),null!==r)return;const t=d;let o=d-1;o<0&&(o=a-1),p(t),u(o),h(null),v(t);const n=setTimeout((()=>{y(o),v(null),p(null),setTimeout((function(){l(null)}),300)}),300);l(n)},k=e=>{let t=e+1;t>=a&&(t=0),v(t)},N=e=>{e.stopPropagation(),h(null),k(d),p(null)},P=e=>{e.stopPropagation()},F=e=>{e.stopPropagation()},M=e=>{if(e.stopPropagation(),null!==r)return;const t=d;let o=d+1;o>=a&&(o=0),p(t),u(o),h(t),v(null);const n=setTimeout((()=>{h(null),k(o),p(null),setTimeout((function(){l(null)}),300)}),300);l(n)},O={background:t.getBackground()};return e.createElement("div",{className:"horizontal-tile-component",style:O},e.createElement("div",{className:"horizontal-tile-pages-container"},b.map(((n,r)=>{let l="horizontal-tile-page-container";return r===d?l+=" active":r===g?l+=" navigating-from-left":r===f&&(l+=" navigating-from-right"),r===m&&(l+=" previous"),e.createElement("div",{className:l},e.createElement(Re,{graphingTile:t,graphingTileIndex:o,graphingTileControls:n.controls}))})),e.createElement("div",{className:"horizontal-tile-page-container background",style:O}),a<=1?null:e.createElement(e.Fragment,null,e.createElement("button",{type:"button",className:"navigate-button navigate-left-button",onMouseEnter:x,onMouseLeave:C,onMouseDown:T,onClick:w},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:N,onMouseLeave:P,onMouseDown:F,onClick:M},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"}))))),a<=1?null:e.createElement("div",{className:"horizontal-tile-paginators-container"},Array.from(Array(a).keys()).map((t=>{let o="paginator-anchor";return t===d&&(o+=" active"),e.createElement("a",{className:o,onMouseEnter:e=>{e.stopPropagation(),t!==d&&(t<d?(h(t),v(null)):(h(null),v(t)),p(null))},onMouseLeave:e=>{e.stopPropagation()},onMouseDown:e=>{e.stopPropagation()},onClick:e=>{if(e.stopPropagation(),t===d)return;const o=d,n=t;p(o),u(n),o<n?h(o):v(o)}})}))))};ie("horizontal-tile",ze);const We=({graphingTile:t})=>{const o=null==t?void 0:t.tile;if(!o)return null;const[n,r]=i(""),[l,a]=i(null),[c,d]=i([]),u=re();s((()=>{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 r(""),a(null)}),[o.states]);const m=e=>{r(e),a(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==l?void 0:l.title)),e.createElement("div",{className:"selectable-states-dropdown-container"},e.createElement(Q,{options:c,label:"Select",value:n,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"},l?e.createElement(ue,{tilePrefix:n,graphingTiles:l.tiles,responsive:l.responsive,columns:l.columns,containerPadding:l.containerPadding,referenceMargin:l.referenceMargin,referenceWidth:l.referenceWidth}):null))};ie("selectable-states-tile",We);const $e=({graphingTile:t,graphingTileIndex:o})=>{const n=null==t?void 0:t.tile;if(!n)return null;const r=re(),l=e=>{f.isFunction(r.handleUIChange)&&r.handleUIChange(e)};return e.createElement("div",{className:"simple-form-tile-component"},(()=>{if(!f.isArray(n.controls)||n.controls.length<0)return null;const r=n.controls;return e.createElement(Re,{graphingTile:t,graphingTileIndex:o,graphingTileControls:r,ControlProps:{onUIChange:l}})})())};ie("simple-form-tile",$e);const Ue=({graphingTile:t,graphingTileIndex:o})=>{const n=null==t?void 0:t.tile;if(!n)return null;const r=[n.control],l={background:t.getBackground()};return e.createElement("div",{className:"single-tile-component",style:l},e.createElement(Re,{graphingTile:t,graphingTileIndex:o,graphingTileControls:r}))};ie("single-tile",Ue);const _e=({graphingTile:t,graphingTileIndex:o})=>{const n=null==t?void 0:t.tile;if(!n)return null;const r=n.controls;return e.createElement("div",{className:"vertical-tile-component"},e.createElement(Re,{graphingTile:t,graphingTileIndex:o,graphingTileControls:r}))};ie("vertical-tile",_e);const Ve=()=>{const e=Ze.pop();e&&(e.classList.add("moorr-modal-container-closing"),setTimeout((()=>{e&&(L.unmountComponentAtNode(e),e.remove())}),300))};let qe=class{constructor(e){this._props=e}open(){const t=this._props;return new Promise(((o,n)=>{let r,l;"function"==typeof t.onClose&&(r=t.onClose),t.onClose=e=>{r&&r(e),o({dismissed:!1,result:e}),t.showModal=!1,Ve()},"function"==typeof t.onDismiss&&(l=t.onClose),t.onDismiss=()=>{l&&l(),o({dismissed:!0}),t.showModal=!1,Ve()},t.showModal=!0;let i=e.createElement(oe,{stylePrefix:"MoorrReactMuiModal"},e.createElement(this.getComponent(),t));Ze.push(this._container=document.createElement("div")),this._container.className="moorr-modal-container",document.body.appendChild(this._container),L.render(i,this._container)}))}};const Ze=[],Ke={},Je=E((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)}}))),Qe=t=>{const o=Je(),n={};t.fixedWidth&&(n.width=t.fixedWidth),t.fixedHeight&&(n.height=t.fixedHeight);let r=o.paper+" moorr-modal-content-container";t.contentClassName&&(r+=" "+t.contentClassName);const[l,a]=i(!1),[c,d]=i(!1);s((()=>{d(!l&&!1!==t.showModal)}),[l,c,t.showModal]);const u=e=>{a(!0),(null==t?void 0:t.onDismiss)&&t.onDismiss(e)};let p=o.modal;switch(p+=" moorr-modal-container",t.effect){case"fade":p+=" moorr-fade-modal";break;case"slide":p+=" moorr-slide-modal"}return l&&(p+=" moorr-modal-closing"),e.createElement(k,{disableEnforceFocus:!0,className:p,open:c,onClose:u,closeAfterTransition:!0,BackdropComponent:N,BackdropProps:{timeout:300,onClick:e=>{e.preventDefault(),e.stopPropagation(),f.isFunction(t.onBackdropClick)?t.onBackdropClick(e):u("backdrop")}}},(()=>{switch(t.effect){case"fade":default:return e.createElement(P,{in:c},e.createElement("div",{className:r,style:n},t.children));case"slide":return e.createElement(m,{in:c,direction:"left",timeout:300},e.createElement("div",{className:r},t.children))}})())},Xe=(t,o)=>{(t=>{H(t,{icon:e.createElement(R,{sx:{color:"#EB5757"}}),style:{color:"#EB5757",backgroundColor:"#FCECEC",border:"2px solid #EB5757",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"},closeButton:()=>e.createElement(G,{sx:{color:"#EB5757"}})})})(o)},Ye=t=>e.createElement(Qe,{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)))),et=t=>{const{onDismiss:o,showModal:r,onClose:l,icon:i,title:a,body:s,cancelLabel:c,confirmLabel:d}=t,m=n((()=>{l(!1)}),[l]),h=n((()=>{l(!0)}),[l]),v=n((()=>f.isString(s)?e.createElement(u,{paragraph:!0},s):f.isArray(s)&&s.length>0?s.map(((t,o)=>{const n=`paragraph-${o}`;if(f.isString(t)||!f.isNullOrUndefined(t))return e.createElement(u,{paragraph:!0,key:n},t)})):f.isNullOrUndefined(s)?e.createElement(u,{paragraph:!0},"Please confirm to continue."):s),[s]),b=n((()=>e.createElement(p,{sx:{marginBottom:"0.5rem","& > .MuiTypography-root.MuiTypography-paragraph":{fontFamily:"Poppins,sans-serif",fontSize:"14px !important",fontWeight:400,lineHeight:"20px"},"& > .MuiTypography-root.MuiTypography-paragraph .MuiTypography-root.MuiTypography-body1":{fontFamily:"inherit !important",fontSize:"inherit !important",fontWeight:"inherit",lineHeight:"inherit"},"& > .MuiTypography-root.MuiTypography-paragraph strong.MuiTypography-root.MuiTypography-body1":{fontWeight:"600 !important"}}},v())),[v]),E=n((()=>f.isString(a)||!f.isNullOrUndefined(a)?a:"Confirm"),[a]),y=n((()=>e.createElement(p,{sx:{position:"relative",marginBottom:"0.5rem","& > .MuiSvgIcon-root":{color:"#541868",fontSize:"2rem"}}},null!=i?i:e.createElement(z,null),e.createElement(u,{variant:"h6",sx:{color:"#541868",fontFamily:"Poppins,sans-serif",fontSize:"16px !important",fontWeight:400,lineHeight:22}},E()),e.createElement(g,{onClick:m,sx:{position:"absolute",top:"-0.5rem",right:"-0.5rem"}},e.createElement(G,{sx:{fontSize:"1rem"}})))),[i,E,m]),x=n((()=>e.createElement(q,{handleClick:m,label:c||"Cancel"})),[c,m]),C=n((()=>e.createElement(_,{handleClick:h,label:d||"Confirm"})),[d,h]);return e.createElement(Ye,{className:"confirm-modal",widthValue:"400px",showModal:!0===r,onDismiss:o,onBackdropClick:m,renderHeader:y(),renderBody:b(),renderLeftButtons:x(),renderRightButtons:C()})};class tt extends qe{constructor(e){super(e)}getComponent(){return et}}Ke.confirm=tt;const ot=e=>{var t,o,n,r,l;const i=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.modal;if(!i||!Ke[i])return Promise.reject("invalid-modal");const a=new Ke[i]((null===(o=null==e?void 0:e.detail)||void 0===o?void 0:o.props)||{}).open();(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.then)&&a.then((t=>{var o;try{null===(o=null==e?void 0:e.detail)||void 0===o||o.then(t)}catch(e){console.error(e)}})),(null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.catch)&&a.catch(null===(l=null==e?void 0:e.detail)||void 0===l?void 0:l.catch),a.finally((()=>{var t,o;if(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.finally)try{null===(o=null==e?void 0:e.detail)||void 0===o||o.finally()}catch(e){console.error(e)}})),(null==e?void 0:e.detail)&&((null==e?void 0:e.detail).promise=a)};document&&(document.removeEventListener("openModal",ot),document.addEventListener("openModal",ot));export{W as Button,tt as ConfirmModal,Q as Dropdown,Ye as FadeModal,ke as FormGroupModel,Ge as FormGroupsTile,Me as FormGroupsTileModel,Te as FormInputModel,ne as GraphingContext,He as GraphingControl,Ce as GraphingControlModel,we as GraphingControlSettingsModel,Be as GraphingGrid,ve as GraphingSettingsModel,ae as GraphingTile,Re as GraphingTileControls,Ne as GraphingTileModel,fe as GraphingTileSettingsModel,ue as GraphingTiles,ze as HorizontalTile,Oe as HorizontalTileModel,qe as Modal,Qe as MoorrModal,Fe as MultipleControlsTileModel,_ as PrimaryButton,V as QtyButton,q as SecondaryButton,Z as SelectButton,We as SelectableStatesTile,Se as SelectableStatesTileModel,$e as SimpleFormTile,Ie as SimpleFormTileModel,Pe as SingleControlTileModel,Ue as SingleTile,De as SingleTileModel,oe as StylesProvider,ee as SvgIcon,_e as VerticalTile,Ae as VerticalTileModel,ye as createGraphingControl,xe as createGraphingControls,ge as createGraphingTile,he as createGraphingTiles,Ke as modals,Ze as modalsStack,Ee as registerGraphingControl,Le as registerGraphingControlComponent,pe as registerGraphingTile,ie as registerGraphingTileComponent,Y as registerSvgIconComponent,Xe as toastMessage,re as useGraphingContext};
|