@inceptionbg/iui 2.0.4 → 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/{NoAccessPage-BllwaG2u.js → NoAccessPage-C6nBt-PN.js} +2 -2
- package/dist/{NoAccessPage-BllwaG2u.js.map → NoAccessPage-C6nBt-PN.js.map} +1 -1
- package/dist/{NotFoundPage-DVm00-sr.js → NotFoundPage-DatmJOrr.js} +2 -2
- package/dist/{NotFoundPage-DVm00-sr.js.map → NotFoundPage-DatmJOrr.js.map} +1 -1
- package/dist/icons/index.d.ts +43 -0
- package/dist/icons/index.js +1 -0
- package/dist/index.d.ts +57 -49
- 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 +15 -11
- 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,84 @@
|
|
|
1
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { Link, useLocation } from 'react-router';
|
|
4
|
+
import { ISidebarItem } from './types/ISidebar';
|
|
5
|
+
import { AddButton } from './AddButton';
|
|
6
|
+
import { ConditionalWrapper } from '../Wrappers/ConditionalWrapper';
|
|
7
|
+
import clsx from 'clsx';
|
|
8
|
+
import { faChevronDown } from '../../assets/icons';
|
|
9
|
+
import { Collapse } from '../Helper/Collapse';
|
|
10
|
+
import { Tooltip } from '../Tooltip/Tooltip';
|
|
11
|
+
|
|
12
|
+
export const SidebarItem: FC<ISidebarItem> = ({ label, icon, to, badge, menu }) => {
|
|
13
|
+
const { pathname } = useLocation();
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<>
|
|
17
|
+
<ConditionalWrapper
|
|
18
|
+
condition={!!to}
|
|
19
|
+
wrapper={children => <Link to={to!}>{children}</Link>}
|
|
20
|
+
>
|
|
21
|
+
<div
|
|
22
|
+
onClick={
|
|
23
|
+
menu
|
|
24
|
+
? () => menu.setOpenedMenu(label !== menu.openedMenu ? label : '')
|
|
25
|
+
: undefined
|
|
26
|
+
}
|
|
27
|
+
className={clsx('iui-sidebar-item item-only clickable', {
|
|
28
|
+
active:
|
|
29
|
+
to === pathname ||
|
|
30
|
+
(menu?.content.find(e => e.to === pathname) && label !== menu?.openedMenu),
|
|
31
|
+
})}
|
|
32
|
+
>
|
|
33
|
+
<FontAwesomeIcon icon={icon!} className="sidebar-item-icon" />
|
|
34
|
+
<p className="sidebar-item-label">{label}</p>
|
|
35
|
+
{!!badge && <div className="sidebar-badge">{badge > 99 ? '99+' : badge}</div>}
|
|
36
|
+
{menu && (
|
|
37
|
+
<FontAwesomeIcon
|
|
38
|
+
icon={faChevronDown}
|
|
39
|
+
className={clsx('sidebar-expand-icon', {
|
|
40
|
+
rotate: label === menu.openedMenu,
|
|
41
|
+
})}
|
|
42
|
+
/>
|
|
43
|
+
)}
|
|
44
|
+
</div>
|
|
45
|
+
</ConditionalWrapper>
|
|
46
|
+
|
|
47
|
+
{menu && (
|
|
48
|
+
<Collapse isOpen={menu.openedMenu === label}>
|
|
49
|
+
{menu.content.map(
|
|
50
|
+
({ hidden, label, to, primary, badge, addUrl, tooltip }) =>
|
|
51
|
+
!hidden && (
|
|
52
|
+
<ConditionalWrapper
|
|
53
|
+
key={label}
|
|
54
|
+
condition={!!to}
|
|
55
|
+
wrapper={children => <Link to={to!}>{children}</Link>}
|
|
56
|
+
>
|
|
57
|
+
<Tooltip
|
|
58
|
+
label={tooltip!}
|
|
59
|
+
disabled={!tooltip}
|
|
60
|
+
position="right"
|
|
61
|
+
singleLine
|
|
62
|
+
>
|
|
63
|
+
<div
|
|
64
|
+
className={clsx('iui-sidebar-item sub-item', {
|
|
65
|
+
clickable: !!to,
|
|
66
|
+
active: to === pathname,
|
|
67
|
+
primary,
|
|
68
|
+
})}
|
|
69
|
+
>
|
|
70
|
+
<p className="sidebar-item-label">{label}</p>
|
|
71
|
+
{!!badge && (
|
|
72
|
+
<div className="sidebar-badge">{badge > 99 ? '99+' : badge}</div>
|
|
73
|
+
)}
|
|
74
|
+
{!!addUrl && <AddButton link={addUrl} />}
|
|
75
|
+
</div>
|
|
76
|
+
</Tooltip>
|
|
77
|
+
</ConditionalWrapper>
|
|
78
|
+
)
|
|
79
|
+
)}
|
|
80
|
+
</Collapse>
|
|
81
|
+
)}
|
|
82
|
+
</>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
+
|
|
3
|
+
export interface ISidebarItem {
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: IconDefinition;
|
|
6
|
+
to?: string;
|
|
7
|
+
content?: ISidebarSubItem[];
|
|
8
|
+
menu?: {
|
|
9
|
+
content: ISidebarSubItem[];
|
|
10
|
+
openedMenu: string;
|
|
11
|
+
setOpenedMenu: (label: string) => void;
|
|
12
|
+
};
|
|
13
|
+
hidden?: boolean;
|
|
14
|
+
badge?: number;
|
|
15
|
+
addUrl?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ISidebarSubItem {
|
|
19
|
+
label: string;
|
|
20
|
+
to?: string;
|
|
21
|
+
content?: ISidebarItem[];
|
|
22
|
+
hidden?: boolean;
|
|
23
|
+
tooltip?: string;
|
|
24
|
+
badge?: number;
|
|
25
|
+
addUrl?: string;
|
|
26
|
+
primary?: boolean;
|
|
27
|
+
collapsed?: boolean;
|
|
28
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { FC, useEffect, useState } from 'react';
|
|
2
|
+
import { ITableColumn } from '../../../../types/ITable';
|
|
3
|
+
import { Draggable, Droppable } from 'react-beautiful-dnd';
|
|
4
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
5
|
+
import { faGripDotsVertical } from '../../../../assets/icons/solid/faGripDotsVertical';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
id: 'hidden' | 'visible';
|
|
9
|
+
items: ITableColumn[];
|
|
10
|
+
search: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const ColumnsList: FC<Props> = ({ id, items, search }) => {
|
|
14
|
+
const [filteredItems, setFilteredItems] = useState<ITableColumn[]>([]);
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
search.length &&
|
|
18
|
+
setFilteredItems(
|
|
19
|
+
items.filter(e =>
|
|
20
|
+
(typeof e.label === 'string' ? e.label : e.labelForFilter ?? '')
|
|
21
|
+
.toLocaleLowerCase()
|
|
22
|
+
.includes(search.toLocaleLowerCase())
|
|
23
|
+
)
|
|
24
|
+
);
|
|
25
|
+
}, [search, items]);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<Droppable droppableId={id}>
|
|
29
|
+
{({ droppableProps, innerRef, placeholder }) => (
|
|
30
|
+
<div {...droppableProps} ref={innerRef} className="list-box">
|
|
31
|
+
{(search.length ? filteredItems : items).map(c => (
|
|
32
|
+
<Draggable
|
|
33
|
+
key={c.id}
|
|
34
|
+
draggableId={c.id}
|
|
35
|
+
index={items.indexOf(c)}
|
|
36
|
+
isDragDisabled
|
|
37
|
+
>
|
|
38
|
+
{({ innerRef, draggableProps, dragHandleProps }) => (
|
|
39
|
+
<div
|
|
40
|
+
className="item"
|
|
41
|
+
ref={innerRef}
|
|
42
|
+
{...draggableProps}
|
|
43
|
+
{...dragHandleProps}
|
|
44
|
+
style={{
|
|
45
|
+
...draggableProps.style,
|
|
46
|
+
top: 'unset',
|
|
47
|
+
left: 'unset',
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
{c.label}
|
|
51
|
+
<FontAwesomeIcon icon={faGripDotsVertical} />
|
|
52
|
+
</div>
|
|
53
|
+
)}
|
|
54
|
+
</Draggable>
|
|
55
|
+
))}
|
|
56
|
+
{placeholder}
|
|
57
|
+
</div>
|
|
58
|
+
)}
|
|
59
|
+
</Droppable>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { FC, useEffect, useState } from 'react';
|
|
2
|
+
import { DragDropContext, OnDragEndResponder } from 'react-beautiful-dnd';
|
|
3
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
+
import { ITableColumn } from '../../../../types/ITable';
|
|
5
|
+
import { Dialog } from '../../../Dialog/Dialog';
|
|
6
|
+
import { faArrowRightArrowLeft } from '../../../../assets/icons/regular/faArrowRightArrowLeft';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
8
|
+
import { ColumnsList } from './ColumnsList';
|
|
9
|
+
import { SearchInput } from '../../../Inputs/SearchInput';
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
columns: ITableColumn[];
|
|
13
|
+
setColumns: (data: ITableColumn[]) => void;
|
|
14
|
+
isOpen: boolean;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
withSearch?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export const SetColumnsList: FC<Props> = ({
|
|
19
|
+
columns,
|
|
20
|
+
setColumns,
|
|
21
|
+
isOpen,
|
|
22
|
+
onClose,
|
|
23
|
+
withSearch,
|
|
24
|
+
}) => {
|
|
25
|
+
const [hidden, setHidden] = useState<ITableColumn[]>([]);
|
|
26
|
+
const [visible, setVisible] = useState<ITableColumn[]>([]);
|
|
27
|
+
const [searchHidden, setSearchHidden] = useState('');
|
|
28
|
+
const [searchVisible, setSearchVisible] = useState('');
|
|
29
|
+
|
|
30
|
+
const { t } = useTranslation();
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (isOpen) {
|
|
34
|
+
let hiddenCols: ITableColumn[] = [];
|
|
35
|
+
let visibleCols: ITableColumn[] = [];
|
|
36
|
+
columns.forEach(
|
|
37
|
+
col =>
|
|
38
|
+
col.id !== 'actions' &&
|
|
39
|
+
!col.unavailable &&
|
|
40
|
+
(!!col.hidden ? hiddenCols.push(col) : visibleCols.push(col))
|
|
41
|
+
);
|
|
42
|
+
setHidden(hiddenCols);
|
|
43
|
+
setVisible(visibleCols);
|
|
44
|
+
}
|
|
45
|
+
}, [isOpen, columns]);
|
|
46
|
+
|
|
47
|
+
const onDragEnd: OnDragEndResponder = ({ source, destination }) => {
|
|
48
|
+
if (!destination) return;
|
|
49
|
+
const hiddenCols = [...hidden];
|
|
50
|
+
const visibleCols = [...visible];
|
|
51
|
+
const destinationIsHidden = destination.droppableId === 'hidden';
|
|
52
|
+
|
|
53
|
+
const sourceList = source.droppableId === 'hidden' ? hiddenCols : visibleCols;
|
|
54
|
+
const destinationList = destinationIsHidden ? hiddenCols : visibleCols;
|
|
55
|
+
|
|
56
|
+
const [removed] = sourceList.splice(source.index, 1);
|
|
57
|
+
destinationList.splice(destination.index, 0, removed);
|
|
58
|
+
if (source.droppableId !== destination.droppableId) {
|
|
59
|
+
destinationList[destination.index].hidden = destinationIsHidden;
|
|
60
|
+
setHidden(hiddenCols);
|
|
61
|
+
setVisible(visibleCols);
|
|
62
|
+
} else {
|
|
63
|
+
destinationIsHidden ? setHidden(hiddenCols) : setVisible(visibleCols);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const onSubmit = () => {
|
|
68
|
+
const newColumns = [...visible, ...hidden];
|
|
69
|
+
const lastCol = columns[columns.length - 1];
|
|
70
|
+
if (lastCol.id === 'actions') {
|
|
71
|
+
newColumns.push(lastCol);
|
|
72
|
+
}
|
|
73
|
+
setColumns(newColumns);
|
|
74
|
+
onClose();
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<DragDropContext onDragEnd={onDragEnd}>
|
|
79
|
+
<Dialog
|
|
80
|
+
isOpen={isOpen}
|
|
81
|
+
onClose={onClose}
|
|
82
|
+
confirmButton={{
|
|
83
|
+
label: t('Confirm'),
|
|
84
|
+
onClick: onSubmit,
|
|
85
|
+
}}
|
|
86
|
+
cancelButton={{ label: t('Cancel') }}
|
|
87
|
+
noBackgroundClick
|
|
88
|
+
>
|
|
89
|
+
<div className="dual-list-container">
|
|
90
|
+
<p className="pb-3">{t('DragDropListsInfo')}</p>
|
|
91
|
+
<div className="dual-list-content">
|
|
92
|
+
<p className="bold ml-2">{t('HiddenColumns')}:</p>
|
|
93
|
+
<div />
|
|
94
|
+
<p className="bold ml-2">{t('SelectedColumns')}:</p>
|
|
95
|
+
|
|
96
|
+
{withSearch && (
|
|
97
|
+
<>
|
|
98
|
+
<SearchInput onSearch={setSearchHidden} />
|
|
99
|
+
<div />
|
|
100
|
+
<SearchInput onSearch={setSearchVisible} />
|
|
101
|
+
</>
|
|
102
|
+
)}
|
|
103
|
+
<ColumnsList id="hidden" items={hidden} search={searchHidden} />
|
|
104
|
+
<div className="exchange-icon">
|
|
105
|
+
<FontAwesomeIcon icon={faArrowRightArrowLeft} />
|
|
106
|
+
</div>
|
|
107
|
+
<ColumnsList id="visible" items={visible} search={searchVisible} />
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
</Dialog>
|
|
111
|
+
</DragDropContext>
|
|
112
|
+
);
|
|
113
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { FC, useState } from 'react';
|
|
2
|
+
import { faEllipsisVertical } from '../../../../assets/icons';
|
|
3
|
+
import { IconButton } from '../../../Button/IconButton';
|
|
4
|
+
import { MenuItem } from '../../../Menu/MenuItem';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { Menu } from '../../../Menu/Menu';
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
item: any;
|
|
10
|
+
setSelectedItem?: (item: any) => void;
|
|
11
|
+
setItemToDeleteUuid?: (uuid: string) => void;
|
|
12
|
+
actions?: {
|
|
13
|
+
label: string;
|
|
14
|
+
onClick: (uuid: string) => void;
|
|
15
|
+
hidden?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const ItemActionsMenu: FC<Props> = ({
|
|
21
|
+
item,
|
|
22
|
+
setSelectedItem,
|
|
23
|
+
setItemToDeleteUuid,
|
|
24
|
+
actions,
|
|
25
|
+
}) => {
|
|
26
|
+
const [menuOpen, setMenuOpen] = useState(false);
|
|
27
|
+
|
|
28
|
+
const { t } = useTranslation();
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Menu
|
|
32
|
+
isOpen={menuOpen}
|
|
33
|
+
onClose={() => setMenuOpen(false)}
|
|
34
|
+
placement="bottom-right"
|
|
35
|
+
renderButton={ref => (
|
|
36
|
+
<IconButton
|
|
37
|
+
ref={ref}
|
|
38
|
+
icon={faEllipsisVertical}
|
|
39
|
+
active={menuOpen}
|
|
40
|
+
onClick={e => {
|
|
41
|
+
e.stopPropagation();
|
|
42
|
+
setMenuOpen(!menuOpen);
|
|
43
|
+
}}
|
|
44
|
+
/>
|
|
45
|
+
)}
|
|
46
|
+
>
|
|
47
|
+
{!!setSelectedItem && (
|
|
48
|
+
<MenuItem
|
|
49
|
+
label={t('Edit')}
|
|
50
|
+
onClick={e => {
|
|
51
|
+
e.stopPropagation();
|
|
52
|
+
setSelectedItem(item);
|
|
53
|
+
setMenuOpen(false);
|
|
54
|
+
}}
|
|
55
|
+
/>
|
|
56
|
+
)}
|
|
57
|
+
{actions?.map(
|
|
58
|
+
action =>
|
|
59
|
+
!action.hidden && (
|
|
60
|
+
<MenuItem
|
|
61
|
+
key={action.label}
|
|
62
|
+
label={action.label}
|
|
63
|
+
disabled={!!action.disabled}
|
|
64
|
+
onClick={e => {
|
|
65
|
+
e.stopPropagation();
|
|
66
|
+
action.onClick(item.uuid);
|
|
67
|
+
setMenuOpen(false);
|
|
68
|
+
}}
|
|
69
|
+
/>
|
|
70
|
+
)
|
|
71
|
+
)}
|
|
72
|
+
{!!setItemToDeleteUuid && (
|
|
73
|
+
<MenuItem
|
|
74
|
+
label={t('Delete')}
|
|
75
|
+
onClick={e => {
|
|
76
|
+
e.stopPropagation();
|
|
77
|
+
setItemToDeleteUuid(item.uuid);
|
|
78
|
+
setMenuOpen(false);
|
|
79
|
+
}}
|
|
80
|
+
/>
|
|
81
|
+
)}
|
|
82
|
+
</Menu>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { FC, RefObject } from 'react';
|
|
2
|
+
import { faCheck, faXmark } from '../../../../assets/icons';
|
|
3
|
+
import { IconButton } from '../../../Button/IconButton';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
setData: (item: any) => void;
|
|
7
|
+
clearItem: () => void;
|
|
8
|
+
inputFocusRef?: RefObject<any>;
|
|
9
|
+
defaultDataValue?: any;
|
|
10
|
+
}
|
|
11
|
+
export const ItemEditOptionsButtons: FC<Props> = ({
|
|
12
|
+
setData,
|
|
13
|
+
clearItem,
|
|
14
|
+
inputFocusRef,
|
|
15
|
+
defaultDataValue,
|
|
16
|
+
}) => {
|
|
17
|
+
return (
|
|
18
|
+
<div className="flex center gap-1">
|
|
19
|
+
<IconButton icon={faCheck} className="p-1" />
|
|
20
|
+
<IconButton
|
|
21
|
+
icon={faXmark}
|
|
22
|
+
className="p-1"
|
|
23
|
+
onClick={() => {
|
|
24
|
+
setData(defaultDataValue || {});
|
|
25
|
+
inputFocusRef?.current?.focus();
|
|
26
|
+
clearItem();
|
|
27
|
+
}}
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { FC, useEffect } from 'react';
|
|
2
|
+
import { ITableDataItem, ITableEditRow } from '../../../../types/ITable';
|
|
3
|
+
import { ItemEditOptionsButtons } from './ItemEditOptionsButtons';
|
|
4
|
+
|
|
5
|
+
export const TableEditRow: FC<ITableEditRow> = ({
|
|
6
|
+
columns,
|
|
7
|
+
defaultDataValue,
|
|
8
|
+
data,
|
|
9
|
+
setData,
|
|
10
|
+
item,
|
|
11
|
+
clearItem,
|
|
12
|
+
inputFocusRef,
|
|
13
|
+
}) => {
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
inputFocusRef?.current?.focus();
|
|
16
|
+
setData(item ?? defaultDataValue ?? {});
|
|
17
|
+
}, [item, defaultDataValue, inputFocusRef, setData]);
|
|
18
|
+
|
|
19
|
+
let cells = {
|
|
20
|
+
...data,
|
|
21
|
+
actions: {
|
|
22
|
+
value: (
|
|
23
|
+
<ItemEditOptionsButtons
|
|
24
|
+
setData={setData}
|
|
25
|
+
clearItem={clearItem}
|
|
26
|
+
defaultDataValue={defaultDataValue}
|
|
27
|
+
inputFocusRef={inputFocusRef}
|
|
28
|
+
/>
|
|
29
|
+
),
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// Object.keys(cells).forEach(key => {
|
|
34
|
+
// isValidElement(cells[key].value) && (cells[key].className = 'p-1');
|
|
35
|
+
// });
|
|
36
|
+
|
|
37
|
+
const rowData: ITableDataItem = { uuid: item?.uuid, cells };
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<tr data-id={rowData.uuid} className="edit-row">
|
|
41
|
+
{columns.map(
|
|
42
|
+
column =>
|
|
43
|
+
!column.hidden && (
|
|
44
|
+
<td
|
|
45
|
+
key={column.id}
|
|
46
|
+
align={column.align}
|
|
47
|
+
colSpan={rowData.cells[column.id]?.span}
|
|
48
|
+
className={rowData.cells[column.id]?.className}
|
|
49
|
+
>
|
|
50
|
+
{rowData.cells[column.id]?.value}
|
|
51
|
+
</td>
|
|
52
|
+
)
|
|
53
|
+
)}
|
|
54
|
+
</tr>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ITableFilterItem } from '../../../types/ITable';
|
|
3
|
+
// import { Button } from '../../Button/Button';
|
|
4
|
+
// import { useTranslation } from 'react-i18next';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
item: ITableFilterItem;
|
|
8
|
+
}
|
|
9
|
+
export const FilterItem: FC<Props> = ({ item }) => {
|
|
10
|
+
// const { t } = useTranslation();
|
|
11
|
+
return (
|
|
12
|
+
<div key={item.label} className="table-filter-item">
|
|
13
|
+
{/* Added zero-width non-breaking space symbol (⁠)
|
|
14
|
+
because of losing focus from input field when first letter of the label is pressed. */}
|
|
15
|
+
{/* <p className="label">⁠{item.label}</p> */}
|
|
16
|
+
<div className="field">{item.field}</div>
|
|
17
|
+
{/* <Button label={t('Delete')} onClick={() => item.resetField()} size="m" /> */}
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { FC, Fragment } from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { ITableColumn } from '../../../../types/ITable';
|
|
4
|
+
import { TableHeaderRow } from './TableHeaderRow';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
columns: ITableColumn[];
|
|
8
|
+
customHeader?: ITableColumn[][];
|
|
9
|
+
headerWrap?: boolean;
|
|
10
|
+
sticky?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export const HeaderTable: FC<Props> = ({ columns, customHeader, headerWrap, sticky }) => (
|
|
13
|
+
<thead
|
|
14
|
+
className={clsx({
|
|
15
|
+
'no-wrap': !headerWrap,
|
|
16
|
+
'sticky-header': sticky,
|
|
17
|
+
})}
|
|
18
|
+
>
|
|
19
|
+
<tr>
|
|
20
|
+
<th className="border-row" colSpan={columns.length} />
|
|
21
|
+
</tr>
|
|
22
|
+
{customHeader ? (
|
|
23
|
+
customHeader?.map((row, i) => (
|
|
24
|
+
// No array manipulation will be performed, so using key 'i' is acceptable.
|
|
25
|
+
<Fragment key={i}>
|
|
26
|
+
<TableHeaderRow row={row} />
|
|
27
|
+
{(sticky || i + 1 < customHeader.length) && (
|
|
28
|
+
<tr>
|
|
29
|
+
<th className="border-row" colSpan={columns.length} />
|
|
30
|
+
</tr>
|
|
31
|
+
)}
|
|
32
|
+
</Fragment>
|
|
33
|
+
))
|
|
34
|
+
) : (
|
|
35
|
+
<>
|
|
36
|
+
<TableHeaderRow row={columns} />
|
|
37
|
+
{sticky && (
|
|
38
|
+
<tr>
|
|
39
|
+
<div className="border-row" />
|
|
40
|
+
</tr>
|
|
41
|
+
)}
|
|
42
|
+
</>
|
|
43
|
+
)}
|
|
44
|
+
</thead>
|
|
45
|
+
);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ITableColumn } from '../../../../types/ITable';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
row: ITableColumn[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const TableHeaderRow: FC<Props> = ({ row }) => (
|
|
9
|
+
<tr>
|
|
10
|
+
{row.map(col => (
|
|
11
|
+
<th
|
|
12
|
+
key={col.id}
|
|
13
|
+
colSpan={col.colSpan}
|
|
14
|
+
rowSpan={col.rowSpan}
|
|
15
|
+
className={col.color}
|
|
16
|
+
style={
|
|
17
|
+
col.minWidth
|
|
18
|
+
? { minWidth: col.minWidth }
|
|
19
|
+
: col.width
|
|
20
|
+
? { width: col.width }
|
|
21
|
+
: undefined
|
|
22
|
+
}
|
|
23
|
+
hidden={col.hidden}
|
|
24
|
+
>
|
|
25
|
+
<div className="flex align-center">
|
|
26
|
+
{typeof col.label === 'string' ? (
|
|
27
|
+
<p className={`full-width p-3 text-${col.align || 'left'}`}>{col.label}</p>
|
|
28
|
+
) : (
|
|
29
|
+
<div className={`full-width px-3 text-${col.align || 'left'}`}>
|
|
30
|
+
{col.label}
|
|
31
|
+
</div>
|
|
32
|
+
)}
|
|
33
|
+
</div>
|
|
34
|
+
</th>
|
|
35
|
+
))}
|
|
36
|
+
</tr>
|
|
37
|
+
);
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { FC, useEffect } from 'react';
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
3
|
+
import { faFileArrowDown } from '../../../../assets/icons/regular/faFileArrowDown';
|
|
4
|
+
import { faPrint } from '../../../../assets/icons/solid/faPrint';
|
|
5
|
+
import { faXmark } from '../../../../assets/icons/solid/faXmark';
|
|
6
|
+
import { ICustomPrintData } from '../../../../types/ITable';
|
|
7
|
+
import { formatDate, getCurrentDateFormatted } from '../../../../utils/DateUtils';
|
|
8
|
+
import { Button } from '../../../Button/Button';
|
|
9
|
+
import { useTranslation } from 'react-i18next';
|
|
10
|
+
import { rootDir } from '../../../../utils/RootDir';
|
|
11
|
+
import { useHideZendesk } from '../../../../hooks/useZendesk';
|
|
12
|
+
|
|
13
|
+
interface Props extends ICustomPrintData {
|
|
14
|
+
isOpen: boolean;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
}
|
|
17
|
+
export const CustomTablePrint: FC<Props> = ({
|
|
18
|
+
isOpen,
|
|
19
|
+
onClose,
|
|
20
|
+
label,
|
|
21
|
+
organization,
|
|
22
|
+
filters,
|
|
23
|
+
content,
|
|
24
|
+
saveXlsx,
|
|
25
|
+
}) => {
|
|
26
|
+
const { t } = useTranslation();
|
|
27
|
+
useHideZendesk();
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
rootDir?.classList.add('hidden');
|
|
31
|
+
return () => {
|
|
32
|
+
rootDir?.classList.remove('hidden');
|
|
33
|
+
};
|
|
34
|
+
}, []);
|
|
35
|
+
|
|
36
|
+
return isOpen
|
|
37
|
+
? createPortal(
|
|
38
|
+
<div className="iui-print-dialog">
|
|
39
|
+
<div className="content">
|
|
40
|
+
<div className="flex justify-between">
|
|
41
|
+
{organization ? (
|
|
42
|
+
<div>
|
|
43
|
+
<p className="name">{organization.name}</p>
|
|
44
|
+
{organization.taxId && <p>{`${t('TaxId')}: ${organization.taxId}`}</p>}
|
|
45
|
+
{organization.registrationNumber && (
|
|
46
|
+
<p>{`${t('BusinessCode')}: ${organization.registrationNumber}`}</p>
|
|
47
|
+
)}
|
|
48
|
+
{organization.jbkjs && <p>JBKJS: {organization.jbkjs}</p>}
|
|
49
|
+
{organization.email && <p>Email: {organization.email}</p>}
|
|
50
|
+
</div>
|
|
51
|
+
) : (
|
|
52
|
+
<div />
|
|
53
|
+
)}
|
|
54
|
+
<div className="text-right">
|
|
55
|
+
<p>{`${t('PrintDate')}: ${getCurrentDateFormatted()}`}</p>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
<h3 className="my-3 text-center">{label}</h3>
|
|
59
|
+
{filters && (
|
|
60
|
+
<div className="flex justify-between">
|
|
61
|
+
<div>
|
|
62
|
+
{filters.basic?.map(
|
|
63
|
+
e =>
|
|
64
|
+
!!e.value && (
|
|
65
|
+
<div key={e.value} className="mb-2">
|
|
66
|
+
<p>{`${e.label}: ${e.value}`}</p>
|
|
67
|
+
</div>
|
|
68
|
+
)
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
71
|
+
{filters.date && (
|
|
72
|
+
<div>
|
|
73
|
+
{filters.date.map(
|
|
74
|
+
e =>
|
|
75
|
+
(!!e.from || !!e.to) && (
|
|
76
|
+
<div key={e.label} className="mb-2 text-right">
|
|
77
|
+
<p>
|
|
78
|
+
{e.label} {!!e.from && `${t('from')} ${formatDate(e.from)}`}{' '}
|
|
79
|
+
{`${t('to')} ${formatDate(e.to || new Date().toString())}`}
|
|
80
|
+
</p>
|
|
81
|
+
</div>
|
|
82
|
+
)
|
|
83
|
+
)}
|
|
84
|
+
</div>
|
|
85
|
+
)}
|
|
86
|
+
</div>
|
|
87
|
+
)}
|
|
88
|
+
{content}
|
|
89
|
+
</div>
|
|
90
|
+
<div className="iui-print-actions no-print">
|
|
91
|
+
<Button
|
|
92
|
+
label={t('Cancel')}
|
|
93
|
+
icon={faXmark}
|
|
94
|
+
onClick={e => {
|
|
95
|
+
e.stopPropagation();
|
|
96
|
+
onClose();
|
|
97
|
+
}}
|
|
98
|
+
className="mr-3"
|
|
99
|
+
/>
|
|
100
|
+
{!!saveXlsx && (
|
|
101
|
+
<Button
|
|
102
|
+
label={t('SaveXlsx')}
|
|
103
|
+
icon={faFileArrowDown}
|
|
104
|
+
onClick={() => saveXlsx()}
|
|
105
|
+
className="mr-3"
|
|
106
|
+
/>
|
|
107
|
+
)}
|
|
108
|
+
<Button label={t('Print')} icon={faPrint} onClick={() => window.print()} />
|
|
109
|
+
</div>
|
|
110
|
+
</div>,
|
|
111
|
+
document.body
|
|
112
|
+
)
|
|
113
|
+
: null;
|
|
114
|
+
};
|