@portnet/ui 0.1.37 → 0.1.40
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.
|
@@ -13,11 +13,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
var React = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _apperance = require("../../config/apperance");
|
|
15
15
|
var _PuiTooltip = _interopRequireDefault(require("./PuiTooltip"));
|
|
16
|
-
var _CheckCircle = _interopRequireDefault(require("@mui/icons-material/CheckCircle"));
|
|
17
|
-
var _Error = _interopRequireDefault(require("@mui/icons-material/Error"));
|
|
18
|
-
var _HourglassEmpty = _interopRequireDefault(require("@mui/icons-material/HourglassEmpty"));
|
|
19
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
const _excluded = ["id", "className", "sx", "color", "fullWidth", "children"
|
|
17
|
+
const _excluded = ["id", "className", "sx", "color", "fullWidth", "children"];
|
|
21
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -49,23 +46,6 @@ const PrimaryChip = (0, _styles.styled)( /*#__PURE__*/React.forwardRef((props, r
|
|
|
49
46
|
}
|
|
50
47
|
};
|
|
51
48
|
});
|
|
52
|
-
const iconMapping = {
|
|
53
|
-
success: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckCircle.default, {
|
|
54
|
-
style: {
|
|
55
|
-
color: 'white'
|
|
56
|
-
}
|
|
57
|
-
}),
|
|
58
|
-
error: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Error.default, {
|
|
59
|
-
style: {
|
|
60
|
-
color: 'white'
|
|
61
|
-
}
|
|
62
|
-
}),
|
|
63
|
-
info: /*#__PURE__*/(0, _jsxRuntime.jsx)(_HourglassEmpty.default, {
|
|
64
|
-
style: {
|
|
65
|
-
color: 'white'
|
|
66
|
-
}
|
|
67
|
-
})
|
|
68
|
-
};
|
|
69
49
|
const SecondaryChip = (0, _styles.styled)( /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledChip, _objectSpread({
|
|
70
50
|
ref: ref
|
|
71
51
|
}, props))))(() => {
|
|
@@ -137,8 +117,7 @@ const PuiChip = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
137
117
|
sx,
|
|
138
118
|
color,
|
|
139
119
|
fullWidth,
|
|
140
|
-
children
|
|
141
|
-
icon
|
|
120
|
+
children
|
|
142
121
|
} = _ref,
|
|
143
122
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
144
123
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTooltip.default, {
|
|
@@ -153,10 +132,7 @@ const PuiChip = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
153
132
|
width: fullWidth ? "100%" : "fit-content"
|
|
154
133
|
}),
|
|
155
134
|
className,
|
|
156
|
-
label: children
|
|
157
|
-
icon: icon ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
158
|
-
children: iconMapping[icon]
|
|
159
|
-
}) : null
|
|
135
|
+
label: children
|
|
160
136
|
}, rest))
|
|
161
137
|
});
|
|
162
138
|
});
|
|
@@ -165,8 +141,7 @@ PuiChip.propTypes = {
|
|
|
165
141
|
className: _propTypes.default.string,
|
|
166
142
|
sx: _propTypes.default.object,
|
|
167
143
|
fullWidth: _propTypes.default.bool,
|
|
168
|
-
color: _propTypes.default.oneOf(["primary", "secondary", "info", "success", "warning", "error"])
|
|
169
|
-
icon: _propTypes.default.oneOf(["success", "error", "info"]) // Prop icon pour spécifier l'icône
|
|
144
|
+
color: _propTypes.default.oneOf(["primary", "secondary", "info", "success", "warning", "error"])
|
|
170
145
|
};
|
|
171
146
|
PuiChip.defaultProps = {
|
|
172
147
|
color: "primary"
|
|
@@ -18,8 +18,9 @@ var _PuiCheckbox = _interopRequireDefault(require("../inputs/PuiCheckbox"));
|
|
|
18
18
|
var _PuiIcon = _interopRequireDefault(require("../others/PuiIcon"));
|
|
19
19
|
var _PuiTooltip = _interopRequireDefault(require("../others/PuiTooltip"));
|
|
20
20
|
var _PuiTableAction = _interopRequireDefault(require("./PuiTableAction"));
|
|
21
|
-
var _ActionPopover = _interopRequireDefault(require("./ActionPopover"));
|
|
22
21
|
var _system = require("@mui/system");
|
|
22
|
+
var _KeyboardArrowDown = _interopRequireDefault(require("@mui/icons-material/KeyboardArrowDown"));
|
|
23
|
+
var _KeyboardArrowUp = _interopRequireDefault(require("@mui/icons-material/KeyboardArrowUp"));
|
|
23
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
25
|
const _excluded = ["id", "className", "sx", "elevate", "rows", "rowCount", "columns", "paginationMode", "page", "pageSize", "checkboxSelection", "loading", "stripped", "actions", "oneActionOnly", "onSelect", "onPageChange", "onPageSizeChange", "rowDetailPanel"];
|
|
25
26
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -31,251 +32,21 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
31
32
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
32
33
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
34
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
34
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
35
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // Styles for your DataGrid
|
|
35
36
|
const StyledMuiTable = (0, _styles.styled)( /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGrid.DataGrid, _objectSpread({
|
|
36
37
|
ref: ref
|
|
37
38
|
}, props))))(() => {
|
|
38
39
|
return {
|
|
39
40
|
"&.MuiDataGrid-root": {
|
|
40
41
|
fontSize: ".8em",
|
|
41
|
-
"& .tableActionColumn": {
|
|
42
|
-
"& .MuiDataGrid-columnHeaderTitle": {
|
|
43
|
-
justifyContent: "center",
|
|
44
|
-
display: "flex"
|
|
45
|
-
},
|
|
46
|
-
"& .MuiDataGrid-columnHeaderTitleContainer": {
|
|
47
|
-
justifyContent: "center"
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
"&.elevate": {
|
|
51
|
-
boxShadow: "0px 2px 1px -1px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%), 0px 1px 3px 0px rgb(0 0 0 / 12%)"
|
|
52
|
-
},
|
|
53
42
|
backgroundColor: _apperance.palette.gray.light,
|
|
54
|
-
border: "2px solid ".concat(_apperance.palette.gray.dark)
|
|
55
|
-
"& .MuiPaginationItem-root": {
|
|
56
|
-
"&.Mui-selected": {
|
|
57
|
-
color: _apperance.palette.white,
|
|
58
|
-
backgroundColor: _apperance.palette.primary
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
"&.table-loading .MuiDataGrid-virtualScroller, &.table-loading .MuiDataGrid-footerContainer": {
|
|
62
|
-
filter: "blur(1px)",
|
|
63
|
-
"&::before": {
|
|
64
|
-
content: "''",
|
|
65
|
-
width: "100%",
|
|
66
|
-
height: "100%",
|
|
67
|
-
backgroundColor: _apperance.palette.white,
|
|
68
|
-
position: "absolute",
|
|
69
|
-
zIndex: 1,
|
|
70
|
-
display: "block",
|
|
71
|
-
opacity: 0
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
"&.table-stripped .MuiDataGrid-row": {
|
|
75
|
-
"&:nth-of-type(even)": {
|
|
76
|
-
backgroundColor: _apperance.palette.gray.light
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
"& .MuiLinearProgress-root": {
|
|
80
|
-
zIndex: 1,
|
|
81
|
-
backgroundColor: _apperance.palette.info,
|
|
82
|
-
"& .MuiLinearProgress-bar": {
|
|
83
|
-
backgroundColor: _apperance.palette.primary
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
"& .MuiDataGrid-columnHeaders": {
|
|
87
|
-
"& .MuiDataGrid-columnHeader": {
|
|
88
|
-
"& .MuiDataGrid-columnHeaderTitle": {
|
|
89
|
-
display: "flex",
|
|
90
|
-
alignItems: "center",
|
|
91
|
-
fontWeight: "600",
|
|
92
|
-
color: _apperance.palette.primary,
|
|
93
|
-
whiteSpace: "normal",
|
|
94
|
-
lineHeight: "1.2em"
|
|
95
|
-
},
|
|
96
|
-
"&:focus-within": {
|
|
97
|
-
outline: "none"
|
|
98
|
-
},
|
|
99
|
-
"&:last-of-type .MuiDataGrid-columnSeparator": {
|
|
100
|
-
display: "none"
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
"& .MuiDataGrid-columnSeparator": {
|
|
104
|
-
color: _apperance.palette.gray.dark
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
"& .MuiDataGrid-cell": {
|
|
108
|
-
paddingTop: "2px",
|
|
109
|
-
paddingBottom: "2px",
|
|
110
|
-
whiteSpace: "normal",
|
|
111
|
-
textOverflow: "ellipsis",
|
|
112
|
-
overflow: "hidden",
|
|
113
|
-
maxHeight: "none",
|
|
114
|
-
minWidth: 'maxWidth',
|
|
115
|
-
wordBreak: "break-word",
|
|
116
|
-
"&.tableAction": {
|
|
117
|
-
justifyContent: "center",
|
|
118
|
-
position: "relative",
|
|
119
|
-
overflow: "initial !important"
|
|
120
|
-
},
|
|
121
|
-
"&:focus-within": {
|
|
122
|
-
outline: "none"
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
"& .MuiDataGrid-row": {
|
|
126
|
-
maxHeight: "none !important",
|
|
127
|
-
"&:nth-of-type(odd)": {
|
|
128
|
-
backgroundColor: "#ffffff" // color for odd rows
|
|
129
|
-
},
|
|
130
|
-
"&:nth-of-type(even)": {
|
|
131
|
-
backgroundColor: "#F6F9FF" // color for even rows
|
|
132
|
-
},
|
|
133
|
-
"&:hover": {
|
|
134
|
-
backgroundColor: "#95C7FC"
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
"& .MuiDataGrid-virtualScrollerContent": {
|
|
138
|
-
"& .MuiDataGrid-row": {
|
|
139
|
-
maxHeight: "none !important"
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
"& .MuiDataGrid-virtualScroller": {
|
|
143
|
-
backgroundColor: _apperance.palette.white
|
|
144
|
-
},
|
|
145
|
-
"& .MuiDataGrid-footerContainer": {
|
|
146
|
-
backgroundColor: _apperance.palette.white,
|
|
147
|
-
height: "28px",
|
|
148
|
-
minHeight: "28px"
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
});
|
|
153
|
-
const localeText = {
|
|
154
|
-
noRowsLabel: "Aucune ligne",
|
|
155
|
-
footerRowSelected: count => count !== 1 ? "".concat(count.toLocaleString(), " lignes s\xE9lectionn\xE9es") : "".concat(count.toLocaleString(), " ligne s\xE9lectionn\xE9e"),
|
|
156
|
-
footerTotalVisibleRows: (visibleCount, totalCount) => "".concat(visibleCount.toLocaleString(), " de ").concat(totalCount.toLocaleString()),
|
|
157
|
-
MuiTablePagination: {
|
|
158
|
-
labelDisplayedRows: _ref => {
|
|
159
|
-
let {
|
|
160
|
-
from,
|
|
161
|
-
to,
|
|
162
|
-
count
|
|
163
|
-
} = _ref;
|
|
164
|
-
return "".concat(from, "\u2013").concat(to, " de ").concat(count !== -1 ? count : "plus que ".concat(to));
|
|
165
|
-
},
|
|
166
|
-
labelRowsPerPage: "Lignes par page"
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
const TableActions = _ref2 => {
|
|
170
|
-
let {
|
|
171
|
-
row,
|
|
172
|
-
actions
|
|
173
|
-
} = _ref2;
|
|
174
|
-
const [isOpen, setIsOpen] = React.useState(false);
|
|
175
|
-
const actionsRef = React.useRef();
|
|
176
|
-
const outsideClickHandler = React.useCallback(event => {
|
|
177
|
-
if (Boolean(actionsRef.current) && !actionsRef.current.contains(event.target)) {
|
|
178
|
-
closeHandler();
|
|
179
|
-
}
|
|
180
|
-
if (!Boolean(actionsRef.current)) {
|
|
181
|
-
document.removeEventListener("mouseup", outsideClickHandler, false);
|
|
43
|
+
border: "2px solid ".concat(_apperance.palette.gray.dark)
|
|
182
44
|
}
|
|
183
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
184
|
-
}, []);
|
|
185
|
-
const openHandler = () => {
|
|
186
|
-
document.addEventListener("mouseup", outsideClickHandler, false);
|
|
187
|
-
setIsOpen(true);
|
|
188
|
-
};
|
|
189
|
-
const closeHandler = () => {
|
|
190
|
-
document.removeEventListener("mouseup", outsideClickHandler, false);
|
|
191
|
-
setIsOpen(false);
|
|
192
45
|
};
|
|
193
|
-
React.useEffect(() => {
|
|
194
|
-
return () => {
|
|
195
|
-
document.removeEventListener("mouseup", outsideClickHandler, false);
|
|
196
|
-
};
|
|
197
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
198
|
-
}, []);
|
|
199
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
200
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTableAction.default, {
|
|
201
|
-
title: "Voir plus",
|
|
202
|
-
color: "primary",
|
|
203
|
-
onClick: openHandler,
|
|
204
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiIcon.default, {
|
|
205
|
-
type: "voir-plus"
|
|
206
|
-
})
|
|
207
|
-
}), Boolean(isOpen) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Paper, {
|
|
208
|
-
ref: actionsRef,
|
|
209
|
-
elevation: 1,
|
|
210
|
-
sx: {
|
|
211
|
-
borderRadius: "5px",
|
|
212
|
-
position: "absolute",
|
|
213
|
-
right: "0",
|
|
214
|
-
top: "50%",
|
|
215
|
-
transform: "translate(0, -50%)",
|
|
216
|
-
display: "flex",
|
|
217
|
-
alignItems: "center",
|
|
218
|
-
gap: "8px",
|
|
219
|
-
paddingX: "11px",
|
|
220
|
-
height: "calc(100% - 4px)",
|
|
221
|
-
backgroundColor: _apperance.palette.gray.light,
|
|
222
|
-
border: "2px solid ".concat(_apperance.palette.gray.dark)
|
|
223
|
-
},
|
|
224
|
-
children: [actions.map((action, index) => /*#__PURE__*/React.cloneElement(action, {
|
|
225
|
-
row,
|
|
226
|
-
key: index
|
|
227
|
-
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTableAction.default, {
|
|
228
|
-
size: "small",
|
|
229
|
-
title: "Fermer",
|
|
230
|
-
color: "primary",
|
|
231
|
-
onClick: closeHandler,
|
|
232
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiIcon.default, {
|
|
233
|
-
type: "voir-plus"
|
|
234
|
-
})
|
|
235
|
-
})]
|
|
236
|
-
})]
|
|
237
|
-
});
|
|
238
|
-
};
|
|
239
|
-
const TablePagination = () => {
|
|
240
|
-
const apiRef = (0, _xDataGrid.useGridApiContext)();
|
|
241
|
-
const page = (0, _xDataGrid.useGridSelector)(apiRef, _xDataGrid.gridPageSelector);
|
|
242
|
-
const pageCount = (0, _xDataGrid.useGridSelector)(apiRef, _xDataGrid.gridPageCountSelector);
|
|
243
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Pagination, {
|
|
244
|
-
size: "small",
|
|
245
|
-
sx: {
|
|
246
|
-
position: "absolute",
|
|
247
|
-
left: "50%",
|
|
248
|
-
transform: "translateX(-50%)",
|
|
249
|
-
"& .MuiButtonBase-root": {
|
|
250
|
-
lineHeight: "1em",
|
|
251
|
-
fontSize: "1em",
|
|
252
|
-
minWidth: "20px",
|
|
253
|
-
height: "20px"
|
|
254
|
-
}
|
|
255
|
-
},
|
|
256
|
-
count: pageCount,
|
|
257
|
-
page: page + 1,
|
|
258
|
-
onChange: (event, value) => apiRef.current.setPage(value - 1),
|
|
259
|
-
showFirstButton: true,
|
|
260
|
-
showLastButton: true
|
|
261
|
-
});
|
|
262
|
-
};
|
|
263
|
-
const TableCheckbox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
264
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiCheckbox.default, _objectSpread(_objectSpread({
|
|
265
|
-
ref: ref
|
|
266
|
-
}, props), {}, {
|
|
267
|
-
formik: false,
|
|
268
|
-
sx: {
|
|
269
|
-
transform: "scale(.6)",
|
|
270
|
-
marginTop: "-4px"
|
|
271
|
-
}
|
|
272
|
-
}));
|
|
273
46
|
});
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
};
|
|
278
|
-
const PuiTable = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
47
|
+
|
|
48
|
+
// Define the table component
|
|
49
|
+
const PuiTable = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
279
50
|
let {
|
|
280
51
|
id,
|
|
281
52
|
className,
|
|
@@ -296,88 +67,65 @@ const PuiTable = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
296
67
|
onPageChange,
|
|
297
68
|
onPageSizeChange,
|
|
298
69
|
rowDetailPanel
|
|
299
|
-
} =
|
|
300
|
-
rest = _objectWithoutProperties(
|
|
301
|
-
const [
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
filterable: false,
|
|
308
|
-
width: 100,
|
|
309
|
-
renderCell: _ref4 => {
|
|
310
|
-
let {
|
|
311
|
-
row
|
|
312
|
-
} = _ref4;
|
|
313
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_system.Box, {
|
|
314
|
-
sx: {
|
|
315
|
-
display: 'flex',
|
|
316
|
-
gap: '8px',
|
|
317
|
-
// Adjust the space between icons as needed
|
|
318
|
-
flexWrap: 'wrap',
|
|
319
|
-
// Keep icons on the same line; remove if you want them to wrap
|
|
320
|
-
justifyContent: 'center',
|
|
321
|
-
// Center the icons horizontally
|
|
322
|
-
alignItems: 'center',
|
|
323
|
-
// Align icons vertically
|
|
324
|
-
minWidth: 0 // Prevent the flex container from stretching past its content width
|
|
325
|
-
},
|
|
326
|
-
children: actions.map((action, index) => /*#__PURE__*/React.cloneElement(action, {
|
|
327
|
-
row,
|
|
328
|
-
key: index,
|
|
329
|
-
sx: _objectSpread(_objectSpread({}, action.props.sx), {}, {
|
|
330
|
-
marginRight: 0,
|
|
331
|
-
// Remove any outer margins
|
|
332
|
-
'&:last-child': {
|
|
333
|
-
marginRight: 0 // Ensure the last item doesn't push the container width
|
|
334
|
-
}
|
|
335
|
-
})
|
|
336
|
-
}))
|
|
337
|
-
});
|
|
338
|
-
},
|
|
339
|
-
cellClassName: "tableAction",
|
|
340
|
-
headerClassName: "tableActionColumn"
|
|
341
|
-
}] : columns;
|
|
342
|
-
setAppColumns(newColumns.map(column => {
|
|
343
|
-
const renderCell = Boolean(column.renderCell) ? column.renderCell : Boolean(column.valueGetter) ? columnData => /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTooltip.default, {
|
|
344
|
-
title: Boolean(column.titleGetter) ? column.titleGetter(columnData.row) : String(column.valueGetter(columnData)),
|
|
345
|
-
children: column.valueGetter(columnData)
|
|
346
|
-
}) : Boolean(column.field) ? _ref5 => {
|
|
347
|
-
let {
|
|
348
|
-
row
|
|
349
|
-
} = _ref5;
|
|
350
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTooltip.default, {
|
|
351
|
-
title: Boolean(column.titleGetter) ? column.titleGetter(row) : String(row[column.field]),
|
|
352
|
-
children: row[column.field]
|
|
353
|
-
});
|
|
354
|
-
} : undefined;
|
|
355
|
-
return _objectSpread(_objectSpread({}, column), {}, {
|
|
356
|
-
renderCell
|
|
357
|
-
});
|
|
70
|
+
} = _ref,
|
|
71
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
72
|
+
const [expandedRows, setExpandedRows] = React.useState({});
|
|
73
|
+
|
|
74
|
+
// Toggle row expansion
|
|
75
|
+
const toggleRowExpansion = rowId => {
|
|
76
|
+
setExpandedRows(prev => _objectSpread(_objectSpread({}, prev), {}, {
|
|
77
|
+
[rowId]: !prev[rowId]
|
|
358
78
|
}));
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// Render the detail panel for expanded rows
|
|
82
|
+
const renderRowDetails = row => {
|
|
83
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Collapse, {
|
|
84
|
+
in: expandedRows[row.id],
|
|
85
|
+
timeout: "auto",
|
|
86
|
+
unmountOnExit: true,
|
|
87
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_system.Box, {
|
|
88
|
+
sx: {
|
|
89
|
+
padding: 2,
|
|
90
|
+
backgroundColor: "#f9f9f9"
|
|
91
|
+
},
|
|
92
|
+
children: rowDetailPanel && /*#__PURE__*/React.cloneElement(rowDetailPanel, {
|
|
93
|
+
rowData: row
|
|
94
|
+
})
|
|
95
|
+
})
|
|
368
96
|
});
|
|
369
97
|
};
|
|
370
|
-
|
|
98
|
+
|
|
99
|
+
// Add an extra column for the expand/collapse button
|
|
100
|
+
const appColumns = React.useMemo(() => [{
|
|
101
|
+
field: "expand",
|
|
102
|
+
headerName: "",
|
|
103
|
+
sortable: false,
|
|
104
|
+
width: 50,
|
|
105
|
+
renderCell: _ref2 => {
|
|
106
|
+
let {
|
|
107
|
+
row
|
|
108
|
+
} = _ref2;
|
|
109
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
110
|
+
"aria-label": "expand row",
|
|
111
|
+
size: "small",
|
|
112
|
+
onClick: () => toggleRowExpansion(row.id),
|
|
113
|
+
children: expandedRows[row.id] ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_KeyboardArrowUp.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_KeyboardArrowDown.default, {})
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}, ...columns // Spread the existing columns
|
|
117
|
+
], [columns, expandedRows]);
|
|
118
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
371
119
|
style: {
|
|
372
|
-
width:
|
|
120
|
+
width: "100%"
|
|
373
121
|
},
|
|
374
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledMuiTable, _objectSpread({
|
|
122
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledMuiTable, _objectSpread({
|
|
375
123
|
ref: ref,
|
|
376
124
|
id: id,
|
|
377
125
|
components: {
|
|
378
|
-
BaseCheckbox:
|
|
126
|
+
BaseCheckbox: _PuiCheckbox.default,
|
|
379
127
|
LoadingOverlay: _material.LinearProgress,
|
|
380
|
-
Pagination:
|
|
128
|
+
Pagination: _material.Pagination
|
|
381
129
|
},
|
|
382
130
|
className: "".concat(className, " ").concat(stripped ? "table-stripped" : "", " ").concat(loading ? "table-loading" : "", " ").concat(elevate ? "elevate" : ""),
|
|
383
131
|
sx: {
|
|
@@ -403,14 +151,28 @@ const PuiTable = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
403
151
|
density: "compact",
|
|
404
152
|
loading: loading,
|
|
405
153
|
paginationMode: paginationMode,
|
|
406
|
-
localeText:
|
|
407
|
-
|
|
154
|
+
localeText: {
|
|
155
|
+
noRowsLabel: "Aucune ligne",
|
|
156
|
+
footerRowSelected: count => count !== 1 ? "".concat(count.toLocaleString(), " lignes s\xE9lectionn\xE9es") : "".concat(count.toLocaleString(), " ligne s\xE9lectionn\xE9e"),
|
|
157
|
+
footerTotalVisibleRows: (visibleCount, totalCount) => "".concat(visibleCount.toLocaleString(), " de ").concat(totalCount.toLocaleString()),
|
|
158
|
+
MuiTablePagination: {
|
|
159
|
+
labelDisplayedRows: _ref3 => {
|
|
160
|
+
let {
|
|
161
|
+
from,
|
|
162
|
+
to,
|
|
163
|
+
count
|
|
164
|
+
} = _ref3;
|
|
165
|
+
return "".concat(from, "\u2013").concat(to, " de ").concat(count !== -1 ? count : "plus que ".concat(to));
|
|
166
|
+
},
|
|
167
|
+
labelRowsPerPage: "Lignes par page"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
408
170
|
onPageChange: onPageChange,
|
|
409
171
|
onPageSizeChange: onPageSizeChange,
|
|
410
|
-
onSelectionModelChange: onSelect
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
},
|
|
172
|
+
onSelectionModelChange: onSelect
|
|
173
|
+
}, rest)), rows.map(row => /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
|
|
174
|
+
children: expandedRows[row.id] && renderRowDetails(row)
|
|
175
|
+
}, row.id))]
|
|
414
176
|
});
|
|
415
177
|
});
|
|
416
178
|
PuiTable.propTypes = {
|
|
@@ -432,7 +194,6 @@ PuiTable.propTypes = {
|
|
|
432
194
|
onSelect: _propTypes.default.func,
|
|
433
195
|
onPageChange: _propTypes.default.func,
|
|
434
196
|
onPageSizeChange: _propTypes.default.func,
|
|
435
|
-
onSelectionModelChange: _propTypes.default.func,
|
|
436
197
|
rowDetailPanel: _propTypes.default.element
|
|
437
198
|
};
|
|
438
199
|
PuiTable.defaultProps = {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.symbol.description.js");
|
|
4
3
|
require("core-js/modules/es.weak-map.js");
|
|
4
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
require("core-js/modules/
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
require("core-js/modules/es.symbol.description.js");
|
|
12
10
|
var _formik = require("formik");
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _PuiButton = _interopRequireDefault(require("../../../buttons/PuiButton"));
|
|
14
14
|
var _PuiFormikForm = _interopRequireDefault(require("../../../others/PuiFormikForm"));
|
|
15
15
|
var _PuiGrid = _interopRequireDefault(require("../../../others/PuiGrid"));
|
|
@@ -17,18 +17,15 @@ var _PuiIcon = _interopRequireDefault(require("../../../others/PuiIcon"));
|
|
|
17
17
|
var _PuiSection = _interopRequireDefault(require("../../../others/PuiSection"));
|
|
18
18
|
var _PuiTable = _interopRequireDefault(require("../../../table/PuiTable"));
|
|
19
19
|
var _PuiDefaultPage = _interopRequireDefault(require("./PuiDefaultPage"));
|
|
20
|
-
var _ExpandMore = _interopRequireDefault(require("@mui/icons-material/ExpandMore"));
|
|
21
|
-
var _ExpandLess = _interopRequireDefault(require("@mui/icons-material/ExpandLess"));
|
|
22
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
21
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
25
22
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
24
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27
25
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28
26
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
27
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
30
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
31
|
-
// Arrow for expanded state
|
|
28
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
32
29
|
const PuiStandardSearchPageContainer = _ref => {
|
|
33
30
|
let {
|
|
34
31
|
actions,
|
|
@@ -64,14 +61,8 @@ const PuiSearchPage = _ref2 => {
|
|
|
64
61
|
onReset,
|
|
65
62
|
onSubmit,
|
|
66
63
|
children: _children,
|
|
67
|
-
additionalActions
|
|
68
|
-
collapsibleSearchSection = true // Collapsible by default
|
|
64
|
+
additionalActions
|
|
69
65
|
} = _ref2;
|
|
70
|
-
// Start with the section collapsed (not displayed on first render)
|
|
71
|
-
const [isSearchSectionExpanded, setSearchSectionExpanded] = (0, _react.useState)(false);
|
|
72
|
-
const toggleSearchSection = () => {
|
|
73
|
-
setSearchSectionExpanded(prev => !prev);
|
|
74
|
-
};
|
|
75
66
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiDefaultPage.default, {
|
|
76
67
|
title: title,
|
|
77
68
|
titleIcon: titleIcon,
|
|
@@ -83,129 +74,102 @@ const PuiSearchPage = _ref2 => {
|
|
|
83
74
|
retour: retour,
|
|
84
75
|
onRetour: onRetour,
|
|
85
76
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiSection.default, {
|
|
86
|
-
title:
|
|
87
|
-
onClick: toggleSearchSection,
|
|
88
|
-
style: {
|
|
89
|
-
display: "flex",
|
|
90
|
-
alignItems: "center",
|
|
91
|
-
cursor: collapsibleSearchSection ? "pointer" : "default" // Clickable only if collapsibleSearchSection is true
|
|
92
|
-
},
|
|
93
|
-
children: [collapsibleSearchSection && (isSearchSectionExpanded ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandLess.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandMore.default, {})), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
94
|
-
style: {
|
|
95
|
-
marginLeft: collapsibleSearchSection ? "8px" : "0px"
|
|
96
|
-
},
|
|
97
|
-
children: "Param\xE8tres de recherche"
|
|
98
|
-
}), " "]
|
|
99
|
-
}),
|
|
77
|
+
title: "Param\xE8tres de recherche",
|
|
100
78
|
sx: {
|
|
101
79
|
marginBottom: 2
|
|
102
80
|
},
|
|
103
|
-
children:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
81
|
+
children: formik ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_formik.Formik, _objectSpread(_objectSpread({
|
|
82
|
+
initialValues: {}
|
|
83
|
+
}, formikProps), {}, {
|
|
84
|
+
children: _ref3 => {
|
|
85
|
+
let {
|
|
86
|
+
resetForm,
|
|
87
|
+
submitForm
|
|
88
|
+
} = _ref3;
|
|
89
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiFormikForm.default, {
|
|
90
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PuiStandardSearchPageContainer, {
|
|
91
|
+
actions: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
|
|
92
|
+
container: true,
|
|
93
|
+
justifyContent: "end",
|
|
94
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
95
|
+
item: true,
|
|
96
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
97
|
+
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiIcon.default, {
|
|
98
|
+
type: "effacer",
|
|
99
|
+
size: "small"
|
|
100
|
+
}),
|
|
101
|
+
onClick: resetForm,
|
|
102
|
+
color: "tertiary",
|
|
103
|
+
children: "Effacer"
|
|
104
|
+
})
|
|
105
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
106
|
+
item: true,
|
|
107
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
108
|
+
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiIcon.default, {
|
|
109
|
+
type: "rechercher",
|
|
110
|
+
size: "small"
|
|
111
|
+
}),
|
|
112
|
+
onClick: submitForm,
|
|
113
|
+
loadingPosition: "start",
|
|
114
|
+
children: "Rechercher"
|
|
115
|
+
})
|
|
116
|
+
}), additionalActions && additionalActions.map((actionItem, index) => {
|
|
117
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
140
118
|
item: true,
|
|
141
119
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
142
120
|
startIcon: actionItem.icon,
|
|
143
121
|
onClick: actionItem.action,
|
|
144
122
|
children: actionItem.name
|
|
145
123
|
})
|
|
146
|
-
}, index)
|
|
147
|
-
})
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
})
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
})
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
})
|
|
124
|
+
}, index);
|
|
125
|
+
})]
|
|
126
|
+
}),
|
|
127
|
+
children: _children
|
|
128
|
+
})
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
})) : /*#__PURE__*/(0, _jsxRuntime.jsx)(PuiStandardSearchPageContainer, {
|
|
132
|
+
actions: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
|
|
133
|
+
container: true,
|
|
134
|
+
justifyContent: "end",
|
|
135
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
136
|
+
item: true,
|
|
137
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
138
|
+
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiIcon.default, {
|
|
139
|
+
type: "effacer",
|
|
140
|
+
size: "small"
|
|
141
|
+
}),
|
|
142
|
+
onClick: onReset,
|
|
143
|
+
color: "tertiary",
|
|
144
|
+
children: "Effacer"
|
|
145
|
+
})
|
|
146
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
147
|
+
item: true,
|
|
148
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
149
|
+
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiIcon.default, {
|
|
150
|
+
type: "rechercher",
|
|
151
|
+
size: "small"
|
|
152
|
+
}),
|
|
153
|
+
onClick: onSubmit,
|
|
154
|
+
loadingPosition: "start",
|
|
155
|
+
children: "Rechercher"
|
|
156
|
+
})
|
|
157
|
+
}), additionalActions && additionalActions.map((actionItem, index) => {
|
|
158
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
179
159
|
item: true,
|
|
180
160
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
181
161
|
startIcon: actionItem.icon,
|
|
182
162
|
onClick: actionItem.action,
|
|
183
163
|
children: actionItem.name
|
|
184
164
|
})
|
|
185
|
-
}, index)
|
|
186
|
-
})
|
|
187
|
-
|
|
188
|
-
|
|
165
|
+
}, index);
|
|
166
|
+
})]
|
|
167
|
+
}),
|
|
168
|
+
children: _children
|
|
189
169
|
})
|
|
190
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTable.default, _objectSpread(
|
|
170
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTable.default, _objectSpread({
|
|
191
171
|
paginationMode: "server"
|
|
192
|
-
}, tableProps)
|
|
193
|
-
sx: {
|
|
194
|
-
'& .MuiDataGrid-columnHeaders': {
|
|
195
|
-
backgroundColor: '#f5f5f5',
|
|
196
|
-
// Light gray background
|
|
197
|
-
fontWeight: 'bold',
|
|
198
|
-
textAlign: 'center',
|
|
199
|
-
padding: '10px 15px'
|
|
200
|
-
},
|
|
201
|
-
'& .MuiDataGrid-cell': {
|
|
202
|
-
padding: '8px 12px' // Adds padding for cells
|
|
203
|
-
},
|
|
204
|
-
'& .numeric-cell': {
|
|
205
|
-
textAlign: 'right' // Aligns numeric values to the right
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}))]
|
|
172
|
+
}, tableProps))]
|
|
209
173
|
});
|
|
210
174
|
};
|
|
211
175
|
PuiSearchPage.propTypes = {
|
|
@@ -227,13 +191,11 @@ PuiSearchPage.propTypes = {
|
|
|
227
191
|
name: _propTypes.default.string.isRequired,
|
|
228
192
|
action: _propTypes.default.func.isRequired,
|
|
229
193
|
icon: _propTypes.default.element
|
|
230
|
-
}))
|
|
231
|
-
collapsibleSearchSection: _propTypes.default.bool // New prop with default value
|
|
194
|
+
}))
|
|
232
195
|
};
|
|
233
196
|
PuiSearchPage.defaultProps = {
|
|
234
197
|
formik: true,
|
|
235
198
|
loading: false,
|
|
236
|
-
additionalActions: []
|
|
237
|
-
collapsibleSearchSection: true // Collapsible by default is true
|
|
199
|
+
additionalActions: []
|
|
238
200
|
};
|
|
239
201
|
var _default = exports.default = PuiSearchPage;
|