@portnet/ui 0.1.49 → 0.1.50
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.
|
@@ -47,6 +47,7 @@ const PuiSearchPage = _ref => {
|
|
|
47
47
|
onRetour,
|
|
48
48
|
onReset,
|
|
49
49
|
onSubmit,
|
|
50
|
+
children,
|
|
50
51
|
additionalActions,
|
|
51
52
|
collapsibleSearchSection = true // Collapsible by default
|
|
52
53
|
} = _ref;
|
|
@@ -58,9 +59,9 @@ const PuiSearchPage = _ref => {
|
|
|
58
59
|
// Extract the columns from tableProps
|
|
59
60
|
const {
|
|
60
61
|
columns
|
|
61
|
-
} = tableProps ||
|
|
62
|
-
const
|
|
63
|
-
const additionalFields = columns.slice(3); // Remaining
|
|
62
|
+
} = tableProps || [];
|
|
63
|
+
const alwaysVisibleFields = columns.slice(0, 3); // First three fields
|
|
64
|
+
const additionalFields = columns.slice(3); // Remaining fields
|
|
64
65
|
|
|
65
66
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiDefaultPage.default, {
|
|
66
67
|
title: title,
|
|
@@ -102,38 +103,16 @@ const PuiSearchPage = _ref => {
|
|
|
102
103
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
|
|
103
104
|
container: true,
|
|
104
105
|
spacing: 2,
|
|
105
|
-
children: [
|
|
106
|
+
children: [alwaysVisibleFields.map((field, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
106
107
|
item: true,
|
|
107
108
|
xs: 12,
|
|
108
109
|
sm: 4,
|
|
109
|
-
children:
|
|
110
|
-
|
|
111
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
112
|
-
name: column.field,
|
|
113
|
-
placeholder: column.headerName,
|
|
114
|
-
style: {
|
|
115
|
-
width: "100%",
|
|
116
|
-
padding: "8px",
|
|
117
|
-
borderRadius: "4px",
|
|
118
|
-
border: "1px solid #ccc"
|
|
119
|
-
}
|
|
120
|
-
})]
|
|
121
|
-
}, index)), isSearchSectionExpanded && additionalFields.map((column, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
|
|
110
|
+
children: field.renderCell || field.headerName
|
|
111
|
+
}, index)), isSearchSectionExpanded && additionalFields.map((field, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
122
112
|
item: true,
|
|
123
113
|
xs: 12,
|
|
124
114
|
sm: 4,
|
|
125
|
-
children:
|
|
126
|
-
children: column.headerName
|
|
127
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
128
|
-
name: column.field,
|
|
129
|
-
placeholder: column.headerName,
|
|
130
|
-
style: {
|
|
131
|
-
width: "100%",
|
|
132
|
-
padding: "8px",
|
|
133
|
-
borderRadius: "4px",
|
|
134
|
-
border: "1px solid #ccc"
|
|
135
|
-
}
|
|
136
|
-
})]
|
|
115
|
+
children: field.renderCell || field.headerName
|
|
137
116
|
}, index))]
|
|
138
117
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
|
|
139
118
|
container: true,
|
|
@@ -193,7 +172,8 @@ PuiSearchPage.propTypes = {
|
|
|
193
172
|
tableProps: _propTypes.default.shape({
|
|
194
173
|
columns: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
195
174
|
field: _propTypes.default.string.isRequired,
|
|
196
|
-
headerName: _propTypes.default.string.isRequired
|
|
175
|
+
headerName: _propTypes.default.string.isRequired,
|
|
176
|
+
renderCell: _propTypes.default.node
|
|
197
177
|
})).isRequired,
|
|
198
178
|
pinnedColumns: _propTypes.default.object
|
|
199
179
|
}),
|