@react-pakistan/util-functions 1.25.62 → 1.25.64
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.
|
@@ -59,10 +59,11 @@ export declare const GenericDrawer: FC<GenericDrawerProps>;
|
|
|
59
59
|
interface GenericModulePageProps {
|
|
60
60
|
config: ComponentConfig;
|
|
61
61
|
context: any;
|
|
62
|
-
tableBodyCols: TableBodyCol[];
|
|
63
62
|
headerActions?: HeaderAction[];
|
|
64
|
-
rowActions?: RowAction[];
|
|
65
63
|
iconMap?: Record<string, any>;
|
|
64
|
+
overrideConfig?: ComponentConfig;
|
|
65
|
+
rowActions?: RowAction[];
|
|
66
|
+
tableBodyCols: TableBodyCol[];
|
|
66
67
|
}
|
|
67
68
|
export declare const createGenericModulePage: (config: ComponentConfig) => React.FC<GenericModulePageProps>;
|
|
68
69
|
export {};
|
|
@@ -6,6 +6,17 @@
|
|
|
6
6
|
*/
|
|
7
7
|
'use client';
|
|
8
8
|
"use strict";
|
|
9
|
+
var __assign = (this && this.__assign) || function () {
|
|
10
|
+
__assign = Object.assign || function(t) {
|
|
11
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
12
|
+
s = arguments[i];
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
}
|
|
16
|
+
return t;
|
|
17
|
+
};
|
|
18
|
+
return __assign.apply(this, arguments);
|
|
19
|
+
};
|
|
9
20
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
21
|
if (k2 === undefined) k2 = k;
|
|
11
22
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -71,7 +82,7 @@ var GenericTable = function (_a) {
|
|
|
71
82
|
// Build header actions from context or props
|
|
72
83
|
var allHeaderActions = (0, react_1.useMemo)(function () { return headerActions || context.headerActions || []; }, [headerActions, context.headerActions]);
|
|
73
84
|
var numberOfFilters = (0, react_1.useMemo)(function () {
|
|
74
|
-
return Object.keys(context.state).filter(function (k) { return k.startsWith('filter') &&
|
|
85
|
+
return Object.keys(context.state).filter(function (k) { return k.startsWith('filter') && context.state[k] !== undefined; }).length;
|
|
75
86
|
}, [context.state]);
|
|
76
87
|
return (react_1.default.createElement("div", { className: "space-y-4 ".concat(isRTL ? 'rtl' : 'ltr'), dir: isRTL ? 'rtl' : 'ltr' },
|
|
77
88
|
react_1.default.createElement(enhanced_table_1.EnhancedTable, { currentPage: Number(context.state.currentPage), handleNextOnClick: context.handlePageChange, handleOnSelect: context.handlePageLimitChange, handlePreviousOnClick: function () {
|
|
@@ -108,9 +119,9 @@ var GenericDrawer = function (_a) {
|
|
|
108
119
|
exports.GenericDrawer = GenericDrawer;
|
|
109
120
|
var createGenericModulePage = function (config) {
|
|
110
121
|
var GenericModulePage = function (_a) {
|
|
111
|
-
var context = _a.context,
|
|
122
|
+
var context = _a.context, headerActions = _a.headerActions, iconMap = _a.iconMap, overrideConfig = _a.overrideConfig, rowActions = _a.rowActions, tableBodyCols = _a.tableBodyCols;
|
|
112
123
|
return (react_1.default.createElement("div", { className: "space-y-6" },
|
|
113
|
-
react_1.default.createElement(exports.GenericTable, { config: config, context: context, tableBodyCols: tableBodyCols, headerActions: headerActions, rowActions: rowActions, iconMap: iconMap }),
|
|
124
|
+
react_1.default.createElement(exports.GenericTable, { config: __assign(__assign({}, config), overrideConfig), context: context, tableBodyCols: tableBodyCols, headerActions: headerActions, rowActions: rowActions, iconMap: iconMap }),
|
|
114
125
|
react_1.default.createElement(exports.GenericDrawer, { config: config, context: context, filterContent: config.filterContent, formContent: config.formContent, moreActionsContent: config.moreActionsContent, viewContent: config.viewContent }),
|
|
115
126
|
react_1.default.createElement(sonner_1.Toaster, null)));
|
|
116
127
|
};
|