@appcorp/fusion-storybook 0.3.67 → 0.3.68

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.
@@ -56,8 +56,6 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
56
56
  studentProfileId: string;
57
57
  filterEnabled: boolean | undefined;
58
58
  filterStatus: PAYMENT_STATUS | "";
59
- appliedFilterEnabled: boolean | undefined;
60
- appliedFilterStatus: PAYMENT_STATUS | "";
61
59
  }>, initialStudentFeeState: {
62
60
  items: StudentFeeBE[];
63
61
  count: number;
@@ -89,8 +87,6 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
89
87
  studentProfileId: string;
90
88
  filterEnabled: boolean | undefined;
91
89
  filterStatus: PAYMENT_STATUS | "";
92
- appliedFilterEnabled: boolean | undefined;
93
- appliedFilterStatus: PAYMENT_STATUS | "";
94
90
  }, StudentFeeProvider: import("react").FC<{
95
91
  children: React.ReactNode;
96
92
  }>, studentFeeReducer: (state: {
@@ -124,8 +120,6 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
124
120
  studentProfileId: string;
125
121
  filterEnabled: boolean | undefined;
126
122
  filterStatus: PAYMENT_STATUS | "";
127
- appliedFilterEnabled: boolean | undefined;
128
- appliedFilterStatus: PAYMENT_STATUS | "";
129
123
  }, action: any) => {
130
124
  items: StudentFeeBE[];
131
125
  count: number;
@@ -157,8 +151,6 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
157
151
  studentProfileId: string;
158
152
  filterEnabled: boolean | undefined;
159
153
  filterStatus: PAYMENT_STATUS | "";
160
- appliedFilterEnabled: boolean | undefined;
161
- appliedFilterStatus: PAYMENT_STATUS | "";
162
154
  }, useStudentFeeContext: () => import("@react-pakistan/util-functions/factory/generic-module-factory").GenericModuleContextWithHandlers<{
163
155
  items: StudentFeeBE[];
164
156
  count: number;
@@ -190,6 +182,4 @@ export declare const STUDENT_FEE_ACTION_TYPES: {
190
182
  studentProfileId: string;
191
183
  filterEnabled: boolean | undefined;
192
184
  filterStatus: PAYMENT_STATUS | "";
193
- appliedFilterEnabled: boolean | undefined;
194
- appliedFilterStatus: PAYMENT_STATUS | "";
195
185
  }>;
@@ -57,12 +57,9 @@ const studentFeeConfig = {
57
57
  schoolId: "",
58
58
  status: PAYMENT_STATUS.PENDING,
59
59
  studentProfileId: "",
60
- // Filters (pending — updated immediately by UI)
60
+ // Filters
61
61
  filterEnabled: undefined,
62
62
  filterStatus: "",
63
- // Applied filters (only updated on "Apply" / "Clear")
64
- appliedFilterEnabled: undefined,
65
- appliedFilterStatus: "",
66
63
  },
67
64
  };
68
65
  // ============================================================================
@@ -68,8 +68,6 @@ export declare const useStudentFeeModule: () => {
68
68
  studentProfileId: string;
69
69
  filterEnabled: boolean | undefined;
70
70
  filterStatus: PAYMENT_STATUS | "";
71
- appliedFilterEnabled: boolean | undefined;
72
- appliedFilterStatus: PAYMENT_STATUS | "";
73
71
  };
74
72
  dispatch: React.Dispatch<any>;
75
73
  };
@@ -45,15 +45,13 @@ export const useStudentFeeModule = () => {
45
45
  // ============================================================================
46
46
  const listParams = useMemo(() => {
47
47
  var _a;
48
- return (Object.assign(Object.assign(Object.assign({ currentPage: state.currentPage, pageLimit: state.pageLimit, schoolId: ((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id) || "" }, (debouncedQuery ? { searchQuery: debouncedQuery } : {})), (state.appliedFilterEnabled !== undefined
49
- ? { filterEnabled: state.appliedFilterEnabled }
50
- : {})), (state.appliedFilterStatus
51
- ? { status: state.appliedFilterStatus }
52
- : {})));
48
+ return (Object.assign(Object.assign(Object.assign({ currentPage: state.currentPage, pageLimit: state.pageLimit, schoolId: ((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id) || "" }, (debouncedQuery ? { searchQuery: debouncedQuery } : {})), (state.filterEnabled !== undefined
49
+ ? { filterEnabled: state.filterEnabled }
50
+ : {})), (state.filterStatus ? { status: state.filterStatus } : {})));
53
51
  }, [
54
52
  state.currentPage,
55
- state.appliedFilterEnabled,
56
- state.appliedFilterStatus,
53
+ state.filterEnabled,
54
+ state.filterStatus,
57
55
  state.pageLimit,
58
56
  debouncedQuery,
59
57
  (_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id,
@@ -503,36 +501,18 @@ export const useStudentFeeModule = () => {
503
501
  });
504
502
  }, [dispatch]);
505
503
  const applyFilters = useCallback(() => {
506
- dispatch({
507
- type: STUDENT_FEE_ACTION_TYPES.SET_INPUT_FIELD,
508
- payload: { key: "appliedFilterEnabled", value: state.filterEnabled },
509
- });
510
- dispatch({
511
- type: STUDENT_FEE_ACTION_TYPES.SET_INPUT_FIELD,
512
- payload: { key: "appliedFilterStatus", value: state.filterStatus },
513
- });
514
504
  dispatch({
515
505
  type: STUDENT_FEE_ACTION_TYPES.SET_CURRENT_PAGE,
516
506
  payload: { currentPage: 1 },
517
507
  });
518
508
  closeDrawer();
519
- }, [dispatch, closeDrawer, state.filterEnabled, state.filterStatus]);
509
+ }, [dispatch, closeDrawer]);
520
510
  const clearFilters = useCallback(() => {
521
511
  dispatch({
522
- type: STUDENT_FEE_ACTION_TYPES.SET_INPUT_FIELD,
523
- payload: { key: "filterEnabled", value: undefined },
524
- });
525
- dispatch({
526
- type: STUDENT_FEE_ACTION_TYPES.SET_INPUT_FIELD,
527
- payload: { key: "filterStatus", value: "" },
528
- });
529
- dispatch({
530
- type: STUDENT_FEE_ACTION_TYPES.SET_INPUT_FIELD,
531
- payload: { key: "appliedFilterEnabled", value: undefined },
532
- });
533
- dispatch({
534
- type: STUDENT_FEE_ACTION_TYPES.SET_INPUT_FIELD,
535
- payload: { key: "appliedFilterStatus", value: "" },
512
+ type: STUDENT_FEE_ACTION_TYPES.SET_FILTERS,
513
+ payload: {
514
+ filters: { filterEnabled: undefined, filterStatus: "" },
515
+ },
536
516
  });
537
517
  dispatch({
538
518
  type: STUDENT_FEE_ACTION_TYPES.SET_CURRENT_PAGE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/fusion-storybook",
3
- "version": "0.3.67",
3
+ "version": "0.3.68",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",