@appcorp/fusion-storybook 0.3.92 → 0.3.94

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.
@@ -15,10 +15,7 @@
15
15
  import { FC } from "react";
16
16
  import { USER_ROLE } from "../../type";
17
17
  interface ConfigProps {
18
- dispatch: React.Dispatch<{
19
- type: string;
20
- payload?: unknown;
21
- }>;
18
+ clearFilters: () => void;
22
19
  drawerButtonCancel: string;
23
20
  drawerButtonSave: string;
24
21
  drawerFilterDescription: string;
@@ -18,7 +18,7 @@ import { useMemo } from "react";
18
18
  import { COMPONENT_TYPE } from "@appcorp/shadcn/components/enhanced-table";
19
19
  import { createGenericModulePage, } from "@react-pakistan/util-functions/factory/generic-component-factory";
20
20
  import { DATE_FORMATS, formatDate, } from "@react-pakistan/util-functions/general/format-date";
21
- import { useExpenseModule, ExpenseProvider, ExpenseApiProvider, EXPENSE_ACTION_TYPES, } from "./context";
21
+ import { useExpenseModule, ExpenseProvider, ExpenseApiProvider, } from "./context";
22
22
  import { ExpenseFilter } from "./filter";
23
23
  import { ExpenseForm } from "./form";
24
24
  import { ExpenseMoreActions } from "./more-actions";
@@ -64,7 +64,7 @@ const createComponentInstances = () => ({
64
64
  moreActions: _jsx(ExpenseMoreActions, {}),
65
65
  view: _jsx(ExpenseView, {}),
66
66
  });
67
- const createExpenseConfig = ({ dispatch, drawerButtonCancel, drawerButtonSave, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, tableColumnHeaderActions, tableColumnHeaderAmount, tableColumnHeaderCategory, tableColumnHeaderExpenseDate, tableColumnHeaderId, tableColumnHeaderStatus, tableColumnHeaderTitle, tableColumnHeaderVendorName, tableDescription, tableSearchPlaceholder, tableTitle, }) => {
67
+ const createExpenseConfig = ({ clearFilters, drawerButtonCancel, drawerButtonSave, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, tableColumnHeaderActions, tableColumnHeaderAmount, tableColumnHeaderCategory, tableColumnHeaderExpenseDate, tableColumnHeaderId, tableColumnHeaderStatus, tableColumnHeaderTitle, tableColumnHeaderVendorName, tableDescription, tableSearchPlaceholder, tableTitle, }) => {
68
68
  const components = createComponentInstances();
69
69
  return {
70
70
  moduleName: "expense",
@@ -95,9 +95,7 @@ const createExpenseConfig = ({ dispatch, drawerButtonCancel, drawerButtonSave, d
95
95
  tableDescription,
96
96
  tableTitle,
97
97
  viewContent: components.view,
98
- onClearFilters: () => {
99
- dispatch({ type: EXPENSE_ACTION_TYPES.RESET_FORM });
100
- },
98
+ onClearFilters: clearFilters,
101
99
  };
102
100
  };
103
101
  // ============================================================================
@@ -111,7 +109,7 @@ const ExpensePageInner = (props) => {
111
109
  const context = useExpenseModule();
112
110
  // Memoize config creation - destructure props to avoid object reference changes
113
111
  const expenseConfig = useMemo(() => createExpenseConfig({
114
- dispatch: context.dispatch,
112
+ clearFilters: context.clearFilters,
115
113
  drawerButtonCancel: props.drawerButtonCancel,
116
114
  drawerButtonSave: props.drawerButtonSave,
117
115
  drawerFormTitle: props.drawerFormTitle,
@@ -134,7 +132,7 @@ const ExpensePageInner = (props) => {
134
132
  tableSearchPlaceholder: props.tableSearchPlaceholder,
135
133
  tableTitle: props.tableTitle,
136
134
  }), [
137
- context.dispatch,
135
+ context.clearFilters,
138
136
  props.drawerButtonCancel,
139
137
  props.drawerButtonSave,
140
138
  props.drawerFormTitle,
@@ -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;
@@ -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;
@@ -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.92",
3
+ "version": "0.3.94",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",