@inceptionbg/iui 2.0.7 → 2.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/NoAccessPage-DBq5IzIf.js +2 -0
- package/dist/{NoAccessPage-BozT_Suz.js.map → NoAccessPage-DBq5IzIf.js.map} +1 -1
- package/dist/NotFoundPage-DM-I96ar.js +2 -0
- package/dist/{NotFoundPage-WWiekDef.js.map → NotFoundPage-DM-I96ar.js.map} +1 -1
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +286 -259
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/iui.css +1 -1
- package/idea/GridTable/GridTable.tsx +119 -0
- package/idea/GridTable/gridTable.scss +42 -0
- package/{src/components → idea}/Table/Components/Print/CustomTablePrint.tsx +2 -2
- package/{src/components → idea}/Table/Components/Print/TablePrint.tsx +2 -2
- package/{src/components → idea}/Table/Components/SetTableFilter.tsx +1 -1
- package/{src/components → idea}/Table/Components/TableOptions.tsx +4 -4
- package/idea/{Table2 → Table}/Table.tsx +151 -281
- package/idea/Table/hooks/useDefaultTemplate.ts +20 -0
- package/{src/components → idea}/Table/hooks/useTableKeyboard.ts +1 -2
- package/idea/Table/hooks/useTableSelect.ts +11 -0
- package/package.json +3 -2
- package/src/assets/icons/index.ts +1 -1
- package/src/assets/icons/light/faClipboardCheck.ts +15 -0
- package/src/assets/icons/light/faHouse.ts +15 -15
- package/src/assets/icons/light/faIdBadge.ts +15 -15
- package/src/assets/icons/light/faPen.ts +15 -0
- package/src/components/Button/IconButton.tsx +3 -1
- package/src/components/Dialog/Dialog.tsx +60 -124
- package/src/components/Dialog/components/DialogFooter.tsx +92 -0
- package/src/components/Dialog/hooks/useDialogKeyboard.ts +6 -5
- package/src/components/Header/Components/ModuleSelect.tsx +1 -1
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/Inputs/DateInput/DateInput.tsx +108 -101
- package/src/components/Inputs/DateInput/components/DatePartInput.tsx +7 -3
- package/src/components/Inputs/InputWrapper.tsx +6 -1
- package/src/components/Inputs/SearchInput.tsx +9 -4
- package/src/components/Inputs/Select2/Select.tsx +65 -30
- package/src/components/Inputs/Select2/select.scss +13 -14
- package/src/components/Inputs/Selects/components/SelectWrapper.tsx +4 -2
- package/src/components/Inputs/Selects/utils/selectStyles.ts +9 -12
- package/src/components/Menu/Menu.tsx +10 -2
- package/src/components/Menu/MenuItem.tsx +11 -10
- package/src/components/Menu/hooks/useMenuPosition.tsx +23 -6
- package/src/components/Pullover/Pullover.tsx +122 -59
- package/src/components/Table/Table.tsx +78 -342
- package/src/components/Table/components/edit/TableEditRow.tsx +69 -0
- package/src/components/Table/components/filters/FilterItem.tsx +15 -0
- package/src/components/Table/components/filters/TableFilters.tsx +125 -0
- package/src/components/Table/components/footer/TableFooter.tsx +128 -0
- package/src/components/Table/components/header/TableHeader.tsx +42 -0
- package/src/components/Table/components/header/TableHeaderRow.tsx +47 -0
- package/src/components/Table/components/items/TableItemActions.tsx +66 -0
- package/src/components/Table/components/select/TableSelect.tsx +49 -0
- package/src/components/Table/components/sort/TableSort.tsx +52 -0
- package/src/components/Table/contexts/TableContext.tsx +123 -0
- package/src/components/Table/hooks/localHooks/useLocalTableColumns.tsx +73 -0
- package/src/components/Table/hooks/localHooks/useLocalTableData.tsx +78 -0
- package/src/components/Table/hooks/localHooks/useLocalTableKeyboard.ts +173 -0
- package/src/components/Table/hooks/localHooks/useLocalTablePagination.ts +12 -0
- package/src/components/Table/hooks/useTableEdit.tsx +111 -0
- package/src/components/Table/hooks/useTableFilterFields.tsx +150 -0
- package/src/components/Table/hooks/useTablePagination.ts +16 -0
- package/src/components/Table/hooks/useTableSearch.ts +29 -0
- package/src/components/Table/hooks/useTableSort.ts +8 -0
- package/src/components/Tooltip/Tooltip.tsx +1 -1
- package/src/components/Wrappers/PageLayout.tsx +13 -18
- package/src/hooks/useGetFocusableElements.ts +42 -0
- package/src/hooks/useLocalPopoverControl.ts +38 -0
- package/src/hooks/usePopupControl.ts +13 -0
- package/src/index.ts +53 -39
- package/src/styles/common/_typography.scss +3 -0
- package/src/styles/common/helpers/_size.scss +1 -1
- package/src/styles/components/_accordions.scss +1 -1
- package/src/styles/components/_badge.scss +4 -3
- package/src/styles/components/_card.scss +1 -1
- package/src/styles/components/_dialog.scss +15 -13
- package/src/styles/components/_input.scss +1 -1
- package/src/styles/components/_inputCheckbox.scss +1 -1
- package/src/styles/components/_inputDateTime.scss +2 -2
- package/src/styles/components/_inputRadio.scss +1 -1
- package/src/styles/components/_inputSelect.scss +6 -4
- package/src/styles/components/_menu-v2.scss +1 -1
- package/src/styles/components/_menu.scss +23 -15
- package/src/styles/components/_page.scss +3 -2
- package/src/styles/components/_pullover.scss +74 -18
- package/src/styles/components/_table.scss +151 -142
- package/src/styles/components/_widget.scss +1 -1
- package/src/styles/variables/_bp.scss +1 -0
- package/src/styles/variables/_variables.scss +4 -2
- package/src/types/IKeyboard.ts +2 -1
- package/src/types/IMenu.ts +1 -0
- package/src/types/ISelect.ts +1 -0
- package/src/types/ITable.ts +87 -80
- package/src/utils/fileUtils.ts +7 -6
- package/src/utils/i18n/i18nIUICyrilic.ts +4 -0
- package/src/utils/i18n/i18nIUILatin.ts +3 -1
- package/src/utils/i18n/i18nIUIMe.ts +4 -0
- package/src/utils/{ObjectUtils.ts → objectUtils.ts} +8 -8
- package/src/utils/popupUtils.ts +82 -0
- package/src/utils/{TableUtils.ts → tableUtils.ts} +5 -5
- package/src/utils/{Toasts.ts → toasts.ts} +6 -6
- package/src/utils/{UrlUtils.ts → urlUtils.ts} +4 -4
- package/dist/NoAccessPage-BozT_Suz.js +0 -2
- package/dist/NotFoundPage-WWiekDef.js +0 -2
- package/idea/Table2/Components/Columns/ColumnsList.tsx +0 -56
- package/idea/Table2/Components/Columns/SetColumnsList.tsx +0 -107
- package/idea/Table2/Components/Edit/ItemActionsMenu.tsx +0 -87
- package/idea/Table2/Components/Edit/ItemEditOptionsButtons.tsx +0 -32
- package/idea/Table2/Components/Edit/TableEditRow.tsx +0 -56
- package/idea/Table2/Components/FilterItem.tsx +0 -20
- package/idea/Table2/Components/Header/TableHeader.tsx +0 -35
- package/idea/Table2/Components/Header/TableHeaderRow.tsx +0 -37
- package/idea/Table2/Components/Print/CustomTablePrint.tsx +0 -119
- package/idea/Table2/Components/Print/TablePrint.tsx +0 -208
- package/idea/Table2/Components/SetSortList.tsx +0 -33
- package/idea/Table2/Components/SetTableFilter.tsx +0 -90
- package/idea/Table2/Components/TableFooter.tsx +0 -107
- package/idea/Table2/Components/TableOptions.tsx +0 -211
- package/idea/Table2/Components/Templates/TemplateCreate.tsx +0 -75
- package/idea/Table2/Components/Templates/TemplateCreateDefault.tsx +0 -45
- package/idea/Table2/Components/Templates/TemplateList.tsx +0 -167
- package/idea/Table2/Components/Templates/repo/TemplateRepo.ts +0 -51
- package/idea/Table2/_table.scss +0 -300
- package/idea/Table2/hooks/useDefaultTemplate.ts +0 -22
- package/idea/Table2/hooks/useTableKeyboard.ts +0 -115
- package/src/assets/icons/light/faPenField.ts +0 -15
- package/src/assets/icons/solid/faMagnifyingGlass.ts +0 -15
- package/src/components/Dialog/DeleteItemDialog.tsx +0 -52
- package/src/components/Dialog/hooks/useDialogObserver.ts +0 -21
- /package/{src/components → idea}/Table/Components/Columns/ColumnsList.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Columns/SetColumnsList.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Edit/ItemActionsMenu.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Edit/ItemEditOptionsButtons.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Edit/TableEditRow.tsx +0 -0
- /package/{src/components → idea}/Table/Components/FilterItem.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Header/TableHeader.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Header/TableHeaderRow.tsx +0 -0
- /package/{src/components → idea}/Table/Components/SetSortList.tsx +0 -0
- /package/{src/components → idea}/Table/Components/TableFooter.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Templates/TemplateCreate.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Templates/TemplateCreateDefault.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Templates/TemplateList.tsx +0 -0
- /package/{src/components → idea}/Table/Components/Templates/repo/TemplateRepo.ts +0 -0
- /package/src/utils/{DateUtils.ts → dateUtils.ts} +0 -0
- /package/src/utils/{LocalStorageHelper.ts → localStorageHelper.ts} +0 -0
- /package/src/utils/{NumberUtils.ts → numberUtils.ts} +0 -0
- /package/src/utils/{RootDir.ts → rootDir.ts} +0 -0
- /package/src/utils/{StringUtils.ts → stringUtils.ts} +0 -0
|
@@ -1,75 +0,0 @@
|
|
|
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
|
-
}
|
|
17
|
-
|
|
18
|
-
export const TemplateCreate: FC<Props> = ({
|
|
19
|
-
identifier,
|
|
20
|
-
data: { searchData, visibleColumns, sorts },
|
|
21
|
-
onSubmitCallback,
|
|
22
|
-
}) => {
|
|
23
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
24
|
-
const [formData, setFormData] = useState<Partial<IReportTemplate>>({});
|
|
25
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
26
|
-
|
|
27
|
-
const { t } = useTranslation();
|
|
28
|
-
|
|
29
|
-
const onFormSubmit = () => {
|
|
30
|
-
setIsLoading(true);
|
|
31
|
-
const data = deleteEmptyProps({
|
|
32
|
-
identifier,
|
|
33
|
-
name: formData.name,
|
|
34
|
-
isPrivate: formData.isPrivate,
|
|
35
|
-
filterValues: convertSearchToReportTemplateFilter(searchData),
|
|
36
|
-
columns: visibleColumns,
|
|
37
|
-
sorts,
|
|
38
|
-
}) as Partial<IReportTemplate>;
|
|
39
|
-
|
|
40
|
-
createReportTemplate(data)
|
|
41
|
-
.then(() => {
|
|
42
|
-
setIsOpen(false);
|
|
43
|
-
onSubmitCallback();
|
|
44
|
-
})
|
|
45
|
-
.catch(() => {})
|
|
46
|
-
.finally(() => setIsLoading(false));
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<>
|
|
51
|
-
<MenuItem label={t('CreateTemplateLong')} onClick={() => setIsOpen(true)} />
|
|
52
|
-
<Dialog
|
|
53
|
-
title={t('CreateTemplate')}
|
|
54
|
-
isOpen={isOpen}
|
|
55
|
-
onClose={() => setIsOpen(false)}
|
|
56
|
-
size="l"
|
|
57
|
-
isLoading={isLoading}
|
|
58
|
-
confirmButton={{ onFormSubmit, keepOpen: true }}
|
|
59
|
-
>
|
|
60
|
-
<div className="flex column gap-3">
|
|
61
|
-
<TextInput
|
|
62
|
-
label={t('Name')}
|
|
63
|
-
value={formData.name}
|
|
64
|
-
setValue={name => setFormData({ ...formData, name })}
|
|
65
|
-
/>
|
|
66
|
-
<Checkbox
|
|
67
|
-
label={t('PrivateTemplate')}
|
|
68
|
-
value={formData.isPrivate}
|
|
69
|
-
setValue={isPrivate => setFormData({ ...formData, isPrivate })}
|
|
70
|
-
/>
|
|
71
|
-
</div>
|
|
72
|
-
</Dialog>
|
|
73
|
-
</>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
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
|
-
isPrivate: true,
|
|
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
|
-
};
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { FC, useCallback, useEffect, 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, getReportTemplates } from './repo/TemplateRepo';
|
|
13
|
-
import { ItemActionsMenu } from '../Edit/ItemActionsMenu';
|
|
14
|
-
import { deleteEmptyProps, deleteProps } from '../../../../utils/ObjectUtils';
|
|
15
|
-
import { DeleteItemDialog } from '../../../Dialog/DeleteItemDialog';
|
|
16
|
-
import { IAnyObject } from '../../../../types/IBasic';
|
|
17
|
-
import { TextInput } from '../../../Inputs/TextInput';
|
|
18
|
-
import { Select } from '../../../Inputs/Selects/Select';
|
|
19
|
-
import {
|
|
20
|
-
getActiveFilterNumber,
|
|
21
|
-
getVisibleColumnsIds,
|
|
22
|
-
} from '../../../../utils/TableUtils';
|
|
23
|
-
|
|
24
|
-
interface Props {
|
|
25
|
-
identifier: string;
|
|
26
|
-
onSelect: (template: IReportTemplate) => void;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const TemplateList: FC<Props> = ({ identifier, onSelect }) => {
|
|
30
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
31
|
-
const [data, setData] = useState<ITableDataItem[]>([]);
|
|
32
|
-
const [limit, setLimit] = useState(5);
|
|
33
|
-
const [offset, setOffset] = useState(0);
|
|
34
|
-
const [totalRows, setTotalRows] = useState(0);
|
|
35
|
-
const [search, setSearch] = useState<{ nameLike?: string }>({});
|
|
36
|
-
const [searchData, setSearchData] = useState<{ nameLike?: string }>({});
|
|
37
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
38
|
-
const [itemToDeleteUuid, setItemToDeleteUuid] = useState('');
|
|
39
|
-
|
|
40
|
-
const { t } = useTranslation();
|
|
41
|
-
|
|
42
|
-
const columns: ITableColumn[] = [
|
|
43
|
-
{ id: 'name', label: t('Name') },
|
|
44
|
-
{ id: 'private', label: t('PrivateTemplate') },
|
|
45
|
-
{ id: 'actions', label: t('Actions'), width: '70px' },
|
|
46
|
-
];
|
|
47
|
-
|
|
48
|
-
const handleGetTemplates = 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
|
-
private: { value: t(e.isPrivate ? '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
|
-
private: {
|
|
146
|
-
label: t('PrivateTemplate'),
|
|
147
|
-
field: (
|
|
148
|
-
<Select
|
|
149
|
-
label={t('Choose')}
|
|
150
|
-
value={
|
|
151
|
-
search.isPrivate !== undefined
|
|
152
|
-
? {
|
|
153
|
-
value: search.isPrivate,
|
|
154
|
-
label: t(search.isPrivate ? '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, isPrivate: e.value })}
|
|
163
|
-
/>
|
|
164
|
-
),
|
|
165
|
-
resetField: () => setSearch(deleteProps(search, ['isPrivate'])),
|
|
166
|
-
},
|
|
167
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
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") || window.location.host.includes("localhost:")
|
|
6
|
-
? 'https://report-templates.api.test.inception.rs'
|
|
7
|
-
: 'https://report-templates.api.inception.rs';
|
|
8
|
-
|
|
9
|
-
export const getReportTemplates = (
|
|
10
|
-
pagination: IPagination,
|
|
11
|
-
search: { identifier: string; nameLike?: string; onlyLoggedInUserTemplates?: boolean },
|
|
12
|
-
fetchOptions?: ('SORT' | 'FILTER_VALUES' | 'COLUMNS' | 'CREATED_BY' | 'ORGANIZATION')[]
|
|
13
|
-
) =>
|
|
14
|
-
axiosInstance
|
|
15
|
-
.get('/report-templates', {
|
|
16
|
-
params: {
|
|
17
|
-
...pagination,
|
|
18
|
-
...search,
|
|
19
|
-
fetchOptions,
|
|
20
|
-
organizationUuid: getActiveOrgUuid(),
|
|
21
|
-
subsystem: moduleId,
|
|
22
|
-
},
|
|
23
|
-
headers: { baseUrl },
|
|
24
|
-
})
|
|
25
|
-
.then(({ data }) => ({
|
|
26
|
-
templates: data.reportTemplates as IReportTemplate[],
|
|
27
|
-
totalRows: data.pagination.totalRows as number,
|
|
28
|
-
}));
|
|
29
|
-
|
|
30
|
-
export const getDefaultReportTemplate = (identifier: string) =>
|
|
31
|
-
axiosInstance
|
|
32
|
-
.get(`/report-templates/${identifier}/default`, {
|
|
33
|
-
params: { organizationUuid: getActiveOrgUuid() },
|
|
34
|
-
headers: { baseUrl },
|
|
35
|
-
})
|
|
36
|
-
.then(({ data }) => data as IReportTemplate);
|
|
37
|
-
|
|
38
|
-
export const createReportTemplate = (data: Partial<IReportTemplate>) =>
|
|
39
|
-
axiosInstance.post(
|
|
40
|
-
`/report-template`,
|
|
41
|
-
{
|
|
42
|
-
...data,
|
|
43
|
-
organization: { uuid: getActiveOrgUuid() },
|
|
44
|
-
subsystem: moduleId,
|
|
45
|
-
},
|
|
46
|
-
{ headers: { baseUrl } }
|
|
47
|
-
);
|
|
48
|
-
export const deleteReportTemplate = (templateUuid: string) =>
|
|
49
|
-
axiosInstance.delete(`/report-templates/${templateUuid}`, {
|
|
50
|
-
headers: { baseUrl },
|
|
51
|
-
});
|
package/idea/Table2/_table.scss
DELETED
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
table {
|
|
2
|
-
border-spacing: 0px;
|
|
3
|
-
border-collapse: collapse;
|
|
4
|
-
}
|
|
5
|
-
// .iui-table {
|
|
6
|
-
// //// Header ////
|
|
7
|
-
// th {
|
|
8
|
-
// border-bottom: var(--table-border);
|
|
9
|
-
// font-size: var(--fs-m);
|
|
10
|
-
// &:last-child {
|
|
11
|
-
// .vertical-separator {
|
|
12
|
-
// display: none;
|
|
13
|
-
// }
|
|
14
|
-
// }
|
|
15
|
-
// }
|
|
16
|
-
// .table-container {
|
|
17
|
-
// overflow: auto;
|
|
18
|
-
// // scroll-snap-type: y mandatory;
|
|
19
|
-
// }
|
|
20
|
-
// .sticky-header {
|
|
21
|
-
// position: sticky;
|
|
22
|
-
// top: 0;
|
|
23
|
-
// background-color: white;
|
|
24
|
-
// }
|
|
25
|
-
// .vertical-separator {
|
|
26
|
-
// height: 14px;
|
|
27
|
-
// width: 2px;
|
|
28
|
-
// background-color: #00000030;
|
|
29
|
-
// }
|
|
30
|
-
|
|
31
|
-
// //// Body ////
|
|
32
|
-
// tbody.no-last-border tr:last-child td {
|
|
33
|
-
// border: none;
|
|
34
|
-
// }
|
|
35
|
-
// // Row
|
|
36
|
-
// tr {
|
|
37
|
-
// // scroll-snap-align: start;
|
|
38
|
-
// margin-bottom: 2px;
|
|
39
|
-
// &.clickable:hover,
|
|
40
|
-
// &.selected {
|
|
41
|
-
// background-color: rgba(0, 0, 0, 0.05);
|
|
42
|
-
// }
|
|
43
|
-
// &.focused {
|
|
44
|
-
// background-color: var(--primary-o10);
|
|
45
|
-
// }
|
|
46
|
-
// &.loading {
|
|
47
|
-
// opacity: 0.5;
|
|
48
|
-
// pointer-events: none;
|
|
49
|
-
// }
|
|
50
|
-
// }
|
|
51
|
-
// // Cell
|
|
52
|
-
// th,
|
|
53
|
-
// td {
|
|
54
|
-
// // Cell colors
|
|
55
|
-
// &.secondary {
|
|
56
|
-
// background-color: rgba(0, 0, 0, 0.04);
|
|
57
|
-
// border-bottom: 1px solid #d3d3d3;
|
|
58
|
-
// }
|
|
59
|
-
// }
|
|
60
|
-
// td {
|
|
61
|
-
// height: 52px;
|
|
62
|
-
// padding: 7px 16px;
|
|
63
|
-
// font-size: var(--fs-m);
|
|
64
|
-
// box-sizing: border-box;
|
|
65
|
-
// border-bottom: var(--table-border);
|
|
66
|
-
// }
|
|
67
|
-
// .clickable-column:hover {
|
|
68
|
-
// background-color: var(--primary-o10) !important;
|
|
69
|
-
// }
|
|
70
|
-
|
|
71
|
-
// //// Footer ////
|
|
72
|
-
|
|
73
|
-
// .table-footer {
|
|
74
|
-
// display: flex;
|
|
75
|
-
// align-items: center;
|
|
76
|
-
// width: 100%;
|
|
77
|
-
// height: 52px;
|
|
78
|
-
// padding: 7px 16px;
|
|
79
|
-
// font-size: var(--fs-m);
|
|
80
|
-
// box-sizing: border-box;
|
|
81
|
-
// }
|
|
82
|
-
// .pagination {
|
|
83
|
-
// display: flex;
|
|
84
|
-
// align-items: center;
|
|
85
|
-
// color: rgba(0, 0, 0, 0.8);
|
|
86
|
-
// @media #{$bp-mobile} {
|
|
87
|
-
// flex-direction: column;
|
|
88
|
-
// align-items: end;
|
|
89
|
-
// }
|
|
90
|
-
// select {
|
|
91
|
-
// color: rgba(0, 0, 0, 0.8);
|
|
92
|
-
// background: none;
|
|
93
|
-
// border: none;
|
|
94
|
-
// text-align: right;
|
|
95
|
-
// cursor: pointer;
|
|
96
|
-
// padding: 0 8px;
|
|
97
|
-
// user-select: none;
|
|
98
|
-
// margin-left: 8px;
|
|
99
|
-
// margin-right: 16px;
|
|
100
|
-
// }
|
|
101
|
-
// .offset-input {
|
|
102
|
-
// width: 30px;
|
|
103
|
-
// border: none;
|
|
104
|
-
// border-bottom: 1px solid rgba(0, 0, 0, 0.3);
|
|
105
|
-
// background: none;
|
|
106
|
-
// text-align: center;
|
|
107
|
-
// padding: 5px 0;
|
|
108
|
-
// }
|
|
109
|
-
// }
|
|
110
|
-
|
|
111
|
-
// @media #{$portrait} {
|
|
112
|
-
// tbody,
|
|
113
|
-
// tr {
|
|
114
|
-
// display: block;
|
|
115
|
-
// }
|
|
116
|
-
// tr {
|
|
117
|
-
// padding: 20px 0;
|
|
118
|
-
// }
|
|
119
|
-
// td {
|
|
120
|
-
// display: flex;
|
|
121
|
-
// align-items: center;
|
|
122
|
-
// height: unset !important;
|
|
123
|
-
// text-align: left;
|
|
124
|
-
// }
|
|
125
|
-
// thead {
|
|
126
|
-
// display: none;
|
|
127
|
-
// }
|
|
128
|
-
// tbody tr td {
|
|
129
|
-
// &:before {
|
|
130
|
-
// content: attr(data-th);
|
|
131
|
-
// font-weight: bold;
|
|
132
|
-
// text-align: left;
|
|
133
|
-
// padding-right: 10px;
|
|
134
|
-
// }
|
|
135
|
-
// }
|
|
136
|
-
// }
|
|
137
|
-
// }
|
|
138
|
-
|
|
139
|
-
.iui-table-filter {
|
|
140
|
-
.iui-dialog-content {
|
|
141
|
-
padding: 0;
|
|
142
|
-
margin: 8px 0;
|
|
143
|
-
}
|
|
144
|
-
.filters-search {
|
|
145
|
-
display: flex;
|
|
146
|
-
align-items: center;
|
|
147
|
-
justify-content: space-between;
|
|
148
|
-
gap: 8px;
|
|
149
|
-
.search-input {
|
|
150
|
-
max-width: 250px;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
.table-filter-item {
|
|
154
|
-
display: flex;
|
|
155
|
-
align-items: center;
|
|
156
|
-
justify-content: space-between;
|
|
157
|
-
padding: 8px 16px;
|
|
158
|
-
.label {
|
|
159
|
-
width: 150px;
|
|
160
|
-
}
|
|
161
|
-
.field {
|
|
162
|
-
display: inline-flex;
|
|
163
|
-
margin: 0 8px;
|
|
164
|
-
width: 100%;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.dual-list-container {
|
|
170
|
-
.dual-list-content {
|
|
171
|
-
display: grid;
|
|
172
|
-
grid-template-columns: 1fr auto 1fr;
|
|
173
|
-
gap: 12px;
|
|
174
|
-
}
|
|
175
|
-
.list-box {
|
|
176
|
-
border: var(--table-border);
|
|
177
|
-
border-radius: 16px;
|
|
178
|
-
padding: 10px;
|
|
179
|
-
user-select: none;
|
|
180
|
-
& > .item {
|
|
181
|
-
display: flex;
|
|
182
|
-
justify-content: space-between;
|
|
183
|
-
align-items: center;
|
|
184
|
-
padding: 8px;
|
|
185
|
-
font-size: 12px;
|
|
186
|
-
svg {
|
|
187
|
-
color: rgba(0, 0, 0, 0.6);
|
|
188
|
-
margin-left: 1rem;
|
|
189
|
-
}
|
|
190
|
-
&:hover {
|
|
191
|
-
background-color: var(--primary-o10);
|
|
192
|
-
}
|
|
193
|
-
&:active {
|
|
194
|
-
background-color: var(--primary-o25);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
.exchange-icon {
|
|
199
|
-
display: flex;
|
|
200
|
-
align-items: center;
|
|
201
|
-
svg {
|
|
202
|
-
height: 20px;
|
|
203
|
-
width: 20px;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.edit-row {
|
|
209
|
-
background: #3d497714;
|
|
210
|
-
}
|
|
211
|
-
.primary-row {
|
|
212
|
-
background-color: rgba(var(--primary-rgb), 0.15);
|
|
213
|
-
}
|
|
214
|
-
.secondary-row {
|
|
215
|
-
background-color: #f1f1f1;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.table-options {
|
|
219
|
-
display: flex;
|
|
220
|
-
align-items: center;
|
|
221
|
-
justify-content: space-between;
|
|
222
|
-
margin-bottom: 4px;
|
|
223
|
-
.table-options-btn {
|
|
224
|
-
background: var(--background-dark);
|
|
225
|
-
border-radius: 4px;
|
|
226
|
-
font-weight: 700;
|
|
227
|
-
&:hover {
|
|
228
|
-
background-color: #dfe1eb !important;
|
|
229
|
-
}
|
|
230
|
-
svg {
|
|
231
|
-
height: 12px;
|
|
232
|
-
width: 12px;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
//
|
|
238
|
-
|
|
239
|
-
.grid-table {
|
|
240
|
-
display: grid;
|
|
241
|
-
// grid-template-rows: auto 1fr; /* Header auto height, body fills */
|
|
242
|
-
grid-template-columns: repeat(9, auto); /* Adjust based on columns */
|
|
243
|
-
thead,
|
|
244
|
-
tbody {
|
|
245
|
-
display: contents;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
tbody {
|
|
249
|
-
max-height: 400px;
|
|
250
|
-
overflow-y: auto;
|
|
251
|
-
}
|
|
252
|
-
// thead {
|
|
253
|
-
// position: sticky;
|
|
254
|
-
// top: 0;
|
|
255
|
-
// background: #f9f9f9;
|
|
256
|
-
// z-index: 1;
|
|
257
|
-
// }
|
|
258
|
-
|
|
259
|
-
// tbody {
|
|
260
|
-
// display: grid;
|
|
261
|
-
// grid-template-columns: repeat(3, 1fr); /* Match columns */
|
|
262
|
-
// }
|
|
263
|
-
|
|
264
|
-
tr {
|
|
265
|
-
display: contents; /* Allows rows to use the grid structure */
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
th,
|
|
269
|
-
td {
|
|
270
|
-
box-sizing: border-box;
|
|
271
|
-
display: flex;
|
|
272
|
-
padding: 12px;
|
|
273
|
-
flex-grow: 1;
|
|
274
|
-
align-items: center;
|
|
275
|
-
min-height: 20px;
|
|
276
|
-
border: 1px solid #ddd; /* Apply borders to th and td */
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
// th:first-child,
|
|
280
|
-
// td:first-child {
|
|
281
|
-
// border-left: none; /* Remove left border for the first column */
|
|
282
|
-
// }
|
|
283
|
-
|
|
284
|
-
// tr:last-child .td {
|
|
285
|
-
// border-bottom: none; /* Remove bottom border from the last row */
|
|
286
|
-
// }
|
|
287
|
-
|
|
288
|
-
th {
|
|
289
|
-
background-color: #f4f4f4; /* Light background for the header */
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
tr:hover {
|
|
293
|
-
outline: 2px solid #007bff;
|
|
294
|
-
background: #6aa1ce;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
tr + tr td {
|
|
298
|
-
border-top: none; /* Remove top border from subsequent rows */
|
|
299
|
-
}
|
|
300
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
import { getDefaultReportTemplate } from '../Components/Templates/repo/TemplateRepo';
|
|
3
|
-
import { IReportTemplate } from '../../../types/ITable';
|
|
4
|
-
|
|
5
|
-
export const useDefaultTemplate = (identifier?: string) => {
|
|
6
|
-
const [template, setTemplate] = useState<IReportTemplate | null>(null);
|
|
7
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
8
|
-
|
|
9
|
-
useEffect(() => {
|
|
10
|
-
if (identifier) {
|
|
11
|
-
getDefaultReportTemplate(identifier)
|
|
12
|
-
.then(setTemplate)
|
|
13
|
-
.catch(() => {})
|
|
14
|
-
.finally(() => setIsLoading(false));
|
|
15
|
-
}
|
|
16
|
-
}, [identifier]);
|
|
17
|
-
|
|
18
|
-
return {
|
|
19
|
-
defaultTemplate: template,
|
|
20
|
-
isLoadingDefaultTemplate: !!identifier && isLoading,
|
|
21
|
-
};
|
|
22
|
-
};
|