@campxdev/shared 0.5.21 → 0.5.23

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 (69) hide show
  1. package/.eslintignore +4 -0
  2. package/.eslintrc.js +34 -0
  3. package/.prettierrc +10 -0
  4. package/exports.ts +7 -6
  5. package/package.json +64 -50
  6. package/publish.sh +2 -0
  7. package/src/assets/images/index.ts +8 -8
  8. package/src/components/Breadcrumbs.tsx +3 -3
  9. package/src/components/ChangePassword.tsx +147 -147
  10. package/src/components/DropDownButton.tsx +167 -163
  11. package/src/components/ErrorBoundary/ErrorBoundary.tsx +22 -22
  12. package/src/components/ErrorBoundary/ErrorFallback.tsx +215 -215
  13. package/src/components/ErrorBoundary/GlobalNetworkLoadingIndicator.tsx +6 -6
  14. package/src/components/ErrorBoundary/index.tsx +1 -1
  15. package/src/components/FullScreenLoader.tsx +15 -15
  16. package/src/components/HookForm/AutoCompleteSearch.tsx +0 -30
  17. package/src/components/HookForm/RadioGroup.tsx +1 -1
  18. package/src/components/IconButtons/Icons.tsx +1 -2
  19. package/src/components/Input/AutoCompleteSearch.tsx +0 -30
  20. package/src/components/Input/SingleSelect.tsx +0 -15
  21. package/src/components/Layout/Header/AppHeader.tsx +89 -89
  22. package/src/components/Layout/Header/AppsMenu.tsx +79 -79
  23. package/src/components/Layout/Header/CogWheelMenu.tsx +27 -27
  24. package/src/components/Layout/Header/UserBox.tsx +25 -25
  25. package/src/components/Layout/Header/applications.ts +79 -79
  26. package/src/components/Layout/Header/assets/index.ts +10 -10
  27. package/src/components/Layout/Header/styles.tsx +72 -72
  28. package/src/components/LayoutWrapper.tsx +6 -6
  29. package/src/components/LinearProgress.tsx +14 -14
  30. package/src/components/ListItemButton.tsx +79 -79
  31. package/src/components/LoginForm.tsx +86 -86
  32. package/src/components/MenuButton.tsx +88 -88
  33. package/src/components/ModalButtons/DialogButton.tsx +66 -66
  34. package/src/components/PageContent.tsx +10 -10
  35. package/src/components/PageNotFound.tsx +12 -12
  36. package/src/components/PopupConfirm/ConfirmContextProvider.tsx +28 -28
  37. package/src/components/PopupConfirm/PopupConfirm.tsx +27 -27
  38. package/src/components/PopupConfirm/useConfirm.ts +41 -41
  39. package/src/components/SideMenuHeader.tsx +15 -15
  40. package/src/components/SideNav.tsx +119 -119
  41. package/src/components/Spinner.tsx +14 -14
  42. package/src/components/TableComponent/ReactTable.tsx +256 -256
  43. package/src/components/TableComponent/RenderTableBody.tsx +56 -56
  44. package/src/components/TableComponent/index.tsx +171 -171
  45. package/src/components/TableComponent/react-table-config.d.ts +2 -3
  46. package/src/components/index.ts +54 -54
  47. package/src/config/axios.ts +50 -50
  48. package/src/config/axiosXTenant.ts +57 -0
  49. package/src/constants/isDevelopment.ts +2 -2
  50. package/src/contexts/LoginFormProvider.tsx +28 -28
  51. package/src/contexts/Providers.tsx +40 -40
  52. package/src/contexts/QueryClientProvider.tsx +15 -15
  53. package/src/hooks/index.ts +2 -2
  54. package/src/hooks/useAppInit.ts +23 -23
  55. package/src/hooks/useAuth.ts +78 -77
  56. package/src/layouts/Components/DashBoardMenu.tsx +77 -77
  57. package/src/layouts/Components/icons/index.tsx +32 -32
  58. package/src/layouts/Components/styles.tsx +23 -23
  59. package/src/permissions/PageWithPermission.tsx +9 -9
  60. package/src/permissions/PermissionDeniedPage.tsx +13 -13
  61. package/src/permissions/PermissionsStore.ts +303 -303
  62. package/src/shared-state/index.ts +3 -3
  63. package/src/theme/MuiThemeProvider.tsx +9 -9
  64. package/src/theme/theme.d.ts +72 -72
  65. package/src/utils/index.ts +7 -7
  66. package/src/utils/logout.ts +19 -19
  67. package/src/utils/withLocalization.tsx +8 -8
  68. package/src/utils/withRouteWrapper.tsx +20 -20
  69. package/src/utils/withSuspense.tsx +3 -3
