@portnet/ui 0.1.45 → 0.1.46
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.
|
@@ -50,6 +50,7 @@ const PuiStandardSearchPageContainer = _ref => {
|
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
52
|
const PuiSearchPage = _ref2 => {
|
|
53
|
+
var _tableProps$rows, _tableProps$columns;
|
|
53
54
|
let {
|
|
54
55
|
formik,
|
|
55
56
|
formikProps,
|
|
@@ -73,6 +74,14 @@ const PuiSearchPage = _ref2 => {
|
|
|
73
74
|
const toggleSearchSection = () => {
|
|
74
75
|
setSearchSectionExpanded(prev => !prev);
|
|
75
76
|
};
|
|
77
|
+
|
|
78
|
+
// Extract the first row for display when collapsed
|
|
79
|
+
const firstRow = (tableProps === null || tableProps === void 0 || (_tableProps$rows = tableProps.rows) === null || _tableProps$rows === void 0 ? void 0 : _tableProps$rows[0]) || {};
|
|
80
|
+
const firstRowColumns = tableProps === null || tableProps === void 0 || (_tableProps$columns = tableProps.columns) === null || _tableProps$columns === void 0 ? void 0 : _tableProps$columns.map(col => ({
|
|
81
|
+
field: col.field,
|
|
82
|
+
headerName: col.headerName,
|
|
83
|
+
value: firstRow[col.field] || "-"
|
|
84
|
+
}));
|
|
76
85
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiDefaultPage.default, {
|
|
77
86
|
title: title,
|
|
78
87
|
titleIcon: titleIcon,
|
|
@@ -101,7 +110,7 @@ const PuiSearchPage = _ref2 => {
|
|
|
101
110
|
sx: {
|
|
102
111
|
marginBottom: 2
|
|
103
112
|
},
|
|
104
|
-
children: isSearchSectionExpanded
|
|
113
|
+
children: isSearchSectionExpanded ? formik ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_formik.Formik, _objectSpread(_objectSpread({
|
|
105
114
|
initialValues: {}
|
|
106
115
|
}, formikProps), {}, {
|
|
107
116
|
children: _ref3 => {
|
|
@@ -185,7 +194,19 @@ const PuiSearchPage = _ref2 => {
|
|
|
185
194
|
}, index))]
|
|
186
195
|
}),
|
|
187
196
|
children: _children
|
|
188
|
-
}))
|
|
197
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
198
|
+
container: true,
|
|
199
|
+
spacing: 2,
|
|
200
|
+
children: firstRowColumns === null || firstRowColumns === void 0 ? void 0 : firstRowColumns.map(col => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
|
|
201
|
+
item: true,
|
|
202
|
+
xs: 12,
|
|
203
|
+
sm: 6,
|
|
204
|
+
md: 4,
|
|
205
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("strong", {
|
|
206
|
+
children: [col.headerName, ":"]
|
|
207
|
+
}), " ", col.value]
|
|
208
|
+
}, col.field))
|
|
209
|
+
})
|
|
189
210
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTable.default, _objectSpread(_objectSpread({
|
|
190
211
|
paginationMode: "server"
|
|
191
212
|
}, tableProps), {}, {
|
|
@@ -204,6 +225,8 @@ PuiSearchPage.propTypes = {
|
|
|
204
225
|
bottomNav: _propTypes.default.bool,
|
|
205
226
|
loading: _propTypes.default.bool,
|
|
206
227
|
tableProps: _propTypes.default.shape({
|
|
228
|
+
rows: _propTypes.default.array,
|
|
229
|
+
columns: _propTypes.default.array,
|
|
207
230
|
pinnedColumns: _propTypes.default.object // Added pinnedColumns prop type
|
|
208
231
|
}),
|
|
209
232
|
retour: _propTypes.default.bool,
|