@portnet/ui 0.1.46 → 0.1.47
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,7 +50,6 @@ const PuiStandardSearchPageContainer = _ref => {
|
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
52
|
const PuiSearchPage = _ref2 => {
|
|
53
|
-
var _tableProps$rows, _tableProps$columns;
|
|
54
53
|
let {
|
|
55
54
|
formik,
|
|
56
55
|
formikProps,
|
|
@@ -74,14 +73,6 @@ const PuiSearchPage = _ref2 => {
|
|
|
74
73
|
const toggleSearchSection = () => {
|
|
75
74
|
setSearchSectionExpanded(prev => !prev);
|
|
76
75
|
};
|
|
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
|
-
}));
|
|
85
76
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiDefaultPage.default, {
|
|
86
77
|
title: title,
|
|
87
78
|
titleIcon: titleIcon,
|
|
@@ -110,7 +101,7 @@ const PuiSearchPage = _ref2 => {
|
|
|
110
101
|
sx: {
|
|
111
102
|
marginBottom: 2
|
|
112
103
|
},
|
|
113
|
-
children:
|
|
104
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_formik.Formik, _objectSpread(_objectSpread({
|
|
114
105
|
initialValues: {}
|
|
115
106
|
}, formikProps), {}, {
|
|
116
107
|
children: _ref3 => {
|
|
@@ -118,95 +109,69 @@ const PuiSearchPage = _ref2 => {
|
|
|
118
109
|
resetForm,
|
|
119
110
|
submitForm
|
|
120
111
|
} = _ref3;
|
|
121
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
122
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
112
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiFormikForm.default, {
|
|
113
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
|
|
114
|
+
container: true,
|
|
115
|
+
spacing: 2,
|
|
116
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
|
|
117
|
+
item: true,
|
|
118
|
+
xs: 12,
|
|
119
|
+
sm: 4,
|
|
120
|
+
children: [_children[0], " "]
|
|
121
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
|
|
122
|
+
item: true,
|
|
123
|
+
xs: 12,
|
|
124
|
+
sm: 4,
|
|
125
|
+
children: [_children[1], " "]
|
|
126
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
|
|
127
|
+
item: true,
|
|
128
|
+
xs: 12,
|
|
129
|
+
sm: 4,
|
|
130
|
+
children: [_children[2], " "]
|
|
131
|
+
}), isSearchSectionExpanded && _children.slice(3).map((child, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
132
|
+
item: true,
|
|
133
|
+
xs: 12,
|
|
134
|
+
sm: 4,
|
|
135
|
+
children: child
|
|
136
|
+
}, index))]
|
|
137
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
|
|
138
|
+
container: true,
|
|
139
|
+
justifyContent: "end",
|
|
140
|
+
spacing: 2,
|
|
141
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
142
|
+
item: true,
|
|
143
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
144
|
+
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiIcon.default, {
|
|
145
|
+
type: "effacer",
|
|
146
|
+
size: "small"
|
|
147
|
+
}),
|
|
148
|
+
onClick: resetForm,
|
|
149
|
+
color: "tertiary",
|
|
150
|
+
children: "Effacer"
|
|
151
|
+
})
|
|
152
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
153
|
+
item: true,
|
|
154
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
155
|
+
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiIcon.default, {
|
|
156
|
+
type: "rechercher",
|
|
157
|
+
size: "small"
|
|
158
|
+
}),
|
|
159
|
+
onClick: submitForm,
|
|
160
|
+
loadingPosition: "start",
|
|
161
|
+
children: "Rechercher"
|
|
162
|
+
})
|
|
163
|
+
}), additionalActions && additionalActions.map((actionItem, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
164
|
+
item: true,
|
|
165
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
166
|
+
startIcon: actionItem.icon,
|
|
167
|
+
onClick: actionItem.action,
|
|
168
|
+
children: actionItem.name
|
|
169
|
+
})
|
|
170
|
+
}, index))]
|
|
171
|
+
})]
|
|
159
172
|
});
|
|
160
173
|
}
|
|
161
|
-
}))
|
|
162
|
-
actions: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
|
|
163
|
-
container: true,
|
|
164
|
-
justifyContent: "end",
|
|
165
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
166
|
-
item: true,
|
|
167
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
168
|
-
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiIcon.default, {
|
|
169
|
-
type: "effacer",
|
|
170
|
-
size: "small"
|
|
171
|
-
}),
|
|
172
|
-
onClick: onReset,
|
|
173
|
-
color: "tertiary",
|
|
174
|
-
children: "Effacer"
|
|
175
|
-
})
|
|
176
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
177
|
-
item: true,
|
|
178
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
179
|
-
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiIcon.default, {
|
|
180
|
-
type: "rechercher",
|
|
181
|
-
size: "small"
|
|
182
|
-
}),
|
|
183
|
-
onClick: onSubmit,
|
|
184
|
-
loadingPosition: "start",
|
|
185
|
-
children: "Rechercher"
|
|
186
|
-
})
|
|
187
|
-
}), additionalActions && additionalActions.map((actionItem, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
188
|
-
item: true,
|
|
189
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
190
|
-
startIcon: actionItem.icon,
|
|
191
|
-
onClick: actionItem.action,
|
|
192
|
-
children: actionItem.name
|
|
193
|
-
})
|
|
194
|
-
}, index))]
|
|
195
|
-
}),
|
|
196
|
-
children: _children
|
|
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
|
-
})
|
|
174
|
+
}))
|
|
210
175
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTable.default, _objectSpread(_objectSpread({
|
|
211
176
|
paginationMode: "server"
|
|
212
177
|
}, tableProps), {}, {
|
|
@@ -225,9 +190,7 @@ PuiSearchPage.propTypes = {
|
|
|
225
190
|
bottomNav: _propTypes.default.bool,
|
|
226
191
|
loading: _propTypes.default.bool,
|
|
227
192
|
tableProps: _propTypes.default.shape({
|
|
228
|
-
|
|
229
|
-
columns: _propTypes.default.array,
|
|
230
|
-
pinnedColumns: _propTypes.default.object // Added pinnedColumns prop type
|
|
193
|
+
pinnedColumns: _propTypes.default.object
|
|
231
194
|
}),
|
|
232
195
|
retour: _propTypes.default.bool,
|
|
233
196
|
onRetour: _propTypes.default.func,
|