@inceptionbg/iui 2.0.11 → 2.0.13

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 (113) hide show
  1. package/dist/icons/index.d.ts +5 -1
  2. package/dist/icons/index.js +1 -1
  3. package/dist/index.d.ts +174 -79
  4. package/dist/index.js +1 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/iui.css +1 -1
  7. package/package.json +1 -1
  8. package/rollup.config.js +1 -5
  9. package/src/assets/icons/duotone/faCircleUser.ts +6 -6
  10. package/src/assets/icons/index.ts +2 -0
  11. package/src/assets/icons/light/faArrowDownShortWide.ts +1 -1
  12. package/src/assets/icons/light/faArrowDownWideShort.ts +1 -1
  13. package/src/assets/icons/light/faArrowUpArrowDown.ts +5 -5
  14. package/src/assets/icons/light/faArrowUpRightFromSquare.ts +1 -1
  15. package/src/assets/icons/light/faArrowsToLine.ts +1 -1
  16. package/src/assets/icons/light/faArrowsUpDown.ts +1 -1
  17. package/src/assets/icons/light/faBookmark.ts +15 -0
  18. package/src/assets/icons/light/faBookmarkSlash.ts +15 -0
  19. package/src/assets/icons/light/faCalendarPlus.ts +5 -5
  20. package/src/assets/icons/light/faCheck.ts +1 -1
  21. package/src/assets/icons/light/faChevronDown.ts +5 -5
  22. package/src/assets/icons/light/faChevronRight.ts +5 -5
  23. package/src/assets/icons/light/faCircleInfo.ts +5 -5
  24. package/src/assets/icons/light/faCircleXmark.ts +5 -5
  25. package/src/assets/icons/light/faClipboardCheck.ts +5 -5
  26. package/src/assets/icons/light/faClockRotateLeft.ts +1 -1
  27. package/src/assets/icons/light/faEllipsisVertical.ts +1 -1
  28. package/src/assets/icons/light/faEye.ts +5 -5
  29. package/src/assets/icons/light/faEyeSlash.ts +5 -5
  30. package/src/assets/icons/light/faFilter.ts +5 -5
  31. package/src/assets/icons/light/faGear.ts +1 -1
  32. package/src/assets/icons/light/faHouse.ts +5 -5
  33. package/src/assets/icons/light/faIdBadge.ts +5 -5
  34. package/src/assets/icons/light/faLineColumns.ts +5 -5
  35. package/src/assets/icons/light/faLink.ts +1 -1
  36. package/src/assets/icons/light/faMagnifyingGlass.ts +5 -5
  37. package/src/assets/icons/light/faPen.ts +5 -5
  38. package/src/assets/icons/light/faPrint.ts +5 -5
  39. package/src/assets/icons/light/faQuestion.ts +5 -5
  40. package/src/assets/icons/light/faRotateRight.ts +5 -5
  41. package/src/assets/icons/light/faTrashCan.ts +5 -5
  42. package/src/assets/icons/light/faTriangleExclamation.ts +5 -5
  43. package/src/assets/icons/light/faXmark.ts +1 -1
  44. package/src/assets/icons/regular/faArrowLeft.ts +6 -6
  45. package/src/assets/icons/regular/faArrowRightArrowLeft.ts +1 -1
  46. package/src/assets/icons/regular/faCircleCheck.ts +1 -1
  47. package/src/assets/icons/regular/faCircleExclamation.ts +1 -1
  48. package/src/assets/icons/regular/faCircleInfo.ts +1 -1
  49. package/src/assets/icons/regular/faFileArrowDown.ts +1 -1
  50. package/src/assets/icons/regular/faFilterCircleXmark.ts +1 -1
  51. package/src/assets/icons/regular/faTriangleExclamation.ts +1 -1
  52. package/src/assets/icons/solid/faAngleLeft.ts +1 -1
  53. package/src/assets/icons/solid/faAngleRight.ts +1 -1
  54. package/src/assets/icons/solid/faArrowDownWideShort.ts +1 -1
  55. package/src/assets/icons/solid/faCaretDown.ts +1 -1
  56. package/src/assets/icons/solid/faCheck.ts +5 -5
  57. package/src/assets/icons/solid/faEllipsisVertical.ts +1 -1
  58. package/src/assets/icons/solid/faFilter.ts +1 -1
  59. package/src/assets/icons/solid/faFloppyDisk.ts +1 -1
  60. package/src/assets/icons/solid/faGripDotsVertical.ts +1 -1
  61. package/src/assets/icons/solid/faListUl.ts +1 -1
  62. package/src/assets/icons/solid/faMinus.ts +6 -6
  63. package/src/assets/icons/solid/faPlus.ts +6 -6
  64. package/src/assets/icons/solid/faPrint.ts +1 -1
  65. package/src/assets/icons/solid/faRotateRight.ts +1 -1
  66. package/src/assets/icons/solid/faXmark.ts +1 -1
  67. package/src/components/Button/Button.tsx +2 -2
  68. package/src/components/Button/IconButton.tsx +1 -1
  69. package/src/components/Button/SplitButton.tsx +91 -0
  70. package/src/components/Dashboard/FastLinksWidget/FastLinksWidget.tsx +1 -1
  71. package/src/components/Dialog/components/DialogFooter.tsx +6 -2
  72. package/src/components/Header/Components/ModuleSelect.tsx +14 -6
  73. package/src/components/Inputs/InputWrapper.tsx +1 -1
  74. package/src/components/Inputs/TextInput.tsx +1 -1
  75. package/src/components/List/List.tsx +18 -0
  76. package/src/components/List/ListItem.tsx +24 -0
  77. package/src/components/Loader/ProgressBar.tsx +41 -0
  78. package/src/components/Menu/Menu.tsx +0 -3
  79. package/src/components/Menu/MenuItem.tsx +21 -23
  80. package/src/components/Menu/NewMenu.tsx +0 -3
  81. package/src/components/Pullover/Pullover.tsx +15 -6
  82. package/src/components/Sidebar/types/ISidebar.ts +1 -1
  83. package/src/components/Table/Table.tsx +18 -11
  84. package/src/components/Table/components/filters/TableFilters.tsx +3 -6
  85. package/src/components/Table/components/footer/TableFooter.tsx +6 -10
  86. package/src/components/Table/components/header/TableHeader.tsx +22 -24
  87. package/src/components/Table/components/header/TableHeaderRow.tsx +16 -7
  88. package/{idea/Table/Components/Print → src/components/Table/components/print}/TablePrint.tsx +89 -96
  89. package/src/components/Table/components/sort/TableSort.tsx +21 -1
  90. package/src/components/Table/components/templates/TableTemplates.tsx +98 -0
  91. package/src/components/Table/components/templates/components/CreateTemplateDialog.tsx +41 -0
  92. package/src/components/Table/hooks/useTablePrint.ts +75 -0
  93. package/src/index.ts +10 -0
  94. package/src/styles/App.scss +3 -0
  95. package/src/styles/common/_animations.scss +8 -14
  96. package/src/styles/common/helpers/_base.scss +0 -4
  97. package/src/styles/common/maps/_buttonMaps.scss +42 -0
  98. package/src/styles/components/_button.scss +11 -50
  99. package/src/styles/components/_buttonSplit.scss +90 -0
  100. package/src/styles/components/_header.scss +21 -9
  101. package/src/styles/components/_list.scss +41 -0
  102. package/src/styles/components/_loader.scss +3 -1
  103. package/src/styles/components/_menu.scss +19 -18
  104. package/src/styles/components/_print.scss +36 -46
  105. package/src/styles/components/_progressBar.scss +83 -0
  106. package/src/styles/components/_table.scss +17 -23
  107. package/src/styles/variables/_variables.scss +1 -0
  108. package/src/types/ITable.ts +42 -32
  109. package/src/utils/i18n/i18nIUICyrilic.ts +3 -2
  110. package/src/utils/i18n/i18nIUILatin.ts +18 -12
  111. package/src/utils/i18n/i18nIUIMe.ts +3 -2
  112. package/src/utils/icons.ts +1 -1
  113. package/tsconfig.json +2 -0
