@campxdev/campx-web-utils 0.4.0 → 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.4.0",
3
+ "version": "0.4.1",
4
4
  "main": "./export.ts",
5
5
  "private": false,
6
6
  "peerDependencies": {
7
- "@campxdev/react-blueprint": ">=1.6.4",
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.4",
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",
@@ -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
+ };
@@ -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';
@@ -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
+ }));