@inceptionbg/iui 2.0.7 → 2.0.10
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/NoAccessPage-DBq5IzIf.js +2 -0
- package/dist/{NoAccessPage-BozT_Suz.js.map → NoAccessPage-DBq5IzIf.js.map} +1 -1
- package/dist/NotFoundPage-DM-I96ar.js +2 -0
- package/dist/{NotFoundPage-WWiekDef.js.map → NotFoundPage-DM-I96ar.js.map} +1 -1
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +286 -259
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/iui.css +1 -1
- package/idea/GridTable/GridTable.tsx +119 -0
- package/idea/GridTable/gridTable.scss +42 -0
- package/{src/components → idea}/Table/Components/Print/CustomTablePrint.tsx +2 -2
- package/{src/components → idea}/Table/Components/Print/TablePrint.tsx +2 -2
- package/{src/components → idea}/Table/Components/SetTableFilter.tsx +1 -1
- package/{src/components → idea}/Table/Components/TableOptions.tsx +4 -4
- package/idea/{Table2 → Table}/Table.tsx +151 -281
- package/idea/Table/hooks/useDefaultTemplate.ts +20 -0
- package/{src/components → idea}/Table/hooks/useTableKeyboard.ts +1 -2
- package/idea/Table/hooks/useTableSelect.ts +11 -0
- package/package.json +3 -2
- package/src/assets/icons/index.ts +1 -1
- package/src/assets/icons/light/faClipboardCheck.ts +15 -0
- package/src/assets/icons/light/faHouse.ts +15 -15
- package/src/assets/icons/light/faIdBadge.ts +15 -15
- package/src/assets/icons/light/faPen.ts +15 -0
- package/src/components/Button/IconButton.tsx +3 -1
- package/src/components/Dialog/Dialog.tsx +60 -124
- package/src/components/Dialog/components/DialogFooter.tsx +92 -0
- package/src/components/Dialog/hooks/useDialogKeyboard.ts +6 -5
- package/src/components/Header/Components/ModuleSelect.tsx +1 -1
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/Inputs/DateInput/DateInput.tsx +108 -101
- package/src/components/Inputs/DateInput/components/DatePartInput.tsx +7 -3
- package/src/components/Inputs/InputWrapper.tsx +6 -1
- package/src/components/Inputs/SearchInput.tsx +9 -4
- package/src/components/Inputs/Select2/Select.tsx +65 -30
- package/src/components/Inputs/Select2/select.scss +13 -14
- package/src/components/Inputs/Selects/components/SelectWrapper.tsx +4 -2
- package/src/components/Inputs/Selects/utils/selectStyles.ts +9 -12
- package/src/components/Menu/Menu.tsx +10 -2
- package/src/components/Menu/MenuItem.tsx +11 -10
- package/src/components/Menu/hooks/useMenuPosition.tsx +23 -6
- package/src/components/Pullover/Pullover.tsx +122 -59
- package/src/components/Table/Table.tsx +78 -342
- package/src/components/Table/components/edit/TableEditRow.tsx +69 -0
- package/src/components/Table/components/filters/FilterItem.tsx +15 -0
- package/src/components/Table/components/filters/TableFilters.tsx +125 -0
- package/src/components/Table/components/footer/TableFooter.tsx +128 -0
- package/src/components/Table/components/header/TableHeader.tsx +42 -0
- package/src/components/Table/components/header/TableHeaderRow.tsx +47 -0
- package/src/components/Table/components/items/TableItemActions.tsx +66 -0
- package/src/components/Table/components/select/TableSelect.tsx +49 -0
- package/src/components/Table/components/sort/TableSort.tsx +52 -0
- package/src/components/Table/contexts/TableContext.tsx +123 -0
- package/src/components/Table/hooks/localHooks/useLocalTableColumns.tsx +73 -0
- package/src/components/Table/hooks/localHooks/useLocalTableData.tsx +78 -0
- package/src/components/Table/hooks/localHooks/useLocalTableKeyboard.ts +173 -0
- package/src/components/Table/hooks/localHooks/useLocalTablePagination.ts +12 -0
- package/src/components/Table/hooks/useTableEdit.tsx +111 -0
- package/src/components/Table/hooks/useTableFilterFields.tsx +150 -0
- package/src/components/Table/hooks/useTablePagination.ts +16 -0
- package/src/components/Table/hooks/useTableSearch.ts +29 -0
- package/src/components/Table/hooks/useTableSort.ts +8 -0
- package/src/components/Tooltip/Tooltip.tsx +1 -1
- package/src/components/Wrappers/PageLayout.tsx +13 -18
- package/src/hooks/useGetFocusableElements.ts +42 -0
- package/src/hooks/useLocalPopoverControl.ts +38 -0
- package/src/hooks/usePopupControl.ts +13 -0
- package/src/index.ts +53 -39
- package/src/styles/common/_typography.scss +3 -0
- package/src/styles/common/helpers/_size.scss +1 -1
- package/src/styles/components/_accordions.scss +1 -1
- package/src/styles/components/_badge.scss +4 -3
- package/src/styles/components/_card.scss +1 -1
- package/src/styles/components/_dialog.scss +15 -13
- package/src/styles/components/_input.scss +1 -1
- package/src/styles/components/_inputCheckbox.scss +1 -1
- package/src/styles/components/_inputDateTime.scss +2 -2
- package/src/styles/components/_inputRadio.scss +1 -1
- package/src/styles/components/_inputSelect.scss +6 -4
- package/src/styles/components/_menu-v2.scss +1 -1
- package/src/styles/components/_menu.scss +23 -15
- package/src/styles/components/_page.scss +3 -2
- package/src/styles/components/_pullover.scss +74 -18
- package/src/styles/components/_table.scss +151 -142
- package/src/styles/components/_widget.scss +1 -1
- package/src/styles/variables/_bp.scss +1 -0
- package/src/styles/variables/_variables.scss +4 -2
- package/src/types/IKeyboard.ts +2 -1
- package/src/types/IMenu.ts +1 -0
- package/src/types/ISelect.ts +1 -0
- package/src/types/ITable.ts +87 -80
- package/src/utils/fileUtils.ts +7 -6
- package/src/utils/i18n/i18nIUICyrilic.ts +4 -0
- package/src/utils/i18n/i18nIUILatin.ts +3 -1
- package/src/utils/i18n/i18nIUIMe.ts +4 -0
- package/src/utils/{ObjectUtils.ts → objectUtils.ts} +8 -8
- package/src/utils/popupUtils.ts +82 -0
- package/src/utils/{TableUtils.ts → tableUtils.ts} +5 -5
- package/src/utils/{Toasts.ts → toasts.ts} +6 -6
- package/src/utils/{UrlUtils.ts → urlUtils.ts} +4 -4
- package/dist/NoAccessPage-BozT_Suz.js +0 -2
- package/dist/NotFoundPage-WWiekDef.js +0 -2
- package/idea/Table2/Components/Columns/ColumnsList.tsx +0 -56
- package/idea/Table2/Components/Columns/SetColumnsList.tsx +0 -107
- package/idea/Table2/Components/Edit/ItemActionsMenu.tsx +0 -87
- package/idea/Table2/Components/Edit/ItemEditOptionsButtons.tsx +0 -32
- package/idea/Table2/Components/Edit/TableEditRow.tsx +0 -56
- package/idea/Table2/Components/FilterItem.tsx +0 -20
- package/idea/Table2/Components/Header/TableHeader.tsx +0 -35
- package/idea/Table2/Components/Header/TableHeaderRow.tsx +0 -37
- package/idea/Table2/Components/Print/CustomTablePrint.tsx +0 -119
- package/idea/Table2/Components/Print/TablePrint.tsx +0 -208
- package/idea/Table2/Components/SetSortList.tsx +0 -33
- package/idea/Table2/Components/SetTableFilter.tsx +0 -90
- package/idea/Table2/Components/TableFooter.tsx +0 -107
- package/idea/Table2/Components/TableOptions.tsx +0 -211
- package/idea/Table2/Components/Templates/TemplateCreate.tsx +0 -75
- package/idea/Table2/Components/Templates/TemplateCreateDefault.tsx +0 -45
- package/idea/Table2/Components/Templates/TemplateList.tsx +0 -167
- package/idea/Table2/Components/Templates/repo/TemplateRepo.ts +0 -51
- package/idea/Table2/_table.scss +0 -300
- package/idea/Table2/hooks/useDefaultTemplate.ts +0 -22
- package/idea/Table2/hooks/useTableKeyboard.ts +0 -115
- package/src/assets/icons/light/faPenField.ts +0 -15
- package/src/assets/icons/solid/faMagnifyingGlass.ts +0 -15
- package/src/components/Dialog/DeleteItemDialog.tsx +0 -52
- package/src/components/Dialog/hooks/useDialogObserver.ts +0 -21
- /package/{src/components → idea}/Table/Components/Columns/ColumnsList.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Columns/SetColumnsList.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Edit/ItemActionsMenu.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Edit/ItemEditOptionsButtons.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Edit/TableEditRow.tsx +0 -0
- /package/{src/components → idea}/Table/Components/FilterItem.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Header/TableHeader.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Header/TableHeaderRow.tsx +0 -0
- /package/{src/components → idea}/Table/Components/SetSortList.tsx +0 -0
- /package/{src/components → idea}/Table/Components/TableFooter.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Templates/TemplateCreate.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Templates/TemplateCreateDefault.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Templates/TemplateList.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Templates/repo/TemplateRepo.ts +0 -0
- /package/src/utils/{DateUtils.ts → dateUtils.ts} +0 -0
- /package/src/utils/{LocalStorageHelper.ts → localStorageHelper.ts} +0 -0
- /package/src/utils/{NumberUtils.ts → numberUtils.ts} +0 -0
- /package/src/utils/{RootDir.ts → rootDir.ts} +0 -0
- /package/src/utils/{StringUtils.ts → stringUtils.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import { FC, ReactNode, RefObject, useRef } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
|
-
import { rootDir } from '../../utils/
|
|
4
|
+
import { rootDir } from '../../utils/rootDir';
|
|
5
5
|
import { useMenuPosition } from './hooks/useMenuPosition';
|
|
6
6
|
import { useBackgroundClose } from '../../hooks/useBackgroundClose';
|
|
7
7
|
import { MenuItem } from './MenuItem';
|
|
@@ -55,7 +55,15 @@ export const Menu: FC<Props> = ({
|
|
|
55
55
|
style={menuStyle}
|
|
56
56
|
>
|
|
57
57
|
{items?.map(item => (
|
|
58
|
-
<MenuItem
|
|
58
|
+
<MenuItem
|
|
59
|
+
{...item}
|
|
60
|
+
key={item.label}
|
|
61
|
+
className={classNameItem}
|
|
62
|
+
onClick={e => {
|
|
63
|
+
item.onClick?.(e);
|
|
64
|
+
!item.keepOpen && onClose();
|
|
65
|
+
}}
|
|
66
|
+
/>
|
|
59
67
|
))}
|
|
60
68
|
{children}
|
|
61
69
|
</div>
|
|
@@ -13,26 +13,27 @@ export const MenuItem: FC<IMenuItem> = ({
|
|
|
13
13
|
onClick,
|
|
14
14
|
to,
|
|
15
15
|
badge,
|
|
16
|
+
active,
|
|
16
17
|
disabled,
|
|
17
18
|
hidden,
|
|
18
19
|
withDevider,
|
|
19
20
|
className,
|
|
20
21
|
}) =>
|
|
21
22
|
hidden ? null : (
|
|
22
|
-
<div
|
|
23
|
+
<div
|
|
24
|
+
className={clsx(className, {
|
|
25
|
+
'iui-menu-item': !className,
|
|
26
|
+
clickable: !!onClick || !!to,
|
|
27
|
+
disabled,
|
|
28
|
+
active,
|
|
29
|
+
'with-devider': withDevider,
|
|
30
|
+
})}
|
|
31
|
+
>
|
|
23
32
|
<ConditionalWrapper
|
|
24
33
|
condition={!disabled && !!to}
|
|
25
34
|
wrapper={children => <Link to={to!}>{children}</Link>}
|
|
26
35
|
>
|
|
27
|
-
<div
|
|
28
|
-
className={clsx(className, {
|
|
29
|
-
'iui-menu-item': !className,
|
|
30
|
-
clickable: !!onClick || !!to,
|
|
31
|
-
disabled,
|
|
32
|
-
'with-devider': withDevider,
|
|
33
|
-
})}
|
|
34
|
-
onClick={disabled ? undefined : onClick}
|
|
35
|
-
>
|
|
36
|
+
<div className="menu-item-content" onClick={disabled ? undefined : onClick}>
|
|
36
37
|
{icon && (
|
|
37
38
|
<div className="menu-item-icon">
|
|
38
39
|
<FontAwesomeIcon icon={icon} rotation={iconRotation} />
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { RefObject, useCallback,
|
|
1
|
+
import { RefObject, useCallback, useLayoutEffect, useState } from 'react';
|
|
2
2
|
import { IMenuPlacement } from '../../../types/IMenu';
|
|
3
|
+
import { IAnyObject } from '../../../types/IBasic';
|
|
3
4
|
|
|
4
5
|
interface Offsets {
|
|
5
6
|
offsetTop: number;
|
|
@@ -11,14 +12,22 @@ interface Props {
|
|
|
11
12
|
placement: IMenuPlacement;
|
|
12
13
|
containerRef: RefObject<Element | null>;
|
|
13
14
|
menuRef: RefObject<Element | null>;
|
|
15
|
+
withMinWidth?: boolean;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
|
-
export const useMenuPosition = ({
|
|
18
|
+
export const useMenuPosition = ({
|
|
19
|
+
isOpen,
|
|
20
|
+
placement,
|
|
21
|
+
containerRef,
|
|
22
|
+
menuRef,
|
|
23
|
+
withMinWidth,
|
|
24
|
+
}: Props) => {
|
|
17
25
|
const [offsets, setOffsets] = useState<Offsets>({
|
|
18
26
|
offsetLeft: 0,
|
|
19
27
|
offsetTop: 0,
|
|
20
28
|
});
|
|
21
29
|
const [maxHeight, setMaxHeight] = useState<number>();
|
|
30
|
+
const [minWidth, setMinWidth] = useState(200);
|
|
22
31
|
|
|
23
32
|
const recalculatePosition = useCallback(() => {
|
|
24
33
|
if (containerRef.current && menuRef.current) {
|
|
@@ -26,6 +35,8 @@ export const useMenuPosition = ({ isOpen, placement, containerRef, menuRef }: Pr
|
|
|
26
35
|
const menuRect = menuRef.current.getBoundingClientRect();
|
|
27
36
|
const [placementY, placementX] = placement.split('-');
|
|
28
37
|
|
|
38
|
+
setMinWidth(containerRect.width);
|
|
39
|
+
|
|
29
40
|
let offsetTop = containerRect.bottom + 5;
|
|
30
41
|
// let offsetTop = containerRect.bottom + document.documentElement.scrollTop + 5;
|
|
31
42
|
|
|
@@ -57,10 +68,10 @@ export const useMenuPosition = ({ isOpen, placement, containerRef, menuRef }: Pr
|
|
|
57
68
|
}
|
|
58
69
|
}, [menuRef, containerRef, placement]);
|
|
59
70
|
|
|
60
|
-
|
|
71
|
+
useLayoutEffect(() => {
|
|
61
72
|
isOpen
|
|
62
|
-
?
|
|
63
|
-
:
|
|
73
|
+
? document.addEventListener('resize', recalculatePosition)
|
|
74
|
+
: document.removeEventListener('resize', recalculatePosition);
|
|
64
75
|
// Disable scroll & fix page resize on menu open
|
|
65
76
|
document.body.style.marginRight =
|
|
66
77
|
isOpen && window.innerWidth > document.body.clientWidth ? '19px' : '';
|
|
@@ -72,9 +83,15 @@ export const useMenuPosition = ({ isOpen, placement, containerRef, menuRef }: Pr
|
|
|
72
83
|
};
|
|
73
84
|
}, [isOpen, recalculatePosition]);
|
|
74
85
|
|
|
75
|
-
|
|
86
|
+
const data: IAnyObject = {
|
|
76
87
|
top: offsets.offsetTop + 'px',
|
|
77
88
|
left: offsets.offsetLeft + 'px',
|
|
78
89
|
maxHeight,
|
|
79
90
|
};
|
|
91
|
+
|
|
92
|
+
if (withMinWidth) {
|
|
93
|
+
data.minWidth = minWidth;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return data;
|
|
80
97
|
};
|
|
@@ -1,85 +1,148 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FC, ReactNode, useCallback, useEffect, useRef } from 'react';
|
|
1
|
+
import { FC, KeyboardEventHandler, ReactNode, Ref, useEffect, useRef } from 'react';
|
|
3
2
|
import { createPortal } from 'react-dom';
|
|
3
|
+
import { rootDir } from '../../utils/rootDir';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { SearchInput } from '../Inputs/SearchInput';
|
|
6
|
+
import {
|
|
7
|
+
PopupControlRef,
|
|
8
|
+
useLocalPopoverControl,
|
|
9
|
+
} from '../../hooks/useLocalPopoverControl';
|
|
10
|
+
import { ConditionalWrapper } from '../Wrappers/ConditionalWrapper';
|
|
11
|
+
import { useGetFocusableElements } from '../../hooks/useGetFocusableElements';
|
|
12
|
+
import { IDialogFooterActions } from '../Dialog/components/DialogFooter';
|
|
13
|
+
import { Button } from '../Button/Button';
|
|
4
14
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import {
|
|
6
|
-
import { rootDir } from '../../utils/RootDir';
|
|
7
|
-
import { IButtonColor } from '../Button/Button';
|
|
15
|
+
import { onPopupKeyDown } from '../../utils/popupUtils';
|
|
8
16
|
|
|
9
17
|
interface Props {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
isLoading: boolean;
|
|
15
|
-
onSubmit: (data: any) => void;
|
|
16
|
-
submitLabel?: string;
|
|
17
|
-
submitDisabled?: boolean;
|
|
18
|
+
controlRef: Ref<PopupControlRef>;
|
|
19
|
+
header?: {
|
|
20
|
+
title: string;
|
|
21
|
+
onSearch?: (search: string) => void;
|
|
18
22
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
outlined?: boolean;
|
|
26
|
-
color?: IButtonColor;
|
|
27
|
-
}[];
|
|
23
|
+
onFormSubmit?: () => void;
|
|
24
|
+
onCloseCallback?: () => void;
|
|
25
|
+
footer?: IDialogFooterActions;
|
|
26
|
+
size?: 'vw25' | 'vw50' | 'vw75' | 'vw100' | 'w500' | 'w600';
|
|
27
|
+
className?: string;
|
|
28
|
+
contentClassName?: string;
|
|
28
29
|
children: ReactNode;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
export const Pullover: FC<Props> = ({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
controlRef,
|
|
34
|
+
header,
|
|
35
|
+
onFormSubmit,
|
|
36
|
+
onCloseCallback,
|
|
37
|
+
footer,
|
|
38
|
+
size = 'vw50',
|
|
39
|
+
className,
|
|
40
|
+
contentClassName,
|
|
37
41
|
children,
|
|
38
42
|
}) => {
|
|
39
|
-
const ref = useRef<HTMLDivElement>(null);
|
|
40
43
|
const { t } = useTranslation();
|
|
44
|
+
const searchRef = useRef<HTMLInputElement>(null);
|
|
41
45
|
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
+
const { elementRef, isOpen, onClose } = useLocalPopoverControl({
|
|
47
|
+
controlRef,
|
|
48
|
+
onCloseCallback,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const focusableElements = useGetFocusableElements({
|
|
52
|
+
elementRef,
|
|
53
|
+
isOpen,
|
|
54
|
+
autoFocusIndex: header?.onSearch ? 1 : 0,
|
|
55
|
+
});
|
|
46
56
|
|
|
47
57
|
useEffect(() => {
|
|
48
58
|
if (isOpen) {
|
|
49
59
|
setTimeout(() => {
|
|
50
|
-
|
|
60
|
+
elementRef.current?.classList.add('open');
|
|
61
|
+
elementRef.current?.focus();
|
|
51
62
|
});
|
|
52
|
-
const handleClick = (e: KeyboardEvent) => {
|
|
53
|
-
e.code === 'Escape' && handleClose();
|
|
54
|
-
};
|
|
55
|
-
window.addEventListener('keydown', handleClick);
|
|
56
|
-
return () => window.removeEventListener('keydown', handleClick);
|
|
57
63
|
}
|
|
58
|
-
}, [
|
|
64
|
+
}, [elementRef, isOpen]);
|
|
65
|
+
|
|
66
|
+
const onKeyDown: KeyboardEventHandler<HTMLDivElement> = event => {
|
|
67
|
+
onPopupKeyDown(event, {
|
|
68
|
+
onClose,
|
|
69
|
+
enter: {
|
|
70
|
+
onAction: () => {
|
|
71
|
+
footer?.confirmButton.onClick?.();
|
|
72
|
+
!footer?.confirmButton.keepOpen && onClose();
|
|
73
|
+
},
|
|
74
|
+
disabled: !footer?.confirmButton.onClick,
|
|
75
|
+
},
|
|
76
|
+
search: {
|
|
77
|
+
onAction: () => searchRef.current?.focus(),
|
|
78
|
+
disabled: !header?.onSearch,
|
|
79
|
+
},
|
|
80
|
+
focusableElements,
|
|
81
|
+
});
|
|
82
|
+
};
|
|
59
83
|
|
|
60
84
|
return isOpen
|
|
61
85
|
? createPortal(
|
|
62
|
-
<div
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
86
|
+
<div
|
|
87
|
+
ref={elementRef}
|
|
88
|
+
className="pullover"
|
|
89
|
+
onClick={onClose}
|
|
90
|
+
aria-label="popup"
|
|
91
|
+
tabIndex={-1}
|
|
92
|
+
onKeyDown={onKeyDown}
|
|
93
|
+
>
|
|
94
|
+
<div className={clsx('container', size)} onClick={e => e.stopPropagation()}>
|
|
95
|
+
<div className={clsx('content', className)}>
|
|
96
|
+
{header && (
|
|
97
|
+
<div className="pullover-header">
|
|
98
|
+
<h3>{header.title}</h3>
|
|
99
|
+
{header.onSearch && (
|
|
100
|
+
<SearchInput
|
|
101
|
+
ref={searchRef}
|
|
102
|
+
onSearch={header.onSearch}
|
|
103
|
+
className="search-input"
|
|
104
|
+
/>
|
|
105
|
+
)}
|
|
106
|
+
</div>
|
|
82
107
|
)}
|
|
108
|
+
<ConditionalWrapper
|
|
109
|
+
condition={!!onFormSubmit}
|
|
110
|
+
wrapper={children => (
|
|
111
|
+
<form
|
|
112
|
+
className="pullover-form"
|
|
113
|
+
onSubmit={e => {
|
|
114
|
+
e.preventDefault();
|
|
115
|
+
e.stopPropagation();
|
|
116
|
+
onFormSubmit?.();
|
|
117
|
+
}}
|
|
118
|
+
>
|
|
119
|
+
{children}
|
|
120
|
+
</form>
|
|
121
|
+
)}
|
|
122
|
+
>
|
|
123
|
+
{/* CONTENT */}
|
|
124
|
+
<div className={clsx('pullover-content', contentClassName)}>
|
|
125
|
+
{children}
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
{/* FOOTER */}
|
|
129
|
+
{footer && (
|
|
130
|
+
<div className={clsx('pullover-footer', className)}>
|
|
131
|
+
{footer.additionalButton && (
|
|
132
|
+
<Button
|
|
133
|
+
{...footer.additionalButton}
|
|
134
|
+
variant="simple"
|
|
135
|
+
className="mr-auto"
|
|
136
|
+
/>
|
|
137
|
+
)}
|
|
138
|
+
<Button label={t('Cancel')} variant="outlined" onClick={onClose} />
|
|
139
|
+
<Button
|
|
140
|
+
{...footer.confirmButton}
|
|
141
|
+
label={footer.confirmButton.label ?? t('Confirm')}
|
|
142
|
+
/>
|
|
143
|
+
</div>
|
|
144
|
+
)}
|
|
145
|
+
</ConditionalWrapper>
|
|
83
146
|
</div>
|
|
84
147
|
</div>
|
|
85
148
|
</div>,
|