@inceptionbg/iui 2.0.11 → 2.0.12

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 (105) 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 +151 -80
  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/src/assets/icons/duotone/faCircleUser.ts +6 -6
  9. package/src/assets/icons/index.ts +2 -0
  10. package/src/assets/icons/light/faArrowDownShortWide.ts +1 -1
  11. package/src/assets/icons/light/faArrowDownWideShort.ts +1 -1
  12. package/src/assets/icons/light/faArrowUpArrowDown.ts +5 -5
  13. package/src/assets/icons/light/faArrowUpRightFromSquare.ts +1 -1
  14. package/src/assets/icons/light/faArrowsToLine.ts +1 -1
  15. package/src/assets/icons/light/faArrowsUpDown.ts +1 -1
  16. package/src/assets/icons/light/faBookmark.ts +15 -0
  17. package/src/assets/icons/light/faBookmarkSlash.ts +15 -0
  18. package/src/assets/icons/light/faCalendarPlus.ts +5 -5
  19. package/src/assets/icons/light/faCheck.ts +1 -1
  20. package/src/assets/icons/light/faChevronDown.ts +5 -5
  21. package/src/assets/icons/light/faChevronRight.ts +5 -5
  22. package/src/assets/icons/light/faCircleInfo.ts +5 -5
  23. package/src/assets/icons/light/faCircleXmark.ts +5 -5
  24. package/src/assets/icons/light/faClipboardCheck.ts +5 -5
  25. package/src/assets/icons/light/faClockRotateLeft.ts +1 -1
  26. package/src/assets/icons/light/faEllipsisVertical.ts +1 -1
  27. package/src/assets/icons/light/faEye.ts +5 -5
  28. package/src/assets/icons/light/faEyeSlash.ts +5 -5
  29. package/src/assets/icons/light/faFilter.ts +5 -5
  30. package/src/assets/icons/light/faGear.ts +1 -1
  31. package/src/assets/icons/light/faHouse.ts +5 -5
  32. package/src/assets/icons/light/faIdBadge.ts +5 -5
  33. package/src/assets/icons/light/faLineColumns.ts +5 -5
  34. package/src/assets/icons/light/faLink.ts +1 -1
  35. package/src/assets/icons/light/faMagnifyingGlass.ts +5 -5
  36. package/src/assets/icons/light/faPen.ts +5 -5
  37. package/src/assets/icons/light/faPrint.ts +5 -5
  38. package/src/assets/icons/light/faQuestion.ts +5 -5
  39. package/src/assets/icons/light/faRotateRight.ts +5 -5
  40. package/src/assets/icons/light/faTrashCan.ts +5 -5
  41. package/src/assets/icons/light/faTriangleExclamation.ts +5 -5
  42. package/src/assets/icons/light/faXmark.ts +1 -1
  43. package/src/assets/icons/regular/faArrowLeft.ts +6 -6
  44. package/src/assets/icons/regular/faArrowRightArrowLeft.ts +1 -1
  45. package/src/assets/icons/regular/faCircleCheck.ts +1 -1
  46. package/src/assets/icons/regular/faCircleExclamation.ts +1 -1
  47. package/src/assets/icons/regular/faCircleInfo.ts +1 -1
  48. package/src/assets/icons/regular/faFileArrowDown.ts +1 -1
  49. package/src/assets/icons/regular/faFilterCircleXmark.ts +1 -1
  50. package/src/assets/icons/regular/faTriangleExclamation.ts +1 -1
  51. package/src/assets/icons/solid/faAngleLeft.ts +1 -1
  52. package/src/assets/icons/solid/faAngleRight.ts +1 -1
  53. package/src/assets/icons/solid/faArrowDownWideShort.ts +1 -1
  54. package/src/assets/icons/solid/faCaretDown.ts +1 -1
  55. package/src/assets/icons/solid/faCheck.ts +5 -5
  56. package/src/assets/icons/solid/faEllipsisVertical.ts +1 -1
  57. package/src/assets/icons/solid/faFilter.ts +1 -1
  58. package/src/assets/icons/solid/faFloppyDisk.ts +1 -1
  59. package/src/assets/icons/solid/faGripDotsVertical.ts +1 -1
  60. package/src/assets/icons/solid/faListUl.ts +1 -1
  61. package/src/assets/icons/solid/faMinus.ts +6 -6
  62. package/src/assets/icons/solid/faPlus.ts +6 -6
  63. package/src/assets/icons/solid/faPrint.ts +1 -1
  64. package/src/assets/icons/solid/faRotateRight.ts +1 -1
  65. package/src/assets/icons/solid/faXmark.ts +1 -1
  66. package/src/components/Button/Button.tsx +1 -1
  67. package/src/components/Button/IconButton.tsx +1 -1
  68. package/src/components/Dashboard/FastLinksWidget/FastLinksWidget.tsx +1 -1
  69. package/src/components/Dialog/components/DialogFooter.tsx +1 -1
  70. package/src/components/Header/Components/ModuleSelect.tsx +14 -6
  71. package/src/components/Inputs/InputWrapper.tsx +1 -1
  72. package/src/components/Inputs/TextInput.tsx +1 -1
  73. package/src/components/List/List.tsx +18 -0
  74. package/src/components/List/ListItem.tsx +24 -0
  75. package/src/components/Loader/ProgressBar.tsx +41 -0
  76. package/src/components/Menu/Menu.tsx +0 -3
  77. package/src/components/Menu/MenuItem.tsx +21 -23
  78. package/src/components/Menu/NewMenu.tsx +0 -3
  79. package/src/components/Pullover/Pullover.tsx +5 -4
  80. package/src/components/Sidebar/types/ISidebar.ts +1 -1
  81. package/src/components/Table/Table.tsx +18 -11
  82. package/src/components/Table/components/filters/TableFilters.tsx +3 -6
  83. package/src/components/Table/components/footer/TableFooter.tsx +6 -10
  84. package/src/components/Table/components/header/TableHeader.tsx +22 -24
  85. package/src/components/Table/components/header/TableHeaderRow.tsx +16 -7
  86. package/{idea/Table/Components/Print → src/components/Table/components/print}/TablePrint.tsx +89 -96
  87. package/src/components/Table/components/sort/TableSort.tsx +2 -0
  88. package/src/components/Table/components/templates/TableTemplates.tsx +81 -0
  89. package/src/components/Table/hooks/useTablePrint.ts +75 -0
  90. package/src/index.ts +8 -0
  91. package/src/styles/App.scss +2 -0
  92. package/src/styles/common/_animations.scss +8 -14
  93. package/src/styles/common/helpers/_base.scss +0 -4
  94. package/src/styles/components/_header.scss +21 -9
  95. package/src/styles/components/_list.scss +40 -0
  96. package/src/styles/components/_loader.scss +3 -1
  97. package/src/styles/components/_menu.scss +19 -18
  98. package/src/styles/components/_print.scss +36 -46
  99. package/src/styles/components/_progressBar.scss +83 -0
  100. package/src/styles/components/_table.scss +16 -22
  101. package/src/types/ITable.ts +55 -32
  102. package/src/utils/i18n/i18nIUICyrilic.ts +2 -1
  103. package/src/utils/i18n/i18nIUILatin.ts +16 -12
  104. package/src/utils/i18n/i18nIUIMe.ts +2 -1
  105. package/src/utils/icons.ts +1 -1
