@inceptionbg/iui 2.0.34 → 2.0.36

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 (244) hide show
  1. package/dist/index.d.ts +7 -6
  2. package/dist/index.js.map +1 -1
  3. package/dist/iui.css +1 -1
  4. package/package.json +25 -22
  5. package/idea/GridTable/GridTable.tsx +0 -119
  6. package/idea/GridTable/gridTable.scss +0 -42
  7. package/idea/Menu/Menu.tsx +0 -121
  8. package/idea/Menu/MenuItem.tsx +0 -75
  9. package/idea/Menu/hooks/useMenuControl.ts +0 -13
  10. package/idea/Menu.tsx +0 -133
  11. package/idea/NoAccessInfo.tsx +0 -193
  12. package/idea/Table/Components/Edit/ItemActionsMenu.tsx +0 -85
  13. package/idea/Table/Components/Edit/ItemEditOptionsButtons.tsx +0 -31
  14. package/idea/Table/Components/Edit/TableEditRow.tsx +0 -57
  15. package/idea/Table/Components/FilterItem.tsx +0 -20
  16. package/idea/Table/Components/Header/TableHeader.tsx +0 -46
  17. package/idea/Table/Components/Header/TableHeaderRow.tsx +0 -37
  18. package/idea/Table/Components/Print/CustomTablePrint.tsx +0 -115
  19. package/idea/Table/Components/SetSortList.tsx +0 -30
  20. package/idea/Table/Components/SetTableFilter.tsx +0 -91
  21. package/idea/Table/Components/TableFooter.tsx +0 -137
  22. package/idea/Table/Components/TableOptions.tsx +0 -227
  23. package/idea/Table/Components/Templates/TemplateCreate.tsx +0 -80
  24. package/idea/Table/Components/Templates/TemplateCreateDefault.tsx +0 -45
  25. package/idea/Table/Components/Templates/TemplateList.tsx +0 -167
  26. package/idea/Table/Components/Templates/repo/TemplateRepo.ts +0 -53
  27. package/idea/Table/Table.tsx +0 -528
  28. package/idea/Table/hooks/useDefaultTemplate.ts +0 -20
  29. package/idea/Table/hooks/useTableKeyboard.ts +0 -137
  30. package/idea/Table/hooks/useTableSelect.ts +0 -11
  31. package/rollup.config.js +0 -52
  32. package/src/assets/icons/duotone/faBell.ts +0 -17
  33. package/src/assets/icons/duotone/faCircleUser.ts +0 -17
  34. package/src/assets/icons/regular/faArrowLeft.ts +0 -15
  35. package/src/assets/icons/regular/faArrowRightArrowLeft.ts +0 -15
  36. package/src/assets/icons/regular/faCircleCheck.ts +0 -15
  37. package/src/assets/icons/regular/faCircleExclamation.ts +0 -15
  38. package/src/assets/icons/regular/faCircleInfo.ts +0 -15
  39. package/src/assets/icons/regular/faFileArrowDown.ts +0 -15
  40. package/src/assets/icons/regular/faFilterCircleXmark.ts +0 -15
  41. package/src/assets/icons/regular/faTriangleExclamation.ts +0 -15
  42. package/src/assets/icons/solid/faAngleLeft.ts +0 -15
  43. package/src/assets/icons/solid/faAngleRight.ts +0 -15
  44. package/src/assets/icons/solid/faArrowDownWideShort.ts +0 -15
  45. package/src/assets/icons/solid/faCaretDown.ts +0 -15
  46. package/src/assets/icons/solid/faCheck.ts +0 -15
  47. package/src/assets/icons/solid/faEllipsisVertical.ts +0 -15
  48. package/src/assets/icons/solid/faEnvelopeDot.ts +0 -15
  49. package/src/assets/icons/solid/faFilter.ts +0 -15
  50. package/src/assets/icons/solid/faFloppyDisk.ts +0 -15
  51. package/src/assets/icons/solid/faGripDotsVertical.ts +0 -15
  52. package/src/assets/icons/solid/faListUl.ts +0 -15
  53. package/src/assets/icons/solid/faMinus.ts +0 -15
  54. package/src/assets/icons/solid/faPlus.ts +0 -15
  55. package/src/assets/icons/solid/faPrint.ts +0 -15
  56. package/src/assets/icons/solid/faRotateRight.ts +0 -15
  57. package/src/assets/icons/solid/faXmark.ts +0 -15
  58. package/src/assets/images/logo/inception.svg +0 -22
  59. package/src/assets/images/logo/mts.svg +0 -5703
  60. package/src/assets/images/logo/paperless.svg +0 -21
  61. package/src/assets/images/logo/pismonosa.png +0 -0
  62. package/src/assets/images/not-found.svg +0 -19
  63. package/src/components/Accordions/Accordions.tsx +0 -74
  64. package/src/components/Alert/Alert.tsx +0 -31
  65. package/src/components/Badge/DotBadge.tsx +0 -16
  66. package/src/components/Badge/NotificationBadge.tsx +0 -29
  67. package/src/components/Badge/PillBadge.tsx +0 -13
  68. package/src/components/Button/Button.tsx +0 -56
  69. package/src/components/Button/IconButton.tsx +0 -51
  70. package/src/components/Button/SplitButton.tsx +0 -91
  71. package/src/components/Dashboard/Dashboard.tsx +0 -9
  72. package/src/components/Dashboard/DashboardWidget.tsx +0 -44
  73. package/src/components/Dashboard/FastLinksWidget/FastLinksWidget.tsx +0 -36
  74. package/src/components/Dialog/Dialog.tsx +0 -178
  75. package/src/components/Dialog/components/DialogFooter.tsx +0 -100
  76. package/src/components/Header/Components/EnvBadge.tsx +0 -17
  77. package/src/components/Header/Components/ModuleSelect.tsx +0 -68
  78. package/src/components/Header/Components/Notifications.tsx +0 -204
  79. package/src/components/Header/Components/UserMenu.tsx +0 -52
  80. package/src/components/Header/Header.tsx +0 -45
  81. package/src/components/Helper/Collapse.tsx +0 -53
  82. package/src/components/Inputs/Checkbox.tsx +0 -53
  83. package/src/components/Inputs/CurrencyInput.tsx +0 -124
  84. package/src/components/Inputs/DateInput/DateInput.tsx +0 -184
  85. package/src/components/Inputs/DateInput/components/DatePartInput.tsx +0 -159
  86. package/src/components/Inputs/InputWrapper.tsx +0 -95
  87. package/src/components/Inputs/NumberInput.tsx +0 -86
  88. package/src/components/Inputs/PasswordInput.tsx +0 -39
  89. package/src/components/Inputs/PhoneInput/PhoneInput.tsx +0 -108
  90. package/src/components/Inputs/PhoneInput/utils/countryCode.ts +0 -20
  91. package/src/components/Inputs/Radio.tsx +0 -59
  92. package/src/components/Inputs/RadioGroup.tsx +0 -48
  93. package/src/components/Inputs/RadioLarge.tsx +0 -39
  94. package/src/components/Inputs/SearchInput.tsx +0 -46
  95. package/src/components/Inputs/Selects/Select.tsx +0 -17
  96. package/src/components/Inputs/Selects/components/CustomSelectComponents.tsx +0 -19
  97. package/src/components/Inputs/Selects/components/SelectWrapper.tsx +0 -118
  98. package/src/components/Inputs/Selects/utils/selectStyles.ts +0 -101
  99. package/src/components/Inputs/TextAreaInput.tsx +0 -68
  100. package/src/components/Inputs/TextInput.tsx +0 -100
  101. package/src/components/Inputs/TimeInput/TimeInput.tsx +0 -81
  102. package/src/components/List/List.tsx +0 -21
  103. package/src/components/List/ListItem.tsx +0 -70
  104. package/src/components/Loader/Loader.tsx +0 -66
  105. package/src/components/Loader/ProgressBar.tsx +0 -41
  106. package/src/components/Menu/Menu.tsx +0 -81
  107. package/src/components/Menu/MenuItem.tsx +0 -46
  108. package/src/components/Menu/NewMenu.tsx +0 -63
  109. package/src/components/Menu/hooks/useMenuPosition.tsx +0 -116
  110. package/src/components/PageComponents/ScrollableContent.tsx +0 -11
  111. package/src/components/Pullover/Pullover.tsx +0 -197
  112. package/src/components/Router/Router.tsx +0 -52
  113. package/src/components/Sidebar/AddButton.tsx +0 -22
  114. package/src/components/Sidebar/Sidebar.tsx +0 -85
  115. package/src/components/Sidebar/SidebarItem.tsx +0 -84
  116. package/src/components/Sidebar/types/ISidebar.ts +0 -28
  117. package/src/components/Table/Table.tsx +0 -258
  118. package/src/components/Table/components/columns/ColumnsList.tsx +0 -60
  119. package/src/components/Table/components/columns/TableColumnsEdit.tsx +0 -114
  120. package/src/components/Table/components/edit/TableEditRow.tsx +0 -78
  121. package/src/components/Table/components/filters/FilterItem.tsx +0 -15
  122. package/src/components/Table/components/filters/TableFilters.tsx +0 -126
  123. package/src/components/Table/components/footer/TableFooter.tsx +0 -126
  124. package/src/components/Table/components/header/TableHeader.tsx +0 -40
  125. package/src/components/Table/components/header/TableHeaderRow.tsx +0 -57
  126. package/src/components/Table/components/items/TableItemActions.tsx +0 -78
  127. package/src/components/Table/components/print/TablePrint.tsx +0 -200
  128. package/src/components/Table/components/select/TableSelect.tsx +0 -50
  129. package/src/components/Table/components/sort/TableSort.tsx +0 -75
  130. package/src/components/Table/components/templates/CreateTemplateDialog.tsx +0 -58
  131. package/src/components/Table/components/templates/TableTemplates.tsx +0 -65
  132. package/src/components/Table/components/templates/TemplatesPullover.tsx +0 -88
  133. package/src/components/Table/contexts/TableContext.tsx +0 -117
  134. package/src/components/Table/hooks/localHooks/useLocalTableColumns.tsx +0 -70
  135. package/src/components/Table/hooks/localHooks/useLocalTableData.tsx +0 -82
  136. package/src/components/Table/hooks/localHooks/useLocalTableKeyboard.ts +0 -175
  137. package/src/components/Table/hooks/localHooks/useLocalTablePagination.ts +0 -12
  138. package/src/components/Table/hooks/useTableColumns.ts +0 -34
  139. package/src/components/Table/hooks/useTableEdit.tsx +0 -140
  140. package/src/components/Table/hooks/useTableFilterFields.tsx +0 -150
  141. package/src/components/Table/hooks/useTablePagination.ts +0 -19
  142. package/src/components/Table/hooks/useTablePrint.ts +0 -83
  143. package/src/components/Table/hooks/useTableSearch.ts +0 -31
  144. package/src/components/Table/hooks/useTableSelect.ts +0 -19
  145. package/src/components/Table/hooks/useTableSort.ts +0 -8
  146. package/src/components/Tabs/Tabs.tsx +0 -68
  147. package/src/components/Tooltip/Tooltip.tsx +0 -191
  148. package/src/components/Tree/Tree.tsx +0 -22
  149. package/src/components/Tree/TreeItem.tsx +0 -57
  150. package/src/components/Wrappers/AppLayout.tsx +0 -17
  151. package/src/components/Wrappers/ConditionalWrapper.tsx +0 -10
  152. package/src/components/Wrappers/FormWrapper.tsx +0 -84
  153. package/src/components/Wrappers/PageLayout.tsx +0 -168
  154. package/src/hooks/useBackgroundClose.ts +0 -19
  155. package/src/hooks/useGetFocusableElements.ts +0 -43
  156. package/src/hooks/useIsMenuOpen.ts +0 -11
  157. package/src/hooks/useLocalPopoverControl.ts +0 -63
  158. package/src/hooks/useOnEsc.ts +0 -14
  159. package/src/hooks/usePopupControl.ts +0 -22
  160. package/src/hooks/useZendesk.ts +0 -21
  161. package/src/index.ts +0 -387
  162. package/src/pages/NoAccessPage.tsx +0 -27
  163. package/src/pages/NotFoundPage.tsx +0 -26
  164. package/src/styles/App.scss +0 -47
  165. package/src/styles/common/_animations.scss +0 -58
  166. package/src/styles/common/_typography.scss +0 -91
  167. package/src/styles/common/helpers/_base.scss +0 -55
  168. package/src/styles/common/helpers/_color.scss +0 -10
  169. package/src/styles/common/helpers/_display.scss +0 -85
  170. package/src/styles/common/helpers/_size.scss +0 -25
  171. package/src/styles/common/maps/_align.scss +0 -21
  172. package/src/styles/common/maps/_buttonMaps.scss +0 -42
  173. package/src/styles/common/maps/_info-types.scss +0 -1
  174. package/src/styles/common/maps/_spacing.scss +0 -78
  175. package/src/styles/common/maps/_text.scss +0 -14
  176. package/src/styles/components/_accordions.scss +0 -51
  177. package/src/styles/components/_alert.scss +0 -23
  178. package/src/styles/components/_badge.scss +0 -84
  179. package/src/styles/components/_button.scss +0 -99
  180. package/src/styles/components/_buttonSplit.scss +0 -65
  181. package/src/styles/components/_card.scss +0 -24
  182. package/src/styles/components/_dialog.scss +0 -119
  183. package/src/styles/components/_form.scss +0 -8
  184. package/src/styles/components/_header.scss +0 -157
  185. package/src/styles/components/_input.scss +0 -167
  186. package/src/styles/components/_inputCheckbox.scss +0 -48
  187. package/src/styles/components/_inputDateTime.scss +0 -161
  188. package/src/styles/components/_inputRadio.scss +0 -83
  189. package/src/styles/components/_inputSelect.scss +0 -8
  190. package/src/styles/components/_list.scss +0 -58
  191. package/src/styles/components/_loader.scss +0 -55
  192. package/src/styles/components/_menu-v2.scss +0 -67
  193. package/src/styles/components/_menu.scss +0 -62
  194. package/src/styles/components/_notifications.scss +0 -71
  195. package/src/styles/components/_page.scss +0 -84
  196. package/src/styles/components/_portal.scss +0 -8
  197. package/src/styles/components/_print.scss +0 -77
  198. package/src/styles/components/_progressBar.scss +0 -83
  199. package/src/styles/components/_pullover.scss +0 -95
  200. package/src/styles/components/_scrollbar.scss +0 -18
  201. package/src/styles/components/_sidebar.scss +0 -204
  202. package/src/styles/components/_smallComponents.scss +0 -23
  203. package/src/styles/components/_table.scss +0 -340
  204. package/src/styles/components/_tabs.scss +0 -33
  205. package/src/styles/components/_tooltip.scss +0 -48
  206. package/src/styles/components/_tree.scss +0 -21
  207. package/src/styles/components/_widget.scss +0 -90
  208. package/src/styles/pages/_fullScreenPage.scss +0 -64
  209. package/src/styles/variables/_bp.scss +0 -6
  210. package/src/styles/variables/_variables.scss +0 -142
  211. package/src/types/Base/custom.d.ts +0 -9
  212. package/src/types/IBasic.ts +0 -32
  213. package/src/types/ICountryCode.ts +0 -5
  214. package/src/types/IError.ts +0 -5
  215. package/src/types/IHeader.ts +0 -40
  216. package/src/types/IInfo.ts +0 -1
  217. package/src/types/IKeyboard.ts +0 -33
  218. package/src/types/IMenu.ts +0 -19
  219. package/src/types/INotifications.ts +0 -15
  220. package/src/types/IPopup.ts +0 -17
  221. package/src/types/IRouter.ts +0 -6
  222. package/src/types/ISelect.ts +0 -54
  223. package/src/types/ITab.ts +0 -10
  224. package/src/types/ITable.ts +0 -291
  225. package/src/types/ITree.ts +0 -6
  226. package/src/utils/InputPatternValidation.ts +0 -12
  227. package/src/utils/dateUtils.ts +0 -32
  228. package/src/utils/fileUtils.ts +0 -177
  229. package/src/utils/i18n/i18nIUICyrilic.ts +0 -119
  230. package/src/utils/i18n/i18nIUILatin.ts +0 -120
  231. package/src/utils/i18n/i18nIUIMe.ts +0 -118
  232. package/src/utils/icons.ts +0 -13
  233. package/src/utils/localStorageHelper.ts +0 -24
  234. package/src/utils/logoUtils.ts +0 -7
  235. package/src/utils/numberUtils.ts +0 -21
  236. package/src/utils/objectUtils.ts +0 -114
  237. package/src/utils/popupUtils.ts +0 -82
  238. package/src/utils/rootDir.ts +0 -1
  239. package/src/utils/stringUtils.ts +0 -18
  240. package/src/utils/tableUtils.ts +0 -130
  241. package/src/utils/toasts.ts +0 -6
  242. package/src/utils/urlUtils.ts +0 -4
  243. package/tsconfig.icons.json +0 -5
  244. package/tsconfig.json +0 -22
