@appcorp/fusion-storybook 0.2.13 → 0.2.15

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 (58) hide show
  1. package/base-modules/admission/context/use-admission-module.d.ts +88 -0
  2. package/base-modules/admission/context/use-admission-module.js +771 -0
  3. package/base-modules/admission/context.d.ts +1 -87
  4. package/base-modules/admission/context.js +3 -769
  5. package/base-modules/attendance/more-actions.js +7 -2
  6. package/base-modules/campus/more-actions.js +0 -1
  7. package/base-modules/class/more-actions.js +1 -6
  8. package/base-modules/enrollment/context.d.ts +1 -13
  9. package/base-modules/enrollment/context.js +0 -3
  10. package/base-modules/enrollment/form.js +2 -6
  11. package/base-modules/enrollment/page.d.ts +0 -1
  12. package/base-modules/enrollment/page.js +5 -13
  13. package/base-modules/enrollment/validate.d.ts +0 -1
  14. package/base-modules/enrollment/validate.js +0 -1
  15. package/base-modules/enrollment/view.js +4 -7
  16. package/base-modules/expense/more-actions.js +1 -6
  17. package/base-modules/fee-structure/more-actions.js +1 -6
  18. package/base-modules/student-fee/context/shared.d.ts +178 -0
  19. package/base-modules/student-fee/context/shared.js +59 -0
  20. package/base-modules/student-fee/context/use-student-fee-module.d.ts +64 -0
  21. package/base-modules/student-fee/context/use-student-fee-module.js +610 -0
  22. package/base-modules/student-fee/context.d.ts +21 -235
  23. package/base-modules/student-fee/context.js +2 -674
  24. package/base-modules/student-fee/more-actions.js +1 -6
  25. package/base-modules/student-profile/constants.js +7 -3
  26. package/base-modules/student-profile/context/module-base.d.ts +187 -0
  27. package/base-modules/student-profile/context/module-base.js +50 -0
  28. package/base-modules/student-profile/context/use-student-profile-module.d.ts +70 -0
  29. package/base-modules/student-profile/context/use-student-profile-module.js +506 -0
  30. package/base-modules/student-profile/context.d.ts +20 -256
  31. package/base-modules/student-profile/context.js +2 -601
  32. package/base-modules/teacher/avatar-upload.js +1 -4
  33. package/base-modules/teacher/more-actions.js +1 -6
  34. package/base-modules/user/context/use-user-module.d.ts +53 -0
  35. package/base-modules/user/context/use-user-module.js +546 -0
  36. package/base-modules/user/context.d.ts +1 -52
  37. package/base-modules/user/context.js +5 -547
  38. package/base-modules/workspace-user/more-actions.js +1 -6
  39. package/components/module-error.d.ts +9 -0
  40. package/components/module-error.js +3 -0
  41. package/package.json +5 -4
  42. package/tsconfig.build.tsbuildinfo +1 -1
  43. package/type.d.ts +3 -1242
  44. package/type.js +3 -445
  45. package/types/academics.d.ts +262 -0
  46. package/types/academics.js +8 -0
  47. package/types/admission.d.ts +85 -0
  48. package/types/admission.js +6 -0
  49. package/types/communication.d.ts +165 -0
  50. package/types/communication.js +7 -0
  51. package/types/enums.d.ts +411 -0
  52. package/types/enums.js +442 -0
  53. package/types/finance.d.ts +126 -0
  54. package/types/finance.js +7 -0
  55. package/types/index.d.ts +12 -0
  56. package/types/index.js +12 -0
  57. package/types/user-management.d.ts +236 -0
  58. package/types/user-management.js +7 -0
@@ -33,7 +33,6 @@ export const StudentFeeMoreActions = () => {
33
33
  {
34
34
  id: "3",
35
35
  title: t("uploadTheCompletedCsvToTheSystem"),
36
- handleOnClick: () => console.log("clicked"),
37
36
  },
38
37
  ];
39
38
  const update = [
@@ -46,11 +45,7 @@ export const StudentFeeMoreActions = () => {
46
45
  },
47
46
  },
48
47
  { id: "2", title: t("updateYourDataInTheCsv") },
49
- {
50
- id: "3",
51
- title: t("uploadTheCompletedCsvToTheSystem"),
52
- handleOnClick: () => console.log("clicked"),
53
- },
48
+ { id: "3", title: t("uploadTheCompletedCsvToTheSystem") },
54
49
  ];
55
50
  return (_jsxs("div", { className: "space-y-4", children: [_jsx(Timeline, { events: create, heading: t("bulkCreate") }), _jsx(Timeline, { events: update, heading: t("bulkUpdate") })] }));
