@myunisoft/design-system 1.3.2 → 1.3.4-autocomplete

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 (27) hide show
  1. package/dist/assets/I18n/locales/en.d.ts +5 -0
  2. package/dist/assets/I18n/locales/fr.d.ts +5 -0
  3. package/dist/components/Autocomplete/Autocomplete/AutocompleteTag/index.d.ts +1 -1
  4. package/dist/components/Autocomplete/Autocomplete/types.d.ts +0 -1
  5. package/dist/components/DocumentComposer/Treeview/hooks/useExpandOnDragHover.d.ts +6 -0
  6. package/dist/components/DocumentComposer/Treeview/slots/IconContainerSlot.d.ts +2 -3
  7. package/dist/components/DocumentComposer/Treeview/slots/LabelInputSlot.d.ts +2 -2
  8. package/dist/components/DocumentComposer/Treeview/slots/LabelSlot.d.ts +2 -4
  9. package/dist/components/DocumentComposer/Treeview/slots/index.d.ts +6 -3
  10. package/dist/components/DocumentComposer/constants.d.ts +1 -0
  11. package/dist/components/DocumentComposer/index.d.ts +67 -2
  12. package/dist/components/DocumentComposer/types/index.d.ts +33 -2
  13. package/dist/index.d.ts +2 -3
  14. package/dist/index.js +5 -5
  15. package/package.json +115 -115
  16. package/dist/components/AnchoredPopper/index.d.ts +0 -14
  17. package/dist/components/Autocomplete/Autocomplete/example-usage.d.ts +0 -4
  18. package/dist/components/DataGrid/components/toolbar/buttons/AddButton.d.ts +0 -6
  19. package/dist/components/DataGrid/components/toolbar/buttons/ExportButton.d.ts +0 -9
  20. package/dist/components/DataGrid/types/index.d.ts +0 -428
  21. package/dist/components/DocumentComposer/hooks/useDragVisualFeedback.d.ts +0 -15
  22. package/dist/components/DocumentComposer/types/props.d.ts +0 -69
  23. package/dist/components/DocumentComposer/types/section.d.ts +0 -33
  24. package/dist/components/DocumentComposer/types.d.ts +0 -56
  25. package/dist/components/Export/index.d.ts +0 -3
  26. package/dist/components/Export/style/index.d.ts +0 -9
  27. package/dist/components/Export/types/index.d.ts +0 -30
@@ -50,6 +50,11 @@ declare const _default: {
50
50
  cancel: string;
51
51
  quitWithoutSaving: string;
52
52
  };
53
+ sectionMenu: {
54
+ rename: string;
55
+ delete: string;
56
+ createSubsection: string;
57
+ };
53
58
  };