@@ -1,37 +0,0 @@
1
- import type { FC } from 'react';
2
- import type { ITableColumn } from '../../../../types/ITable';
3
-
4
- interface Props {
5
- row: ITableColumn[];
6
- }
7
-
8
- export const TableHeaderRow: FC<Props> = ({ row }) => (
9
- <tr>
10
- {row.map(col => (
11
- <th
12
- key={col.id}
13
- colSpan={col.colSpan}
14
- rowSpan={col.rowSpan}
15
- className={col.color}
16
- style={
17
- col.minWidth
18
- ? { minWidth: col.minWidth }
19
- : col.width
20
- ? { width: col.width }
21
- : undefined
22
- }
23
- hidden={col.hidden}
24
- >
25
- <div className="flex align-center">
26
- {typeof col.label === 'string' ? (
27
- <p className={`full-width p-3 text-${col.align || 'left'}`}>{col.label}</p>
28
- ) : (
29
- <div className={`full-width px-3 text-${col.align || 'left'}`}>
30
- {col.label}
31
- </div>
32
- )}
33
- </div>
34
- </th>
35
- ))}
36
- </tr>
37
- );
@@ -1,115 +0,0 @@
1
- import type { FC} from 'react';
2
- import { useEffect } from 'react';
3
- import { createPortal } from 'react-dom';
4
- import { faFileArrowDown } from '../../../../assets/icons/regular/faFileArrowDown';
5
- import { faPrint } from '../../../../assets/icons/solid/faPrint';
6
- import { faXmark } from '../../../../assets/icons/solid/faXmark';
7
- import type { ICustomPrintData } from '../../../../types/ITable';
8
- import { formatDate, getCurrentDateFormatted } from '../../../../utils/dateUtils';
9
- import { Button } from '../../../Button/Button';
10
- import { useTranslation } from 'react-i18next';
11
- import { rootDir } from '../../../../utils/rootDir';
12
- import { useHideZendesk } from '../../../../hooks/useZendesk';
13
-
14
- interface Props extends ICustomPrintData {
15
- isOpen: boolean;
16
- onClose: () => void;
17
- }
18
- export const CustomTablePrint: FC<Props> = ({
19
- isOpen,
20
- onClose,
21
- label,
22
- organization,
23
- filters,
24
- content,
25
- saveXlsx,
26
- }) => {
27
- const { t } = useTranslation();
28
- useHideZendesk();
29
-
30
- useEffect(() => {
31
- rootDir?.classList.add('hidden');
32
- return () => {
33
- rootDir?.classList.remove('hidden');
34
- };
35
- }, []);
36
-
37
- return isOpen
38
- ? createPortal(
39
- <div className="iui-print-dialog">
40
- <div className="content">
41
- <div className="flex justify-between">
42
- {organization ? (
43
- <div>
44
- <p className="name">{organization.name}</p>
45
- {organization.taxId && <p>{`${t('TaxId')}: ${organization.taxId}`}</p>}
46
- {organization.registrationNumber && (
47
- <p>{`${t('BusinessCode')}: ${organization.registrationNumber}`}</p>
48
- )}
49
- {organization.jbkjs && <p>JBKJS: {organization.jbkjs}</p>}
50
- {organization.email && <p>Email: {organization.email}</p>}
51
- </div>
52
- ) : (
53
- <div />
54
- )}
55
- <div className="text-right">
56
- <p>{`${t('PrintDate')}: ${getCurrentDateFormatted()}`}</p>
57
- </div>
58
- </div>
59
- <h3 className="my-3 text-center">{label}</h3>
60
- {filters && (
61
- <div className="flex justify-between">
62
- <div>
63
- {filters.basic?.map(
64
- e =>
65
- !!e.value && (
66
- <div key={e.value} className="mb-2">
67
- <p>{`${e.label}: ${e.value}`}</p>
68
- </div>
69
- )
70
- )}
71
- </div>
72
- {filters.date && (
73
- <div>
74
- {filters.date.map(
75
- e =>
76
- (!!e.from || !!e.to) && (
77
- <div key={e.label} className="mb-2 text-right">
78
- <p>
79
- {e.label} {!!e.from && `${t('from')} ${formatDate(e.from)}`}{' '}
80
- {`${t('to')} ${formatDate(e.to || new Date().toString())}`}
81
- </p>
82
- </div>
83
- )
84
- )}
85
- </div>
86
- )}
87
- </div>
88
- )}
89
- {content}
90
- </div>
91
- <div className="iui-print-actions no-print">
92
- <Button
93
- label={t('Cancel')}
94
- icon={faXmark}
95
- onClick={e => {
96
- e.stopPropagation();
97
- onClose();
98
- }}
99
- className="mr-3"
100
- />
101
- {!!saveXlsx && (
102
- <Button
103
- label={t('SaveXlsx')}
104
- icon={faFileArrowDown}
105
- onClick={() => saveXlsx()}
106
- className="mr-3"
107
- />
108
- )}
109
- <Button label={t('Print')} icon={faPrint} onClick={() => window.print()} />
110
- </div>
111
- </div>,
112
- document.body
113
- )
114
- : null;
115
- };
@@ -1,30 +0,0 @@
1
- import type { FC } from 'react';
2
- // import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3
- import type { ITableSort } from '../../../types/ITable';
4
- import { faArrowDownWideShort } from '../../../assets/icons/light/faArrowDownWideShort';
5
- import { faArrowDownShortWide } from '../../../assets/icons/light/faArrowDownShortWide';
6
- import { MenuItem } from '../../Menu/MenuItem';
7
-
8
- interface Props {
9
- sort: string;
10
- setSort: (sort: string) => void;
11
- sortOptions: ITableSort[];
12
- }
13
- export const SetSortList: FC<Props> = ({ sortOptions, sort, setSort }) => (
14
- <>
15
- {sortOptions.map(e => (
16
- <MenuItem
17
- key={e.label}
18
- label={e.label}
19
- className="menu-item-m"
20
- onClick={() => setSort(sort === e.desc ? e.asc : e.desc)}
21
- icon={sort === e.desc ? faArrowDownWideShort : faArrowDownShortWide}
22
- />
23
- // <div className="flex center justify-between full-width">
24
- // {/* <p className="mr-5 mb-0">{e.label}</p> */}
25
- // {sort === e.desc && <FontAwesomeIcon icon={faArrowDownWideShort} />}
26
- // {sort === e.asc && <FontAwesomeIcon icon={faArrowDownShortWide} />}
27
- // </div>
28
- ))}
29
- </>
30
- );
@@ -1,91 +0,0 @@
1
- import type { FC} from 'react';
2
- import { useMemo, useState } from 'react';
3
- import { faFilterCircleXmark } from '../../../assets/icons/regular/faFilterCircleXmark';
4
- import { faMagnifyingGlass } from '../../../assets/icons/solid/faMagnifyingGlass';
5
- import { faXmark } from '../../../assets/icons/solid/faXmark';
6
- import type { ITableFilterData, ITableFilterItem } from '../../../types/ITable';
7
- import { deleteEmptyPropsIncludingArray, deleteProps } from '../../../utils/objectUtils';
8
- import { Dialog } from '../../Dialog/Dialog';
9
- import { FilterItem } from './FilterItem';
10
- import { useTranslation } from 'react-i18next';
11
- import { SearchInput } from '../../Inputs/SearchInput';
12
-
13
- interface Props extends ITableFilterData {
14
- isOpen: boolean;
15
- onClose: () => void;
16
- }
17
-
18
- export const SetTableFilter: FC<Props> = ({
19
- columns,
20
- filters,
21
- additionalFilters,
22
- excludeFromSearch,
23
- searchData,
24
- setSearchData,
25
- onSubmit,
26
- resetData,
27
- isOpen,
28
- onClose,
29
- }) => {
30
- const [search, setSearch] = useState('');
31
-
32
- const { t } = useTranslation();
33
-
34
- const visibleFilters = useMemo(
35
- () =>
36
- columns.reduce(
37
- (arr: ITableFilterItem[], col) =>
38
- !!filters[col] ? arr.concat(filters[col]) : arr,
39
- []
40
- ),
41
- [columns, filters]
42
- );
43
-
44
- const filteredFilters = useMemo(
45
- () =>
46
- visibleFilters.filter(e => e?.label.toLowerCase().includes(search.toLowerCase())),
47
- [visibleFilters, search]
48
- );
49
-
50
- return (
51
- <Dialog
52
- className="iui-table-filter"
53
- titleEl={
54
- <div className="filters-search">
55
- <h1>{t('Filter')}</h1>
56
- <SearchInput onSearch={setSearch} className="search-input" />
57
- </div>
58
- }
59
- isOpen={isOpen}
60
- onClose={() => {
61
- setSearch('');
62
- onClose();
63
- }}
64
- cancelButton={{ icon: faXmark }}
65
- additionalButton={{
66
- label: t('ResetFilter'),
67
- icon: faFilterCircleXmark,
68
- onClick: () => {
69
- setSearchData(resetData || {});
70
- onSubmit(resetData || {});
71
- },
72
- disabled: resetData
73
- ? JSON.stringify(searchData) === JSON.stringify(resetData)
74
- : Object.keys(searchData).length === 0,
75
- }}
76
- confirmButton={{
77
- label: t('Search'),
78
- icon: faMagnifyingGlass,
79
- onFormSubmit: () => {
80
- const data = deleteEmptyPropsIncludingArray(searchData);
81
- onSubmit(excludeFromSearch ? deleteProps(data, excludeFromSearch) : data);
82
- },
83
- }}
84
- >
85
- {filteredFilters?.map(item => (
86
- <FilterItem key={item.label} item={item} />
87
- ))}
88
- {additionalFilters && <div className="pb-1">{additionalFilters}</div>}
89
- </Dialog>
90
- );
91
- };
@@ -1,137 +0,0 @@
1
- import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
2
- import type { FC, MouseEventHandler} from 'react';
3
- import { useEffect, useState } from 'react';
4
- import { faAngleLeft } from '../../../assets/icons/solid/faAngleLeft';
5
- import { faAngleRight } from '../../../assets/icons/solid/faAngleRight';
6
- import { faRotateRight } from '../../../assets/icons/solid/faRotateRight';
7
- import { IconButton } from '../../Button/IconButton';
8
- import { useTranslation } from 'react-i18next';
9
- import type { IServerSidePagination} from '../../../types/ITable';
10
- import { tableStandardLimit } from '../../../types/ITable';
11
- import { Select } from '../../Inputs/Selects/Select';
12
- import type { ISelectData } from '../../../types/ISelect';
13
- import { TextInput } from '../../Inputs/TextInput';
14
-
15
- interface Props {
16
- pagination: IServerSidePagination;
17
- noTotalRows?: boolean;
18
- dataLength: number;
19
- footerAction?: {
20
- icon?: IconDefinition;
21
- onClick: MouseEventHandler<HTMLButtonElement>;
22
- };
23
- customLimit?: number[];
24
- }
25
-
26
- export const TableFooter: FC<Props> = ({
27
- pagination: { limit, offset, setLimit, setOffset, totalRows },
28
- noTotalRows,
29
- dataLength,
30
- footerAction,
31
- customLimit,
32
- }) => {
33
- const [tempOffset, setTempOffset] = useState(offset + 1);
34
-
35
- const { t } = useTranslation();
36
-
37
- useEffect(() => {
38
- setTempOffset(offset + 1);
39
- }, [offset]);
40
-
41
- const handleChangeLimit = (value: ISelectData) => {
42
- const newLimit = Math.floor(+value.value);
43
- setLimit(newLimit);
44
- setOffset(0);
45
- };
46
-
47
- const maxOffset = Math.ceil(totalRows / limit);
48
-
49
- return (
50
- <div className={`table-footer ${footerAction ? 'justify-between' : 'justify-right'}`}>
51
- {!!footerAction && (
52
- <IconButton
53
- icon={footerAction.icon || faRotateRight}
54
- onClick={footerAction.onClick}
55
- tooltip={t('RefreshData')}
56
- // outlined
57
- size="s"
58
- />
59
- )}
60
- <div className="pagination">
61
- <div className="flex align-center gap-2">
62
- <p>{t('rowsPerPage')}</p>
63
- <Select
64
- value={{ label: `${limit}`, value: limit }}
65
- // size="s"
66
- minWidth={60}
67
- onChange={handleChangeLimit}
68
- options={(customLimit || tableStandardLimit).map(e => ({
69
- label: `${e}`,
70
- value: e ?? t('allResults'),
71
- }))}
72
- isClearable={false}
73
- />
74
- {/* {(customLimit || tableStandardLimit).map(e => (
75
- <option key={e} value={e}>
76
- {e ? e : t('allResults')}
77
- </option>
78
- ))}
79
- </Select> */}
80
- {!noTotalRows && (
81
- <p>
82
- {limit
83
- ? `${offset * limit + 1}-${
84
- offset * limit + limit <= totalRows
85
- ? offset * limit + limit
86
- : totalRows
87
- } ${t('of')} ${totalRows}`
88
- : `${t('allResults')} ${t('of')} ${totalRows} `}
89
- </p>
90
- )}
91
- </div>
92
- <div className="separator" />
93
- {/* <p>|</p> */}
94
- <div className="flex gap-1 align-center">
95
- <p>{t('page')}:</p>
96
- <IconButton
97
- disabled={offset < 1}
98
- icon={faAngleLeft}
99
- onClick={() => setOffset(offset - 1)}
100
- size="s"
101
- />
102
- <TextInput
103
- className="offset-input"
104
- value={`${tempOffset}`}
105
- setValue={e => !isNaN(+e) && setTempOffset(+e)}
106
- isClearable={false}
107
- inputProps={{
108
- onFocus: e => e.target.select(),
109
- onBlur: () => setTempOffset(offset + 1),
110
- onKeyUp: e => {
111
- if (e.key === 'Enter') {
112
- const value = tempOffset;
113
- if (typeof value === 'number' && value >= 0 && value <= maxOffset) {
114
- setOffset(value - 1);
115
- } else {
116
- setTempOffset(offset + 1);
117
- }
118
- }
119
- },
120
- }}
121
- />
122
- <IconButton
123
- disabled={
124
- noTotalRows /* && serverSidePagination */
125
- ? limit > dataLength
126
- : offset + 1 >= maxOffset
127
- }
128
- icon={faAngleRight}
129
- onClick={() => setOffset(offset + 1)}
130
- size="s"
131
- />
132
- {!noTotalRows && <p>{`${t('of')} ${maxOffset}`}</p>}
133
- </div>
134
- </div>
135
- </div>
136
- );
137
- };
@@ -1,227 +0,0 @@
1
- import type { FC, ReactNode} from 'react';
2
- import { useState } from 'react';
3
- import { faPrint } from '../../../assets/icons/solid/faPrint';
4
- import type {
5
- ITableSortData,
6
- ITableColumn,
7
- ITableFilterData,
8
- IPrintData,
9
- ITableColumnsData,
10
- ITable,
11
- ICustomPrintData,
12
- } from '../../../types/ITable';
13
- import { getActiveFilterNumber, setTemplateData } from '../../../utils/tableUtils';
14
- import { NotificationBadge } from '../../Badge/NotificationBadge';
15
- import { TablePrint } from './Print/TablePrint';
16
- import { SetColumnsList } from './Columns/SetColumnsList';
17
- import { SetSortList } from './SetSortList';
18
- import { SetTableFilter } from './SetTableFilter';
19
- import { useTranslation } from 'react-i18next';
20
- // import { TemplateList } from './Templates/TemplateList';
21
- // import { TemplateCreate } from './Templates/TemplateCreate';
22
- // import { TemplateCreateDefault } from './Templates/TemplateCreateDefault';
23
- import { MenuItem } from '../../Menu/MenuItem';
24
- import { maxChar } from '../../../utils/stringUtils';
25
- import { deletePropsThatEndsWith } from '../../../utils/objectUtils';
26
- import { CustomTablePrint } from './Print/CustomTablePrint';
27
- import { IconButton } from '../../Button/IconButton';
28
- import { Tooltip } from '../../Tooltip/Tooltip';
29
- import { Menu } from '../../Menu/Menu';
30
- import { faFilter } from '../../../assets/icons/light/faFilter';
31
- import { faLineColumns } from '../../../assets/icons/light/faLineColumns';
32
- import { faArrowUpArrowDown } from '../../../assets/icons/light/faArrowUpArrowDown';
33
-
34
- interface Props {
35
- columns: ITableColumn[];
36
- columnsData?: ITableColumnsData;
37
- filterData?: ITableFilterData;
38
- sortData?: ITableSortData;
39
- printData?: IPrintData;
40
- customPrintData?: ICustomPrintData;
41
- templates?: ITable['templates'];
42
- additionsalOptions?: ReactNode;
43
- }
44
- export const TableOptions: FC<Props> = ({
45
- columns,
46
- columnsData,
47
- filterData,
48
- sortData,
49
- printData,
50
- customPrintData,
51
- templates,
52
- additionsalOptions,
53
- }) => {
54
- const [selectedTemplateName, setSelectedTemplateName] = useState('');
55
- const [opened, setOpened] = useState<
56
- 'filter' | 'sort' | 'columns' | 'print' | 'templates' | ''
57
- >('');
58
-
59
- const { t } = useTranslation();
60
-
61
- const onClose = () => setOpened('');
62
-
63
- return (
64
- <div className="table-options gap-2">
65
- <div className="flex align-center gap-3">
66
- {filterData && (
67
- <>
68
- <NotificationBadge number={getActiveFilterNumber(filterData.search)}>
69
- <IconButton
70
- icon={faFilter}
71
- tooltip={t('Filter')}
72
- active={opened === 'filter'}
73
- onClick={() => setOpened('filter')}
74
- size="s"
75
- variant="outlined"
76
- />
77
- </NotificationBadge>
78
- <SetTableFilter
79
- {...filterData}
80
- onSubmit={search => {
81
- filterData.onSubmit(search);
82
- setSelectedTemplateName('');
83
- templates?.setTemplateName?.('');
84
- }}
85
- isOpen={opened === 'filter'}
86
- onClose={onClose}
87
- />
88
- </>
89
- )}
90
- {columnsData && (
91
- <>
92
- <IconButton
93
- icon={faLineColumns}
94
- tooltip={t('Columns')}
95
- active={opened === 'columns'}
96
- onClick={() => setOpened('columns')}
97
- size="s"
98
- variant="outlined"
99
- />
100
- {opened === 'columns' && (
101
- <SetColumnsList
102
- columns={columnsData.columns}
103
- setColumns={data => {
104
- columnsData.setColumns(data);
105
- setSelectedTemplateName('');
106
- templates?.setTemplateName?.('');
107
- }}
108
- isOpen={true}
109
- onClose={onClose}
110
- withSearch={columnsData.withSearch}
111
- />
112
- )}
113
- </>
114
- )}
115
- {sortData && (
116
- <Menu
117
- isOpen={opened === 'sort'}
118
- onClose={onClose}
119
- renderButton={ref => (
120
- <Tooltip label={t('Sort')} ref={ref}>
121
- <IconButton
122
- icon={faArrowUpArrowDown}
123
- active={opened === 'sort'}
124
- onClick={() => setOpened('sort')}
125
- size="s"
126
- variant="outlined"
127
- />
128
- </Tooltip>
129
- )}
130
- size={sortData.menuSize}
131
- >
132
- <SetSortList
133
- {...sortData}
134
- setSort={data => {
135
- sortData.setSort(data);
136
- setSelectedTemplateName('');
137
- templates?.setTemplateName?.('');
138
- }}
139
- />
140
- </Menu>
141
- )}
142
- {/* {templates && (
143
- <Menu
144
- renderButton={ref => (
145
- <Tooltip
146
- label={
147
- selectedTemplateName
148
- ? `${t('Templates')} (${maxChar(selectedTemplateName, 30)})`
149
- : t('Templates')
150
- }
151
- ref={ref}
152
- >
153
- <IconButton
154
- icon={faPenField}
155
- active={opened === 'templates'}
156
- onClick={() => setOpened('templates')}
157
- size="s"
158
- variant="outlined"
159
- />
160
- </Tooltip>
161
- )}
162
- isOpen={opened === 'templates'}
163
- onClose={onClose}
164
- >
165
- <TemplateList
166
- identifier={templates.identifier}
167
- onSelect={template => {
168
- setTemplateData({
169
- template,
170
- columnsData,
171
- setFilters: e => {
172
- filterData?.setSearchData(e);
173
- filterData?.onSubmit(deletePropsThatEndsWith(e, 'Obj'));
174
- },
175
- setSort: sortData?.setSort,
176
- });
177
- setSelectedTemplateName(template.name);
178
- templates.setTemplateName?.(template.name);
179
- onClose();
180
- }}
181
- />
182
- <MenuItem
183
- label={t('RemoveFiltersAndLook')}
184
- onClick={() => {
185
- templates.onClearFilters();
186
- setSelectedTemplateName('');
187
- templates.setTemplateName?.('');
188
- onClose();
189
- }}
190
- />
191
- <TemplateCreate
192
- identifier={templates.identifier}
193
- data={templates.data}
194
- onSubmitCallback={onClose}
195
- allowPublicCreate={templates.allowPublicCreate}
196
- />
197
- <TemplateCreateDefault
198
- identifier={templates.identifier}
199
- data={templates.data}
200
- onClose={onClose}
201
- />
202
- </Menu>
203
- )} */}
204
- {(printData ?? customPrintData) && (
205
- <>
206
- <IconButton
207
- icon={faPrint}
208
- tooltip={t('PrintExport')}
209
- onClick={() => setOpened('print')}
210
- size="s"
211
- variant="solid"
212
- />
213
- {opened === 'print' &&
214
- (printData ? (
215
- <TablePrint {...printData} isOpen onClose={onClose} columns={columns} />
216
- ) : (
217
- customPrintData && (
218
- <CustomTablePrint {...customPrintData} isOpen onClose={onClose} />
219
- )
220
- ))}
221
- </>
222
- )}
223
- {additionsalOptions}
224
- </div>
225
- </div>
226
- );
227
- };