@inceptionbg/iui 2.0.5 → 2.0.6

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 (253) hide show
  1. package/dist/icons/index.d.ts +43 -0
  2. package/dist/icons/index.js +1 -0
  3. package/dist/index.d.ts +24 -15
  4. package/dist/index.js +1 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/iui.css +1 -1
  7. package/idea/Menu/Menu.tsx +119 -0
  8. package/idea/Menu/MenuItem.tsx +74 -0
  9. package/idea/Menu/hooks/useMenuControl.ts +13 -0
  10. package/idea/Menu.tsx +132 -0
  11. package/idea/NoAccessInfo.tsx +193 -0
  12. package/idea/Notifications.tsx +245 -0
  13. package/idea/Table2/Components/Columns/ColumnsList.tsx +56 -0
  14. package/idea/Table2/Components/Columns/SetColumnsList.tsx +107 -0
  15. package/idea/Table2/Components/Edit/ItemActionsMenu.tsx +87 -0
  16. package/idea/Table2/Components/Edit/ItemEditOptionsButtons.tsx +32 -0
  17. package/idea/Table2/Components/Edit/TableEditRow.tsx +56 -0
  18. package/idea/Table2/Components/FilterItem.tsx +20 -0
  19. package/idea/Table2/Components/Header/TableHeader.tsx +35 -0
  20. package/idea/Table2/Components/Header/TableHeaderRow.tsx +37 -0
  21. package/idea/Table2/Components/Print/CustomTablePrint.tsx +119 -0
  22. package/idea/Table2/Components/Print/TablePrint.tsx +208 -0
  23. package/idea/Table2/Components/SetSortList.tsx +33 -0
  24. package/idea/Table2/Components/SetTableFilter.tsx +90 -0
  25. package/idea/Table2/Components/TableFooter.tsx +107 -0
  26. package/idea/Table2/Components/TableOptions.tsx +211 -0
  27. package/idea/Table2/Components/Templates/TemplateCreate.tsx +75 -0
  28. package/idea/Table2/Components/Templates/TemplateCreateDefault.tsx +45 -0
  29. package/idea/Table2/Components/Templates/TemplateList.tsx +167 -0
  30. package/idea/Table2/Components/Templates/repo/TemplateRepo.ts +51 -0
  31. package/idea/Table2/Table.tsx +657 -0
  32. package/idea/Table2/_table.scss +300 -0
  33. package/idea/Table2/hooks/useDefaultTemplate.ts +22 -0
  34. package/idea/Table2/hooks/useTableKeyboard.ts +115 -0
  35. package/package.json +8 -4
  36. package/rollup.config.js +80 -0
  37. package/src/assets/icons/duotone/faCircleUser.ts +17 -0
  38. package/src/assets/icons/index.ts +20 -0
  39. package/src/assets/icons/light/faArrowDownShortWide.ts +15 -0
  40. package/src/assets/icons/light/faArrowDownWideShort.ts +15 -0
  41. package/src/assets/icons/light/faArrowUpArrowDown.ts +15 -0
  42. package/src/assets/icons/light/faArrowUpRightFromSquare.ts +15 -0
  43. package/src/assets/icons/light/faArrowsToLine.ts +15 -0
  44. package/src/assets/icons/light/faArrowsUpDown.ts +15 -0
  45. package/src/assets/icons/light/faCalendarPlus.ts +15 -0
  46. package/src/assets/icons/light/faCheck.ts +15 -0
  47. package/src/assets/icons/light/faChevronDown.ts +15 -0
  48. package/src/assets/icons/light/faChevronRight.ts +15 -0
  49. package/src/assets/icons/light/faCircleInfo.ts +15 -0
  50. package/src/assets/icons/light/faCircleXmark.ts +15 -0
  51. package/src/assets/icons/light/faClockRotateLeft.ts +15 -0
  52. package/src/assets/icons/light/faEllipsisVertical.ts +15 -0
  53. package/src/assets/icons/light/faEye.ts +15 -0
  54. package/src/assets/icons/light/faEyeSlash.ts +15 -0
  55. package/src/assets/icons/light/faFilter.ts +15 -0
  56. package/src/assets/icons/light/faGear.ts +15 -0
  57. package/src/assets/icons/light/faHouse.ts +15 -0
  58. package/src/assets/icons/light/faIdBadge.ts +15 -0
  59. package/src/assets/icons/light/faLineColumns.ts +15 -0
  60. package/src/assets/icons/light/faLink.ts +15 -0
  61. package/src/assets/icons/light/faMagnifyingGlass.ts +15 -0
  62. package/src/assets/icons/light/faPenField.ts +15 -0
  63. package/src/assets/icons/light/faPrint.ts +15 -0
  64. package/src/assets/icons/light/faQuestion.ts +15 -0
  65. package/src/assets/icons/light/faRotateRight.ts +15 -0
  66. package/src/assets/icons/light/faTrashCan.ts +15 -0
  67. package/src/assets/icons/light/faTriangleExclamation.ts +15 -0
  68. package/src/assets/icons/light/faXmark.ts +15 -0
  69. package/src/assets/icons/regular/faArrowLeft.ts +15 -0
  70. package/src/assets/icons/regular/faArrowRightArrowLeft.ts +15 -0
  71. package/src/assets/icons/regular/faCircleCheck.ts +15 -0
  72. package/src/assets/icons/regular/faCircleExclamation.ts +15 -0
  73. package/src/assets/icons/regular/faCircleInfo.ts +15 -0
  74. package/src/assets/icons/regular/faFileArrowDown.ts +15 -0
  75. package/src/assets/icons/regular/faFilterCircleXmark.ts +15 -0
  76. package/src/assets/icons/regular/faTriangleExclamation.ts +15 -0
  77. package/src/assets/icons/solid/faAngleLeft.ts +15 -0
  78. package/src/assets/icons/solid/faAngleRight.ts +15 -0
  79. package/src/assets/icons/solid/faArrowDownWideShort.ts +15 -0
  80. package/src/assets/icons/solid/faCaretDown.ts +15 -0
  81. package/src/assets/icons/solid/faCheck.ts +15 -0
  82. package/src/assets/icons/solid/faEllipsisVertical.ts +15 -0
  83. package/src/assets/icons/solid/faFilter.ts +15 -0
  84. package/src/assets/icons/solid/faFloppyDisk.ts +15 -0
  85. package/src/assets/icons/solid/faGripDotsVertical.ts +15 -0
  86. package/src/assets/icons/solid/faListUl.ts +15 -0
  87. package/src/assets/icons/solid/faMagnifyingGlass.ts +15 -0
  88. package/src/assets/icons/solid/faMinus.ts +15 -0
  89. package/src/assets/icons/solid/faPlus.ts +15 -0
  90. package/src/assets/icons/solid/faPrint.ts +15 -0
  91. package/src/assets/icons/solid/faRotateRight.ts +15 -0
  92. package/src/assets/icons/solid/faXmark.ts +15 -0
  93. package/src/assets/images/logo/mts.svg +5703 -0
  94. package/src/assets/images/logo/paperless.svg +21 -0
  95. package/src/assets/images/logo/pismonosa.png +0 -0
  96. package/src/assets/images/not-found.svg +19 -0
  97. package/src/components/Accordions/Accordions.tsx +64 -0
  98. package/src/components/Alert/Alert.tsx +31 -0
  99. package/src/components/Badge/DotBadge.tsx +16 -0
  100. package/src/components/Badge/NotificationBadge.tsx +29 -0
  101. package/src/components/Badge/PillBadge.tsx +13 -0
  102. package/src/components/Button/Button.tsx +56 -0
  103. package/src/components/Button/IconButton.tsx +49 -0
  104. package/src/components/Dashboard/Dashboard.tsx +9 -0
  105. package/src/components/Dashboard/DashboardWidget.tsx +44 -0
  106. package/src/components/Dashboard/FastLinksWidget/FastLinksWidget.tsx +37 -0
  107. package/src/components/Dialog/DeleteItemDialog.tsx +52 -0
  108. package/src/components/Dialog/Dialog.tsx +226 -0
  109. package/src/components/Dialog/hooks/useDialogKeyboard.ts +41 -0
  110. package/src/components/Dialog/hooks/useDialogObserver.ts +21 -0
  111. package/src/components/Header/Components/ModuleSelect.tsx +55 -0
  112. package/src/components/Header/Components/UserMenu.tsx +44 -0
  113. package/src/components/Header/Header.tsx +36 -0
  114. package/src/components/Helper/Collapse.tsx +52 -0
  115. package/src/components/Inputs/Checkbox.tsx +53 -0
  116. package/src/components/Inputs/CurrencyInput.tsx +123 -0
  117. package/src/components/Inputs/DateInput/DateInput.tsx +176 -0
  118. package/src/components/Inputs/DateInput/components/DatePartInput.tsx +154 -0
  119. package/src/components/Inputs/InputWrapper.tsx +90 -0
  120. package/src/components/Inputs/NumberInput.tsx +83 -0
  121. package/src/components/Inputs/PasswordInput.tsx +38 -0
  122. package/src/components/Inputs/Radio.tsx +59 -0
  123. package/src/components/Inputs/RadioGroup.tsx +48 -0
  124. package/src/components/Inputs/RadioLarge.tsx +39 -0
  125. package/src/components/Inputs/SearchInput.tsx +40 -0
  126. package/src/components/Inputs/Select2/Select.tsx +224 -0
  127. package/src/components/Inputs/Select2/select.scss +43 -0
  128. package/src/components/Inputs/Selects/Select.tsx +17 -0
  129. package/src/components/Inputs/Selects/components/CustomSelectComponents.tsx +19 -0
  130. package/src/components/Inputs/Selects/components/SelectWrapper.tsx +126 -0
  131. package/src/components/Inputs/Selects/utils/selectStyles.ts +104 -0
  132. package/src/components/Inputs/TextAreaInput.tsx +67 -0
  133. package/src/components/Inputs/TextInput.tsx +98 -0
  134. package/src/components/Inputs/TimeInput/TimeInput.tsx +81 -0
  135. package/src/components/Loader/Loader.tsx +53 -0
  136. package/src/components/Menu/Menu.tsx +68 -0
  137. package/src/components/Menu/MenuItem.tsx +47 -0
  138. package/src/components/Menu/NewMenu.tsx +66 -0
  139. package/src/components/Menu/hooks/useMenuPosition.tsx +80 -0
  140. package/src/components/Pullover/Pullover.tsx +89 -0
  141. package/src/components/Router/Router.tsx +51 -0
  142. package/src/components/Sidebar/AddButton.tsx +22 -0
  143. package/src/components/Sidebar/Sidebar.tsx +81 -0
  144. package/src/components/Sidebar/SidebarItem.tsx +84 -0
  145. package/src/components/Sidebar/types/ISidebar.ts +28 -0
  146. package/src/components/Table/Components/Columns/ColumnsList.tsx +61 -0
  147. package/src/components/Table/Components/Columns/SetColumnsList.tsx +113 -0
  148. package/src/components/Table/Components/Edit/ItemActionsMenu.tsx +84 -0
  149. package/src/components/Table/Components/Edit/ItemEditOptionsButtons.tsx +31 -0
  150. package/src/components/Table/Components/Edit/TableEditRow.tsx +56 -0
  151. package/src/components/Table/Components/FilterItem.tsx +20 -0
  152. package/src/components/Table/Components/Header/TableHeader.tsx +45 -0
  153. package/src/components/Table/Components/Header/TableHeaderRow.tsx +37 -0
  154. package/src/components/Table/Components/Print/CustomTablePrint.tsx +114 -0
  155. package/src/components/Table/Components/Print/TablePrint.tsx +207 -0
  156. package/src/components/Table/Components/SetSortList.tsx +30 -0
  157. package/src/components/Table/Components/SetTableFilter.tsx +90 -0
  158. package/src/components/Table/Components/TableFooter.tsx +135 -0
  159. package/src/components/Table/Components/TableOptions.tsx +226 -0
  160. package/src/components/Table/Components/Templates/TemplateCreate.tsx +80 -0
  161. package/src/components/Table/Components/Templates/TemplateCreateDefault.tsx +45 -0
  162. package/src/components/Table/Components/Templates/TemplateList.tsx +167 -0
  163. package/src/components/Table/Components/Templates/repo/TemplateRepo.ts +53 -0
  164. package/src/components/Table/Table.tsx +527 -0
  165. package/src/components/Table/hooks/useDefaultTemplate.ts +20 -0
  166. package/src/components/Table/hooks/useTableKeyboard.ts +138 -0
  167. package/src/components/Table/hooks/useTableSelect.ts +11 -0
  168. package/src/components/Tabs/Tabs.tsx +66 -0
  169. package/src/components/Tooltip/Tooltip.tsx +133 -0
  170. package/src/components/Tree/Tree.tsx +22 -0
  171. package/src/components/Tree/TreeItem.tsx +56 -0
  172. package/src/components/Wrappers/AppLayout.tsx +17 -0
  173. package/src/components/Wrappers/ConditionalWrapper.tsx +10 -0
  174. package/src/components/Wrappers/FormWrapper.tsx +81 -0
  175. package/src/components/Wrappers/PageLayout.tsx +152 -0
  176. package/src/hooks/useBackgroundClose.ts +18 -0
  177. package/src/hooks/useIsMenuOpen.ts +11 -0
  178. package/src/hooks/useOnEsc.ts +14 -0
  179. package/src/hooks/useZendesk.ts +21 -0
  180. package/src/index.ts +324 -0
  181. package/src/pages/NoAccessPage.tsx +27 -0
  182. package/src/pages/NotFoundPage.tsx +26 -0
  183. package/src/styles/App.scss +43 -0
  184. package/src/styles/common/_animations.scss +64 -0
  185. package/src/styles/common/_typography.scss +88 -0
  186. package/src/styles/common/helpers/_base.scss +55 -0
  187. package/src/styles/common/helpers/_color.scss +7 -0
  188. package/src/styles/common/helpers/_display.scss +85 -0
  189. package/src/styles/common/helpers/_size.scss +25 -0
  190. package/src/styles/common/maps/_align.scss +21 -0
  191. package/src/styles/common/maps/_info-types.scss +1 -0
  192. package/src/styles/common/maps/_spacing.scss +78 -0
  193. package/src/styles/common/maps/_text.scss +14 -0
  194. package/src/styles/components/_accordions.scss +46 -0
  195. package/src/styles/components/_alert.scss +23 -0
  196. package/src/styles/components/_badge.scss +76 -0
  197. package/src/styles/components/_button.scss +138 -0
  198. package/src/styles/components/_card.scss +24 -0
  199. package/src/styles/components/_dialog.scss +111 -0
  200. package/src/styles/components/_form.scss +8 -0
  201. package/src/styles/components/_header.scss +109 -0
  202. package/src/styles/components/_input.scss +158 -0
  203. package/src/styles/components/_inputCheckbox.scss +105 -0
  204. package/src/styles/components/_inputDateTime.scss +161 -0
  205. package/src/styles/components/_inputRadio.scss +83 -0
  206. package/src/styles/components/_inputSelect.scss +6 -0
  207. package/src/styles/components/_loader.scss +44 -0
  208. package/src/styles/components/_menu-v2.scss +67 -0
  209. package/src/styles/components/_menu.scss +53 -0
  210. package/src/styles/components/_page.scss +62 -0
  211. package/src/styles/components/_portal.scss +8 -0
  212. package/src/styles/components/_print.scss +87 -0
  213. package/src/styles/components/_pullover.scss +43 -0
  214. package/src/styles/components/_scrollbar.scss +18 -0
  215. package/src/styles/components/_sidebar.scss +206 -0
  216. package/src/styles/components/_smallComponents.scss +23 -0
  217. package/src/styles/components/_table.scss +270 -0
  218. package/src/styles/components/_tabs.scss +33 -0
  219. package/src/styles/components/_tooltip.scss +48 -0
  220. package/src/styles/components/_tree.scss +21 -0
  221. package/src/styles/components/_widget.scss +90 -0
  222. package/src/styles/pages/_fullScreenPage.scss +64 -0
  223. package/src/styles/variables/_bp.scss +5 -0
  224. package/src/styles/variables/_variables.scss +130 -0
  225. package/src/types/Base/custom.d.ts +9 -0
  226. package/src/types/IBasic.ts +31 -0
  227. package/src/types/IError.ts +5 -0
  228. package/src/types/IHeader.ts +24 -0
  229. package/src/types/IInfo.ts +1 -0
  230. package/src/types/IKeyboard.ts +37 -0
  231. package/src/types/IMenu.ts +18 -0
  232. package/src/types/IRouter.ts +6 -0
  233. package/src/types/ISelect.ts +52 -0
  234. package/src/types/ITab.ts +10 -0
  235. package/src/types/ITable.ts +249 -0
  236. package/src/types/ITree.ts +6 -0
  237. package/src/utils/DateUtils.ts +32 -0
  238. package/src/utils/InputPatternValidation.ts +12 -0
  239. package/src/utils/LocalStorageHelper.ts +24 -0
  240. package/src/utils/NumberUtils.ts +21 -0
  241. package/src/utils/ObjectUtils.ts +85 -0
  242. package/src/utils/RootDir.ts +1 -0
  243. package/src/utils/StringUtils.ts +18 -0
  244. package/src/utils/TableUtils.ts +130 -0
  245. package/src/utils/Toasts.ts +6 -0
  246. package/src/utils/UrlUtils.ts +4 -0
  247. package/src/utils/fileUtils.ts +176 -0
  248. package/src/utils/i18n/i18nIUICyrilic.ts +90 -0
  249. package/src/utils/i18n/i18nIUILatin.ts +90 -0
  250. package/src/utils/i18n/i18nIUIMe.ts +88 -0
  251. package/src/utils/icons.ts +13 -0
  252. package/tsconfig.icons.json +5 -0
  253. package/tsconfig.json +19 -0