56
51
  };
@@ -59,14 +59,18 @@ export const tableBodyCols = [
59
59
  componentType: COMPONENT_TYPE.TEXT,
60
60
  key: "enrollments",
61
61
  textFormatter: (value) => {
62
- var _a;
62
+ var _a, _b, _c, _d;
63
63
  const enrollments = value;
64
64
  if (!enrollments || enrollments.length === 0)
65
65
  return "No enrollments";
66
66
  if (enrollments.length === 1) {
67
- return ((_a = enrollments[0].course) === null || _a === void 0 ? void 0 : _a.code) || "Unknown course";
67
+ const section = enrollments[0].section;
68
+ const courseCount = (_b = (_a = section === null || section === void 0 ? void 0 : section.courses) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
69
+ return courseCount > 0
70
+ ? `${(_c = section === null || section === void 0 ? void 0 : section.name) !== null && _c !== void 0 ? _c : "Section"} (${courseCount} subjects)`
71
+ : (_d = section === null || section === void 0 ? void 0 : section.name) !== null && _d !== void 0 ? _d : "Enrolled";
68
72
  }
69
- return `${enrollments.length} courses`;
73
+ return `${enrollments.length} sections`;
70
74
  },
71
75
  },
72
76
  {
@@ -0,0 +1,187 @@
1
+ import { StudentProfileBE } from "../../../type";
2
+ export declare const STUDENT_PROFILE_DRAWER: {
3
+ readonly FILTER_DRAWER: string;
4
+ readonly FORM_DRAWER: string;
5
+ readonly MORE_ACTIONS_DRAWER: string;
6
+ readonly VIEW_DRAWER: string;
7
+ };
8
+ export declare const STUDENT_PROFILE_ACTION_TYPES: {
9
+ readonly RESET_FORM: "RESET_FORM";
10
+ readonly SET_CURRENT_PAGE: "SET_CURRENT_PAGE";
11
+ readonly SET_PAGE_LIMIT: "SET_PAGE_LIMIT";
12
+ readonly SET_SEARCH_QUERY: "SET_SEARCH_QUERY";
13
+ readonly SET_DRAWER: "SET_DRAWER";
14
+ readonly SET_ITEMS: "SET_ITEMS";
15
+ readonly SET_FORM_DATA: "SET_FORM_DATA";
16
+ readonly SET_DISABLE_SAVE_BUTTON: "SET_DISABLE_SAVE_BUTTON";
17
+ readonly SET_INPUT_FIELD: "SET_INPUT_FIELD";
18
+ readonly SET_ERRORS: "SET_ERRORS";
19
+ readonly SET_FILTERS: "SET_FILTERS";
20
+ }, studentProfileModuleConfig: import("@react-pakistan/util-functions/factory/generic-module-factory").ModuleConfig<{
21
+ items: StudentProfileBE[];
22
+ count: number;
23
+ currentPage: number;
24
+ pageLimit: number;
25
+ searchQuery: string;
26
+ disableSaveButton: boolean;
27
+ drawer: string | null;
28
+ errors: Record<string, string>;
29
+ id: string;
30
+ familyMemberId: string;
31
+ studentCode: string;
32
+ status: string;
33
+ enabled: boolean;
34
+ remarks: string | null;
35
+ firstName: string;
36
+ lastName: string;
37
+ dateOfBirth: string | Date | null;
38
+ gender: string | null;
39
+ bloodGroup: string | null;
40
+ phone: string | null;
41
+ email: string | null;
42
+ emergencyPhone: string | null;
43
+ avatar: string | null;
44
+ familyId: string;
45
+ address: string | null;
46
+ city: string | null;
47
+ state: string | null;
48
+ country: string | null;
49
+ postalCode: string | null;
50
+ filterEnabled: boolean | undefined;
51
+ filterGender: string | undefined;
52
+ filterStatus: string | undefined;
53
+ }>, initialStudentProfileState: {
54
+ items: StudentProfileBE[];
55
+ count: number;
56
+ currentPage: number;
57
+ pageLimit: number;
58
+ searchQuery: string;
59
+ disableSaveButton: boolean;
60
+ drawer: string | null;
61
+ errors: Record<string, string>;
62
+ id: string;
63
+ familyMemberId: string;
64
+ studentCode: string;
65
+ status: string;
66
+ enabled: boolean;
67
+ remarks: string | null;
68
+ firstName: string;
69
+ lastName: string;
70
+ dateOfBirth: string | Date | null;
71
+ gender: string | null;
72
+ bloodGroup: string | null;
73
+ phone: string | null;
74
+ email: string | null;
75
+ emergencyPhone: string | null;
76
+ avatar: string | null;
77
+ familyId: string;
78
+ address: string | null;
79
+ city: string | null;
80
+ state: string | null;
81
+ country: string | null;
82
+ postalCode: string | null;
83
+ filterEnabled: boolean | undefined;
84
+ filterGender: string | undefined;
85
+ filterStatus: string | undefined;
86
+ }, StudentProfileProvider: import("react").FC<{
87
+ children: React.ReactNode;
88
+ }>, studentProfileReducer: (state: {
89
+ items: StudentProfileBE[];
90
+ count: number;
91
+ currentPage: number;
92
+ pageLimit: number;
93
+ searchQuery: string;
94
+ disableSaveButton: boolean;
95
+ drawer: string | null;
96
+ errors: Record<string, string>;
97
+ id: string;
98
+ familyMemberId: string;
99
+ studentCode: string;
100
+ status: string;
101
+ enabled: boolean;
102
+ remarks: string | null;
103
+ firstName: string;
104
+ lastName: string;
105
+ dateOfBirth: string | Date | null;
106
+ gender: string | null;
107
+ bloodGroup: string | null;
108
+ phone: string | null;
109
+ email: string | null;
110
+ emergencyPhone: string | null;
111
+ avatar: string | null;
112
+ familyId: string;
113
+ address: string | null;
114
+ city: string | null;
115
+ state: string | null;
116
+ country: string | null;
117
+ postalCode: string | null;
118
+ filterEnabled: boolean | undefined;
119
+ filterGender: string | undefined;
120
+ filterStatus: string | undefined;
121
+ }, action: any) => {
122
+ items: StudentProfileBE[];
123
+ count: number;
124
+ currentPage: number;
125
+ pageLimit: number;
126
+ searchQuery: string;
127
+ disableSaveButton: boolean;
128
+ drawer: string | null;
129
+ errors: Record<string, string>;
130
+ id: string;
131
+ familyMemberId: string;
132
+ studentCode: string;
133
+ status: string;
134
+ enabled: boolean;
135
+ remarks: string | null;
136
+ firstName: string;
137
+ lastName: string;
138
+ dateOfBirth: string | Date | null;
139
+ gender: string | null;
140
+ bloodGroup: string | null;
141
+ phone: string | null;
142
+ email: string | null;
143
+ emergencyPhone: string | null;
144
+ avatar: string | null;
145
+ familyId: string;
146
+ address: string | null;
147
+ city: string | null;
148
+ state: string | null;
149
+ country: string | null;
150
+ postalCode: string | null;
151
+ filterEnabled: boolean | undefined;
152
+ filterGender: string | undefined;
153
+ filterStatus: string | undefined;
154
+ }, useStudentProfileContext: () => import("@react-pakistan/util-functions/factory/generic-module-factory").GenericModuleContext<{
155
+ items: StudentProfileBE[];
156
+ count: number;
157
+ currentPage: number;
158
+ pageLimit: number;
159
+ searchQuery: string;
160
+ disableSaveButton: boolean;
161
+ drawer: string | null;
162
+ errors: Record<string, string>;
163
+ id: string;
164
+ familyMemberId: string;
165
+ studentCode: string;
166
+ status: string;
167
+ enabled: boolean;
168
+ remarks: string | null;
169
+ firstName: string;
170
+ lastName: string;
171
+ dateOfBirth: string | Date | null;
172
+ gender: string | null;
173
+ bloodGroup: string | null;
174
+ phone: string | null;
175
+ email: string | null;
176
+ emergencyPhone: string | null;
177
+ avatar: string | null;
178
+ familyId: string;
179
+ address: string | null;
180
+ city: string | null;
181
+ state: string | null;
182
+ country: string | null;
183
+ postalCode: string | null;
184
+ filterEnabled: boolean | undefined;
185
+ filterGender: string | undefined;
186
+ filterStatus: string | undefined;
187
+ }>;
@@ -0,0 +1,50 @@
1
+ import { createGenericModule } from "@react-pakistan/util-functions/factory/generic-module-factory";
2
+ import { DRAWER_TYPES } from "@react-pakistan/util-functions/factory/generic-component-factory";
3
+ import { STUDENT_STATUS } from "../../../type";
4
+ import { pageLimit } from "../constants";
5
+ export const STUDENT_PROFILE_DRAWER = {
6
+ FILTER_DRAWER: DRAWER_TYPES.FILTER_DRAWER,
7
+ FORM_DRAWER: DRAWER_TYPES.FORM_DRAWER,
8
+ MORE_ACTIONS_DRAWER: DRAWER_TYPES.MORE_ACTIONS_DRAWER,
9
+ VIEW_DRAWER: DRAWER_TYPES.VIEW_DRAWER,
10
+ };
11
+ const studentProfileConfig = {
12
+ name: "StudentProfile",
13
+ displayName: "Student Profile",
14
+ drawerTypes: DRAWER_TYPES,
15
+ initialState: {
16
+ items: [],
17
+ count: 0,
18
+ currentPage: 1,
19
+ pageLimit,
20
+ searchQuery: "",
21
+ disableSaveButton: false,
22
+ drawer: null,
23
+ errors: {},
24
+ id: "",
25
+ familyMemberId: "",
26
+ studentCode: "",
27
+ status: STUDENT_STATUS.ACTIVE,
28
+ enabled: true,
29
+ remarks: "",
30
+ firstName: "",
31
+ lastName: "",
32
+ dateOfBirth: "",
33
+ gender: "",
34
+ bloodGroup: "",
35
+ phone: "",
36
+ email: "",
37
+ emergencyPhone: "",
38
+ avatar: "",
39
+ familyId: "",
40
+ address: "",
41
+ city: "",
42
+ state: "",
43
+ country: "",
44
+ postalCode: "",
45
+ filterEnabled: undefined,
46
+ filterGender: undefined,
47
+ filterStatus: undefined,
48
+ },
49
+ };
50
+ export const { actionTypes: STUDENT_PROFILE_ACTION_TYPES, config: studentProfileModuleConfig, initialState: initialStudentProfileState, Provider: StudentProfileProvider, reducer: studentProfileReducer, useContext: useStudentProfileContext, } = createGenericModule(studentProfileConfig);
@@ -0,0 +1,70 @@
1
+ import { StudentProfileBE } from "../../../type";
2
+ import { type RowAction, type TableRow } from "@appcorp/shadcn/components/enhanced-table";
3
+ export declare const useStudentProfileModule: () => {
4
+ applyFilters: () => void;
5
+ byIdLoading: boolean;
6
+ clearFilters: () => void;
7
+ clearSearch: () => void;
8
+ closeDrawer: () => void;
9
+ deleteLoading: boolean;
10
+ handleAvatar: (files: File[]) => void;
11
+ handleChange: (field: string, value: string | number | boolean | undefined | null) => void;
12
+ handleCreate: () => void;
13
+ handleDelete: (row?: TableRow) => void;
14
+ handleEdit: (row?: TableRow) => void;
15
+ handleFilters: () => void;
16
+ handleMoreActions: () => void;
17
+ handlePageChange: (page: number | unknown) => void;
18
+ handlePageLimitChange: (k: string, value: object) => void;
19
+ handleReAdmitStudent: (row?: TableRow) => Promise<void>;
20
+ handleSearch: (query: string) => void;
21
+ handleSubmit: () => void;
22
+ handleView: (row?: TableRow) => void;
23
+ handleWithdrawStudent: () => Promise<void>;
24
+ headerActions: {
25
+ enabled: boolean;
26
+ handleOnClick: () => void;
27
+ label: string;
28
+ order: number;
29
+ }[];
30
+ listFetchNow: (url?: string, config?: import("@react-pakistan/util-functions/hooks/use-fetch").FetchConfig) => void;
31
+ listLoading: boolean;
32
+ rowActions: RowAction[];
33
+ toggleStatus: (row?: TableRow) => void;
34
+ updateLoading: boolean;
35
+ state: {
36
+ items: StudentProfileBE[];
37
+ count: number;
38
+ currentPage: number;
39
+ pageLimit: number;
40
+ searchQuery: string;
41
+ disableSaveButton: boolean;
42
+ drawer: string | null;
43
+ errors: Record<string, string>;
44
+ id: string;
45
+ familyMemberId: string;
46
+ studentCode: string;
47
+ status: string;
48
+ enabled: boolean;
49
+ remarks: string | null;
50
+ firstName: string;
51
+ lastName: string;
52
+ dateOfBirth: string | Date | null;
53
+ gender: string | null;
54
+ bloodGroup: string | null;
55
+ phone: string | null;
56
+ email: string | null;
57
+ emergencyPhone: string | null;
58
+ avatar: string | null;
59
+ familyId: string;
60
+ address: string | null;
61
+ city: string | null;
62
+ state: string | null;
63
+ country: string | null;
64
+ postalCode: string | null;
65
+ filterEnabled: boolean | undefined;
66
+ filterGender: string | undefined;
67
+ filterStatus: string | undefined;
68
+ };
69
+ dispatch: React.Dispatch<any>;
70
+ };