@campxdev/campx-web-utils 0.3.11 → 0.4.1
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.
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@campxdev/campx-web-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"main": "./export.ts",
|
|
5
5
|
"private": false,
|
|
6
6
|
"peerDependencies": {
|
|
7
|
-
"@campxdev/react-blueprint": ">=1.6.
|
|
7
|
+
"@campxdev/react-blueprint": ">=1.6.6",
|
|
8
8
|
"@emotion/react": ">=^11.13.3",
|
|
9
9
|
"@emotion/styled": ">=^11.13.0",
|
|
10
10
|
"@mui/icons-material": ">=6.1.5",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"react-redux": "=>9.1.2"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@campxdev/react-blueprint": "1.6.
|
|
17
|
+
"@campxdev/react-blueprint": "1.6.6",
|
|
18
18
|
"@hookform/resolvers": "^3.9.0",
|
|
19
19
|
"@mui/x-date-pickers": "^7.22.1",
|
|
20
20
|
"axios": "^1.7.2",
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { lightTheme, MuiThemeProvider
|
|
1
|
+
import { lightTheme, MuiThemeProvider } from '@campxdev/react-blueprint';
|
|
2
2
|
import { LocalizationProvider } from '@mui/x-date-pickers';
|
|
3
3
|
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3';
|
|
4
|
+
import {
|
|
5
|
+
combineReducers,
|
|
6
|
+
configureStore,
|
|
7
|
+
ReducersMapObject,
|
|
8
|
+
} from '@reduxjs/toolkit';
|
|
4
9
|
import Cookies from 'js-cookie';
|
|
5
10
|
import { ReactNode, useEffect } from 'react';
|
|
6
11
|
import { QueryClient, QueryClientProvider } from 'react-query';
|
|
@@ -13,10 +18,12 @@ export const Providers = ({
|
|
|
13
18
|
children,
|
|
14
19
|
basename,
|
|
15
20
|
theme = lightTheme,
|
|
21
|
+
reducers = {},
|
|
16
22
|
}: {
|
|
17
23
|
children: ReactNode;
|
|
18
24
|
basename?: string;
|
|
19
25
|
theme?: any;
|
|
26
|
+
reducers?: ReducersMapObject;
|
|
20
27
|
}) => {
|
|
21
28
|
const queryClient = new QueryClient({
|
|
22
29
|
defaultOptions: {
|
|
@@ -43,6 +50,10 @@ export const Providers = ({
|
|
|
43
50
|
}
|
|
44
51
|
}, [institutionCode, tenantCode]);
|
|
45
52
|
|
|
53
|
+
const store = configureStore({
|
|
54
|
+
reducer: combineReducers(reducers),
|
|
55
|
+
});
|
|
56
|
+
|
|
46
57
|
return (
|
|
47
58
|
<Provider store={store}>
|
|
48
59
|
<BrowserRouter basename={basename ?? baseName}>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SingleSelect, SingleSelectProps } from '@campxdev/react-blueprint';
|
|
2
|
+
import { batchOptions } from './utils';
|
|
3
|
+
|
|
4
|
+
export const BatchSelector = (props: SingleSelectProps) => {
|
|
5
|
+
return (
|
|
6
|
+
<SingleSelect
|
|
7
|
+
label="Batch"
|
|
8
|
+
options={batchOptions?.map((item: { label: string; value: string }) => ({
|
|
9
|
+
label: item.label,
|
|
10
|
+
value: item.value,
|
|
11
|
+
}))}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SingleSelect, SingleSelectProps } from '@campxdev/react-blueprint';
|
|
2
|
+
import { axios } from '../config/axios';
|
|
3
|
+
|
|
4
|
+
export const PrintFormatSelector = (props: SingleSelectProps) => {
|
|
5
|
+
return (
|
|
6
|
+
<SingleSelect
|
|
7
|
+
dbLabelProps={{
|
|
8
|
+
labelKey: 'name',
|
|
9
|
+
subLabelKey: 'type',
|
|
10
|
+
useSubLabelStartCase: true,
|
|
11
|
+
}}
|
|
12
|
+
{...props}
|
|
13
|
+
externalAxios={axios}
|
|
14
|
+
optionsApiEndPoint="/dropdowns/print-formats"
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
};
|
package/src/selectors/export.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
export * from './BatchSelector';
|
|
1
2
|
export * from './CourseSelector';
|
|
3
|
+
export * from './DepartmentSelector';
|
|
2
4
|
export * from './EmployeesSelector';
|
|
3
|
-
export * from './SemesterSelector';
|
|
4
5
|
export * from './FeeTypeSelector';
|
|
5
6
|
export * from './HostelFloorSelector';
|
|
6
7
|
export * from './HostelRoomSelector';
|
|
8
|
+
export * from './PrintFormatSelector';
|
|
9
|
+
export * from './SemesterSelector';
|
|
7
10
|
export * from './YearRangeSelector';
|
|
8
|
-
export * from './DepartmentSelector';
|
package/src/selectors/utils.tsx
CHANGED
|
@@ -32,3 +32,8 @@ export const FeeTypes: {
|
|
|
32
32
|
export const years = Array.from({ length: 6 }, (_, i) => {
|
|
33
33
|
return new Date().getFullYear() - i;
|
|
34
34
|
});
|
|
35
|
+
|
|
36
|
+
export const batchOptions = Array.from({ length: 12 }, (_, i) => ({
|
|
37
|
+
label: `${new Date().getFullYear() - i} - ${new Date().getFullYear() - i + 1}`,
|
|
38
|
+
value: `${new Date().getFullYear() - i} - ${new Date().getFullYear() - i + 1}`,
|
|
39
|
+
}));
|