@inceptionbg/iui 2.0.13 → 2.0.14

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.
Files changed (40) hide show
  1. package/dist/index.d.ts +84 -49
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/iui.css +1 -1
  5. package/package.json +1 -1
  6. package/src/assets/icons/light/faBookmark.ts +15 -15
  7. package/src/assets/icons/light/faBookmarkSlash.ts +15 -15
  8. package/src/assets/images/logo/inception.svg +22 -0
  9. package/src/components/Header/Components/ModuleSelect.tsx +15 -10
  10. package/src/components/Header/Components/UserMenu.tsx +1 -0
  11. package/src/components/List/List.tsx +4 -2
  12. package/src/components/List/ListItem.tsx +58 -13
  13. package/src/components/Menu/Menu.tsx +5 -1
  14. package/src/components/Pullover/Pullover.tsx +19 -11
  15. package/src/components/Sidebar/Sidebar.tsx +6 -4
  16. package/src/components/Table/Table.tsx +1 -4
  17. package/src/components/Table/components/edit/TableEditRow.tsx +4 -1
  18. package/src/components/Table/components/filters/TableFilters.tsx +4 -1
  19. package/src/components/Table/components/items/TableItemActions.tsx +12 -3
  20. package/src/components/Table/components/print/TablePrint.tsx +4 -1
  21. package/src/components/Table/components/templates/TableTemplates.tsx +49 -55
  22. package/src/components/Table/contexts/TableContext.tsx +13 -17
  23. package/src/components/Table/hooks/localHooks/useLocalTableColumns.tsx +8 -10
  24. package/src/components/Table/hooks/localHooks/useLocalTableData.tsx +1 -1
  25. package/src/components/Table/hooks/useTableColumns.ts +28 -0
  26. package/src/components/Table/hooks/useTablePagination.ts +10 -7
  27. package/src/components/Table/hooks/useTableSelect.ts +15 -7
  28. package/src/index.ts +12 -2
  29. package/src/styles/components/_header.scss +26 -5
  30. package/src/styles/components/_list.scss +18 -1
  31. package/src/styles/components/_page.scss +2 -1
  32. package/src/styles/components/_sidebar.scss +2 -2
  33. package/src/types/ITable.ts +40 -31
  34. package/src/utils/i18n/i18nIUICyrilic.ts +21 -12
  35. package/src/utils/i18n/i18nIUILatin.ts +8 -2
  36. package/src/utils/i18n/i18nIUIMe.ts +20 -10
  37. package/src/utils/logoUtils.ts +7 -0
  38. package/src/utils/tableUtils.ts +5 -5
  39. package/src/components/Table/components/templates/components/CreateTemplateDialog.tsx +0 -41
  40. package/src/components/Table/hooks/useDefaultTemplate.ts +0 -20
@@ -4,41 +4,17 @@ import { ITableKeyboardActionsBase } from './IKeyboard';
4
4
  import { IPopupControl } from './IPopup';
5
5
 
6
6
  export interface ITable<T = unknown> {
7
- columns: ITableColumn[];
8
- // setColumns?: (data: ITableColumn[]) => void;
9
- // withColumnsSearch?: boolean;
7
+ columnData: ITableColumnsData;
10
8
  data: ITableDataItem[];
11
- dataActions?: {
12
- edit?: {
13
- hasAccess: boolean;
14
- };
15
- delete?: {
16
- onClick: (itemUuid: string) => void;
17
- hasAccess: boolean;
18
- };
19
- actions?: {
20
- label: string;
21
- onClick: (item: ITableDataItem) => void;
22
- hasAccess: boolean;
23
- }[];
24
- };
9
+ dataActions?: ITableDataActions;
25
10
  rowSelect?: {
26
11
  selectedRows: Set<string>;
27
12
  setSelectedRows: Dispatch<SetStateAction<Set<string>>>;
28
- actions: ITableSelectedActions[];
13
+ actions: ITableSelectedAction[];
29
14
  };
30
15
  filterData?: ITableFilterData;
31
16
  sortData?: ITableSortData;
32
- templateData?: {
33
- identifier: string;
34
- setSearch?: (search: string) => void;
35
- items: IReportTemplate[];
36
- isLoading?: boolean;
37
- // data: IReportTemplateData;
38
- // setTemplateName?: (templateName: string) => void;
39
- // onClearFilters: () => void;
40
- allowPublicCreate?: boolean;
41
- };
17
+ templateData?: ITableTemplateData;
42
18
  printData?: IPrintData<T>;
43
19
  sumRows?: ITableDataItem[];
44
20
  editable?: ITableEdit;
@@ -116,6 +92,20 @@ export interface ITableDataItemCells {
116
92
  };
117
93
  }
