@dashadmin/dash-admin 1.3.73 → 1.3.74-srcfree.2

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 (553) hide show
  1. package/dist/AppAsyncWrapper.d.ts +3 -0
  2. package/dist/AppWrapper.d.ts +3 -0
  3. package/dist/DASHAdmin.d.ts +38 -0
  4. package/dist/RoutingWrapper.d.ts +10 -0
  5. package/dist/classes/DASHStorageClass.d.ts +5 -0
  6. package/dist/components/Input/RichTextField.d.ts +4 -0
  7. package/dist/components/Redirect.d.ts +9 -0
  8. package/dist/components/avatar/Avatar.d.ts +7 -0
  9. package/dist/components/avatar/SingleImageUploader.d.ts +9 -0
  10. package/dist/components/currency/Format.d.ts +4 -0
  11. package/dist/components/custom/Redirect.d.ts +7 -0
  12. package/dist/components/error/Error.d.ts +31 -0
  13. package/dist/components/geocoding/GeocodingField.d.ts +4 -0
  14. package/dist/components/i18n/BridgedLocalesMenuButton.d.ts +7 -0
  15. package/dist/components/i18n/LangSwitcher.d.ts +10 -0
  16. package/dist/components/loader/GlobalLoader.d.ts +6 -0
  17. package/dist/components/logs/LogFile.d.ts +6 -0
  18. package/dist/components/logs/LogFileById.d.ts +6 -0
  19. package/dist/components/logs/LogViewer.d.ts +8 -0
  20. package/dist/components/menu/AppMenu.d.ts +7 -0
  21. package/dist/components/menu/CustomMenuItemLink.d.ts +12 -0
  22. package/dist/components/menu/DarkToggleMode.d.ts +3 -0
  23. package/dist/components/menu/LanguageToggleMode.d.ts +3 -0
  24. package/dist/components/misc/CustomImageInput.d.ts +4 -0
  25. package/dist/components/misc/DASHGlobalErrorHandler.d.ts +10 -0
  26. package/dist/components/misc/DarkModeSwitcher.d.ts +3 -0
  27. package/dist/components/misc/HorizontalScroller.d.ts +14 -0
  28. package/dist/components/misc/LanguageSwitcher.d.ts +10 -0
  29. package/dist/components/misc/MuiSimpleJsonTable.d.ts +16 -0
  30. package/dist/components/misc/MultiLevelTable.d.ts +18 -0
  31. package/dist/components/misc/NoResults.d.ts +6 -0
  32. package/dist/components/misc/PDFViewer.d.ts +4 -0
  33. package/dist/components/navigation/Breadcrumbs.d.ts +14 -0
  34. package/dist/components/navigation/BreadcrumbsManager.d.ts +14 -0
  35. package/{src/components/navigation/index.tsx → dist/components/navigation/index.d.ts} +0 -1
  36. package/dist/components/panel/Error.d.ts +31 -0
  37. package/dist/components/permission/AvailablePermissionsContext.d.ts +11 -0
  38. package/dist/components/permission/PermissionsSelector.d.ts +4 -0
  39. package/dist/components/permission/PermissionsSelectorList.d.ts +4 -0
  40. package/dist/components/racustombuttons/CustomRAButton.d.ts +23 -0
  41. package/dist/components/racustombuttons/QuickButton.d.ts +15 -0
  42. package/dist/components/racustombuttons/QuickEditButton.d.ts +28 -0
  43. package/dist/components/racustombuttons/QuickIconButton.d.ts +27 -0
  44. package/dist/components/scrollbar/Scrollbar.d.ts +7 -0
  45. package/dist/components/selects/MultiSelect.d.ts +4 -0
  46. package/dist/components/selects/RASearchableSelect.d.ts +25 -0
  47. package/dist/components/selects/RASearchableSelectChips.d.ts +29 -0
  48. package/dist/components/selects/SearchableSelect.d.ts +3 -0
  49. package/dist/components/serviceAccount/ApiKeyRevealDialog.d.ts +7 -0
  50. package/dist/components/serviceAccount/ServiceAccountStatusSwitch.d.ts +4 -0
  51. package/dist/components/subscription/BillingCycleSelectInput.d.ts +3 -0
  52. package/dist/components/subscription/PlanAddonsSettings.d.ts +4 -0
  53. package/dist/components/subscription/PlanAuditLog.d.ts +4 -0
  54. package/dist/components/subscription/PlanFeaturesSettings.d.ts +4 -0
  55. package/dist/components/subscription/PlanLimitsSettings.d.ts +4 -0
  56. package/dist/components/subscription/PlanMetadataSettings.d.ts +4 -0
  57. package/dist/components/subscription/PlanPricesSettings.d.ts +4 -0
  58. package/{src/components/subscription/index.ts → dist/components/subscription/index.d.ts} +0 -2
  59. package/dist/components/svgelements/SvgLoading.d.ts +3 -0
  60. package/dist/components/svgelements/SvgLogo.d.ts +3 -0
  61. package/dist/components/svgelements/SvgLogoMin.d.ts +3 -0
  62. package/dist/components/svgelements/SvgShipping.d.ts +3 -0
  63. package/dist/components/tenancy/GlobalTenantWrapper.d.ts +6 -0
  64. package/dist/components/tenancy/TenantSwitcher.d.ts +16 -0
  65. package/dist/components/tenant/SettingsSections.d.ts +11 -0
  66. package/dist/components/tenant/TenancyPlan.d.ts +4 -0
  67. package/dist/components/tenant/TenancyPlan.js +307 -0
  68. package/dist/components/tenant/TenancySettings.d.ts +4 -0
  69. package/dist/components/tenant/TenantAttributes.d.ts +4 -0
  70. package/dist/components/tenant/TenantAttributesContext.d.ts +10 -0
  71. package/dist/components/tenant/TenantSelector.d.ts +11 -0
  72. package/dist/components/tenant/TenantSettings.d.ts +4 -0
  73. package/dist/components/tenant/TenantSettingsContext.d.ts +11 -0
  74. package/dist/components/tenant/TenantTheme.d.ts +4 -0
  75. package/dist/components/user/AvatarComponent.d.ts +6 -0
  76. package/dist/components/user/TenantAvatarComponent.d.ts +15 -0
  77. package/dist/components/user/UserPreferences.d.ts +3 -0
  78. package/dist/config/ACTIONS.d.ts +3 -0
  79. package/dist/config/ConstantsService.d.ts +14 -0
  80. package/dist/config/DASHAdminSystemConstants.d.ts +120 -0
  81. package/dist/config/PARSERS.d.ts +5 -0
  82. package/dist/contexts/DashQueryClientContext.d.ts +19 -0
  83. package/dist/contexts/DashResourceContext.d.ts +11 -0
  84. package/dist/contexts/I18nBridgeContext.d.ts +18 -0
  85. package/dist/contexts/I18nBridgeSetter.d.ts +3 -0
  86. package/dist/contexts/I18nReduxSync.d.ts +6 -0
  87. package/dist/contexts/SubscriptionPlanFormatsProvider.d.ts +13 -0
  88. package/dist/contexts/SystemRequestsCache.d.ts +16 -0
  89. package/dist/contexts/auth/AuthContext.d.ts +40 -0
  90. package/dist/contexts/auth/AuthContextLocalStorage.d.ts +27 -0
  91. package/dist/contexts/auth/DASHAuthenticationService.d.ts +46 -0
  92. package/dist/contexts/auth/WindowContext.d.ts +8 -0
  93. package/{src/contexts/auth/index.tsx → dist/contexts/auth/index.d.ts} +0 -1
  94. package/dist/contexts/com/FCMContext.d.ts +62 -0
  95. package/dist/contexts/com/LaravelEchoContext.d.ts +18 -0
  96. package/dist/contexts/com/LaravelEchoMgr.d.ts +8 -0
  97. package/dist/contexts/com/components/DefaultNotificationComponent.d.ts +6 -0
  98. package/dist/contexts/com/components/EchoNotificationsCenter.d.ts +3 -0
  99. package/dist/contexts/com/components/NotificationAttributesTable.d.ts +8 -0
  100. package/dist/contexts/com/components/NotificationRenderer.d.ts +8 -0
  101. package/dist/contexts/com/components/NotificationsWidget.d.ts +17 -0
  102. package/dist/contexts/com/components/notificationFormats.d.ts +38 -0
  103. package/dist/contexts/com/useLaravelEcho.d.ts +37 -0
  104. package/dist/contexts/dictionary/DictionaryContext.d.ts +21 -0
  105. package/dist/default-theme/DASHAppProviders.d.ts +21 -0
  106. package/dist/default-theme/DashThemeContext.d.ts +17 -0
  107. package/dist/default-theme/DashThemeHelperProvider.d.ts +10 -0
  108. package/dist/default-theme/DomainAppLayout.d.ts +13 -0
  109. package/dist/default-theme/DomainHeader.d.ts +6 -0
  110. package/dist/default-theme/DomainTheme.d.ts +8 -0
  111. package/dist/default-theme/FullLayoutMarkup.d.ts +9 -0
  112. package/dist/default-theme/StaticLayout.d.ts +5 -0
  113. package/{src/default-theme/index.tsx → dist/default-theme/index.d.ts} +0 -3
  114. package/dist/default-theme/menu/AppDashboardGrid.d.ts +24 -0
  115. package/dist/default-theme/menu/AppMaterialMenu.d.ts +11 -0
  116. package/dist/default-theme/menu/AppMenuComponents/SubmenuPortal.d.ts +15 -0
  117. package/dist/default-theme/menu/AppMenuComponents/collapsed/CollapsedSidebarItem.d.ts +22 -0
  118. package/dist/default-theme/menu/AppMenuComponents/collapsed/CollapsedSidebarItems.d.ts +11 -0
  119. package/dist/default-theme/menu/AppMenuComponents/expanded/CollapsableSidebarMenu.d.ts +4 -0
  120. package/dist/default-theme/menu/AppMenuComponents/expanded/SidebarItem.d.ts +3 -0
  121. package/dist/default-theme/menu/AppMenuComponents/getItem.d.ts +3 -0
  122. package/dist/default-theme/menu/AppMenuComponents/interfaces.d.ts +36 -0
  123. package/dist/default-theme/menu/AppMenuComponents/submenuConstants.d.ts +7 -0
  124. package/dist/default-theme/menu/AppSidebarMaterial.d.ts +8 -0
  125. package/dist/default-theme/menu/SidebarActions.d.ts +8 -0
  126. package/dist/default-theme/updateDomCssVariables.d.ts +6 -0
  127. package/dist/helpers/checkRole.d.ts +2 -0
  128. package/dist/helpers/parseAxiosError.d.ts +1 -0
  129. package/dist/hooks/audio/useAudio.d.ts +2 -0
  130. package/dist/hooks/axios.d.ts +5 -0
  131. package/dist/hooks/data/useDashboardStats.d.ts +13 -0
  132. package/dist/hooks/data/usePackageByClientsStats.d.ts +13 -0
  133. package/dist/hooks/data/usePackageByCommunesStats.d.ts +13 -0
  134. package/dist/hooks/data/usePackageStats.d.ts +13 -0
  135. package/dist/hooks/data/usePackageWithdrawDetails.d.ts +25 -0
  136. package/dist/hooks/data/useStats.d.ts +9 -0
  137. package/dist/hooks/isCurrentPath.d.ts +3 -0
  138. package/dist/hooks/notifications/WSMessagesManager.d.ts +4 -0
  139. package/dist/hooks/notifications/WSPusherManager.d.ts +3 -0
  140. package/dist/hooks/useBreadcrumbs.d.ts +21 -0
  141. package/dist/hooks/useClickOutside.d.ts +2 -0
  142. package/dist/hooks/useFormPersistance.d.ts +13 -0
  143. package/dist/hooks/useGlobalErrorMediator.d.ts +5 -0
  144. package/dist/hooks/useGlobalLoaderMgr.d.ts +3 -0
  145. package/dist/hooks/useHash.d.ts +2 -0
  146. package/dist/hooks/useLocalStorage.d.ts +2 -0
  147. package/dist/hooks/usePolyglotTranslation.d.ts +11 -0
  148. package/dist/hooks/usePrevious.d.ts +2 -0
  149. package/dist/hooks/usePrintSelected.d.ts +12 -0
  150. package/dist/hooks/useVirtualHash.d.ts +5 -0
  151. package/dist/hooks/window/useWindowSize.d.ts +6 -0
  152. package/{src/index.tsx → dist/index.d.ts} +22 -91
  153. package/dist/interfaces/IAppResourceConfig.d.ts +10 -0
  154. package/dist/interfaces/Log.d.ts +15 -0
  155. package/dist/interfaces/Tenant.d.ts +25 -0
  156. package/{src/interfaces/communication/IActions.tsx → dist/interfaces/communication/IActions.d.ts} +1 -2
  157. package/{src/interfaces/communication/INotification.tsx → dist/interfaces/communication/INotification.d.ts} +5 -7
  158. package/{src/interfaces/communication/IPayload.tsx → dist/interfaces/communication/IPayload.d.ts} +1 -1
  159. package/dist/interfaces/communication/IRequestAction.d.ts +10 -0
  160. package/dist/interfaces/communication/IRequestPayload.d.ts +7 -0
  161. package/dist/interfaces/communication/IResponseAction.d.ts +7 -0
  162. package/{src/interfaces/misc/IAny.tsx → dist/interfaces/misc/IAny.d.ts} +1 -1
  163. package/dist/interfaces/misc/IFlashMessage.d.ts +10 -0
  164. package/dist/interfaces/navigation/IAppMenu.d.ts +11 -0
  165. package/dist/interfaces/navigation/ICollapsableSidebarMenu.d.ts +10 -0
  166. package/dist/interfaces/navigation/IMenuItem.d.ts +14 -0
  167. package/{src/interfaces/notifications/IModel.tsx → dist/interfaces/notifications/IModel.d.ts} +1 -2
  168. package/dist/interfaces/notifications/IModelField.d.ts +10 -0
  169. package/dist/interfaces/notifications/IUserNotification.d.ts +11 -0
  170. package/{src/interfaces/notifications/IUserNotificationData.tsx → dist/interfaces/notifications/IUserNotificationData.d.ts} +6 -7
  171. package/dist/interfaces/notifications/IUserNotificationPayload.d.ts +10 -0
  172. package/dist/interfaces/user/IGetAuth.d.ts +75 -0
  173. package/dist/interfaces/user/ITenantSettings.d.ts +3 -0
  174. package/dist/interfaces/user/IUser.d.ts +60 -0
  175. package/dist/interfaces/user/IUserSettings.d.ts +36 -0
  176. package/{src/interfaces.tsx → dist/interfaces.d.ts} +5 -6
  177. package/dist/layout/AppLayout.d.ts +5 -0
  178. package/dist/layout/ApplicationLayout.d.ts +22 -0
  179. package/dist/layout/MotionWrapper.d.ts +22 -0
  180. package/dist/layout/MotionWrapper.original.d.ts +22 -0
  181. package/dist/layout/ResourceMenu.d.ts +7 -0
  182. package/dist/layout/ResoureLayout.d.ts +8 -0
  183. package/dist/layout/TransitionWrapper.d.ts +8 -0
  184. package/dist/pages/ChangePassword.d.ts +6 -0
  185. package/dist/pages/DASHLanding.d.ts +5 -0
  186. package/dist/pages/DASHLightWeightLogin.d.ts +6 -0
  187. package/dist/pages/DASHSimpleLogin.d.ts +6 -0
  188. package/dist/pages/Login.d.ts +3 -0
  189. package/dist/pages/Profile.d.ts +3 -0
  190. package/dist/pages/RecoverPassword.d.ts +3 -0
  191. package/dist/pages/SingleImageUploader.d.ts +8 -0
  192. package/dist/pages/VerifyAccount.d.ts +5 -0
  193. package/dist/providers/authProvider.d.ts +15 -0
  194. package/dist/providers/dataProvider.d.ts +31 -0
  195. package/dist/providers/i18n/en.d.ts +569 -0
  196. package/dist/providers/i18n/es.d.ts +2 -0
  197. package/dist/providers/i18n/languages.d.ts +571 -0
  198. package/dist/providers/i18n/mergeTranslations.d.ts +3 -0
  199. package/dist/providers/i18nProvider.d.ts +2 -0
  200. package/dist/react-admin-dash/RADashComponent.d.ts +7 -0
  201. package/dist/react-admin-dash/Resource.d.ts +16 -0
  202. package/dist/resources/Brand/BrandResource.d.ts +3 -0
  203. package/dist/resources/DASHResourceLoader.d.ts +17 -0
  204. package/dist/resources/Log/LogResource.d.ts +3 -0
  205. package/dist/resources/Tenant/ImpersonateTenantResource.d.ts +5 -0
  206. package/dist/resources/Trash/TrashTemplate.d.ts +3 -0
  207. package/dist/resources/User/components/AvatarUploadField.d.ts +6 -0
  208. package/dist/resources/User/components/PasswordFields.d.ts +8 -0
  209. package/dist/resources/User/getProfileMenu.d.ts +4 -0
  210. package/dist/resources/User/profileResource.d.ts +3 -0
  211. package/dist/resources/User/userLayout.d.ts +2 -0
  212. package/dist/resources/User/userResource.d.ts +3 -0
  213. package/dist/resources/User/userSchema.d.ts +3 -0
  214. package/dist/resources/User/usersFilters.d.ts +3 -0
  215. package/dist/resources.d.ts +11 -0
  216. package/dist/schemas/log.d.ts +3 -0
  217. package/dist/schemas/notification.d.ts +3 -0
  218. package/dist/schemas/permissions.d.ts +3 -0
  219. package/dist/schemas/roles.d.ts +3 -0
  220. package/dist/schemas/rolesDataGrid.d.ts +3 -0
  221. package/dist/schemas/subscription/components/SubscriptionActions.d.ts +4 -0
  222. package/dist/schemas/subscription/components/SubscriptionPaymentHistory.d.ts +4 -0
  223. package/dist/schemas/subscription/components/SubscriptionPlanFeatures.d.ts +4 -0
  224. package/dist/schemas/subscription/components/SubscriptionPlanPreview.d.ts +4 -0
  225. package/dist/schemas/subscription/components/SubscriptionPlanStats.d.ts +4 -0
  226. package/dist/schemas/subscription/components/SubscriptionStatusIndicator.d.ts +4 -0
  227. package/dist/schemas/subscription/subscriptionPlanSchema.d.ts +3 -0
  228. package/dist/schemas/subscription/subscriptionSchema.d.ts +3 -0
  229. package/dist/schemas/subscriptionPlan.d.ts +3 -0
  230. package/dist/schemas/tenant.d.ts +3 -0
  231. package/dist/schemas/tenantUser.d.ts +3 -0
  232. package/dist/schemas/tenant_superadmin.d.ts +3 -0
  233. package/dist/schemas/user.d.ts +3 -0
  234. package/dist/systemResources.d.ts +3 -0
  235. package/dist/systemResources.js +18 -2
  236. package/dist/systemResources.old.d.ts +3 -0
  237. package/dist/templates/ResourceTemplate.d.ts +10 -0
  238. package/dist/templates/ResourceTemplateCreate.d.ts +3 -0
  239. package/dist/templates/ResourceTemplateEdit.d.ts +3 -0
  240. package/dist/templates/ResourceTemplateFull.d.ts +7 -0
  241. package/dist/templates/ResourceTemplateList.d.ts +8 -0
  242. package/dist/templates/ResourceTemplateShow.d.ts +3 -0
  243. package/dist/templates/TrashTemplate.d.ts +3 -0
  244. package/dist/tenantResources.d.ts +3 -0
  245. package/dist/test_portal_bubbles.d.ts +2 -0
  246. package/dist/theme/AppHeader.d.ts +6 -0
  247. package/dist/theme/AppLayoutSetting.d.ts +28 -0
  248. package/dist/theme/AppLogo.d.ts +8 -0
  249. package/dist/theme/AppSidebar.d.ts +7 -0
  250. package/dist/theme/AppSidebarContent.d.ts +12 -0
  251. package/dist/theme/AppSidebarLogo.d.ts +9 -0
  252. package/dist/theme/components/PageTitle.d.ts +10 -0
  253. package/dist/utils/cache/CacheInvalidatorContext.d.ts +25 -0
  254. package/dist/utils/cache/CacheInvalidatorListenerComponent.d.ts +3 -0
  255. package/dist/utils/cache/useCacheInvalidatorListener.d.ts +4 -0
  256. package/dist/utils/convertFileToBase64.d.ts +2 -0
  257. package/dist/utils/convertToFile.d.ts +2 -0
  258. package/dist/utils/cookies.d.ts +5 -0
  259. package/dist/utils/dashDefaultQueryClient.d.ts +3 -0
  260. package/dist/utils/dataUrlToBlob.d.ts +2 -0
  261. package/dist/utils/deepReplace.d.ts +2 -0
  262. package/dist/utils/getProfileMenu.d.ts +3 -0
  263. package/dist/utils/getTenantSettings.d.ts +3 -0
  264. package/dist/utils/getType.d.ts +2 -0
  265. package/dist/utils/getUserSettings.d.ts +3 -0
  266. package/dist/utils/hasCode.d.ts +2 -0
  267. package/dist/utils/index.d.ts +19 -0
  268. package/dist/utils/injectTenantStyles.d.ts +2 -0
  269. package/dist/utils/isComponent.d.ts +2 -0
  270. package/dist/utils/navEvents.d.ts +28 -0
  271. package/dist/utils/regexp.d.ts +1 -0
  272. package/dist/utils/resolveObjectPath.d.ts +2 -0
  273. package/dist/utils/setNativeValue.d.ts +2 -0
  274. package/dist/utils/slugify.d.ts +1 -0
  275. package/dist/utils/validators/emailValidator.d.ts +2 -0
  276. package/dist/utils/validators/requiredValidator.d.ts +2 -0
  277. package/dist/utils/validators/rutValidator.d.ts +2 -0
  278. package/dist/utils/validators.d.ts +3 -0
  279. package/package.json +25 -22
  280. package/src/AppAsyncWrapper.tsx +0 -42
  281. package/src/AppWrapper.tsx +0 -45
  282. package/src/DASHAdmin.tsx +0 -502
  283. package/src/DASHAdmin.tsx.old +0 -456
  284. package/src/RoutingWrapper.tsx +0 -143
  285. package/src/classes/DASHStorageClass.tsx +0 -8
  286. package/src/components/Input/RichTextField.tsx +0 -27
  287. package/src/components/Redirect.tsx +0 -46
  288. package/src/components/avatar/Avatar.tsx +0 -71
  289. package/src/components/avatar/SingleImageUploader.tsx +0 -107
  290. package/src/components/currency/Format.tsx +0 -79
  291. package/src/components/custom/Redirect.tsx +0 -23
  292. package/src/components/error/Error.tsx +0 -168
  293. package/src/components/geocoding/GeocodingField.tsx +0 -167
  294. package/src/components/i18n/BridgedLocalesMenuButton.tsx +0 -160
  295. package/src/components/i18n/LangSwitcher.tsx +0 -204
  296. package/src/components/loader/GlobalLoader.tsx +0 -49
  297. package/src/components/logs/LogFile.tsx +0 -88
  298. package/src/components/logs/LogFileById.tsx +0 -68
  299. package/src/components/logs/LogViewer.tsx +0 -43
  300. package/src/components/menu/AppMenu.tsx +0 -22
  301. package/src/components/menu/CustomMenuItemLink.tsx +0 -61
  302. package/src/components/menu/DarkToggleMode.tsx +0 -65
  303. package/src/components/menu/LanguageToggleMode.tsx +0 -120
  304. package/src/components/misc/CustomImageInput.tsx +0 -62
  305. package/src/components/misc/DASHGlobalErrorHandler.tsx +0 -194
  306. package/src/components/misc/DarkModeSwitcher.tsx +0 -112
  307. package/src/components/misc/HorizontalScroller.tsx +0 -225
  308. package/src/components/misc/LanguageSwitcher.tsx +0 -199
  309. package/src/components/misc/MUIHtmlToolTip.tsx +0 -15
  310. package/src/components/misc/MuiSimpleJsonTable.tsx +0 -279
  311. package/src/components/misc/MultiLevelTable.tsx +0 -229
  312. package/src/components/misc/NoResults.tsx +0 -28
  313. package/src/components/misc/PDFViewer.tsx +0 -85
  314. package/src/components/navigation/Breadcrumbs.tsx +0 -220
  315. package/src/components/navigation/BreadcrumbsManager.tsx +0 -310
  316. package/src/components/panel/Error.tsx +0 -168
  317. package/src/components/permission/AvailablePermissionsContext.tsx +0 -173
  318. package/src/components/permission/PermissionsSelector.tsx +0 -834
  319. package/src/components/permission/PermissionsSelectorList.tsx +0 -473
  320. package/src/components/racustombuttons/CustomRAButton.tsx +0 -87
  321. package/src/components/racustombuttons/QuickButton.tsx +0 -117
  322. package/src/components/racustombuttons/QuickEditButton.tsx +0 -115
  323. package/src/components/racustombuttons/QuickIconButton.tsx +0 -122
  324. package/src/components/scrollbar/Scrollbar.tsx +0 -31
  325. package/src/components/selects/MultiSelect.tsx +0 -53
  326. package/src/components/selects/RASearchableSelect.tsx +0 -282
  327. package/src/components/selects/RASearchableSelectChips.tsx +0 -308
  328. package/src/components/selects/SearchableSelect.tsx +0 -139
  329. package/src/components/serviceAccount/ApiKeyRevealDialog.tsx +0 -129
  330. package/src/components/serviceAccount/ServiceAccountStatusSwitch.tsx +0 -99
  331. package/src/components/subscription/BillingCycleSelectInput.tsx +0 -68
  332. package/src/components/subscription/PlanAddonsSettings.tsx +0 -563
  333. package/src/components/subscription/PlanAuditLog.tsx +0 -453
  334. package/src/components/subscription/PlanFeaturesSettings.tsx +0 -243
  335. package/src/components/subscription/PlanLimitsSettings.tsx +0 -230
  336. package/src/components/subscription/PlanMetadataSettings.tsx +0 -306
  337. package/src/components/subscription/PlanPricesSettings.tsx +0 -307
  338. package/src/components/svgelements/SvgLoading.tsx +0 -229
  339. package/src/components/svgelements/SvgLogo.tsx +0 -53
  340. package/src/components/svgelements/SvgLogoMin.tsx +0 -64
  341. package/src/components/svgelements/SvgShipping.tsx +0 -673
  342. package/src/components/tenancy/GlobalTenantWrapper.tsx +0 -84
  343. package/src/components/tenancy/TenantSwitcher.tsx +0 -514
  344. package/src/components/tenant/SettingsSections.tsx +0 -151
  345. package/src/components/tenant/TenancySettings.tsx +0 -122
  346. package/src/components/tenant/TenantAttributes.tsx +0 -153
  347. package/src/components/tenant/TenantAttributesContext.tsx +0 -163
  348. package/src/components/tenant/TenantSelector.tsx +0 -142
  349. package/src/components/tenant/TenantSettings.tsx +0 -184
  350. package/src/components/tenant/TenantSettingsContext.tsx +0 -165
  351. package/src/components/tenant/TenantTheme.tsx +0 -172
  352. package/src/components/user/AvatarComponent.tsx +0 -317
  353. package/src/components/user/TenantAvatarComponent.tsx +0 -99
  354. package/src/components/user/UserPreferences.tsx +0 -677
  355. package/src/config/ACTIONS.tsx +0 -26
  356. package/src/config/ConstantsService.tsx +0 -44
  357. package/src/config/DASHAdminSystemConstants.tsx +0 -183
  358. package/src/config/PARSERS.tsx +0 -9
  359. package/src/contexts/DashQueryClientContext.tsx +0 -113
  360. package/src/contexts/DashResourceContext.tsx +0 -34
  361. package/src/contexts/I18nBridgeContext.tsx +0 -156
  362. package/src/contexts/I18nBridgeSetter.tsx +0 -39
  363. package/src/contexts/I18nReduxSync.tsx +0 -27
  364. package/src/contexts/SubscriptionPlanFormatsProvider.tsx +0 -217
  365. package/src/contexts/SystemRequestsCache.tsx +0 -215
  366. package/src/contexts/auth/AuthContext.tsx +0 -567
  367. package/src/contexts/auth/AuthContextLocalStorage.tsx +0 -140
  368. package/src/contexts/auth/DASHAuthenticationService.tsx +0 -915
  369. package/src/contexts/auth/WindowContext.tsx +0 -15
  370. package/src/contexts/com/FCMContext.tsx +0 -415
  371. package/src/contexts/com/LaravelEchoContext.tsx +0 -41
  372. package/src/contexts/com/LaravelEchoMgr.tsx +0 -155
  373. package/src/contexts/com/components/DefaultNotificationComponent.tsx +0 -20
  374. package/src/contexts/com/components/EchoNotificationsCenter.tsx +0 -65
  375. package/src/contexts/com/components/NotificationAttributesTable.tsx +0 -54
  376. package/src/contexts/com/components/NotificationRenderer.tsx +0 -42
  377. package/src/contexts/com/components/NotificationsWidget.tsx +0 -182
  378. package/src/contexts/com/components/notificationFormats.tsx +0 -50
  379. package/src/contexts/com/useLaravelEcho.tsx +0 -432
  380. package/src/contexts/dictionary/DictionaryContext.tsx +0 -94
  381. package/src/declarations.d.ts +0 -17
  382. package/src/default-theme/DASHAppProviders.tsx +0 -117
  383. package/src/default-theme/DashThemeContext.tsx +0 -209
  384. package/src/default-theme/DashThemeContext.tsx.fast +0 -143
  385. package/src/default-theme/DashThemeContext.tsx.old +0 -306
  386. package/src/default-theme/DashThemeHelperProvider.tsx +0 -98
  387. package/src/default-theme/DomainAppLayout.tsx +0 -166
  388. package/src/default-theme/DomainHeader.tsx +0 -162
  389. package/src/default-theme/DomainTheme.tsx +0 -59
  390. package/src/default-theme/FullLayoutMarkup.tsx +0 -231
  391. package/src/default-theme/StaticLayout.tsx +0 -47
  392. package/src/default-theme/menu/AppDashboardGrid.tsx +0 -279
  393. package/src/default-theme/menu/AppMaterialMenu.tsx +0 -546
  394. package/src/default-theme/menu/AppMenuComponents/SubmenuPortal.tsx +0 -61
  395. package/src/default-theme/menu/AppMenuComponents/collapsed/CollapsedSidebarItem.tsx +0 -264
  396. package/src/default-theme/menu/AppMenuComponents/collapsed/CollapsedSidebarItems.tsx +0 -31
  397. package/src/default-theme/menu/AppMenuComponents/expanded/CollapsableSidebarMenu.tsx +0 -293
  398. package/src/default-theme/menu/AppMenuComponents/expanded/SidebarItem.tsx +0 -92
  399. package/src/default-theme/menu/AppMenuComponents/getItem.tsx +0 -17
  400. package/src/default-theme/menu/AppMenuComponents/interfaces.tsx +0 -41
  401. package/src/default-theme/menu/AppMenuComponents/submenuConstants.ts +0 -90
  402. package/src/default-theme/menu/AppSidebarMaterial.tsx +0 -339
  403. package/src/default-theme/menu/SidebarActions.tsx +0 -84
  404. package/src/default-theme/updateDomCssVariables.tsx +0 -176
  405. package/src/helpers/checkRole.tsx +0 -66
  406. package/src/helpers/parseAxiosError.tsx +0 -41
  407. package/src/hooks/audio/useAudio.tsx +0 -39
  408. package/src/hooks/axios.tsx +0 -165
  409. package/src/hooks/data/useDashboardStats.tsx +0 -65
  410. package/src/hooks/data/usePackageByClientsStats.tsx +0 -44
  411. package/src/hooks/data/usePackageByCommunesStats.tsx +0 -44
  412. package/src/hooks/data/usePackageStats.tsx +0 -69
  413. package/src/hooks/data/usePackageWithdrawDetails.tsx +0 -61
  414. package/src/hooks/data/useStats.tsx +0 -86
  415. package/src/hooks/isCurrentPath.tsx +0 -22
  416. package/src/hooks/notifications/WSMessagesManager.tsx +0 -152
  417. package/src/hooks/notifications/WSPusherManager.tsx +0 -92
  418. package/src/hooks/useBreadcrumbs.tsx +0 -329
  419. package/src/hooks/useClickOutside.tsx +0 -57
  420. package/src/hooks/useFormPersistance.tsx +0 -150
  421. package/src/hooks/useGlobalErrorMediator.tsx +0 -43
  422. package/src/hooks/useGlobalLoaderMgr.tsx +0 -21
  423. package/src/hooks/useHash.tsx +0 -27
  424. package/src/hooks/useLocalStorage.tsx +0 -196
  425. package/src/hooks/usePolyglotTranslation.tsx +0 -62
  426. package/src/hooks/usePrevious.tsx +0 -9
  427. package/src/hooks/usePrintSelected.tsx +0 -37
  428. package/src/hooks/useVirtualHash.tsx +0 -33
  429. package/src/hooks/window/useWindowSize.tsx +0 -36
  430. package/src/interfaces/IAppResourceConfig.tsx +0 -20
  431. package/src/interfaces/Log.tsx +0 -16
  432. package/src/interfaces/Tenant.tsx +0 -25
  433. package/src/interfaces/communication/IRequestAction.tsx +0 -10
  434. package/src/interfaces/communication/IRequestPayload.tsx +0 -7
  435. package/src/interfaces/communication/IResponseAction.tsx +0 -7
  436. package/src/interfaces/misc/IFlashMessage.tsx +0 -10
  437. package/src/interfaces/navigation/IAppMenu.ts +0 -14
  438. package/src/interfaces/navigation/ICollapsableSidebarMenu.ts +0 -12
  439. package/src/interfaces/navigation/IMenuItem.ts +0 -16
  440. package/src/interfaces/notifications/IModelField.tsx +0 -8
  441. package/src/interfaces/notifications/IUserNotification.tsx +0 -12
  442. package/src/interfaces/notifications/IUserNotificationPayload.tsx +0 -8
  443. package/src/interfaces/user/IGetAuth.tsx +0 -92
  444. package/src/interfaces/user/ITenantSettings.tsx +0 -3
  445. package/src/interfaces/user/IUser.tsx +0 -60
  446. package/src/interfaces/user/IUserSettings.tsx +0 -43
  447. package/src/layout/AppLayout.tsx +0 -112
  448. package/src/layout/ApplicationLayout.tsx +0 -197
  449. package/src/layout/MotionWrapper.original.tsx +0 -236
  450. package/src/layout/MotionWrapper.tsx +0 -236
  451. package/src/layout/ResourceMenu.tsx +0 -164
  452. package/src/layout/ResoureLayout.tsx +0 -105
  453. package/src/layout/TransitionWrapper.tsx +0 -125
  454. package/src/pages/ChangePassword.tsx +0 -179
  455. package/src/pages/DASHLanding.tsx +0 -22
  456. package/src/pages/DASHLightWeightLogin.tsx +0 -611
  457. package/src/pages/DASHSimpleLogin.tsx +0 -260
  458. package/src/pages/Login.tsx +0 -111
  459. package/src/pages/Profile.tsx +0 -357
  460. package/src/pages/RecoverPassword.tsx +0 -175
  461. package/src/pages/SingleImageUploader.tsx +0 -55
  462. package/src/pages/VerifyAccount.tsx +0 -128
  463. package/src/providers/authProvider.tsx +0 -217
  464. package/src/providers/dataProvider.tsx +0 -672
  465. package/src/providers/i18n/en.ts +0 -646
  466. package/src/providers/i18n/es.ts +0 -652
  467. package/src/providers/i18n/languages.tsx +0 -8
  468. package/src/providers/i18n/mergeTranslations.ts +0 -53
  469. package/src/providers/i18nProvider.tsx +0 -23
  470. package/src/react-admin-dash/RADashComponent.tsx +0 -240
  471. package/src/react-admin-dash/Resource.tsx +0 -77
  472. package/src/resources/Brand/BrandResource.tsx +0 -130
  473. package/src/resources/DASHResourceLoader.ts +0 -180
  474. package/src/resources/Log/LogResource.tsx +0 -73
  475. package/src/resources/Tenant/ImpersonateTenantResource.tsx +0 -113
  476. package/src/resources/Trash/TrashTemplate.tsx +0 -180
  477. package/src/resources/User/components/AvatarUploadField.tsx +0 -57
  478. package/src/resources/User/components/PasswordFields.tsx +0 -73
  479. package/src/resources/User/getProfileMenu.ts +0 -57
  480. package/src/resources/User/profileResource.tsx +0 -51
  481. package/src/resources/User/userLayout.tsx +0 -62
  482. package/src/resources/User/userResource.tsx +0 -111
  483. package/src/resources/User/userSchema.tsx +0 -213
  484. package/src/resources/User/usersFilters.tsx +0 -21
  485. package/src/resources.tsx +0 -280
  486. package/src/schemas/log.tsx +0 -45
  487. package/src/schemas/notification.tsx +0 -42
  488. package/src/schemas/permissions.tsx +0 -44
  489. package/src/schemas/roles.tsx +0 -48
  490. package/src/schemas/rolesDataGrid.tsx +0 -48
  491. package/src/schemas/subscription/components/SubscriptionActions.tsx +0 -153
  492. package/src/schemas/subscription/components/SubscriptionPaymentHistory.tsx +0 -127
  493. package/src/schemas/subscription/components/SubscriptionPlanFeatures.tsx +0 -162
  494. package/src/schemas/subscription/components/SubscriptionPlanPreview.tsx +0 -141
  495. package/src/schemas/subscription/components/SubscriptionPlanStats.tsx +0 -318
  496. package/src/schemas/subscription/components/SubscriptionStatusIndicator.tsx +0 -72
  497. package/src/schemas/subscription/subscriptionPlanSchema.tsx +0 -185
  498. package/src/schemas/subscription/subscriptionSchema.tsx +0 -152
  499. package/src/schemas/subscriptionPlan.ts +0 -422
  500. package/src/schemas/tenant.tsx +0 -129
  501. package/src/schemas/tenantUser.tsx +0 -96
  502. package/src/schemas/tenant_superadmin.tsx +0 -119
  503. package/src/schemas/user.tsx +0 -26
  504. package/src/systemResources.old.tsx +0 -928
  505. package/src/systemResources.tsx +0 -1369
  506. package/src/templates/ResourceTemplate.tsx +0 -240
  507. package/src/templates/ResourceTemplate.tsx.memoized_experiment +0 -350
  508. package/src/templates/ResourceTemplate.tsx.original +0 -396
  509. package/src/templates/ResourceTemplateCreate.tsx +0 -182
  510. package/src/templates/ResourceTemplateEdit.tsx +0 -176
  511. package/src/templates/ResourceTemplateFull.tsx +0 -581
  512. package/src/templates/ResourceTemplateList.tsx +0 -340
  513. package/src/templates/ResourceTemplateOld.tsx.bkup +0 -567
  514. package/src/templates/ResourceTemplateShow.tsx +0 -88
  515. package/src/templates/TrashTemplate.tsx +0 -179
  516. package/src/tenantResources.tsx +0 -223
  517. package/src/test_portal_bubbles.tsx +0 -40
  518. package/src/theme/AppHeader.tsx +0 -52
  519. package/src/theme/AppLayoutSetting.tsx +0 -33
  520. package/src/theme/AppLogo.tsx +0 -13
  521. package/src/theme/AppSidebar.tsx +0 -12
  522. package/src/theme/AppSidebarContent.tsx +0 -105
  523. package/src/theme/AppSidebarLogo.tsx +0 -48
  524. package/src/theme/components/PageTitle.tsx +0 -37
  525. package/src/utils/cache/CacheInvalidatorContext.tsx +0 -125
  526. package/src/utils/cache/CacheInvalidatorListenerComponent.tsx +0 -10
  527. package/src/utils/cache/useCacheInvalidatorListener.tsx +0 -27
  528. package/src/utils/convertFileToBase64.tsx +0 -9
  529. package/src/utils/convertToFile.tsx +0 -14
  530. package/src/utils/cookies.tsx +0 -33
  531. package/src/utils/dashDefaultQueryClient.tsx +0 -34
  532. package/src/utils/dataUrlToBlob.tsx +0 -30
  533. package/src/utils/deepReplace.tsx +0 -19
  534. package/src/utils/getProfileMenu.tsx +0 -41
  535. package/src/utils/getTenantSettings.tsx +0 -9
  536. package/src/utils/getType.tsx +0 -8
  537. package/src/utils/getUserSettings.tsx +0 -8
  538. package/src/utils/hasCode.tsx +0 -14
  539. package/src/utils/index.ts +0 -19
  540. package/src/utils/injectTenantStyles.ts +0 -28
  541. package/src/utils/isComponent.tsx +0 -45
  542. package/src/utils/navEvents.tsx +0 -91
  543. package/src/utils/prototypes.tsx +0 -5
  544. package/src/utils/regexp.tsx +0 -4
  545. package/src/utils/resolveObjectPath.tsx +0 -4
  546. package/src/utils/setNativeValue.tsx +0 -24
  547. package/src/utils/slugify.tsx +0 -11
  548. package/src/utils/validators/emailValidator.tsx +0 -6
  549. package/src/utils/validators/requiredValidator.tsx +0 -5
  550. package/src/utils/validators/rutValidator.tsx +0 -31
  551. package/src/utils/validators.tsx +0 -96
  552. /package/{src/components/permission/tsx → dist/components/tenant/AvailablePermissionsContext.d.ts} +0 -0
  553. /package/{src/components/tenant/AvailablePermissionsContext.tsx → dist/utils/prototypes.d.ts} +0 -0
