@myunisoft/design-system 1.3.4 → 1.4.0-rev418

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.
Files changed (39) hide show
  1. package/dist/assets/I18n/locales/en.d.ts +56 -0
  2. package/dist/assets/I18n/locales/fr.d.ts +56 -0
  3. package/dist/components/Autocomplete/Autocomplete/AutocompleteTag/index.d.ts +1 -1
  4. package/dist/components/Autocomplete/Autocomplete/types.d.ts +3 -0
  5. package/dist/components/DocumentComposer/Treeview/CustomTreeItem.d.ts +1 -0
  6. package/dist/components/DocumentComposer/Treeview/SkeletonTreeItem.d.ts +3 -0
  7. package/dist/components/DocumentComposer/Treeview/TreeviewSkeleton.d.ts +2 -0
  8. package/dist/components/DocumentComposer/Treeview/slots/LabelInputSlot.d.ts +1 -0
  9. package/dist/components/DocumentComposer/Treeview/slots/LabelSlot.d.ts +2 -1
  10. package/dist/components/DocumentComposer/Treeview/types.d.ts +5 -0
  11. package/dist/components/DocumentComposer/hooks/useTemporarySection.d.ts +2 -2
  12. package/dist/components/DocumentComposer/index.d.ts +7 -8
  13. package/dist/components/RichTextEditor/components/AlignmentSplitButton.d.ts +10 -0
  14. package/dist/components/RichTextEditor/components/EditorToolbarButton.d.ts +7 -0
  15. package/dist/components/RichTextEditor/components/FontColorButton.d.ts +5 -0
  16. package/dist/components/RichTextEditor/components/ImageButton.d.ts +7 -0
  17. package/dist/components/RichTextEditor/components/ImageResizeObserver.d.ts +2 -0
  18. package/dist/components/RichTextEditor/components/LinkButton.d.ts +8 -0
  19. package/dist/components/RichTextEditor/components/SplitButton.d.ts +16 -0
  20. package/dist/components/RichTextEditor/components/TableBubbleMenu.d.ts +2 -0
  21. package/dist/components/RichTextEditor/components/Toolbar.d.ts +22 -0
  22. package/dist/components/RichTextEditor/extensions/TableWithAlignment.d.ts +1 -0
  23. package/dist/components/RichTextEditor/index.d.ts +18 -0
  24. package/dist/components/RichTextEditor/styles.d.ts +1 -0
  25. package/dist/index.d.ts +1 -0
  26. package/dist/index.js +5 -5
  27. package/package.json +45 -10
  28. package/dist/components/AnchoredPopper/index.d.ts +0 -14
  29. package/dist/components/Autocomplete/Autocomplete/example-usage.d.ts +0 -4
  30. package/dist/components/DataGrid/components/toolbar/buttons/AddButton.d.ts +0 -6
  31. package/dist/components/DataGrid/components/toolbar/buttons/ExportButton.d.ts +0 -9
  32. package/dist/components/DataGrid/types/index.d.ts +0 -428
  33. package/dist/components/DocumentComposer/hooks/useDragVisualFeedback.d.ts +0 -15
  34. package/dist/components/DocumentComposer/types/props.d.ts +0 -67
  35. package/dist/components/DocumentComposer/types/section.d.ts +0 -33
  36. package/dist/components/DocumentComposer/types.d.ts +0 -56
  37. package/dist/components/Export/index.d.ts +0 -3
  38. package/dist/components/Export/style/index.d.ts +0 -9
  39. package/dist/components/Export/types/index.d.ts +0 -30