54
59
  dashboard: {
55
60
  ba: {
@@ -50,6 +50,11 @@ declare const _default: {
50
50
  cancel: string;
51
51
  quitWithoutSaving: string;
52
52
  };
53
+ sectionMenu: {
54
+ rename: string;
55
+ delete: string;
56
+ createSubsection: string;
57
+ };
53
58
  };
54
59
  dashboard: {
55
60
  ba: {
@@ -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,7 +24,6 @@ export type AutocompleteBaseProps<T = OptionType> = {
24
24
  selectAllHidden?: boolean;
25
25
  selectAllLabel?: string;
26
26
  allSelectedLabel?: string;
27
- isDisabled?: boolean;
28
27
  expandSelectedTagsOnEdition?: false;
29
28
  InputProps?: StandardInputProps;
30
29
  onIsSearchingChange?: (isOpen: boolean) => void;
@@ -0,0 +1,6 @@
1
+ type UseExpandOnDragHoverParams = {
2
+ expandedItems: string[];
3
+ onExpand: (itemId: string) => void;
4
+ };
5
+ export declare const useExpandOnDragHover: ({ expandedItems, onExpand }: UseExpandOnDragHoverParams) => void;
6
+ export {};
@@ -1,10 +1,9 @@
1
1
  import type { SxProps, Theme } from '@mui/material';
2
2
  type IconContainerSlotProps = {
3
- ownerState?: unknown;
4
3
  children?: React.ReactNode;
5
4
  sx?: SxProps<Theme>;
6
5
  isDraggable?: boolean;
7
6
  isVisible?: boolean;
8
7
  };
9
- export declare const IconContainerSlot: import("react").MemoExoticComponent<(props: IconContainerSlotProps) => import("react/jsx-runtime").JSX.Element>;
10
- export {};
8
+ declare const _default: import("react").MemoExoticComponent<({ children, sx, isDraggable, isVisible, ...rest }: IconContainerSlotProps) => import("react/jsx-runtime").JSX.Element>;
9
+ export default _default;
@@ -1,12 +1,12 @@
1
1
  import type { InputHTMLAttributes } from 'react';
2
2
  import type { RichTreeViewProApiRef } from '@mui/x-tree-view-pro';
3
- export declare const LabelInputSlot: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
3
+ declare const LabelInputSlot: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
4
4
  ownerState?: unknown;
5
5
  itemId?: string;
6
6
  isEditing?: boolean;
7
7
  onTemporarySectionValidation?: (label: string) => void;
8
8
  onTemporarySectionCancel?: () => void;
9
- onItemLabelChange?: (itemId: string, newLabel: string) => void;
10
9
  apiRef?: RichTreeViewProApiRef;
11
10
  onEditingEnd?: () => void;
12
11
  } & import("react").RefAttributes<HTMLInputElement>>;
12
+ export default LabelInputSlot;
@@ -1,7 +1,5 @@
1
1
  import type { SxProps, Theme } from '@mui/material';
2
2
  type LabelSlotProps = {
3
- ownerState?: unknown;
4
- editable?: unknown;
5
3
  children?: React.ReactNode;
6
4
  sx?: SxProps<Theme>;
7
5
  customIcon?: React.ReactNode;
@@ -16,5 +14,5 @@ type LabelSlotProps = {
16
14
  visibleIconTooltip?: string;
17
15
  hiddenIconTooltip?: string;
18
16
  };
19
- export declare const LabelSlot: import("react").MemoExoticComponent<(props: LabelSlotProps) => import("react/jsx-runtime").JSX.Element>;
20
- export {};
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
+ export default _default;
@@ -1,3 +1,6 @@
1
- export { IconContainerSlot } from './IconContainerSlot';
2
- export { LabelInputSlot } from './LabelInputSlot';
3
- export { LabelSlot } from './LabelSlot';
1
+ import IconContainerSlot from './IconContainerSlot';
2
+ import LabelInputSlot from './LabelInputSlot';
3
+ import LabelSlot from './LabelSlot';
4
+ export { IconContainerSlot };
5
+ export { LabelInputSlot };
6
+ export { LabelSlot };
@@ -0,0 +1 @@
1
+ export declare const MUI_TREE_ITEM_ID_PATTERN: RegExp;
@@ -1,6 +1,71 @@
1
- import type { DocumentComposerCallbacks, DocumentComposerCustomProps, DocumentSection } from './types';
1
+ import { type ReactNode } from 'react';
2
+ import type { ItemPositionParams } from './Treeview/types';
3
+ import type { DocumentSection, SectionContent } from './types';
4
+ export type DeleteConfirmationRenderProps = {
5
+ isOpen: boolean;
6
+ onConfirm: () => void;
7
+ onCancel: () => void;
8
+ };
9
+ export type UnsavedChangesRenderProps = {
10
+ isOpen: boolean;
11
+ isSaving: boolean;
12
+ /** True if onSectionContentSave is provided */
13
+ canSave: boolean;
14
+ onSaveAndQuit: () => void;
15
+ onQuitWithoutSaving: () => void;
16
+ onCancel: () => void;
17
+ };
18
+ export type DocumentComposerLabels = {
19
+ createSection?: string;
20
+ rename?: string;
21
+ delete?: string;
22
+ createSubsection?: string;
23
+ hiddenItemTooltip?: string;
24
+ };
25
+ export type DocumentComposerCallbacks = {
26
+ onSectionOrderChange?: (params: ItemPositionParams) => void;
27
+ onSectionTitleChange?: (sectionId: string, newTitle: string) => void;
28
+ onSectionDelete?: (sectionId: string) => void;
29
+ onSectionVisibilityChange?: (sectionId: string, visible: boolean) => void;
30
+ onSectionCreate?: (parentId: string | null, title: string) => string | Promise<string>;
31
+ onSectionSelect?: (sectionId: string | null) => void;
32
+ /** Used by unsaved changes modal "Save and quit" action */
33
+ onSectionContentSave?: () => Promise<void>;
34
+ };
35
+ export type DocumentComposerCustomProps = {
36
+ noSectionsPlaceholder?: string | ReactNode;
37
+ isLoadingSections?: boolean;
38
+ /** Defaults to `() => true` */
39
+ getSectionTitleChangePermission?: (section: DocumentSection) => boolean;
40
+ /** Defaults to `() => true` */
41
+ getSectionDeletePermission?: (section: DocumentSection) => boolean;
42
+ /** Defaults to `() => true` */
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;
50
+ /** Defaults to `() => true` */
51
+ getSectionCreatePermission?: (section: DocumentSection) => boolean;
52
+ /** Defaults to `() => true` */
53
+ getSectionVisibilityChangePermission?: (section: DocumentSection) => boolean;
54
+ hiddenSectionTooltip?: string;
55
+ visibleIconTooltip?: string;
56
+ hiddenIconTooltip?: string;
57
+ /** Return null for no icon */
58
+ renderSectionIcon?: (section: DocumentSection) => ReactNode;
59
+ sectionContent?: SectionContent;
60
+ isLoadingSectionContent?: boolean;
61
+ selectedSectionId?: string | null;
62
+ /** If not provided, deletion proceeds without confirmation */
63
+ renderDeleteConfirmation?: (props: DeleteConfirmationRenderProps) => ReactNode;
64
+ /** If not provided, navigation proceeds without confirmation (discards changes) */
65
+ renderUnsavedChangesConfirmation?: (props: UnsavedChangesRenderProps) => ReactNode;
66
+ };
2
67
  type DocumentComposerProps = {
3
68
  sections?: DocumentSection[];
4
69
  } & DocumentComposerCallbacks & DocumentComposerCustomProps;
5
- 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;
6
71
  export default DocumentComposer;
@@ -1,2 +1,33 @@
1
- export * from './props';
2
- export * from './section';
1
+ export declare const CellFormat: {
2
+ readonly TEXT: "text";
3
+ readonly AMOUNT: "amount";
4
+ };
5
+ export type CellFormat = (typeof CellFormat)[keyof typeof CellFormat];
6
+ export type TableCell = {
7
+ value: string;
8
+ editable: boolean;
9
+ format: CellFormat;
10
+ };
11
+ export type TableRow = TableCell[];
12
+ export type TableValue = {
13
+ id: string;
14
+ headers: TableRow[];
15
+ rows: TableRow[];
16
+ footers: TableRow[];
17
+ };
18
+ export type TableContentBlock = {
19
+ type: 'table';
20
+ value: TableValue;
21
+ };
22
+ /** Extend this union as new content block types are added */
23
+ export type ContentBlock = TableContentBlock;
24
+ export type SectionContent = ContentBlock[];
25
+ export type DocumentSection = {
26
+ id: string;
27
+ title: string;
28
+ visible: boolean;
29
+ parentId: string | null;
30
+ type?: string;
31
+ hasTables?: boolean;
32
+ sections?: DocumentSection[] | null;
33
+ };
package/dist/index.d.ts CHANGED
@@ -7,13 +7,11 @@ 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';
11
- export type { CellFormat, ContentBlock, DeleteConfirmationRenderProps, SectionContent, TableCell, TableContentBlock, TableRow, TableValue, UnsavedChangesRenderProps } from './components/DocumentComposer/types';
12
- export { CellFormat as CellFormatEnum } from './components/DocumentComposer/types';
13
10
  export * from './components/basics/Icon/';
14
11
  export * from './components/basics/Icon/Icons-material';
15
12
  export { default as Snackbar } from './components/basics/Snackbar';
16
13
  export { default as DataGridDS } from './components/DataGrid';
14
+ export { default as DocumentComposer } from './components/DocumentComposer';
17
15
  export { default as DraggableList } from './components/DraggableList';
18
16
  export { default as FileDropper } from './components/FileDropper';
19
17
  export { default as Modal } from './components/Modal';
@@ -27,3 +25,4 @@ export { exportData } from './components/VirtualTable/helpers/file';
27
25
  export { useDataManager } from './components/VirtualTable/hooks';
28
26
  export { ROW_TYPE } from './components/VirtualTable/utils';
29
27
  export * from './helpers';
28
+ export * from './locale';