@inceptionbg/iui 2.0.5 → 2.0.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/icons/index.d.ts +43 -0
- package/dist/icons/index.js +1 -0
- package/dist/index.d.ts +24 -15
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/iui.css +1 -1
- package/idea/Menu/Menu.tsx +119 -0
- package/idea/Menu/MenuItem.tsx +74 -0
- package/idea/Menu/hooks/useMenuControl.ts +13 -0
- package/idea/Menu.tsx +132 -0
- package/idea/NoAccessInfo.tsx +193 -0
- package/idea/Notifications.tsx +245 -0
- package/idea/Table2/Components/Columns/ColumnsList.tsx +56 -0
- package/idea/Table2/Components/Columns/SetColumnsList.tsx +107 -0
- package/idea/Table2/Components/Edit/ItemActionsMenu.tsx +87 -0
- package/idea/Table2/Components/Edit/ItemEditOptionsButtons.tsx +32 -0
- package/idea/Table2/Components/Edit/TableEditRow.tsx +56 -0
- package/idea/Table2/Components/FilterItem.tsx +20 -0
- package/idea/Table2/Components/Header/TableHeader.tsx +35 -0
- package/idea/Table2/Components/Header/TableHeaderRow.tsx +37 -0
- package/idea/Table2/Components/Print/CustomTablePrint.tsx +119 -0
- package/idea/Table2/Components/Print/TablePrint.tsx +208 -0
- package/idea/Table2/Components/SetSortList.tsx +33 -0
- package/idea/Table2/Components/SetTableFilter.tsx +90 -0
- package/idea/Table2/Components/TableFooter.tsx +107 -0
- package/idea/Table2/Components/TableOptions.tsx +211 -0
- package/idea/Table2/Components/Templates/TemplateCreate.tsx +75 -0
- package/idea/Table2/Components/Templates/TemplateCreateDefault.tsx +45 -0
- package/idea/Table2/Components/Templates/TemplateList.tsx +167 -0
- package/idea/Table2/Components/Templates/repo/TemplateRepo.ts +51 -0
- package/idea/Table2/Table.tsx +657 -0
- package/idea/Table2/_table.scss +300 -0
- package/idea/Table2/hooks/useDefaultTemplate.ts +22 -0
- package/idea/Table2/hooks/useTableKeyboard.ts +115 -0
- package/package.json +8 -4
- package/rollup.config.js +80 -0
- package/src/assets/icons/duotone/faCircleUser.ts +17 -0
- package/src/assets/icons/index.ts +20 -0
- package/src/assets/icons/light/faArrowDownShortWide.ts +15 -0
- package/src/assets/icons/light/faArrowDownWideShort.ts +15 -0
- package/src/assets/icons/light/faArrowUpArrowDown.ts +15 -0
- package/src/assets/icons/light/faArrowUpRightFromSquare.ts +15 -0
- package/src/assets/icons/light/faArrowsToLine.ts +15 -0
- package/src/assets/icons/light/faArrowsUpDown.ts +15 -0
- package/src/assets/icons/light/faCalendarPlus.ts +15 -0
- package/src/assets/icons/light/faCheck.ts +15 -0
- package/src/assets/icons/light/faChevronDown.ts +15 -0
- package/src/assets/icons/light/faChevronRight.ts +15 -0
- package/src/assets/icons/light/faCircleInfo.ts +15 -0
- package/src/assets/icons/light/faCircleXmark.ts +15 -0
- package/src/assets/icons/light/faClockRotateLeft.ts +15 -0
- package/src/assets/icons/light/faEllipsisVertical.ts +15 -0
- package/src/assets/icons/light/faEye.ts +15 -0
- package/src/assets/icons/light/faEyeSlash.ts +15 -0
- package/src/assets/icons/light/faFilter.ts +15 -0
- package/src/assets/icons/light/faGear.ts +15 -0
- package/src/assets/icons/light/faHouse.ts +15 -0
- package/src/assets/icons/light/faIdBadge.ts +15 -0
- package/src/assets/icons/light/faLineColumns.ts +15 -0
- package/src/assets/icons/light/faLink.ts +15 -0
- package/src/assets/icons/light/faMagnifyingGlass.ts +15 -0
- package/src/assets/icons/light/faPenField.ts +15 -0
- package/src/assets/icons/light/faPrint.ts +15 -0
- package/src/assets/icons/light/faQuestion.ts +15 -0
- package/src/assets/icons/light/faRotateRight.ts +15 -0
- package/src/assets/icons/light/faTrashCan.ts +15 -0
- package/src/assets/icons/light/faTriangleExclamation.ts +15 -0
- package/src/assets/icons/light/faXmark.ts +15 -0
- package/src/assets/icons/regular/faArrowLeft.ts +15 -0
- package/src/assets/icons/regular/faArrowRightArrowLeft.ts +15 -0
- package/src/assets/icons/regular/faCircleCheck.ts +15 -0
- package/src/assets/icons/regular/faCircleExclamation.ts +15 -0
- package/src/assets/icons/regular/faCircleInfo.ts +15 -0
- package/src/assets/icons/regular/faFileArrowDown.ts +15 -0
- package/src/assets/icons/regular/faFilterCircleXmark.ts +15 -0
- package/src/assets/icons/regular/faTriangleExclamation.ts +15 -0
- package/src/assets/icons/solid/faAngleLeft.ts +15 -0
- package/src/assets/icons/solid/faAngleRight.ts +15 -0
- package/src/assets/icons/solid/faArrowDownWideShort.ts +15 -0
- package/src/assets/icons/solid/faCaretDown.ts +15 -0
- package/src/assets/icons/solid/faCheck.ts +15 -0
- package/src/assets/icons/solid/faEllipsisVertical.ts +15 -0
- package/src/assets/icons/solid/faFilter.ts +15 -0
- package/src/assets/icons/solid/faFloppyDisk.ts +15 -0
- package/src/assets/icons/solid/faGripDotsVertical.ts +15 -0
- package/src/assets/icons/solid/faListUl.ts +15 -0
- package/src/assets/icons/solid/faMagnifyingGlass.ts +15 -0
- package/src/assets/icons/solid/faMinus.ts +15 -0
- package/src/assets/icons/solid/faPlus.ts +15 -0
- package/src/assets/icons/solid/faPrint.ts +15 -0
- package/src/assets/icons/solid/faRotateRight.ts +15 -0
- package/src/assets/icons/solid/faXmark.ts +15 -0
- package/src/assets/images/logo/mts.svg +5703 -0
- package/src/assets/images/logo/paperless.svg +21 -0
- package/src/assets/images/logo/pismonosa.png +0 -0
- package/src/assets/images/not-found.svg +19 -0
- package/src/components/Accordions/Accordions.tsx +64 -0
- package/src/components/Alert/Alert.tsx +31 -0
- package/src/components/Badge/DotBadge.tsx +16 -0
- package/src/components/Badge/NotificationBadge.tsx +29 -0
- package/src/components/Badge/PillBadge.tsx +13 -0
- package/src/components/Button/Button.tsx +56 -0
- package/src/components/Button/IconButton.tsx +49 -0
- package/src/components/Dashboard/Dashboard.tsx +9 -0
- package/src/components/Dashboard/DashboardWidget.tsx +44 -0
- package/src/components/Dashboard/FastLinksWidget/FastLinksWidget.tsx +37 -0
- package/src/components/Dialog/DeleteItemDialog.tsx +52 -0
- package/src/components/Dialog/Dialog.tsx +226 -0
- package/src/components/Dialog/hooks/useDialogKeyboard.ts +41 -0
- package/src/components/Dialog/hooks/useDialogObserver.ts +21 -0
- package/src/components/Header/Components/ModuleSelect.tsx +55 -0
- package/src/components/Header/Components/UserMenu.tsx +44 -0
- package/src/components/Header/Header.tsx +36 -0
- package/src/components/Helper/Collapse.tsx +52 -0
- package/src/components/Inputs/Checkbox.tsx +53 -0
- package/src/components/Inputs/CurrencyInput.tsx +123 -0
- package/src/components/Inputs/DateInput/DateInput.tsx +176 -0
- package/src/components/Inputs/DateInput/components/DatePartInput.tsx +154 -0
- package/src/components/Inputs/InputWrapper.tsx +90 -0
- package/src/components/Inputs/NumberInput.tsx +83 -0
- package/src/components/Inputs/PasswordInput.tsx +38 -0
- package/src/components/Inputs/Radio.tsx +59 -0
- package/src/components/Inputs/RadioGroup.tsx +48 -0
- package/src/components/Inputs/RadioLarge.tsx +39 -0
- package/src/components/Inputs/SearchInput.tsx +40 -0
- package/src/components/Inputs/Select2/Select.tsx +224 -0
- package/src/components/Inputs/Select2/select.scss +43 -0
- package/src/components/Inputs/Selects/Select.tsx +17 -0
- package/src/components/Inputs/Selects/components/CustomSelectComponents.tsx +19 -0
- package/src/components/Inputs/Selects/components/SelectWrapper.tsx +126 -0
- package/src/components/Inputs/Selects/utils/selectStyles.ts +104 -0
- package/src/components/Inputs/TextAreaInput.tsx +67 -0
- package/src/components/Inputs/TextInput.tsx +98 -0
- package/src/components/Inputs/TimeInput/TimeInput.tsx +81 -0
- package/src/components/Loader/Loader.tsx +53 -0
- package/src/components/Menu/Menu.tsx +68 -0
- package/src/components/Menu/MenuItem.tsx +47 -0
- package/src/components/Menu/NewMenu.tsx +66 -0
- package/src/components/Menu/hooks/useMenuPosition.tsx +80 -0
- package/src/components/Pullover/Pullover.tsx +89 -0
- package/src/components/Router/Router.tsx +51 -0
- package/src/components/Sidebar/AddButton.tsx +22 -0
- package/src/components/Sidebar/Sidebar.tsx +81 -0
- package/src/components/Sidebar/SidebarItem.tsx +84 -0
- package/src/components/Sidebar/types/ISidebar.ts +28 -0
- package/src/components/Table/Components/Columns/ColumnsList.tsx +61 -0
- package/src/components/Table/Components/Columns/SetColumnsList.tsx +113 -0
- package/src/components/Table/Components/Edit/ItemActionsMenu.tsx +84 -0
- package/src/components/Table/Components/Edit/ItemEditOptionsButtons.tsx +31 -0
- package/src/components/Table/Components/Edit/TableEditRow.tsx +56 -0
- package/src/components/Table/Components/FilterItem.tsx +20 -0
- package/src/components/Table/Components/Header/TableHeader.tsx +45 -0
- package/src/components/Table/Components/Header/TableHeaderRow.tsx +37 -0
- package/src/components/Table/Components/Print/CustomTablePrint.tsx +114 -0
- package/src/components/Table/Components/Print/TablePrint.tsx +207 -0
- package/src/components/Table/Components/SetSortList.tsx +30 -0
- package/src/components/Table/Components/SetTableFilter.tsx +90 -0
- package/src/components/Table/Components/TableFooter.tsx +135 -0
- package/src/components/Table/Components/TableOptions.tsx +226 -0
- package/src/components/Table/Components/Templates/TemplateCreate.tsx +80 -0
- package/src/components/Table/Components/Templates/TemplateCreateDefault.tsx +45 -0
- package/src/components/Table/Components/Templates/TemplateList.tsx +167 -0
- package/src/components/Table/Components/Templates/repo/TemplateRepo.ts +53 -0
- package/src/components/Table/Table.tsx +527 -0
- package/src/components/Table/hooks/useDefaultTemplate.ts +20 -0
- package/src/components/Table/hooks/useTableKeyboard.ts +138 -0
- package/src/components/Table/hooks/useTableSelect.ts +11 -0
- package/src/components/Tabs/Tabs.tsx +66 -0
- package/src/components/Tooltip/Tooltip.tsx +133 -0
- package/src/components/Tree/Tree.tsx +22 -0
- package/src/components/Tree/TreeItem.tsx +56 -0
- package/src/components/Wrappers/AppLayout.tsx +17 -0
- package/src/components/Wrappers/ConditionalWrapper.tsx +10 -0
- package/src/components/Wrappers/FormWrapper.tsx +81 -0
- package/src/components/Wrappers/PageLayout.tsx +152 -0
- package/src/hooks/useBackgroundClose.ts +18 -0
- package/src/hooks/useIsMenuOpen.ts +11 -0
- package/src/hooks/useOnEsc.ts +14 -0
- package/src/hooks/useZendesk.ts +21 -0
- package/src/index.ts +324 -0
- package/src/pages/NoAccessPage.tsx +27 -0
- package/src/pages/NotFoundPage.tsx +26 -0
- package/src/styles/App.scss +43 -0
- package/src/styles/common/_animations.scss +64 -0
- package/src/styles/common/_typography.scss +88 -0
- package/src/styles/common/helpers/_base.scss +55 -0
- package/src/styles/common/helpers/_color.scss +7 -0
- package/src/styles/common/helpers/_display.scss +85 -0
- package/src/styles/common/helpers/_size.scss +25 -0
- package/src/styles/common/maps/_align.scss +21 -0
- package/src/styles/common/maps/_info-types.scss +1 -0
- package/src/styles/common/maps/_spacing.scss +78 -0
- package/src/styles/common/maps/_text.scss +14 -0
- package/src/styles/components/_accordions.scss +46 -0
- package/src/styles/components/_alert.scss +23 -0
- package/src/styles/components/_badge.scss +76 -0
- package/src/styles/components/_button.scss +138 -0
- package/src/styles/components/_card.scss +24 -0
- package/src/styles/components/_dialog.scss +111 -0
- package/src/styles/components/_form.scss +8 -0
- package/src/styles/components/_header.scss +109 -0
- package/src/styles/components/_input.scss +158 -0
- package/src/styles/components/_inputCheckbox.scss +105 -0
- package/src/styles/components/_inputDateTime.scss +161 -0
- package/src/styles/components/_inputRadio.scss +83 -0
- package/src/styles/components/_inputSelect.scss +6 -0
- package/src/styles/components/_loader.scss +44 -0
- package/src/styles/components/_menu-v2.scss +67 -0
- package/src/styles/components/_menu.scss +53 -0
- package/src/styles/components/_page.scss +62 -0
- package/src/styles/components/_portal.scss +8 -0
- package/src/styles/components/_print.scss +87 -0
- package/src/styles/components/_pullover.scss +43 -0
- package/src/styles/components/_scrollbar.scss +18 -0
- package/src/styles/components/_sidebar.scss +206 -0
- package/src/styles/components/_smallComponents.scss +23 -0
- package/src/styles/components/_table.scss +270 -0
- package/src/styles/components/_tabs.scss +33 -0
- package/src/styles/components/_tooltip.scss +48 -0
- package/src/styles/components/_tree.scss +21 -0
- package/src/styles/components/_widget.scss +90 -0
- package/src/styles/pages/_fullScreenPage.scss +64 -0
- package/src/styles/variables/_bp.scss +5 -0
- package/src/styles/variables/_variables.scss +130 -0
- package/src/types/Base/custom.d.ts +9 -0
- package/src/types/IBasic.ts +31 -0
- package/src/types/IError.ts +5 -0
- package/src/types/IHeader.ts +24 -0
- package/src/types/IInfo.ts +1 -0
- package/src/types/IKeyboard.ts +37 -0
- package/src/types/IMenu.ts +18 -0
- package/src/types/IRouter.ts +6 -0
- package/src/types/ISelect.ts +52 -0
- package/src/types/ITab.ts +10 -0
- package/src/types/ITable.ts +249 -0
- package/src/types/ITree.ts +6 -0
- package/src/utils/DateUtils.ts +32 -0
- package/src/utils/InputPatternValidation.ts +12 -0
- package/src/utils/LocalStorageHelper.ts +24 -0
- package/src/utils/NumberUtils.ts +21 -0
- package/src/utils/ObjectUtils.ts +85 -0
- package/src/utils/RootDir.ts +1 -0
- package/src/utils/StringUtils.ts +18 -0
- package/src/utils/TableUtils.ts +130 -0
- package/src/utils/Toasts.ts +6 -0
- package/src/utils/UrlUtils.ts +4 -0
- package/src/utils/fileUtils.ts +176 -0
- package/src/utils/i18n/i18nIUICyrilic.ts +90 -0
- package/src/utils/i18n/i18nIUILatin.ts +90 -0
- package/src/utils/i18n/i18nIUIMe.ts +88 -0
- package/src/utils/icons.ts +13 -0
- package/tsconfig.icons.json +5 -0
- package/tsconfig.json +19 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { FC, useState } from 'react';
|
|
2
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { ITab } from '../../types/ITab';
|
|
5
|
+
import { Collapse } from '../Helper/Collapse';
|
|
6
|
+
import { faArrowsToLine } from '../../assets/icons/light/faArrowsToLine';
|
|
7
|
+
import { faArrowsUpDown } from '../../assets/icons/light/faArrowsUpDown';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
tabs: ITab[];
|
|
11
|
+
initialValue?: string;
|
|
12
|
+
compact?: boolean;
|
|
13
|
+
keepContentInDom?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export const Accordions: FC<Props> = ({
|
|
17
|
+
tabs: allTabs,
|
|
18
|
+
initialValue,
|
|
19
|
+
compact,
|
|
20
|
+
keepContentInDom,
|
|
21
|
+
className,
|
|
22
|
+
}) => {
|
|
23
|
+
const tabs = allTabs.filter(tab => !tab.hidden);
|
|
24
|
+
const [selected, setSelected] = useState(initialValue || '');
|
|
25
|
+
|
|
26
|
+
return tabs.length > 0 ? (
|
|
27
|
+
<div className={className}>
|
|
28
|
+
<div className="iui-accordions">
|
|
29
|
+
{tabs.map(tab => (
|
|
30
|
+
<div
|
|
31
|
+
key={tab.value}
|
|
32
|
+
className={clsx('iui-accordion', {
|
|
33
|
+
selected: selected === tab.value,
|
|
34
|
+
compact,
|
|
35
|
+
})}
|
|
36
|
+
>
|
|
37
|
+
<div
|
|
38
|
+
className={clsx('summary clickable', {
|
|
39
|
+
disabled: tab.disabled,
|
|
40
|
+
})}
|
|
41
|
+
onClick={
|
|
42
|
+
tab.disabled
|
|
43
|
+
? undefined
|
|
44
|
+
: () => setSelected(selected === tab.value ? '' : tab.value)
|
|
45
|
+
}
|
|
46
|
+
>
|
|
47
|
+
<div className="flex center">
|
|
48
|
+
{tab.icon && <FontAwesomeIcon icon={tab.icon} className="iui-icon" />}
|
|
49
|
+
{tab.label}
|
|
50
|
+
</div>
|
|
51
|
+
<FontAwesomeIcon
|
|
52
|
+
icon={tab.value === selected ? faArrowsToLine : faArrowsUpDown}
|
|
53
|
+
className="collapse-icon"
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
<Collapse isOpen={selected === tab.value} keepContentInDom={keepContentInDom}>
|
|
57
|
+
<div className="p-4">{tab.component}</div>
|
|
58
|
+
</Collapse>
|
|
59
|
+
</div>
|
|
60
|
+
))}
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
) : null;
|
|
64
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { FC, ReactNode } from 'react';
|
|
4
|
+
import { infoIcons } from '../../utils/icons';
|
|
5
|
+
import { IInfoType } from '../../types/IInfo';
|
|
6
|
+
|
|
7
|
+
export interface IAlertProps {
|
|
8
|
+
text?: string;
|
|
9
|
+
severity: IInfoType;
|
|
10
|
+
fitContent?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const Alert: FC<IAlertProps> = ({
|
|
16
|
+
text,
|
|
17
|
+
severity,
|
|
18
|
+
fitContent,
|
|
19
|
+
className,
|
|
20
|
+
children,
|
|
21
|
+
}) => (
|
|
22
|
+
<div
|
|
23
|
+
className={clsx('iui-alert', severity, className, {
|
|
24
|
+
'width-fit': fitContent,
|
|
25
|
+
})}
|
|
26
|
+
>
|
|
27
|
+
<FontAwesomeIcon icon={infoIcons[severity]} />
|
|
28
|
+
{text && <p>{text}</p>}
|
|
29
|
+
{children}
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { IInfoType } from '../../types/IInfo';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
label: string;
|
|
7
|
+
color: IInfoType | 'gray';
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const DotBadge: FC<Props> = ({ label, color, className }) => (
|
|
12
|
+
<div className="flex align-center gap-2">
|
|
13
|
+
<div className={clsx('iui-dot-badge', color, className)} />
|
|
14
|
+
{label}
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { FC, ReactNode } from 'react';
|
|
3
|
+
import { IInfoType } from '../../types/IInfo';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
number?: number;
|
|
7
|
+
className?: string;
|
|
8
|
+
size?: 's' | 'm';
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
color?: IInfoType | 'primary';
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const NotificationBadge: FC<Props> = ({
|
|
14
|
+
number,
|
|
15
|
+
className,
|
|
16
|
+
size = 'm',
|
|
17
|
+
children,
|
|
18
|
+
color = 'primary',
|
|
19
|
+
}) =>
|
|
20
|
+
!!number && number > 0 ? (
|
|
21
|
+
<div className="iui-badge-parent">
|
|
22
|
+
{children}
|
|
23
|
+
<div className={clsx('iui-badge', color, className, size)}>
|
|
24
|
+
{number > 99 ? '99+' : number}
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
) : (
|
|
28
|
+
children
|
|
29
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { IInfoType } from '../../types/IInfo';
|
|
3
|
+
import { FC } from 'react';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
label: string;
|
|
7
|
+
color: IInfoType | 'gray';
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const PillBadge: FC<Props> = ({ label, color, className }) => (
|
|
12
|
+
<div className={clsx('iui-pill-badge', color, className)}>{label}</div>
|
|
13
|
+
);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, FC, MouseEventHandler, Ref } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
+
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
5
|
+
|
|
6
|
+
export type IButtonColor = 'primary' | 'neutral' | 'danger';
|
|
7
|
+
export type IButtonVariant = 'solid' | 'outlined' | 'simple';
|
|
8
|
+
|
|
9
|
+
export interface IButtonProps {
|
|
10
|
+
label: string;
|
|
11
|
+
icon?: IconDefinition;
|
|
12
|
+
iconEnd?: IconDefinition;
|
|
13
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
14
|
+
variant?: IButtonVariant;
|
|
15
|
+
color?: IButtonColor;
|
|
16
|
+
size?: 'xs' | 's' | 'm' | 'l';
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
active?: boolean;
|
|
19
|
+
type?: ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
20
|
+
className?: string;
|
|
21
|
+
buttonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
|
|
22
|
+
ref?: Ref<HTMLButtonElement>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const Button: FC<IButtonProps> = ({
|
|
26
|
+
label,
|
|
27
|
+
icon,
|
|
28
|
+
iconEnd,
|
|
29
|
+
onClick,
|
|
30
|
+
variant = 'solid',
|
|
31
|
+
color,
|
|
32
|
+
size = 'm',
|
|
33
|
+
disabled,
|
|
34
|
+
active,
|
|
35
|
+
type = 'button',
|
|
36
|
+
className,
|
|
37
|
+
buttonProps,
|
|
38
|
+
ref,
|
|
39
|
+
}) => (
|
|
40
|
+
<button
|
|
41
|
+
ref={ref}
|
|
42
|
+
disabled={disabled}
|
|
43
|
+
className={clsx('iui-btn iui-text-btn', variant, color, size, className, {
|
|
44
|
+
active,
|
|
45
|
+
primary: !color && variant === 'solid',
|
|
46
|
+
neutral: !color && variant === 'outlined',
|
|
47
|
+
})}
|
|
48
|
+
onClick={onClick}
|
|
49
|
+
type={type}
|
|
50
|
+
{...buttonProps}
|
|
51
|
+
>
|
|
52
|
+
{icon && <FontAwesomeIcon icon={icon} />}
|
|
53
|
+
<div className="iui-btn-label">{label}</div>
|
|
54
|
+
{iconEnd && <FontAwesomeIcon icon={iconEnd} />}
|
|
55
|
+
</button>
|
|
56
|
+
);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, FC, MouseEventHandler, Ref } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
+
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
5
|
+
import { IButtonColor, IButtonVariant } from './Button';
|
|
6
|
+
import { Tooltip } from '../Tooltip/Tooltip';
|
|
7
|
+
|
|
8
|
+
export interface IIconButtonProps {
|
|
9
|
+
icon: IconDefinition;
|
|
10
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
11
|
+
variant?: IButtonVariant;
|
|
12
|
+
color?: IButtonColor;
|
|
13
|
+
size?: 's' | 'm' | 'l';
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
active?: boolean;
|
|
16
|
+
tooltip?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
buttonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
|
|
19
|
+
ref?: Ref<HTMLButtonElement>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const IconButton: FC<IIconButtonProps> = ({
|
|
23
|
+
icon,
|
|
24
|
+
onClick,
|
|
25
|
+
variant = 'simple',
|
|
26
|
+
color = 'primary',
|
|
27
|
+
size = 'm',
|
|
28
|
+
disabled,
|
|
29
|
+
active,
|
|
30
|
+
tooltip,
|
|
31
|
+
className,
|
|
32
|
+
buttonProps,
|
|
33
|
+
ref,
|
|
34
|
+
}) => (
|
|
35
|
+
<Tooltip label={tooltip} disabled={disabled}>
|
|
36
|
+
<button
|
|
37
|
+
ref={ref}
|
|
38
|
+
disabled={disabled}
|
|
39
|
+
className={clsx('iui-btn iui-icon-btn', variant, color, size, className, {
|
|
40
|
+
active,
|
|
41
|
+
})}
|
|
42
|
+
onClick={onClick}
|
|
43
|
+
type={buttonProps?.type || onClick ? 'button' : 'submit'}
|
|
44
|
+
{...buttonProps}
|
|
45
|
+
>
|
|
46
|
+
<FontAwesomeIcon icon={icon} />
|
|
47
|
+
</button>
|
|
48
|
+
</Tooltip>
|
|
49
|
+
);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { FC, ReactNode } from 'react';
|
|
4
|
+
import { Loader } from '../Loader/Loader';
|
|
5
|
+
import { faCircleInfo, faTriangleExclamation } from '../../assets/icons';
|
|
6
|
+
|
|
7
|
+
const Icons = {
|
|
8
|
+
warning: faTriangleExclamation,
|
|
9
|
+
info: faCircleInfo,
|
|
10
|
+
};
|
|
11
|
+
interface Props {
|
|
12
|
+
title: string;
|
|
13
|
+
icon?: any;
|
|
14
|
+
type?: 'warning' | 'info';
|
|
15
|
+
span?: 2 | 3 | 4;
|
|
16
|
+
isLoading?: boolean;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export const DashboardWidget: FC<Props> = ({
|
|
20
|
+
title,
|
|
21
|
+
icon,
|
|
22
|
+
type,
|
|
23
|
+
span,
|
|
24
|
+
isLoading,
|
|
25
|
+
children,
|
|
26
|
+
}) => (
|
|
27
|
+
<Loader isLoading={!!isLoading}>
|
|
28
|
+
<div
|
|
29
|
+
className={clsx('dashboard-widget', type, {
|
|
30
|
+
[`grid-span${span}`]: !!span,
|
|
31
|
+
})}
|
|
32
|
+
>
|
|
33
|
+
<div className="flex gap-3 mb-3">
|
|
34
|
+
{icon && (
|
|
35
|
+
<div className="widget-icon">
|
|
36
|
+
<FontAwesomeIcon icon={icon || Icons[type!]} />
|
|
37
|
+
</div>
|
|
38
|
+
)}
|
|
39
|
+
<h1>{title}</h1>
|
|
40
|
+
</div>
|
|
41
|
+
{children}
|
|
42
|
+
</div>
|
|
43
|
+
</Loader>
|
|
44
|
+
);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { DashboardWidget } from '../DashboardWidget';
|
|
5
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
6
|
+
import { faLink } from '../../../assets/icons/light/faLink';
|
|
7
|
+
import { faArrowUpRightFromSquare } from '../../../assets/icons/light/faArrowUpRightFromSquare';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
links: {
|
|
11
|
+
icon?: IconDefinition;
|
|
12
|
+
label: string;
|
|
13
|
+
onClick: () => void;
|
|
14
|
+
}[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const FastLinksWidget: FC<Props> = ({ links }) => {
|
|
18
|
+
const { t } = useTranslation();
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<DashboardWidget title={t('FastLinks')} icon={faLink}>
|
|
22
|
+
<div className="short-links-widget mt-4">
|
|
23
|
+
<ul>
|
|
24
|
+
{links.map((l, i) => (
|
|
25
|
+
<li onClick={l.onClick} className="clickable" key={`short-links-${i}`}>
|
|
26
|
+
<FontAwesomeIcon
|
|
27
|
+
icon={l.icon || faArrowUpRightFromSquare}
|
|
28
|
+
className="mr-3"
|
|
29
|
+
/>
|
|
30
|
+
{l.label}
|
|
31
|
+
</li>
|
|
32
|
+
))}
|
|
33
|
+
</ul>
|
|
34
|
+
</div>
|
|
35
|
+
</DashboardWidget>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Dispatch, FC, SetStateAction, useState } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { Dialog } from './Dialog';
|
|
4
|
+
import { faTrashCan } from '../../assets/icons';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
textId: string;
|
|
8
|
+
itemUuid: string;
|
|
9
|
+
setItemUuid: Dispatch<SetStateAction<string>>;
|
|
10
|
+
reloadItems: () => void;
|
|
11
|
+
deleteItemFunction: (itemUuid: string) => Promise<any>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const DeleteItemDialog: FC<Props> = ({
|
|
15
|
+
textId,
|
|
16
|
+
itemUuid,
|
|
17
|
+
setItemUuid,
|
|
18
|
+
reloadItems,
|
|
19
|
+
deleteItemFunction,
|
|
20
|
+
}) => {
|
|
21
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
22
|
+
|
|
23
|
+
const { t } = useTranslation();
|
|
24
|
+
|
|
25
|
+
const handOnDelete = () => {
|
|
26
|
+
setIsLoading(true);
|
|
27
|
+
deleteItemFunction(itemUuid)
|
|
28
|
+
.then(() => {
|
|
29
|
+
reloadItems();
|
|
30
|
+
setItemUuid('');
|
|
31
|
+
})
|
|
32
|
+
.catch(() => {})
|
|
33
|
+
.finally(() => setIsLoading(false));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Dialog
|
|
38
|
+
isOpen={!!itemUuid}
|
|
39
|
+
onClose={() => setItemUuid('')}
|
|
40
|
+
title={t(`Delete${textId}Title`)}
|
|
41
|
+
desc={t(`Delete${textId}Desc`)}
|
|
42
|
+
isLoading={isLoading}
|
|
43
|
+
type="info"
|
|
44
|
+
confirmButton={{
|
|
45
|
+
label: t('Delete'),
|
|
46
|
+
icon: faTrashCan,
|
|
47
|
+
keepOpen: true,
|
|
48
|
+
onClick: handOnDelete,
|
|
49
|
+
}}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { FC, ReactNode, useCallback, useRef } from 'react';
|
|
5
|
+
import { createPortal } from 'react-dom';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import { rootDir } from '../../utils/RootDir';
|
|
8
|
+
import { Button, IButtonColor, IButtonVariant } from '../Button/Button';
|
|
9
|
+
import { Loader } from '../Loader/Loader';
|
|
10
|
+
import { ConditionalWrapper } from '../Wrappers/ConditionalWrapper';
|
|
11
|
+
import { useDialogKeyboard } from './hooks/useDialogKeyboard';
|
|
12
|
+
import { faXmark } from '../../assets/icons';
|
|
13
|
+
import { IconButton } from '../Button/IconButton';
|
|
14
|
+
import { infoIcons } from '../../utils/icons';
|
|
15
|
+
import { IInfoType } from '../../types/IInfo';
|
|
16
|
+
import { useBackgroundClose } from '../../hooks/useBackgroundClose';
|
|
17
|
+
|
|
18
|
+
interface Props {
|
|
19
|
+
title?: string;
|
|
20
|
+
titleEl?: ReactNode;
|
|
21
|
+
desc?: string;
|
|
22
|
+
descEl?: ReactNode;
|
|
23
|
+
isOpen: boolean;
|
|
24
|
+
onClose: () => void;
|
|
25
|
+
isLoading?: boolean;
|
|
26
|
+
confirmButton?: {
|
|
27
|
+
label?: string;
|
|
28
|
+
icon?: IconDefinition;
|
|
29
|
+
onClick?: () => void;
|
|
30
|
+
onFormSubmit?: () => void;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
keepOpen?: boolean;
|
|
33
|
+
isKeyboardDisabled?: boolean;
|
|
34
|
+
};
|
|
35
|
+
cancelButton?: {
|
|
36
|
+
label?: string;
|
|
37
|
+
icon?: IconDefinition;
|
|
38
|
+
onClick?: () => void;
|
|
39
|
+
};
|
|
40
|
+
additionalButton?: {
|
|
41
|
+
label: string;
|
|
42
|
+
icon?: IconDefinition;
|
|
43
|
+
onClick?: () => void;
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
keepOpen?: boolean;
|
|
46
|
+
color?: IButtonColor;
|
|
47
|
+
variant?: IButtonVariant;
|
|
48
|
+
};
|
|
49
|
+
hideActionButtons?: boolean;
|
|
50
|
+
isKeyboardDisabled?: boolean;
|
|
51
|
+
noBackgroundClick?: boolean;
|
|
52
|
+
noOverflow?: boolean;
|
|
53
|
+
type?: IInfoType;
|
|
54
|
+
size?: 'm' | 'l' | 'xl';
|
|
55
|
+
className?: string;
|
|
56
|
+
children?: ReactNode;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const Dialog: FC<Props> = ({
|
|
60
|
+
title,
|
|
61
|
+
titleEl,
|
|
62
|
+
desc,
|
|
63
|
+
descEl,
|
|
64
|
+
isOpen,
|
|
65
|
+
onClose,
|
|
66
|
+
isLoading,
|
|
67
|
+
confirmButton,
|
|
68
|
+
cancelButton,
|
|
69
|
+
additionalButton,
|
|
70
|
+
isKeyboardDisabled,
|
|
71
|
+
hideActionButtons,
|
|
72
|
+
noBackgroundClick,
|
|
73
|
+
noOverflow,
|
|
74
|
+
type,
|
|
75
|
+
size = 'm',
|
|
76
|
+
className,
|
|
77
|
+
children,
|
|
78
|
+
}) => {
|
|
79
|
+
const { t } = useTranslation();
|
|
80
|
+
|
|
81
|
+
const portalRef = useRef<HTMLDivElement>(null);
|
|
82
|
+
const formRef = useRef<HTMLFormElement>(null);
|
|
83
|
+
|
|
84
|
+
const handleClose = useCallback(() => {
|
|
85
|
+
portalRef.current?.classList.add('closing');
|
|
86
|
+
setTimeout(onClose, 200);
|
|
87
|
+
}, [portalRef, onClose]);
|
|
88
|
+
|
|
89
|
+
useDialogKeyboard({
|
|
90
|
+
isOpen,
|
|
91
|
+
isDisabled: isKeyboardDisabled,
|
|
92
|
+
onClose: handleClose,
|
|
93
|
+
submit: {
|
|
94
|
+
onEnter: () => {
|
|
95
|
+
if (confirmButton) {
|
|
96
|
+
if (confirmButton.onFormSubmit) {
|
|
97
|
+
formRef.current?.requestSubmit();
|
|
98
|
+
} else {
|
|
99
|
+
confirmButton.onClick?.();
|
|
100
|
+
!confirmButton.keepOpen && handleClose();
|
|
101
|
+
}
|
|
102
|
+
} else {
|
|
103
|
+
cancelButton?.onClick ? cancelButton.onClick() : handleClose();
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
isDisabled: !confirmButton?.disabled && !confirmButton?.isKeyboardDisabled,
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
useBackgroundClose({
|
|
111
|
+
portalRef,
|
|
112
|
+
disabled: noBackgroundClick || !isOpen,
|
|
113
|
+
handleClose,
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
return isOpen
|
|
117
|
+
? createPortal(
|
|
118
|
+
<div ref={portalRef} className="iui-dialog">
|
|
119
|
+
<Loader isLoading={!!isLoading}>
|
|
120
|
+
<div className={clsx('iui-dialog-container', size, type, className)}>
|
|
121
|
+
<ConditionalWrapper
|
|
122
|
+
condition={!!confirmButton?.onFormSubmit}
|
|
123
|
+
wrapper={children => (
|
|
124
|
+
<form
|
|
125
|
+
ref={formRef}
|
|
126
|
+
onSubmit={e => {
|
|
127
|
+
e.preventDefault();
|
|
128
|
+
e.stopPropagation();
|
|
129
|
+
confirmButton?.onFormSubmit?.();
|
|
130
|
+
!confirmButton?.keepOpen && handleClose();
|
|
131
|
+
}}
|
|
132
|
+
>
|
|
133
|
+
{children}
|
|
134
|
+
</form>
|
|
135
|
+
)}
|
|
136
|
+
>
|
|
137
|
+
<div
|
|
138
|
+
className={clsx('iui-dialog-content', {
|
|
139
|
+
'no-overflow': noOverflow,
|
|
140
|
+
})}
|
|
141
|
+
>
|
|
142
|
+
<div className="iui-dialog-header">
|
|
143
|
+
{type && (
|
|
144
|
+
<FontAwesomeIcon
|
|
145
|
+
icon={infoIcons[type]}
|
|
146
|
+
className={clsx('dialog-type-icon', type)}
|
|
147
|
+
/>
|
|
148
|
+
)}
|
|
149
|
+
<div className="full-width">
|
|
150
|
+
<div className="iui-dialog-title">
|
|
151
|
+
{title ? <h1>{title}</h1> : titleEl}
|
|
152
|
+
<IconButton
|
|
153
|
+
icon={faXmark}
|
|
154
|
+
onClick={handleClose}
|
|
155
|
+
color="neutral"
|
|
156
|
+
size="l"
|
|
157
|
+
className="close-icon"
|
|
158
|
+
/>
|
|
159
|
+
</div>
|
|
160
|
+
{desc ? <p className="iui-dialog-desc">{desc}</p> : descEl}
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
{children}
|
|
164
|
+
</div>
|
|
165
|
+
{!hideActionButtons && (
|
|
166
|
+
<div className="iui-dialog-actions">
|
|
167
|
+
<Button
|
|
168
|
+
label={
|
|
169
|
+
cancelButton?.label || (confirmButton ? t('Cancel') : t('Close'))
|
|
170
|
+
}
|
|
171
|
+
icon={cancelButton?.icon}
|
|
172
|
+
variant={confirmButton ? 'outlined' : 'solid'}
|
|
173
|
+
onClick={e => {
|
|
174
|
+
e.stopPropagation();
|
|
175
|
+
cancelButton?.onClick ? cancelButton.onClick() : handleClose();
|
|
176
|
+
}}
|
|
177
|
+
type="button"
|
|
178
|
+
/>
|
|
179
|
+
{additionalButton && (
|
|
180
|
+
<Button
|
|
181
|
+
label={additionalButton.label}
|
|
182
|
+
icon={additionalButton.icon}
|
|
183
|
+
onClick={
|
|
184
|
+
!!additionalButton.onClick
|
|
185
|
+
? e => {
|
|
186
|
+
e.stopPropagation();
|
|
187
|
+
additionalButton.onClick!();
|
|
188
|
+
!additionalButton.keepOpen && handleClose();
|
|
189
|
+
}
|
|
190
|
+
: undefined
|
|
191
|
+
}
|
|
192
|
+
type="button"
|
|
193
|
+
variant={additionalButton.variant ?? 'outlined'}
|
|
194
|
+
color={additionalButton.color}
|
|
195
|
+
disabled={additionalButton.disabled}
|
|
196
|
+
/>
|
|
197
|
+
)}
|
|
198
|
+
{confirmButton && (
|
|
199
|
+
<Button
|
|
200
|
+
label={confirmButton.label || 'Potvrdi'}
|
|
201
|
+
icon={confirmButton.icon}
|
|
202
|
+
variant="solid"
|
|
203
|
+
type={confirmButton.onFormSubmit ? 'submit' : 'button'}
|
|
204
|
+
onClick={
|
|
205
|
+
!!confirmButton.onClick
|
|
206
|
+
? e => {
|
|
207
|
+
e.stopPropagation();
|
|
208
|
+
confirmButton.onClick!();
|
|
209
|
+
!confirmButton.keepOpen && handleClose();
|
|
210
|
+
}
|
|
211
|
+
: undefined
|
|
212
|
+
}
|
|
213
|
+
color={type === 'danger' ? 'danger' : undefined}
|
|
214
|
+
disabled={confirmButton.disabled}
|
|
215
|
+
/>
|
|
216
|
+
)}
|
|
217
|
+
</div>
|
|
218
|
+
)}
|
|
219
|
+
</ConditionalWrapper>
|
|
220
|
+
</div>
|
|
221
|
+
</Loader>
|
|
222
|
+
</div>,
|
|
223
|
+
rootDir
|
|
224
|
+
)
|
|
225
|
+
: null;
|
|
226
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { IKeyboardAction } from '../../../types/IKeyboard';
|
|
3
|
+
|
|
4
|
+
export const useDialogKeyboard = ({
|
|
5
|
+
isOpen,
|
|
6
|
+
onClose,
|
|
7
|
+
submit,
|
|
8
|
+
isDisabled,
|
|
9
|
+
}: {
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
submit: {
|
|
13
|
+
onEnter: () => void;
|
|
14
|
+
isDisabled?: boolean;
|
|
15
|
+
};
|
|
16
|
+
isDisabled?: boolean;
|
|
17
|
+
}) => {
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (isOpen && !isDisabled) {
|
|
20
|
+
const handleKeyDown = (event: KeyboardEvent) => {
|
|
21
|
+
const actions: IKeyboardAction[] = [
|
|
22
|
+
{ key: 'Enter', onAction: submit.onEnter!, disabled: submit.isDisabled },
|
|
23
|
+
{ key: 'Escape', onAction: onClose },
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
actions.forEach(item => {
|
|
27
|
+
if (!item.disabled && item.key === event.key) {
|
|
28
|
+
event.preventDefault();
|
|
29
|
+
event.stopPropagation();
|
|
30
|
+
item.onAction();
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
36
|
+
return () => {
|
|
37
|
+
window.removeEventListener('keydown', handleKeyDown);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}, [isOpen, submit, onClose, isDisabled]);
|
|
41
|
+
};
|