@inceptionbg/iui 2.0.15 → 2.0.17
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-BmizYfw0.js +2 -0
- package/dist/{NoAccessPage-DBq5IzIf.js.map → NoAccessPage-BmizYfw0.js.map} +1 -1
- package/dist/NotFoundPage-Cv544vAr.js +2 -0
- package/dist/{NotFoundPage-DM-I96ar.js.map → NotFoundPage-Cv544vAr.js.map} +1 -1
- package/dist/index.d.ts +160 -91
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/iui.css +1 -1
- package/package.json +4 -7
- package/src/assets/icons/duotone/faBell.ts +17 -0
- package/src/assets/icons/duotone/faPen.ts +18 -0
- package/src/assets/icons/duotone/faTrashCan.ts +18 -0
- package/src/assets/icons/light/faBell.ts +15 -0
- package/src/assets/icons/light/faEnvelope.ts +15 -0
- package/src/assets/icons/regular/faEllipsisVertical.ts +15 -0
- package/src/assets/icons/solid/faEnvelopeDot.ts +15 -0
- package/src/components/Button/SplitButton.tsx +5 -5
- package/src/components/Dialog/Dialog.tsx +3 -3
- package/src/components/Header/Components/ModuleSelect.tsx +5 -5
- package/src/components/Header/Components/Notifications.tsx +208 -0
- package/src/components/Header/Components/UserMenu.tsx +15 -14
- package/src/components/Header/Header.tsx +5 -4
- package/src/components/Inputs/NumberInput.tsx +3 -0
- package/src/components/Inputs/Selects/components/SelectWrapper.tsx +48 -29
- package/src/components/Inputs/TextInput.tsx +1 -0
- package/src/components/List/ListItem.tsx +1 -1
- package/src/components/Loader/ProgressBar.tsx +1 -1
- package/src/components/Menu/Menu.tsx +3 -0
- package/src/components/Pullover/Pullover.tsx +38 -39
- package/src/components/Table/Table.tsx +23 -32
- package/{idea/Table/Components/Columns → src/components/Table/components/columns}/ColumnsList.tsx +12 -14
- package/src/components/Table/components/columns/TableColumnsEdit.tsx +112 -0
- package/src/components/Table/components/edit/TableEditRow.tsx +26 -21
- package/src/components/Table/components/header/TableHeaderRow.tsx +2 -1
- package/src/components/Table/components/items/TableItemActions.tsx +18 -13
- package/src/components/Table/components/print/TablePrint.tsx +1 -5
- package/src/components/Table/components/templates/CreateTemplateDialog.tsx +48 -0
- package/src/components/Table/components/templates/TableTemplates.tsx +24 -4
- package/src/components/Table/contexts/TableContext.tsx +34 -33
- package/src/components/Table/hooks/localHooks/useLocalTableColumns.tsx +27 -28
- package/src/components/Table/hooks/localHooks/useLocalTableData.tsx +17 -11
- package/src/components/Table/hooks/localHooks/useLocalTableKeyboard.ts +8 -6
- package/src/components/Table/hooks/useTableColumns.ts +16 -10
- package/src/components/Table/hooks/useTableEdit.tsx +24 -2
- package/src/components/Table/hooks/useTablePrint.ts +12 -4
- package/src/components/Table/hooks/useTableSelect.ts +1 -1
- package/src/components/Tabs/Tabs.tsx +1 -0
- package/src/components/Tooltip/Tooltip.tsx +81 -14
- package/src/hooks/useIsMenuOpen.ts +3 -3
- package/src/hooks/usePopupControl.ts +9 -4
- package/src/index.ts +24 -5
- package/src/styles/App.scss +1 -0
- package/src/styles/components/_badge.scss +8 -1
- package/src/styles/components/_header.scss +18 -8
- package/src/styles/components/_list.scss +1 -1
- package/src/styles/components/_notifications.scss +71 -0
- package/src/styles/components/_page.scss +1 -0
- package/src/styles/components/_pullover.scss +1 -1
- package/src/styles/components/_sidebar.scss +1 -3
- package/src/styles/components/_table.scss +110 -57
- package/src/styles/variables/_variables.scss +9 -0
- package/src/types/IHeader.ts +1 -1
- package/src/types/IKeyboard.ts +0 -5
- package/src/types/IMenu.ts +2 -2
- package/src/types/INotifications.ts +15 -0
- package/src/types/IPopup.ts +2 -2
- package/src/types/ITable.ts +36 -32
- package/src/utils/i18n/i18nIUICyrilic.ts +12 -0
- package/src/utils/i18n/i18nIUILatin.ts +13 -0
- package/src/utils/i18n/i18nIUIMe.ts +12 -0
- package/src/utils/objectUtils.ts +19 -0
- package/src/utils/tableUtils.ts +1 -1
- package/dist/NoAccessPage-DBq5IzIf.js +0 -2
- package/dist/NotFoundPage-DM-I96ar.js +0 -2
- package/idea/Notifications.tsx +0 -245
- package/idea/Table/Components/Columns/SetColumnsList.tsx +0 -113
package/src/types/ITable.ts
CHANGED
|
@@ -4,24 +4,26 @@ import { ITableKeyboardActionsBase } from './IKeyboard';
|
|
|
4
4
|
import { IPopupControl } from './IPopup';
|
|
5
5
|
|
|
6
6
|
export interface ITable<T = unknown> {
|
|
7
|
+
id?: string;
|
|
7
8
|
columnData: ITableColumnsData;
|
|
8
|
-
data: ITableDataItem[];
|
|
9
|
-
dataActions?: ITableDataActions
|
|
9
|
+
data: ITableDataItem<T>[];
|
|
10
|
+
dataActions?: ITableDataActions<T>;
|
|
10
11
|
rowSelect?: {
|
|
11
12
|
selectedRows: Set<string>;
|
|
12
13
|
setSelectedRows: Dispatch<SetStateAction<Set<string>>>;
|
|
13
|
-
actions
|
|
14
|
+
actions?: ITableSelectedAction[];
|
|
14
15
|
};
|
|
15
16
|
filterData?: ITableFilterData;
|
|
16
17
|
sortData?: ITableSortData;
|
|
17
18
|
templateData?: ITableTemplateData;
|
|
18
19
|
printData?: IPrintData<T>;
|
|
19
|
-
sumRows?: ITableDataItem[];
|
|
20
|
-
editable?: ITableEdit
|
|
20
|
+
sumRows?: ITableDataItem<T>[];
|
|
21
|
+
editable?: ITableEdit<T>;
|
|
21
22
|
selectedRowUuid?: string;
|
|
23
|
+
itemDeleteData?: ITableItemDeleteData;
|
|
22
24
|
keyboard?: {
|
|
23
25
|
enabled: boolean;
|
|
24
|
-
actions
|
|
26
|
+
actions?: ITableKeyboardActionsBase;
|
|
25
27
|
};
|
|
26
28
|
headerWrap?: boolean;
|
|
27
29
|
customHeader?: ITableColumn[][];
|
|
@@ -48,14 +50,16 @@ export interface ITableColumn {
|
|
|
48
50
|
label?: string | ReactElement;
|
|
49
51
|
labelForFilter?: string;
|
|
50
52
|
align?: 'center' | 'left' | 'right' | 'justify' | undefined;
|
|
51
|
-
hidden?: boolean;
|
|
52
53
|
unavailable?: boolean;
|
|
54
|
+
hidden?: boolean;
|
|
55
|
+
printHidden?: boolean;
|
|
53
56
|
width?: string;
|
|
54
57
|
minWidth?: string;
|
|
55
58
|
colSpan?: number;
|
|
56
59
|
rowSpan?: number;
|
|
57
60
|
break?: boolean;
|
|
58
61
|
color?: 'secondary';
|
|
62
|
+
sticky?: boolean;
|
|
59
63
|
sortOptions?: {
|
|
60
64
|
asc: string;
|
|
61
65
|
desc: string;
|
|
@@ -66,11 +70,11 @@ export interface ITableColumn {
|
|
|
66
70
|
className?: string;
|
|
67
71
|
}
|
|
68
72
|
|
|
69
|
-
export interface ITableDataItem {
|
|
73
|
+
export interface ITableDataItem<T = unknown> {
|
|
70
74
|
uuid: string;
|
|
71
75
|
onRowClick?: (event?: MouseEvent<HTMLTableRowElement>) => void;
|
|
72
76
|
className?: string;
|
|
73
|
-
item?:
|
|
77
|
+
item?: T;
|
|
74
78
|
disableSelect?: boolean;
|
|
75
79
|
cells: ITableDataItemCells;
|
|
76
80
|
extendable?: {
|
|
@@ -92,18 +96,13 @@ export interface ITableDataItemCells {
|
|
|
92
96
|
};
|
|
93
97
|
}
|
|
94
98
|
|
|
95
|
-
export interface ITableDataActions {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
};
|
|
99
|
-
delete?: {
|
|
100
|
-
onClick: (itemUuid: string) => void;
|
|
101
|
-
hasAccess: boolean;
|
|
102
|
-
};
|
|
103
|
-
actions?: {
|
|
99
|
+
export interface ITableDataActions<T = unknown> {
|
|
100
|
+
hasEditAccess: boolean;
|
|
101
|
+
actions?: (item?: T) => {
|
|
104
102
|
label: string;
|
|
105
|
-
onClick: (
|
|
103
|
+
onClick: () => void;
|
|
106
104
|
hasAccess: boolean;
|
|
105
|
+
disabled?: boolean;
|
|
107
106
|
}[];
|
|
108
107
|
}
|
|
109
108
|
export interface ITableFilterData {
|
|
@@ -155,25 +154,23 @@ export interface ITableSelectedAction {
|
|
|
155
154
|
export interface ITableTemplateData {
|
|
156
155
|
identifier: string;
|
|
157
156
|
popupController: IPopupControl;
|
|
157
|
+
defaultTemplate?: IReportTemplate;
|
|
158
158
|
items: IReportTemplate[];
|
|
159
159
|
isLoading?: boolean;
|
|
160
160
|
isFetching?: boolean;
|
|
161
161
|
setSearch?: (search: string) => void;
|
|
162
|
-
initiateCreate: () => void;
|
|
163
|
-
initiateCreateDefault: () => void;
|
|
164
162
|
setItemToDeleteUuids: (itemUuids: string[]) => void;
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
TemplateNode: ReactNode;
|
|
163
|
+
DeleteDialog: ReactNode;
|
|
164
|
+
createItem: {
|
|
165
|
+
allowPublicCreate?: boolean;
|
|
166
|
+
onCreate: (data: Partial<IReportTemplate>) => void;
|
|
167
|
+
onCreateDefault: () => void;
|
|
168
|
+
};
|
|
172
169
|
}
|
|
173
170
|
///// EDIT /////
|
|
174
|
-
export interface ITableEdit<T =
|
|
175
|
-
selectedItem: T | null;
|
|
176
|
-
setSelectedItem: (item: T | null) => void;
|
|
171
|
+
export interface ITableEdit<T = unknown> {
|
|
172
|
+
selectedItem: ITableDataItem<T> | null;
|
|
173
|
+
setSelectedItem: (item: ITableDataItem<T> | null) => void;
|
|
177
174
|
editData: Partial<T>;
|
|
178
175
|
setEditData: Dispatch<SetStateAction<Partial<T>>>;
|
|
179
176
|
onSubmit: (data: T, onSubmitCallback: () => void) => void;
|
|
@@ -185,6 +182,14 @@ export interface ITableEdit<T = any> {
|
|
|
185
182
|
keepEditOnSubmit?: boolean;
|
|
186
183
|
}
|
|
187
184
|
|
|
185
|
+
///// DELETE /////
|
|
186
|
+
export interface ITableItemDeleteData {
|
|
187
|
+
hasAccess: boolean;
|
|
188
|
+
itemToDeleteUuids: string[];
|
|
189
|
+
setItemToDeleteUuids: Dispatch<SetStateAction<string[]>>;
|
|
190
|
+
DeleteDialog: ReactNode;
|
|
191
|
+
}
|
|
192
|
+
|
|
188
193
|
///// PRINT /////
|
|
189
194
|
export interface IBasePrintData {
|
|
190
195
|
label: string;
|
|
@@ -210,7 +215,6 @@ export type IGetPrintData<T> = (props: {
|
|
|
210
215
|
export interface IPrintData<T = unknown> extends IBasePrintData {
|
|
211
216
|
printPopupControl: IPopupControl;
|
|
212
217
|
customHeader?: ITableColumn[][];
|
|
213
|
-
excludeColumnIds?: string[];
|
|
214
218
|
isLoading?: boolean;
|
|
215
219
|
progress?: number;
|
|
216
220
|
tableData?: ITableDataItem[];
|
|
@@ -91,6 +91,18 @@ export const i18nIUICyrilic = {
|
|
|
91
91
|
ErrorMessage: 'Дошло је до грешке!',
|
|
92
92
|
TryAgain: 'Покушај поново',
|
|
93
93
|
|
|
94
|
+
////// NOTIFICATIONS //////
|
|
95
|
+
InApp: 'U aplikaciji',
|
|
96
|
+
MarkAllAsRead: 'Означи све као прочитано',
|
|
97
|
+
NoNewNotifications: 'Немате нове нотификације',
|
|
98
|
+
Notifications: 'Нотификације',
|
|
99
|
+
NotificationsAll: 'Све',
|
|
100
|
+
NotificationsUnread: 'Непрочитане',
|
|
101
|
+
NotificationsRead: 'Прочитане',
|
|
102
|
+
NotificationSound: 'Звук нотификације',
|
|
103
|
+
// NTitleADD_DOC: 'Додат је документ на платформу',
|
|
104
|
+
// NContentADD_DOC: 'Документ са бројем <documentNumber>{{- documentNumber}}</documentNumber> је додат на платформу',
|
|
105
|
+
|
|
94
106
|
////// PAGES //////
|
|
95
107
|
ReturnToHomepage: 'Повратак на почетну страну',
|
|
96
108
|
FooterText: `Инцептион ЦА је акредитовано сертификационо тело за квалификовану електронску доставу,
|
|
@@ -91,6 +91,19 @@ export const i18nIUILatin = {
|
|
|
91
91
|
ErrorMessage: 'Došlo je do greške!',
|
|
92
92
|
TryAgain: 'Pokušaj ponovo',
|
|
93
93
|
|
|
94
|
+
////// NOTIFICATIONS //////
|
|
95
|
+
InApp: 'In-app',
|
|
96
|
+
// MarkAsRead: 'Označi kao pročitano',
|
|
97
|
+
MarkAllAsRead: 'Označi sve kao pročitano',
|
|
98
|
+
NoNewNotifications: 'Nemate nove notifikacije',
|
|
99
|
+
Notifications: 'Notifikacije',
|
|
100
|
+
NotificationsAll: 'Sve',
|
|
101
|
+
NotificationsUnread: 'Nepročitane',
|
|
102
|
+
NotificationsRead: 'Pročitane',
|
|
103
|
+
NotificationSound: 'Zvuk notifikacije',
|
|
104
|
+
// NTitleADD_DOC: 'Dodat je dokument na platformu',
|
|
105
|
+
// NContentADD_DOC: 'Dokument sa brojem <documentNumber>{{- documentNumber}}</documentNumber> je dodat na platformu',
|
|
106
|
+
|
|
94
107
|
////// PAGES //////
|
|
95
108
|
ReturnToHomepage: 'Povratak na početnu stranu',
|
|
96
109
|
FooterText: `Inception CA je akreditovano sertifikaciono telo za kvalifikovanu elektronsku dostavu,
|
|
@@ -90,6 +90,18 @@ export const i18nIUIMe = {
|
|
|
90
90
|
ErrorMessage: 'Došlo je do greške!',
|
|
91
91
|
TryAgain: 'Pokušajte ponovo',
|
|
92
92
|
|
|
93
|
+
////// NOTIFICATIONS //////
|
|
94
|
+
InApp: 'In-app',
|
|
95
|
+
MarkAllAsRead: 'Označi sve kao pročitano',
|
|
96
|
+
NoNewNotifications: 'Nemate nove notifikacije',
|
|
97
|
+
Notifications: 'Notifikacije',
|
|
98
|
+
NotificationsAll: 'Sve',
|
|
99
|
+
NotificationsUnread: 'Nepročitane',
|
|
100
|
+
NotificationsRead: 'Pročitane',
|
|
101
|
+
NotificationSound: 'Zvuk notifikacije',
|
|
102
|
+
// NTitleADD_DOC: 'Dodat je dokument na platformu',
|
|
103
|
+
// NContentADD_DOC: 'Dokument sa brojem <documentNumber>{{- documentNumber}}</documentNumber> je dodat na platformu',
|
|
104
|
+
|
|
93
105
|
////// PAGES //////
|
|
94
106
|
ReturnToHomepage: 'Povratak na početnu stranicu',
|
|
95
107
|
FooterText: '',
|
package/src/utils/objectUtils.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { TFunction } from 'i18next';
|
|
1
2
|
import { IBooleanObject } from '../types/IBasic';
|
|
3
|
+
import { formatDate, formatDateAndTime } from './dateUtils';
|
|
4
|
+
import { INotification } from '../types/INotifications';
|
|
2
5
|
|
|
3
6
|
export const hasValue = (value: any) => ![null, undefined, ''].includes(value);
|
|
4
7
|
|
|
@@ -83,3 +86,19 @@ export const intersectArrays = <T>(
|
|
|
83
86
|
const set2 = new Set(arr2);
|
|
84
87
|
return (arr1 as T[]).filter(item => set2.has(item));
|
|
85
88
|
};
|
|
89
|
+
|
|
90
|
+
export const getNotificationValues = (
|
|
91
|
+
t: TFunction,
|
|
92
|
+
notificationValues?: INotification['values']
|
|
93
|
+
) =>
|
|
94
|
+
notificationValues?.reduce((obj, item) => {
|
|
95
|
+
let processedValue = item.value;
|
|
96
|
+
if (item.format === 'TRANSLATE') {
|
|
97
|
+
processedValue = t(processedValue);
|
|
98
|
+
} else if (item.format === 'DATE') {
|
|
99
|
+
processedValue = formatDate(processedValue);
|
|
100
|
+
} else if (item.format === 'DATE_TIME') {
|
|
101
|
+
processedValue = formatDateAndTime(processedValue);
|
|
102
|
+
}
|
|
103
|
+
return { ...obj, [item.key]: processedValue };
|
|
104
|
+
}, {});
|
package/src/utils/tableUtils.ts
CHANGED
|
@@ -100,7 +100,7 @@ export const setTemplateData = ({
|
|
|
100
100
|
newFilters && setFilters?.(newFilters);
|
|
101
101
|
columnData &&
|
|
102
102
|
columnData.setColumns?.(
|
|
103
|
-
getVisibleColumnsFromList(columnData.
|
|
103
|
+
getVisibleColumnsFromList(columnData.defaultColumns, template.columns)
|
|
104
104
|
);
|
|
105
105
|
template.sorts && setSort && setSort(template.sorts[0]);
|
|
106
106
|
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useTranslation as r}from"react-i18next";import{Link as a}from"react-router";import{Button as c}from"./index.js";import"@fortawesome/react-fontawesome";import"clsx";import"dayjs";import"react-beautiful-dnd";import"react-toastify";import"react";import"react-dom";import"react-calendar";import"react-select";import"react-select-async-paginate";import"react-select/async-creatable";const i=()=>{const{t:i}=r();return e("div",{className:"full-screen-page",children:[e("div",{id:"content",children:[t("h1",{children:i("NoAccessPage")}),t("p",{className:"subtitle",children:i("NoAccessPageInfo")})]}),t("p",{id:"img",className:"img-403",children:"403"}),t("div",{id:"actions",children:t(a,{to:"/",children:t(c,{label:i("ReturnToHomepage")})})})]})};export{i as default};
|
|
2
|
-
//# sourceMappingURL=NoAccessPage-DBq5IzIf.js.map
|