@inceptionbg/iui 2.0.35 → 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 (241) hide show
  1. package/package.json +4 -1
  2. package/idea/GridTable/GridTable.tsx +0 -119
  3. package/idea/GridTable/gridTable.scss +0 -42
  4. package/idea/Menu/Menu.tsx +0 -121
  5. package/idea/Menu/MenuItem.tsx +0 -75
  6. package/idea/Menu/hooks/useMenuControl.ts +0 -13
  7. package/idea/Menu.tsx +0 -133
  8. package/idea/NoAccessInfo.tsx +0 -193
  9. package/idea/Table/Components/Edit/ItemActionsMenu.tsx +0 -85
  10. package/idea/Table/Components/Edit/ItemEditOptionsButtons.tsx +0 -31
  11. package/idea/Table/Components/Edit/TableEditRow.tsx +0 -57
  12. package/idea/Table/Components/FilterItem.tsx +0 -20
  13. package/idea/Table/Components/Header/TableHeader.tsx +0 -46
  14. package/idea/Table/Components/Header/TableHeaderRow.tsx +0 -37
  15. package/idea/Table/Components/Print/CustomTablePrint.tsx +0 -115
  16. package/idea/Table/Components/SetSortList.tsx +0 -30
  17. package/idea/Table/Components/SetTableFilter.tsx +0 -91
  18. package/idea/Table/Components/TableFooter.tsx +0 -137
  19. package/idea/Table/Components/TableOptions.tsx +0 -227
  20. package/idea/Table/Components/Templates/TemplateCreate.tsx +0 -80
  21. package/idea/Table/Components/Templates/TemplateCreateDefault.tsx +0 -45
  22. package/idea/Table/Components/Templates/TemplateList.tsx +0 -167
  23. package/idea/Table/Components/Templates/repo/TemplateRepo.ts +0 -53
  24. package/idea/Table/Table.tsx +0 -528
  25. package/idea/Table/hooks/useDefaultTemplate.ts +0 -20
  26. package/idea/Table/hooks/useTableKeyboard.ts +0 -137
  27. package/idea/Table/hooks/useTableSelect.ts +0 -11
  28. package/rollup.config.js +0 -52
  29. package/src/assets/icons/duotone/faBell.ts +0 -17
  30. package/src/assets/icons/duotone/faCircleUser.ts +0 -17
  31. package/src/assets/icons/regular/faArrowLeft.ts +0 -15
  32. package/src/assets/icons/regular/faArrowRightArrowLeft.ts +0 -15
  33. package/src/assets/icons/regular/faCircleCheck.ts +0 -15
  34. package/src/assets/icons/regular/faCircleExclamation.ts +0 -15
  35. package/src/assets/icons/regular/faCircleInfo.ts +0 -15
  36. package/src/assets/icons/regular/faFileArrowDown.ts +0 -15
  37. package/src/assets/icons/regular/faFilterCircleXmark.ts +0 -15
  38. package/src/assets/icons/regular/faTriangleExclamation.ts +0 -15
  39. package/src/assets/icons/solid/faAngleLeft.ts +0 -15
  40. package/src/assets/icons/solid/faAngleRight.ts +0 -15
  41. package/src/assets/icons/solid/faArrowDownWideShort.ts +0 -15
  42. package/src/assets/icons/solid/faCaretDown.ts +0 -15
  43. package/src/assets/icons/solid/faCheck.ts +0 -15
  44. package/src/assets/icons/solid/faEllipsisVertical.ts +0 -15
  45. package/src/assets/icons/solid/faEnvelopeDot.ts +0 -15
  46. package/src/assets/icons/solid/faFilter.ts +0 -15
  47. package/src/assets/icons/solid/faFloppyDisk.ts +0 -15
  48. package/src/assets/icons/solid/faGripDotsVertical.ts +0 -15
  49. package/src/assets/icons/solid/faListUl.ts +0 -15
  50. package/src/assets/icons/solid/faMinus.ts +0 -15
  51. package/src/assets/icons/solid/faPlus.ts +0 -15
  52. package/src/assets/icons/solid/faPrint.ts +0 -15
  53. package/src/assets/icons/solid/faRotateRight.ts +0 -15
  54. package/src/assets/icons/solid/faXmark.ts +0 -15
  55. package/src/assets/images/logo/inception.svg +0 -22
  56. package/src/assets/images/logo/mts.svg +0 -5703
  57. package/src/assets/images/logo/paperless.svg +0 -21
  58. package/src/assets/images/logo/pismonosa.png +0 -0
  59. package/src/assets/images/not-found.svg +0 -19
  60. package/src/components/Accordions/Accordions.tsx +0 -74
  61. package/src/components/Alert/Alert.tsx +0 -31
  62. package/src/components/Badge/DotBadge.tsx +0 -16
  63. package/src/components/Badge/NotificationBadge.tsx +0 -29
  64. package/src/components/Badge/PillBadge.tsx +0 -13
  65. package/src/components/Button/Button.tsx +0 -56
  66. package/src/components/Button/IconButton.tsx +0 -51
  67. package/src/components/Button/SplitButton.tsx +0 -91
  68. package/src/components/Dashboard/Dashboard.tsx +0 -9
  69. package/src/components/Dashboard/DashboardWidget.tsx +0 -44
  70. package/src/components/Dashboard/FastLinksWidget/FastLinksWidget.tsx +0 -36
  71. package/src/components/Dialog/Dialog.tsx +0 -178
  72. package/src/components/Dialog/components/DialogFooter.tsx +0 -100
  73. package/src/components/Header/Components/EnvBadge.tsx +0 -17
  74. package/src/components/Header/Components/ModuleSelect.tsx +0 -68
  75. package/src/components/Header/Components/Notifications.tsx +0 -204
  76. package/src/components/Header/Components/UserMenu.tsx +0 -52
  77. package/src/components/Header/Header.tsx +0 -45
  78. package/src/components/Helper/Collapse.tsx +0 -53
  79. package/src/components/Inputs/Checkbox.tsx +0 -53
  80. package/src/components/Inputs/CurrencyInput.tsx +0 -124
  81. package/src/components/Inputs/DateInput/DateInput.tsx +0 -184
  82. package/src/components/Inputs/DateInput/components/DatePartInput.tsx +0 -159
  83. package/src/components/Inputs/InputWrapper.tsx +0 -95
  84. package/src/components/Inputs/NumberInput.tsx +0 -86
  85. package/src/components/Inputs/PasswordInput.tsx +0 -39
  86. package/src/components/Inputs/PhoneInput/PhoneInput.tsx +0 -108
  87. package/src/components/Inputs/PhoneInput/utils/countryCode.ts +0 -20
  88. package/src/components/Inputs/Radio.tsx +0 -59
  89. package/src/components/Inputs/RadioGroup.tsx +0 -48
  90. package/src/components/Inputs/RadioLarge.tsx +0 -39
  91. package/src/components/Inputs/SearchInput.tsx +0 -46
  92. package/src/components/Inputs/Selects/Select.tsx +0 -17
  93. package/src/components/Inputs/Selects/components/CustomSelectComponents.tsx +0 -19
  94. package/src/components/Inputs/Selects/components/SelectWrapper.tsx +0 -118
  95. package/src/components/Inputs/Selects/utils/selectStyles.ts +0 -101
  96. package/src/components/Inputs/TextAreaInput.tsx +0 -68
  97. package/src/components/Inputs/TextInput.tsx +0 -100
  98. package/src/components/Inputs/TimeInput/TimeInput.tsx +0 -81
  99. package/src/components/List/List.tsx +0 -21
  100. package/src/components/List/ListItem.tsx +0 -70
  101. package/src/components/Loader/Loader.tsx +0 -66
  102. package/src/components/Loader/ProgressBar.tsx +0 -41
  103. package/src/components/Menu/Menu.tsx +0 -81
  104. package/src/components/Menu/MenuItem.tsx +0 -46
  105. package/src/components/Menu/NewMenu.tsx +0 -63
  106. package/src/components/Menu/hooks/useMenuPosition.tsx +0 -116
  107. package/src/components/PageComponents/ScrollableContent.tsx +0 -11
  108. package/src/components/Pullover/Pullover.tsx +0 -197
  109. package/src/components/Router/Router.tsx +0 -52
  110. package/src/components/Sidebar/AddButton.tsx +0 -22
  111. package/src/components/Sidebar/Sidebar.tsx +0 -85
  112. package/src/components/Sidebar/SidebarItem.tsx +0 -84
  113. package/src/components/Sidebar/types/ISidebar.ts +0 -28
  114. package/src/components/Table/Table.tsx +0 -258
  115. package/src/components/Table/components/columns/ColumnsList.tsx +0 -60
  116. package/src/components/Table/components/columns/TableColumnsEdit.tsx +0 -114
  117. package/src/components/Table/components/edit/TableEditRow.tsx +0 -78
  118. package/src/components/Table/components/filters/FilterItem.tsx +0 -15
  119. package/src/components/Table/components/filters/TableFilters.tsx +0 -126
  120. package/src/components/Table/components/footer/TableFooter.tsx +0 -126
  121. package/src/components/Table/components/header/TableHeader.tsx +0 -40
  122. package/src/components/Table/components/header/TableHeaderRow.tsx +0 -57
  123. package/src/components/Table/components/items/TableItemActions.tsx +0 -78
  124. package/src/components/Table/components/print/TablePrint.tsx +0 -200
  125. package/src/components/Table/components/select/TableSelect.tsx +0 -50
  126. package/src/components/Table/components/sort/TableSort.tsx +0 -75
  127. package/src/components/Table/components/templates/CreateTemplateDialog.tsx +0 -58
  128. package/src/components/Table/components/templates/TableTemplates.tsx +0 -65
  129. package/src/components/Table/components/templates/TemplatesPullover.tsx +0 -88
  130. package/src/components/Table/contexts/TableContext.tsx +0 -117
  131. package/src/components/Table/hooks/localHooks/useLocalTableColumns.tsx +0 -70
  132. package/src/components/Table/hooks/localHooks/useLocalTableData.tsx +0 -82
  133. package/src/components/Table/hooks/localHooks/useLocalTableKeyboard.ts +0 -175
  134. package/src/components/Table/hooks/localHooks/useLocalTablePagination.ts +0 -12
  135. package/src/components/Table/hooks/useTableColumns.ts +0 -34
  136. package/src/components/Table/hooks/useTableEdit.tsx +0 -140
  137. package/src/components/Table/hooks/useTableFilterFields.tsx +0 -150
  138. package/src/components/Table/hooks/useTablePagination.ts +0 -19
  139. package/src/components/Table/hooks/useTablePrint.ts +0 -83
  140. package/src/components/Table/hooks/useTableSearch.ts +0 -31
  141. package/src/components/Table/hooks/useTableSelect.ts +0 -19
  142. package/src/components/Table/hooks/useTableSort.ts +0 -8
  143. package/src/components/Tabs/Tabs.tsx +0 -68
  144. package/src/components/Tooltip/Tooltip.tsx +0 -191
  145. package/src/components/Tree/Tree.tsx +0 -22
  146. package/src/components/Tree/TreeItem.tsx +0 -57
  147. package/src/components/Wrappers/AppLayout.tsx +0 -17
  148. package/src/components/Wrappers/ConditionalWrapper.tsx +0 -10
  149. package/src/components/Wrappers/FormWrapper.tsx +0 -84
  150. package/src/components/Wrappers/PageLayout.tsx +0 -168
  151. package/src/hooks/useBackgroundClose.ts +0 -19
  152. package/src/hooks/useGetFocusableElements.ts +0 -43
  153. package/src/hooks/useIsMenuOpen.ts +0 -11
  154. package/src/hooks/useLocalPopoverControl.ts +0 -63
  155. package/src/hooks/useOnEsc.ts +0 -14
  156. package/src/hooks/usePopupControl.ts +0 -22
  157. package/src/hooks/useZendesk.ts +0 -22
  158. package/src/index.ts +0 -387
  159. package/src/pages/NoAccessPage.tsx +0 -27
  160. package/src/pages/NotFoundPage.tsx +0 -26
  161. package/src/styles/App.scss +0 -47
  162. package/src/styles/common/_animations.scss +0 -58
  163. package/src/styles/common/_typography.scss +0 -91
  164. package/src/styles/common/helpers/_base.scss +0 -55
  165. package/src/styles/common/helpers/_color.scss +0 -10
  166. package/src/styles/common/helpers/_display.scss +0 -85
  167. package/src/styles/common/helpers/_size.scss +0 -25
  168. package/src/styles/common/maps/_align.scss +0 -21
  169. package/src/styles/common/maps/_buttonMaps.scss +0 -42
  170. package/src/styles/common/maps/_info-types.scss +0 -1
  171. package/src/styles/common/maps/_spacing.scss +0 -78
  172. package/src/styles/common/maps/_text.scss +0 -14
  173. package/src/styles/components/_accordions.scss +0 -51
  174. package/src/styles/components/_alert.scss +0 -23
  175. package/src/styles/components/_badge.scss +0 -84
  176. package/src/styles/components/_button.scss +0 -99
  177. package/src/styles/components/_buttonSplit.scss +0 -74
  178. package/src/styles/components/_card.scss +0 -24
  179. package/src/styles/components/_dialog.scss +0 -119
  180. package/src/styles/components/_form.scss +0 -8
  181. package/src/styles/components/_header.scss +0 -157
  182. package/src/styles/components/_input.scss +0 -167
  183. package/src/styles/components/_inputCheckbox.scss +0 -48
  184. package/src/styles/components/_inputDateTime.scss +0 -161
  185. package/src/styles/components/_inputRadio.scss +0 -83
  186. package/src/styles/components/_inputSelect.scss +0 -8
  187. package/src/styles/components/_list.scss +0 -58
  188. package/src/styles/components/_loader.scss +0 -55
  189. package/src/styles/components/_menu-v2.scss +0 -67
  190. package/src/styles/components/_menu.scss +0 -62
  191. package/src/styles/components/_notifications.scss +0 -71
  192. package/src/styles/components/_page.scss +0 -84
  193. package/src/styles/components/_portal.scss +0 -8
  194. package/src/styles/components/_print.scss +0 -77
  195. package/src/styles/components/_progressBar.scss +0 -83
  196. package/src/styles/components/_pullover.scss +0 -95
  197. package/src/styles/components/_scrollbar.scss +0 -18
  198. package/src/styles/components/_sidebar.scss +0 -204
  199. package/src/styles/components/_smallComponents.scss +0 -23
  200. package/src/styles/components/_table.scss +0 -340
  201. package/src/styles/components/_tabs.scss +0 -33
  202. package/src/styles/components/_tooltip.scss +0 -48
  203. package/src/styles/components/_tree.scss +0 -21
  204. package/src/styles/components/_widget.scss +0 -90
  205. package/src/styles/pages/_fullScreenPage.scss +0 -64
  206. package/src/styles/variables/_bp.scss +0 -6
  207. package/src/styles/variables/_variables.scss +0 -142
  208. package/src/types/Base/custom.d.ts +0 -9
  209. package/src/types/IBasic.ts +0 -32
  210. package/src/types/ICountryCode.ts +0 -5
  211. package/src/types/IError.ts +0 -5
  212. package/src/types/IHeader.ts +0 -40
  213. package/src/types/IInfo.ts +0 -1
  214. package/src/types/IKeyboard.ts +0 -33
  215. package/src/types/IMenu.ts +0 -19
  216. package/src/types/INotifications.ts +0 -15
  217. package/src/types/IPopup.ts +0 -17
  218. package/src/types/IRouter.ts +0 -6
  219. package/src/types/ISelect.ts +0 -54
  220. package/src/types/ITab.ts +0 -10
  221. package/src/types/ITable.ts +0 -291
  222. package/src/types/ITree.ts +0 -6
  223. package/src/utils/InputPatternValidation.ts +0 -12
  224. package/src/utils/dateUtils.ts +0 -32
  225. package/src/utils/fileUtils.ts +0 -177
  226. package/src/utils/i18n/i18nIUICyrilic.ts +0 -119
  227. package/src/utils/i18n/i18nIUILatin.ts +0 -120
  228. package/src/utils/i18n/i18nIUIMe.ts +0 -118
  229. package/src/utils/icons.ts +0 -13
  230. package/src/utils/localStorageHelper.ts +0 -24
  231. package/src/utils/logoUtils.ts +0 -7
  232. package/src/utils/numberUtils.ts +0 -21
  233. package/src/utils/objectUtils.ts +0 -114
  234. package/src/utils/popupUtils.ts +0 -82
  235. package/src/utils/rootDir.ts +0 -1
  236. package/src/utils/stringUtils.ts +0 -18
  237. package/src/utils/tableUtils.ts +0 -130
  238. package/src/utils/toasts.ts +0 -6
  239. package/src/utils/urlUtils.ts +0 -4
  240. package/tsconfig.icons.json +0 -5
  241. package/tsconfig.json +0 -22
