@zealicsolutions/web-ui 1.0.140-beta.12 → 1.0.140-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/containers/types/moleculeTypes.d.ts +36 -15
- package/dist/cjs/contexts/OrganismContext/OrganismContext.d.ts +1 -1
- package/dist/cjs/contexts/OrganismContext/OrganismContextProvider.d.ts +3 -0
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/molecules/Button/Button.d.ts +3 -1
- package/dist/cjs/molecules/Button/hooks/useButtonAction.d.ts +2 -3
- package/dist/cjs/molecules/Button/index.d.ts +1 -0
- package/dist/cjs/molecules/Button/types.d.ts +77 -0
- package/dist/esm/_virtual/index3.js +1 -1
- package/dist/esm/_virtual/index4.js +1 -1
- package/dist/esm/containers/types/moleculeTypes.d.ts +36 -15
- package/dist/esm/contexts/OrganismContext/OrganismContext.d.ts +1 -1
- package/dist/esm/contexts/OrganismContext/OrganismContextProvider.d.ts +3 -0
- package/dist/esm/contexts/OrganismContext/OrganismContextProvider.js +1 -1
- package/dist/esm/contexts/OrganismContext/OrganismContextProvider.js.map +1 -1
- package/dist/esm/helpers/utils.js +1 -1
- package/dist/esm/molecules/Accordion/Accordion.js +1 -1
- package/dist/esm/molecules/Avatar/Avatar.js +1 -1
- package/dist/esm/molecules/BaseMolecule.js.map +1 -1
- package/dist/esm/molecules/BinaryRadioButtons/BinaryRadioButtons.js +1 -1
- package/dist/esm/molecules/Button/Button.d.ts +3 -1
- package/dist/esm/molecules/Button/Button.js +1 -1
- package/dist/esm/molecules/Button/Button.js.map +1 -1
- package/dist/esm/molecules/Button/hooks/useButtonAction.d.ts +2 -3
- package/dist/esm/molecules/Button/hooks/useButtonAction.js +1 -1
- package/dist/esm/molecules/Button/hooks/useButtonAction.js.map +1 -1
- package/dist/esm/molecules/Button/index.d.ts +1 -0
- package/dist/esm/molecules/Button/types.d.ts +77 -0
- package/dist/esm/molecules/Checkbox/Checkbox.js +1 -1
- package/dist/esm/molecules/Checklist/Checklist.js +1 -1
- package/dist/esm/molecules/Drawer/Drawer.js +1 -1
- package/dist/esm/molecules/Menu/Menu.js +1 -1
- package/dist/esm/molecules/Stepper/Stepper.js +1 -1
- package/dist/esm/molecules/Tabs/Tabs.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/Accordion/Accordion.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/Menu/Menu.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/MenuList/MenuList.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/Select/SelectInput.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/SpeedDial/SpeedDial.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/Tabs/Tabs.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/ToggleButtonGroup/ToggleButtonGroup.js +1 -1
- package/dist/esm/node_modules/@mui/material/node_modules/react-is/index.js +1 -1
- package/dist/esm/node_modules/classnames/index.js +1 -1
- package/dist/esm/node_modules/react-slick/lib/arrows.js +1 -1
- package/dist/esm/node_modules/react-slick/lib/dots.js +1 -1
- package/dist/esm/node_modules/react-slick/lib/inner-slider.js +1 -1
- package/dist/esm/node_modules/react-slick/lib/track.js +1 -1
- package/package.json +2 -2
- package/dist/index.d.ts +0 -4984
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ButtonProps as MuiButtonProps, TypographyProps } from '@mui/material';
|
|
2
2
|
import { ConfigurationItemInfo } from 'containers';
|
|
3
|
+
import type { ActionObject } from 'containers/types/moleculeTypes';
|
|
3
4
|
import { IconRendererProps } from 'molecules/Icon';
|
|
4
5
|
import { MouseEvent } from 'react';
|
|
5
6
|
export interface ButtonProps extends MuiButtonProps {
|
|
@@ -92,10 +93,11 @@ export interface ButtonProps extends MuiButtonProps {
|
|
|
92
93
|
maxWidth?: string;
|
|
93
94
|
minHeight?: string;
|
|
94
95
|
maxHeight?: string;
|
|
96
|
+
action?: ActionObject[];
|
|
95
97
|
}
|
|
96
98
|
export declare const Button: React.ForwardRefExoticComponent<Pick<ButtonProps & {
|
|
97
99
|
properties?: {
|
|
98
100
|
text?: any;
|
|
99
|
-
action?:
|
|
101
|
+
action?: ActionObject[] | undefined;
|
|
100
102
|
} | undefined;
|
|
101
103
|
}, "maxWidth" | "maxHeight" | "minWidth" | "minHeight" | "color" | "fontFamily" | "fontSize" | "fontWeight" | "height" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "textAlign" | "translate" | "width" | "borderColor" | "borderRadius" | "gap" | "action" | "className" | "style" | "classes" | "children" | "elevation" | "sx" | "variant" | "form" | "link" | "slot" | "title" | "text" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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" | "component" | "value" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "href" | "loading" | "loadingIndicator" | "loadingPosition" | "size" | "startIcon" | "textColor" | "iconOnly" | "properties" | "configurationItemInfo" | "moleculeId" | "wrapText" | "fillColor" | "fillColorDisabled" | "fillColorHover" | "fillColorPressed" | "borderColorDisabled" | "borderColorHover" | "borderColorPressed" | "textColorDisabled" | "textColorHover" | "textColorPressed" | "externalOnClick"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { UseButtonActionOptions, UseButtonActionReturn } from '../types';
|
|
1
2
|
export interface UseButtonActionProps {
|
|
2
3
|
properties?: {
|
|
3
4
|
text?: any;
|
|
@@ -7,6 +8,4 @@ export interface UseButtonActionProps {
|
|
|
7
8
|
onClick?: (event: any) => void;
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
}
|
|
10
|
-
export declare const useButtonAction: (
|
|
11
|
-
handleAction: (event: any) => void;
|
|
12
|
-
};
|
|
11
|
+
export declare const useButtonAction: (props: UseButtonActionProps, options?: UseButtonActionOptions) => UseButtonActionReturn;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export type ActionTypes = 'link' | 'open_popup' | 'drawer' | 'download' | 'submit' | 'reset' | 'destroy' | 'navigate_to_create_form' | 'navigate_to_edit_form' | 'navigate_to_prepopulate_form' | 'navigate_to_organism_with_rwo_context' | 'navigate_to_page_with_rwo_context';
|
|
2
|
+
export interface ActionObject {
|
|
3
|
+
type: ActionTypes;
|
|
4
|
+
link?: LinkProperties;
|
|
5
|
+
popup?: PopupDrawerAction;
|
|
6
|
+
drawer?: Identifier;
|
|
7
|
+
download?: DownloadAction;
|
|
8
|
+
submit?: SubmitAction;
|
|
9
|
+
reset?: ResetAction;
|
|
10
|
+
destroy?: DestroyAction;
|
|
11
|
+
navigateToCreateForm?: NavigationConfig;
|
|
12
|
+
navigateToEditForm?: NavigationConfig;
|
|
13
|
+
navigateToPrepopulateForm?: NavigationConfig;
|
|
14
|
+
navigateToOrganismWithRwoContext?: NavigationConfig;
|
|
15
|
+
navigateToPageWithRwoContext?: NavigationConfig;
|
|
16
|
+
}
|
|
17
|
+
export interface NavigationConfig {
|
|
18
|
+
link?: LinkProperties;
|
|
19
|
+
targetFormId?: string;
|
|
20
|
+
fieldMap?: Array<{
|
|
21
|
+
source: string;
|
|
22
|
+
destination: string;
|
|
23
|
+
}>;
|
|
24
|
+
sourceDataModelFieldId?: string;
|
|
25
|
+
targetOrganismIds?: string[];
|
|
26
|
+
includeRwoRecordId?: boolean;
|
|
27
|
+
rwoContextMapping?: Array<{
|
|
28
|
+
source: string;
|
|
29
|
+
destination: string;
|
|
30
|
+
transformation?: string;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
33
|
+
export interface ButtonActionProps {
|
|
34
|
+
propertyType: 'action';
|
|
35
|
+
required: boolean;
|
|
36
|
+
action: ActionObject[];
|
|
37
|
+
}
|
|
38
|
+
export interface UseButtonActionOptions {
|
|
39
|
+
onActionStart?: (action: ActionObject, index: number) => void;
|
|
40
|
+
onActionComplete?: (action: ActionObject, index: number, result: unknown) => void;
|
|
41
|
+
onActionError?: (action: ActionObject, index: number, error: Error) => void;
|
|
42
|
+
onAllActionsComplete?: (results: unknown[]) => void;
|
|
43
|
+
stopOnError?: boolean;
|
|
44
|
+
executeAsync?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface UseButtonActionReturn {
|
|
47
|
+
executeActions: () => Promise<unknown[]>;
|
|
48
|
+
handleAction: (event: any) => void;
|
|
49
|
+
isExecuting: boolean;
|
|
50
|
+
currentActionIndex: number;
|
|
51
|
+
results: unknown[];
|
|
52
|
+
error: Error | null;
|
|
53
|
+
}
|
|
54
|
+
export type DownloadFile = {
|
|
55
|
+
url: string;
|
|
56
|
+
name: string;
|
|
57
|
+
};
|
|
58
|
+
export type LinkProperties = {
|
|
59
|
+
id?: string;
|
|
60
|
+
attributeType?: 'link';
|
|
61
|
+
propertyType?: 'link';
|
|
62
|
+
type: 'internalLink' | 'externalLink' | 'external_link' | 'internal_link';
|
|
63
|
+
internalLink?: string | null;
|
|
64
|
+
externalLink?: string | null;
|
|
65
|
+
name?: string;
|
|
66
|
+
required?: boolean;
|
|
67
|
+
};
|
|
68
|
+
export type PopupDrawerAction = {
|
|
69
|
+
type: 'open' | 'close';
|
|
70
|
+
id: string;
|
|
71
|
+
payload?: Record<string, unknown>;
|
|
72
|
+
};
|
|
73
|
+
export type Identifier = string;
|
|
74
|
+
export type DownloadAction = DownloadFile;
|
|
75
|
+
export type SubmitAction = Record<string, unknown>;
|
|
76
|
+
export type ResetAction = Record<string, unknown>;
|
|
77
|
+
export type DestroyAction = Record<string, unknown>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var r={exports:{}};export{r};
|
|
1
|
+
var r={exports:{}};export{r as c};
|
|
2
2
|
//# sourceMappingURL=index3.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var r={exports:{}};export{r
|
|
1
|
+
var r={exports:{}};export{r};
|
|
2
2
|
//# sourceMappingURL=index4.js.map
|
|
@@ -18,7 +18,7 @@ import { SpeedDialItem, SpeedDialProps } from '../../molecules/SpeedDial/types';
|
|
|
18
18
|
import { TabsProps } from '../../molecules/Tabs/Tabs';
|
|
19
19
|
import { AccordionItemDTO, ChecklistItemDTO, DividerItemDTO, ImageItemDTO, MenuItemDTO, RichTextItemDTO, StepperItemDTO, TabsItemDTO, TextItemDTO } from './moleculeItemTypes';
|
|
20
20
|
import { ConditionConfig, MetadataType } from './types';
|
|
21
|
-
export type ActionTypes = 'link' | '
|
|
21
|
+
export type ActionTypes = 'link' | 'open_popup' | 'drawer' | 'download' | 'submit' | 'reset' | 'destroy' | 'navigate_to_create_form' | 'navigate_to_edit_form' | 'navigate_to_prepopulate_form' | 'navigate_to_organism_with_rwo_context' | 'navigate_to_page_with_rwo_context';
|
|
22
22
|
export type DataModelFieldFormatCodeTypes = 'date' | 'email' | 'string' | 'integer' | 'boolean' | 'numeric' | 'zip_code' | 'phone_number';
|
|
23
23
|
export type DataModelFieldFormatValueTypes = 'any' | 'text' | 'email' | 'integer' | 'numerical' | 'us_zip_code' | 'phone_number' | 'month_year_date' | 'day_month_year_date' | 'month_day_year_date' | 'year_month_day_date';
|
|
24
24
|
export type DownloadFile = {
|
|
@@ -26,27 +26,48 @@ export type DownloadFile = {
|
|
|
26
26
|
name: string;
|
|
27
27
|
};
|
|
28
28
|
type LinkAction = LinkProperties;
|
|
29
|
+
type PopupDrawerAction = {
|
|
30
|
+
type: 'open' | 'close';
|
|
31
|
+
id: string;
|
|
32
|
+
payload?: Record<string, unknown>;
|
|
33
|
+
};
|
|
34
|
+
type Identifier = string;
|
|
29
35
|
type DownloadAction = DownloadFile;
|
|
30
36
|
type SubmitAction = AnyObject;
|
|
31
|
-
type CancelAction = AnyObject;
|
|
32
37
|
type ResetAction = AnyObject;
|
|
33
38
|
type DestroyAction = AnyObject;
|
|
34
|
-
|
|
39
|
+
export interface ActionObject {
|
|
35
40
|
type: ActionTypes;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
reset
|
|
42
|
-
destroy
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
link?: LinkAction;
|
|
42
|
+
popup?: PopupDrawerAction;
|
|
43
|
+
drawer?: Identifier;
|
|
44
|
+
download?: DownloadAction;
|
|
45
|
+
submit?: SubmitAction;
|
|
46
|
+
reset?: ResetAction;
|
|
47
|
+
destroy?: DestroyAction;
|
|
48
|
+
navigateToCreateForm?: NavigationConfig;
|
|
49
|
+
navigateToEditForm?: NavigationConfig;
|
|
50
|
+
navigateToPrepopulateForm?: NavigationConfig;
|
|
51
|
+
navigateToOrganismWithRwoContext?: NavigationConfig;
|
|
52
|
+
navigateToPageWithRwoContext?: NavigationConfig;
|
|
53
|
+
}
|
|
54
|
+
export interface NavigationConfig {
|
|
55
|
+
link?: LinkAction;
|
|
56
|
+
targetFormId?: string;
|
|
57
|
+
fieldMap?: Array<{
|
|
46
58
|
source: string;
|
|
47
59
|
destination: string;
|
|
48
60
|
}>;
|
|
49
|
-
|
|
61
|
+
sourceDataModelFieldId?: string;
|
|
62
|
+
targetOrganismIds?: string[];
|
|
63
|
+
includeRwoRecordId?: boolean;
|
|
64
|
+
rwoContextMapping?: Array<{
|
|
65
|
+
source: string;
|
|
66
|
+
destination: string;
|
|
67
|
+
transformation?: string;
|
|
68
|
+
}>;
|
|
69
|
+
}
|
|
70
|
+
type Action = ActionObject;
|
|
50
71
|
export type FormStateType = 'default' | 'success' | 'error' | 'format_error' | 'field_error' | 'open_dropdown' | 'match_error';
|
|
51
72
|
export type ImageProperties = {
|
|
52
73
|
attributeType?: 'image';
|
|
@@ -81,7 +102,7 @@ export interface VideoProperties {
|
|
|
81
102
|
export interface ActionProperties {
|
|
82
103
|
attributeType?: 'action';
|
|
83
104
|
propertyType?: 'action';
|
|
84
|
-
action: Action;
|
|
105
|
+
action: Action[];
|
|
85
106
|
required?: boolean;
|
|
86
107
|
}
|
|
87
108
|
export interface LinkProperties {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
1
2
|
import { ContainerComponentProps, MetadataType, Molecule, StateConfigType } from '../../containers';
|
|
2
3
|
import { PasswordRuleValidation } from '../../molecules/PasswordSetup/PasswordSetup';
|
|
3
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
4
4
|
import type { AnyObject } from '../../typescript';
|
|
5
5
|
import { ConfigurationItem } from './OrganismContextProvider';
|
|
6
6
|
import { GroupedStepItemsByStepContainer } from './utils';
|
|
@@ -15,6 +15,9 @@ export type ConfigurationItem = {
|
|
|
15
15
|
* For molecules, this mirrors organismLibraryMoleculeId.
|
|
16
16
|
*/
|
|
17
17
|
libraryEntityId?: string;
|
|
18
|
+
/** Parent organism identifier and subtype (optional, used by host apps for breadcrumbs) */
|
|
19
|
+
organismId?: string;
|
|
20
|
+
organismSubtype?: string;
|
|
18
21
|
};
|
|
19
22
|
export type OrganismContextProviderProps = React.PropsWithChildren<{} & Partial<{
|
|
20
23
|
formId: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as i}from"../../node_modules/tslib/tslib.es6.js";import{jsx as t}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import e,{useState as o,useCallback as r}from"react";import{OrganismContext as n}from"./OrganismContext.js";import{groupStepItemsByStepContainer as a}from"./utils.js";var d=function(d){var l=d.initItems,u=void 0===l?[]:l,s=d.children,m=d.submitHandler,c=d.formId,f=d.validations,v=d.editable,I=void 0===v||v,p=d.isPreview,g=void 0!==p&&p,b=d.organismBodyId,y=d.isFormInEditMode,j=void 0===y||y,C=d.organismMetadata,S=d.organismInfo,M=d.localStateObject,O=void 0===M?null:M,P=d.isConfigurationMode,h=void 0!==P&&P,D=d.onConfigurationItemHandler,x=d.selectedConfigurationItemId,A=d.currentStyleProperties,E=void 0===A?{}:A,F=d.currentContentProperties,B=void 0===F?{}:F,H=d.onInternalNavigation,L=void 0===H?function(){return null}:H,w=d.routing,N=d.prefillData,R=void 0===N?null:N,_=d.loadRecordData,k=e.useState([]),V=k[0],q=k[1],z=o(O||{}),G=z[0],J=z[1],K=r(function(t,e){J(function(o){var r;return i(i({},o),((r={})[t]=e,r))})},[]),Q=e.useMemo(function(){return function(t,e){if(t){var o=i(i({},t),{organismInfo:S,organismId:null==S?void 0:S.id,organismSubtype:null==S?void 0:S.subtype,libraryEntityId:(null==t?void 0:t.libraryEntityId)||(null==S?void 0:S.moleculeLibraryId)||(null==t?void 0:t.moleculeLibraryId)||void 0});!o.pmiObjectId&&(null==S?void 0:S.pmiObjectId)&&(o.pmiObjectId=S.pmiObjectId),null==D||D(o,e,S)}}},[D,S]),T=e.useMemo(function(){return(Array.isArray(u)?u:[u]).map(function(t){return"children"in t&&!("items"in t)&&Array.isArray(t.children)?i(i({},t),{items:t.children}):t})},[u]),U=e.useMemo(function(){return{dateFields:V,setDateFields:q,items:T,groupStepItemsByStepContainer:function(){return a(T)},submitHandler:m,formId:c,validations:f,editable:I,isPreview:g,organismBodyId:b,isFormInEditMode:j,organismMetadata:C,organismInfo:S,localStateObject:O,localState:G,setLocalStateValue:K,isConfigurationMode:h,onConfigurationItemClicked:Q,selectedConfigurationItemId:x,currentStyleProperties:E,currentContentProperties:B,onInternalNavigation:L,routing:w,prefillData:R,loadRecordData:_}},[T,c,f,I,g,V,q,m,b,j,C,S,O,G,K,h,Q,x,E,B,L,w,R,_]);return t(n.Provider,i({value:U},{children:s}))};export{d as OrganismContextProvider};
|
|
2
2
|
//# sourceMappingURL=OrganismContextProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrganismContextProvider.js","sources":["../../../../../src/contexts/OrganismContext/OrganismContextProvider.tsx"],"sourcesContent":[null],"names":["OrganismContextProvider","_a","_b","initItems","children","submitHandler","formId","validations","_c","editable","_d","isPreview","organismBodyId","_e","isFormInEditMode","organismMetadata","organismInfo","_f","localStateObject","_g","isConfigurationMode","onConfigurationItemHandler","selectedConfigurationItemId","_h","currentStyleProperties","_j","currentContentProperties","_k","onInternalNavigation","routing","_l","prefillData","loadRecordData","_m","React","useState","dateFields","setDateFields","_o","localState","setLocalState","setLocalStateValue","useCallback","key","value","prev","onConfigurationItemClicked","useMemo","itemInfo","doubleClick","mergedItem","__assign","libraryEntityId","moleculeLibraryId","undefined","pmiObjectId","processedItems","Array","isArray","map","item","items","contextValues","groupStepItemsByStepContainer","_jsx","OrganismContext","Provider"],"mappings":"
|
|
1
|
+
{"version":3,"file":"OrganismContextProvider.js","sources":["../../../../../src/contexts/OrganismContext/OrganismContextProvider.tsx"],"sourcesContent":[null],"names":["OrganismContextProvider","_a","_b","initItems","children","submitHandler","formId","validations","_c","editable","_d","isPreview","organismBodyId","_e","isFormInEditMode","organismMetadata","organismInfo","_f","localStateObject","_g","isConfigurationMode","onConfigurationItemHandler","selectedConfigurationItemId","_h","currentStyleProperties","_j","currentContentProperties","_k","onInternalNavigation","routing","_l","prefillData","loadRecordData","_m","React","useState","dateFields","setDateFields","_o","localState","setLocalState","setLocalStateValue","useCallback","key","value","prev","onConfigurationItemClicked","useMemo","itemInfo","doubleClick","mergedItem","__assign","organismId","id","organismSubtype","subtype","libraryEntityId","moleculeLibraryId","undefined","pmiObjectId","processedItems","Array","isArray","map","item","items","contextValues","groupStepItemsByStepContainer","_jsx","OrganismContext","Provider"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e}from"../node_modules/tslib/tslib.es6.js";import"../contexts/AccountButtonContext/AccountButtonContext.js";import"react/jsx-runtime";import"../node_modules/@emotion/react/dist/emotion-element-d59e098f.esm.js";import"react";import"../node_modules/stylis/dist/umd/stylis.js";import"../node_modules/@babel/runtime/helpers/extends.js";import"../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js";import"../contexts/ApiContext/ApiContext.js";import"../contexts/ContainerRuntimeContext/ContainerRuntimeContext.js";import"../contexts/FormStepContext/FormStepContext.js";import"../contexts/LayoutContext/LayoutContext.js";import"../theme/theme.js";import"../theme/provider.js";import"../theme/toastStyles.js";import"../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import"../contexts/OrganismContext/OrganismContext.js";import"../contexts/PopupContext/PopupContext.js";import"../contexts/StateContext/StateContext.js";import"../molecules/Button/Button.js";import"@tanstack/react-query";import{
|
|
1
|
+
import{__awaiter as t,__generator as e}from"../node_modules/tslib/tslib.es6.js";import"../contexts/AccountButtonContext/AccountButtonContext.js";import"react/jsx-runtime";import"../node_modules/@emotion/react/dist/emotion-element-d59e098f.esm.js";import"react";import"../node_modules/stylis/dist/umd/stylis.js";import"../node_modules/@babel/runtime/helpers/extends.js";import"../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js";import"../contexts/ApiContext/ApiContext.js";import"../contexts/ContainerRuntimeContext/ContainerRuntimeContext.js";import"../contexts/FormStepContext/FormStepContext.js";import"../contexts/LayoutContext/LayoutContext.js";import"../theme/theme.js";import"../theme/provider.js";import"../theme/toastStyles.js";import"../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import"../contexts/OrganismContext/OrganismContext.js";import"../contexts/PopupContext/PopupContext.js";import"../contexts/StateContext/StateContext.js";import"../molecules/Button/Button.js";import"@tanstack/react-query";import{paramKeys as o}from"../constants/params.js";import{decodeBase64UrlToObject as n}from"./rwoContext.js";export{encodeObjectToBase64Url,getByPath}from"./rwoContext.js";import{urlPattern as r}from"./validations.js";import"../node_modules/@emotion/react/dist/emotion-react.esm.js";import"../components/Buttons/TextButton.js";import"../components/Buttons/TouchableOpacity.js";import"../components/Circle/Circle.js";import"../components/CircularIndicator/CircularIndicator.js";import"../components/ContentWrapper/ContentWrapper.js";import"../components/CustomValidation/CustomValidation.js";import"../components/HorizontalButtons/HorizontalButtons.js";import"../components/Input/Input.js";import"../components/Paddings/Paddings.js";import"../components/PdfDocument/PdfDocument.js";import"../components/RadioButtons/RadioButtons.js";import"../components/RegularImage/RegularImage.js";import{richTextDefaultValue as i}from"../components/RichTextViewer/RichTextViewer.js";import"../node_modules/slate/dist/index.es.js";import"../components/TextWrapper/TextWrapper.js";import"../components/Select/styles.js";import"../components/Spacer/Spacer.js";import"../components/Spinner/Spinner.js";import{toast as s}from"../components/Toast/toast.js";import"../components/Tooltip/Tooltip.js";import"../components/ValidationTag/ValidationTag.js";import"../components/ZealUIModal/ZealUIModal.js";var a=function(t){r.test(t)?window.open(t,"_blank","noopener,noreferrer")&&setTimeout(function(){window.blur()},100):console.error("invalid url:",t)},c=function(t,e){if(!e||"string"!=typeof e)return"";var o=e.match(new RegExp("[?&]".concat(t,"=([^&]*)")));return o?decodeURIComponent(o[1]):""},p=function(t){var e=t||window.location.href,o=c("rwoContext",e);if(o)try{var r=n(o);if(r){var i=[];return Object.entries(r).forEach(function(t){var e=t[0],o=t[1];o&&"object"==typeof o&&"rwoRecordId"in o&&o.rwoRecordId&&i.push({organismId:e,recordId:o.rwoRecordId})}),i}}catch(a){}var s=c("rwoTargets",e);if(!s)return[];try{return s.split(",").map(function(t){var e=t.split(":");return{organismId:e[0],recordId:e[1]}}).filter(function(t){return t.organismId&&t.recordId})}catch(a){return[]}},m=function(t,e){var o=e||window.location.href,r=c("rwoContext",o);if(r)try{var i=n(r),s=null==i?void 0:i[t];if(s&&"object"==typeof s&&"rwoRecordId"in s)return s.rwoRecordId}catch(a){}return c("rwoRecordId",o)||void 0},d=function(t,e,n){if(void 0===n&&(n=!1),!e)return t;var r=c(o.internalLinkWebpageId,e),i=c(o.internalLinkApplicationId,e);if(!r||!i)return t;var s=new URLSearchParams(t.toString());return n?(t.has(o.previewApplicationId)&&s.set(o.previewApplicationId,i),t.has(o.previewSelectedWebpageId)&&s.set(o.previewSelectedWebpageId,r)):(t.has(o.runtimeSelectedWebpageId)&&s.set(o.runtimeSelectedWebpageId,r),s.set(o.runtimeSelectedWebpageId,r)),s},u=function(o,n){return void 0===o&&(o=""),void 0===n&&(n="Downloaded file"),t(void 0,void 0,void 0,function(){var t,r,i,a;return e(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,fetch(o)];case 1:return[4,e.sent().blob()];case 2:return t=e.sent(),r=URL.createObjectURL(t),(i=document.createElement("a")).href=r,i.download=n,i.click(),URL.revokeObjectURL(r),[3,4];case 3:return a=e.sent(),s({message:"Failed to download the file: ".concat(a),type:"error"}),[3,4];case 4:return[2]}})})},l=function(t){if(t){if("object"==typeof t&&"type"in t){var e=t;if(x(e))return;return j(e.externalLink)}return j(t)}},f=function(t,e){if(t){if("object"==typeof t&&"type"in t){var o=t;return x(o)?void(e&&o.internalLink?e({link:o.internalLink}):o.internalLink&&(window.location.href=o.internalLink)):l(o.externalLink)}return l(t)}},j=function(t){if(t&&"string"==typeof t)if(r.test(t))try{var e=window.open(t,"_blank","noopener,noreferrer");e&&setTimeout(function(){window.blur();try{e.blur()}catch(t){}},100)}catch(o){console.error("Failed to open URL:",o)}else console.error("Invalid URL format:",t)},x=function(t){return!!t&&("internal_link"===(null==t?void 0:t.type)||"internalLink"===(null==t?void 0:t.type))},w=function(t,e){if(t){var o=new URL(window.location.href),n=d(o.searchParams,t,e);return o.search=n.toString(),o.toString()}},v=function(t,e){if(t)return x(t)?w(null==t?void 0:t.internalLink,e):null==t?void 0:t.externalLink},h=function(t){var e=null==t?void 0:t.replace(/\\/g,"");try{return JSON.parse(t)}catch(o){try{return JSON.parse(e)}catch(n){return i}}};export{w as addInternalParamsToCurrentLink,x as checkIsInternalLink,u as downloadFile,v as getHref,c as getParameterByName,m as getRwoRecordIdForOrganism,p as getRwoTargets,l as navigateToExternalLink,f as navigateToLink,h as parseDescendantContent,d as updateSearchParams,a as validateAndOpenUrl};
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|