@myunisoft/design-system 1.2.9-rev157-4 → 1.2.9-rev157-6
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/DocumentComposer/Treeview/CustomTreeItem.d.ts +1 -1
- package/dist/components/DocumentComposer/Treeview/hooks/useTreeItemMenu.d.ts +1 -3
- package/dist/components/DocumentComposer/Treeview/slots/IconContainerSlot.d.ts +0 -1
- package/dist/components/DocumentComposer/Treeview/slots/LabelSlot.d.ts +0 -1
- package/dist/components/DocumentComposer/Treeview/types.d.ts +1 -0
- package/dist/components/DocumentComposer/index.d.ts +1 -1
- package/dist/components/DocumentComposer/types.d.ts +8 -6
- package/dist/index.js +3 -3
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RichTreeViewProApiRef, TreeItemProps } from '@mui/x-tree-view-pro';
|
|
2
2
|
import type { TreeviewProps } from './types';
|
|
3
|
-
type TreeItemCallbacks<T extends Record<string, unknown>> = Pick<TreeviewProps<T>, 'isSectionItem' | 'isVisibleItem' | 'getIconItem' | 'hasItemMenu' | 'getMenuItems' | 'isItemReorderable' | 'onItemVisibilityChange' | 'isTemporaryItem' | 'onTemporarySectionValidation' | 'onTemporarySectionCancel' | 'onItemLabelChange' | 'hiddenSectionTooltip' | 'visibleIconTooltip' | 'hiddenIconTooltip'> & {
|
|
3
|
+
type TreeItemCallbacks<T extends Record<string, unknown>> = Pick<TreeviewProps<T>, 'isSectionItem' | 'isVisibleItem' | 'getIconItem' | 'hasItemMenu' | 'getMenuItems' | 'isItemReorderable' | 'isSectionDraggable' | 'onItemVisibilityChange' | 'isTemporaryItem' | 'onTemporarySectionValidation' | 'onTemporarySectionCancel' | 'onItemLabelChange' | 'hiddenSectionTooltip' | 'visibleIconTooltip' | 'hiddenIconTooltip'> & {
|
|
4
4
|
apiRef: RichTreeViewProApiRef;
|
|
5
5
|
onEditingChange?: (itemId: string | null) => void;
|
|
6
6
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const useTreeItemMenu: () => {
|
|
2
|
-
containerRef: import("react").RefObject<
|
|
2
|
+
containerRef: import("react").RefObject<HTMLLIElement | null>;
|
|
3
3
|
menuAnchorEl: HTMLElement | null;
|
|
4
4
|
menuPosition: {
|
|
5
5
|
top: number;
|
|
@@ -9,6 +9,4 @@ export declare const useTreeItemMenu: () => {
|
|
|
9
9
|
handleMenuClose: () => void;
|
|
10
10
|
scheduleMenuAction: (action: () => void) => void;
|
|
11
11
|
onMenuExited: () => void;
|
|
12
|
-
createMouseMoveHandler: (isHovered: boolean, onHoverChange?: (isHovered: boolean) => void) => (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
13
|
-
createMouseLeaveHandler: (onHoverChange?: (isHovered: boolean) => void) => () => void;
|
|
14
12
|
};
|
|
@@ -5,7 +5,6 @@ type IconContainerSlotProps = {
|
|
|
5
5
|
sx?: SxProps<Theme>;
|
|
6
6
|
isDraggable?: boolean;
|
|
7
7
|
isVisible?: boolean;
|
|
8
|
-
[key: string]: unknown;
|
|
9
8
|
};
|
|
10
9
|
export declare const IconContainerSlot: import("react").MemoExoticComponent<(props: IconContainerSlotProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
10
|
export {};
|
|
@@ -15,7 +15,6 @@ type LabelSlotProps = {
|
|
|
15
15
|
hiddenSectionTooltip?: string;
|
|
16
16
|
visibleIconTooltip?: string;
|
|
17
17
|
hiddenIconTooltip?: string;
|
|
18
|
-
[key: string]: unknown;
|
|
19
18
|
};
|
|
20
19
|
export declare const LabelSlot: import("react").MemoExoticComponent<(props: LabelSlotProps) => import("react/jsx-runtime").JSX.Element>;
|
|
21
20
|
export {};
|
|
@@ -31,6 +31,7 @@ export type TreeviewProps<T> = {
|
|
|
31
31
|
getItemLabel: (item: T) => string;
|
|
32
32
|
getItemChildren: (item: T) => T[] | undefined;
|
|
33
33
|
isItemReorderable: (itemId: string) => boolean;
|
|
34
|
+
isSectionDraggable: (itemId: string) => boolean;
|
|
34
35
|
canMoveItemToNewPosition: (params: ItemPositionParams) => boolean;
|
|
35
36
|
onItemPositionChange: (params: ItemPositionParams) => void;
|
|
36
37
|
onItemLabelChange: (itemId: string, newLabel: string) => void;
|
|
@@ -2,5 +2,5 @@ import type { DocumentComposerCallbacks, DocumentComposerCustomProps, DocumentSe
|
|
|
2
2
|
type DocumentComposerProps = {
|
|
3
3
|
sections?: DocumentSection[];
|
|
4
4
|
} & DocumentComposerCallbacks & DocumentComposerCustomProps;
|
|
5
|
-
declare const DocumentComposer: ({ sections, onSectionOrderChange, onSectionTitleChange, onSectionDelete, onSectionVisibilityChange, onSectionCreate, noSectionsPlaceholder, isLoading, getSectionTitleChangePermission, getSectionDeletePermission,
|
|
5
|
+
declare const DocumentComposer: ({ sections, onSectionOrderChange, onSectionTitleChange, onSectionDelete, onSectionVisibilityChange, onSectionCreate, noSectionsPlaceholder, isLoading, getSectionTitleChangePermission, getSectionDeletePermission, getSectionOrderChangePermission, getSectionCreatePermission, getSectionVisibilityChangePermission, hiddenSectionTooltip, visibleIconTooltip, hiddenIconTooltip, isValidDropTarget: isValidDropTargetCallback }: DocumentComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default DocumentComposer;
|
|
@@ -6,10 +6,6 @@ export type DocumentSection = {
|
|
|
6
6
|
parentId: string | null;
|
|
7
7
|
sections?: DocumentSection[] | null;
|
|
8
8
|
};
|
|
9
|
-
export type ItemDisplayOrder = {
|
|
10
|
-
id: string;
|
|
11
|
-
displayOrder: number;
|
|
12
|
-
};
|
|
13
9
|
export type DocumentComposerLabels = {
|
|
14
10
|
/** Label for the "Create section" button */
|
|
15
11
|
createSection?: string;
|
|
@@ -32,17 +28,23 @@ export type DocumentComposerCustomProps = {
|
|
|
32
28
|
/** Returns whether section can be deleted ("Supprimer" menu). Defaults to `() => true`. */
|
|
33
29
|
getSectionDeletePermission?: (section: DocumentSection) => boolean;
|
|
34
30
|
/** Returns whether section can be reordered via drag & drop. Defaults to `() => true`. */
|
|
35
|
-
|
|
31
|
+
getSectionOrderChangePermission?: (section: DocumentSection) => boolean;
|
|
36
32
|
/** Returns whether a section can be created under this section. Defaults to `() => true`. */
|
|
37
33
|
getSectionCreatePermission?: (section: DocumentSection) => boolean;
|
|
38
34
|
/** Returns whether section visibility can be toggled. Defaults to `() => true`. */
|
|
39
|
-
|
|
35
|
+
getSectionVisibilityChangePermission?: (section: DocumentSection) => boolean;
|
|
40
36
|
/** Tooltip text displayed when hovering a hidden section label (visible: false) */
|
|
41
37
|
hiddenSectionTooltip?: string;
|
|
42
38
|
/** Tooltip text displayed when hovering the visibility icon of a visible section */
|
|
43
39
|
visibleIconTooltip?: string;
|
|
44
40
|
/** Tooltip text displayed when hovering the visibility icon of a hidden section */
|
|
45
41
|
hiddenIconTooltip?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Determines if `targetSection` is a valid drop location for `draggedSection`.
|
|
44
|
+
* When provided, invalid targets are visually greyed out during drag.
|
|
45
|
+
* Defaults to () => true (all targets valid).
|
|
46
|
+
*/
|
|
47
|
+
isValidDropTarget?: (draggedSection: DocumentSection, targetSection: DocumentSection) => boolean;
|
|
46
48
|
};
|
|
47
49
|
export type DocumentComposerCallbacks = {
|
|
48
50
|
onSectionOrderChange?: (params: ItemPositionParams) => void;
|