@imtf/dms-core 1.1.0-beta.2 → 1.1.0-beta.3
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/core/components/ActionMenu/Menu.d.ts +19 -0
- package/core/components/ActionMenu/Trigger.d.ts +8 -0
- package/core/components/ActionMenu/index.d.ts +1 -0
- package/core/components/ActionMenu/styles.d.ts +4 -0
- package/core/constants/dragTypes.d.ts +2 -0
- package/core/containers/EntityDocuments/EntityDocumentsComponent.d.ts +30 -0
- package/core/containers/EntityDocuments/components/Accordion.d.ts +12 -0
- package/core/containers/EntityDocuments/components/Document.d.ts +11 -0
- package/core/containers/EntityDocuments/components/DocumentLabel.d.ts +7 -0
- package/core/containers/EntityDocuments/components/DocumentList.d.ts +18 -0
- package/core/containers/EntityDocuments/components/DocumentListTitle.d.ts +7 -0
- package/core/containers/EntityDocuments/constants.d.ts +1 -0
- package/core/containers/EntityDocuments/styles.d.ts +10 -0
- package/core/containers/EntityDocuments/types.d.ts +6 -0
- package/core/providers/Plugins/ComponentPluginContext.d.ts +14 -0
- package/core/providers/Plugins/types/componentPlugins.d.ts +3 -5
- package/core/providers/Plugins/withComponentPlugin.d.ts +27 -0
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode, SyntheticEvent } from "react";
|
|
2
|
+
import { SupportedItem } from "../../providers/App/types";
|
|
3
|
+
type ActionMenuProps = {
|
|
4
|
+
items: SupportedItem[];
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
showShortcuts?: boolean;
|
|
7
|
+
onClose?: (e: SyntheticEvent) => void;
|
|
8
|
+
actionProps?: Record<string, unknown>;
|
|
9
|
+
renderTrigger?: (props: Record<string, unknown> | undefined) => ReactNode;
|
|
10
|
+
allowedActionIds?: string[];
|
|
11
|
+
TriggerVariant?: "iconButton" | "textButton";
|
|
12
|
+
TriggerProps?: Record<string, unknown>;
|
|
13
|
+
anchorRef?: React.RefObject<HTMLElement>;
|
|
14
|
+
MenuComp?: React.ComponentType<any>;
|
|
15
|
+
open?: boolean;
|
|
16
|
+
};
|
|
17
|
+
declare function ActionMenu({ items, label, showShortcuts, onClose, actionProps, renderTrigger, allowedActionIds, TriggerVariant, TriggerProps, ...props }: ActionMenuProps): false | import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare const _default: import("react").MemoExoticComponent<typeof ActionMenu>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
type TriggerProps = {
|
|
3
|
+
variant: "textButton" | "iconButton";
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
};
|
|
7
|
+
declare const Trigger: ({ variant, label, ...props }: TriggerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export default Trigger;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Menu";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const IconButtonStyled: import("@emotion/styled").StyledComponent<import("@mui/material").IconButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
2
|
+
ref?: ((instance: HTMLButtonElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
3
|
+
}, "classes" | "children" | "className" | "sx" | "style" | "tabIndex" | "color" | "loading" | "size" | "disabled" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "loadingIndicator" | "edge"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
4
|
+
export const MoreIcon: import("@emotion/styled").StyledComponent<Omit<import("react").SVGProps<SVGSVGElement> & import("@imtf/icons").IconProps, "ref"> & import("react").RefAttributes<SVGSVGElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ElementType, ReactNode } from "react";
|
|
2
|
+
import { Inode, InodeType } from "../../providers/Inodes/types";
|
|
3
|
+
import { Entity } from "../../providers/MdmGraph/types";
|
|
4
|
+
import { DocumentTaskListError } from "../../providers/Tasks/types";
|
|
5
|
+
import { FileType } from "./types";
|
|
6
|
+
export type EntityDocumentsComponentProps = {
|
|
7
|
+
types: FileType[];
|
|
8
|
+
typesFromDefinition: FileType[];
|
|
9
|
+
documentsByType: {
|
|
10
|
+
[key: string]: Inode<"dms-core.File">[];
|
|
11
|
+
};
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
documentUploadButton?: ReactNode;
|
|
14
|
+
title?: ReactNode;
|
|
15
|
+
WrapperComponent?: ElementType;
|
|
16
|
+
WrapperProps?: {
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
};
|
|
19
|
+
hideDocumentTypeWhenSolo?: boolean;
|
|
20
|
+
entity?: Entity;
|
|
21
|
+
errors?: {
|
|
22
|
+
[key: string]: DocumentTaskListError["errors"];
|
|
23
|
+
};
|
|
24
|
+
onDrop: (items: File[] | Inode<"dms-core.File">[], targetTypes: InodeType[]) => void;
|
|
25
|
+
onDragStart?: (document: any) => void;
|
|
26
|
+
onDragEnd?: (document: any) => void;
|
|
27
|
+
canDrop: (items: Inode<"dms-core.File">[] | File[], typeName?: string) => boolean;
|
|
28
|
+
};
|
|
29
|
+
declare const _default: import("react").MemoExoticComponent<({ types, typesFromDefinition, documentsByType, disabled, documentUploadButton, title, WrapperComponent, WrapperProps, hideDocumentTypeWhenSolo, entity, errors, onDragStart, onDragEnd, onDrop, canDrop: canDropProp, }: EntityDocumentsComponentProps) => import("react/jsx-runtime").JSX.Element>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Entity } from "../../../providers/MdmGraph/types";
|
|
2
|
+
type AccordionProps = {
|
|
3
|
+
defaultExpanded?: boolean;
|
|
4
|
+
isOver?: boolean;
|
|
5
|
+
title: string;
|
|
6
|
+
entity: Entity;
|
|
7
|
+
documentUploadButton?: React.ReactNode;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
TransitionProps?: Record<string, any>;
|
|
10
|
+
};
|
|
11
|
+
declare const AccordionComponent: import("react").ForwardRefExoticComponent<AccordionProps & import("react").RefAttributes<unknown>>;
|
|
12
|
+
export default AccordionComponent;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Inode } from "../../../providers/Inodes/types";
|
|
2
|
+
import { Entity } from "../../../providers/MdmGraph/types";
|
|
3
|
+
type DocumentProps = {
|
|
4
|
+
document: Inode<"dms-core.File">;
|
|
5
|
+
onDragStart?: (document: any) => void;
|
|
6
|
+
onDragEnd?: (document: any) => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
entity?: Entity;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import("react").MemoExoticComponent<({ document, onDragStart, onDragEnd, disabled, entity, }: DocumentProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Inode } from "../../../providers/Inodes/types";
|
|
2
|
+
import { Entity } from "../../../providers/MdmGraph/types";
|
|
3
|
+
type DocumentListProps = {
|
|
4
|
+
label?: string;
|
|
5
|
+
typeName: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
entity?: Entity;
|
|
8
|
+
errors?: string[];
|
|
9
|
+
isTypeAssignable: boolean;
|
|
10
|
+
isRequired: boolean;
|
|
11
|
+
documents: Inode<"dms-core.File">[];
|
|
12
|
+
canDrop?: (item: Inode<"dms-core.File">[] | File[], typeName?: string) => boolean;
|
|
13
|
+
onDrop?: (files: File[], monitor: any, typeName: string) => void;
|
|
14
|
+
onDragStart?: (document: any) => void;
|
|
15
|
+
onDragEnd?: (document: any) => void;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: import("react").MemoExoticComponent<({ label, typeName, disabled, isTypeAssignable, entity, errors, isRequired, documents, canDrop: canDropOnDocuments, onDrop, onDragStart, onDragEnd, }: DocumentListProps) => import("react/jsx-runtime").JSX.Element>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type DocumentsTypeProps = {
|
|
2
|
+
label: string;
|
|
3
|
+
disabled: boolean;
|
|
4
|
+
isRequired: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const DocumentListTitle: ({ disabled, label, isRequired, }: DocumentsTypeProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default DocumentListTitle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const REQUIRED_FIELD_SYMBOL = "*";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const Accordion: import("react").JSXElementConstructor<any>;
|
|
2
|
+
export const AccordionDetails: import("react").JSXElementConstructor<Omit<import("@mui/material").AccordionDetailsProps, "classes"> & import("@mui/styles").StyledComponentProps<"root"> & object>;
|
|
3
|
+
export const AccordionActions: import("react").JSXElementConstructor<Omit<import("@mui/material").AccordionActionsProps, "classes"> & import("@mui/styles").StyledComponentProps<"root"> & object>;
|
|
4
|
+
export const Placeholder: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
5
|
+
ref?: ((instance: HTMLSpanElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
6
|
+
}, "maxWidth" | "classes" | "children" | "className" | "sx" | "p" | "style" | "color" | "m" | "right" | "left" | "variant" | "flex" | "display" | "alignItems" | "alignContent" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "columnGap" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "displayPrint" | "bgcolor" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "marginX" | "marginY" | "paddingX" | "paddingY" | "typography" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
7
|
+
export const File: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
|
+
export const FileName: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
9
|
+
export const Required: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
10
|
+
export const Error: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, {}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
type ComponentPluginContextType = {
|
|
3
|
+
props: {
|
|
4
|
+
identifier?: string;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
declare const ComponentPluginContext: import("react").Context<ComponentPluginContextType>;
|
|
9
|
+
export default ComponentPluginContext;
|
|
10
|
+
export declare function useComponentPluginContext(): ComponentPluginContextType;
|
|
11
|
+
export declare const ComponentPluginProps: ({ children, ...props }: {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
import { FormDefinition, MdmEditorDefinition } from "../../Definitions/types";
|
|
3
3
|
import { Inode } from "../../Inodes/types";
|
|
4
4
|
import { Entity } from "../../MdmGraph/types";
|
|
5
|
+
import type { EntityDocumentsComponentProps as EntityDocumentsComponentCoreProps } from "../../../../core/containers/EntityDocuments/EntityDocumentsComponent";
|
|
5
6
|
export type ComponentPluginProps<P> = P & {
|
|
6
7
|
defaultRender: (props?: Partial<P>) => JSX.Element;
|
|
7
8
|
};
|
|
@@ -18,10 +19,7 @@ export type EntityEditModalEditForm = ComponentPluginProps<{
|
|
|
18
19
|
entity: Entity;
|
|
19
20
|
children: ReactNode;
|
|
20
21
|
}>;
|
|
21
|
-
export type EntityDocumentsComponentProps = ComponentPluginProps<{
|
|
22
|
-
dropRef: React.Ref<HTMLElement>;
|
|
23
|
-
canDrop: () => boolean;
|
|
24
|
-
documentUploadButton?: ReactNode;
|
|
22
|
+
export type EntityDocumentsComponentProps = ComponentPluginProps<Pick<EntityDocumentsComponentCoreProps, "entity" | "canDrop" | "onDrop" | "documentsByType" | "typesFromDefinition" | "disabled"> & {
|
|
25
23
|
identifier?: string;
|
|
26
24
|
taskOid?: string;
|
|
27
25
|
caseOid?: string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ComponentType } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* This component can be used to replace a component
|
|
4
|
+
* but from the "consumer" side (i.e. the side that uses the component)
|
|
5
|
+
*/
|
|
6
|
+
export declare const WithComponentPlugin: <P extends Record<string, unknown>>(props: {
|
|
7
|
+
component: ComponentType<P> | keyof JSX.IntrinsicElements;
|
|
8
|
+
/**
|
|
9
|
+
* The identifier of the component. It must be unique.
|
|
10
|
+
* First segment is the type of the component
|
|
11
|
+
* Second segment is the name of the component
|
|
12
|
+
*/
|
|
13
|
+
identifier: `${string}/${string}`;
|
|
14
|
+
/**
|
|
15
|
+
* Exhausive list of the props that should be forwarded to the component.
|
|
16
|
+
* By default none are forwarded.
|
|
17
|
+
*/
|
|
18
|
+
forwardedProps?: (keyof P)[];
|
|
19
|
+
/**
|
|
20
|
+
* Extra props that should be passed to the component
|
|
21
|
+
*/
|
|
22
|
+
extraProps?: Record<string, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* Function to alter the props before passing them to the component
|
|
25
|
+
*/
|
|
26
|
+
alterProps?: (propName: keyof P, propValue: P[keyof P]) => P[keyof P];
|
|
27
|
+
} & P) => import("react/jsx-runtime").JSX.Element;
|