@@ -1,3 +1,3 @@
1
- import {AssetsStore} from './AssetsStore'
2
- import {UserStore} from './UserStore'
3
- export {AssetsStore, UserStore}
1
+ import { AssetsStore } from './AssetsStore'
2
+ import { UserStore } from './UserStore'
3
+ export { AssetsStore, UserStore }
@@ -1,13 +1,13 @@
1
- import {CssBaseline, ThemeProvider} from '@mui/material'
1
+ import { CssBaseline, ThemeProvider } from '@mui/material'
2
2
  import GlobalNetworkLoadingIndicator from '../components/ErrorBoundary/GlobalNetworkLoadingIndicator'
3
3
  import muiTheme from './muiTheme'
4
4
 
5
- export default function MuiThemeProvider({children}) {
6
- return (
7
- <ThemeProvider theme={muiTheme}>
8
- {children}
9
- <CssBaseline />
10
- <GlobalNetworkLoadingIndicator />
11
- </ThemeProvider>
12
- )
5
+ export default function MuiThemeProvider({ children }) {
6
+ return (
7
+ <ThemeProvider theme={muiTheme}>
8
+ {children}
9
+ <CssBaseline />
10
+ <GlobalNetworkLoadingIndicator />
11
+ </ThemeProvider>
12
+ )
13
13
  }
@@ -1,75 +1,75 @@
1
- import {ThemeOptions as MuiThemeOptions} from '@mui/material/styles'
1
+ import { ThemeOptions as MuiThemeOptions } from '@mui/material/styles'
2
2
 
3
3
  declare module '@mui/material/styles' {
4
- interface Theme {
5
- borders: {
6
- grayLight: string
7
- primary: string
8
- }
9
- palette: {
10
- primary: {
11
- dark: string
12
- main: string
13
- light: string
14
- lighter: string
15
- }
16
- secondary: {
17
- main: string
18
- light: string
19
- dark: string
20
- lighter: string
21
- }
22
- common: {
23
- black: string
24
- white: string
25
- green: string
26
- yellow: string
27
- blue: string
28
- }
29
- error: {
30
- main: string
31
- }
32
- text: {
33
- primary: string
34
- secondary: string
35
- disabled: string
36
- }
37
- }
38
- }
39
- // allow configuration using `createTheme`
40
- interface CustomThemeOptions extends MuiThemeOptions {
41
- borders?: {
42
- grayLight?: string
43
- }
44
- palette: {
45
- secondary?: {
46
- main?: string
47
- light?: string
48
- dark?: string
49
- lighter?: string
50
- }
51
- primary?: {
52
- dark?: string
53
- main?: string
54
- light?: string
55
- lighter?: string
56
- }
57
- common?: {
58
- black?: string
59
- white?: string
60
- green?: string
61
- yellow?: string
62
- blue?: string
63
- }
64
- error?: {
65
- main?: string
66
- }
67
- text?: {
68
- primary?: string
69
- secondary?: string
70
- disabled?: string
71
- }
72
- }
73
- }
74
- export function createTheme(options?: CustomThemeOptions): CustomTheme
4
+ interface Theme {
5
+ borders: {
6
+ grayLight: string
7
+ primary: string
8
+ }
9
+ palette: {
10
+ primary: {
11
+ dark: string
12
+ main: string
13
+ light: string
14
+ lighter: string
15
+ }
16
+ secondary: {
17
+ main: string
18
+ light: string
19
+ dark: string
20
+ lighter: string
21
+ }
22
+ common: {
23
+ black: string
24
+ white: string
25
+ green: string
26
+ yellow: string
27
+ blue: string
28
+ }
29
+ error: {
30
+ main: string
31
+ }
32
+ text: {
33
+ primary: string
34
+ secondary: string
35
+ disabled: string
36
+ }
37
+ }
38
+ }
39
+ // allow configuration using `createTheme`
40
+ interface CustomThemeOptions extends MuiThemeOptions {
41
+ borders?: {
42
+ grayLight?: string
43
+ }
44
+ palette: {
45
+ secondary?: {
46
+ main?: string
47
+ light?: string
48
+ dark?: string
49
+ lighter?: string
50
+ }
51
+ primary?: {
52
+ dark?: string
53
+ main?: string
54
+ light?: string
55
+ lighter?: string
56
+ }
57
+ common?: {
58
+ black?: string
59
+ white?: string
60
+ green?: string
61
+ yellow?: string
62
+ blue?: string
63
+ }
64
+ error?: {
65
+ main?: string
66
+ }
67
+ text?: {
68
+ primary?: string
69
+ secondary?: string
70
+ disabled?: string
71
+ }
72
+ }
73
+ }
74
+ export function createTheme(options?: CustomThemeOptions): CustomTheme
75
75
  }
@@ -1,8 +1,8 @@
1
- export {default as getUrlParams} from './getUrlParams'
2
- export {default as arrayPadEnd} from './arrayPadEnd'
3
- export {default as romanize} from './romanize'
1
+ export { default as getUrlParams } from './getUrlParams'
2
+ export { default as arrayPadEnd } from './arrayPadEnd'
3
+ export { default as romanize } from './romanize'
4
4
 
5
- export {default as withRouteWrapper} from './withRouteWrapper'
6
- export {default as withSuspense} from './withSuspense'
7
- export {default as withLocalization} from './withLocalization'
8
- export {default as onLogout} from './logout'
5
+ export { default as withRouteWrapper } from './withRouteWrapper'
6
+ export { default as withSuspense } from './withSuspense'
7
+ export { default as withLocalization } from './withLocalization'
8
+ export { default as onLogout } from './logout'
@@ -1,24 +1,24 @@
1
1
  import Cookies from 'js-cookie'
2
- import axios, {axiosErrorToast} from '../config/axios'
3
- import {isDevelopment} from '../constants'
2
+ import axios, { axiosErrorToast } from '../config/axios'
3
+ import { isDevelopment } from '../constants'
4
4
 
5
5
  export default function logout() {
6
- if (isDevelopment) {
7
- Cookies.remove('campx_session_key')
8
- window.location.href = window.location.origin + '/campx_dev'
9
- return
10
- }
6
+ if (isDevelopment) {
7
+ Cookies.remove('campx_session_key')
8
+ window.location.href = window.location.origin + '/campx_dev'
9
+ return
10
+ }
11
11
 
12
- axios({
13
- method: 'POST',
14
- baseURL: 'https://auth-api.campx.in',
15
- url: '/auth/logout',
16
- })
17
- .then((res) => {
18
- Cookies.remove('campx_tenant')
19
- window.location.href = 'https://id.campx.in'
20
- })
21
- .catch((err) => {
22
- axiosErrorToast('Unable To Logout.')
23
- })
12
+ axios({
13
+ method: 'POST',
14
+ baseURL: 'https://auth-api.campx.in',
15
+ url: '/auth/logout',
16
+ })
17
+ .then((res) => {
18
+ Cookies.remove('campx_tenant')
19
+ window.location.href = 'https://id.campx.in'
20
+ })
21
+ .catch((err) => {
22
+ axiosErrorToast('Unable To Logout.')
23
+ })
24
24
  }
@@ -1,11 +1,11 @@
1
- import {LocalizationProvider} from '@mui/x-date-pickers'
2
- import {AdapterMoment} from '@mui/x-date-pickers/AdapterMoment'
3
- import {ReactNode} from 'react'
1
+ import { LocalizationProvider } from '@mui/x-date-pickers'
2
+ import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment'
3
+ import { ReactNode } from 'react'
4
4
 
5
5
  export default function withLocalization(component: ReactNode) {
6
- return (
7
- <LocalizationProvider dateAdapter={AdapterMoment}>
8
- {component}
9
- </LocalizationProvider>
10
- )
6
+ return (
7
+ <LocalizationProvider dateAdapter={AdapterMoment}>
8
+ {component}
9
+ </LocalizationProvider>
10
+ )
11
11
  }
@@ -1,25 +1,25 @@
1
- import {Suspense} from 'react'
1
+ import { Suspense } from 'react'
2
2
  import PageWithPermission from '../permissions/PageWithPermission'
3
- import {LinearProgress} from '../components/LinearProgress'
3
+ import { LinearProgress } from '../components/LinearProgress'
4
4
 
5
5
  const withRouteWrapper = (routes) => {
6
- return routes?.map((item, index) => {
7
- if (item?.children) {
8
- return {
9
- ...item,
10
- children: withRouteWrapper(item.children),
11
- }
12
- }
13
- return {
14
- ...item,
15
- element: item?.element ? (
16
- <Suspense fallback={<LinearProgress />} key={index}>
17
- <PageWithPermission permissionKey={item?.permissionKey}>
18
- {item.element}
19
- </PageWithPermission>
20
- </Suspense>
21
- ) : undefined,
22
- }
23
- })
6
+ return routes?.map((item, index) => {
7
+ if (item?.children) {
8
+ return {
9
+ ...item,
10
+ children: withRouteWrapper(item.children),
11
+ }
12
+ }
13
+ return {
14
+ ...item,
15
+ element: item?.element ? (
16
+ <Suspense fallback={<LinearProgress />} key={index}>
17
+ <PageWithPermission permissionKey={item?.permissionKey}>
18
+ {item.element}
19
+ </PageWithPermission>
20
+ </Suspense>
21
+ ) : undefined,
22
+ }
23
+ })
24
24
  }
25
25
  export default withRouteWrapper
@@ -1,6 +1,6 @@
1
- import {LinearProgress, Spinner} from '../components'
2
- import {ReactNode, Suspense} from 'react'
1
+ import { LinearProgress, Spinner } from '../components'
2
+ import { ReactNode, Suspense } from 'react'
3
3
 
4
4
  export default function withSuspense(component: ReactNode) {
5
- return <Suspense fallback={<LinearProgress />}>{component}</Suspense>
5
+ return <Suspense fallback={<LinearProgress />}>{component}</Suspense>
6
6
  }