@dashadmin/dash-admin 1.3.17 → 1.3.20

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 (268) hide show
  1. package/dist/AppAsyncWrapper.js +1 -0
  2. package/dist/AppWrapper.js +1 -0
  3. package/dist/DASHAdmin.js +1 -0
  4. package/dist/DASHAdmin.tsx.old +456 -0
  5. package/dist/RoutingWrapper.js +1 -0
  6. package/dist/classes/DASHStorageClass.js +1 -0
  7. package/dist/components/Input/RichTextField.js +1 -0
  8. package/dist/components/Redirect.js +1 -0
  9. package/dist/components/avatar/Avatar.js +1 -0
  10. package/dist/components/avatar/SingleImageUploader.js +1 -0
  11. package/dist/components/currency/Format.js +1 -0
  12. package/dist/components/custom/Redirect.js +1 -0
  13. package/dist/components/error/Error.js +1 -0
  14. package/dist/components/geocoding/GeocodingField.js +1 -0
  15. package/dist/components/i18n/BridgedLocalesMenuButton.js +1 -0
  16. package/dist/components/i18n/LangSwitcher.js +1 -0
  17. package/dist/components/loader/GlobalLoader.js +1 -0
  18. package/dist/components/logs/LogFile.js +1 -0
  19. package/dist/components/logs/LogFileById.js +1 -0
  20. package/dist/components/logs/LogViewer.js +1 -0
  21. package/dist/components/menu/AppMenu.js +1 -0
  22. package/dist/components/menu/CustomMenuItemLink.js +1 -0
  23. package/dist/components/menu/DarkToggleMode.js +1 -0
  24. package/dist/components/menu/LanguageToggleMode.js +1 -0
  25. package/dist/components/misc/CustomImageInput.js +1 -0
  26. package/dist/components/misc/DASHGlobalErrorHandler.js +1 -0
  27. package/dist/components/misc/DarkModeSwitcher.js +1 -0
  28. package/dist/components/misc/LanguageSwitcher.js +1 -0
  29. package/dist/components/misc/MUIHtmlToolTip.js +1 -0
  30. package/dist/components/misc/MuiSimpleJsonTable.js +1 -0
  31. package/dist/components/misc/MultiLevelTable.js +1 -0
  32. package/dist/components/misc/NoResults.js +1 -0
  33. package/dist/components/misc/PDFViewer.js +1 -0
  34. package/dist/components/navigation/Breadcrumbs.js +1 -0
  35. package/dist/components/navigation/BreadcrumbsManager.js +1 -0
  36. package/dist/components/navigation/index.js +1 -0
  37. package/dist/components/panel/Error.js +1 -0
  38. package/dist/components/permission/AvailablePermissionsContext.js +1 -0
  39. package/dist/components/permission/PermissionsSelector.js +1 -0
  40. package/dist/components/permission/PermissionsSelectorList.js +1 -0
  41. package/dist/components/permission/tsx +0 -0
  42. package/dist/components/racustombuttons/CustomRAButton.js +1 -0
  43. package/dist/components/racustombuttons/QuickButton.js +1 -0
  44. package/dist/components/racustombuttons/QuickEditButton.js +1 -0
  45. package/dist/components/racustombuttons/QuickIconButton.js +1 -0
  46. package/dist/components/scrollbar/Scrollbar.js +1 -0
  47. package/dist/components/selects/MultiSelect.js +1 -0
  48. package/dist/components/selects/RASearchableSelect.js +1 -0
  49. package/dist/components/selects/RASearchableSelectChips.js +1 -0
  50. package/dist/components/selects/SearchableSelect.js +1 -0
  51. package/dist/components/subscription/BillingCycleSelectInput.js +1 -0
  52. package/dist/components/subscription/PlanAddonsSettings.js +1 -0
  53. package/dist/components/subscription/PlanAuditLog.js +1 -0
  54. package/dist/components/subscription/PlanFeaturesSettings.js +1 -0
  55. package/dist/components/subscription/PlanLimitsSettings.js +1 -0
  56. package/dist/components/subscription/PlanMetadataSettings.js +1 -0
  57. package/dist/components/subscription/PlanPricesSettings.js +1 -0
  58. package/dist/components/subscription/index.js +1 -0
  59. package/dist/components/svgelements/SvgLoading.js +1 -0
  60. package/dist/components/svgelements/SvgLogo.js +1 -0
  61. package/dist/components/svgelements/SvgLogoMin.js +1 -0
  62. package/dist/components/svgelements/SvgShipping.js +1 -0
  63. package/dist/components/tenant/AvailablePermissionsContext.js +0 -0
  64. package/dist/components/tenant/TenantAttributes.js +1 -0
  65. package/dist/components/tenant/TenantAttributesContext.js +1 -0
  66. package/dist/components/tenant/TenantSelector.js +1 -0
  67. package/dist/components/tenant/TenantSettings.js +1 -0
  68. package/dist/components/tenant/TenantSettingsContext.js +1 -0
  69. package/dist/components/tenant/TenantTheme.js +1 -0
  70. package/dist/components/user/AvatarComponent.js +1 -0
  71. package/dist/components/user/TenantAvatarComponent.js +1 -0
  72. package/dist/components/user/UserPreferences.js +1 -0
  73. package/dist/config/ACTIONS.js +1 -0
  74. package/dist/config/ConstantsService.js +1 -0
  75. package/dist/config/DASHAdminSystemConstants.js +1 -0
  76. package/dist/config/PARSERS.js +1 -0
  77. package/dist/contexts/DashQueryClientContext.js +1 -0
  78. package/dist/contexts/DashResourceContext.js +1 -0
  79. package/dist/contexts/I18nBridgeContext.js +1 -0
  80. package/dist/contexts/I18nBridgeSetter.js +1 -0
  81. package/dist/contexts/I18nReduxSync.js +1 -0
  82. package/dist/contexts/SubscriptionPlanFormatsProvider.js +1 -0
  83. package/dist/contexts/SystemRequestsCache.js +1 -0
  84. package/dist/contexts/auth/AuthContext.js +1 -0
  85. package/dist/contexts/auth/AuthContextLocalStorage.js +1 -0
  86. package/dist/contexts/auth/DASHAuthenticationService.js +1 -0
  87. package/dist/contexts/auth/WindowContext.js +1 -0
  88. package/dist/contexts/auth/index.js +1 -0
  89. package/dist/contexts/com/FCMContext.js +1 -0
  90. package/dist/contexts/com/LaravelEchoContext.js +1 -0
  91. package/dist/contexts/com/LaravelEchoMgr.js +1 -0
  92. package/dist/contexts/com/components/DefaultNotificationComponent.js +1 -0
  93. package/dist/contexts/com/components/NotificationAttributesTable.js +1 -0
  94. package/dist/contexts/com/components/NotificationRenderer.js +1 -0
  95. package/dist/contexts/com/components/NotificationsWidget.js +1 -0
  96. package/dist/contexts/com/components/notificationFormats.js +1 -0
  97. package/dist/contexts/com/useLaravelEcho.js +1 -0
  98. package/dist/contexts/dictionary/DictionaryContext.js +1 -0
  99. package/dist/declarations.d.ts +17 -0
  100. package/dist/default-theme/DASHAppProviders.js +1 -0
  101. package/dist/default-theme/DashThemeContext.js +1 -0
  102. package/dist/default-theme/DashThemeContext.tsx.fast +143 -0
  103. package/dist/default-theme/DashThemeContext.tsx.old +306 -0
  104. package/dist/default-theme/DashThemeHelperProvider.js +1 -0
  105. package/dist/default-theme/DomainAppLayout.js +1 -0
  106. package/dist/default-theme/DomainHeader.js +1 -0
  107. package/dist/default-theme/DomainTheme.js +1 -0
  108. package/dist/default-theme/FullLayoutMarkup.js +1 -0
  109. package/dist/default-theme/StaticLayout.js +1 -0
  110. package/dist/default-theme/index.js +1 -0
  111. package/dist/default-theme/menu/AppMaterialMenu.js +1 -0
  112. package/dist/default-theme/menu/AppMenuComponents/SubmenuPortal.js +1 -0
  113. package/dist/default-theme/menu/AppMenuComponents/collapsed/CollapsedSidebarItem.js +1 -0
  114. package/dist/default-theme/menu/AppMenuComponents/collapsed/CollapsedSidebarItems.js +1 -0
  115. package/dist/default-theme/menu/AppMenuComponents/expanded/CollapsableSidebarMenu.js +1 -0
  116. package/dist/default-theme/menu/AppMenuComponents/expanded/SidebarItem.js +1 -0
  117. package/dist/default-theme/menu/AppMenuComponents/getItem.js +1 -0
  118. package/dist/default-theme/menu/AppMenuComponents/interfaces.js +0 -0
  119. package/dist/default-theme/menu/AppMenuComponents/submenuConstants.js +1 -0
  120. package/dist/default-theme/menu/AppSidebarMaterial.js +1 -0
  121. package/dist/default-theme/menu/SidebarActions.js +1 -0
  122. package/dist/default-theme/updateDomCssVariables.js +1 -0
  123. package/dist/helpers/checkRole.js +1 -0
  124. package/dist/helpers/parseAxiosError.js +2 -0
  125. package/dist/hooks/audio/useAudio.js +1 -0
  126. package/dist/hooks/axios.js +1 -0
  127. package/dist/hooks/data/useDashboardStats.js +1 -0
  128. package/dist/hooks/data/usePackageByClientsStats.js +1 -0
  129. package/dist/hooks/data/usePackageByCommunesStats.js +1 -0
  130. package/dist/hooks/data/usePackageStats.js +1 -0
  131. package/dist/hooks/data/usePackageWithdrawDetails.js +1 -0
  132. package/dist/hooks/data/useStats.js +1 -0
  133. package/dist/hooks/isCurrentPath.js +1 -0
  134. package/dist/hooks/notifications/WSMessagesManager.js +1 -0
  135. package/dist/hooks/notifications/WSPusherManager.js +1 -0
  136. package/dist/hooks/useBreadcrumbs.js +1 -0
  137. package/dist/hooks/useClickOutside.js +1 -0
  138. package/dist/hooks/useFormPersistance.js +1 -0
  139. package/dist/hooks/useGlobalErrorMediator.js +1 -0
  140. package/dist/hooks/useGlobalLoaderMgr.js +1 -0
  141. package/dist/hooks/useHash.js +1 -0
  142. package/dist/hooks/useLocalStorage.js +1 -0
  143. package/dist/hooks/usePolyglotTranslation.js +1 -0
  144. package/dist/hooks/usePrevious.js +1 -0
  145. package/dist/hooks/usePrintSelected.js +1 -0
  146. package/dist/hooks/useVirtualHash.js +1 -0
  147. package/dist/hooks/window/useWindowSize.js +1 -0
  148. package/dist/interfaces/IAppResourceConfig.js +0 -0
  149. package/dist/interfaces/Log.js +0 -0
  150. package/dist/interfaces/Tenant.js +0 -0
  151. package/dist/interfaces/communication/IActions.js +0 -0
  152. package/dist/interfaces/communication/INotification.js +0 -0
  153. package/dist/interfaces/communication/IPayload.js +0 -0
  154. package/dist/interfaces/communication/IRequestAction.js +0 -0
  155. package/dist/interfaces/communication/IRequestPayload.js +0 -0
  156. package/dist/interfaces/communication/IResponseAction.js +0 -0
  157. package/dist/interfaces/misc/IAny.js +0 -0
  158. package/dist/interfaces/misc/IFlashMessage.js +0 -0
  159. package/dist/interfaces/navigation/IAppMenu.js +0 -0
  160. package/dist/interfaces/navigation/ICollapsableSidebarMenu.js +0 -0
  161. package/dist/interfaces/navigation/IMenuItem.js +0 -0
  162. package/dist/interfaces/notifications/IModel.js +0 -0
  163. package/dist/interfaces/notifications/IModelField.js +0 -0
  164. package/dist/interfaces/notifications/IUserNotification.js +0 -0
  165. package/dist/interfaces/notifications/IUserNotificationData.js +0 -0
  166. package/dist/interfaces/notifications/IUserNotificationPayload.js +0 -0
  167. package/dist/interfaces/user/IGetAuth.js +0 -0
  168. package/dist/interfaces/user/ITenantSettings.js +0 -0
  169. package/dist/interfaces/user/IUser.js +0 -0
  170. package/dist/interfaces/user/IUserSettings.js +0 -0
  171. package/dist/interfaces.js +1 -0
  172. package/dist/layout/AppLayout.js +1 -0
  173. package/dist/layout/ApplicationLayout.js +1 -0
  174. package/dist/layout/MotionWrapper.js +1 -0
  175. package/dist/layout/MotionWrapper.original.js +1 -0
  176. package/dist/layout/ResourceMenu.js +1 -0
  177. package/dist/layout/ResoureLayout.js +1 -0
  178. package/dist/layout/TransitionWrapper.js +24 -0
  179. package/dist/pages/ChangePassword.js +1 -0
  180. package/dist/pages/DASHLanding.js +1 -0
  181. package/dist/pages/DASHLightWeightLogin.js +1 -0
  182. package/dist/pages/DASHSimpleLogin.js +1 -0
  183. package/dist/pages/Login.js +1 -0
  184. package/dist/pages/Profile.js +1 -0
  185. package/dist/pages/RecoverPassword.js +1 -0
  186. package/dist/pages/SingleImageUploader.js +1 -0
  187. package/dist/pages/VerifyAccount.js +1 -0
  188. package/dist/providers/authProvider.js +1 -0
  189. package/dist/providers/dataProvider.js +1 -0
  190. package/dist/providers/i18n/en.js +1 -0
  191. package/dist/providers/i18n/es.js +1 -0
  192. package/dist/providers/i18n/languages.js +1 -0
  193. package/dist/providers/i18nProvider.js +1 -0
  194. package/dist/react-admin-dash/RADashComponent.js +1 -0
  195. package/dist/react-admin-dash/Resource.js +1 -0
  196. package/dist/resources/Brand/BrandResource.js +1 -0
  197. package/dist/resources/DASHResourceLoader.js +1 -0
  198. package/dist/resources/Log/LogResource.js +1 -0
  199. package/dist/resources/Tenant/ImpersonateTenantResource.js +1 -0
  200. package/dist/resources/Trash/TrashTemplate.js +1 -0
  201. package/dist/resources.js +1 -0
  202. package/dist/schemas/log.js +1 -0
  203. package/dist/schemas/notification.js +1 -0
  204. package/dist/schemas/permissions.js +1 -0
  205. package/dist/schemas/roles.js +1 -0
  206. package/dist/schemas/rolesDataGrid.js +1 -0
  207. package/dist/schemas/subscription/components/SubscriptionActions.js +1 -0
  208. package/dist/schemas/subscription/components/SubscriptionPaymentHistory.js +1 -0
  209. package/dist/schemas/subscription/components/SubscriptionPlanFeatures.js +1 -0
  210. package/dist/schemas/subscription/components/SubscriptionPlanPreview.js +1 -0
  211. package/dist/schemas/subscription/components/SubscriptionPlanStats.js +1 -0
  212. package/dist/schemas/subscription/components/SubscriptionStatusIndicator.js +1 -0
  213. package/dist/schemas/subscription/subscriptionPlanSchema.js +1 -0
  214. package/dist/schemas/subscription/subscriptionSchema.js +1 -0
  215. package/dist/schemas/subscriptionPlan.js +1 -0
  216. package/dist/schemas/tenant.js +1 -0
  217. package/dist/schemas/tenantUser.js +1 -0
  218. package/dist/schemas/tenant_superadmin.js +1 -0
  219. package/dist/schemas/user.js +1 -0
  220. package/dist/systemResources.js +1 -0
  221. package/dist/systemResources.old.js +1 -0
  222. package/dist/templates/ResourceTemplate.js +1 -0
  223. package/dist/templates/ResourceTemplate.tsx.memoized_experiment +350 -0
  224. package/dist/templates/ResourceTemplate.tsx.original +396 -0
  225. package/dist/templates/ResourceTemplateCreate.js +1 -0
  226. package/dist/templates/ResourceTemplateEdit.js +1 -0
  227. package/dist/templates/ResourceTemplateFull.js +1 -0
  228. package/dist/templates/ResourceTemplateList.js +1 -0
  229. package/dist/templates/ResourceTemplateOld.tsx.bkup +567 -0
  230. package/dist/templates/ResourceTemplateShow.js +1 -0
  231. package/dist/templates/TrashTemplate.js +1 -0
  232. package/dist/tenantResources.js +1 -0
  233. package/dist/test_portal_bubbles.js +1 -0
  234. package/dist/theme/AppHeader.js +1 -0
  235. package/dist/theme/AppLayoutSetting.js +1 -0
  236. package/dist/theme/AppLogo.js +1 -0
  237. package/dist/theme/AppSidebar.js +1 -0
  238. package/dist/theme/AppSidebarContent.js +1 -0
  239. package/dist/theme/AppSidebarLogo.js +1 -0
  240. package/dist/theme/components/PageTitle.js +1 -0
  241. package/dist/utils/cache/CacheInvalidatorContext.js +1 -0
  242. package/dist/utils/cache/CacheInvalidatorListenerComponent.js +1 -0
  243. package/dist/utils/cache/useCacheInvalidatorListener.js +1 -0
  244. package/dist/utils/convertFileToBase64.js +1 -0
  245. package/dist/utils/convertToFile.js +1 -0
  246. package/dist/utils/cookies.js +1 -0
  247. package/dist/utils/dashDefaultQueryClient.js +1 -0
  248. package/dist/utils/dataUrlToBlob.js +1 -0
  249. package/dist/utils/deepReplace.js +1 -0
  250. package/dist/utils/getProfileMenu.js +1 -0
  251. package/dist/utils/getTenantSettings.js +1 -0
  252. package/dist/utils/getType.js +1 -0
  253. package/dist/utils/getUserSettings.js +1 -0
  254. package/dist/utils/hasCode.js +1 -0
  255. package/dist/utils/index.js +1 -0
  256. package/dist/utils/injectTenantStyles.js +1 -0
  257. package/dist/utils/isComponent.js +1 -0
  258. package/dist/utils/navEvents.js +1 -0
  259. package/dist/utils/prototypes.js +1 -0
  260. package/dist/utils/regexp.js +1 -0
  261. package/dist/utils/resolveObjectPath.js +1 -0
  262. package/dist/utils/setNativeValue.js +1 -0
  263. package/dist/utils/slugify.js +1 -0
  264. package/dist/utils/validators/emailValidator.js +1 -0
  265. package/dist/utils/validators/requiredValidator.js +1 -0
  266. package/dist/utils/validators/rutValidator.js +1 -0
  267. package/dist/utils/validators.js +1 -0
  268. package/package.json +13 -2