@@ -5,6 +5,62 @@ declare const _default: {
5
5
  autocomplete: {
6
6
  createOption: string;
7
7
  };
8
+ richTextEditor: {
9
+ toolbar: {
10
+ bold: string;
11
+ italic: string;
12
+ strikethrough: string;
13
+ underline: string;
14
+ alignleft: string;
15
+ aligncenter: string;
16
+ alignright: string;
17
+ alignjustify: string;
18
+ blockquote: string;
19
+ numberedlist: string;
20
+ bulletlist: string;
21
+ indent: string;
22
+ outdent: string;
23
+ subscript: string;
24
+ superscript: string;
25
+ table: string;
26
+ image: string;
27
+ link: string;
28
+ fontcolor: string;
29
+ undo: string;
30
+ redo: string;
31
+ more: string;
32
+ alignment: string;
33
+ clearformatting: string;
34
+ };
35
+ image: {
36
+ fromComputer: string;
37
+ fromUrl: string;
38
+ browse: string;
39
+ insert: string;
40
+ };
41
+ table: {
42
+ addRowBefore: string;
43
+ addRowAfter: string;
44
+ deleteRow: string;
45
+ addColumnBefore: string;
46
+ addColumnAfter: string;
47
+ deleteColumn: string;
48
+ deleteTable: string;
49
+ mergeCells: string;
50
+ splitCell: string;
51
+ toggleHeaderRow: string;
52
+ toggleHeaderColumn: string;
53
+ toggleHeaderCell: string;
54
+ alignLeft: string;
55
+ alignCenter: string;
56
+ alignRight: string;
57
+ };
58
+ link: {
59
+ update: string;
60
+ add: string;
61
+ remove: string;
62
+ };
63
+ };
8
64
  common: {
9
65
  addRow: string;
10
66
  cancel: string;
@@ -5,6 +5,62 @@ declare const _default: {
5
5
  autocomplete: {
6
6
  createOption: string;
7
7
  };
8
+ richTextEditor: {
9
+ toolbar: {
10
+ bold: string;
11
+ italic: string;
12
+ strikethrough: string;
13
+ underline: string;
14
+ alignleft: string;
15
+ aligncenter: string;
16
+ alignright: string;
17
+ alignjustify: string;
18
+ blockquote: string;
19
+ numberedlist: string;
20
+ bulletlist: string;
21
+ indent: string;
22
+ outdent: string;
23
+ subscript: string;
24
+ superscript: string;
25
+ table: string;
26
+ image: string;
27
+ link: string;
28
+ fontcolor: string;
29
+ undo: string;
30
+ redo: string;
31
+ more: string;
32
+ alignment: string;
33
+ clearformatting: string;
34
+ };
35
+ image: {
36
+ fromComputer: string;
37
+ fromUrl: string;
38
+ browse: string;
39
+ insert: string;
40
+ };
41
+ table: {
42
+ addRowBefore: string;
43
+ addRowAfter: string;
44
+ deleteRow: string;
45
+ addColumnBefore: string;
46
+ addColumnAfter: string;
47
+ deleteColumn: string;
48
+ deleteTable: string;
49
+ mergeCells: string;
50
+ splitCell: string;
51
+ toggleHeaderRow: string;
52
+ toggleHeaderColumn: string;
53
+ toggleHeaderCell: string;
54
+ alignLeft: string;
55
+ alignCenter: string;
56
+ alignRight: string;
57
+ };
58
+ link: {
59
+ update: string;
60
+ add: string;
61
+ remove: string;
62
+ };
63
+ };
8
64
  common: {
9
65
  addRow: string;
10
66
  cancel: string;
@@ -5,7 +5,7 @@ export type AutocompleteTagProps = ChipProps & {
5
5
  option?: OptionType;
6
6
  maxChipWidth?: number;
7
7
  reserveForCounter?: number;
8
- isDisabled?: boolean;
8
+ disabled?: boolean;
9
9
  };
10
10
  declare const AutocompleteTag: React.FC<AutocompleteTagProps>;
11
11
  export default AutocompleteTag;
@@ -24,6 +24,9 @@ export type AutocompleteBaseProps<T = OptionType> = {
24
24
  selectAllHidden?: boolean;
25
25
  selectAllLabel?: string;
26
26
  allSelectedLabel?: string;
27
+ /**
28
+ * @deprecated Use disabled instead
29
+ */
27
30
  isDisabled?: boolean;
28
31
  expandSelectedTagsOnEdition?: false;
29
32
  InputProps?: StandardInputProps;
@@ -3,6 +3,7 @@ import type { TreeviewProps } from './types';
3
3
  type TreeItemCallbacks<T extends Record<string, unknown>> = Pick<TreeviewProps<T>, 'isSectionItem' | 'isVisibleItem' | 'getIconItem' | 'hasItemMenu' | 'getMenuItems' | 'isSectionDraggable' | 'onItemVisibilityChange' | 'temporaryItem' | 'isTemporaryItem' | 'onTemporarySectionValidation' | 'onTemporarySectionCancel' | 'onItemLabelChange' | 'hiddenSectionTooltip' | 'visibleIconTooltip' | 'hiddenIconTooltip'> & {
4
4
  apiRef: RichTreeViewProApiRef;
5
5
  onEditingChange?: (itemId: string | null) => void;
6
+ onLabelClick?: (itemId: string) => void;
6
7
  };
7
8
  type CustomTreeItemProps<T extends Record<string, unknown>> = TreeItemProps & TreeItemCallbacks<T>;
8
9
  export declare const CustomTreeItem: <T extends Record<string, unknown>>(props: CustomTreeItemProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import type { TreeItemProps } from '@mui/x-tree-view-pro';
2
+ declare const SkeletonTreeItem: ({ itemId, children, ...rest }: TreeItemProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default SkeletonTreeItem;
@@ -0,0 +1,2 @@
1
+ declare const TreeviewSkeleton: () => import("react/jsx-runtime").JSX.Element;
2
+ export default TreeviewSkeleton;
@@ -6,6 +6,7 @@ declare const LabelInputSlot: import("react").ForwardRefExoticComponent<InputHTM
6
6
  isEditing?: boolean;
7
7
  onTemporarySectionValidation?: (label: string) => void;
8
8
  onTemporarySectionCancel?: () => void;
9
+ onItemLabelChange?: (itemId: string, newLabel: string) => void;
9
10
  apiRef?: RichTreeViewProApiRef;
10
11
  onEditingEnd?: () => void;
11
12
  } & import("react").RefAttributes<HTMLInputElement>>;
@@ -10,9 +10,10 @@ type LabelSlotProps = {
10
10
  menuAnchorEl?: HTMLElement | null;
11
11
  onMenuClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
12
12
  onItemVisibilityChange?: (itemId: string, visible: boolean) => void;
13
+ onLabelClick?: (itemId: string) => void;
13
14
  hiddenSectionTooltip?: string;
14
15
  visibleIconTooltip?: string;
15
16
  hiddenIconTooltip?: string;
16
17
  };
17
- declare const _default: import("react").MemoExoticComponent<({ children, sx, customIcon, hasMenu, itemId, isVisible, isTemporary, menuAnchorEl, onItemVisibilityChange, onMenuClick, hiddenSectionTooltip, visibleIconTooltip, hiddenIconTooltip, ...rest }: LabelSlotProps) => import("react/jsx-runtime").JSX.Element>;
18
+ declare const _default: import("react").MemoExoticComponent<({ children, sx, customIcon, hasMenu, itemId, isVisible, isTemporary, menuAnchorEl, onItemVisibilityChange, onMenuClick, onLabelClick, hiddenSectionTooltip, visibleIconTooltip, hiddenIconTooltip, ...rest }: LabelSlotProps) => import("react/jsx-runtime").JSX.Element>;
18
19
  export default _default;
@@ -47,4 +47,9 @@ export type TreeviewItemProps<T> = {
47
47
  label?: React.ReactNode;
48
48
  children?: React.ReactNode;
49
49
  } & CustomTreeviewItemProps<T>;
50
+ export type SkeletonItem = {
51
+ id: string;
52
+ label: string;
53
+ children?: SkeletonItem[];
54
+ };
50
55
  export {};
@@ -9,7 +9,7 @@ type UseTemporarySectionParams = {
9
9
  apiRef: RichTreeViewProApiRef;
10
10
  getSectionById: (sectionId: string) => DocumentSection | null;
11
11
  onSectionCreate?: (parentId: string | null, title: string) => string | Promise<string>;
12
- scrollToBottom?: () => void;
12
+ treeviewWrapperRef?: React.RefObject<HTMLDivElement | null>;
13
13
  };
14
14
  /**
15
15
  * Flow:
@@ -21,7 +21,7 @@ type UseTemporarySectionParams = {
21
21
  * 4. User presses Escape or leaves empty → `cancel()` is called
22
22
  * 5. Server responds → temporary section is cleared, real section replaces it
23
23
  */
24
- export declare const useTemporarySection: ({ apiRef, getSectionById, onSectionCreate, scrollToBottom }: UseTemporarySectionParams) => {
24
+ export declare const useTemporarySection: ({ apiRef, getSectionById, onSectionCreate, treeviewWrapperRef }: UseTemporarySectionParams) => {
25
25
  temporarySection: TemporarySection | null;
26
26
  create: (parentId?: string | null) => void;
27
27
  validate: (title: string) => void;
@@ -41,6 +41,12 @@ export type DocumentComposerCustomProps = {
41
41
  getSectionDeletePermission?: (section: DocumentSection) => boolean;
42
42
  /** Defaults to `() => true` */
43
43
  getSectionOrderChangePermission?: (section: DocumentSection) => boolean;
44
+ /**
45
+ * Called during drag to validate if the move to a new position is allowed.
46
+ * Use this for custom drop target restrictions (e.g., prevent dropping into archive sections).
47
+ * Defaults to `() => true`.
48
+ */
49
+ canMoveSectionToNewPosition?: (params: ItemPositionParams) => boolean;
44
50
  /** Defaults to `() => true` */
45
51
  getSectionCreatePermission?: (section: DocumentSection) => boolean;
46
52
  /** Defaults to `() => true` */
@@ -50,13 +56,6 @@ export type DocumentComposerCustomProps = {
50
56
  hiddenIconTooltip?: string;
51
57
  /** Return null for no icon */
52
58
  renderSectionIcon?: (section: DocumentSection) => ReactNode;
53
- /**
54
- * Determines valid drop targets during drag. Invalid targets are greyed out.
55
- * `targetSection` is `null` when dropping at root level.
56
- * `newIndex` is the position where the item would be inserted in the target's children.
57
- * Defaults to `() => true`.
58
- */
59
- isValidDropTarget?: (draggedSection: DocumentSection, targetSection: DocumentSection | null, newIndex: number) => boolean;
60
59
  sectionContent?: SectionContent;
61
60
  isLoadingSectionContent?: boolean;
62
61
  selectedSectionId?: string | null;
@@ -68,5 +67,5 @@ export type DocumentComposerCustomProps = {
68
67
  type DocumentComposerProps = {
69
68
  sections?: DocumentSection[];
70
69
  } & DocumentComposerCallbacks & DocumentComposerCustomProps;
71
- declare const DocumentComposer: ({ sections, isLoadingSections, onSectionOrderChange, onSectionTitleChange, onSectionDelete, onSectionVisibilityChange, onSectionCreate, onSectionSelect, onSectionContentSave, noSectionsPlaceholder, getSectionTitleChangePermission, getSectionDeletePermission, getSectionOrderChangePermission, getSectionCreatePermission, getSectionVisibilityChangePermission, hiddenSectionTooltip, visibleIconTooltip, hiddenIconTooltip, renderSectionIcon, isValidDropTarget, sectionContent, isLoadingSectionContent, selectedSectionId, renderDeleteConfirmation, renderUnsavedChangesConfirmation }: DocumentComposerProps) => import("react/jsx-runtime").JSX.Element;
70
+ declare const DocumentComposer: ({ sections, isLoadingSections, onSectionOrderChange, onSectionTitleChange, onSectionDelete, onSectionVisibilityChange, onSectionCreate, onSectionSelect, onSectionContentSave, noSectionsPlaceholder, getSectionTitleChangePermission, getSectionDeletePermission, getSectionOrderChangePermission, canMoveSectionToNewPosition, getSectionCreatePermission, getSectionVisibilityChangePermission, hiddenSectionTooltip, visibleIconTooltip, hiddenIconTooltip, renderSectionIcon, sectionContent, isLoadingSectionContent, selectedSectionId, renderDeleteConfirmation, renderUnsavedChangesConfirmation }: DocumentComposerProps) => import("react/jsx-runtime").JSX.Element;
72
71
  export default DocumentComposer;
@@ -0,0 +1,10 @@
1
+ type Alignment = 'left' | 'center' | 'right' | 'justify';
2
+ type AlignmentSplitButtonProps = {
3
+ activeAlignment?: Alignment;
4
+ onSelect?: (alignment: Alignment) => void;
5
+ options?: Alignment[];
6
+ disabled?: boolean;
7
+ };
8
+ declare const AlignmentSplitButton: ({ activeAlignment, onSelect, options, disabled }: AlignmentSplitButtonProps) => import("react/jsx-runtime").JSX.Element | null;
9
+ export default AlignmentSplitButton;
10
+ export type { Alignment };
@@ -0,0 +1,7 @@
1
+ import { type IconButtonProps } from '@mui/material';
2
+ type Props = IconButtonProps & {
3
+ active?: boolean;
4
+ tooltipText?: string | null;
5
+ };
6
+ declare const EditorToolbarButton: ({ active, tooltipText, children, sx, ...otherProps }: Props) => import("react/jsx-runtime").JSX.Element | undefined;
7
+ export default EditorToolbarButton;
@@ -0,0 +1,5 @@
1
+ type Props = {
2
+ disabled?: boolean;
3
+ };
4
+ declare const FontColorButton: ({ disabled }: Props) => import("react/jsx-runtime").JSX.Element | null;
5
+ export default FontColorButton;
@@ -0,0 +1,7 @@
1
+ type Props = {
2
+ externalAnchorEl?: HTMLElement | null;
3
+ onExternalClose?: () => void;
4
+ disabled?: boolean;
5
+ };
6
+ declare const ImageButton: ({ externalAnchorEl, onExternalClose, disabled }?: Props) => import("react/jsx-runtime").JSX.Element | null;
7
+ export default ImageButton;
@@ -0,0 +1,2 @@
1
+ declare const ImageResizeObserver: () => import("react/jsx-runtime").JSX.Element | null;
2
+ export default ImageResizeObserver;
@@ -0,0 +1,8 @@
1
+ type Props = {
2
+ active?: boolean;
3
+ externalAnchorEl?: HTMLElement | null;
4
+ onExternalClose?: () => void;
5
+ disabled?: boolean;
6
+ };
7
+ declare const LinkButton: ({ active, externalAnchorEl, onExternalClose, disabled }: Props) => import("react/jsx-runtime").JSX.Element | null;
8
+ export default LinkButton;
@@ -0,0 +1,16 @@
1
+ type SplitButtonOption = {
2
+ value: string;
3
+ icon: React.ReactNode;
4
+ label: string;
5
+ };
6
+ type SplitButtonProps = {
7
+ options: SplitButtonOption[];
8
+ onSelect: (value: string) => void;
9
+ defaultValue?: string;
10
+ value?: string;
11
+ ariaLabel?: string;
12
+ disabled?: boolean;
13
+ };
14
+ declare const SplitButton: ({ options, onSelect, defaultValue, value, ariaLabel, disabled }: SplitButtonProps) => import("react/jsx-runtime").JSX.Element | null;
15
+ export default SplitButton;
16
+ export type { SplitButtonOption };
@@ -0,0 +1,2 @@
1
+ declare const TableBubbleMenu: () => import("react/jsx-runtime").JSX.Element | null;
2
+ export default TableBubbleMenu;
@@ -0,0 +1,22 @@
1
+ import type { Editor } from '@tiptap/react';
2
+ import { type ReactNode } from 'react';
3
+ export type BuiltInButtonId = '-' | 'bold' | 'italic' | 'strikethrough' | 'underline' | 'fontColor' | 'subscript' | 'superscript' | 'alignment' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'orderedList' | 'bulletList' | 'indent' | 'outdent' | 'blockquote' | 'link' | 'image' | 'table' | 'undo' | 'redo' | 'clearFormatting';
4
+ export type CustomToolbarButton = {
5
+ id: string;
6
+ icon: ReactNode;
7
+ onClick: (editor: Editor) => void;
8
+ isActive?: (editor: Editor) => boolean;
9
+ isDisabled?: (editor: Editor) => boolean;
10
+ ariaLabel?: string;
11
+ tooltipText?: string;
12
+ };
13
+ export type ToolbarButton = BuiltInButtonId | CustomToolbarButton | ReactNode;
14
+ export type ToolbarProps = {
15
+ buttons?: ToolbarButton[];
16
+ extraButtons?: ToolbarButton[];
17
+ overflowMenu?: boolean;
18
+ disabled?: boolean;
19
+ };
20
+ export declare const defaultButtonsCompleteSet: BuiltInButtonId[];
21
+ declare const Toolbar: ({ buttons, extraButtons, overflowMenu, disabled }: ToolbarProps) => import("react/jsx-runtime").JSX.Element | null;
22
+ export default Toolbar;
@@ -0,0 +1 @@
1
+ export declare const TableWithAlignment: import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any>;
@@ -0,0 +1,18 @@
1
+ import { type Editor } from '@tiptap/react';
2
+ import { type ToolbarButton, type BuiltInButtonId, type CustomToolbarButton, type ToolbarProps } from './components/Toolbar';
3
+ export type RichTextEditorRef = {
4
+ editor: Editor | null;
5
+ };
6
+ declare const RichTextEditor: import("react").ForwardRefExoticComponent<Partial<import("@tiptap/core").EditorOptions> & {
7
+ immediatelyRender?: boolean;
8
+ shouldRerenderOnTransaction?: boolean;
9
+ } & {
10
+ toolbarSet?: "all" | "minimal";
11
+ placeholder?: string;
12
+ readOnly?: boolean;
13
+ slotProps?: {
14
+ toolbar?: ToolbarProps;
15
+ };
16
+ } & import("react").RefAttributes<RichTextEditorRef>>;
17
+ export default RichTextEditor;
18
+ export type { ToolbarButton, BuiltInButtonId, CustomToolbarButton };
@@ -0,0 +1 @@
1
+ export declare const EditorContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
package/dist/index.d.ts CHANGED
@@ -25,3 +25,4 @@ export { exportData } from './components/VirtualTable/helpers/file';
25
25
  export { useDataManager } from './components/VirtualTable/hooks';
26
26
  export { ROW_TYPE } from './components/VirtualTable/utils';
27
27
  export * from './helpers';
28
+ export * from './locale';