@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,80 @@
|
|
|
1
|
+
// import { FC, useState } from 'react';
|
|
2
|
+
// import { MenuItem } from '../../../Menu/MenuItem';
|
|
3
|
+
// import { useTranslation } from 'react-i18next';
|
|
4
|
+
// import { Dialog } from '../../../Dialog/Dialog';
|
|
5
|
+
// import { createReportTemplate } from './repo/TemplateRepo';
|
|
6
|
+
// import { IReportTemplate, IReportTemplateData } from '../../../../types/ITable';
|
|
7
|
+
// import { deleteEmptyProps } from '../../../../utils/ObjectUtils';
|
|
8
|
+
// import { TextInput } from '../../../Inputs/TextInput';
|
|
9
|
+
// import { Checkbox } from '../../../Inputs/Checkbox';
|
|
10
|
+
// import { convertSearchToReportTemplateFilter } from '../../../../utils/TableUtils';
|
|
11
|
+
|
|
12
|
+
// interface Props {
|
|
13
|
+
// identifier: string;
|
|
14
|
+
// data: IReportTemplateData;
|
|
15
|
+
// onSubmitCallback: () => void;
|
|
16
|
+
// allowPublicCreate?: boolean;
|
|
17
|
+
// }
|
|
18
|
+
|
|
19
|
+
// export const TemplateCreate: FC<Props> = ({
|
|
20
|
+
// identifier,
|
|
21
|
+
// data: { searchData, visibleColumns, sorts },
|
|
22
|
+
// onSubmitCallback,
|
|
23
|
+
// allowPublicCreate,
|
|
24
|
+
// }) => {
|
|
25
|
+
// const [isOpen, setIsOpen] = useState(false);
|
|
26
|
+
// const [formData, setFormData] = useState<Partial<IReportTemplate>>({});
|
|
27
|
+
// const [isLoading, setIsLoading] = useState(false);
|
|
28
|
+
|
|
29
|
+
// const { t } = useTranslation();
|
|
30
|
+
|
|
31
|
+
// const onFormSubmit = () => {
|
|
32
|
+
// setIsLoading(true);
|
|
33
|
+
// const data = deleteEmptyProps({
|
|
34
|
+
// identifier,
|
|
35
|
+
// name: formData.name,
|
|
36
|
+
// isPublic: formData.isPublic,
|
|
37
|
+
|
|
38
|
+
// filterValues: convertSearchToReportTemplateFilter(searchData),
|
|
39
|
+
// columns: visibleColumns,
|
|
40
|
+
// sorts,
|
|
41
|
+
// }) as Partial<IReportTemplate>;
|
|
42
|
+
|
|
43
|
+
// createReportTemplate(data)
|
|
44
|
+
// .then(() => {
|
|
45
|
+
// setIsOpen(false);
|
|
46
|
+
// onSubmitCallback();
|
|
47
|
+
// })
|
|
48
|
+
// .catch(() => {})
|
|
49
|
+
// .finally(() => setIsLoading(false));
|
|
50
|
+
// };
|
|
51
|
+
|
|
52
|
+
// return (
|
|
53
|
+
// <>
|
|
54
|
+
// <MenuItem label={t('CreateTemplateLong')} onClick={() => setIsOpen(true)} />
|
|
55
|
+
// <Dialog
|
|
56
|
+
// title={t('CreateTemplate')}
|
|
57
|
+
// isOpen={isOpen}
|
|
58
|
+
// onClose={() => setIsOpen(false)}
|
|
59
|
+
// size="l"
|
|
60
|
+
// isLoading={isLoading}
|
|
61
|
+
// confirmButton={{ onFormSubmit, keepOpen: true }}
|
|
62
|
+
// >
|
|
63
|
+
// <div className="flex column gap-3">
|
|
64
|
+
// <TextInput
|
|
65
|
+
// label={t('Name')}
|
|
66
|
+
// value={formData.name}
|
|
67
|
+
// setValue={name => setFormData({ ...formData, name })}
|
|
68
|
+
// />
|
|
69
|
+
// {allowPublicCreate && (
|
|
70
|
+
// <Checkbox
|
|
71
|
+
// label={t('PublicTemplate')}
|
|
72
|
+
// value={formData.isPublic}
|
|
73
|
+
// setValue={isPublic => setFormData({ ...formData, isPublic })}
|
|
74
|
+
// />
|
|
75
|
+
// )}
|
|
76
|
+
// </div>
|
|
77
|
+
// </Dialog>
|
|
78
|
+
// </>
|
|
79
|
+
// );
|
|
80
|
+
// };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// import { FC } from 'react';
|
|
2
|
+
// import { MenuItem } from '../../../Menu/MenuItem';
|
|
3
|
+
// import { useTranslation } from 'react-i18next';
|
|
4
|
+
// import { createReportTemplate } from './repo/TemplateRepo';
|
|
5
|
+
// import { IReportTemplate, IReportTemplateData } from '../../../../types/ITable';
|
|
6
|
+
// import { deleteEmptyProps } from '../../../../utils/ObjectUtils';
|
|
7
|
+
// import { convertSearchToReportTemplateFilter } from '../../../../utils/TableUtils';
|
|
8
|
+
|
|
9
|
+
// interface Props {
|
|
10
|
+
// identifier: string;
|
|
11
|
+
// data: IReportTemplateData;
|
|
12
|
+
// onClose: () => void;
|
|
13
|
+
// }
|
|
14
|
+
|
|
15
|
+
// export const TemplateCreateDefault: FC<Props> = ({
|
|
16
|
+
// identifier,
|
|
17
|
+
// data: { searchData, visibleColumns, sorts },
|
|
18
|
+
// onClose,
|
|
19
|
+
// }) => {
|
|
20
|
+
// const { t } = useTranslation();
|
|
21
|
+
|
|
22
|
+
// const onSubmit = () => {
|
|
23
|
+
// const data: Partial<IReportTemplate> = deleteEmptyProps({
|
|
24
|
+
// identifier,
|
|
25
|
+
// name: identifier,
|
|
26
|
+
// isPublic: false,
|
|
27
|
+
// isDefault: true,
|
|
28
|
+
// filterValues: convertSearchToReportTemplateFilter(searchData),
|
|
29
|
+
// columns: visibleColumns,
|
|
30
|
+
// sorts,
|
|
31
|
+
// });
|
|
32
|
+
|
|
33
|
+
// createReportTemplate(data);
|
|
34
|
+
// };
|
|
35
|
+
|
|
36
|
+
// return (
|
|
37
|
+
// <MenuItem
|
|
38
|
+
// label={t('CreateDefaultTemplate')}
|
|
39
|
+
// onClick={() => {
|
|
40
|
+
// onSubmit();
|
|
41
|
+
// onClose();
|
|
42
|
+
// }}
|
|
43
|
+
// />
|
|
44
|
+
// );
|
|
45
|
+
// };
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// import { FC, useState } from 'react';
|
|
2
|
+
// import { MenuItem } from '../../../Menu/MenuItem';
|
|
3
|
+
// import { useTranslation } from 'react-i18next';
|
|
4
|
+
// import { Dialog } from '../../../Dialog/Dialog';
|
|
5
|
+
// import {
|
|
6
|
+
// IReportTemplate,
|
|
7
|
+
// ITableColumn,
|
|
8
|
+
// ITableDataItem,
|
|
9
|
+
// ITableFilter,
|
|
10
|
+
// } from '../../../../types/ITable';
|
|
11
|
+
// import { Table } from '../../Table';
|
|
12
|
+
// import { deleteReportTemplate } from './repo/TemplateRepo';
|
|
13
|
+
// import { deleteProps } from '../../../../utils/ObjectUtils';
|
|
14
|
+
// import { DeleteItemDialog } from '../../../Dialog/DeleteItemDialog';
|
|
15
|
+
// import { IAnyObject } from '../../../../types/IBasic';
|
|
16
|
+
// import { TextInput } from '../../../Inputs/TextInput';
|
|
17
|
+
// import { Select } from '../../../Inputs/Selects/Select';
|
|
18
|
+
// import {
|
|
19
|
+
// getActiveFilterNumber,
|
|
20
|
+
// getVisibleColumnsIds,
|
|
21
|
+
// } from '../../../../utils/TableUtils';
|
|
22
|
+
|
|
23
|
+
// interface Props {
|
|
24
|
+
// identifier: string;
|
|
25
|
+
// onSelect: (template: IReportTemplate) => void;
|
|
26
|
+
// }
|
|
27
|
+
|
|
28
|
+
// export const TemplateList: FC<Props> = ({ identifier, onSelect }) => {
|
|
29
|
+
// const [isOpen, setIsOpen] = useState(false);
|
|
30
|
+
// const [data, setData] = useState<ITableDataItem[]>([]);
|
|
31
|
+
// const [limit, setLimit] = useState(5);
|
|
32
|
+
// const [offset, setOffset] = useState(0);
|
|
33
|
+
// const [totalRows, setTotalRows] = useState(0);
|
|
34
|
+
// const [search, setSearch] = useState<{ nameLike?: string }>({});
|
|
35
|
+
// const [searchData, setSearchData] = useState<{ nameLike?: string }>({});
|
|
36
|
+
// const [isLoading, setIsLoading] = useState(false);
|
|
37
|
+
// const [itemToDeleteUuid, setItemToDeleteUuid] = useState('');
|
|
38
|
+
|
|
39
|
+
// const { t } = useTranslation();
|
|
40
|
+
|
|
41
|
+
// const columns: ITableColumn[] = [
|
|
42
|
+
// { id: 'name', label: t('Name') },
|
|
43
|
+
// { id: 'public', label: t('PublicTemplate') },
|
|
44
|
+
// { id: 'actions', label: t('Actions'), width: '70px' },
|
|
45
|
+
// ];
|
|
46
|
+
|
|
47
|
+
// const handleGetTemplates = () => [];
|
|
48
|
+
// // useCallback(() => {
|
|
49
|
+
// // if (isOpen) {
|
|
50
|
+
// // setIsLoading(true);
|
|
51
|
+
// // getReportTemplates({ limit, offset }, { identifier, ...deleteEmptyProps(search) }, [
|
|
52
|
+
// // 'FILTER_VALUES',
|
|
53
|
+
// // ])
|
|
54
|
+
// // .then(({ templates, totalRows }) => {
|
|
55
|
+
// // setData(
|
|
56
|
+
// // templates.map(
|
|
57
|
+
// // e =>
|
|
58
|
+
// // ({
|
|
59
|
+
// // uuid: e.uuid,
|
|
60
|
+
// // onRowClick: () => {
|
|
61
|
+
// // onSelect(e);
|
|
62
|
+
// // setIsOpen(false);
|
|
63
|
+
// // },
|
|
64
|
+
// // cells: {
|
|
65
|
+
// // name: { value: e.name },
|
|
66
|
+
// // public: { value: t(e.isPublic ? 'Yes' : 'No') },
|
|
67
|
+
// // actions: {
|
|
68
|
+
// // value: (
|
|
69
|
+
// // <ItemActionsMenu
|
|
70
|
+
// // item={e}
|
|
71
|
+
// // // setSelectedItem={e => setSelectedItem(e)}
|
|
72
|
+
// // setItemToDeleteUuid={() => setItemToDeleteUuid(e.uuid)}
|
|
73
|
+
// // />
|
|
74
|
+
// // ),
|
|
75
|
+
// // unclickable: true,
|
|
76
|
+
// // },
|
|
77
|
+
// // },
|
|
78
|
+
// // } as ITableDataItem)
|
|
79
|
+
// // )
|
|
80
|
+
// // );
|
|
81
|
+
// // setTotalRows(totalRows);
|
|
82
|
+
// // })
|
|
83
|
+
// // .catch(() => {})
|
|
84
|
+
// // .finally(() => setIsLoading(false));
|
|
85
|
+
// // }
|
|
86
|
+
// // }, [isOpen, limit, offset, identifier, search]);
|
|
87
|
+
|
|
88
|
+
// // useEffect(handleGetTemplates, [handleGetTemplates]);
|
|
89
|
+
|
|
90
|
+
// return (
|
|
91
|
+
// <>
|
|
92
|
+
// <MenuItem label={t('SelectTemplate')} onClick={() => setIsOpen(true)} />
|
|
93
|
+
// <Dialog
|
|
94
|
+
// title={t('TemplateList')}
|
|
95
|
+
// isOpen={isOpen}
|
|
96
|
+
// onClose={() => setIsOpen(false)}
|
|
97
|
+
// size="l"
|
|
98
|
+
// >
|
|
99
|
+
// <Table
|
|
100
|
+
// columns={columns}
|
|
101
|
+
// data={data}
|
|
102
|
+
// isLoading={isLoading}
|
|
103
|
+
// serverSidePagination={{ limit, offset, setLimit, setOffset, totalRows }}
|
|
104
|
+
// filterData={{
|
|
105
|
+
// activeFilterNo: getActiveFilterNumber(search),
|
|
106
|
+
// columns: getVisibleColumnsIds(columns),
|
|
107
|
+
// filters: filters(searchData, setSearchData, t),
|
|
108
|
+
// search,
|
|
109
|
+
// searchData,
|
|
110
|
+
// setSearchData,
|
|
111
|
+
// onSubmit: (search: IAnyObject) => {
|
|
112
|
+
// setOffset(0);
|
|
113
|
+
// setSearch(search);
|
|
114
|
+
// },
|
|
115
|
+
// }}
|
|
116
|
+
// />
|
|
117
|
+
// </Dialog>
|
|
118
|
+
// <DeleteItemDialog
|
|
119
|
+
// itemUuid={itemToDeleteUuid}
|
|
120
|
+
// setItemUuid={setItemToDeleteUuid}
|
|
121
|
+
// textId="Template"
|
|
122
|
+
// deleteItemFunction={deleteReportTemplate}
|
|
123
|
+
// reloadItems={handleGetTemplates}
|
|
124
|
+
// />
|
|
125
|
+
// </>
|
|
126
|
+
// );
|
|
127
|
+
// };
|
|
128
|
+
|
|
129
|
+
// const filters: (
|
|
130
|
+
// search: IAnyObject,
|
|
131
|
+
// setSearch: (search: IAnyObject) => void,
|
|
132
|
+
// t: any
|
|
133
|
+
// ) => ITableFilter = (search, setSearch, t) => ({
|
|
134
|
+
// name: {
|
|
135
|
+
// label: t('Name'),
|
|
136
|
+
// field: (
|
|
137
|
+
// <TextInput
|
|
138
|
+
// placeholder={t('AddInput') + '...'}
|
|
139
|
+
// value={search.nameLike}
|
|
140
|
+
// setValue={nameLike => setSearch({ ...search, nameLike })}
|
|
141
|
+
// />
|
|
142
|
+
// ),
|
|
143
|
+
// resetField: () => setSearch(deleteProps(search, ['nameLike'])),
|
|
144
|
+
// },
|
|
145
|
+
// public: {
|
|
146
|
+
// label: t('PublicTemplates'),
|
|
147
|
+
// field: (
|
|
148
|
+
// <Select
|
|
149
|
+
// placeholder={t('Choose')}
|
|
150
|
+
// value={
|
|
151
|
+
// search.isPublic !== undefined
|
|
152
|
+
// ? {
|
|
153
|
+
// value: search.isPublic,
|
|
154
|
+
// label: t(search.isPublic ? 'Yes' : 'No'),
|
|
155
|
+
// }
|
|
156
|
+
// : null
|
|
157
|
+
// }
|
|
158
|
+
// options={[
|
|
159
|
+
// { value: true, label: t(`Yes`) },
|
|
160
|
+
// { value: false, label: t(`No`) },
|
|
161
|
+
// ]}
|
|
162
|
+
// onChange={e => setSearch({ ...search, isPublic: e.value })}
|
|
163
|
+
// />
|
|
164
|
+
// ),
|
|
165
|
+
// resetField: () => setSearch(deleteProps(search, ['isPublic'])),
|
|
166
|
+
// },
|
|
167
|
+
// });
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// import { IPagination, IReportTemplate } from '../../../../../types/ITable';
|
|
2
|
+
// import { getActiveOrgUuid } from '../../../../../utils/LocalStorageHelper';
|
|
3
|
+
|
|
4
|
+
// const baseUrl =
|
|
5
|
+
// window.location.host.includes('test.inception.rs') ||
|
|
6
|
+
// window.location.host.includes('web-bankt.erstebank.rs') ||
|
|
7
|
+
// window.location.host.includes('localhost:')
|
|
8
|
+
// ? 'https://report-templates.api.test.inception.rs'
|
|
9
|
+
// : 'https://report-templates.api.inception.rs';
|
|
10
|
+
|
|
11
|
+
// export const getReportTemplates = (
|
|
12
|
+
// pagination: IPagination,
|
|
13
|
+
// search: { identifier: string; nameLike?: string; onlyLoggedInUserTemplates?: boolean },
|
|
14
|
+
// fetchOptions?: ('SORT' | 'FILTER_VALUES' | 'COLUMNS' | 'CREATED_BY' | 'ORGANIZATION')[]
|
|
15
|
+
// ) =>
|
|
16
|
+
// axiosInstance
|
|
17
|
+
// .get('/report-templates', {
|
|
18
|
+
// params: {
|
|
19
|
+
// ...pagination,
|
|
20
|
+
// ...search,
|
|
21
|
+
// fetchOptions,
|
|
22
|
+
// organizationUuid: getActiveOrgUuid(),
|
|
23
|
+
// subsystem: moduleId,
|
|
24
|
+
// },
|
|
25
|
+
// headers: { baseUrl },
|
|
26
|
+
// })
|
|
27
|
+
// .then(({ data }) => ({
|
|
28
|
+
// templates: data.reportTemplates as IReportTemplate[],
|
|
29
|
+
// totalRows: data.pagination.totalRows as number,
|
|
30
|
+
// }));
|
|
31
|
+
|
|
32
|
+
// export const getDefaultReportTemplate = (identifier: string) =>
|
|
33
|
+
// axiosInstance
|
|
34
|
+
// .get(`/report-templates/${identifier}/default`, {
|
|
35
|
+
// params: { organizationUuid: getActiveOrgUuid() },
|
|
36
|
+
// headers: { baseUrl },
|
|
37
|
+
// })
|
|
38
|
+
// .then(({ data }) => data as IReportTemplate);
|
|
39
|
+
|
|
40
|
+
// export const createReportTemplate = (data: Partial<IReportTemplate>) =>
|
|
41
|
+
// axiosInstance.post(
|
|
42
|
+
// `/report-template`,
|
|
43
|
+
// {
|
|
44
|
+
// ...data,
|
|
45
|
+
// organization: { uuid: getActiveOrgUuid() },
|
|
46
|
+
// subsystem: moduleId,
|
|
47
|
+
// },
|
|
48
|
+
// { headers: { baseUrl } }
|
|
49
|
+
// );
|
|
50
|
+
// export const deleteReportTemplate = (templateUuid: string) =>
|
|
51
|
+
// axiosInstance.delete(`/report-templates/${templateUuid}`, {
|
|
52
|
+
// headers: { baseUrl },
|
|
53
|
+
// });
|