@myunisoft/design-system 1.2.4 → 1.2.5-rev157.1
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/Autocomplete/Autocomplete/AutocompleteTag/index.d.ts +3 -6
- package/dist/components/Autocomplete/Autocomplete/index.d.ts +3 -51
- package/dist/components/Autocomplete/Autocomplete/types.d.ts +63 -0
- package/dist/components/DataGrid/components/toolbar/ActionsMenu/index.d.ts +19 -0
- package/dist/components/DataGrid/components/toolbar/CustomGridToolbar.d.ts +4 -1
- package/dist/components/DocumentComposer/LoadingSkeleton.d.ts +2 -0
- package/dist/components/DocumentComposer/Treeview/CustomTreeItem.d.ts +2 -1
- package/dist/components/DocumentComposer/Treeview/hooks/useTreeItemMenu.d.ts +2 -0
- package/dist/components/DocumentComposer/Treeview/slots/LabelInputSlot.d.ts +10 -5
- package/dist/components/DocumentComposer/Treeview/types.d.ts +22 -15
- package/dist/components/DocumentComposer/hooks/useDragValidation.d.ts +14 -0
- package/dist/components/DocumentComposer/hooks/useSummaryItemsMap.d.ts +5 -0
- package/dist/components/DocumentComposer/hooks/useTemporarySection.d.ts +25 -0
- package/dist/components/DocumentComposer/index.d.ts +1 -1
- package/dist/components/DocumentComposer/types.d.ts +1 -0
- package/dist/components/DocumentComposer/utils/getSummaryItemMenuItems.d.ts +9 -0
- package/dist/components/DocumentComposer/utils/summaryHelpers.d.ts +12 -0
- package/dist/components/VirtualTable/components/ExportDialog/styles.d.ts +1 -1
- package/dist/components/VirtualTable/styles.d.ts +1 -1
- package/dist/index.js +3 -3
- package/package.json +121 -119
- package/dist/components/DataGrid/DataGrid.d.ts +0 -3
- package/dist/components/DataGrid/hooks/useSizing.d.ts +0 -5
- package/dist/components/DataGrid/hooks/useSizing.test.d.ts +0 -1
- package/dist/components/DocumentComposer/Treeview/icons/index.d.ts +0 -1
- package/dist/components/DocumentComposer/hooks/useDocumentComposer.d.ts +0 -17
- package/dist/components/DocumentComposer/icons/index.d.ts +0 -8
- package/dist/components/Modal/components/ModalVariantIcon.d.ts +0 -6
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import { type
|
|
3
|
-
import type { OptionType } from '../
|
|
4
|
-
export type AutocompleteTagProps = {
|
|
2
|
+
import { type ChipProps } from '@mui/material';
|
|
3
|
+
import type { OptionType } from '../types';
|
|
4
|
+
export type AutocompleteTagProps = ChipProps & {
|
|
5
5
|
option?: OptionType;
|
|
6
|
-
label?: string;
|
|
7
6
|
maxChipWidth?: number;
|
|
8
7
|
reserveForCounter?: number;
|
|
9
8
|
isDisabled?: boolean;
|
|
10
|
-
onDelete?: (event: MouseEvent) => void;
|
|
11
|
-
sx?: SxProps<Theme>;
|
|
12
9
|
};
|
|
13
10
|
declare const AutocompleteTag: React.FC<AutocompleteTagProps>;
|
|
14
11
|
export default AutocompleteTag;
|
|
@@ -1,52 +1,4 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export type OptionType = {
|
|
5
|
-
id: string | number;
|
|
6
|
-
label: string;
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Use value instead
|
|
9
|
-
*/
|
|
10
|
-
selected?: boolean;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
optionType?: 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';
|
|
13
|
-
};
|
|
14
|
-
type SingleValueType<T> = T | null;
|
|
15
|
-
type MultiValueType<T> = T[];
|
|
16
|
-
type ValueType<T> = SingleValueType<T> | MultiValueType<T>;
|
|
17
|
-
export type AutocompleteBaseProps<T extends OptionType = OptionType> = {
|
|
18
|
-
label?: string;
|
|
19
|
-
options?: T[];
|
|
20
|
-
isError?: boolean;
|
|
21
|
-
isDisplayLabel?: boolean;
|
|
22
|
-
customSearch?: (inputValue: string, options: T[]) => T[];
|
|
23
|
-
selectAllHidden?: boolean;
|
|
24
|
-
selectAllLabel?: string;
|
|
25
|
-
allSelectedLabel?: string;
|
|
26
|
-
isDisabled?: boolean;
|
|
27
|
-
oneRowMode?: true;
|
|
28
|
-
InputProps?: StandardInputProps;
|
|
29
|
-
onIsSearchingChange?: (isOpen: boolean) => void;
|
|
30
|
-
getOptionLabel?: (option: T) => string;
|
|
31
|
-
onCreate?: (label: string, options: T[]) => void;
|
|
32
|
-
renderTag?: (tagProps: ChipProps, option: T) => ReactNode;
|
|
33
|
-
renderOptionLabel?: (labelChild: ReactNode, option: T) => ReactNode;
|
|
34
|
-
disableAllSelectedTag?: true;
|
|
35
|
-
disableSort?: true;
|
|
36
|
-
variant?: TextFieldVariants;
|
|
37
|
-
isOptionEqualToValue?: (option: T, value: T) => boolean;
|
|
38
|
-
placeholder?: string;
|
|
39
|
-
};
|
|
40
|
-
export type AutocompleteMultipleProps<T extends OptionType = OptionType> = Omit<MuiAutocompleteProps<T, true, false, false>, 'renderInput' | 'renderOption' | 'value' | 'multiple'> & AutocompleteBaseProps<T> & {
|
|
41
|
-
multiple: true;
|
|
42
|
-
value?: MultiValueType<T>;
|
|
43
|
-
onChange?: (newValue: ValueType<T>) => void;
|
|
44
|
-
};
|
|
45
|
-
export type AutocompleteSingleProps<T extends OptionType = OptionType> = Omit<MuiAutocompleteProps<T, false, false, false>, 'renderInput' | 'renderOption' | 'value' | 'multiple'> & AutocompleteBaseProps<T> & {
|
|
46
|
-
multiple?: false;
|
|
47
|
-
value?: SingleValueType<T>;
|
|
48
|
-
onChange?: (newValue: ValueType<T>) => void;
|
|
49
|
-
};
|
|
50
|
-
export type AutocompleteProps<T extends OptionType = OptionType> = AutocompleteMultipleProps<T> | AutocompleteSingleProps<T>;
|
|
51
|
-
declare const Autocomplete: <T extends OptionType = OptionType>(inProps: AutocompleteProps<T>) => React.ReactElement;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AutocompleteProps, OptionType } from './types';
|
|
3
|
+
declare const Autocomplete: <T = OptionType>(inProps: AutocompleteProps<T>) => React.ReactElement;
|
|
52
4
|
export default Autocomplete;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { AutocompleteRenderOptionState, ChipProps, AutocompleteProps as MuiAutocompleteProps, TextFieldVariants } from '@mui/material';
|
|
3
|
+
import type { InputProps as StandardInputProps } from '@mui/material/Input/Input';
|
|
4
|
+
export type OptionType = {
|
|
5
|
+
id?: string | number;
|
|
6
|
+
label?: string;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Use value instead
|
|
9
|
+
*/
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
optionType?: 'default' | 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';
|
|
13
|
+
};
|
|
14
|
+
export type SingleValueType<T> = T | null;
|
|
15
|
+
export type MultiValueType<T> = T[];
|
|
16
|
+
export type ValueType<T> = SingleValueType<T> | MultiValueType<T>;
|
|
17
|
+
export type AutocompleteBaseProps<T = OptionType> = {
|
|
18
|
+
label?: string;
|
|
19
|
+
options?: T[];
|
|
20
|
+
isError?: boolean;
|
|
21
|
+
isDisplayLabel?: boolean;
|
|
22
|
+
customSearch?: (inputValue: string, options: T[]) => T[];
|
|
23
|
+
selectAllHidden?: boolean;
|
|
24
|
+
selectAllLabel?: string;
|
|
25
|
+
allSelectedLabel?: string;
|
|
26
|
+
isDisabled?: boolean;
|
|
27
|
+
expandSelectedTagsOnEdition?: false;
|
|
28
|
+
InputProps?: StandardInputProps;
|
|
29
|
+
onIsSearchingChange?: (isOpen: boolean) => void;
|
|
30
|
+
getOptionLabel?: (option: T) => string;
|
|
31
|
+
onCreate?: (label: string, options: T[]) => void;
|
|
32
|
+
renderTag?: (tagProps: ChipProps, option: T) => ReactNode;
|
|
33
|
+
renderOptionLabel?: (labelChild: ReactNode, option: T) => ReactNode;
|
|
34
|
+
disableAllSelectedTag?: true;
|
|
35
|
+
disableSort?: true;
|
|
36
|
+
variant?: TextFieldVariants;
|
|
37
|
+
isOptionEqualToValue?: (option: T, value: T) => boolean;
|
|
38
|
+
placeholder?: string;
|
|
39
|
+
minListWidth?: number;
|
|
40
|
+
helperText?: string;
|
|
41
|
+
};
|
|
42
|
+
export type AutocompleteMultipleProps<T = OptionType> = Omit<MuiAutocompleteProps<T, true, false, false>, 'renderInput' | 'renderOption' | 'value' | 'multiple' | 'onChange'> & AutocompleteBaseProps<T> & {
|
|
43
|
+
multiple: true;
|
|
44
|
+
value?: MultiValueType<T>;
|
|
45
|
+
onChange?: (newValue: MultiValueType<T>) => void;
|
|
46
|
+
};
|
|
47
|
+
export type AutocompleteSingleProps<T = OptionType> = Omit<MuiAutocompleteProps<T, false, false, false>, 'renderInput' | 'renderOption' | 'value' | 'multiple' | 'onChange'> & AutocompleteBaseProps<T> & {
|
|
48
|
+
multiple?: false;
|
|
49
|
+
value?: SingleValueType<T>;
|
|
50
|
+
onChange?: (newValue: SingleValueType<T>) => void;
|
|
51
|
+
};
|
|
52
|
+
export type AutocompleteProps<T = OptionType> = AutocompleteMultipleProps<T> | AutocompleteSingleProps<T>;
|
|
53
|
+
export type ItemData<T = OptionType> = {
|
|
54
|
+
items: Array<{
|
|
55
|
+
key: number;
|
|
56
|
+
group: string;
|
|
57
|
+
children: React.ReactNode;
|
|
58
|
+
} | [React.ReactElement, T, AutocompleteRenderOptionState]>;
|
|
59
|
+
};
|
|
60
|
+
export type AutocompleteContextProps<T = OptionType> = {
|
|
61
|
+
renderOption: (props: React.HTMLAttributes<HTMLLIElement>, option: T, { selected }: AutocompleteRenderOptionState, inlineStyle: React.CSSProperties, currentValue: ValueType<T>) => React.ReactElement;
|
|
62
|
+
value: ValueType<T>;
|
|
63
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { GridValidRowModel } from '@mui/x-data-grid-pro';
|
|
3
|
+
export type MenuAction = {
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
color?: string;
|
|
8
|
+
disabled?: boolean | ((selectedRows: GridValidRowModel[]) => boolean);
|
|
9
|
+
onClick: (selectedRows: GridValidRowModel[]) => void;
|
|
10
|
+
};
|
|
11
|
+
type ActionsMenuProps = {
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
anchorEl: HTMLElement | null;
|
|
14
|
+
menuActions: MenuAction[];
|
|
15
|
+
selectedRows: GridValidRowModel[];
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
};
|
|
18
|
+
declare const ActionsMenu: ({ isOpen, anchorEl, menuActions, selectedRows, onClose }: ActionsMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default ActionsMenu;
|
|
@@ -7,20 +7,23 @@
|
|
|
7
7
|
* Source (MUI v7.x): https://github.com/mui/mui-x/blob/v7.x/packages/x-data-grid/src/components/toolbar/GridToolbar.tsx
|
|
8
8
|
*/
|
|
9
9
|
import { type GridRowSelectionModel, type GridSlotsComponentsProps, type GridValidRowModel } from '@mui/x-data-grid-pro';
|
|
10
|
+
import { type MenuAction } from './ActionsMenu';
|
|
10
11
|
import { type IconButtonConfig, type TextButtonConfig } from './ArrayButtons';
|
|
11
12
|
interface DeleteAction {
|
|
12
13
|
onDelete: (selectedRowIds: GridRowSelectionModel) => boolean | Promise<boolean>;
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
}
|
|
15
16
|
interface BulkEditAction {
|
|
16
|
-
onBulkEditSave: (
|
|
17
|
+
onBulkEditSave: (selectedRowIds: GridRowSelectionModel, newRows: GridValidRowModel[]) => boolean | Promise<boolean>;
|
|
17
18
|
disabled?: boolean;
|
|
18
19
|
}
|
|
19
20
|
declare module '@mui/x-data-grid-pro' {
|
|
20
21
|
interface ToolbarPropsOverrides {
|
|
22
|
+
showSelectedCount?: boolean;
|
|
21
23
|
customButtons?: CustomToolbarButtonConfig[];
|
|
22
24
|
deleteAction?: DeleteAction;
|
|
23
25
|
bulkEditAction?: BulkEditAction;
|
|
26
|
+
menuActions?: MenuAction[];
|
|
24
27
|
}
|
|
25
28
|
}
|
|
26
29
|
interface CustomTextButtonConfig extends Omit<TextButtonConfig, 'onClick'> {
|
|
@@ -1,7 +1,8 @@
|
|
|
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'> & {
|
|
3
|
+
type TreeItemCallbacks<T extends Record<string, unknown>> = Pick<TreeviewProps<T>, 'isSectionItem' | 'isVisibleItem' | 'getIconItem' | 'hasItemMenu' | 'getMenuItems' | 'isItemReorderable' | 'onItemVisibilityChange' | 'isTemporaryItem' | 'onTemporarySectionValidation' | 'onTemporarySectionCancel' | 'onItemLabelChange'> & {
|
|
4
4
|
apiRef: RichTreeViewProApiRef;
|
|
5
|
+
onEditingChange?: (itemId: string | null) => void;
|
|
5
6
|
};
|
|
6
7
|
type CustomTreeItemProps<T extends Record<string, unknown>> = TreeItemProps & TreeItemCallbacks<T>;
|
|
7
8
|
export declare const CustomTreeItem: <T extends Record<string, unknown>>(props: CustomTreeItemProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,6 +7,8 @@ export declare const useTreeItemMenu: () => {
|
|
|
7
7
|
} | null;
|
|
8
8
|
handleMenuClick: (event: React.MouseEvent<HTMLElement>) => void;
|
|
9
9
|
handleMenuClose: () => void;
|
|
10
|
+
scheduleMenuAction: (action: () => void) => void;
|
|
11
|
+
onMenuExited: () => void;
|
|
10
12
|
createMouseMoveHandler: (isHovered: boolean, onHoverChange?: (isHovered: boolean) => void) => (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
11
13
|
createMouseLeaveHandler: (onHoverChange?: (isHovered: boolean) => void) => () => void;
|
|
12
14
|
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
type
|
|
1
|
+
import type { InputHTMLAttributes } from 'react';
|
|
2
|
+
import type { RichTreeViewProApiRef } from '@mui/x-tree-view-pro';
|
|
3
|
+
export declare const LabelInputSlot: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
|
|
2
4
|
ownerState?: unknown;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
itemId?: string;
|
|
6
|
+
isTemporary?: boolean;
|
|
7
|
+
onTemporarySectionValidation?: (label: string) => void;
|
|
8
|
+
onTemporarySectionCancel?: () => void;
|
|
9
|
+
onItemLabelChange?: (itemId: string, newLabel: string) => void;
|
|
10
|
+
apiRef?: RichTreeViewProApiRef;
|
|
11
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RichTreeViewProApiRef } from '@mui/x-tree-view-pro';
|
|
2
|
+
import type { TemporaryItem } from '../hooks/useTemporarySection';
|
|
2
3
|
export type ItemPositionParams = {
|
|
3
4
|
itemId: string;
|
|
4
5
|
oldPosition: {
|
|
@@ -10,27 +11,33 @@ export type ItemPositionParams = {
|
|
|
10
11
|
index: number;
|
|
11
12
|
};
|
|
12
13
|
};
|
|
14
|
+
export type ScheduleMenuAction = (action: () => void) => void;
|
|
13
15
|
type CustomTreeviewItemProps<T> = {
|
|
14
|
-
hasItemMenu
|
|
15
|
-
getMenuItems
|
|
16
|
-
isSectionItem
|
|
17
|
-
getIconItem
|
|
18
|
-
isItemEditable
|
|
19
|
-
isVisibleItem
|
|
20
|
-
onItemVisibilityChange
|
|
16
|
+
hasItemMenu: (item: T) => boolean;
|
|
17
|
+
getMenuItems: (item: T, scheduleMenuAction: ScheduleMenuAction) => React.ReactNode[];
|
|
18
|
+
isSectionItem: (item: T) => boolean;
|
|
19
|
+
getIconItem: (item: T) => React.ReactNode;
|
|
20
|
+
isItemEditable: (item: T) => boolean;
|
|
21
|
+
isVisibleItem: (item: T) => boolean;
|
|
22
|
+
onItemVisibilityChange: (itemId: string, visible: boolean) => void;
|
|
21
23
|
};
|
|
22
24
|
export type TreeviewProps<T> = {
|
|
25
|
+
apiRef: RichTreeViewProApiRef;
|
|
23
26
|
items: readonly T[];
|
|
24
|
-
getItemId
|
|
25
|
-
getItemLabel
|
|
26
|
-
getItemChildren
|
|
27
|
-
isItemReorderable
|
|
28
|
-
canMoveItemToNewPosition
|
|
29
|
-
onItemPositionChange
|
|
30
|
-
onItemLabelChange
|
|
27
|
+
getItemId: (item: T) => string;
|
|
28
|
+
getItemLabel: (item: T) => string;
|
|
29
|
+
getItemChildren: (item: T) => T[] | undefined;
|
|
30
|
+
isItemReorderable: (itemId: string) => boolean;
|
|
31
|
+
canMoveItemToNewPosition: (params: ItemPositionParams) => boolean;
|
|
32
|
+
onItemPositionChange: (params: ItemPositionParams) => void;
|
|
33
|
+
onItemLabelChange: (itemId: string, newLabel: string) => void;
|
|
34
|
+
temporaryItem: TemporaryItem | null;
|
|
35
|
+
isTemporaryItem: (itemId: string) => boolean;
|
|
36
|
+
onTemporarySectionValidation: (label: string) => void;
|
|
37
|
+
onTemporarySectionCancel: () => void;
|
|
38
|
+
defaultExpandedItems: string[];
|
|
31
39
|
checkboxSelection?: boolean;
|
|
32
40
|
multiSelect?: boolean;
|
|
33
|
-
defaultExpandedItems?: string[];
|
|
34
41
|
} & CustomTreeviewItemProps<T>;
|
|
35
42
|
export type TreeviewItemProps<T> = {
|
|
36
43
|
itemId: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ItemPositionParams } from '../Treeview/types';
|
|
2
|
+
import type { DocumentComposerSummaryItem } from '../types';
|
|
3
|
+
type UseDragValidationParams = {
|
|
4
|
+
getItemById: (itemId: string) => DocumentComposerSummaryItem | null;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Business rule: Items can only be moved within their current parent
|
|
8
|
+
* or into their siblings' children. Moving items to a completely
|
|
9
|
+
* different branch is disabled to maintain document structure integrity.
|
|
10
|
+
*/
|
|
11
|
+
export declare const useDragValidation: ({ getItemById }: UseDragValidationParams) => {
|
|
12
|
+
canMoveItemToNewPosition: (params: ItemPositionParams) => boolean;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DocumentComposerSummaryItem } from '../types';
|
|
2
|
+
export declare const useSummaryItemsMap: (summary: DocumentComposerSummaryItem[] | undefined) => {
|
|
3
|
+
itemsMap: Map<string, DocumentComposerSummaryItem>;
|
|
4
|
+
getItemById: (itemId: string) => DocumentComposerSummaryItem | null;
|
|
5
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { RichTreeViewProApiRef } from '@mui/x-tree-view-pro';
|
|
2
|
+
import type { DocumentComposerSummaryItem } from '../types';
|
|
3
|
+
export type TemporaryItem = Pick<DocumentComposerSummaryItem, 'id' | 'parentId'> & {
|
|
4
|
+
parentVisible: boolean;
|
|
5
|
+
};
|
|
6
|
+
type UseTemporarySectionParams = {
|
|
7
|
+
apiRef: RichTreeViewProApiRef;
|
|
8
|
+
getItemById: (itemId: string) => DocumentComposerSummaryItem | null;
|
|
9
|
+
onItemCreated?: (parentId: string | null, label: string) => string | Promise<string>;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Flow:
|
|
13
|
+
* 1. User triggers `create(parentId)` from context menu
|
|
14
|
+
* 2. A temporary item appears in the tree in edit mode
|
|
15
|
+
* 3. User types a label and presses Enter → `validate()` is called
|
|
16
|
+
* 4. User presses Escape or leaves empty → `cancel()` is called
|
|
17
|
+
*/
|
|
18
|
+
export declare const useTemporarySection: ({ apiRef, getItemById, onItemCreated }: UseTemporarySectionParams) => {
|
|
19
|
+
temporaryItem: TemporaryItem | null;
|
|
20
|
+
create: (parentId: string) => void;
|
|
21
|
+
validate: (label: string) => Promise<void>;
|
|
22
|
+
cancel: () => void;
|
|
23
|
+
isTemporary: (itemId: string) => boolean;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -2,5 +2,5 @@ import type { DocumentComposerCallbacks, DocumentComposerCustomProps, DocumentCo
|
|
|
2
2
|
type DocumentComposerProps = {
|
|
3
3
|
summary?: DocumentComposerSummaryItem[];
|
|
4
4
|
} & DocumentComposerCallbacks & DocumentComposerCustomProps;
|
|
5
|
-
declare const DocumentComposer: ({ summary, onSummaryItemOrderChange, onSummaryItemLabelChange, onSummaryItemDelete, onSummaryItemVisibilityChange, emptySummaryLabel, isLoading }: DocumentComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const DocumentComposer: ({ summary, onSummaryItemOrderChange, onSummaryItemLabelChange, onSummaryItemDelete, onSummaryItemVisibilityChange, onSummaryItemCreated, emptySummaryLabel, isLoading }: DocumentComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default DocumentComposer;
|
|
@@ -20,4 +20,5 @@ export type DocumentComposerCallbacks = {
|
|
|
20
20
|
onSummaryItemLabelChange?: (itemId: string, newLabel: string) => void;
|
|
21
21
|
onSummaryItemDelete?: (itemId: string) => void;
|
|
22
22
|
onSummaryItemVisibilityChange?: (itemId: string, visible: boolean) => void;
|
|
23
|
+
onSummaryItemCreated?: (parentId: string | null, label: string) => string | Promise<string>;
|
|
23
24
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ScheduleMenuAction } from '../Treeview/types';
|
|
2
|
+
import type { DocumentComposerSummaryItem } from '../types';
|
|
3
|
+
type MenuItemCallbacks = {
|
|
4
|
+
onRename: (itemId: string) => void;
|
|
5
|
+
onDelete: (itemId: string) => void;
|
|
6
|
+
onCreateSubsection: (parentId: string) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const getSummaryItemMenuItems: (item: DocumentComposerSummaryItem, callbacks: MenuItemCallbacks, scheduleMenuAction: ScheduleMenuAction) => React.ReactNode[];
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DocumentComposerSummaryItem } from '../types';
|
|
2
|
+
export declare const getAllExpandableItemIds: (items: DocumentComposerSummaryItem[]) => string[];
|
|
3
|
+
export declare const getAllTreeItemsFlat: (items: DocumentComposerSummaryItem[]) => DocumentComposerSummaryItem[];
|
|
4
|
+
export declare const isSummaryItemSection: (item: DocumentComposerSummaryItem) => boolean;
|
|
5
|
+
export declare const hasSummaryItemMenu: (_item: DocumentComposerSummaryItem) => boolean;
|
|
6
|
+
export declare const isSummaryItemVisible: (item: DocumentComposerSummaryItem) => boolean;
|
|
7
|
+
export declare const getItemChildren: (item: DocumentComposerSummaryItem) => DocumentComposerSummaryItem[] | undefined;
|
|
8
|
+
export declare const getItemId: (item: DocumentComposerSummaryItem) => string;
|
|
9
|
+
export declare const getItemLabel: (item: DocumentComposerSummaryItem) => string;
|
|
10
|
+
export declare const isItemEditable: (_item: DocumentComposerSummaryItem) => boolean;
|
|
11
|
+
export declare const isItemReorderable: (_itemId: string) => boolean;
|
|
12
|
+
export declare const getSummaryItemIcon: (item: DocumentComposerSummaryItem) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -2,7 +2,7 @@ declare const useStyles: (params: void, muiStyleOverridesParams?: {
|
|
|
2
2
|
props: Record<string, unknown>;
|
|
3
3
|
ownerState?: Record<string, unknown> | undefined;
|
|
4
4
|
} | undefined) => {
|
|
5
|
-
classes: Record<"fieldset" | "title" | "
|
|
5
|
+
classes: Record<"fieldset" | "title" | "root" | "checkbox" | "actions" | "exportAllPage" | "checkboxLabel" | "switchButton", string>;
|
|
6
6
|
theme: import("@mui/material/styles").Theme;
|
|
7
7
|
css: import("tss-react/types").Css;
|
|
8
8
|
cx: import("tss-react/types").Cx;
|
|
@@ -2,7 +2,7 @@ declare const useStyles: (params: void, muiStyleOverridesParams?: {
|
|
|
2
2
|
props: Record<string, unknown>;
|
|
3
3
|
ownerState?: Record<string, unknown> | undefined;
|
|
4
4
|
} | undefined) => {
|
|
5
|
-
classes: Record<"center" | "container" | "disabled" | "onError" | "align" | "
|
|
5
|
+
classes: Record<"center" | "container" | "disabled" | "onError" | "align" | "cell" | "checkbox" | "pointer" | "alignLeft" | "alignCenter" | "alignRight" | "thumbnail" | "groupRow" | "cbCell" | "checkmark" | "BodyGrid" | "defaultStyle" | "lockRow" | "alignVerticalCenter" | "alignVerticalBottom" | "alignVerticalTop" | "selectedRow" | "hasSelectAll" | "HeaderGrid" | "GridRow" | "GridColumn" | "LeftSideGridContainer" | "LeftSideGrid" | "mb32" | "hoverRow" | "displayNone", string>;
|
|
6
6
|
theme: import("@mui/material/styles").Theme;
|
|
7
7
|
css: import("tss-react/types").Css;
|
|
8
8
|
cx: import("tss-react/types").Cx;
|