@portnet/ui 3.1.2 → 4.0.0
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.
- package/dist/components/buttons/PuiButton.js +88 -103
- package/dist/components/common/StyledMuiButton.js +3 -5
- package/dist/components/common/StyledMuiTextField.js +94 -58
- package/dist/components/inputs/PuiDateField.js +121 -57
- package/dist/components/inputs/PuiDateTimeField.js +27 -296
- package/dist/components/inputs/PuiSelect.js +28 -68
- package/dist/components/others/DateTimePickerField.js +210 -0
- package/dist/components/others/PuiSection.js +83 -20
- package/dist/components/referentiel/components/PuiSpecificReferentielField.js +6 -24
- package/dist/components/table/PuiTable.js +110 -41
- package/dist/components/typography/PuiMainTitle.js +57 -4
- package/dist/components/ui/pages/general/PuiSearchPage.js +56 -34
- package/dist/config/apperance.js +13 -85
- package/dist/index.js +0 -42
- package/package.json +105 -110
- package/dist/components/providers/PuiAntdProvider.js +0 -70
- package/dist/components/providers/PuiThemeProvider.js +0 -230
- package/dist/components/stepper/PuiStepContent.js +0 -66
- package/dist/components/stepper/PuiStepper.js +0 -184
- package/dist/components/stepper/PuiStepperActions.js +0 -105
- package/dist/components/table/PuiModernTable.js +0 -427
- package/dist/components-antd-optional/PuiAntdForm.js +0 -328
- package/dist/components-antd-optional/PuiAntdStepper.js +0 -317
- package/dist/components-antd-optional/PuiAntdTable.js +0 -352
- package/dist/config/antdTheme.js +0 -227
- package/dist/hooks/useCustomAxios.js +0 -36
|
@@ -33,13 +33,79 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
33
33
|
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; }
|
|
34
34
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
35
35
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
36
|
-
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); }
|
|
36
|
+
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); } // Helper function to get palette from theme or fallback to appearance
|
|
37
|
+
const getPalette = theme => {
|
|
38
|
+
// Check if theme has our custom palette properties
|
|
39
|
+
if (theme && theme.palette && theme.palette.gray && theme.palette.gray.darker) {
|
|
40
|
+
// Theme has our custom structure, now normalize it
|
|
41
|
+
return {
|
|
42
|
+
primary: theme.palette.primary.main || theme.palette.primary,
|
|
43
|
+
secondary: theme.palette.secondary.main || theme.palette.secondary,
|
|
44
|
+
error: theme.palette.error ? theme.palette.error.main || theme.palette.error : _apperance.palette.error,
|
|
45
|
+
warning: theme.palette.warning ? theme.palette.warning.main || theme.palette.warning : _apperance.palette.warning,
|
|
46
|
+
success: theme.palette.success ? theme.palette.success.main || theme.palette.success : _apperance.palette.success,
|
|
47
|
+
info: theme.palette.info ? theme.palette.info.main || theme.palette.info : _apperance.palette.info,
|
|
48
|
+
white: theme.palette.white || _apperance.palette.white,
|
|
49
|
+
dark: theme.palette.dark || _apperance.palette.dark,
|
|
50
|
+
gray: theme.palette.gray,
|
|
51
|
+
blue: theme.palette.blue || _apperance.palette.blue,
|
|
52
|
+
background: theme.palette.background || _apperance.palette.background,
|
|
53
|
+
border: theme.palette.border || _apperance.palette.border,
|
|
54
|
+
shadow: theme.palette.shadow || _apperance.palette.shadow
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
// Check if theme object itself has gray (root level)
|
|
58
|
+
if (theme && theme.gray && theme.gray.darker) {
|
|
59
|
+
return {
|
|
60
|
+
primary: theme.primary,
|
|
61
|
+
secondary: theme.secondary,
|
|
62
|
+
error: theme.error || _apperance.palette.error,
|
|
63
|
+
warning: theme.warning || _apperance.palette.warning,
|
|
64
|
+
success: theme.success || _apperance.palette.success,
|
|
65
|
+
info: theme.info || _apperance.palette.info,
|
|
66
|
+
white: theme.white || _apperance.palette.white,
|
|
67
|
+
dark: theme.dark || _apperance.palette.dark,
|
|
68
|
+
gray: theme.gray,
|
|
69
|
+
blue: theme.blue || _apperance.palette.blue,
|
|
70
|
+
background: theme.background || _apperance.palette.background,
|
|
71
|
+
border: theme.border || _apperance.palette.border,
|
|
72
|
+
shadow: theme.shadow || _apperance.palette.shadow
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
return _apperance.palette;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// Helper function to get PuiTable styles from theme
|
|
79
|
+
const getPuiTableStyles = theme => {
|
|
80
|
+
if (theme && theme.components && theme.components.PuiTable) {
|
|
81
|
+
return theme.components.PuiTable;
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
border: "2px solid ".concat(_apperance.palette.gray.dark),
|
|
85
|
+
marginTop: "0px",
|
|
86
|
+
rowHeight: {
|
|
87
|
+
maxHeight: "none",
|
|
88
|
+
minHeight: "auto",
|
|
89
|
+
lineHeight: "1.2em"
|
|
90
|
+
},
|
|
91
|
+
cellJustifyContent: "flex-start",
|
|
92
|
+
headerJustifyContent: "flex-start",
|
|
93
|
+
headerColor: _apperance.palette.primary,
|
|
94
|
+
headerFontSize: "1em",
|
|
95
|
+
virtualScrollerHeight: "auto"
|
|
96
|
+
};
|
|
97
|
+
};
|
|
37
98
|
const StyledMuiTable = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGrid.DataGrid, _objectSpread({
|
|
38
99
|
ref: ref
|
|
39
|
-
}, props))))(
|
|
100
|
+
}, props))))(props => {
|
|
101
|
+
var _themePalette$shadow, _palette$shadow;
|
|
102
|
+
const themePalette = getPalette(props.theme);
|
|
103
|
+
const tableStyles = getPuiTableStyles(props.theme);
|
|
40
104
|
return {
|
|
41
105
|
"&.MuiDataGrid-root": {
|
|
42
106
|
fontSize: ".8em",
|
|
107
|
+
border: "".concat(tableStyles.border, " !important"),
|
|
108
|
+
marginTop: "".concat(tableStyles.marginTop, " !important"),
|
|
43
109
|
"& .tableActionColumn": {
|
|
44
110
|
"& .MuiDataGrid-columnHeaderTitle": {
|
|
45
111
|
justifyContent: "center",
|
|
@@ -50,14 +116,13 @@ const StyledMuiTable = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props,
|
|
|
50
116
|
}
|
|
51
117
|
},
|
|
52
118
|
"&.elevate": {
|
|
53
|
-
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%)"
|
|
119
|
+
boxShadow: ((_themePalette$shadow = themePalette.shadow) === null || _themePalette$shadow === void 0 ? void 0 : _themePalette$shadow.medium) || ((_palette$shadow = _apperance.palette.shadow) === null || _palette$shadow === void 0 ? void 0 : _palette$shadow.medium) || "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%)"
|
|
54
120
|
},
|
|
55
|
-
backgroundColor:
|
|
56
|
-
border: "2px solid ".concat(_apperance.palette.gray.dark),
|
|
121
|
+
backgroundColor: themePalette.gray.light,
|
|
57
122
|
"& .MuiPaginationItem-root": {
|
|
58
123
|
"&.Mui-selected": {
|
|
59
|
-
color:
|
|
60
|
-
backgroundColor:
|
|
124
|
+
color: themePalette.white,
|
|
125
|
+
backgroundColor: themePalette.primary
|
|
61
126
|
}
|
|
62
127
|
},
|
|
63
128
|
"&.table-loading .MuiDataGrid-virtualScroller, &.table-loading .MuiDataGrid-footerContainer": {
|
|
@@ -66,7 +131,7 @@ const StyledMuiTable = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props,
|
|
|
66
131
|
content: "''",
|
|
67
132
|
width: "100%",
|
|
68
133
|
height: "100%",
|
|
69
|
-
backgroundColor:
|
|
134
|
+
backgroundColor: themePalette.white,
|
|
70
135
|
position: "absolute",
|
|
71
136
|
zIndex: 1,
|
|
72
137
|
display: "block",
|
|
@@ -75,14 +140,14 @@ const StyledMuiTable = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props,
|
|
|
75
140
|
},
|
|
76
141
|
"&.table-stripped .MuiDataGrid-row": {
|
|
77
142
|
"&:nth-of-type(even)": {
|
|
78
|
-
backgroundColor:
|
|
143
|
+
backgroundColor: themePalette.gray.light
|
|
79
144
|
}
|
|
80
145
|
},
|
|
81
146
|
"& .MuiLinearProgress-root": {
|
|
82
147
|
zIndex: 1,
|
|
83
|
-
backgroundColor:
|
|
148
|
+
backgroundColor: themePalette.info,
|
|
84
149
|
"& .MuiLinearProgress-bar": {
|
|
85
|
-
backgroundColor:
|
|
150
|
+
backgroundColor: themePalette.primary
|
|
86
151
|
}
|
|
87
152
|
},
|
|
88
153
|
"& .MuiDataGrid-columnHeaders": {
|
|
@@ -91,10 +156,14 @@ const StyledMuiTable = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props,
|
|
|
91
156
|
display: "flex",
|
|
92
157
|
alignItems: "center",
|
|
93
158
|
fontWeight: "600",
|
|
94
|
-
color:
|
|
159
|
+
color: "".concat(tableStyles.headerColor, " !important"),
|
|
160
|
+
fontSize: "".concat(tableStyles.headerFontSize, " !important"),
|
|
95
161
|
whiteSpace: "normal",
|
|
96
162
|
lineHeight: "1.2em"
|
|
97
163
|
},
|
|
164
|
+
"& .MuiDataGrid-columnHeaderTitleContainer": {
|
|
165
|
+
justifyContent: "".concat(tableStyles.headerJustifyContent, " !important")
|
|
166
|
+
},
|
|
98
167
|
"&:focus-within": {
|
|
99
168
|
outline: "none"
|
|
100
169
|
},
|
|
@@ -103,7 +172,7 @@ const StyledMuiTable = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props,
|
|
|
103
172
|
}
|
|
104
173
|
},
|
|
105
174
|
"& .MuiDataGrid-columnSeparator": {
|
|
106
|
-
color:
|
|
175
|
+
color: themePalette.gray.dark
|
|
107
176
|
}
|
|
108
177
|
},
|
|
109
178
|
"& .MuiDataGrid-cell": {
|
|
@@ -112,11 +181,12 @@ const StyledMuiTable = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props,
|
|
|
112
181
|
whiteSpace: "normal",
|
|
113
182
|
textOverflow: "ellipsis",
|
|
114
183
|
overflow: "hidden",
|
|
115
|
-
maxHeight: "
|
|
184
|
+
maxHeight: "".concat(tableStyles.rowHeight.maxHeight, " !important"),
|
|
116
185
|
minWidth: 'maxWidth',
|
|
117
186
|
wordBreak: "break-word",
|
|
187
|
+
justifyContent: "".concat(tableStyles.cellJustifyContent, " !important"),
|
|
118
188
|
"&.tableAction": {
|
|
119
|
-
justifyContent: "center",
|
|
189
|
+
justifyContent: "center !important",
|
|
120
190
|
position: "relative",
|
|
121
191
|
overflow: "initial !important"
|
|
122
192
|
},
|
|
@@ -125,12 +195,14 @@ const StyledMuiTable = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props,
|
|
|
125
195
|
}
|
|
126
196
|
},
|
|
127
197
|
"& .MuiDataGrid-row": {
|
|
128
|
-
maxHeight: "
|
|
198
|
+
maxHeight: "".concat(tableStyles.rowHeight.maxHeight, " !important"),
|
|
199
|
+
minHeight: "".concat(tableStyles.rowHeight.minHeight, " !important"),
|
|
200
|
+
lineHeight: "".concat(tableStyles.rowHeight.lineHeight, " !important"),
|
|
129
201
|
"&:nth-of-type(odd)": {
|
|
130
|
-
backgroundColor: "#ffffff"
|
|
202
|
+
backgroundColor: "#ffffff"
|
|
131
203
|
},
|
|
132
204
|
"&:nth-of-type(even)": {
|
|
133
|
-
backgroundColor: "#F6F9FF"
|
|
205
|
+
backgroundColor: "#F6F9FF"
|
|
134
206
|
},
|
|
135
207
|
"&:hover": {
|
|
136
208
|
backgroundColor: "#95C7FC"
|
|
@@ -142,10 +214,10 @@ const StyledMuiTable = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props,
|
|
|
142
214
|
}
|
|
143
215
|
},
|
|
144
216
|
"& .MuiDataGrid-virtualScroller": {
|
|
145
|
-
backgroundColor:
|
|
217
|
+
backgroundColor: themePalette.white
|
|
146
218
|
},
|
|
147
219
|
"& .MuiDataGrid-footerContainer": {
|
|
148
|
-
backgroundColor:
|
|
220
|
+
backgroundColor: themePalette.white,
|
|
149
221
|
height: "28px",
|
|
150
222
|
minHeight: "28px"
|
|
151
223
|
}
|
|
@@ -209,19 +281,22 @@ const TableActions = _ref2 => {
|
|
|
209
281
|
}), Boolean(isOpen) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Paper, {
|
|
210
282
|
ref: actionsRef,
|
|
211
283
|
elevation: 1,
|
|
212
|
-
sx: {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
284
|
+
sx: theme => {
|
|
285
|
+
const themePalette = getPalette(theme);
|
|
286
|
+
return {
|
|
287
|
+
borderRadius: "5px",
|
|
288
|
+
position: "absolute",
|
|
289
|
+
right: "0",
|
|
290
|
+
top: "50%",
|
|
291
|
+
transform: "translate(0, -50%)",
|
|
292
|
+
display: "flex",
|
|
293
|
+
alignItems: "center",
|
|
294
|
+
gap: "8px",
|
|
295
|
+
paddingX: "11px",
|
|
296
|
+
height: "calc(100% - 4px)",
|
|
297
|
+
backgroundColor: themePalette.gray.light,
|
|
298
|
+
border: "2px solid ".concat(themePalette.gray.dark)
|
|
299
|
+
};
|
|
225
300
|
},
|
|
226
301
|
children: [actions.map((action, index) => /*#__PURE__*/React.cloneElement(action, {
|
|
227
302
|
row,
|
|
@@ -316,23 +391,18 @@ const PuiTable = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
316
391
|
sx: {
|
|
317
392
|
display: 'flex',
|
|
318
393
|
gap: '8px',
|
|
319
|
-
// Adjust the space between icons as needed
|
|
320
394
|
flexWrap: 'wrap',
|
|
321
|
-
// Keep icons on the same line; remove if you want them to wrap
|
|
322
395
|
justifyContent: 'center',
|
|
323
|
-
// Center the icons horizontally
|
|
324
396
|
alignItems: 'center',
|
|
325
|
-
|
|
326
|
-
minWidth: 0 // Prevent the flex container from stretching past its content width
|
|
397
|
+
minWidth: 0
|
|
327
398
|
},
|
|
328
399
|
children: actions.map((action, index) => /*#__PURE__*/React.cloneElement(action, {
|
|
329
400
|
row,
|
|
330
401
|
key: index,
|
|
331
402
|
sx: _objectSpread(_objectSpread({}, action.props.sx), {}, {
|
|
332
403
|
marginRight: 0,
|
|
333
|
-
// Remove any outer margins
|
|
334
404
|
'&:last-child': {
|
|
335
|
-
marginRight: 0
|
|
405
|
+
marginRight: 0
|
|
336
406
|
}
|
|
337
407
|
})
|
|
338
408
|
}))
|
|
@@ -364,7 +434,6 @@ const PuiTable = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
364
434
|
const {
|
|
365
435
|
data
|
|
366
436
|
} = params;
|
|
367
|
-
// Render the passed rowDetailPanel component with the row data
|
|
368
437
|
return /*#__PURE__*/React.cloneElement(rowDetailPanel, {
|
|
369
438
|
rowData: data
|
|
370
439
|
});
|
|
@@ -11,6 +11,7 @@ exports.default = void 0;
|
|
|
11
11
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
12
12
|
require("core-js/modules/esnext.iterator.map.js");
|
|
13
13
|
var _material = require("@mui/material");
|
|
14
|
+
var _styles = require("@mui/material/styles");
|
|
14
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
16
|
var React = _interopRequireWildcard(require("react"));
|
|
16
17
|
var _apperance = require("../../config/apperance");
|
|
@@ -21,7 +22,57 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
21
22
|
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; }
|
|
22
23
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
23
24
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
24
|
-
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); }
|
|
25
|
+
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); } // Helper function to get palette from theme or fallback to appearance
|
|
26
|
+
const getPalette = theme => {
|
|
27
|
+
// Check if theme has our custom palette properties
|
|
28
|
+
if (theme && theme.palette && theme.palette.gray && theme.palette.gray.darker) {
|
|
29
|
+
// Theme has our custom structure, now normalize it
|
|
30
|
+
return {
|
|
31
|
+
primary: theme.palette.primary.main || theme.palette.primary,
|
|
32
|
+
secondary: theme.palette.secondary.main || theme.palette.secondary,
|
|
33
|
+
error: theme.palette.error ? theme.palette.error.main || theme.palette.error : _apperance.palette.error,
|
|
34
|
+
warning: theme.palette.warning ? theme.palette.warning.main || theme.palette.warning : _apperance.palette.warning,
|
|
35
|
+
success: theme.palette.success ? theme.palette.success.main || theme.palette.success : _apperance.palette.success,
|
|
36
|
+
info: theme.palette.info ? theme.palette.info.main || theme.palette.info : _apperance.palette.info,
|
|
37
|
+
white: theme.palette.white || _apperance.palette.white,
|
|
38
|
+
dark: theme.palette.dark || _apperance.palette.dark,
|
|
39
|
+
gray: theme.palette.gray,
|
|
40
|
+
blue: theme.palette.blue || _apperance.palette.blue,
|
|
41
|
+
background: theme.palette.background || _apperance.palette.background,
|
|
42
|
+
border: theme.palette.border || _apperance.palette.border,
|
|
43
|
+
shadow: theme.palette.shadow || _apperance.palette.shadow
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// Check if theme object itself has gray (root level)
|
|
47
|
+
if (theme && theme.gray && theme.gray.darker) {
|
|
48
|
+
return {
|
|
49
|
+
primary: theme.primary,
|
|
50
|
+
secondary: theme.secondary,
|
|
51
|
+
error: theme.error || _apperance.palette.error,
|
|
52
|
+
warning: theme.warning || _apperance.palette.warning,
|
|
53
|
+
success: theme.success || _apperance.palette.success,
|
|
54
|
+
info: theme.info || _apperance.palette.info,
|
|
55
|
+
white: theme.white || _apperance.palette.white,
|
|
56
|
+
dark: theme.dark || _apperance.palette.dark,
|
|
57
|
+
gray: theme.gray,
|
|
58
|
+
blue: theme.blue || _apperance.palette.blue,
|
|
59
|
+
background: theme.background || _apperance.palette.background,
|
|
60
|
+
border: theme.border || _apperance.palette.border,
|
|
61
|
+
shadow: theme.shadow || _apperance.palette.shadow
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return _apperance.palette;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// Helper function to get PuiMainTitle color from theme
|
|
68
|
+
const getPuiMainTitleColor = theme => {
|
|
69
|
+
if (theme && theme.components && theme.components.PuiMainTitle && theme.components.PuiMainTitle.color) {
|
|
70
|
+
return theme.components.PuiMainTitle.color;
|
|
71
|
+
}
|
|
72
|
+
// Fall back to primary color
|
|
73
|
+
const themePalette = getPalette(theme);
|
|
74
|
+
return themePalette.primary;
|
|
75
|
+
};
|
|
25
76
|
const PuiMainTitle = _ref => {
|
|
26
77
|
let {
|
|
27
78
|
id,
|
|
@@ -31,6 +82,8 @@ const PuiMainTitle = _ref => {
|
|
|
31
82
|
trace,
|
|
32
83
|
title
|
|
33
84
|
} = _ref;
|
|
85
|
+
const theme = (0, _styles.useTheme)();
|
|
86
|
+
const mainTitleColor = getPuiMainTitleColor(theme);
|
|
34
87
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
35
88
|
id: id,
|
|
36
89
|
className: className,
|
|
@@ -44,13 +97,13 @@ const PuiMainTitle = _ref => {
|
|
|
44
97
|
sx: {
|
|
45
98
|
marginRight: 1,
|
|
46
99
|
fontSize: "2.4em",
|
|
47
|
-
color:
|
|
100
|
+
color: mainTitleColor
|
|
48
101
|
}
|
|
49
102
|
})
|
|
50
103
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
51
104
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
52
105
|
sx: {
|
|
53
|
-
color:
|
|
106
|
+
color: mainTitleColor,
|
|
54
107
|
fontSize: "1.8rem",
|
|
55
108
|
fontWeight: "bold"
|
|
56
109
|
},
|
|
@@ -58,7 +111,7 @@ const PuiMainTitle = _ref => {
|
|
|
58
111
|
children: title
|
|
59
112
|
}), Boolean(trace) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
60
113
|
sx: {
|
|
61
|
-
color:
|
|
114
|
+
color: mainTitleColor,
|
|
62
115
|
fontSize: ".8rem",
|
|
63
116
|
fontWeight: "bold"
|
|
64
117
|
},
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
require("core-js/modules/es.weak-map.js");
|
|
4
4
|
require("core-js/modules/esnext.iterator.filter.js");
|
|
5
5
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
6
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
7
6
|
Object.defineProperty(exports, "__esModule", {
|
|
8
7
|
value: true
|
|
9
8
|
});
|
|
10
9
|
exports.default = void 0;
|
|
11
10
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
12
11
|
require("core-js/modules/esnext.iterator.map.js");
|
|
13
|
-
|
|
12
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
var
|
|
15
|
+
var _formik = require("formik");
|
|
16
16
|
var _PuiButton = _interopRequireDefault(require("../../../buttons/PuiButton"));
|
|
17
17
|
var _PuiFormikForm = _interopRequireDefault(require("../../../others/PuiFormikForm"));
|
|
18
18
|
var _PuiGrid = _interopRequireDefault(require("../../../others/PuiGrid"));
|
|
@@ -20,14 +20,16 @@ var _PuiIcon = _interopRequireDefault(require("../../../others/PuiIcon"));
|
|
|
20
20
|
var _PuiSection = _interopRequireDefault(require("../../../others/PuiSection"));
|
|
21
21
|
var _PuiTable = _interopRequireDefault(require("../../../table/PuiTable"));
|
|
22
22
|
var _PuiDefaultPage = _interopRequireDefault(require("./PuiDefaultPage"));
|
|
23
|
+
var _ExpandMore = _interopRequireDefault(require("@mui/icons-material/ExpandMore"));
|
|
24
|
+
var _ExpandLess = _interopRequireDefault(require("@mui/icons-material/ExpandLess"));
|
|
23
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
25
26
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
27
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
26
28
|
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
29
|
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
30
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
29
31
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : 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); }
|
|
32
|
+
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); } // Container for search form and actions
|
|
31
33
|
const PuiStandardSearchPageContainer = _ref => {
|
|
32
34
|
let {
|
|
33
35
|
actions,
|
|
@@ -63,8 +65,13 @@ const PuiSearchPage = _ref2 => {
|
|
|
63
65
|
onReset,
|
|
64
66
|
onSubmit,
|
|
65
67
|
children: _children,
|
|
66
|
-
additionalActions
|
|
68
|
+
additionalActions,
|
|
69
|
+
collapsibleSearchSection = true // Collapsible by default
|
|
67
70
|
} = _ref2;
|
|
71
|
+
const [isSearchSectionExpanded, setSearchSectionExpanded] = (0, _react.useState)(false);
|
|
72
|
+
const toggleSearchSection = () => {
|
|
73
|
+
setSearchSectionExpanded(prev => !prev);
|
|
74
|
+
};
|
|
68
75
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiDefaultPage.default, {
|
|
69
76
|
title: title,
|
|
70
77
|
titleIcon: titleIcon,
|
|
@@ -76,11 +83,24 @@ const PuiSearchPage = _ref2 => {
|
|
|
76
83
|
retour: retour,
|
|
77
84
|
onRetour: onRetour,
|
|
78
85
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiSection.default, {
|
|
79
|
-
title:
|
|
86
|
+
title: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
87
|
+
onClick: toggleSearchSection,
|
|
88
|
+
style: {
|
|
89
|
+
display: "flex",
|
|
90
|
+
alignItems: "center",
|
|
91
|
+
cursor: collapsibleSearchSection ? "pointer" : "default"
|
|
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
|
+
}),
|
|
80
100
|
sx: {
|
|
81
101
|
marginBottom: 2
|
|
82
102
|
},
|
|
83
|
-
children: formik ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_formik.Formik, _objectSpread(_objectSpread({
|
|
103
|
+
children: isSearchSectionExpanded && (formik ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_formik.Formik, _objectSpread(_objectSpread({
|
|
84
104
|
initialValues: {}
|
|
85
105
|
}, formikProps), {}, {
|
|
86
106
|
children: _ref3 => {
|
|
@@ -115,16 +135,14 @@ const PuiSearchPage = _ref2 => {
|
|
|
115
135
|
loadingPosition: "start",
|
|
116
136
|
children: "Rechercher"
|
|
117
137
|
})
|
|
118
|
-
}), additionalActions && additionalActions.map((actionItem, index) => {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}, index);
|
|
127
|
-
})]
|
|
138
|
+
}), additionalActions && additionalActions.map((actionItem, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
139
|
+
item: true,
|
|
140
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
141
|
+
startIcon: actionItem.icon,
|
|
142
|
+
onClick: actionItem.action,
|
|
143
|
+
children: actionItem.name
|
|
144
|
+
})
|
|
145
|
+
}, index))]
|
|
128
146
|
}),
|
|
129
147
|
children: _children
|
|
130
148
|
})
|
|
@@ -156,22 +174,22 @@ const PuiSearchPage = _ref2 => {
|
|
|
156
174
|
loadingPosition: "start",
|
|
157
175
|
children: "Rechercher"
|
|
158
176
|
})
|
|
159
|
-
}), additionalActions && additionalActions.map((actionItem, index) => {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}, index);
|
|
168
|
-
})]
|
|
177
|
+
}), additionalActions && additionalActions.map((actionItem, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
178
|
+
item: true,
|
|
179
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
180
|
+
startIcon: actionItem.icon,
|
|
181
|
+
onClick: actionItem.action,
|
|
182
|
+
children: actionItem.name
|
|
183
|
+
})
|
|
184
|
+
}, index))]
|
|
169
185
|
}),
|
|
170
186
|
children: _children
|
|
171
|
-
})
|
|
172
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTable.default, _objectSpread({
|
|
187
|
+
}))
|
|
188
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTable.default, _objectSpread(_objectSpread({
|
|
173
189
|
paginationMode: "server"
|
|
174
|
-
}, tableProps)
|
|
190
|
+
}, tableProps), {}, {
|
|
191
|
+
pinnedColumns: tableProps.pinnedColumns // Added pinnedColumns
|
|
192
|
+
}))]
|
|
175
193
|
});
|
|
176
194
|
};
|
|
177
195
|
PuiSearchPage.propTypes = {
|
|
@@ -184,7 +202,9 @@ PuiSearchPage.propTypes = {
|
|
|
184
202
|
topNav: _propTypes.default.bool,
|
|
185
203
|
bottomNav: _propTypes.default.bool,
|
|
186
204
|
loading: _propTypes.default.bool,
|
|
187
|
-
tableProps: _propTypes.default.
|
|
205
|
+
tableProps: _propTypes.default.shape({
|
|
206
|
+
pinnedColumns: _propTypes.default.object // Added pinnedColumns prop type
|
|
207
|
+
}),
|
|
188
208
|
retour: _propTypes.default.bool,
|
|
189
209
|
onRetour: _propTypes.default.func,
|
|
190
210
|
onReset: _propTypes.default.func,
|
|
@@ -193,11 +213,13 @@ PuiSearchPage.propTypes = {
|
|
|
193
213
|
name: _propTypes.default.string.isRequired,
|
|
194
214
|
action: _propTypes.default.func.isRequired,
|
|
195
215
|
icon: _propTypes.default.element
|
|
196
|
-
}))
|
|
216
|
+
})),
|
|
217
|
+
collapsibleSearchSection: _propTypes.default.bool
|
|
197
218
|
};
|
|
198
219
|
PuiSearchPage.defaultProps = {
|
|
199
220
|
formik: true,
|
|
200
221
|
loading: false,
|
|
201
|
-
additionalActions: []
|
|
222
|
+
additionalActions: [],
|
|
223
|
+
collapsibleSearchSection: true
|
|
202
224
|
};
|
|
203
225
|
var _default = exports.default = PuiSearchPage;
|
package/dist/config/apperance.js
CHANGED
|
@@ -6,93 +6,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.palette = void 0;
|
|
7
7
|
const palette = exports.palette = {
|
|
8
8
|
inherit: "inherit",
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// Status colors des maquettes
|
|
18
|
-
error: "#F44336",
|
|
19
|
-
// Rouge des maquettes
|
|
20
|
-
warning: "#FF9800",
|
|
21
|
-
// Orange des maquettes
|
|
22
|
-
success: "#4CAF50",
|
|
23
|
-
// Vert des maquettes
|
|
24
|
-
info: "#2196F3",
|
|
25
|
-
// Bleu info des maquettes
|
|
26
|
-
|
|
27
|
-
// Colors neutres
|
|
28
|
-
white: "#FFFFFF",
|
|
29
|
-
dark: "#212121",
|
|
30
|
-
black: "#000000",
|
|
31
|
-
// Palette complète basée sur l'analyse des maquettes
|
|
32
|
-
accent: "#FF5722",
|
|
33
|
-
// Orange accent des maquettes
|
|
34
|
-
blue: {
|
|
35
|
-
light: "#E3F2FD",
|
|
36
|
-
main: "#1976D2",
|
|
37
|
-
// Bleu principal
|
|
38
|
-
dark: "#1565C0",
|
|
39
|
-
darker: "#0D47A1"
|
|
40
|
-
},
|
|
9
|
+
primary: "#232f66",
|
|
10
|
+
secondary: "#e7e7e7",
|
|
11
|
+
error: "#d32f2f",
|
|
12
|
+
warning: "#FD9727",
|
|
13
|
+
success: "#48AC24",
|
|
14
|
+
info: "#2278CF",
|
|
15
|
+
white: "#FFF",
|
|
16
|
+
dark: "#000",
|
|
41
17
|
gray: {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
300: "#E0E0E0",
|
|
46
|
-
400: "#BDBDBD",
|
|
47
|
-
500: "#9E9E9E",
|
|
48
|
-
600: "#757575",
|
|
49
|
-
700: "#616161",
|
|
50
|
-
800: "#424242",
|
|
51
|
-
900: "#212121"
|
|
18
|
+
darker: "#505050",
|
|
19
|
+
dark: "#b6b6b6",
|
|
20
|
+
light: "#F1F1F1"
|
|
52
21
|
},
|
|
53
22
|
background: {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
paper: "#FFFFFF",
|
|
57
|
-
card: "#FFFFFF",
|
|
58
|
-
sidebar: "#F5F5F5",
|
|
59
|
-
required: "#FFF3E0",
|
|
60
|
-
// Orange très clair
|
|
61
|
-
error: "#FFEBEE",
|
|
62
|
-
// Rouge très clair
|
|
63
|
-
success: "#E8F5E8",
|
|
64
|
-
// Vert très clair
|
|
65
|
-
warning: "#FFF3E0",
|
|
66
|
-
// Orange très clair
|
|
67
|
-
info: "#E3F2FD" // Bleu très clair
|
|
68
|
-
},
|
|
69
|
-
border: {
|
|
70
|
-
light: "#E0E0E0",
|
|
71
|
-
// Bordures claires des maquettes
|
|
72
|
-
main: "#BDBDBD",
|
|
73
|
-
// Bordures moyennes des maquettes
|
|
74
|
-
dark: "#757575" // Bordures foncées des maquettes
|
|
75
|
-
},
|
|
76
|
-
shadow: {
|
|
77
|
-
light: "0px 1px 3px rgba(0, 0, 0, 0.1)",
|
|
78
|
-
medium: "0px 4px 6px rgba(0, 0, 0, 0.1)",
|
|
79
|
-
strong: "0px 10px 25px rgba(0, 0, 0, 0.15)",
|
|
80
|
-
card: "0px 2px 8px rgba(0, 0, 0, 0.08)"
|
|
81
|
-
},
|
|
82
|
-
// Couleurs spécifiques des boutons d'actions des maquettes
|
|
83
|
-
actions: {
|
|
84
|
-
validate: "#4CAF50",
|
|
85
|
-
// Vert "Validé" des maquettes
|
|
86
|
-
expire: "#F44336",
|
|
87
|
-
// Rouge "Expiré" des maquettes
|
|
88
|
-
renew: "#FF9800",
|
|
89
|
-
// Orange "Renouveler" des maquettes
|
|
90
|
-
download: "#2196F3",
|
|
91
|
-
// Bleu "Télécharger" des maquettes
|
|
92
|
-
processing: "#9C27B0",
|
|
93
|
-
// Violet "En cours" des maquettes
|
|
94
|
-
souscrit: "#607D8B",
|
|
95
|
-
// Gris bleu "Souscrit" des maquettes
|
|
96
|
-
default: "#757575" // Gris par défaut
|
|
23
|
+
required: "#FFFBE3",
|
|
24
|
+
error: "#FFE5E5"
|
|
97
25
|
}
|
|
98
26
|
};
|