@@ -1,13 +1,12 @@
1
1
  import { Dispatch, MouseEvent, ReactElement, ReactNode, SetStateAction } from 'react';
2
- import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
3
2
  import { IAnyObject, ISimpleObject } from './IBasic';
4
3
  import { ITableKeyboardActionsBase } from './IKeyboard';
4
+ import { IPopupControl } from './IPopup';
5
5
 
6
- export interface ITable {
6
+ export interface ITable<T = unknown> {
7
7
  columns: ITableColumn[];
8
8
  // setColumns?: (data: ITableColumn[]) => void;
9
9
  // withColumnsSearch?: boolean;
10
- customHeader?: ITableColumn[][];
11
10
  data: ITableDataItem[];
12
11
  dataActions?: {
13
12
  edit?: {
@@ -23,11 +22,6 @@ export interface ITable {
23
22
  hasAccess: boolean;
24
23
  }[];
25
24
  };
26
- sumRows?: ITableDataItem[];
27
- isLoading?: boolean;
28
-
29
- headerWrap?: boolean;
30
- selectedRowUuid?: string;
31
25
  rowSelect?: {
32
26
  selectedRows: Set<string>;
33
27
  setSelectedRows: Dispatch<SetStateAction<Set<string>>>;
@@ -35,14 +29,28 @@ export interface ITable {
35
29
  };
36
30
  filterData?: ITableFilterData;
37
31
  sortData?: ITableSortData;
38
- // printData?: IPrintData;
39
- // customPrintData?: ICustomPrintData;
40
- // additionsalOptions?: ReactNode;
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
+ };
42
+ printData?: IPrintData<T>;
43
+ sumRows?: ITableDataItem[];
41
44
  editable?: ITableEdit;
45
+ selectedRowUuid?: string;
42
46
  keyboard?: {
43
47
  enabled: boolean;
44
48
  actions: ITableKeyboardActionsBase;
45
49
  };
50
+ headerWrap?: boolean;
51
+ customHeader?: ITableColumn[][];
52
+ // customPrintData?: ICustomPrintData;
53
+ // additionsalOptions?: ReactNode;
46
54
  footer?: {
47
55
  paginationControl?: IPaginationControl;
48
56
  customPagination?: {
@@ -51,22 +59,12 @@ export interface ITable {
51
59
  };
52
60
  totalRows?: number;
53
61
  // noTotalRows?: boolean;
54
- footerAction?: {
55
- icon?: IconDefinition;
56
- onClick: () => void;
57
- };
62
+ refetch?: () => void;
58
63
  };
59
-
64
+ isLoading?: boolean;
60
65
  className?: string;
61
66
  rowHeight?: 'xs' | 's' | 'm';
62
67
  maxHeight?: string;
63
- // templates?: {
64
- // identifier: string;
65
- // data: IReportTemplateData;
66
- // setTemplateName?: (templateName: string) => void;
67
- // onClearFilters: () => void;
68
- // allowPublicCreate?: boolean;
69
- // };
70
68
  }
71
69
 
72
70
  export interface ITableColumn {
@@ -87,6 +85,7 @@ export interface ITableColumn {
87
85
  desc: string;
88
86
  label: string;
89
87
  };
88
+ notFirstCell?: boolean;
90
89
  // code?: string;
91
90
  className?: string;
92
91
  }
@@ -193,19 +192,30 @@ export interface IBasePrintData {
193
192
  };
194
193
  saveXlsx?: () => void;
195
194
  }
196
- export interface ICustomPrintData extends IBasePrintData {
197
- content: ReactNode;
198
- }
199
- export interface IPrintData extends IBasePrintData {
195
+
196
+ export type IGetPrintData<T> = (props: {
197
+ pagination: IPagination;
198
+ noTotalRows?: boolean;
199
+ }) => Promise<{ items: T[]; totalRows?: number }>;
200
+
201
+ export interface IPrintData<T = unknown> extends IBasePrintData {
202
+ printPopupControl: IPopupControl;
203
+ customHeader?: ITableColumn[][];
204
+ excludeColumnIds?: string[];
205
+ isLoading?: boolean;
206
+ progress?: number;
207
+ tableData?: ITableDataItem[];
208
+ items?: T[];
209
+ paginationControl?: IPaginationControl;
210
+ totals?: ITableDataItem;
200
211
  optionalNode?: {
201
212
  aboveTable?: ReactNode;
202
213
  bellowTable?: ReactNode;
203
214
  };
204
- customHeader?: ITableColumn[][];
205
- excludeColumns?: string[];
206
- getPrintData: (pagination: IPagination) => Promise<{ data: any[]; totalRows?: number }>;
207
- formatPrintData: (data: any) => ITableDataItem[];
208
- totals?: ITableDataItem;
215
+ }
216
+
217
+ export interface ICustomPrintData extends IBasePrintData {
218
+ content: ReactNode;
209
219
  }
210
220
  ///////////////
211
221
 
@@ -13,7 +13,7 @@ export const i18nIUICyrilic = {
13
13
  Close: 'Затвори',
14
14
  Confirm: 'Потврди',
15
15
  Create: 'Креирај',
16
- Delete: 'Избриши',
16
+ Delete: 'Обриши',
17
17
  Edit: 'Измени',
18
18
  FreeText: 'Слободан унос',
19
19
  from: 'од',
@@ -32,6 +32,7 @@ export const i18nIUICyrilic = {
32
32
  Title: 'Наслов',
33
33
  to: 'до',
34
34
  Yes: 'Да',
35
+ LoadingProgress: 'Учитавање...',
35
36
 
36
37
  ////// TABLE //////
37
38
  RefreshData: 'Освежи податке',
@@ -39,7 +40,7 @@ export const i18nIUICyrilic = {
39
40
  Columns: 'Колоне',
40
41
  DragDropListsInfo:
41
42
  'Одаберите колоне за приказивање превлачењем са једне листе на другу',
42
- TableSelect: 'Акције над изабраним елементима',
43
+ TableSelect: 'Акције над изабраним редовима',
43
44
  Filter: 'Филтери',
44
45
  ApplyFilters: 'Примени филтере',
45
46
  HiddenColumns: 'Сакривене колоне',
@@ -13,7 +13,7 @@ export const i18nIUILatin = {
13
13
  Close: 'Zatvori',
14
14
  Confirm: 'Potvrdi',
15
15
  Create: 'Kreiraj',
16
- Delete: 'Izbriši',
16
+ Delete: 'Obriši',
17
17
  Edit: 'Izmeni',
18
18
  FreeText: 'Slobodan unos',
19
19
  from: 'od',
@@ -32,6 +32,7 @@ export const i18nIUILatin = {
32
32
  Title: 'Naslov',
33
33
  to: 'do',
34
34
  Yes: 'Da',
35
+ LoadingProgress: 'Učitavanje...',
35
36
 
36
37
  ////// TABLE //////
37
38
  RefreshData: 'Osveži podatke',
@@ -39,7 +40,7 @@ export const i18nIUILatin = {
39
40
  Columns: 'Kolone',
40
41
  DragDropListsInfo:
41
42
  'Odaberite kolone za prikazivanje prevlačenjem sa jedne liste na drugu',
42
- TableSelect: 'Akcije nad izabranim elementima',
43
+ TableSelect: 'Akcije nad izabranim redovima',
43
44
  Filter: 'Filteri',
44
45
  ApplyFilters: 'Primeni filtere',
45
46
  HiddenColumns: 'Sakrivene kolone',
@@ -55,18 +56,23 @@ export const i18nIUILatin = {
55
56
  SelectedColumns: 'Odabrane kolone',
56
57
  Sort: 'Sortiranje',
57
58
  AddItem: 'Dodaj stavku',
59
+ // TEMPLATES
58
60
  Templates: 'Šabloni',
59
- SelectTemplate: 'Izaberi šablon',
60
- TemplateList: 'Lista šablona',
61
- PublicTemplate: 'Javni šablon',
62
- PublicTemplates: 'Javni šabloni',
63
- DefaultTemplate: 'Osnovni šabloni',
64
- RemoveFiltersAndLook: 'Poništi izgled i filtere',
65
- CreateTemplateLong: 'Sačuvaj trenutni izgled kao šablon',
61
+ ApplyTemplate: 'Primeni šablon',
62
+ ResetTemplate: 'Poništi šablon',
63
+ DeleteTemplate: 'Obriši šablon',
64
+ CreateTemplateLong: 'Sačuvaj trenutni izgled kao šablon',
66
65
  CreateDefaultTemplate: 'Sačuvaj trenutni izgled kao podrazumevani',
67
- CreateTemplate: 'Sačuvaj šablon',
68
- DeleteTemplateDesc: 'Da li ste sigurni da želite da izbrišete šablon?',
69
- DeleteTemplateTitle: 'Brisanje šablona',
66
+ CreateTemplate: 'Kreiraj šablon',
67
+ TemplateName: 'Naziv šablona',
68
+ // SelectTemplate: 'Izaberi šablon',
69
+ // TemplateList: 'Lista šablona',
70
+ PublicTemplate: 'Javni šablon',
71
+ // PublicTemplates: 'Javni šabloni',
72
+ // DefaultTemplate: 'Osnovni šabloni',
73
+ // RemoveFiltersAndLook: 'Poništi izgled i filtere',
74
+ // DeleteTemplateDesc: 'Da li ste sigurni da želite da izbrišete šablon?',
75
+ // DeleteTemplateTitle: 'Brisanje šablona',
70
76
 
71
77
  FastLinks: 'Brzi pristup',
72
78
 
@@ -12,7 +12,7 @@ export const i18nIUIMe = {
12
12
  Close: 'Zatvori',
13
13
  Confirm: 'Potvrdi',
14
14
  Create: 'Kreiraj',
15
- Delete: 'Izbriši',
15
+ Delete: 'Obriši',
16
16
  Edit: 'Izmijeni',
17
17
  FreeText: 'Slobodan unos',
18
18
  from: 'od',
@@ -31,13 +31,14 @@ export const i18nIUIMe = {
31
31
  Title: 'Naslov',
32
32
  to: 'do',
33
33
  Yes: 'Da',
34
+ LoadingProgress: 'Učitavanje...',
34
35
 
35
36
  ////// TABLE //////
36
37
  RefreshData: 'Osvježi podatke',
37
38
  allResults: 'Svi',
38
39
  Columns: 'Kolone',
39
40
  DragDropListsInfo: 'Izaberite kolone za prikaz prevlačenjem sa jedne liste na drugu',
40
- TableSelect: 'Akcije nad izabranim elementima',
41
+ TableSelect: 'Akcije nad izabranim redovima',
41
42
  Filter: 'Filteri',
42
43
  ApplyFilters: 'Primijeni filtere',
43
44
  HiddenColumns: 'Skrivene kolone',
@@ -1,4 +1,4 @@
1
- import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
1
+ import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
2
2
  import { faCircleCheck } from '../assets/icons/regular/faCircleCheck';
3
3
  import { faCircleExclamation } from '../assets/icons/regular/faCircleExclamation';
4
4
  import { faCircleInfo } from '../assets/icons/regular/faCircleInfo';
package/tsconfig.json CHANGED
@@ -10,6 +10,8 @@
10
10
  "moduleResolution": "node",
11
11
  "forceConsistentCasingInFileNames": true,
12
12
  "skipLibCheck": true,
13
+ "declaration": true,
14
+ "declarationDir": "dist/types",
13
15
  "paths": {
14
16
  "react": ["./node_modules/@types/react"]
15
17
  }