118
94
 
95
+ export interface ITableDataActions {
96
+ edit?: {
97
+ hasAccess: boolean;
98
+ };
99
+ delete?: {
100
+ onClick: (itemUuid: string) => void;
101
+ hasAccess: boolean;
102
+ };
103
+ actions?: {
104
+ label: string;
105
+ onClick: (item: ITableDataItem) => void;
106
+ hasAccess: boolean;
107
+ }[];
108
+ }
119
109
  export interface ITableFilterData {
120
110
  filters: ITableFilter;
121
111
  customFilterIdList?: string[];
@@ -149,11 +139,12 @@ export interface ITableSort {
149
139
  }
150
140
 
151
141
  export interface ITableColumnsData {
142
+ defaultColumns: ITableColumn[];
152
143
  columns: ITableColumn[];
153
- setColumns: (columns: ITableColumn[]) => void;
154
- withSearch?: boolean;
144
+ setColumns?: (columns: ITableColumn[]) => void;
145
+ // withSearch?: boolean;
155
146
  }
156
- export interface ITableSelectedActions {
147
+ export interface ITableSelectedAction {
157
148
  label: string;
158
149
  onClick: (selected: Set<string>) => void;
159
150
  hidden?: boolean;
@@ -161,6 +152,24 @@ export interface ITableSelectedActions {
161
152
  clearSelected?: boolean;
162
153
  }
163
154
 
155
+ export interface ITableTemplateData {
156
+ identifier: string;
157
+ popupController: IPopupControl;
158
+ items: IReportTemplate[];
159
+ isLoading?: boolean;
160
+ isFetching?: boolean;
161
+ setSearch?: (search: string) => void;
162
+ initiateCreate: () => void;
163
+ initiateCreateDefault: () => void;
164
+ setItemToDeleteUuids: (itemUuids: string[]) => void;
165
+
166
+ // data: IReportTemplateData;
167
+ // setTemplateName?: (templateName: string) => void;
168
+ // onClearFilters: () => void;
169
+
170
+ allowPublicCreate?: boolean;
171
+ TemplateNode: ReactNode;
172
+ }
164
173
  ///// EDIT /////
165
174
  export interface ITableEdit<T = any> {
166
175
  selectedItem: T | null;
@@ -56,18 +56,26 @@ export const i18nIUICyrilic = {
56
56
  SelectedColumns: 'Одабране колоне',
57
57
  Sort: 'Сортирање',
58
58
  AddItem: 'Додај ставку',
59
+ // TEMPLATES
59
60
  Templates: 'Шаблони',
60
- SelectTemplate: 'Изабери шаблон',
61
- TemplateList: 'Листа шаблона',
62
- PublicTemplate: 'Јавни шаблон',
63
- PublicTemplates: 'Јавни шаблони',
64
- DefaultTemplate: 'Основни шаблони',
65
- RemoveFiltersAndLook: 'Поништи изглед и филтере',
66
- CreateTemplateLong: 'Сачувај тренутни изглед као шаблон',
61
+ ApplyTemplate: 'Примени шаблон',
62
+ ResetTemplate: 'Поништи шаблон',
63
+ DeleteTemplate: 'Обриши шаблон',
64
+ CreateTemplateLong: 'Сачувај тренутни изглед као шаблон',
67
65
  CreateDefaultTemplate: 'Сачувај тренутни изглед као подразумевани',
68
- CreateTemplate: 'Сачувај шаблон',
69
- DeleteTemplateDesc: 'Да ли сте сигурни да желите да избришете шаблон?',
70
- DeleteTemplateTitle: 'Брисање шаблона',
66
+ CreateTemplate: 'Креирај шаблон',
67
+ TemplateName: 'Назив шаблона',
68
+ NoTemplatesAvailable: `Нема доступних шаблона.
69
+ Кликните на "Креирај шаблон" да бисте направили шаблон са тренутно изабраним колонама, филтерима и сортирањем.`,
70
+ // SelectTemplate: 'Изабери шаблон',
71
+ // TemplateList: 'Листа шаблона',
72
+ PublicTemplate: 'Јавни шаблон',
73
+ // PublicTemplates: 'Јавни шаблони',
74
+ PrivateTemplate: 'Приватни шаблон',
75
+ // DefaultTemplate: 'Основни шаблони',
76
+ // RemoveFiltersAndLook: 'Поништи изглед и филтере',
77
+ // DeleteTemplateDesc: 'Да ли сте сигурни да желите да изришете шаблон?',
78
+ // DeleteTemplateTitle: 'Брисање шаблона',
71
79
 
72
80
  FastLinks: 'Брзи приступ',
73
81
 
@@ -79,13 +87,14 @@ export const i18nIUICyrilic = {
79
87
  ////// TOAST //////
80
88
  Pending: 'У току',
81
89
  Successfully: 'Успешно',
82
- DeletedSuccessfully: 'Успешно избрисано',
90
+ DeletedSuccessfully: 'Успешно обрисано',
83
91
  ErrorMessage: 'Дошло је до грешке!',
84
92
  TryAgain: 'Покушај поново',
85
93
 
86
94
  ////// PAGES //////
87
95
  ReturnToHomepage: 'Повратак на почетну страну',
88
- FooterText: `<strong>Инцеп️тион ЦА</strong> је сертификационо тело <strong>акредитовано</strong> за услугу <strong>електронске доставе</strong> и <strong>издавања временских жигова.<strong>`,
96
+ FooterText: `Инцептион ЦА је акредитовано сертификационо тело за квалификовану електронску доставу,
97
+ издавање временских жигова, валидацију квалификованог потписа и печата и квалификовано чување докумената.`,
89
98
  PageNotFound: 'Страница није пронађена',
90
99
  PageNotFoundInfo: `Страница коју тражите није пронађена или је премештена.
91
100
  Можете се вратити на почетну страну.`,
@@ -65,10 +65,13 @@ export const i18nIUILatin = {
65
65
  CreateDefaultTemplate: 'Sačuvaj trenutni izgled kao podrazumevani',
66
66
  CreateTemplate: 'Kreiraj šablon',
67
67
  TemplateName: 'Naziv šablona',
68
+ NoTemplatesAvailable: `Nema dostupnih šablona.
69
+ Kliknite na "Kreiraj šablon" da biste napravili šablon sa trenutno izabranim kolonama, filterima i sortiranjem.`,
68
70
  // SelectTemplate: 'Izaberi šablon',
69
71
  // TemplateList: 'Lista šablona',
70
72
  PublicTemplate: 'Javni šablon',
71
73
  // PublicTemplates: 'Javni šabloni',
74
+ PrivateTemplate: 'Privatni šablon',
72
75
  // DefaultTemplate: 'Osnovni šabloni',
73
76
  // RemoveFiltersAndLook: 'Poništi izgled i filtere',
74
77
  // DeleteTemplateDesc: 'Da li ste sigurni da želite da izbrišete šablon?',
@@ -82,13 +85,16 @@ export const i18nIUILatin = {
82
85
  CharNumber: 'Broj karaktera {{number}}',
83
86
 
84
87
  ////// TOAST //////
88
+ Pending: 'U toku',
85
89
  Successfully: 'Uspešno',
86
- DeletedSuccessfully: 'Uspešno izbrisano',
90
+ DeletedSuccessfully: 'Uspešno obrisano',
87
91
  ErrorMessage: 'Došlo je do greške!',
92
+ TryAgain: 'Pokušaj ponovo',
88
93
 
89
94
  ////// PAGES //////
90
95
  ReturnToHomepage: 'Povratak na početnu stranu',
91
- FooterText: `<strong>Incep️tion CA</strong> je sertifikaciono telo <strong>akreditovano</strong> za uslugu <strong>elektronske dostave</strong> i <strong>izdavanja vremenskih žigova.<strong>`,
96
+ FooterText: `Inception CA je akreditovano sertifikaciono telo za kvalifikovanu elektronsku dostavu,
97
+ izdavanje vremenskih žigova, validaciju kvalifikovanog potpisa i pečata i kvalifikovano čuvanje dokumenata.`,
92
98
  PageNotFound: 'Stranica nije pronadjena',
93
99
  PageNotFoundInfo: `Stranica koju tražite nije pronadjena ili je premeštena.
94
100
  Možete se vratiti na početnu stranu.`,
@@ -54,18 +54,27 @@ export const i18nIUIMe = {
54
54
  SelectedColumns: 'Odabrane kolone',
55
55
  Sort: 'Sortiranje',
56
56
  AddItem: 'Dodaj stavku',
57
+
58
+ // TEMPLATES
57
59
  Templates: 'Šabloni',
58
- SelectTemplate: 'Izaberi šablon',
59
- TemplateList: 'Lista šablona',
60
- PublicTemplate: 'Javni šablon',
61
- PublicTemplates: 'Javni šabloni',
62
- DefaultTemplate: 'Podrazumijevani šabloni',
63
- RemoveFiltersAndLook: 'Poništi izgled i filtere',
60
+ ApplyTemplate: 'Primijeni šablon',
61
+ ResetTemplate: 'Poništi šablon',
62
+ DeleteTemplate: 'Obriši šablon',
64
63
  CreateTemplateLong: 'Sačuvaj trenutni izgled kao šablon',
65
64
  CreateDefaultTemplate: 'Sačuvaj trenutni izgled kao podrazumijevani',
66
- CreateTemplate: 'Sačuvaj šablon',
67
- DeleteTemplateDesc: 'Da li ste sigurni da želite da izbrišete šablon?',
68
- DeleteTemplateTitle: 'Brisanje šablona',
65
+ CreateTemplate: 'Kreiraj šablon',
66
+ TemplateName: 'Naziv šablona',
67
+ NoTemplatesAvailable: `Nema dostupnih šablona.
68
+ Kliknite na "Kreiraj šablon" da biste napravili šablon sa trenutno izabranim kolonama, filterima i sortiranjem.`,
69
+ // SelectTemplate: 'Izaberi šablon',
70
+ // TemplateList: 'Lista šablona',
71
+ PublicTemplate: 'Javni šablon',
72
+ // PublicTemplates: 'Javni šabloni',
73
+ PrivateTemplate: 'Privatni šablon',
74
+ // DefaultTemplate: 'Osnovni šabloni',
75
+ // RemoveFiltersAndLook: 'Poništi izgled i filtere',
76
+ // DeleteTemplateDesc: 'Da li ste sigurni da želite da izbrišete šablon?',
77
+ // DeleteTemplateTitle: 'Brisanje šablona',
69
78
 
70
79
  FastLinks: 'Brzi linkovi',
71
80
 
@@ -77,13 +86,14 @@ export const i18nIUIMe = {
77
86
  ////// TOAST //////
78
87
  Pending: 'U toku',
79
88
  Successfully: 'Uspješno',
80
- DeletedSuccessfully: 'Uspješno izbrisano',
89
+ DeletedSuccessfully: 'Uspješno obrisano',
81
90
  ErrorMessage: 'Došlo je do greške!',
82
91
  TryAgain: 'Pokušajte ponovo',
83
92
 
84
93
  ////// PAGES //////
85
94
  ReturnToHomepage: 'Povratak na početnu stranicu',
86
95
  FooterText: '',
96
+
87
97
  PageNotFound: 'Stranica nije pronađena',
88
98
  PageNotFoundInfo: `Stranica koju tražite nije pronađena ili je premještena.
89
99
  Možete se vratiti na početnu stranicu.`,
@@ -0,0 +1,7 @@
1
+ import MTS from '../assets/images/logo/mts.svg';
2
+ import PPL from '../assets/images/logo/paperless.svg';
3
+ import INC from '../assets/images/logo/inception.svg';
4
+
5
+ export type IOrgLogo = 'MTS' | 'PPL' | 'INC';
6
+
7
+ export const orgLogo: Record<IOrgLogo, string> = { MTS, PPL, INC };
@@ -86,21 +86,21 @@ export const convertReportTemplateFilterToSearch = (
86
86
 
87
87
  export const setTemplateData = ({
88
88
  template,
89
- columnsData,
89
+ columnData,
90
90
  setFilters,
91
91
  setSort,
92
92
  }: {
93
93
  template: IReportTemplate;
94
- columnsData?: ITableColumnsData;
94
+ columnData?: ITableColumnsData;
95
95
  setFilters?: (filters: IAnyObject) => void;
96
96
  setSort?: (sort: string) => void;
97
97
  }) => {
98
98
  const newFilters =
99
99
  template.filterValues && convertReportTemplateFilterToSearch(template.filterValues);
100
100
  newFilters && setFilters?.(newFilters);
101
- template.columns &&
102
- columnsData?.setColumns(
103
- getVisibleColumnsFromList(columnsData.columns, template.columns)
101
+ columnData &&
102
+ columnData.setColumns?.(
103
+ getVisibleColumnsFromList(columnData.columns, template.columns)
104
104
  );
105
105
  template.sorts && setSort && setSort(template.sorts[0]);
106
106
  };
@@ -1,41 +0,0 @@
1
- import { useState, type FC } from 'react';
2
- import { IPopupControl } from '../../../../../types/IPopup';
3
- import { useTranslation } from 'react-i18next';
4
- import { Dialog } from '../../../../Dialog/Dialog';
5
- import { TextInput } from '../../../../Inputs/TextInput';
6
- import { Checkbox } from '../../../../Inputs/Checkbox';
7
- import { IReportTemplate } from '../../../../../types/ITable';
8
- import { useTableContext } from '../../../contexts/TableContext';
9
-
10
- interface Props {
11
- control: IPopupControl['control'];
12
- }
13
-
14
- export const CreateTemplateDialog: FC<Props> = ({ control }) => {
15
- const { t } = useTranslation();
16
- const { templateData } = useTableContext();
17
-
18
- const [formData, setFormData] = useState<Partial<IReportTemplate>>({});
19
-
20
- return (
21
- <Dialog
22
- title={t('CreateTemplateLong')}
23
- control={control}
24
- onFormSubmit={() => console.log('Template saved!')}
25
- footer={{ confirmButton: { label: t('CreateTemplate'), type: 'submit' } }}
26
- >
27
- <TextInput
28
- label={t('TemplateName')}
29
- value={formData.name}
30
- setValue={name => setFormData({ ...formData, name })}
31
- />
32
- {templateData?.allowPublicCreate && (
33
- <Checkbox
34
- label={t('PublicTemplate')}
35
- value={formData.isPublic}
36
- setValue={isPublic => setFormData({ ...formData, isPublic })}
37
- />
38
- )}
39
- </Dialog>
40
- );
41
- };
@@ -1,20 +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
- // useEffect(() => {
9
- // if (identifier) {
10
- // getDefaultReportTemplate(identifier)
11
- // .then(setTemplate)
12
- // .catch(() => {})
13
- // .finally(() => setIsLoading(false));
14
- // }
15
- // }, [identifier]);
16
- // return {
17
- // defaultTemplate: template,
18
- // isLoadingDefaultTemplate: !!identifier && isLoading,
19
- // };
20
- };