@@ -0,0 +1,193 @@
1
+ import { FC } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { Button } from '../src/components/Button/Button';
4
+ import { Link } from 'react-router';
5
+
6
+ interface Props {
7
+ title?: string;
8
+ buttonLabel?: string;
9
+ }
10
+
11
+ export const NoAccessInfo: FC<Props> = ({ title, buttonLabel }) => {
12
+ const { t } = useTranslation();
13
+
14
+ return (
15
+ <div className="flex center column mt-5 gap-4">
16
+ <svg
17
+ id="aa03ddf9-f8f2-4819-a4ce-be9b0a220741"
18
+ data-name="Layer 1"
19
+ xmlns="http://www.w3.org/2000/svg"
20
+ width="40%"
21
+ viewBox="0 0 1119.60911 699"
22
+ >
23
+ <title>No Access</title>
24
+ <circle cx="292.60911" cy="213" r="213" fill="#f2f2f2" />
25
+ <path
26
+ d="M31.39089,151.64237c0,77.49789,48.6181,140.20819,108.70073,140.20819"
27
+ transform="translate(-31.39089 -100.5)"
28
+ fill="#2f2e41"
29
+ />
30
+ <path
31
+ d="M140.09162,291.85056c0-78.36865,54.255-141.78356,121.30372-141.78356"
32
+ transform="translate(-31.39089 -100.5)"
33
+ fill="#4191ff"
34
+ />
35
+ <path
36
+ d="M70.77521,158.66768c0,73.61476,31.00285,133.18288,69.31641,133.18288"
37
+ transform="translate(-31.39089 -100.5)"
38
+ fill="#4191ff"
39
+ />
40
+ <path
41
+ d="M140.09162,291.85056c0-100.13772,62.7103-181.16788,140.20819-181.16788"
42
+ transform="translate(-31.39089 -100.5)"
43
+ fill="#2f2e41"
44
+ />
45
+ <path
46
+ d="M117.22379,292.83905s15.41555-.47479,20.06141-3.783,23.713-7.2585,24.86553-1.95278,23.16671,26.38821,5.76263,26.5286-40.43935-2.711-45.07627-5.53549S117.22379,292.83905,117.22379,292.83905Z"
47
+ transform="translate(-31.39089 -100.5)"
48
+ fill="#a8a8a8"
49
+ />
50
+ <path
51
+ d="M168.224,311.78489c-17.40408.14042-40.43933-2.71094-45.07626-5.53548-3.53126-2.151-4.93843-9.86945-5.40926-13.43043-.32607.014-.51463.02-.51463.02s.97638,12.43276,5.61331,15.2573,27.67217,5.67589,45.07626,5.53547c5.02386-.04052,6.7592-1.82793,6.66391-4.47526C173.87935,310.756,171.96329,311.75474,168.224,311.78489Z"
52
+ transform="translate(-31.39089 -100.5)"
53
+ opacity="0.2"
54
+ />
55
+ <ellipse cx="198.60911" cy="424.5" rx="187" ry="25.43993" fill="#3f3d56" />
56
+ <ellipse cx="198.60911" cy="424.5" rx="157" ry="21.35866" opacity="0.1" />
57
+ <ellipse cx="836.60911" cy="660.5" rx="283" ry="38.5" fill="#3f3d56" />
58
+ <ellipse cx="310.60911" cy="645.5" rx="170" ry="23.12721" fill="#3f3d56" />
59
+ <path
60
+ d="M494,726.5c90,23,263-30,282-90"
61
+ transform="translate(-31.39089 -100.5)"
62
+ fill="none"
63
+ stroke="#2f2e41"
64
+ strokeMiterlimit="10"
65
+ strokeWidth="2"
66
+ />
67
+ <path
68
+ d="M341,359.5s130-36,138,80-107,149-17,172"
69
+ transform="translate(-31.39089 -100.5)"
70
+ fill="none"
71
+ stroke="#2f2e41"
72
+ strokeMiterlimit="10"
73
+ strokeWidth="2"
74
+ />
75
+ <path
76
+ d="M215.40233,637.78332s39.0723-10.82,41.47675,24.04449-32.15951,44.78287-5.10946,51.69566"
77
+ transform="translate(-31.39089 -100.5)"
78
+ fill="none"
79
+ stroke="#2f2e41"
80
+ strokeMiterlimit="10"
81
+ strokeWidth="2"
82
+ />
83
+ <path
84
+ d="M810.09554,663.73988,802.218,714.03505s-38.78182,20.60284-11.51335,21.20881,155.73324,0,155.73324,0,24.84461,0-14.54318-21.81478l-7.87756-52.719Z"
85
+ transform="translate(-31.39089 -100.5)"
86
+ fill="#2f2e41"
87
+ />
88
+ <path
89
+ d="M785.21906,734.69812c6.193-5.51039,16.9989-11.252,16.9989-11.252l7.87756-50.2952,113.9216.10717,7.87756,49.582c9.185,5.08711,14.8749,8.987,18.20362,11.97818,5.05882-1.15422,10.58716-5.44353-18.20362-21.38921l-7.87756-52.719-113.9216,3.02983L802.218,714.03506S769.62985,731.34968,785.21906,734.69812Z"
90
+ transform="translate(-31.39089 -100.5)"
91
+ opacity="0.1"
92
+ />
93
+ <rect
94
+ x="578.43291"
95
+ y="212.68859"
96
+ width="513.25314"
97
+ height="357.51989"
98
+ rx="18.04568"
99
+ fill="#2f2e41"
100
+ />
101
+ <rect
102
+ x="595.70294"
103
+ y="231.77652"
104
+ width="478.71308"
105
+ height="267.83694"
106
+ fill="#3f3d56"
107
+ />
108
+ <circle cx="835.05948" cy="223.29299" r="3.02983" fill="#f2f2f2" />
109
+ <path
110
+ d="M1123.07694,621.32226V652.6628a18.04341,18.04341,0,0,1-18.04568,18.04568H627.86949A18.04341,18.04341,0,0,1,609.8238,652.6628V621.32226Z"
111
+ transform="translate(-31.39089 -100.5)"
112
+ fill="#2f2e41"
113
+ />
114
+ <polygon
115
+ points="968.978 667.466 968.978 673.526 642.968 673.526 642.968 668.678 643.417 667.466 651.452 645.651 962.312 645.651 968.978 667.466"
116
+ fill="#2f2e41"
117
+ />
118
+ <path
119
+ d="M1125.828,762.03359c-.59383,2.539-2.83591,5.21743-7.90178,7.75032-18.179,9.08949-55.1429-2.42386-55.1429-2.42386s-28.4804-4.84773-28.4804-17.573a22.72457,22.72457,0,0,1,2.49658-1.48459c7.64294-4.04351,32.98449-14.02122,77.9177.42248a18.73921,18.73921,0,0,1,8.54106,5.59715C1125.07908,756.45353,1126.50669,759.15715,1125.828,762.03359Z"
120
+ transform="translate(-31.39089 -100.5)"
121
+ fill="#2f2e41"
122
+ />
123
+ <path
124
+ d="M1125.828,762.03359c-22.251,8.526-42.0843,9.1622-62.43871-4.975-10.26507-7.12617-19.59089-8.88955-26.58979-8.75618,7.64294-4.04351,32.98449-14.02122,77.9177.42248a18.73921,18.73921,0,0,1,8.54106,5.59715C1125.07908,756.45353,1126.50669,759.15715,1125.828,762.03359Z"
125
+ transform="translate(-31.39089 -100.5)"
126
+ opacity="0.1"
127
+ />
128
+ <ellipse
129
+ cx="1066.53846"
130
+ cy="654.13477"
131
+ rx="7.87756"
132
+ ry="2.42386"
133
+ fill="#f2f2f2"
134
+ />
135
+ <circle cx="835.05948" cy="545.66686" r="11.51335" fill="#f2f2f2" />
136
+ <polygon
137
+ points="968.978 667.466 968.978 673.526 642.968 673.526 642.968 668.678 643.417 667.466 968.978 667.466"
138
+ opacity="0.1"
139
+ />
140
+ <rect x="108.60911" y="159" width="208" height="242" fill="#2f2e41" />
141
+ <rect x="87.60911" y="135" width="250" height="86" fill="#3f3d56" />
142
+ <rect x="87.60911" y="237" width="250" height="86" fill="#3f3d56" />
143
+ <rect x="87.60911" y="339" width="250" height="86" fill="#3f3d56" />
144
+ <rect x="271.60911" y="150" width="16" height="16" fill="#4191ff" opacity="0.4" />
145
+ <rect x="294.60911" y="150" width="16" height="16" fill="#4191ff" opacity="0.8" />
146
+ <rect x="317.60911" y="150" width="16" height="16" fill="#4191ff" />
147
+ <rect x="271.60911" y="251" width="16" height="16" fill="#4191ff" opacity="0.4" />
148
+ <rect x="294.60911" y="251" width="16" height="16" fill="#4191ff" opacity="0.8" />
149
+ <rect x="317.60911" y="251" width="16" height="16" fill="#4191ff" />
150
+ <rect x="271.60911" y="352" width="16" height="16" fill="#4191ff" opacity="0.4" />
151
+ <rect x="294.60911" y="352" width="16" height="16" fill="#4191ff" opacity="0.8" />
152
+ <rect x="317.60911" y="352" width="16" height="16" fill="#4191ff" />
153
+ <circle cx="316.60911" cy="538" r="79" fill="#2f2e41" />
154
+ <rect x="280.60911" y="600" width="24" height="43" fill="#2f2e41" />
155
+ <rect x="328.60911" y="600" width="24" height="43" fill="#2f2e41" />
156
+ <ellipse cx="300.60911" cy="643.5" rx="20" ry="7.5" fill="#2f2e41" />
157
+ <ellipse cx="348.60911" cy="642.5" rx="20" ry="7.5" fill="#2f2e41" />
158
+ <circle cx="318.60911" cy="518" r="27" fill="#fff" />
159
+ <circle cx="318.60911" cy="518" r="9" fill="#3f3d56" />
160
+ <path
161
+ d="M271.36733,565.03228c-6.37889-28.56758,14.01185-57.43392,45.544-64.47477s62.2651,10.41,68.644,38.9776-14.51861,39.10379-46.05075,46.14464S277.74622,593.59986,271.36733,565.03228Z"
162
+ transform="translate(-31.39089 -100.5)"
163
+ fill="#4191ff"
164
+ />
165
+ <ellipse
166
+ cx="417.21511"
167
+ cy="611.34365"
168
+ rx="39.5"
169
+ ry="12.40027"
170
+ transform="translate(-238.28665 112.98044) rotate(-23.17116)"
171
+ fill="#2f2e41"
172
+ />
173
+ <ellipse
174
+ cx="269.21511"
175
+ cy="664.34365"
176
+ rx="39.5"
177
+ ry="12.40027"
178
+ transform="translate(-271.07969 59.02084) rotate(-23.17116)"
179
+ fill="#2f2e41"
180
+ />
181
+ <path
182
+ d="M394,661.5c0,7.732-19.90861,23-42,23s-43-14.268-43-22,20.90861-6,43-6S394,653.768,394,661.5Z"
183
+ transform="translate(-31.39089 -100.5)"
184
+ fill="#fff"
185
+ />
186
+ </svg>
187
+ <h1 className="fs-32 mt-5">{title || t('NoAccessTitle')}</h1>
188
+ <Link to="/">
189
+ <Button label={buttonLabel || t('ReturnToHomepage')} size="l" />
190
+ </Link>
191
+ </div>
192
+ );
193
+ };
@@ -0,0 +1,245 @@
1
+ import {
2
+ FontAwesomeIcon,
3
+ ISelectData,
4
+ IconButton,
5
+ Menu,
6
+ MenuItem,
7
+ SearchInput,
8
+ Trans,
9
+ clsx,
10
+ formatDate,
11
+ formatDateAndTime,
12
+ getActiveOrgUuid,
13
+ useTranslation,
14
+ } from '@inceptionbg/iui';
15
+ import { FC, useCallback, useContext, useEffect, useState } from 'react';
16
+ import { Link } from 'react-router-dom';
17
+ import { faBell } from '../../InceptionMain/src/assets/icons/duotone/faBell';
18
+ import { faBell as faBellLight } from '../../InceptionMain/src/assets/icons/light/faBell';
19
+ import { faEnvelope } from '../../InceptionMain/src/assets/icons/light/faEnvelope';
20
+ import { faCaretDown } from '../../InceptionMain/src/assets/icons/solid/faCaretDown';
21
+ import { faEnvelopeDot } from '../../InceptionMain/src/assets/icons/solid/faEnvelopeDot';
22
+ import notification from '../../../assets/sound/notification.mp3';
23
+ import { UserOrgContext } from '../../InceptionMain/src/context/UserOrgContext';
24
+ import {
25
+ getNewNotificationCount,
26
+ getNotifications,
27
+ markAllNotificationsAsSeen,
28
+ markNotificationAsSeen,
29
+ } from '../../InceptionMain/src/repo/NotificationsRepository';
30
+ import { INotification } from '../../InceptionMain/src/types/INotifications';
31
+ import { ControledMenu } from '../src/components/ControledMenu/ControledMenu';
32
+
33
+ const sound = new Audio(notification);
34
+
35
+ export const Notifications: FC = () => {
36
+ const [notificationCount, setNotificationCount] = useState(0);
37
+ const [notifications, setNotifications] = useState<INotification[]>([]);
38
+ const [isOpen, setIsOpen] = useState(false);
39
+ const [isActionsOpen, setIsActionsOpen] = useState(false);
40
+ const [seen, setSeen] = useState<boolean | null>(null);
41
+
42
+ const { t } = useTranslation();
43
+ const { userSettings } = useContext(UserOrgContext);
44
+
45
+ const handleGetNotificationsCount = useCallback(
46
+ (withSound?: boolean) => {
47
+ getNewNotificationCount()
48
+ .then(newCount => {
49
+ setNotificationCount(count => {
50
+ userSettings.notificationsSound &&
51
+ withSound &&
52
+ newCount > count &&
53
+ sound.play();
54
+ return newCount;
55
+ });
56
+ })
57
+ .catch(() => {});
58
+ },
59
+ [userSettings.notificationsSound]
60
+ );
61
+
62
+ const handleGetNotifications = useCallback(() => {
63
+ if (isOpen) {
64
+ getNotifications(100, seen)
65
+ .then(data => setNotifications(data.notifications || []))
66
+ .catch(() => {});
67
+ }
68
+ }, [isOpen, seen]);
69
+
70
+ useEffect(() => {
71
+ if (getActiveOrgUuid()) {
72
+ handleGetNotificationsCount();
73
+
74
+ const notificationIntervalId = setInterval(() => {
75
+ handleGetNotificationsCount(true);
76
+ }, 50000);
77
+ return () => {
78
+ clearInterval(notificationIntervalId!);
79
+ };
80
+ }
81
+ }, [handleGetNotificationsCount]);
82
+
83
+ useEffect(handleGetNotifications, [handleGetNotifications]);
84
+
85
+ const seenOptions: ISelectData[] = [
86
+ { label: t('NotificationsAll'), value: null },
87
+ { label: t('NotificationsUnread'), value: false },
88
+ { label: t('NotificationsRead'), value: true },
89
+ ];
90
+
91
+ return (
92
+ <ControledMenu
93
+ isOpen={isOpen}
94
+ onClose={() => setIsOpen(false)}
95
+ placementY="bottom"
96
+ placementX="right"
97
+ size="l"
98
+ renderButton={ref => (
99
+ <div
100
+ ref={ref}
101
+ className="header-button notification-counter"
102
+ onClick={() => setIsOpen(true)}
103
+ >
104
+ <div className="bell">
105
+ <FontAwesomeIcon
106
+ className="icon24"
107
+ icon={!!notificationCount ? faBell : faBellLight}
108
+ />
109
+ </div>
110
+ {!!notificationCount && (
111
+ <div className="count">
112
+ {notificationCount > 99 ? '99+' : notificationCount}
113
+ </div>
114
+ )}
115
+ </div>
116
+ )}
117
+ >
118
+ <div>
119
+ <div className="flex gap-5 justify-between align-center px-3 py-2">
120
+ <h1>Notifikacije</h1>
121
+ <SearchInput onSearch={() => {}} />
122
+ </div>
123
+ <div className="flex justify-between px-3 py-2">
124
+ <div className="flex gap-2">
125
+ {seenOptions.map(({ label, value }) => (
126
+ <div
127
+ key={label}
128
+ className={clsx('link fs-13', {
129
+ inactive: seen !== value,
130
+ })}
131
+ onClick={() => setSeen(value)}
132
+ >
133
+ {label}
134
+ </div>
135
+ ))}
136
+ </div>
137
+ {!!notifications.length && (
138
+ <Menu
139
+ isOpen={isActionsOpen}
140
+ onClose={() => setIsActionsOpen(false)}
141
+ placementX="right"
142
+ className="user-box-menu"
143
+ renderButton={ref => (
144
+ <p
145
+ ref={ref}
146
+ className="link fs-10"
147
+ onClick={() => setIsActionsOpen(true)}
148
+ >
149
+ {t('Actions')}
150
+ <FontAwesomeIcon className="ml-1" icon={faCaretDown} />
151
+ </p>
152
+ )}
153
+ >
154
+ <MenuItem
155
+ label={t('MarkAllAsRead')}
156
+ onClick={() => {
157
+ markAllNotificationsAsSeen()
158
+ .then(() => {
159
+ handleGetNotificationsCount();
160
+ handleGetNotifications();
161
+ })
162
+ .catch(() => {});
163
+ }}
164
+ />
165
+ </Menu>
166
+ )}
167
+ </div>
168
+ <div className="notifications-container">
169
+ {!!notifications.length ? (
170
+ notifications.map(notification => (
171
+ <div
172
+ key={notification.uuid}
173
+ className={clsx('notification', { seen: notification.seen })}
174
+ >
175
+ <div className="header">
176
+ <div>
177
+ <p className="title">{t(`NTitle${notification.event}`)}</p>
178
+ <p className="date">{formatDateAndTime(notification.createdAt)}</p>
179
+ </div>
180
+ <IconButton
181
+ icon={notification.seen ? faEnvelope : faEnvelopeDot}
182
+ className={notification.seen ? 'disabled' : 'unread-icon'}
183
+ disabled={notification.seen}
184
+ onClick={() =>
185
+ markNotificationAsSeen(notification.uuid).then(() => {
186
+ handleGetNotificationsCount();
187
+ handleGetNotifications();
188
+ })
189
+ }
190
+ />
191
+ </div>
192
+ <p className="desc">
193
+ <Trans
194
+ i18nKey={`NContent${notification.event}`}
195
+ values={notification.values?.reduce((obj, e) => {
196
+ let value = e.value;
197
+ if (e.format === 'TRANSLATE') {
198
+ value = t(value);
199
+ } else if (e.format === 'DATE') {
200
+ value = formatDate(value);
201
+ } else if (e.format === 'DATE_TIME') {
202
+ value = formatDateAndTime(value);
203
+ }
204
+
205
+ return {
206
+ ...obj,
207
+ [e.key]: value,
208
+ };
209
+ }, {})}
210
+ t={t}
211
+ components={notification.values?.reduce(
212
+ (obj, e) =>
213
+ e.url
214
+ ? {
215
+ ...obj,
216
+ [e.key]: (
217
+ <Link
218
+ to={e.url}
219
+ className="link"
220
+ onClick={() => {
221
+ !notification.seen &&
222
+ markNotificationAsSeen(notification.uuid).then(
223
+ handleGetNotifications
224
+ );
225
+ }}
226
+ />
227
+ ),
228
+ }
229
+ : obj,
230
+ {
231
+ bold: <span className="bold" />,
232
+ }
233
+ )}
234
+ />
235
+ </p>
236
+ </div>
237
+ ))
238
+ ) : (
239
+ <p className="text-center fs-13 pt-2">{t('NoNewNotifications')}</p>
240
+ )}
241
+ </div>
242
+ </div>
243
+ </ControledMenu>
244
+ );
245
+ };
@@ -0,0 +1,56 @@
1
+ import { FC, useEffect, useState } from 'react';
2
+ import { ITableColumn } from '../../../../types/ITable';
3
+ import { Draggable, Droppable } from 'react-beautiful-dnd';
4
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
5
+ import { faGripDotsVertical } from '../../../../icons/solid/faGripDotsVertical';
6
+
7
+ interface Props {
8
+ id: 'hidden' | 'visible';
9
+ items: ITableColumn[];
10
+ search: string;
11
+ }
12
+
13
+ export const ColumnsList: FC<Props> = ({ id, items, search }) => {
14
+ const [filteredItems, setFilteredItems] = useState<ITableColumn[]>([]);
15
+
16
+ useEffect(() => {
17
+ search.length &&
18
+ setFilteredItems(
19
+ items.filter(e =>
20
+ (typeof e.label === 'string' ? e.label : e.labelForFilter ?? '')
21
+ .toLocaleLowerCase()
22
+ .includes(search.toLocaleLowerCase())
23
+ )
24
+ );
25
+ }, [search, items]);
26
+
27
+ return (
28
+ <Droppable droppableId={id}>
29
+ {({ droppableProps, innerRef, placeholder }) => (
30
+ <div {...droppableProps} ref={innerRef} className="list-box">
31
+ {(search.length ? filteredItems : items).map(c => (
32
+ <Draggable key={c.id} draggableId={c.id} index={items.indexOf(c)}>
33
+ {({ innerRef, draggableProps, dragHandleProps }) => (
34
+ <div
35
+ className="item"
36
+ ref={innerRef}
37
+ {...draggableProps}
38
+ {...dragHandleProps}
39
+ style={{
40
+ ...draggableProps.style,
41
+ top: 'unset',
42
+ left: 'unset',
43
+ }}
44
+ >
45
+ {c.label}
46
+ <FontAwesomeIcon icon={faGripDotsVertical} />
47
+ </div>
48
+ )}
49
+ </Draggable>
50
+ ))}
51
+ {placeholder}
52
+ </div>
53
+ )}
54
+ </Droppable>
55
+ );
56
+ };
@@ -0,0 +1,107 @@
1
+ import { FC, useEffect, useState } from 'react';
2
+ import { DragDropContext, OnDragEndResponder } from 'react-beautiful-dnd';
3
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4
+ import { ITableColumn } from '../../../../types/ITable';
5
+ import { Dialog } from '../../../Dialog/Dialog';
6
+ import { faArrowRightArrowLeft } from '../../../../icons/regular/faArrowRightArrowLeft';
7
+ import { useTranslation } from 'react-i18next';
8
+ import { ColumnsList } from './ColumnsList';
9
+ import { SearchInput } from '../../../Inputs/SearchInput';
10
+
11
+ interface Props {
12
+ columns: ITableColumn[];
13
+ setColumns: (data: ITableColumn[]) => void;
14
+ isOpen: boolean;
15
+ onClose: () => void;
16
+ withSearch?: boolean;
17
+ }
18
+ export const SetColumnsList: FC<Props> = ({
19
+ columns,
20
+ setColumns,
21
+ isOpen,
22
+ onClose,
23
+ withSearch,
24
+ }) => {
25
+ const [hidden, setHidden] = useState<ITableColumn[]>([]);
26
+ const [visible, setVisible] = useState<ITableColumn[]>([]);
27
+ const [searchHidden, setSearchHidden] = useState('');
28
+ const [searchVisible, setSearchVisible] = useState('');
29
+
30
+ const { t } = useTranslation();
31
+
32
+ useEffect(() => {
33
+ if (isOpen) {
34
+ let hiddenCols: ITableColumn[] = [];
35
+ let visibleCols: ITableColumn[] = [];
36
+ columns.forEach(
37
+ col =>
38
+ col.id !== 'actions' &&
39
+ (!!col.hidden ? hiddenCols.push(col) : visibleCols.push(col))
40
+ );
41
+ setHidden(hiddenCols);
42
+ setVisible(visibleCols);
43
+ }
44
+ }, [isOpen, columns]);
45
+
46
+ const onDragEnd: OnDragEndResponder = ({ source, destination }) => {
47
+ if (!destination) return;
48
+ const hiddenCols = [...hidden];
49
+ const visibleCols = [...visible];
50
+ const destinationIsHidden = destination.droppableId === 'hidden';
51
+
52
+ const sourceList = source.droppableId === 'hidden' ? hiddenCols : visibleCols;
53
+ const destinationList = destinationIsHidden ? hiddenCols : visibleCols;
54
+
55
+ const [removed] = sourceList.splice(source.index, 1);
56
+ destinationList.splice(destination.index, 0, removed);
57
+ if (source.droppableId !== destination.droppableId) {
58
+ destinationList[destination.index].hidden = destinationIsHidden;
59
+ setHidden(hiddenCols);
60
+ setVisible(visibleCols);
61
+ } else {
62
+ destinationIsHidden ? setHidden(hiddenCols) : setVisible(visibleCols);
63
+ }
64
+ };
65
+
66
+ const onSubmit = () => {
67
+ setColumns([...visible, ...hidden]);
68
+ onClose();
69
+ };
70
+
71
+ return (
72
+ <DragDropContext onDragEnd={onDragEnd}>
73
+ <Dialog
74
+ isOpen={isOpen}
75
+ onClose={onClose}
76
+ confirmButton={{
77
+ label: t('Confirm'),
78
+ onClick: onSubmit,
79
+ }}
80
+ cancelButton={{ label: t('Cancel') }}
81
+ noBackgroundClick
82
+ >
83
+ <div className="dual-list-container">
84
+ <p className="pb-3">{t('DragDropListsInfo')}</p>
85
+ <div className="dual-list-content">
86
+ <p className="bold ml-2">{t('HiddenColumns')}:</p>
87
+ <div />
88
+ <p className="bold ml-2">{t('SelectedColumns')}:</p>
89
+
90
+ {withSearch && (
91
+ <>
92
+ <SearchInput onSearch={setSearchHidden} />
93
+ <div />
94
+ <SearchInput onSearch={setSearchVisible} />
95
+ </>
96
+ )}
97
+ <ColumnsList id="hidden" items={hidden} search={searchHidden} />
98
+ <div className="exchange-icon">
99
+ <FontAwesomeIcon icon={faArrowRightArrowLeft} />
100
+ </div>
101
+ <ColumnsList id="visible" items={visible} search={searchVisible} />
102
+ </div>
103
+ </div>
104
+ </Dialog>
105
+ </DragDropContext>
106
+ );
107
+ };
@@ -0,0 +1,87 @@
1
+ import { FC, useState } from 'react';
2
+ import { faEllipsisVertical } from '../../../../icons/light/faEllipsisVertical';
3
+ import { IconButton } from '../../../Button/IconButton';
4
+ import { Menu } from '../../../Menu/Menu';
5
+ import { MenuItem } from '../../../Menu/MenuItem';
6
+ import { useTranslation } from 'react-i18next';
7
+
8
+ interface Props {
9
+ item: any;
10
+ setSelectedItem?: (item: any) => void;
11
+ setItemToDeleteUuid?: (uuid: string) => void;
12
+ actions?: {
13
+ label: string;
14
+ onClick: (uuid: string) => void;
15
+ hidden?: boolean;
16
+ disabled?: boolean;
17
+ }[];
18
+ }
19
+
20
+ export const ItemActionsMenu: FC<Props> = ({
21
+ item,
22
+ setSelectedItem,
23
+ setItemToDeleteUuid,
24
+ actions,
25
+ }) => {
26
+ const [menuOpen, setMenuOpen] = useState(false);
27
+
28
+ const { t } = useTranslation();
29
+
30
+ return (
31
+ <Menu
32
+ isOpen={menuOpen}
33
+ onClose={() => setMenuOpen(false)}
34
+ placementX="right"
35
+ renderButton={ref => (
36
+ <IconButton
37
+ ref={ref}
38
+ icon={faEllipsisVertical}
39
+ active={menuOpen}
40
+ onClick={e => {
41
+ e.stopPropagation();
42
+ setMenuOpen(!menuOpen);
43
+ }}
44
+ />
45
+ )}
46
+ >
47
+ {!!setSelectedItem && (
48
+ <MenuItem
49
+ onClick={e => {
50
+ e.stopPropagation();
51
+ setSelectedItem(item);
52
+ setMenuOpen(false);
53
+ }}
54
+ >
55
+ <p>{t('Edit')}</p>
56
+ </MenuItem>
57
+ )}
58
+ {actions?.map(
59
+ action =>
60
+ !action.hidden && (
61
+ <MenuItem
62
+ key={action.label}
63
+ disabled={!!action.disabled}
64
+ onClick={e => {
65
+ e.stopPropagation();
66
+ action.onClick(item.uuid);
67
+ setMenuOpen(false);
68
+ }}
69
+ >
70
+ <p>{action.label}</p>
71
+ </MenuItem>
72
+ )
73
+ )}
74
+ {!!setItemToDeleteUuid && (
75
+ <MenuItem
76
+ onClick={e => {
77
+ e.stopPropagation();
78
+ setItemToDeleteUuid(item.uuid);
79
+ setMenuOpen(false);
80
+ }}
81
+ >
82
+ <p>{t('Delete')}</p>
83
+ </MenuItem>
84
+ )}
85
+ </Menu>
86
+ );
87
+ };