@@ -1,546 +0,0 @@
1
- import * as React from 'react';
2
-
3
- import { useSelector } from 'react-redux';
4
- // Remove this import
5
- // import { usePermissions } from 'react-admin';
6
-
7
- import { List, IconButton, Box, useMediaQuery, useTheme } from '@mui/material';
8
- import KeyboardDoubleArrowLeftIcon from '@mui/icons-material/KeyboardDoubleArrowLeft';
9
- import KeyboardDoubleArrowRightIcon from '@mui/icons-material/KeyboardDoubleArrowRight';
10
- import MenuOpenIcon from '@mui/icons-material/MenuOpen';
11
- import { useEffect } from 'react';
12
- import { IMenuItem, IAppMenu } from './AppMenuComponents/interfaces';
13
- import SidebarItem from './AppMenuComponents/expanded/SidebarItem';
14
- import SidebarItemCollapse from './AppMenuComponents/expanded/CollapsableSidebarMenu';
15
- import CollapsedSidebarItems from './AppMenuComponents/collapsed/CollapsedSidebarItems';
16
- import { IDashAutoAdminResourceConfig } from 'dash-auto-admin';
17
-
18
- import { IDASHAppState, usePanelSettings } from 'dash-admin-state';
19
- import checkRole from '../../helpers/checkRole';
20
- import { slugify } from '../../utils/slugify';
21
- // Direct imports to avoid circular barrel imports
22
- import AvatarComponent from '../../components/user/AvatarComponent';
23
- import TenantAvatarComponent from '../../components/user/TenantAvatarComponent';
24
-
25
- import Scrollbar from '../../components/scrollbar/Scrollbar';
26
- // Add this import
27
- import { AuthPersistenceService } from 'dash-auth';
28
- import { useAuthContext } from '../../contexts/auth/AuthContext';
29
- import DarkToggleMode from '../../components/menu/DarkToggleMode';
30
- // Use I18nBridgeContext exclusively
31
- import { useI18nBridge } from '../../contexts/I18nBridgeContext';
32
- import BridgedLocalesMenuButton from '../../components/i18n/BridgedLocalesMenuButton';
33
-
34
- import { dashStorage } from 'dash-utils';
35
- import SidebarActions from './SidebarActions';
36
- import { useNavigate } from 'react-router';
37
-
38
- // Update the interface to include new props
39
- interface IAppMenuExtended extends IAppMenu {
40
- logos?: {
41
- horizontalLogo: React.ReactNode;
42
- squaredLogo: React.ReactNode;
43
- };
44
- onToggleDrawer?: (e: React.MouseEvent) => void;
45
- }
46
-
47
- // Group icons
48
- const GenerateItems: React.FC<{ items: IMenuItem[]; navExpanded: boolean, navSize: "large" | "small", level: number, sidebarPosition?: "left" | "top" | "bottom" | "right", translate: (key: string, options?: any) => string }> = ({
49
- items,
50
- navExpanded,
51
- navSize,
52
- level,
53
- sidebarPosition = "left",
54
- translate
55
- }) => {
56
- const isHorizontal = sidebarPosition === "top" || sidebarPosition === "bottom";
57
-
58
- return items &&
59
- <>
60
- {navExpanded && navSize === "large" ? (
61
- <List
62
- className={'sidebar-list'}
63
- component='nav'
64
- sx={isHorizontal ? {
65
- display: 'flex',
66
- flexDirection: 'row',
67
- flexWrap: 'nowrap',
68
- alignItems: 'center',
69
- padding: 0,
70
- margin: 0,
71
- } : undefined}
72
- >
73
- {items.map((item, index) => {
74
- return item.children && item.children.length ? (
75
- <SidebarItemCollapse
76
- navExpanded={navExpanded}
77
- navSize={navSize}
78
- item={item}
79
- key={index}
80
- level={level + 1}
81
- sidebarPosition={sidebarPosition}
82
- />
83
- ) : (
84
-
85
- <SidebarItem level={level} navExpanded={navExpanded} navSize={navSize} item={item} key={index} />
86
- );
87
- })}
88
- </List>
89
- ) : (
90
- <CollapsedSidebarItems level={level} items={items} navExpanded={navExpanded} navSize={navSize} sidebarPosition={sidebarPosition} />
91
- )}
92
- </>
93
-
94
- };
95
-
96
-
97
- const AppMaterialMenu: React.FC<IAppMenuExtended> = props => {
98
-
99
- const DEBUG = true;
100
- const { menu, debug, navExpanded, navSize, logos, onToggleDrawer, sidebarPosition: propSidebarPosition } = props;
101
- const navigate = useNavigate();
102
- const theme = useTheme();
103
- const isSmallScreen = useMediaQuery(theme.breakpoints.down('sm'));
104
- const isMediumScreen = useMediaQuery(theme.breakpoints.down('md')); // For logo switching
105
-
106
- // Get panel settings from Redux (includes dimensions, padding, but NOT sidebarPosition - that comes from prop)
107
- const { sidebarLargeWidth, sidebarSmallWidth, sidebarHorizontalHeight, logoVerticalMaxWidth, logoVerticalMaxHeight, logoHorizontalMaxWidth, logoHorizontalMaxHeight } = usePanelSettings();
108
-
109
- // Use sidebarPosition from prop (which is responsive from AppSidebarMaterial) with fallback to 'left'
110
- const sidebarPosition = propSidebarPosition || 'left';
111
-
112
- // Get i18n from Bridge context exclusively
113
- const { i18nProvider, locale: currentLocale } = useI18nBridge();
114
-
115
- // Use bridged translate
116
- const translate = React.useCallback((key: string, options?: any) => {
117
- // Safety check for non-string keys
118
- if (typeof key !== 'string') {
119
- return key;
120
- }
121
- // Use bridged provider
122
- if (i18nProvider?.translate) {
123
- try {
124
- return i18nProvider.translate(key, options);
125
- } catch (e) {
126
- console.warn('Translation error:', e);
127
- return key;
128
- }
129
- }
130
- return key;
131
- }, [i18nProvider]);
132
-
133
- useEffect(() => {
134
- DEBUG && console.log('🌐 AppMaterialMenu: Bridged i18nProvider:', i18nProvider);
135
- DEBUG && console.log('🌐 AppMaterialMenu: currentLocale:', currentLocale);
136
-
137
- // Enhanced debug: test translate with various keys
138
- DEBUG && console.log('🧪 Translation test:', {
139
- // Test react-admin built-in keys
140
- 'ra.action.delete': translate('ra.action.delete'),
141
- 'ra.action.save': translate('ra.action.save'),
142
- // Test top-level custom keys
143
- 'kiosk.total': translate('kiosk.total'),
144
- // Test nested resource keys
145
- 'resource.groups.products': translate('resource.groups.products'),
146
- 'resource.system.tenants.label': translate('resource.system.tenants.label'),
147
- });
148
- }, [i18nProvider, currentLocale, translate]);
149
-
150
- //const resources = useResourceDefinitions()
151
-
152
- // Replace usePermissions with useAuthContext - add null check
153
- // const { permissions } = usePermissions();
154
- const authContext = useAuthContext();
155
-
156
- const [items, setItems] = React.useState<IMenuItem[]>(null);
157
-
158
-
159
- // State for tenant logos
160
- /* const [tenantLogos, setTenantLogos] = React.useState<{
161
- horizontalLogo: string | null;
162
- squaredLogo: string | null;
163
- }>({
164
- horizontalLogo: null,
165
- squaredLogo: null
166
- });*/
167
-
168
- const resources = useSelector(
169
- (
170
- state: IDASHAppState<any, any, IDashAutoAdminResourceConfig>,
171
- ) => {
172
- if (debug || menu) {
173
- return menu;
174
- }
175
- return state.resources.items;
176
- },
177
- );
178
-
179
- // Track resource changes for debugging
180
- const prevResourcesRef = React.useRef<any[]>(null);
181
- React.useEffect(() => {
182
- const prevResources = prevResourcesRef.current;
183
- const prevModels = Array.isArray(prevResources) ? prevResources.map((r: any) => r.model) : [];
184
- const newModels = Array.isArray(resources) ? resources.map((r: any) => r.model) : [];
185
- const added = newModels.filter(m => !prevModels.includes(m));
186
- const removed = prevModels.filter(m => !newModels.includes(m));
187
- console.log('📊 AppMaterialMenu: Resources from Redux', {
188
- isSameRef: prevResources === resources,
189
- prevCount: prevResources?.length || 0,
190
- newCount: resources?.length || 0,
191
- added: added.length > 0 ? added : 'none',
192
- removed: removed.length > 0 ? removed : 'none',
193
- allModels: newModels,
194
- });
195
- prevResourcesRef.current = resources;
196
- }, [resources]);
197
-
198
- const panelSettings = useSelector((state: any) => state.common.panelSettings);
199
- const horizontalLogo = panelSettings?.horizontalLogo;
200
- const squaredLogo = panelSettings?.squaredLogo;
201
-
202
- const groupIcons = useSelector(
203
- (state: IDASHAppState<any, any, IDashAutoAdminResourceConfig>) =>
204
- state.settings.groupIcons
205
- );
206
-
207
- // Load tenant logos from AuthPersistenceService
208
- /*useEffect(() => {
209
- const tenantImages = AuthPersistenceService.getTenantImages();
210
- DEBUG && console.log('AppMaterialMenu Loaded: loading tenant images:', tenantImages);
211
- if (tenantImages) {
212
- //console.log('AppMaterialMenu: Loading tenant logos:', tenantImages);
213
-
214
-
215
-
216
- setTenantLogos({
217
- horizontalLogo: tenantImages.horizontal_logo?.original || null,
218
- squaredLogo: tenantImages.squared_logo?.original || null
219
- });
220
- } else {
221
- DEBUG && console.log('AppMaterialMenu: No tenant images found');
222
- setTenantLogos({
223
- horizontalLogo: null,
224
- squaredLogo: null
225
- });
226
- }
227
-
228
-
229
-
230
- //console.log('DASHTRefreshTheme');
231
- window.dispatchEvent(new CustomEvent("DASHTRefreshTheme", {}));
232
-
233
-
234
-
235
-
236
- }, []);*/
237
-
238
- useEffect(() => {
239
- // Don't process resources if permissions haven't been loaded yet and not in debug mode
240
-
241
- // Get user roles, defaulting to ["Public"] for unauthenticated users
242
- const userRoles = authContext?.user?.roles
243
- ? authContext.user.roles.flatMap(role => role.name)
244
- : ["Public"];
245
-
246
- const groups = [
247
- ...new Set(
248
- resources
249
- .map((resource) => resource.group)
250
- .filter((x) => x !== null && x !== undefined && x !== ''),
251
- ),
252
- ];
253
- //group resources belonging to the group
254
- const groupedResources = new Object();
255
- groups.forEach((group) => {
256
- groupedResources[group as string] = resources.filter((resource) => {
257
-
258
- //console.log(resource.group + " | ", resource.label + " | ", permissions, resource.roles, checkRole(permissions, resource.roles));
259
- /* @ts-ignore */
260
- return (resource.group === group && checkRole(userRoles, resource.roles));
261
- });
262
- });
263
- const _items: IMenuItem[] = [];
264
-
265
-
266
-
267
- Object.keys(groupedResources).map((groupKey) => {
268
- const group: IDashAutoAdminResourceConfig[] = groupedResources[groupKey];
269
- if (!group.length) return;
270
- const hidden = group[0] && group[0].hidden === true ? true : false;
271
- if (hidden) return;
272
-
273
- const _childrens = group
274
- .filter((resource) => resource.hidden !== true);
275
-
276
- // Generate paths relative to BrowserRouter basename (don't prepend currentAppPath)
277
- // React Router's Link components will automatically prepend the basename
278
- const _children = _childrens
279
- .map((resource) => {
280
-
281
- /* debugger;
282
- const translation = translate(resource.label)
283
- console.log( translation);
284
-
285
- debugger;
286
- */
287
-
288
- console.log('translating resource label:', resource.label, translate(resource.label));
289
-
290
- // Add more debug info
291
- // Use optional chaining carefully since i18nProvider might be null
292
- const currentLocale = i18nProvider?.getLocale?.() || 'unknown';
293
- const messages = i18nProvider?.getMessages?.(currentLocale) || {};
294
- const hasKey = messages[resource.label] !== undefined;
295
-
296
- console.log('🌐 Translation debug:', {
297
- key: resource.label,
298
- currentLocale,
299
- hasKey,
300
- translation: messages[resource.label],
301
- allMessagesKeys: Object.keys(messages).filter(k => k.includes('resource.system')),
302
- translateResult: translate(resource.label)
303
- });
304
-
305
- // For menuOnly resources, use redirect or path directly as the navigation target
306
- // For regular resources, build the path from model + optional redirect
307
- const buildMenuPath = () => {
308
- if (resource.menuOnly) {
309
- // menuOnly: use redirect, path, or fallback to model
310
- return resource.redirect || resource.path || `/${resource.model}`;
311
- }
312
- // Regular resource: existing logic
313
- if (resource?.redirect?.startsWith('/')) {
314
- return resource.redirect;
315
- }
316
- if (resource?.redirect) {
317
- return `/${resource.model}/${resource.redirect}`.replace(/\/+/g, '/');
318
- }
319
- return `/${resource.model}`.replace(/\/+/g, '/');
320
- };
321
-
322
- return {
323
- label: translate(resource.label, { _: resource.label }),
324
- key: resource.label,
325
- to: buildMenuPath(),
326
- icon: resource.icon,
327
- group: slugify(group[0].group),
328
- model: resource.model,
329
- menuOnly: resource.menuOnly,
330
- txtLabel: translate(resource.label, { _: resource.label }),
331
- };
332
- });
333
-
334
- // Generate path relative to BrowserRouter basename (don't prepend currentAppPath)
335
- // React Router's Link components will automatically prepend the basename
336
- const _item: IMenuItem = {
337
- label: translate(group[0].group, { _: group[0].group }),
338
- key: slugify(group[0].group),
339
- icon: group[0].icon || groupIcons[group[0].group],
340
- group: slugify(group[0].group),
341
- model: group[0].model,
342
- to: group[0].redirect?.startsWith('/')
343
- ? group[0].redirect
344
- : group[0].redirect
345
- ? `/${group[0].model}/${group[0].redirect}`.replace(/\/+/g, '/')
346
- : `/${group[0].model}`.replace(/\/+/g, '/'),
347
- txtLabel: translate(group[0].group, { _: group[0].group }),
348
- ...(_childrens && _childrens.length > 1 && { children: _children }) as any
349
- };
350
-
351
- _items.push(_item);
352
-
353
- });
354
-
355
- // Add ungrouped resources as top-level items
356
- const ungroupedResources = resources.filter((resource) => {
357
- const hasGroup = resource.group !== null && resource.group !== undefined && resource.group !== '';
358
- return !hasGroup && checkRole(userRoles, resource.roles) && resource.hidden !== true;
359
- });
360
-
361
- ungroupedResources.forEach((resource) => {
362
- const buildMenuPath = () => {
363
- if (resource.menuOnly) {
364
- return resource.redirect || resource.path || `/${resource.model}`;
365
- }
366
- if (resource?.redirect?.startsWith('/')) {
367
- return resource.redirect;
368
- }
369
- if (resource?.redirect) {
370
- return `/${resource.model}/${resource.redirect}`.replace(/\/+/g, '/');
371
- }
372
- return `/${resource.model}`.replace(/\/+/g, '/');
373
- };
374
-
375
- _items.push({
376
- label: translate(resource.label, { _: resource.label }),
377
- key: resource.label || resource.model,
378
- to: buildMenuPath(),
379
- icon: resource.icon,
380
- group: null,
381
- model: resource.model,
382
- menuOnly: resource.menuOnly,
383
- txtLabel: translate(resource.label, { _: resource.label }),
384
- });
385
- });
386
- DEBUG && console.log("MENU ITEMS", _items);
387
- setItems(_items);
388
- }, [resources, debug, authContext?.user, translate, i18nProvider, currentLocale]); // Include translate, i18nProvider and currentLocale to rebuild menu when translations change
389
-
390
- const isHorizontal = sidebarPosition === "top" || sidebarPosition === "bottom";
391
-
392
- return <>
393
-
394
- <Box className='sidebar-header'
395
-
396
- sx={{
397
- display: 'flex',
398
- flexDirection: isHorizontal ? 'row' : (navExpanded && navSize === 'large' ? 'row' : 'column'),
399
- alignItems: isHorizontal ? 'center' : undefined,
400
- }
401
-
402
- }>
403
-
404
- <Box sx={{
405
- paddingRight: '5px',
406
- //borderRight: navExpanded && navSize === 'large' ? '1px solid rgba(0, 0, 0, 0.12)' : 'none',
407
- display: 'flex',
408
- flexDirection: 'column',
409
- alignItems: 'center',
410
- gap: 1
411
- }}>
412
-
413
- <Box
414
- sx={{
415
- display: 'flex',
416
- alignItems: 'center',
417
- //gap: 1,
418
- flexDirection: 'column',
419
-
420
- }}>
421
- {/* Toggle icon - burger for mobile, arrows for desktop */}
422
- {onToggleDrawer && (
423
- <IconButton
424
- className='dash-icon-button-color dash-icon-button-bg'
425
- onClick={onToggleDrawer}
426
- sx={{
427
- m:1
428
- }}
429
- /*sx={{
430
- m:1,
431
- padding: '8px',
432
- borderRadius: '8px',
433
- backgroundColor: 'rgba(255,255,255,0.1)',
434
- '&:hover': {
435
- backgroundColor: 'rgba(255,255,255,0.2)',
436
- }
437
- }}*/
438
-
439
- >
440
- {navSize === 'small' ? (
441
- <MenuOpenIcon sx={{ fontSize: 28, transform: 'scaleX(-1)' }} />
442
- ) : navExpanded ? (
443
- <KeyboardDoubleArrowLeftIcon sx={{ fontSize: 28 }} />
444
- ) : (
445
- <KeyboardDoubleArrowRightIcon sx={{ fontSize: 28 }} />
446
- )}
447
- </IconButton>
448
- )}
449
- {!(navExpanded && navSize === 'large') && !isSmallScreen && <TenantAvatarComponent
450
- navExpanded={navExpanded}
451
- navSize={navSize}
452
- imageUrl={isMediumScreen || sidebarPosition === "left" || sidebarPosition === "right" ? squaredLogo : horizontalLogo}
453
- maxWidth={isHorizontal ? logoHorizontalMaxWidth : logoVerticalMaxWidth}
454
- maxHeight={isHorizontal ? logoHorizontalMaxHeight : logoVerticalMaxHeight}
455
- sidebarSmallWidth={sidebarSmallWidth}
456
- alt="Tenant Logo"
457
- sidebarPosition={sidebarPosition}
458
- onClick={() => navigate('/')}
459
- />}
460
- </Box>
461
-
462
-
463
- {(sidebarPosition === "left" || sidebarPosition === "right") && (
464
- <SidebarActions sidebarPosition={sidebarPosition} navExpanded={navExpanded} />
465
- )}
466
-
467
-
468
- </Box>
469
-
470
- {navExpanded && navSize === 'large' && <Box
471
- sx={{
472
- display: 'flex',
473
- alignItems: 'center',
474
-
475
- flexDirection: 'column',
476
-
477
- }}
478
-
479
- >
480
-
481
- <TenantAvatarComponent
482
- navExpanded={navExpanded}
483
- navSize={navSize}
484
-
485
- imageUrl={isMediumScreen || sidebarPosition === "left" || sidebarPosition === "right" ? squaredLogo : horizontalLogo}
486
- maxWidth={isHorizontal ? logoHorizontalMaxWidth : logoVerticalMaxWidth}
487
- maxHeight={isHorizontal ? logoHorizontalMaxHeight : logoVerticalMaxHeight}
488
- sidebarSmallWidth={sidebarSmallWidth}
489
- alt="Tenant Logo"
490
- sidebarPosition={sidebarPosition}
491
- onClick={() => navigate('/')}
492
- />
493
-
494
-
495
-
496
- </Box>}
497
-
498
-
499
- </Box>
500
-
501
- {/* For horizontal mode (top/bottom), use a simple Box instead of Scrollbar
502
- since react-custom-scrollbars creates nested divs that break flex layout */}
503
- {(sidebarPosition === "top" || sidebarPosition === "bottom") ? (
504
- <Box
505
- className="dash-layout-sider-scrollbar horizontal-mode"
506
- sx={{
507
- display: 'flex',
508
- flexDirection: 'row',
509
- overflowX: 'auto',
510
- overflowY: 'hidden',
511
- flex: 1,
512
- height: '100%',
513
- alignItems: 'center',
514
- }}
515
- >
516
- <GenerateItems items={items} navExpanded={navExpanded} navSize={navSize} level={0} sidebarPosition={sidebarPosition} translate={translate} />
517
- </Box>
518
- ) : (
519
- <Scrollbar
520
- //autoHide={true}
521
- //autoHideTimeout={1000}
522
- //autoHideDuration={200}
523
- className={'dash-layout-sider-scrollbar'}
524
- >
525
- <GenerateItems items={items} navExpanded={navExpanded} navSize={navSize} level={0} sidebarPosition={sidebarPosition} translate={translate} />
526
- </Scrollbar>
527
- )}
528
-
529
- {(sidebarPosition === "top" || sidebarPosition === "bottom") && (
530
- <SidebarActions sidebarPosition={sidebarPosition} navExpanded={navExpanded} />
531
- )}
532
-
533
-
534
- </>
535
-
536
-
537
- };
538
-
539
- /*export default React.memo(
540
- AppMaterialMenu,
541
- (props, nextProps) =>
542
- props === nextProps
543
- ) as typeof AppMaterialMenu;
544
- */
545
-
546
- export default AppMaterialMenu;
@@ -1,61 +0,0 @@
1
- import React, { RefObject } from 'react';
2
- import ReactDOM from 'react-dom';
3
- import { SidebarPosition } from '../AppSidebarMaterial';
4
- import { getSubmenuStyle, SUBMENU_SCROLL_THRESHOLD } from './submenuConstants';
5
-
6
- export interface SubmenuPortalProps {
7
- /** Whether the submenu is open */
8
- open: boolean;
9
- /** Reference to the parent menu item element for position calculation */
10
- itemRef: RefObject<HTMLElement | null>;
11
- /** Sidebar position affects where submenu opens relative to item */
12
- sidebarPosition: SidebarPosition;
13
- /** Submenu content to render */
14
- children: React.ReactNode;
15
- /** Mouse enter handler for hover behavior */
16
- onMouseEnter?: () => void;
17
- /** Mouse leave handler for hover behavior */
18
- onMouseLeave?: () => void;
19
- /** Number of children items (affects renderAtTop behavior) */
20
- childrenCount?: number;
21
- /** Additional CSS class */
22
- className?: string;
23
- /** Ref to the portaled root, so callers can include it in click-outside containment checks
24
- * (the portal content is not a DOM descendant of itemRef, so itemRef alone isn't enough). */
25
- contentRef?: RefObject<HTMLDivElement | null>;
26
- }
27
-
28
- /**
29
- * Shared portal component for rendering submenus.
30
- * Renders content in a portal attached to document.body with calculated position.
31
- */
32
- const SubmenuPortal: React.FC<SubmenuPortalProps> = ({
33
- open,
34
- itemRef,
35
- sidebarPosition,
36
- children,
37
- onMouseEnter,
38
- onMouseLeave,
39
- childrenCount = 0,
40
- className = 'sidebar-submenu-portal',
41
- contentRef,
42
- }) => {
43
- if (!open) return null;
44
-
45
- const renderAtTop = childrenCount > SUBMENU_SCROLL_THRESHOLD;
46
-
47
- return ReactDOM.createPortal(
48
- <div
49
- ref={contentRef}
50
- className={className}
51
- style={getSubmenuStyle(itemRef, sidebarPosition, renderAtTop)}
52
- onMouseEnter={onMouseEnter}
53
- onMouseLeave={onMouseLeave}
54
- >
55
- {children}
56
- </div>,
57
- document.body
58
- );
59
- };
60
-
61
- export default SubmenuPortal;