@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
@@ -1,256 +1,20 @@
1
- import { StudentProfileBE } from "../../type";
2
- import { type RowAction, type TableRow } from "@appcorp/shadcn/components/enhanced-table";
3
- export declare const STUDENT_PROFILE_DRAWER: {
4
- readonly FILTER_DRAWER: string;
5
- readonly FORM_DRAWER: string;
6
- readonly MORE_ACTIONS_DRAWER: string;
7
- readonly VIEW_DRAWER: string;
8
- };
9
- export declare const STUDENT_PROFILE_ACTION_TYPES: {
10
- readonly RESET_FORM: "RESET_FORM";
11
- readonly SET_CURRENT_PAGE: "SET_CURRENT_PAGE";
12
- readonly SET_PAGE_LIMIT: "SET_PAGE_LIMIT";
13
- readonly SET_SEARCH_QUERY: "SET_SEARCH_QUERY";
14
- readonly SET_DRAWER: "SET_DRAWER";
15
- readonly SET_ITEMS: "SET_ITEMS";
16
- readonly SET_FORM_DATA: "SET_FORM_DATA";
17
- readonly SET_DISABLE_SAVE_BUTTON: "SET_DISABLE_SAVE_BUTTON";
18
- readonly SET_INPUT_FIELD: "SET_INPUT_FIELD";
19
- readonly SET_ERRORS: "SET_ERRORS";
20
- readonly SET_FILTERS: "SET_FILTERS";
21
- }, studentProfileModuleConfig: import("@react-pakistan/util-functions/factory/generic-module-factory").ModuleConfig<{
22
- items: StudentProfileBE[];
23
- count: number;
24
- currentPage: number;
25
- pageLimit: number;
26
- searchQuery: string;
27
- disableSaveButton: boolean;
28
- drawer: string | null;
29
- errors: Record<string, string>;
30
- id: string;
31
- familyMemberId: string;
32
- studentCode: string;
33
- status: string;
34
- enabled: boolean;
35
- remarks: string | null;
36
- firstName: string;
37
- lastName: string;
38
- dateOfBirth: string | Date | null;
39
- gender: string | null;
40
- bloodGroup: string | null;
41
- phone: string | null;
42
- email: string | null;
43
- emergencyPhone: string | null;
44
- avatar: string | null;
45
- familyId: string;
46
- address: string | null;
47
- city: string | null;
48
- state: string | null;
49
- country: string | null;
50
- postalCode: string | null;
51
- filterEnabled: boolean | undefined;
52
- filterGender: string | undefined;
53
- filterStatus: string | undefined;
54
- }>, initialStudentProfileState: {
55
- items: StudentProfileBE[];
56
- count: number;
57
- currentPage: number;
58
- pageLimit: number;
59
- searchQuery: string;
60
- disableSaveButton: boolean;
61
- drawer: string | null;
62
- errors: Record<string, string>;
63
- id: string;
64
- familyMemberId: string;
65
- studentCode: string;
66
- status: string;
67
- enabled: boolean;
68
- remarks: string | null;
69
- firstName: string;
70
- lastName: string;
71
- dateOfBirth: string | Date | null;
72
- gender: string | null;
73
- bloodGroup: string | null;
74
- phone: string | null;
75
- email: string | null;
76
- emergencyPhone: string | null;
77
- avatar: string | null;
78
- familyId: string;
79
- address: string | null;
80
- city: string | null;
81
- state: string | null;
82
- country: string | null;
83
- postalCode: string | null;
84
- filterEnabled: boolean | undefined;
85
- filterGender: string | undefined;
86
- filterStatus: string | undefined;
87
- }, StudentProfileProvider: import("react").FC<{
88
- children: React.ReactNode;
89
- }>, studentProfileReducer: (state: {
90
- items: StudentProfileBE[];
91
- count: number;
92
- currentPage: number;
93
- pageLimit: number;
94
- searchQuery: string;
95
- disableSaveButton: boolean;
96
- drawer: string | null;
97
- errors: Record<string, string>;
98
- id: string;
99
- familyMemberId: string;
100
- studentCode: string;
101
- status: string;
102
- enabled: boolean;
103
- remarks: string | null;
104
- firstName: string;
105
- lastName: string;
106
- dateOfBirth: string | Date | null;
107
- gender: string | null;
108
- bloodGroup: string | null;
109
- phone: string | null;
110
- email: string | null;
111
- emergencyPhone: string | null;
112
- avatar: string | null;
113
- familyId: string;
114
- address: string | null;
115
- city: string | null;
116
- state: string | null;
117
- country: string | null;
118
- postalCode: string | null;
119
- filterEnabled: boolean | undefined;
120
- filterGender: string | undefined;
121
- filterStatus: string | undefined;
122
- }, action: any) => {
123
- items: StudentProfileBE[];
124
- count: number;
125
- currentPage: number;
126
- pageLimit: number;
127
- searchQuery: string;
128
- disableSaveButton: boolean;
129
- drawer: string | null;
130
- errors: Record<string, string>;
131
- id: string;
132
- familyMemberId: string;
133
- studentCode: string;
134
- status: string;
135
- enabled: boolean;
136
- remarks: string | null;
137
- firstName: string;
138
- lastName: string;
139
- dateOfBirth: string | Date | null;
140
- gender: string | null;
141
- bloodGroup: string | null;
142
- phone: string | null;
143
- email: string | null;
144
- emergencyPhone: string | null;
145
- avatar: string | null;
146
- familyId: string;
147
- address: string | null;
148
- city: string | null;
149
- state: string | null;
150
- country: string | null;
151
- postalCode: string | null;
152
- filterEnabled: boolean | undefined;
153
- filterGender: string | undefined;
154
- filterStatus: string | undefined;
155
- }, useStudentProfileContext: () => import("@react-pakistan/util-functions/factory/generic-module-factory").GenericModuleContext<{
156
- items: StudentProfileBE[];
157
- count: number;
158
- currentPage: number;
159
- pageLimit: number;
160
- searchQuery: string;
161
- disableSaveButton: boolean;
162
- drawer: string | null;
163
- errors: Record<string, string>;
164
- id: string;
165
- familyMemberId: string;
166
- studentCode: string;
167
- status: string;
168
- enabled: boolean;
169
- remarks: string | null;
170
- firstName: string;
171
- lastName: string;
172
- dateOfBirth: string | Date | null;
173
- gender: string | null;
174
- bloodGroup: string | null;
175
- phone: string | null;
176
- email: string | null;
177
- emergencyPhone: string | null;
178
- avatar: string | null;
179
- familyId: string;
180
- address: string | null;
181
- city: string | null;
182
- state: string | null;
183
- country: string | null;
184
- postalCode: string | null;
185
- filterEnabled: boolean | undefined;
186
- filterGender: string | undefined;
187
- filterStatus: string | undefined;
188
- }>;
189
- export declare const useStudentProfileModule: () => {
190
- applyFilters: () => void;
191
- byIdLoading: boolean;
192
- clearFilters: () => void;
193
- clearSearch: () => void;
194
- closeDrawer: () => void;
195
- deleteLoading: boolean;
196
- handleAvatar: (files: File[]) => void;
197
- handleChange: (field: string, value: string | number | boolean | undefined | null) => void;
198
- handleCreate: () => void;
199
- handleDelete: (row?: TableRow) => void;
200
- handleEdit: (row?: TableRow) => void;
201
- handleFilters: () => void;
202
- handleMoreActions: () => void;
203
- handlePageChange: (page: number | unknown) => void;
204
- handlePageLimitChange: (k: string, value: object) => void;
205
- handleReAdmitStudent: (row?: TableRow) => Promise<void>;
206
- handleSearch: (query: string) => void;
207
- handleSubmit: () => void;
208
- handleView: (row?: TableRow) => void;
209
- handleWithdrawStudent: () => Promise<void>;
210
- headerActions: {
211
- enabled: boolean;
212
- handleOnClick: () => void;
213
- label: string;
214
- order: number;
215
- }[];
216
- listFetchNow: (url?: string, config?: import("@react-pakistan/util-functions/hooks/use-fetch").FetchConfig) => void;
217
- listLoading: boolean;
218
- rowActions: RowAction[];
219
- toggleStatus: (row?: TableRow) => void;
220
- updateLoading: boolean;
221
- state: {
222
- items: StudentProfileBE[];
223
- count: number;
224
- currentPage: number;
225
- pageLimit: number;
226
- searchQuery: string;
227
- disableSaveButton: boolean;
228
- drawer: string | null;
229
- errors: Record<string, string>;
230
- id: string;
231
- familyMemberId: string;
232
- studentCode: string;
233
- status: string;
234
- enabled: boolean;
235
- remarks: string | null;
236
- firstName: string;
237
- lastName: string;
238
- dateOfBirth: string | Date | null;
239
- gender: string | null;
240
- bloodGroup: string | null;
241
- phone: string | null;
242
- email: string | null;
243
- emergencyPhone: string | null;
244
- avatar: string | null;
245
- familyId: string;
246
- address: string | null;
247
- city: string | null;
248
- state: string | null;
249
- country: string | null;
250
- postalCode: string | null;
251
- filterEnabled: boolean | undefined;
252
- filterGender: string | undefined;
253
- filterStatus: string | undefined;
254
- };
255
- dispatch: React.Dispatch<any>;
256
- };
1
+ /**
2
+ * StudentProfile Context
3
+ *
4
+ * Wires the generic module state (created by `createGenericModule`) to network
5
+ * actions using `useModuleEntityV2`. Contains domain-specific handlers for
6
+ * CRUD operations, withdraw, re-admit, and status changes.
7
+ *
8
+ * Key responsibilities:
9
+ * - Expose `useStudentProfileModule()` which UI components call for actions
10
+ * - Keep module-specific `apiParams` and callbacks in one place
11
+ * - Ensure cache invalidation and toast notifications on mutation
12
+ *
13
+ * Exported utilities:
14
+ * - `StudentProfileProvider` — provider component used by the page
15
+ * - `STUDENT_PROFILE_ACTION_TYPES` — action type constants (from factory)
16
+ * - `STUDENT_PROFILE_DRAWER` — drawer type constants
17
+ * - `useStudentProfileModule()` — hook that returns state, dispatch, and handlers
18
+ */
19
+ export { STUDENT_PROFILE_DRAWER, STUDENT_PROFILE_ACTION_TYPES, studentProfileModuleConfig, initialStudentProfileState, StudentProfileProvider, studentProfileReducer, useStudentProfileContext, } from "./context/module-base";
20
+ export { useStudentProfileModule } from "./context/use-student-profile-module";