@@ -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
- };
@@ -1,80 +0,0 @@
1
- // import { FC, useState } from 'react';
2
- // import { MenuItem } from '../../../Menu/MenuItem';
3
- // import { useTranslation } from 'react-i18next';
4
- // import { Dialog } from '../../../Dialog/Dialog';
5
- // import { createReportTemplate } from './repo/TemplateRepo';
6
- // import { IReportTemplate, IReportTemplateData } from '../../../../types/ITable';
7
- // import { deleteEmptyProps } from '../../../../utils/ObjectUtils';
8
- // import { TextInput } from '../../../Inputs/TextInput';
9
- // import { Checkbox } from '../../../Inputs/Checkbox';
10
- // import { convertSearchToReportTemplateFilter } from '../../../../utils/TableUtils';
11
-
12
- // interface Props {
13
- // identifier: string;
14
- // data: IReportTemplateData;
15
- // onSubmitCallback: () => void;
16
- // allowPublicCreate?: boolean;
17
- // }
18
-
19
- // export const TemplateCreate: FC<Props> = ({
20
- // identifier,
21
- // data: { searchData, visibleColumns, sorts },
22
- // onSubmitCallback,
23
- // allowPublicCreate,
24
- // }) => {
25
- // const [isOpen, setIsOpen] = useState(false);
26
- // const [formData, setFormData] = useState<Partial<IReportTemplate>>({});
27
- // const [isLoading, setIsLoading] = useState(false);
28
-
29
- // const { t } = useTranslation();
30
-
31
- // const onFormSubmit = () => {
32
- // setIsLoading(true);
33
- // const data = deleteEmptyProps({
34
- // identifier,
35
- // name: formData.name,
36
- // isPublic: formData.isPublic,
37
-
38
- // filterValues: convertSearchToReportTemplateFilter(searchData),
39
- // columns: visibleColumns,
40
- // sorts,
41
- // }) as Partial<IReportTemplate>;
42
-
43
- // createReportTemplate(data)
44
- // .then(() => {
45
- // setIsOpen(false);
46
- // onSubmitCallback();
47
- // })
48
- // .catch(() => {})
49
- // .finally(() => setIsLoading(false));
50
- // };
51
-
52
- // return (
53
- // <>
54
- // <MenuItem label={t('CreateTemplateLong')} onClick={() => setIsOpen(true)} />
55
- // <Dialog
56
- // title={t('CreateTemplate')}
57
- // isOpen={isOpen}
58
- // onClose={() => setIsOpen(false)}
59
- // size="l"
60
- // isLoading={isLoading}
61
- // confirmButton={{ onFormSubmit, keepOpen: true }}
62
- // >
63
- // <div className="flex column gap-3">
64
- // <TextInput
65
- // label={t('Name')}
66
- // value={formData.name}
67
- // setValue={name => setFormData({ ...formData, name })}
68
- // />
69
- // {allowPublicCreate && (
70
- // <Checkbox
71
- // label={t('PublicTemplate')}
72
- // value={formData.isPublic}
73
- // setValue={isPublic => setFormData({ ...formData, isPublic })}
74
- // />
75
- // )}
76
- // </div>
77
- // </Dialog>
78
- // </>
79
- // );
80
- // };
@@ -1,45 +0,0 @@
1
- // import { FC } from 'react';
2
- // import { MenuItem } from '../../../Menu/MenuItem';
3
- // import { useTranslation } from 'react-i18next';
4
- // import { createReportTemplate } from './repo/TemplateRepo';
5
- // import { IReportTemplate, IReportTemplateData } from '../../../../types/ITable';
6
- // import { deleteEmptyProps } from '../../../../utils/ObjectUtils';
7
- // import { convertSearchToReportTemplateFilter } from '../../../../utils/TableUtils';
8
-
9
- // interface Props {
10
- // identifier: string;
11
- // data: IReportTemplateData;
12
- // onClose: () => void;
13
- // }
14
-
15
- // export const TemplateCreateDefault: FC<Props> = ({
16
- // identifier,
17
- // data: { searchData, visibleColumns, sorts },
18
- // onClose,
19
- // }) => {
20
- // const { t } = useTranslation();
21
-
22
- // const onSubmit = () => {
23
- // const data: Partial<IReportTemplate> = deleteEmptyProps({
24
- // identifier,
25
- // name: identifier,
26
- // isPublic: false,
27
- // isDefault: true,
28
- // filterValues: convertSearchToReportTemplateFilter(searchData),
29
- // columns: visibleColumns,
30
- // sorts,
31
- // });
32
-
33
- // createReportTemplate(data);
34
- // };
35
-
36
- // return (
37
- // <MenuItem
38
- // label={t('CreateDefaultTemplate')}
39
- // onClick={() => {
40
- // onSubmit();
41
- // onClose();
42
- // }}
43
- // />
44
- // );
45
- // };