@myunisoft/design-system 1.2.2-myun36212.1 → 1.2.2-rev157-2
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/components/DataGrid/DataGrid.d.ts +3 -0
- package/dist/components/DataGrid/hooks/useSizing.d.ts +5 -0
- package/dist/components/DataGrid/hooks/useSizing.test.d.ts +1 -0
- package/dist/components/DocumentComposer/EmptySummary/index.d.ts +4 -0
- package/dist/components/DocumentComposer/Treeview/CustomTreeItem.d.ts +8 -0
- package/dist/components/DocumentComposer/Treeview/hooks/useTreeItemMenu.d.ts +12 -0
- package/dist/components/DocumentComposer/Treeview/icons/index.d.ts +1 -0
- package/dist/components/DocumentComposer/Treeview/index.d.ts +3 -0
- package/dist/components/DocumentComposer/Treeview/slots/IconContainerSlot.d.ts +14 -0
- package/dist/components/DocumentComposer/Treeview/slots/LabelInputSlot.d.ts +6 -0
- package/dist/components/DocumentComposer/Treeview/slots/LabelSlot.d.ts +20 -0
- package/dist/components/DocumentComposer/Treeview/slots/index.d.ts +3 -0
- package/dist/components/DocumentComposer/Treeview/types.d.ts +40 -0
- package/dist/components/DocumentComposer/hooks/useDocumentComposer.d.ts +17 -0
- package/dist/components/DocumentComposer/icons/index.d.ts +8 -0
- package/dist/components/DocumentComposer/index.d.ts +6 -0
- package/dist/components/DocumentComposer/types.d.ts +23 -0
- package/dist/components/Modal/components/ModalVariantIcon.d.ts +6 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -3
- package/package.json +119 -117
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RichTreeViewProApiRef, TreeItemProps } from '@mui/x-tree-view-pro';
|
|
2
|
+
import type { TreeviewProps } from './types';
|
|
3
|
+
type TreeItemCallbacks<T extends Record<string, unknown>> = Pick<TreeviewProps<T>, 'isSectionItem' | 'isVisibleItem' | 'getIconItem' | 'hasItemMenu' | 'getMenuItems' | 'isItemReorderable' | 'onItemVisibilityChange'> & {
|
|
4
|
+
apiRef: RichTreeViewProApiRef;
|
|
5
|
+
};
|
|
6
|
+
type CustomTreeItemProps<T extends Record<string, unknown>> = TreeItemProps & TreeItemCallbacks<T>;
|
|
7
|
+
export declare const CustomTreeItem: <T extends Record<string, unknown>>(props: CustomTreeItemProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const useTreeItemMenu: () => {
|
|
2
|
+
containerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
3
|
+
menuAnchorEl: HTMLElement | null;
|
|
4
|
+
menuPosition: {
|
|
5
|
+
top: number;
|
|
6
|
+
left: number;
|
|
7
|
+
} | null;
|
|
8
|
+
handleMenuClick: (event: React.MouseEvent<HTMLElement>) => void;
|
|
9
|
+
handleMenuClose: () => void;
|
|
10
|
+
createMouseMoveHandler: (isHovered: boolean, onHoverChange?: (isHovered: boolean) => void) => (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
11
|
+
createMouseLeaveHandler: (onHoverChange?: (isHovered: boolean) => void) => () => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DragHandleIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SxProps, Theme } from '@mui/material';
|
|
2
|
+
type IconContainerSlotProps = {
|
|
3
|
+
ownerState?: unknown;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
sx?: SxProps<Theme>;
|
|
6
|
+
isDraggable?: boolean;
|
|
7
|
+
isVisible?: boolean;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
};
|
|
10
|
+
export declare const IconContainerSlot: {
|
|
11
|
+
(props: IconContainerSlotProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SxProps, Theme } from '@mui/material';
|
|
2
|
+
type LabelSlotProps = {
|
|
3
|
+
ownerState?: unknown;
|
|
4
|
+
editable?: unknown;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
sx?: SxProps<Theme>;
|
|
7
|
+
customIcon?: React.ReactNode;
|
|
8
|
+
hasMenu?: boolean;
|
|
9
|
+
isVisible?: boolean;
|
|
10
|
+
itemId: string;
|
|
11
|
+
menuAnchorEl?: HTMLElement | null;
|
|
12
|
+
onMenuClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
+
onItemVisibilityChange?: (itemId: string, visible: boolean) => void;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
};
|
|
16
|
+
export declare const LabelSlot: {
|
|
17
|
+
(props: LabelSlotProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { RichTreeViewProApiRef } from '@mui/x-tree-view-pro';
|
|
2
|
+
export type ItemPositionParams = {
|
|
3
|
+
itemId: string;
|
|
4
|
+
oldPosition: {
|
|
5
|
+
parentId: string | null;
|
|
6
|
+
index: number;
|
|
7
|
+
};
|
|
8
|
+
newPosition: {
|
|
9
|
+
parentId: string | null;
|
|
10
|
+
index: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
type CustomTreeviewItemProps<T> = {
|
|
14
|
+
hasItemMenu?: (item: T) => boolean;
|
|
15
|
+
getMenuItems?: (item: T, apiRef?: RichTreeViewProApiRef) => React.ReactNode[];
|
|
16
|
+
isSectionItem?: (item: T) => boolean;
|
|
17
|
+
getIconItem?: (item: T) => React.ReactNode;
|
|
18
|
+
isItemEditable?: (item: T) => boolean;
|
|
19
|
+
isVisibleItem?: (item: T) => boolean;
|
|
20
|
+
onItemVisibilityChange?: (itemId: string, visible: boolean) => void;
|
|
21
|
+
};
|
|
22
|
+
export type TreeviewProps<T> = {
|
|
23
|
+
items: readonly T[];
|
|
24
|
+
getItemId?: (item: T) => string;
|
|
25
|
+
getItemLabel?: (item: T) => string;
|
|
26
|
+
getItemChildren?: (item: T) => T[] | undefined;
|
|
27
|
+
isItemReorderable?: (itemId: string) => boolean;
|
|
28
|
+
canMoveItemToNewPosition?: (params: ItemPositionParams) => boolean;
|
|
29
|
+
onItemPositionChange?: (params: ItemPositionParams) => void;
|
|
30
|
+
onItemLabelChange?: (itemId: string, newLabel: string) => void;
|
|
31
|
+
checkboxSelection?: boolean;
|
|
32
|
+
multiSelect?: boolean;
|
|
33
|
+
defaultExpandedItems?: string[];
|
|
34
|
+
} & CustomTreeviewItemProps<T>;
|
|
35
|
+
export type TreeviewItemProps<T> = {
|
|
36
|
+
itemId: string;
|
|
37
|
+
label?: React.ReactNode;
|
|
38
|
+
children?: React.ReactNode;
|
|
39
|
+
} & CustomTreeviewItemProps<T>;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { RichTreeViewProApiRef } from '@mui/x-tree-view-pro';
|
|
2
|
+
import type { ItemPositionParams } from '../Treeview/types';
|
|
3
|
+
import type { DocumentComposerCallbacks, DocumentComposerSummaryItem } from '../types';
|
|
4
|
+
type HookDocumentComposerProps = {
|
|
5
|
+
summary?: DocumentComposerSummaryItem[];
|
|
6
|
+
} & DocumentComposerCallbacks;
|
|
7
|
+
export declare const useDocumentComposer: ({ summary, onSummaryItemVisibilityChange, onSummaryItemDelete }: HookDocumentComposerProps) => {
|
|
8
|
+
summaryItemsMap: Map<string, DocumentComposerSummaryItem>;
|
|
9
|
+
getSummaryItemMenu: (item: DocumentComposerSummaryItem, apiRef?: RichTreeViewProApiRef) => import("react").ReactNode[];
|
|
10
|
+
hasSummaryItemMenu: (_item: DocumentComposerSummaryItem) => boolean;
|
|
11
|
+
getSummaryItemById: (itemId: string) => DocumentComposerSummaryItem | null;
|
|
12
|
+
getSummaryItemIcon: (item: DocumentComposerSummaryItem) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
isSummaryItemSection: (item: DocumentComposerSummaryItem) => boolean;
|
|
14
|
+
canMoveSummaryItemToNewPosition: (params: ItemPositionParams) => boolean;
|
|
15
|
+
handleOnSummaryItemVisibilityChange: (itemId: string, visible: boolean) => void;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const TableIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const RenameIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const DeleteIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const CreateIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const AddIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const VisibilityOffIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const VisibilityOnIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const EmptyAnnexIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DocumentComposerCallbacks, DocumentComposerCustomProps, DocumentComposerSummaryItem } from './types';
|
|
2
|
+
type DocumentComposerProps = {
|
|
3
|
+
summary?: DocumentComposerSummaryItem[];
|
|
4
|
+
} & DocumentComposerCallbacks & DocumentComposerCustomProps;
|
|
5
|
+
declare const DocumentComposer: ({ summary, onSummaryItemOrderChange, onSummaryItemLabelChange, onSummaryItemDelete, onSummaryItemVisibilityChange, emptySummaryLabel, isLoading }: DocumentComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default DocumentComposer;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ItemPositionParams } from './Treeview/types';
|
|
2
|
+
export type DocumentComposerSummaryItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
visible: boolean;
|
|
6
|
+
parentId: string | null;
|
|
7
|
+
sections?: DocumentComposerSummaryItem[] | null;
|
|
8
|
+
};
|
|
9
|
+
export type ItemDisplayOrder = {
|
|
10
|
+
id: string;
|
|
11
|
+
displayOrder: number;
|
|
12
|
+
};
|
|
13
|
+
export type DocumentComposerCustomProps = {
|
|
14
|
+
emptySummaryLabel?: string | React.ReactNode;
|
|
15
|
+
/** Show a loading state that blocks the summary */
|
|
16
|
+
isLoading?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type DocumentComposerCallbacks = {
|
|
19
|
+
onSummaryItemOrderChange?: (params: ItemPositionParams) => void;
|
|
20
|
+
onSummaryItemLabelChange?: (itemId: string, newLabel: string) => void;
|
|
21
|
+
onSummaryItemDelete?: (itemId: string) => void;
|
|
22
|
+
onSummaryItemVisibilityChange?: (itemId: string, visible: boolean) => void;
|
|
23
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { default as BackgroundLoader } from './components/BackgroundLoader';
|
|
|
7
7
|
export { default as BadgeAdd } from './components/BadgeAdd';
|
|
8
8
|
export { default as Checkbox } from './components/basics/Checkbox';
|
|
9
9
|
export { default as ExpandButton } from './components/basics/ExpandButton';
|
|
10
|
+
export { default as DocumentComposer } from './components/DocumentComposer';
|
|
10
11
|
export * from './components/basics/Icon/';
|
|
11
12
|
export * from './components/basics/Icon/Icons-material';
|
|
12
13
|
export { default as Snackbar } from './components/basics/Snackbar';
|