@appcorp/fusion-storybook 0.3.93 → 0.3.95

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.
@@ -38,7 +38,7 @@ interface ConfigProps {
38
38
  tableSearchPlaceholder: string;
39
39
  tableTitle: string;
40
40
  }
41
- interface Props extends ConfigProps {
41
+ interface Props extends Omit<ConfigProps, "clearFilters"> {
42
42
  userRole: USER_ROLE;
43
43
  }
44
44
  export declare const ExpensePage: FC<Props>;
@@ -18,10 +18,7 @@
18
18
  import { FC } from "react";
19
19
  import { USER_ROLE } from "../../type";
20
20
  interface ConfigProps {
21
- dispatch: React.Dispatch<{
22
- type: string;
23
- payload?: unknown;
24
- }>;
21
+ clearFilters: () => void;
25
22
  drawerButtonCancel: string;
26
23
  drawerButtonSave: string;
27
24
  drawerFilterDescription: string;
@@ -44,7 +41,7 @@ interface ConfigProps {
44
41
  tableSearchPlaceholder: string;
45
42
  tableTitle: string;
46
43
  }
47
- interface Props extends ConfigProps {
44
+ interface Props extends Omit<ConfigProps, "clearFilters"> {
48
45
  userRole: USER_ROLE;
49
46
  }
50
47
  export declare const FeeStructurePage: FC<Props>;
@@ -20,7 +20,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
20
20
  import { useMemo } from "react";
21
21
  import { COMPONENT_TYPE } from "@appcorp/shadcn/components/enhanced-table";
22
22
  import { createGenericModulePage, } from "@react-pakistan/util-functions/factory/generic-component-factory";
23
- import { useFeeStructureModule, FeeStructureProvider, FeeStructureApiProvider, FEE_STRUCTURE_ACTION_TYPES, } from "./context";
23
+ import { useFeeStructureModule, FeeStructureProvider, FeeStructureApiProvider, } from "./context";
24
24
  import { FeeStructureFilter } from "./filter";
25
25
  import { FeeStructureForm } from "./form";
26
26
  import { FeeStructureMoreActions } from "./more-actions";
@@ -66,7 +66,7 @@ const createComponentInstances = () => ({
66
66
  moreActions: _jsx(FeeStructureMoreActions, {}),
67
67
  view: _jsx(FeeStructureView, {}),
68
68
  });
69
- const createFeeStructureConfig = ({ dispatch, drawerButtonCancel, drawerButtonSave, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, tableColumnHeaderActions, tableColumnHeaderAmount, tableColumnHeaderDescription, tableColumnHeaderEnabled, tableColumnHeaderFeeType, tableColumnHeaderFrequency, tableColumnHeaderId, tableColumnHeaderName, tableDescription, tableSearchPlaceholder, tableTitle, }) => {
69
+ const createFeeStructureConfig = ({ clearFilters, drawerButtonCancel, drawerButtonSave, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, tableColumnHeaderActions, tableColumnHeaderAmount, tableColumnHeaderDescription, tableColumnHeaderEnabled, tableColumnHeaderFeeType, tableColumnHeaderFrequency, tableColumnHeaderId, tableColumnHeaderName, tableDescription, tableSearchPlaceholder, tableTitle, }) => {
70
70
  const components = createComponentInstances();
71
71
  return {
72
72
  moduleName: "feeStructure",
@@ -97,9 +97,7 @@ const createFeeStructureConfig = ({ dispatch, drawerButtonCancel, drawerButtonSa
97
97
  tableDescription,
98
98
  tableTitle,
99
99
  viewContent: components.view,
100
- onClearFilters: () => {
101
- dispatch({ type: FEE_STRUCTURE_ACTION_TYPES.RESET_FORM });
102
- },
100
+ onClearFilters: clearFilters,
103
101
  };
104
102
  };
105
103
  // ============================================================================
@@ -112,7 +110,7 @@ const GenericFeeStructurePage = createGenericModulePage();
112
110
  const FeeStructurePageInner = (props) => {
113
111
  const context = useFeeStructureModule();
114
112
  const feeStructureConfig = useMemo(() => createFeeStructureConfig({
115
- dispatch: context.dispatch,
113
+ clearFilters: context.clearFilters,
116
114
  drawerButtonCancel: props.drawerButtonCancel,
117
115
  drawerButtonSave: props.drawerButtonSave,
118
116
  drawerFormTitle: props.drawerFormTitle,
@@ -135,7 +133,7 @@ const FeeStructurePageInner = (props) => {
135
133
  tableSearchPlaceholder: props.tableSearchPlaceholder,
136
134
  tableTitle: props.tableTitle,
137
135
  }), [
138
- context.dispatch,
136
+ context.clearFilters,
139
137
  props.drawerButtonCancel,
140
138
  props.drawerButtonSave,
141
139
  props.drawerFormTitle,
@@ -16,10 +16,6 @@ import { FC } from "react";
16
16
  import { USER_ROLE } from "../../type";
17
17
  interface ConfigProps {
18
18
  clearFilters: () => void;
19
- dispatch: React.Dispatch<{
20
- type: string;
21
- payload?: unknown;
22
- }>;
23
19
  drawerButtonCancel: string;
24
20
  drawerButtonSave: string;
25
21
  drawerFilterDescription: string;
@@ -48,7 +44,7 @@ interface ConfigProps {
48
44
  tableSearchPlaceholder: string;
49
45
  tableTitle: string;
50
46
  }
51
- interface Props extends ConfigProps {
47
+ interface Props extends Omit<ConfigProps, "clearFilters"> {
52
48
  userRole: USER_ROLE;
53
49
  }
54
50
  export declare const StudentFeePage: FC<Props>;
@@ -133,7 +133,6 @@ const StudentFeePageInner = (props) => {
133
133
  // Memoize config creation - destructure props to avoid object reference changes
134
134
  const studentFeeConfig = useMemo(() => createStudentFeeConfig({
135
135
  clearFilters: context.clearFilters,
136
- dispatch: context.dispatch,
137
136
  drawerButtonCancel: props.drawerButtonCancel,
138
137
  drawerButtonSave: props.drawerButtonSave,
139
138
  drawerFilterDescription: props.drawerFilterDescription,
@@ -163,7 +162,6 @@ const StudentFeePageInner = (props) => {
163
162
  tableTitle: props.tableTitle,
164
163
  }), [
165
164
  context.clearFilters,
166
- context.dispatch,
167
165
  props.drawerButtonCancel,
168
166
  props.drawerButtonSave,
169
167
  props.drawerFilterDescription,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/fusion-storybook",
3
- "version": "0.3.93",
3
+ "version": "0.3.95",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",