@appcorp/stellar-solutions-modules 0.1.14 → 0.1.16
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.
- package/global-modules/branch/context.js +7 -7
- package/global-modules/payment-mode/context.js +7 -7
- package/global-modules/preferences/actions.d.ts +2 -141
- package/global-modules/preferences/actions.js +0 -22
- package/global-modules/preferences/branch-drawer.d.ts +0 -8
- package/global-modules/preferences/branch-drawer.js +36 -19
- package/global-modules/preferences/branch-form-elements.d.ts +0 -3
- package/global-modules/preferences/branch-form-elements.js +30 -41
- package/global-modules/preferences/branch-form.d.ts +0 -8
- package/global-modules/preferences/branch-form.js +33 -81
- package/global-modules/preferences/branch.d.ts +0 -2
- package/global-modules/preferences/branch.js +106 -69
- package/global-modules/preferences/constants.d.ts +0 -29
- package/global-modules/preferences/constants.js +1 -302
- package/global-modules/preferences/context.js +5 -582
- package/global-modules/preferences/payment-mode-drawer.d.ts +0 -8
- package/global-modules/preferences/payment-mode-drawer.js +36 -19
- package/global-modules/preferences/payment-mode-form-elements.d.ts +0 -3
- package/global-modules/preferences/payment-mode-form-elements.js +30 -41
- package/global-modules/preferences/payment-mode-form.d.ts +0 -8
- package/global-modules/preferences/payment-mode-form.js +33 -81
- package/global-modules/preferences/payment-mode.d.ts +0 -2
- package/global-modules/preferences/payment-mode.js +94 -57
- package/global-modules/preferences/preferences.js +2 -1
- package/global-modules/preferences/reducer.js +6 -162
- package/global-modules/preferences/types.d.ts +0 -46
- package/global-modules/tax/context.js +7 -11
- package/package.json +7 -7
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { VistaTableHeaderActionItem } from '@appcorp/app-corp-vista/type/vista-table-type';
|
|
2
|
-
import { RowActionItem } from '@appcorp/app-corp-vista/type/vista-dropdown-menu-type';
|
|
3
1
|
import { PreferenceActions } from './actions';
|
|
4
2
|
import { Dispatch } from 'react';
|
|
5
3
|
import { VistaDashboardTabNavigatorListItem } from '@appcorp/app-corp-vista/type/vista-dashboard-tab-navigator-type';
|
|
6
4
|
import { Currency } from '@react-pakistan/util-functions';
|
|
7
|
-
import { VistaFormElements } from '@appcorp/app-corp-vista/type/vista-form-elements';
|
|
8
5
|
export interface MenuItem {
|
|
9
6
|
preferenceId: string;
|
|
10
7
|
label: string;
|
|
@@ -67,29 +64,10 @@ export interface Tax {
|
|
|
67
64
|
export type TaxForm = Omit<TaxTypeBE, 'createdAt' | 'updatedAt' | 'preference'>;
|
|
68
65
|
export interface PreferenceState {
|
|
69
66
|
activeTab: string;
|
|
70
|
-
bankDetails: BankDetails;
|
|
71
|
-
bankDetailsData: BankDetails[];
|
|
72
|
-
branchCount: number;
|
|
73
|
-
branchCurrentPage: number;
|
|
74
|
-
branchDisableSaveButton: boolean;
|
|
75
|
-
branchDrawer: null | PREFERENCE_DRAWER;
|
|
76
|
-
branchPageLimit: number;
|
|
77
|
-
branchSearchQuery: string;
|
|
78
|
-
branches: BranchTypeBE[];
|
|
79
67
|
currencies: CurrencyTypeBE[];
|
|
80
68
|
currencyUpdateId: string;
|
|
81
69
|
id: string;
|
|
82
70
|
count: number;
|
|
83
|
-
isMenuOrderData: boolean;
|
|
84
|
-
localMenuItems: MenuItem[];
|
|
85
|
-
onboarding: boolean;
|
|
86
|
-
paymentModeCount: number;
|
|
87
|
-
paymentModeCurrentPage: number;
|
|
88
|
-
paymentModeDisableSaveButton: boolean;
|
|
89
|
-
paymentModeDrawer: null | PREFERENCE_DRAWER;
|
|
90
|
-
paymentModePageLimit: number;
|
|
91
|
-
paymentModeSearchQuery: string;
|
|
92
|
-
paymentModes: PaymentModeTypeBE[];
|
|
93
71
|
errors: {
|
|
94
72
|
[key: string]: string;
|
|
95
73
|
};
|
|
@@ -208,11 +186,9 @@ export interface PreferenceContextType {
|
|
|
208
186
|
deleteError?: Error;
|
|
209
187
|
deleteLoading: boolean;
|
|
210
188
|
dispatch: Dispatch<PreferenceActions>;
|
|
211
|
-
paymentModeHeaderActions: VistaTableHeaderActionItem[];
|
|
212
189
|
listError?: Error;
|
|
213
190
|
listFetchNow: () => void;
|
|
214
191
|
listLoading: boolean;
|
|
215
|
-
paymentModeRowActions: RowActionItem[];
|
|
216
192
|
searchOnChange: (k: string, v: string) => void;
|
|
217
193
|
updateError?: Error;
|
|
218
194
|
updateLoading: boolean;
|
|
@@ -225,30 +201,8 @@ export interface PreferenceContextType {
|
|
|
225
201
|
currencyListLoading: boolean;
|
|
226
202
|
currencyUpdateError?: Error;
|
|
227
203
|
currencyUpdateLoading: boolean;
|
|
228
|
-
paymentModeByIdError?: Error;
|
|
229
|
-
paymentModeByIdLoading: boolean;
|
|
230
|
-
paymentModeDeleteError?: Error;
|
|
231
|
-
paymentModeDeleteLoading: boolean;
|
|
232
|
-
paymentModeListError?: Error;
|
|
233
|
-
paymentModeListLoading: boolean;
|
|
234
|
-
paymentModeUpdateError?: Error;
|
|
235
|
-
paymentModeUpdateLoading: boolean;
|
|
236
|
-
branchByIdError?: Error;
|
|
237
|
-
branchByIdLoading: boolean;
|
|
238
|
-
branchDeleteError?: Error;
|
|
239
|
-
branchDeleteLoading: boolean;
|
|
240
|
-
branchListError?: Error;
|
|
241
|
-
branchListLoading: boolean;
|
|
242
|
-
branchUpdateError?: Error;
|
|
243
|
-
branchUpdateLoading: boolean;
|
|
244
204
|
handleUpdateCurrency: (id: string, route: 'enabled' | 'isDefault') => void;
|
|
245
205
|
handleCreateCurrency: (currency: Currency) => void;
|
|
246
|
-
handlePaymentModeSubmit: () => void;
|
|
247
|
-
paymentModeDynamicFormElements: VistaFormElements;
|
|
248
|
-
branchDynamicFormElements: VistaFormElements;
|
|
249
|
-
handleBranchSubmit: () => void;
|
|
250
|
-
branchHeaderActions: VistaTableHeaderActionItem[];
|
|
251
|
-
branchRowActions: RowActionItem[];
|
|
252
206
|
}
|
|
253
207
|
export interface CreateBankDetailArg {
|
|
254
208
|
id: string;
|
|
@@ -95,7 +95,7 @@ var validate_1 = require("./validate");
|
|
|
95
95
|
var context_1 = require("../preferences/context");
|
|
96
96
|
var useTaxState = function () {
|
|
97
97
|
var _a = (0, react_1.useReducer)(reducer_1.taxReducer, reducer_1.initialTaxState), state = _a[0], dispatch = _a[1];
|
|
98
|
-
var
|
|
98
|
+
var _b = (0, context_1.usePreferenceStateContext)(), preferences = _b.preferences, activeTab = _b.activeTab;
|
|
99
99
|
var debouncedQuery = (0, util_functions_1.useDebounce)(state.searchQuery, 800);
|
|
100
100
|
var listParams = {
|
|
101
101
|
currentPage: state.currentPage,
|
|
@@ -199,7 +199,7 @@ var useTaxState = function () {
|
|
|
199
199
|
listFetchNow();
|
|
200
200
|
}
|
|
201
201
|
};
|
|
202
|
-
var
|
|
202
|
+
var _c = (0, util_functions_1.useModuleEntity)({
|
|
203
203
|
byIdCallback: byIdCallback,
|
|
204
204
|
byIdParams: byIdParams,
|
|
205
205
|
deleteCallback: deleteCallback,
|
|
@@ -213,21 +213,17 @@ var useTaxState = function () {
|
|
|
213
213
|
updateCallback: updateCallback,
|
|
214
214
|
updateDeps: [state],
|
|
215
215
|
updateParams: updateParams,
|
|
216
|
-
}), byIdError =
|
|
216
|
+
}), byIdError = _c.byIdError, byIdFetchNow = _c.byIdFetchNow, byIdLoading = _c.byIdLoading, deleteError = _c.deleteError, deleteFetchNow = _c.deleteFetchNow, deleteLoading = _c.deleteLoading, listError = _c.listError, listFetchNow = _c.listFetchNow, listLoading = _c.listLoading, updateError = _c.updateError, updateFetchNow = _c.updateFetchNow, updateLoading = _c.updateLoading;
|
|
217
217
|
(0, react_1.useEffect)(function () {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
// branchListFetchNow();
|
|
222
|
-
// if (state.activeTab === 'Tax') {
|
|
223
|
-
listFetchNow();
|
|
224
|
-
// }
|
|
218
|
+
if (activeTab === 'Tax') {
|
|
219
|
+
listFetchNow();
|
|
220
|
+
}
|
|
225
221
|
// eslint-disable-next-line
|
|
226
222
|
}, [
|
|
227
223
|
debouncedQuery,
|
|
228
224
|
state.currentPage,
|
|
229
225
|
state.pageLimit,
|
|
230
|
-
|
|
226
|
+
activeTab,
|
|
231
227
|
]);
|
|
232
228
|
var searchOnChange = function (k, v) {
|
|
233
229
|
dispatch({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appcorp/stellar-solutions-modules",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "yarn clean && yarn build:ts && cp package.json lib && cp README.md lib",
|
|
6
6
|
"build:next": "next build",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@appcorp/app-corp-vista": "^0.2.
|
|
21
|
+
"@appcorp/app-corp-vista": "^0.2.66",
|
|
22
22
|
"@eslint/eslintrc": "^3",
|
|
23
23
|
"@headlessui/react": "^2",
|
|
24
24
|
"@heroicons/react": "^2",
|
|
@@ -30,24 +30,24 @@
|
|
|
30
30
|
"@types/react": "^19",
|
|
31
31
|
"@types/react-dom": "^19",
|
|
32
32
|
"@types/react-slick": "^0.23.13",
|
|
33
|
-
"dayjs": "^1
|
|
33
|
+
"dayjs": "^1",
|
|
34
34
|
"eslint": "^9",
|
|
35
35
|
"eslint-config-next": "^15",
|
|
36
|
-
"husky": "^9
|
|
36
|
+
"husky": "^9",
|
|
37
37
|
"next": "^15",
|
|
38
38
|
"next-intl": "^4",
|
|
39
39
|
"react": "^19",
|
|
40
40
|
"react-copy-to-clipboard": "^5",
|
|
41
41
|
"react-dom": "^19",
|
|
42
42
|
"react-hot-toast": "^2",
|
|
43
|
-
"react-photo-view": "^1
|
|
43
|
+
"react-photo-view": "^1",
|
|
44
44
|
"react-slick": "^0",
|
|
45
45
|
"react-tooltip": "^5",
|
|
46
|
-
"rimraf": "^6
|
|
46
|
+
"rimraf": "^6",
|
|
47
47
|
"slick-carousel": "^1",
|
|
48
48
|
"tailwindcss": "^4",
|
|
49
49
|
"typescript": "^5",
|
|
50
|
-
"uuid": "^11
|
|
50
|
+
"uuid": "^11",
|
|
51
51
|
"zod": "^3"
|
|
52
52
|
}
|
|
53
53
|
}
|