@@ -0,0 +1,567 @@
1
+ import { PropsWithChildren, useEffect } from 'react';
2
+ import { Route, useParams } from 'react-router';
3
+ import { toast } from 'react-toastify';
4
+ import { useDialog } from 'dash-dialog';
5
+ import { IDASHAppConstants } from 'dash-constants';
6
+ import {
7
+ Create,
8
+ Edit,
9
+ EditButton,
10
+ CustomRoutes,
11
+ Loading,
12
+ Resource,
13
+ Show,
14
+ SimpleForm,
15
+ TabbedShowLayout,
16
+ TopToolbar,
17
+ Toolbar,
18
+ useNotify,
19
+ useRedirect,
20
+ useRefresh
21
+ } from 'react-admin';
22
+
23
+ import { DashResourceProvider } from '../../contexts/DashResourceContext';
24
+ import { IDashAutoAdminResourceConfig, evalActionPermission, DashRedirect, DashAutoList, DashAutoDrawer, DashAutoEdit, DashAutoCreate, DashAutoTitle, DashAutoTabs, DashAutoReferenceTab } from 'dash-auto-admin';
25
+ import DashAutoAdminSaveButton from 'dash-auto-admin/src/DashAutoAdminSaveButton';
26
+ // TODO: The following dependencies shpuld not depend on @dashboard
27
+
28
+ export const ResourceTemplate = (
29
+ resourceConfig: IDashAutoAdminResourceConfig,
30
+ ResourceLayout: React.FC<PropsWithChildren<{ resourceConfig: IDashAutoAdminResourceConfig }>>,
31
+ dashConstants: IDASHAppConstants,
32
+ ) => {
33
+ const _create = evalActionPermission(resourceConfig, resourceConfig?.create);
34
+ const _edit = evalActionPermission(resourceConfig, resourceConfig?.edit);
35
+ //const _delete = evalActionPermission(resourceConfig,resourceConfig?.delete)
36
+
37
+ const _showNotifyAfterSubmit =
38
+ resourceConfig?.showNotifyAfterSubmit === false ? false : true;
39
+ const _showDialogAfterSubmit =
40
+ resourceConfig?.showDialogAfterSubmit === false ? false : true;
41
+
42
+ const showError = (error: any) => {
43
+ if (error && error.nativeEvent) return;
44
+
45
+ let _error: any = error;
46
+ try {
47
+ const _parsedError =
48
+ typeof error === 'string' ? JSON.parse(error) : error;
49
+ if (typeof _parsedError === 'object') {
50
+ _error = <>{JSON.stringify(_parsedError)}</>;
51
+ }
52
+ } catch (e) {
53
+ console.error(e);
54
+ }
55
+
56
+ toast.error(<>{_error}</>, {
57
+ position: 'bottom-center',
58
+ //autoClose: 10000,
59
+ autoClose: false,
60
+ hideProgressBar: true,
61
+ closeOnClick: true,
62
+ pauseOnHover: true,
63
+ draggable: true,
64
+ //progress: undefined,
65
+ /*onClose: () => {
66
+ }*/
67
+ });
68
+ };
69
+
70
+ return (
71
+ <DashResourceProvider resourceConfig={resourceConfig}>
72
+ <CustomRoutes>
73
+ {typeof resourceConfig.customRoutes === 'function' &&
74
+ resourceConfig.customRoutes(resourceConfig)}
75
+ <Route
76
+ path={resourceConfig.model + '/inline'}
77
+ element={
78
+ <DashRedirect
79
+ stateHashPattern={dashConstants.system.URL_PREFIX + resourceConfig.model + '/inline'}
80
+ method='list'
81
+ drawerMethod='edit'
82
+ resourceConfig={resourceConfig}
83
+ />
84
+ }
85
+ />
86
+ <Route
87
+ path={resourceConfig.model + '/inline/:id'}
88
+ element={
89
+ <DashRedirect
90
+ stateHashPattern={
91
+ dashConstants.system.URL_PREFIX + resourceConfig.model + '/inline/:id/:method'
92
+ }
93
+ method='list'
94
+ drawerMethod='edit'
95
+ resourceConfig={resourceConfig}
96
+ />
97
+ }
98
+ />
99
+ <Route
100
+ path={resourceConfig.model + '/inline/:id/edit'}
101
+ element={
102
+ <DashRedirect
103
+ stateHashPattern={
104
+ dashConstants.system.URL_PREFIX + resourceConfig.model + '/inline/:id/:method'
105
+ }
106
+ method='list'
107
+ drawerMethod='edit'
108
+ resourceConfig={resourceConfig}
109
+ />
110
+ }
111
+ />
112
+ <Route
113
+ path={resourceConfig.model + '/inline/:id/show'}
114
+ element={
115
+ <DashRedirect
116
+ stateHashPattern={
117
+ dashConstants.system.URL_PREFIX + resourceConfig.model + '/inline/:id/:method'
118
+ }
119
+ method='list'
120
+ drawerMethod='show'
121
+ resourceConfig={resourceConfig}
122
+ />
123
+ }
124
+ />
125
+ <Route
126
+ path={resourceConfig.model + '/inline/create'}
127
+ element={
128
+ <DashRedirect
129
+ stateHashPattern={dashConstants.system.URL_PREFIX + resourceConfig.model + '/inline/create'}
130
+ method='list'
131
+ drawerMethod='create'
132
+ resourceConfig={resourceConfig}
133
+ />
134
+ }
135
+ />
136
+ </CustomRoutes>
137
+ <Resource
138
+ options={{ label: resourceConfig.label, group: resourceConfig.group }}
139
+ name={resourceConfig.model}
140
+ list={() => {
141
+ const notify = useNotify();
142
+ const redirect = useRedirect();
143
+ const dialog = useDialog();
144
+ const refresh = useRefresh();
145
+
146
+ useEffect(() => {
147
+ console.log('LIST', resourceConfig);
148
+ }, []);
149
+
150
+ const onSubmit = (data: any) => {
151
+ if (_showNotifyAfterSubmit) {
152
+ notify('Recurso Actualizado', { type: 'success' });
153
+ }
154
+
155
+ if (_showDialogAfterSubmit) {
156
+ dialog({
157
+ variant: 'info',
158
+ title: 'Recurso Actualizado',
159
+ content:
160
+ 'Se ha actualizado el recurso ' + resourceConfig.label,
161
+ onConfirm: () => {
162
+ //resourceConfig.refreshAfter && refresh();
163
+ switch (resourceConfig.redirectAfterUpdate) {
164
+ case false:
165
+ return;
166
+ case 'view':
167
+ redirect(
168
+ '/' + resourceConfig.model + '/' + data.id + '/show',
169
+ );
170
+ break;
171
+ case 'edit':
172
+ redirect('/' + resourceConfig.model + '/' + data.id);
173
+ break;
174
+ case 'list':
175
+ default:
176
+ redirect('/' + resourceConfig.model);
177
+ break;
178
+ }
179
+ },
180
+ onClose: () => { },
181
+ });
182
+ }
183
+
184
+ if (!_showDialogAfterSubmit && resourceConfig.redirectAfterUpdate) {
185
+ switch (resourceConfig.redirectAfterUpdate) {
186
+ case 'view':
187
+ redirect(
188
+ '/' + resourceConfig.model + '/' + data.id + '/show',
189
+ );
190
+ break;
191
+ case 'edit':
192
+ redirect('/' + resourceConfig.model + '/' + data.id);
193
+ break;
194
+ case 'list':
195
+ default:
196
+ redirect('/' + resourceConfig.model);
197
+ break;
198
+ }
199
+ }
200
+
201
+ if (resourceConfig.refreshAfter) {
202
+ refresh();
203
+ }
204
+ }; const onError = (error: any) => {
205
+ //notify(`Error!`);
206
+ showError(error);
207
+ };
208
+
209
+ return (
210
+ <ResourceLayout resourceConfig={resourceConfig}>
211
+ {resourceConfig.listComponent ? (
212
+ resourceConfig.listComponent(resourceConfig, onSubmit, onError)
213
+ ) : (
214
+ <DashAutoList
215
+ resourceConfig={resourceConfig}
216
+ onSubmit={onSubmit}
217
+ onError={onError}
218
+ // custom form Domain project:
219
+ //stickyHeader={true}
220
+ {...(resourceConfig.Pagination && {
221
+ Pagination: resourceConfig.Pagination,
222
+ })}
223
+ />
224
+ )}
225
+ {resourceConfig.drawer && (
226
+ <DashAutoDrawer
227
+ resourceConfig={resourceConfig}
228
+ {...(resourceConfig.drawerProps && {
229
+ ...resourceConfig.drawerProps,
230
+ })}
231
+ />
232
+ )}
233
+ </ResourceLayout>
234
+ );
235
+ }}
236
+ edit={
237
+ _edit &&
238
+ (() => {
239
+ useEffect(() => {
240
+ console.log('EDIT', resourceConfig);
241
+ }, []);
242
+
243
+ const notify = useNotify();
244
+ const redirect = useRedirect();
245
+ const dialog = useDialog();
246
+ const refresh = useRefresh();
247
+ //const location = useLocation();
248
+
249
+ const onEdit = (data: any) => {
250
+ if (_showNotifyAfterSubmit) {
251
+ notify('Recurso Editado');
252
+ }
253
+ if (_showDialogAfterSubmit) {
254
+ dialog({
255
+ variant: 'info',
256
+ title: 'Recurso Actualizado',
257
+ content:
258
+ 'Se ha actualizado el recurso ' + resourceConfig.label,
259
+ onConfirm: () => {
260
+ //resourceConfig.refreshAfter && refresh();
261
+ switch (resourceConfig.redirectAfterUpdate) {
262
+ case false:
263
+ return;
264
+ case 'view':
265
+ redirect(
266
+ '/' + resourceConfig.model + '/' + data.id + '/show',
267
+ );
268
+ break;
269
+ case 'edit':
270
+ redirect('/' + resourceConfig.model + '/' + data.id);
271
+ break;
272
+ case 'list':
273
+ default:
274
+ redirect('/' + resourceConfig.model);
275
+ break;
276
+ }
277
+ },
278
+ onClose: () => { },
279
+ });
280
+ }
281
+
282
+ if (
283
+ !_showDialogAfterSubmit &&
284
+ resourceConfig.redirectAfterUpdate
285
+ ) {
286
+ switch (resourceConfig.redirectAfterUpdate) {
287
+ case 'view':
288
+ redirect(
289
+ '/' + resourceConfig.model + '/' + data.id + '/show',
290
+ );
291
+ break;
292
+ case 'edit':
293
+ redirect('/' + resourceConfig.model + '/' + data.id);
294
+ break;
295
+ case 'list':
296
+ default:
297
+ redirect('/' + resourceConfig.model);
298
+ break;
299
+ }
300
+ }
301
+
302
+ if (resourceConfig.refreshAfter) {
303
+ refresh();
304
+ }
305
+ }; const onError = (error: any) => {
306
+ //notify(`Error!`);
307
+ showError(error);
308
+ };
309
+
310
+ const onBeforeSubmit = (values: any) => {
311
+ return resourceConfig.beforeSubmit
312
+ ? resourceConfig.beforeSubmit(values)
313
+ : values;
314
+ };
315
+
316
+ const ToolBar = () => {
317
+ return (
318
+ <Toolbar>
319
+ <DashAutoAdminSaveButton
320
+ resourceConfig={resourceConfig}
321
+ alwaysEnable={
322
+ resourceConfig?.saveButtonAlwaysEnabled === true
323
+ ? true
324
+ : false
325
+ }
326
+
327
+ />
328
+ </Toolbar>
329
+ );
330
+ };
331
+
332
+ return resourceConfig.editComponent ? (
333
+ <ResourceLayout resourceConfig={resourceConfig}>
334
+ <Edit>
335
+ {' '}
336
+ <SimpleForm reValidateMode="onBlur">
337
+ {resourceConfig.editComponent(resourceConfig)}
338
+ </SimpleForm>
339
+ </Edit>
340
+ {resourceConfig.drawer && (
341
+ <DashAutoDrawer
342
+ onError={onError}
343
+ onSubmit={onEdit}
344
+ resourceConfig={resourceConfig}
345
+ {...(resourceConfig.drawerProps && {
346
+ ...resourceConfig.drawerProps,
347
+ })}
348
+ />
349
+ )}
350
+ </ResourceLayout>
351
+ ) : (
352
+ <ResourceLayout resourceConfig={resourceConfig}>
353
+ <DashAutoEdit
354
+ toolbar={<ToolBar />}
355
+ onError={onError}
356
+ onSubmit={onEdit}
357
+ beforeSubmit={onBeforeSubmit}
358
+ resourceConfig={resourceConfig}
359
+ />
360
+ {resourceConfig.drawer && (
361
+ <DashAutoDrawer
362
+ onError={onError}
363
+ onSubmit={onEdit}
364
+ resourceConfig={resourceConfig}
365
+ {...(resourceConfig.drawerProps && {
366
+ ...resourceConfig.drawerProps,
367
+ })}
368
+ />
369
+ )}
370
+ </ResourceLayout>
371
+ );
372
+ })
373
+ }
374
+ create={
375
+ _create &&
376
+ (() => {
377
+ const notify = useNotify();
378
+ const redirect = useRedirect();
379
+ const refresh = useRefresh();
380
+ //console.log("CREATE", resourceConfig)
381
+ const dialog = useDialog();
382
+
383
+ const onCreate = (data: any) => {
384
+ if (_showNotifyAfterSubmit) {
385
+ notify('Recurso Creado');
386
+ }
387
+ if (_showDialogAfterSubmit) {
388
+ dialog({
389
+ variant: 'info',
390
+ title: 'Recurso Creado',
391
+ content: 'Se ha creado el recurso ' + resourceConfig.label,
392
+ onConfirm: () => {
393
+ switch (resourceConfig?.redirectAfterCreate) {
394
+ case false:
395
+ return;
396
+ case 'view':
397
+ redirect(
398
+ '/' + resourceConfig.model + '/' + data.id + '/show',
399
+ );
400
+ break;
401
+ case 'edit':
402
+ redirect('/' + resourceConfig.model + '/' + data.id);
403
+ break;
404
+ case 'list':
405
+ default:
406
+ redirect('/' + resourceConfig.model);
407
+ break;
408
+ }
409
+ },
410
+ onClose: () => { },
411
+ });
412
+ }
413
+
414
+ if (
415
+ !_showDialogAfterSubmit &&
416
+ resourceConfig.redirectAfterCreate
417
+ ) {
418
+ switch (resourceConfig?.redirectAfterCreate) {
419
+ case 'view':
420
+ redirect(
421
+ '/' + resourceConfig.model + '/' + data.id + '/show',
422
+ );
423
+ break;
424
+ case 'edit':
425
+ redirect('/' + resourceConfig.model + '/' + data.id);
426
+ break;
427
+ case 'list':
428
+ default:
429
+ redirect('/' + resourceConfig.model);
430
+ break;
431
+ }
432
+ }
433
+
434
+ if (resourceConfig.refreshAfter) {
435
+ refresh();
436
+ }
437
+ };
438
+
439
+ const onError = (error: any) => {
440
+ //notify(`Error!`);
441
+
442
+ showError(error);
443
+ };
444
+
445
+ const onBeforeSubmit = (values: any) => {
446
+ return resourceConfig.beforeSubmit
447
+ ? resourceConfig.beforeSubmit(values)
448
+ : values;
449
+ };
450
+
451
+ const ToolBar = () => {
452
+ return (
453
+ <Toolbar>
454
+ <DashAutoAdminSaveButton
455
+ resourceConfig={resourceConfig}
456
+ alwaysEnable={
457
+ resourceConfig?.saveButtonAlwaysEnabled === true
458
+ ? true
459
+ : false
460
+ }
461
+
462
+ />
463
+ </Toolbar>
464
+ );
465
+ };
466
+
467
+ return resourceConfig.createComponent ? (
468
+ <ResourceLayout resourceConfig={resourceConfig}>
469
+ <Create>
470
+ <SimpleForm reValidateMode="onBlur">
471
+ {resourceConfig.createComponent(resourceConfig)}
472
+ </SimpleForm>
473
+ </Create>
474
+ {resourceConfig.drawer && (
475
+ <DashAutoDrawer
476
+ resourceConfig={resourceConfig}
477
+ {...(resourceConfig.drawerProps && {
478
+ ...resourceConfig.drawerProps,
479
+ })}
480
+ />
481
+ )}
482
+ </ResourceLayout>
483
+ ) : (
484
+ <ResourceLayout resourceConfig={resourceConfig}>
485
+ <DashAutoCreate
486
+ toolbar={<ToolBar />}
487
+ onError={onError}
488
+ onSubmit={onCreate}
489
+ beforeSubmit={onBeforeSubmit}
490
+ resourceConfig={resourceConfig}
491
+ />
492
+ {resourceConfig.drawer && (
493
+ <DashAutoDrawer
494
+ resourceConfig={resourceConfig}
495
+ {...(resourceConfig.drawerProps && {
496
+ ...resourceConfig.drawerProps,
497
+ })}
498
+ />
499
+ )}
500
+ </ResourceLayout>
501
+ );
502
+ })
503
+ }
504
+ show={() => {
505
+ const ShowActions = ({ edit }) => (
506
+ <TopToolbar sx={{ mb: 2 }} >{edit !== false && <EditButton />}</TopToolbar>
507
+ );
508
+
509
+ return resourceConfig.showComponent ? (
510
+ <ResourceLayout resourceConfig={resourceConfig}>
511
+ <Show
512
+ title={
513
+ <DashAutoTitle
514
+ //schema={resourceConfig.showSchema ? resourceConfig.showSchema : resourceConfig.schema}
515
+ resourceConfig={resourceConfig}
516
+ />
517
+ }
518
+ actions={<ShowActions edit={resourceConfig.edit} />}
519
+ >
520
+ {resourceConfig.showComponent(resourceConfig)}
521
+ </Show>
522
+ {resourceConfig.drawer && (
523
+ <DashAutoDrawer
524
+ resourceConfig={resourceConfig}
525
+ {...(resourceConfig.drawerProps && {
526
+ ...resourceConfig.drawerProps,
527
+ })}
528
+ />
529
+ )}
530
+ </ResourceLayout>
531
+ ) : (
532
+ <ResourceLayout resourceConfig={resourceConfig}>
533
+ <Show
534
+ title={
535
+ <DashAutoTitle
536
+ //schema={resourceConfig.showSchema ? resourceConfig.showSchema : resourceConfig.schema}
537
+ resourceConfig={resourceConfig}
538
+ />
539
+ }
540
+ actions={<ShowActions edit={resourceConfig.edit} />}
541
+ >
542
+ <TabbedShowLayout syncWithLocation={false}>
543
+ {DashAutoTabs(resourceConfig)}
544
+ {resourceConfig.references &&
545
+ resourceConfig.references.map((reference) =>
546
+ DashAutoReferenceTab(reference),
547
+ )}
548
+ </TabbedShowLayout>
549
+ </Show>
550
+ {resourceConfig.drawer && (
551
+ <DashAutoDrawer
552
+ resourceConfig={resourceConfig}
553
+ {...(resourceConfig.drawerProps && {
554
+ ...resourceConfig.drawerProps,
555
+ })}
556
+ />
557
+ )}
558
+ </ResourceLayout>
559
+ );
560
+ }}
561
+ /* @ts-ignore */
562
+ icon={resourceConfig.icon}
563
+ />
564
+ </DashResourceProvider>
565
+ );
566
+ };
567
+ export default ResourceTemplate;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as u}from"react/jsx-runtime";import{DashAutoDrawer as s}from"@dashadmin/dash-auto-admin";import c from"@dashadmin/dash-auto-admin/src/DashAutoShow";import a from"../layout/ResoureLayout";const D=t=>{const{resourceConfig:o,locale:r}=t;return o.showComponent?u(a,{resourceConfig:o,locale:r,children:[e(c,{resourceConfig:o,locale:r}),o.drawer&&e(s,{resourceConfig:o,...o.drawerProps&&{...o.drawerProps}})]}):u(a,{resourceConfig:o,locale:r,children:[e(c,{resourceConfig:o,locale:r}),o.drawer&&e(s,{resourceConfig:o,...o.drawerProps&&{...o.drawerProps}})]})};export{D as ResourceTemplateShow};
@@ -0,0 +1 @@
1
+ import{Fragment as g,jsx as t,jsxs as V}from"react/jsx-runtime";import{Resource as v}from"react-admin";import{useListContext as w}from"react-admin";import{useState as n}from"react";import{useRefresh as x,useTranslate as P}from"react-admin";import{useUnselectAll as E}from"react-admin";import{Button as f}from"react-admin";import{Confirm as p}from"react-admin";import{useDialog as G}from"@dashadmin/dash-dialog";import{initAxios as $}from"../hooks/axios";import{ResourceTemplateList as S}from"./ResourceTemplateList";const U=(a,h)=>{const C=()=>{const i=$(),m=G(),{selectedIds:c}=w(),d=x(),o=P(),u=E(e.model),[D,s]=n(!1),[b,l]=n(!1),y=()=>l(!0),R=()=>l(!1),A=()=>{k(),l(!1)},[M,q]=n(!1),[L,r]=n(!1),_=()=>r(!0),B=()=>r(!1),I=()=>{O(),r(!1)},k=async()=>{s(!0);try{await i.post(`${e.model}/updateMany`,{ids:c}),s(!1),d(),u(),m({variant:"info",title:o("dash.resource.updated"),content:o("dash.resource.updated_message",{label:o(e.label,{_:e.label})}),onConfirm:()=>{},onClose:()=>{}})}catch{s(!1)}},O=async()=>{s(!0);try{await i.post(`${e.model}/deleteMany`,{ids:c}),s(!1),d(),u(),m({variant:"info",title:o("dash.resource.updated"),content:o("dash.resource.updated_message",{label:o(e.label,{_:e.label})}),onConfirm:()=>{},onClose:()=>{}})}catch{s(!1)}};return V(g,{children:[t(f,{label:o("dash.action.restore"),onClick:y}),t(p,{isOpen:b,loading:D,title:o("dash.action.restore"),content:o("dash.message.are_you_sure"),onConfirm:A,onClose:R}),t(f,{label:o("ra.action.delete"),onClick:_}),t(p,{isOpen:L,loading:M,title:o("ra.action.delete"),content:o("dash.message.are_you_sure"),onConfirm:I,onClose:B})]})},e={...a,model:a.model+"/trash",listDeleteButton:{enabled:!0,props:{label:"Eliminar definitivamente"}},listEditButton:{enabled:!1},listViewButton:{enabled:!1},customListButtons:null,dataGridProps:{...a.dataGridProps,bulkActionButtons:t(C,{})}};return t(v,{options:{label:e.label,group:e.group},name:e.model,list:()=>t(g,{children:t(S,{resourceConfig:e,locale:h})}),icon:e.icon})};var me=U;export{me as default};
@@ -0,0 +1 @@
1
+ import{jsx as a}from"react/jsx-runtime";import{TableContainer as o}from"@mui/material";import s from"@mui/icons-material/Person";import{SelectInput as i}from"react-admin";import{ImageInput as l}from"react-admin";import{SelectArrayInput as n}from"react-admin";import m from"./templates/ResourceTemplate";import{DASHAppConstants as r}from"@dashadmin/dash-constants";const u={drawer:!0,drawerOptions:{view:!0,edit:!1,create:!1},listViewButton:{props:{buttonProps:{variant:"text",size:"small"},label:""}},listEditButton:{props:{buttonProps:{variant:"text",size:"small"},label:""}},listDeleteButton:{confirm:!0,props:{buttonProps:{variant:"text",size:"small"},label:""}}},p=[{roles:[r.system.SYSTEM_ROLE,r.system.TENANT_ROLE],component:m,trash:!0,model:"system/user",group:"resource.groups.system_resources",label:"Usuarios",referenceFilters:[{id:"search",label:"Buscar",source:"q",reference:null,optionText:"",alwaysOn:!0}],schema:[{label:"Nombre",attribute:"name",type:String,tab:"Datos Usuario"},{label:"Email",attribute:"email",type:String,tab:"Datos Usuario"},{label:"Contrase\xF1a",attribute:"password",type:String,isPassword:!0,fieldProps:{fullWidth:!0},inList:!1,tab:"Contrase\xF1a",validate:t=>{if(t&&t.length<6&&t.length>1)throw Error("Min 6 caracteres")}},{label:"Confirmar Contrase\xF1a",attribute:"password_confirmation",type:String,isPassword:!0,fieldProps:{fullWidth:!0},inList:!1,tab:"Contrase\xF1a",validate:(t,e)=>{if(e?.password!==t)throw Error("Contrase\xF1as no coinciden.")}},{label:"Genear Contrase\xF1a Aleatorea Autom\xE1ticamente",attribute:"generate_password",type:Boolean,inList:!1,tab:"Contrase\xF1a"},{tab:"Datos Usuario",label:"Roles",attribute:"role_ids",type:"system/role.name",pagination:!1,multiple:!0,component:n},{attribute:"active",type:Boolean,inList:!0,label:"Activo",tab:"Datos Usuario",processor:"Boolean"},{attribute:"avatar",listAttribute:"system/userclients.avatar",type:l,inList:!1,label:"Im\xE1gen",tab:"Datos Usuario",processor:"RawFile"},{tab:"Datos Usuario",label:"Cliente",attribute:"tenant_id",type:"system/tenant.name",pagination:!1,multiple:!1,component:i,processor:"Null"}],icon:a(s,{}),redirectAfterUpdate:!1,menu:[{title:"Usuarios",redirect:"/system/user"}],mainAction:{title:"Crear usuario",redirect:"/system/user/create"},mutationMode:"pessimistic",isFormData:!1,dataGridProps:{stickyHeader:!0},dataGridWrapper:t=>a(o,{sx:{maxHeight:800},children:t.children}),postFormatter:(t,e)=>(e==="update"&&(t._method="PUT"),t.role_id=t.role_ids?t.role_ids[0]:null,t),...u}];var F=p;export{F as default};
@@ -0,0 +1 @@
1
+ import{jsx as o,jsxs as i}from"react/jsx-runtime";const r=({children:e,onTouchStart:t})=>(console.log("SidebarItem render"),i("div",{onTouchStart:n=>{console.log("Parent onTouchStart"),t&&t(n)},style:{padding:"20px",border:"1px solid black"},children:["Parent Item",e]})),l=()=>o("div",{onTouchStart:e=>{console.log("Child onTouchStart")},onClick:()=>console.log("Child Click"),style:{padding:"10px",background:"red"},children:"Child (Portaled in React tree)"});function d(){return o(r,{onTouchStart:()=>console.log("Closing menu"),children:o(l,{})})}export{d as default};
@@ -0,0 +1 @@
1
+ import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useSelector as r}from"react-redux";import l from"./components/PageTitle";import{Box as p}from"@mui/material";const m=({children:o,...i})=>{const e=r(a=>a.page),s=r(a=>a.common.headerToolBar);return n(p,{className:"dash-header",sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1},children:[o||t(l,{className:"dash-header-title dash-d-lg-block",avatar:e.icon,title:e.title,subTitle:e.subTitle}),t(p,{className:"dash-header-items",sx:{display:"flex",alignItems:"center",ml:"auto"},children:t(s,{})})]})};var T=m;export{T as default};
@@ -0,0 +1 @@
1
+ var Y=Object.defineProperty;var D=(A,T,N)=>T in A?Y(A,T,{enumerable:!0,configurable:!0,writable:!0,value:N}):A[T]=N;var E=(A,T,N)=>D(A,typeof T!="symbol"?T+"":T,N);class _{}E(_,"TAB_SIZE",992),E(_,"MOBILE_SIZE",575),E(_,"THEME_TYPE","THEME_TYPE"),E(_,"THEME_TYPE_LIGHT","light"),E(_,"THEME_TYPE_DARK","dark"),E(_,"THEME_TYPE_DASH_DEFAULT","light"),E(_,"THEME_TYPE_SEMI_DARK","THEME_TYPE_SEMI_DARK"),E(_,"THEME_COLOR","THEME_COLOR"),E(_,"UPDATE_RTL_STATUS","UPDATE_RTL_STATUS"),E(_,"LAYOUT_TYPE","LAYOUT_TYPE"),E(_,"LAYOUT_TYPE_FRAMED","framed-layout"),E(_,"LAYOUT_TYPE_BOXED","boxed-layout"),E(_,"LAYOUT_TYPE_FULL","full-layout"),E(_,"NAV_STYLE","NAV_STYLE"),E(_,"NAV_STYLE_FIXED","NAV_STYLE_FIXED"),E(_,"NAV_STYLE_MINI_SIDEBAR","NAV_STYLE_MINI_SIDEBAR"),E(_,"NAV_STYLE_DRAWER","NAV_STYLE_DRAWER"),E(_,"NAV_STYLE_NO_HEADER_MINI_SIDEBAR","NAV_STYLE_NO_HEADER_MINI_SIDEBAR"),E(_,"NAV_STYLE_NO_HEADER_EXPANDED_SIDEBAR","NAV_STYLE_NO_HEADER_EXPANDED_SIDEBAR"),E(_,"NAV_STYLE_DEFAULT_HORIZONTAL","NAV_STYLE_DEFAULT_HORIZONTAL"),E(_,"NAV_STYLE_DARK_HORIZONTAL","NAV_STYLE_DARK_HORIZONTAL"),E(_,"NAV_STYLE_INSIDE_HEADER_HORIZONTAL","NAV_STYLE_INSIDE_HEADER_HORIZONTAL"),E(_,"NAV_STYLE_BELOW_HEADER","NAV_STYLE_BELOW_HEADER"),E(_,"NAV_STYLE_ABOVE_HEADER","NAV_STYLE_ABOVE_HEADER"),E(_,"NAV_STYLE_COLLAPSABLE","NAV_STYLE_COLLAPSABLE");var O=_;export{O as default};
@@ -0,0 +1 @@
1
+ const p=({type:o="logo",horizontalLogo:e,squaredLogo:t})=>o==="logo"?e:t;var a=p;export{a as default};
@@ -0,0 +1 @@
1
+ import{Fragment as a,jsx as p}from"react/jsx-runtime";const e=({children:t,navStyle:r,...d})=>p(a,{children:"Deprecated"});var n=e;export{n as default};
@@ -0,0 +1 @@
1
+ import{Fragment as _,jsx as e,jsxs as s}from"react/jsx-runtime";import c from"./AppSidebarLogo";import{useSelector as E}from"react-redux";import o from"./AppLayoutSetting";import A from"@mui/icons-material/MenuOpen";import S from"@mui/icons-material/Menu";const l=({sidebarExpanded:a,setSidebarExpanded:t,navStyle:i,themeType:u,logo:m,squaredLogo:p,children:r,...L})=>{const d=E(n=>n.common.pathname),N=n=>n===o.NAV_STYLE_NO_HEADER_MINI_SIDEBAR||n===o.NAV_STYLE_NO_HEADER_EXPANDED_SIDEBAR?"dash-no-header-notifications":"",f=d.substr(1);return s(_,{children:[e(c,{sidebarExpanded:a,setSidebarExpanded:t,logo:m,squaredLogo:p}),s("div",{className:"sidebar-content",children:[i!=o.NAV_STYLE_COLLAPSABLE&&i===o.NAV_STYLE_FIXED?e("div",{className:"dash-linebar",children:e("div",{className:"sidebar-icon",children:e("i",{className:"sidebar-menu",onClick:()=>{t(!a)},children:a?e(A,{sx:{fontSize:24}}):e(S,{sx:{fontSize:24}})})})}):null,i===o.NAV_STYLE_COLLAPSABLE?e("div",{onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1),children:r}):r]})]})};var M=l;export{M as default};
@@ -0,0 +1 @@
1
+ import{jsx as o}from"react/jsx-runtime";import a from"./AppLogo";const p=({logo:e,sidebarExpanded:d,squaredLogo:r,setSidebarExpanded:t,...i})=>o("div",{className:"dash-layout-sider-header",children:d?o(a,{type:"iso",logoBig:e,squaredLogo:r}):o(a,{type:"logo",logoBig:e,squaredLogo:r})});var b=p;export{b as default};
@@ -0,0 +1 @@
1
+ import{Fragment as l,jsx as t,jsxs as o}from"react/jsx-runtime";const d=({avatar:h,title:e,subTitle:a,className:r,extra:i,children:s,...n})=>!e||e===""?t(l,{}):o("div",{className:`dash-page-header ${r||""}`,...n,children:[t("h3",{children:e}),t("b",{children:a}),s||i]});var P=d;export{P as default};
@@ -0,0 +1 @@
1
+ var x=Object.defineProperty;var u=(t,e,a)=>e in t?x(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var s=(t,e,a)=>u(t,typeof e!="symbol"?e+"":e,a);import{jsx as y}from"react/jsx-runtime";import p,{useContext as S}from"react";import g from"../../hooks/useLocalStorage";import{dashStorage as i}from"@dashadmin/dash-utils";const l=()=>{const t=new Date;return t.getFullYear()+""+(t.getMonth()+1)+t.getDate()+t.getHours()+t.getMinutes()+t.getSeconds()};class f{}s(f,"values");const P={cacheInvalidatorStore:{}},o=p.createContext(null),W=t=>{const{children:e,values:a}=t,C=JSON.stringify(a||P),[I,v]=g("SerializedCacheInvalidatorContext",C),h=c=>{v(n=>{const r=typeof n=="string"?JSON.parse(n):n;return r.cacheInvalidatorStore=r.cacheInvalidatorStore?{...r.cacheInvalidatorStore,[c]:l()}:{[c]:l()},r})};return y(o.Provider,{value:{...I,updateEntry:h},children:e})},D=o.Consumer,H=()=>S(o),d=()=>JSON.parse(i.getItem("SerializedCacheInvalidatorContext"));function m(t,e){return Object.keys(t).filter(a=>e.includes(a))}const M=t=>{const e=d();if(!e)return null;const a=m(e.cacheInvalidatorStore,t);return a?e.cacheInvalidatorStore[a[0]]:null},b=t=>{const e=d();i.setItem("SerializedCacheInvalidatorContext",JSON.stringify({...e,...t}))},k=t=>{i.setItem("SerializedCacheInvalidatorContext",JSON.stringify(t))};var w=o;export{o as CacheInvalidatorContext,f as CacheInvalidatorContextClass,D as CacheInvalidatorContextConsumer,W as CacheInvalidatorContextProvider,M as cacheInvalidatorHash,w as default,d as getCacheInvalidatorContext,k as setCacheInvalidatorContext,b as updateCacheInvalidatorContext,H as useCacheInvalidatorContext};
@@ -0,0 +1 @@
1
+ import{Fragment as r,jsx as e}from"react/jsx-runtime";import o from"./useCacheInvalidatorListener";const t=()=>{const a=o();return e(r,{})};var C=t;export{C as default};
@@ -0,0 +1 @@
1
+ import{useContext as e,useEffect as a}from"react";import r from"./CacheInvalidatorContext";import n from"../../contexts/com/LaravelEchoContext";const c=()=>{const t=e(n),{cacheInvalidatorStore:o,updateEntry:l}=e(r);return a(()=>{const i=t?.lastEvent},[t]),{cacheInvalidatorStore:o}};var x=c;export{x as default};
@@ -0,0 +1 @@
1
+ const n=r=>new Promise((o,a)=>{const e=new FileReader;e.onload=()=>o(e.result),e.onerror=a,e.readAsDataURL(r.rawFile)});var t=n;export{t as default};
@@ -0,0 +1 @@
1
+ const n=r=>new Promise((o,a)=>{const e=new FileReader;e.onload=()=>{o(e.result)},e.onerror=a,e.readAsDataURL(r.rawFile)});var l=n;export{l as default};
@@ -0,0 +1 @@
1
+ import e from"js-cookie";const c=(o,t,r={})=>{e.set(o,t,{path:"/",...r})},k=o=>{e.remove(o,{expires:1})},n=o=>s(o),s=o=>e.get(o),p=()=>{const o=e.get();Object.keys(o).forEach(t=>{e.remove(t,{path:"/"})})};export{p as clearAllCookies,n as getCookie,k as removeCookie,c as setCookie};
@@ -0,0 +1 @@
1
+ import{QueryClient as e}from"react-query";const t=new e({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:300*1e3,retry:1}}});var i=t;export{i as default};
@@ -0,0 +1 @@
1
+ function d(a){const o=";base64,",n=a.src;if(n.indexOf(o)===-1){const t=n.split(","),i=t[0].split(":")[1],l=decodeURIComponent(t[1]);return new Blob([l],{type:i})}const e=n.split(o),p=e[0].split(":")[1],s=window.atob(e[1]),r=s.length,c=new Uint8Array(r);for(let t=0;t<r;++t)c[t]=s.charCodeAt(t);return new Blob([c],{type:p})}var w=d;export{w as default};
@@ -0,0 +1 @@
1
+ const n=(t,s,i)=>{for(const f in t)f===s?t[f]=i(t[f]):Array.isArray(t[f])?t[f].forEach(e=>n(e,s,i)):typeof t[f]=="object"&&n(t[f],s,i)};var r=n;export{r as default};