@@ -2,19 +2,19 @@
2
2
 
3
3
  table {
4
4
  border-spacing: 0px;
5
- border-collapse: collapse;
5
+ // border-collapse: collapse;
6
6
  }
7
7
  .iui-table {
8
8
  //// Header ////
9
9
  thead {
10
10
  z-index: 2;
11
- background-color: var(--primary-100);
11
+ background-color: var(--neutral-200);
12
+ tr:first-child th {
13
+ border-top: var(--border);
14
+ }
12
15
  }
13
16
  th {
14
17
  padding: 4px 12px;
15
- border-left: var(--border);
16
- border-right: var(--border);
17
-
18
18
  font-weight: bold;
19
19
  p {
20
20
  font-size: 12px;
@@ -33,22 +33,13 @@ table {
33
33
  top: 0;
34
34
  z-index: 1;
35
35
  }
36
- .border-row {
37
- background-color: var(--border-color);
38
- height: 1px;
39
- padding: 0;
40
- }
41
36
 
42
37
  //// Body ////
43
- // tbody.no-last-border tr:last-child td {
44
- // border: none;
45
- // }
46
38
  // Row
47
39
  tr {
48
40
  scroll-snap-align: start;
49
41
  }
50
42
  tbody tr {
51
- // border-bottom: var(--border);
52
43
  &.clickable:hover,
53
44
  &.selected {
54
45
  background-color: rgba(0, 0, 0, 0.05);
@@ -64,18 +55,14 @@ table {
64
55
  // Cell
65
56
  th,
66
57
  td {
67
- // 1px solid #f2f4f7;
58
+ border-bottom: var(--border);
68
59
  // Cell colors
69
60
  &.secondary {
70
61
  background-color: rgba(0, 0, 0, 0.04);
71
- // border-bottom: 1px solid #d3d3d3;
72
62
  }
73
63
  }
74
64
  td {
75
- border: var(--border);
76
- border-top: none;
77
65
  font-size: 14px;
78
- box-sizing: border-box;
79
66
  height: 48px;
80
67
  padding: 6px 12px;
81
68
  &.s {
@@ -96,7 +83,6 @@ table {
96
83
  align-items: center;
97
84
  justify-content: center;
98
85
  padding: 0 4px;
99
- // gap: 8px;
100
86
  }
101
87
 
102
88
  //// Footer ////
@@ -106,7 +92,6 @@ table {
106
92
  width: 100%;
107
93
  padding: 8px;
108
94
  font-size: var(--fs-m);
109
- box-sizing: border-box;
110
95
  .pagination {
111
96
  display: flex;
112
97
  align-items: center;
@@ -149,6 +134,13 @@ table {
149
134
  }
150
135
 
151
136
  @media #{bp.$landscape} {
137
+ td,
138
+ th {
139
+ border-right: var(--border);
140
+ &:first-child:not(.not-first-cell) {
141
+ border-left: var(--border);
142
+ }
143
+ }
152
144
  .select-col,
153
145
  .actions-col {
154
146
  padding: 0;
@@ -168,7 +160,6 @@ table {
168
160
  }
169
161
  tr {
170
162
  padding-bottom: 20px;
171
- border-top: var(--border);
172
163
  }
173
164
  td {
174
165
  display: flex;
@@ -210,6 +201,9 @@ table {
210
201
  }
211
202
  }
212
203
 
204
+ .table-sort-item {
205
+ flex-direction: row-reverse;
206
+ }
213
207
  // .dual-list-container {
214
208
  // .dual-list-content {
215
209
  // display: grid;
@@ -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,18 @@ export interface ITable {
35
29
  };
36
30
  filterData?: ITableFilterData;
37
31
  sortData?: ITableSortData;
38
- // printData?: IPrintData;
39
- // customPrintData?: ICustomPrintData;
40
- // additionsalOptions?: ReactNode;
32
+ printData?: IPrintData<T>;
33
+ sumRows?: ITableDataItem[];
41
34
  editable?: ITableEdit;
35
+ selectedRowUuid?: string;
42
36
  keyboard?: {
43
37
  enabled: boolean;
44
38
  actions: ITableKeyboardActionsBase;
45
39
  };
40
+ headerWrap?: boolean;
41
+ customHeader?: ITableColumn[][];
42
+ // customPrintData?: ICustomPrintData;
43
+ // additionsalOptions?: ReactNode;
46
44
  footer?: {
47
45
  paginationControl?: IPaginationControl;
48
46
  customPagination?: {
@@ -51,22 +49,35 @@ export interface ITable {
51
49
  };
52
50
  totalRows?: number;
53
51
  // noTotalRows?: boolean;
54
- footerAction?: {
55
- icon?: IconDefinition;
56
- onClick: () => void;
57
- };
52
+ refetch?: () => void;
58
53
  };
59
-
54
+ isLoading?: boolean;
60
55
  className?: string;
61
56
  rowHeight?: 'xs' | 's' | 'm';
62
57
  maxHeight?: string;
63
- // templates?: {
64
- // identifier: string;
65
- // data: IReportTemplateData;
66
- // setTemplateName?: (templateName: string) => void;
67
- // onClearFilters: () => void;
68
- // allowPublicCreate?: boolean;
69
- // };
58
+ templates?: {
59
+ identifier: string;
60
+ setSearch?: (search: string) => void;
61
+ items: {
62
+ uuid: string;
63
+ name: string;
64
+ // identifier: string;
65
+ // filterValues?: IReportTemplateFilterValue[];
66
+ // columns: string[];
67
+ // organization?: ISimpleObject;
68
+ // subsystem?: IModule;
69
+ // sorts?: string[];
70
+ // isPublic?: boolean;
71
+ // isDefault?: boolean;
72
+ // order?: number;
73
+ // createdAt?: string;
74
+ // createdBy?: ISimpleObject;
75
+ }[];
76
+ // data: IReportTemplateData;
77
+ // setTemplateName?: (templateName: string) => void;
78
+ // onClearFilters: () => void;
79
+ // allowPublicCreate?: boolean;
80
+ };
70
81
  }
71
82
 
72
83
  export interface ITableColumn {
@@ -87,6 +98,7 @@ export interface ITableColumn {
87
98
  desc: string;
88
99
  label: string;
89
100
  };
101
+ notFirstCell?: boolean;
90
102
  // code?: string;
91
103
  className?: string;
92
104
  }
@@ -193,19 +205,30 @@ export interface IBasePrintData {
193
205
  };
194
206
  saveXlsx?: () => void;
195
207
  }
196
- export interface ICustomPrintData extends IBasePrintData {
197
- content: ReactNode;
198
- }
199
- export interface IPrintData extends IBasePrintData {
208
+
209
+ export type IGetPrintData<T> = (props: {
210
+ pagination: IPagination;
211
+ noTotalRows?: boolean;
212
+ }) => Promise<{ items: T[]; totalRows?: number }>;
213
+
214
+ export interface IPrintData<T = unknown> extends IBasePrintData {
215
+ printPopupControl: IPopupControl;
216
+ customHeader?: ITableColumn[][];
217
+ excludeColumnIds?: string[];
218
+ isLoading?: boolean;
219
+ progress?: number;
220
+ tableData?: ITableDataItem[];
221
+ items?: T[];
222
+ paginationControl?: IPaginationControl;
223
+ totals?: ITableDataItem;
200
224
  optionalNode?: {
201
225
  aboveTable?: ReactNode;
202
226
  bellowTable?: ReactNode;
203
227
  };
204
- customHeader?: ITableColumn[][];
205
- excludeColumns?: string[];
206
- getPrintData: (pagination: IPagination) => Promise<{ data: any[]; totalRows?: number }>;
207
- formatPrintData: (data: any) => ITableDataItem[];
208
- totals?: ITableDataItem;
228
+ }
229
+
230
+ export interface ICustomPrintData extends IBasePrintData {
231
+ content: ReactNode;
209
232
  }
210
233
  ///////////////
211
234
 
@@ -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: 'Освежи податке',
@@ -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',
@@ -55,18 +56,21 @@ 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',
66
- 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',
61
+ ApplyTemplate: 'Primeni šablon',
62
+ ResetTemplate: 'Poništi šablon',
63
+ // SelectTemplate: 'Izaberi šablon',
64
+ // TemplateList: 'Lista šablona',
65
+ // PublicTemplate: 'Javni šablon',
66
+ // PublicTemplates: 'Javni šabloni',
67
+ // DefaultTemplate: 'Osnovni šabloni',
68
+ // RemoveFiltersAndLook: 'Poništi izgled i filtere',
69
+ // CreateTemplateLong: 'Sačuvaj trenutni izgled kao šablon',
70
+ // CreateDefaultTemplate: 'Sačuvaj trenutni izgled kao podrazumevani',
71
+ // CreateTemplate: 'Sačuvaj šablon',
72
+ // DeleteTemplateDesc: 'Da li ste sigurni da želite da izbrišete šablon?',
73
+ // DeleteTemplateTitle: 'Brisanje šablona',
70
74
 
71
75
  FastLinks: 'Brzi pristup',
72
76
 
@@ -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,6 +31,7 @@ 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',
@@ -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';