@portnet/ui 2.0.9 → 3.0.1
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/package.json +1 -4
- package/dist/components/buttons/PuiButton.js +0 -146
- package/dist/components/buttons/PuiIconButton.js +0 -99
- package/dist/components/buttons/PuiNewUserButton.js +0 -121
- package/dist/components/common/PuiAlertContext.js +0 -13
- package/dist/components/common/StyledMuiButton.js +0 -49
- package/dist/components/common/StyledMuiTextField.js +0 -157
- package/dist/components/inputs/PuiAutocomplete.js +0 -353
- package/dist/components/inputs/PuiCheckbox.js +0 -310
- package/dist/components/inputs/PuiCheckboxGroup.js +0 -215
- package/dist/components/inputs/PuiCheckboxItem.js +0 -163
- package/dist/components/inputs/PuiDateField.js +0 -281
- package/dist/components/inputs/PuiDateTimeField.js +0 -397
- package/dist/components/inputs/PuiFileField.js +0 -338
- package/dist/components/inputs/PuiRadioGroup.js +0 -198
- package/dist/components/inputs/PuiRadioItem.js +0 -101
- package/dist/components/inputs/PuiSelect.js +0 -425
- package/dist/components/inputs/PuiTextField.js +0 -264
- package/dist/components/others/PuiBadge.js +0 -58
- package/dist/components/others/PuiChip.js +0 -291
- package/dist/components/others/PuiDialog.js +0 -112
- package/dist/components/others/PuiFormikForm.js +0 -71
- package/dist/components/others/PuiGrid.js +0 -23
- package/dist/components/others/PuiIcon.js +0 -93
- package/dist/components/others/PuiLoadingBackdrop.js +0 -32
- package/dist/components/others/PuiMainContainer.js +0 -42
- package/dist/components/others/PuiNavigation.js +0 -69
- package/dist/components/others/PuiSection.js +0 -134
- package/dist/components/others/PuiTooltip.js +0 -87
- package/dist/components/providers/PuiAlertProvider.js +0 -135
- package/dist/components/providers/PuiLocalizationProvider.js +0 -34
- package/dist/components/referentiel/common/ReferetielContext.js +0 -13
- package/dist/components/referentiel/common/constants/specificReferentielsApis.js +0 -22
- package/dist/components/referentiel/common/constants/specificReferentielsBaseColumns.js +0 -691
- package/dist/components/referentiel/common/constants/specificReferentielsBaseFilters.js +0 -598
- package/dist/components/referentiel/common/constants/specificReferentielsInitialValues.js +0 -80
- package/dist/components/referentiel/common/constants/specificReferentielsKeys.js +0 -18
- package/dist/components/referentiel/common/constants/specificReferentielsTitles.js +0 -22
- package/dist/components/referentiel/common/constants/specificReferentielsValidationSchemas.js +0 -86
- package/dist/components/referentiel/components/PuiBasePopupReferentielField.js +0 -357
- package/dist/components/referentiel/components/PuiCustomPopupReferentielField.js +0 -182
- package/dist/components/referentiel/components/PuiSimplePopupReferentielField.js +0 -326
- package/dist/components/referentiel/components/PuiSimpleReferentielField.js +0 -204
- package/dist/components/referentiel/components/PuiSpecificReferentielField.js +0 -328
- package/dist/components/referentiel/providers/PuiReferentielProvider.js +0 -67
- package/dist/components/tab/PuiTab.js +0 -25
- package/dist/components/tab/PuiTabs.js +0 -149
- package/dist/components/table/ActionPopover.js +0 -56
- package/dist/components/table/PuiTable.js +0 -688
- package/dist/components/table/PuiTableAction.js +0 -65
- package/dist/components/typography/PuiDefinition.js +0 -42
- package/dist/components/typography/PuiIndication.js +0 -81
- package/dist/components/typography/PuiMainTitle.js +0 -88
- package/dist/components/ui/dialogs/PuiSearchDialog.js +0 -255
- package/dist/components/ui/layout/Header.js +0 -253
- package/dist/components/ui/layout/Layout.js +0 -104
- package/dist/components/ui/layout/Sidebar.js +0 -193
- package/dist/components/ui/layout/index.js +0 -29
- package/dist/components/ui/pages/errors/PuiErrorBasePage.js +0 -73
- package/dist/components/ui/pages/errors/PuiForbiddenErrorPage.js +0 -36
- package/dist/components/ui/pages/errors/PuiNetworkErrorPage.js +0 -36
- package/dist/components/ui/pages/errors/PuiNotFoundErrorPage.js +0 -30
- package/dist/components/ui/pages/errors/PuiServerErrorPage.js +0 -37
- package/dist/components/ui/pages/general/PuiDefaultPage.js +0 -68
- package/dist/components/ui/pages/general/PuiSearchPage.js +0 -436
- package/dist/config/ThemeProvider.js +0 -32
- package/dist/config/apperance.js +0 -26
- package/dist/config/mapping.js +0 -26
- package/dist/config/referentiel.js +0 -10
- package/dist/config/styleUtils.js +0 -135
- package/dist/config/theme.js +0 -183
- package/dist/general/yupValidationErrors.js +0 -8
- package/dist/hooks/useAlert.js +0 -20
- package/dist/hooks/useAxios.js +0 -25
- package/dist/hooks/useQuery.js +0 -21
- package/dist/index.js +0 -434
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/esnext.iterator.filter.js");
|
|
4
|
-
require("core-js/modules/esnext.iterator.for-each.js");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
10
|
-
require("core-js/modules/esnext.iterator.map.js");
|
|
11
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
12
|
-
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
-
var _styles = require("@mui/material/styles");
|
|
15
|
-
var _material = require("@mui/material");
|
|
16
|
-
var _iconsMaterial = require("@mui/icons-material");
|
|
17
|
-
var _apperance = require("../../../config/apperance");
|
|
18
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
const _excluded = ["title", "userName", "avatarSrc", "onLogout", "onSettingsClick", "onProfileClick", "notificationsCount", "onNotificationsClick"]; // AppBar stylisée
|
|
20
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
|
-
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; }
|
|
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; }
|
|
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; }
|
|
24
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
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); }
|
|
26
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
27
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
28
|
-
const StyledAppBar = (0, _styles.styled)(_material.AppBar)(_ref => {
|
|
29
|
-
let {
|
|
30
|
-
theme
|
|
31
|
-
} = _ref;
|
|
32
|
-
return {
|
|
33
|
-
backgroundColor: _apperance.palette.white,
|
|
34
|
-
color: _apperance.palette.gray.darker,
|
|
35
|
-
boxShadow: '0 2px 4px rgba(0, 0, 0, 0.05)',
|
|
36
|
-
position: 'fixed',
|
|
37
|
-
zIndex: 1100,
|
|
38
|
-
width: 'calc(100% - 280px)',
|
|
39
|
-
// Ajuster selon la largeur de la sidebar (280px)
|
|
40
|
-
marginLeft: '280px'
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
// Toolbar stylisée
|
|
45
|
-
const StyledToolbar = (0, _styles.styled)(_material.Toolbar)({
|
|
46
|
-
display: 'flex',
|
|
47
|
-
justifyContent: 'space-between',
|
|
48
|
-
height: '64px',
|
|
49
|
-
padding: '0 16px'
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
// Conteneur pour les actions à droite
|
|
53
|
-
const ActionContainer = (0, _styles.styled)(_material.Box)({
|
|
54
|
-
display: 'flex',
|
|
55
|
-
alignItems: 'center',
|
|
56
|
-
gap: '8px'
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
// Icône stylisée
|
|
60
|
-
const StyledIconButton = (0, _styles.styled)(_material.IconButton)({
|
|
61
|
-
color: _apperance.palette.gray.dark,
|
|
62
|
-
transition: 'all 0.2s ease',
|
|
63
|
-
'&:hover': {
|
|
64
|
-
color: _apperance.palette.primary,
|
|
65
|
-
backgroundColor: "".concat(_apperance.palette.primary, "10")
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
// Avatar stylisé
|
|
70
|
-
const StyledAvatar = (0, _styles.styled)(_material.Avatar)({
|
|
71
|
-
cursor: 'pointer',
|
|
72
|
-
width: 40,
|
|
73
|
-
height: 40,
|
|
74
|
-
transition: 'all 0.2s ease',
|
|
75
|
-
border: "2px solid transparent",
|
|
76
|
-
'&:hover': {
|
|
77
|
-
borderColor: _apperance.palette.primary
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
// Menu stylisé
|
|
82
|
-
const StyledMenu = (0, _styles.styled)(_material.Menu)({
|
|
83
|
-
'& .MuiPaper-root': {
|
|
84
|
-
borderRadius: '8px',
|
|
85
|
-
boxShadow: '0 4px 20px rgba(0, 0, 0, 0.1)',
|
|
86
|
-
overflow: 'hidden'
|
|
87
|
-
},
|
|
88
|
-
'& .MuiMenuItem-root': {
|
|
89
|
-
padding: '10px 16px',
|
|
90
|
-
fontSize: '0.9rem',
|
|
91
|
-
transition: 'all 0.2s ease',
|
|
92
|
-
'&:hover': {
|
|
93
|
-
backgroundColor: "".concat(_apperance.palette.primary, "10")
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Composant Header - En-tête de l'application avec avatar en haut à droite
|
|
100
|
-
*/
|
|
101
|
-
const Header = _ref2 => {
|
|
102
|
-
let {
|
|
103
|
-
title,
|
|
104
|
-
userName,
|
|
105
|
-
avatarSrc,
|
|
106
|
-
onLogout,
|
|
107
|
-
onSettingsClick,
|
|
108
|
-
onProfileClick,
|
|
109
|
-
notificationsCount = 0,
|
|
110
|
-
onNotificationsClick
|
|
111
|
-
} = _ref2,
|
|
112
|
-
props = _objectWithoutProperties(_ref2, _excluded);
|
|
113
|
-
const [anchorEl, setAnchorEl] = _react.default.useState(null);
|
|
114
|
-
const open = Boolean(anchorEl);
|
|
115
|
-
const handleAvatarClick = event => {
|
|
116
|
-
setAnchorEl(event.currentTarget);
|
|
117
|
-
};
|
|
118
|
-
const handleClose = () => {
|
|
119
|
-
setAnchorEl(null);
|
|
120
|
-
};
|
|
121
|
-
const handleProfileClick = () => {
|
|
122
|
-
if (onProfileClick) {
|
|
123
|
-
onProfileClick();
|
|
124
|
-
}
|
|
125
|
-
handleClose();
|
|
126
|
-
};
|
|
127
|
-
const handleSettingsClick = () => {
|
|
128
|
-
if (onSettingsClick) {
|
|
129
|
-
onSettingsClick();
|
|
130
|
-
}
|
|
131
|
-
handleClose();
|
|
132
|
-
};
|
|
133
|
-
const handleLogoutClick = () => {
|
|
134
|
-
if (onLogout) {
|
|
135
|
-
onLogout();
|
|
136
|
-
}
|
|
137
|
-
handleClose();
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
// Génération des initiales pour l'avatar si pas d'image
|
|
141
|
-
const getInitials = name => {
|
|
142
|
-
if (!name) return 'U';
|
|
143
|
-
return name.split(' ').map(part => part[0]).join('').toUpperCase().substring(0, 2);
|
|
144
|
-
};
|
|
145
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledAppBar, _objectSpread(_objectSpread({}, props), {}, {
|
|
146
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledToolbar, {
|
|
147
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
148
|
-
variant: "h6",
|
|
149
|
-
fontWeight: "bold",
|
|
150
|
-
children: title
|
|
151
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(ActionContainer, {
|
|
152
|
-
children: [onNotificationsClick && /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledIconButton, {
|
|
153
|
-
onClick: onNotificationsClick,
|
|
154
|
-
title: "Notifications",
|
|
155
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Badge, {
|
|
156
|
-
badgeContent: notificationsCount,
|
|
157
|
-
color: "error",
|
|
158
|
-
max: 99,
|
|
159
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_iconsMaterial.Notifications, {})
|
|
160
|
-
})
|
|
161
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledAvatar, {
|
|
162
|
-
src: avatarSrc,
|
|
163
|
-
alt: userName || 'Utilisateur',
|
|
164
|
-
onClick: handleAvatarClick,
|
|
165
|
-
"aria-controls": open ? 'user-menu' : undefined,
|
|
166
|
-
"aria-haspopup": "true",
|
|
167
|
-
"aria-expanded": open ? 'true' : undefined,
|
|
168
|
-
children: !avatarSrc && getInitials(userName)
|
|
169
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledMenu, {
|
|
170
|
-
id: "user-menu",
|
|
171
|
-
anchorEl: anchorEl,
|
|
172
|
-
open: open,
|
|
173
|
-
onClose: handleClose,
|
|
174
|
-
MenuListProps: {
|
|
175
|
-
'aria-labelledby': 'avatar-button'
|
|
176
|
-
},
|
|
177
|
-
anchorOrigin: {
|
|
178
|
-
vertical: 'bottom',
|
|
179
|
-
horizontal: 'right'
|
|
180
|
-
},
|
|
181
|
-
transformOrigin: {
|
|
182
|
-
vertical: 'top',
|
|
183
|
-
horizontal: 'right'
|
|
184
|
-
},
|
|
185
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
186
|
-
sx: {
|
|
187
|
-
px: 2,
|
|
188
|
-
py: 1
|
|
189
|
-
},
|
|
190
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
191
|
-
variant: "subtitle1",
|
|
192
|
-
fontWeight: "bold",
|
|
193
|
-
children: userName || 'Utilisateur'
|
|
194
|
-
})
|
|
195
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Divider, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
196
|
-
onClick: handleProfileClick,
|
|
197
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
198
|
-
display: "flex",
|
|
199
|
-
alignItems: "center",
|
|
200
|
-
gap: 1,
|
|
201
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
202
|
-
sx: {
|
|
203
|
-
width: 24,
|
|
204
|
-
height: 24
|
|
205
|
-
},
|
|
206
|
-
src: avatarSrc,
|
|
207
|
-
children: !avatarSrc && getInitials(userName)
|
|
208
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
209
|
-
children: "Profil"
|
|
210
|
-
})]
|
|
211
|
-
})
|
|
212
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
213
|
-
onClick: handleSettingsClick,
|
|
214
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
215
|
-
display: "flex",
|
|
216
|
-
alignItems: "center",
|
|
217
|
-
gap: 1,
|
|
218
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_iconsMaterial.Settings, {
|
|
219
|
-
fontSize: "small"
|
|
220
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
221
|
-
children: "Param\xE8tres"
|
|
222
|
-
})]
|
|
223
|
-
})
|
|
224
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Divider, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
225
|
-
onClick: handleLogoutClick,
|
|
226
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
227
|
-
display: "flex",
|
|
228
|
-
alignItems: "center",
|
|
229
|
-
gap: 1,
|
|
230
|
-
color: "error.main",
|
|
231
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_iconsMaterial.ExitToApp, {
|
|
232
|
-
fontSize: "small"
|
|
233
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
234
|
-
children: "D\xE9connexion"
|
|
235
|
-
})]
|
|
236
|
-
})
|
|
237
|
-
})]
|
|
238
|
-
})]
|
|
239
|
-
})]
|
|
240
|
-
})
|
|
241
|
-
}));
|
|
242
|
-
};
|
|
243
|
-
Header.propTypes = {
|
|
244
|
-
title: _propTypes.default.string,
|
|
245
|
-
userName: _propTypes.default.string,
|
|
246
|
-
avatarSrc: _propTypes.default.string,
|
|
247
|
-
onLogout: _propTypes.default.func,
|
|
248
|
-
onSettingsClick: _propTypes.default.func,
|
|
249
|
-
onProfileClick: _propTypes.default.func,
|
|
250
|
-
notificationsCount: _propTypes.default.number,
|
|
251
|
-
onNotificationsClick: _propTypes.default.func
|
|
252
|
-
};
|
|
253
|
-
var _default = exports.default = Header;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
4
|
-
require("core-js/modules/esnext.iterator.filter.js");
|
|
5
|
-
require("core-js/modules/esnext.iterator.for-each.js");
|
|
6
|
-
Object.defineProperty(exports, "__esModule", {
|
|
7
|
-
value: true
|
|
8
|
-
});
|
|
9
|
-
exports.default = void 0;
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var _styles = require("@mui/material/styles");
|
|
13
|
-
var _material = require("@mui/material");
|
|
14
|
-
var _Sidebar = _interopRequireDefault(require("./Sidebar"));
|
|
15
|
-
var _Header = _interopRequireDefault(require("./Header"));
|
|
16
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
const _excluded = ["children", "title", "userName", "userRole", "avatarSrc", "logoUrl", "appName", "menuItems", "activeMenuId", "onLogout", "onSettingsClick", "onProfileClick", "notificationsCount", "onNotificationsClick"]; // Conteneur principal
|
|
18
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
-
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; }
|
|
20
|
-
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; }
|
|
21
|
-
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; }
|
|
22
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
23
|
-
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); }
|
|
24
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
25
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
26
|
-
const MainContainer = (0, _styles.styled)(_material.Box)({
|
|
27
|
-
display: 'flex'
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// Conteneur du contenu
|
|
31
|
-
const ContentContainer = (0, _styles.styled)(_material.Box)({
|
|
32
|
-
marginLeft: '280px',
|
|
33
|
-
// Doit correspondre à la largeur de la Sidebar
|
|
34
|
-
marginTop: '64px',
|
|
35
|
-
// Doit correspondre à la hauteur du Header
|
|
36
|
-
width: 'calc(100% - 280px)',
|
|
37
|
-
minHeight: 'calc(100vh - 64px)',
|
|
38
|
-
padding: '24px',
|
|
39
|
-
backgroundColor: '#f9fafb',
|
|
40
|
-
// Fond légèrement grisé pour le contenu
|
|
41
|
-
boxSizing: 'border-box'
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Composant Layout - Structure principale de l'application
|
|
46
|
-
*/
|
|
47
|
-
const Layout = _ref => {
|
|
48
|
-
let {
|
|
49
|
-
children,
|
|
50
|
-
title,
|
|
51
|
-
userName,
|
|
52
|
-
userRole,
|
|
53
|
-
avatarSrc,
|
|
54
|
-
logoUrl,
|
|
55
|
-
appName,
|
|
56
|
-
menuItems,
|
|
57
|
-
activeMenuId,
|
|
58
|
-
onLogout,
|
|
59
|
-
onSettingsClick,
|
|
60
|
-
onProfileClick,
|
|
61
|
-
notificationsCount,
|
|
62
|
-
onNotificationsClick
|
|
63
|
-
} = _ref,
|
|
64
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
65
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(MainContainer, _objectSpread(_objectSpread({}, props), {}, {
|
|
66
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Sidebar.default, {
|
|
67
|
-
items: menuItems,
|
|
68
|
-
logoUrl: logoUrl,
|
|
69
|
-
appName: appName,
|
|
70
|
-
userName: userName,
|
|
71
|
-
userRole: userRole,
|
|
72
|
-
onLogout: onLogout,
|
|
73
|
-
activeItemId: activeMenuId
|
|
74
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Header.default, {
|
|
75
|
-
title: title,
|
|
76
|
-
userName: userName,
|
|
77
|
-
avatarSrc: avatarSrc,
|
|
78
|
-
onLogout: onLogout,
|
|
79
|
-
onSettingsClick: onSettingsClick,
|
|
80
|
-
onProfileClick: onProfileClick,
|
|
81
|
-
notificationsCount: notificationsCount,
|
|
82
|
-
onNotificationsClick: onNotificationsClick
|
|
83
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ContentContainer, {
|
|
84
|
-
children: children
|
|
85
|
-
})]
|
|
86
|
-
}));
|
|
87
|
-
};
|
|
88
|
-
Layout.propTypes = {
|
|
89
|
-
children: _propTypes.default.node,
|
|
90
|
-
title: _propTypes.default.string,
|
|
91
|
-
userName: _propTypes.default.string,
|
|
92
|
-
userRole: _propTypes.default.string,
|
|
93
|
-
avatarSrc: _propTypes.default.string,
|
|
94
|
-
logoUrl: _propTypes.default.string,
|
|
95
|
-
appName: _propTypes.default.string,
|
|
96
|
-
menuItems: _propTypes.default.array,
|
|
97
|
-
activeMenuId: _propTypes.default.string,
|
|
98
|
-
onLogout: _propTypes.default.func,
|
|
99
|
-
onSettingsClick: _propTypes.default.func,
|
|
100
|
-
onProfileClick: _propTypes.default.func,
|
|
101
|
-
notificationsCount: _propTypes.default.number,
|
|
102
|
-
onNotificationsClick: _propTypes.default.func
|
|
103
|
-
};
|
|
104
|
-
var _default = exports.default = Layout;
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/esnext.iterator.filter.js");
|
|
4
|
-
require("core-js/modules/esnext.iterator.for-each.js");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
10
|
-
require("core-js/modules/esnext.iterator.map.js");
|
|
11
|
-
var _react = _interopRequireDefault(require("react"));
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
var _styles = require("@mui/material/styles");
|
|
14
|
-
var _material = require("@mui/material");
|
|
15
|
-
var _iconsMaterial = require("@mui/icons-material");
|
|
16
|
-
var _apperance = require("../../../config/apperance");
|
|
17
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
const _excluded = ["items", "logoUrl", "appName", "userName", "userRole", "onLogout", "activeItemId"]; // Largeur augmentée
|
|
19
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
|
-
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; }
|
|
21
|
-
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
|
-
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
|
-
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 _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
26
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
27
|
-
const SIDEBAR_WIDTH = 280; // Largeur augmentée (anciennement 254px)
|
|
28
|
-
|
|
29
|
-
// Composant stylisé pour la barre latérale
|
|
30
|
-
const SidebarContainer = (0, _styles.styled)(_material.Box)(_ref => {
|
|
31
|
-
let {
|
|
32
|
-
theme
|
|
33
|
-
} = _ref;
|
|
34
|
-
return {
|
|
35
|
-
width: SIDEBAR_WIDTH,
|
|
36
|
-
height: '100vh',
|
|
37
|
-
position: 'fixed',
|
|
38
|
-
left: 0,
|
|
39
|
-
top: 0,
|
|
40
|
-
backgroundColor: _apperance.palette.white,
|
|
41
|
-
borderRight: "1px solid ".concat(_apperance.palette.gray.light),
|
|
42
|
-
boxShadow: 'none',
|
|
43
|
-
display: 'flex',
|
|
44
|
-
flexDirection: 'column',
|
|
45
|
-
zIndex: 1200,
|
|
46
|
-
overflow: 'hidden',
|
|
47
|
-
transition: 'width 0.3s ease'
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
// En-tête de la barre latérale
|
|
52
|
-
const SidebarHeader = (0, _styles.styled)(_material.Box)({
|
|
53
|
-
padding: '16px',
|
|
54
|
-
display: 'flex',
|
|
55
|
-
alignItems: 'center',
|
|
56
|
-
justifyContent: 'space-between',
|
|
57
|
-
borderBottom: "1px solid ".concat(_apperance.palette.gray.light)
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
// Contenu de la barre latérale
|
|
61
|
-
const SidebarContent = (0, _styles.styled)(_material.Box)({
|
|
62
|
-
flex: 1,
|
|
63
|
-
overflowY: 'auto',
|
|
64
|
-
padding: '8px 0'
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
// Pied de la barre latérale
|
|
68
|
-
const SidebarFooter = (0, _styles.styled)(_material.Box)({
|
|
69
|
-
padding: '12px',
|
|
70
|
-
borderTop: "1px solid ".concat(_apperance.palette.gray.light),
|
|
71
|
-
display: 'flex',
|
|
72
|
-
alignItems: 'center',
|
|
73
|
-
justifyContent: 'space-between'
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
// Item de menu stylisé
|
|
77
|
-
const StyledListItem = (0, _styles.styled)(_material.ListItem)({
|
|
78
|
-
padding: '8px 16px',
|
|
79
|
-
borderRadius: '4px',
|
|
80
|
-
margin: '2px 8px',
|
|
81
|
-
transition: 'all 0.2s ease',
|
|
82
|
-
'&:hover': {
|
|
83
|
-
backgroundColor: "".concat(_apperance.palette.primary, "08"),
|
|
84
|
-
'& .MuiListItemIcon-root': {
|
|
85
|
-
color: _apperance.palette.primary
|
|
86
|
-
},
|
|
87
|
-
'& .MuiListItemText-root': {
|
|
88
|
-
color: _apperance.palette.primary
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
'&.active': {
|
|
92
|
-
backgroundColor: "".concat(_apperance.palette.primary, "10"),
|
|
93
|
-
'& .MuiListItemIcon-root': {
|
|
94
|
-
color: _apperance.palette.primary
|
|
95
|
-
},
|
|
96
|
-
'& .MuiListItemText-root': {
|
|
97
|
-
color: _apperance.palette.primary
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
// Icône de déconnexion stylisée
|
|
103
|
-
const LogoutButton = (0, _styles.styled)(_material.IconButton)({
|
|
104
|
-
color: _apperance.palette.gray.dark,
|
|
105
|
-
padding: '6px',
|
|
106
|
-
transition: 'all 0.2s ease',
|
|
107
|
-
'&:hover': {
|
|
108
|
-
color: _apperance.palette.error,
|
|
109
|
-
backgroundColor: "".concat(_apperance.palette.error, "08")
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Composant Sidebar - Barre latérale de navigation
|
|
115
|
-
*/
|
|
116
|
-
const Sidebar = _ref2 => {
|
|
117
|
-
let {
|
|
118
|
-
items,
|
|
119
|
-
logoUrl,
|
|
120
|
-
appName,
|
|
121
|
-
userName,
|
|
122
|
-
userRole,
|
|
123
|
-
onLogout,
|
|
124
|
-
activeItemId
|
|
125
|
-
} = _ref2,
|
|
126
|
-
props = _objectWithoutProperties(_ref2, _excluded);
|
|
127
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(SidebarContainer, _objectSpread(_objectSpread({}, props), {}, {
|
|
128
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SidebarHeader, {
|
|
129
|
-
children: logoUrl ? /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
130
|
-
src: logoUrl,
|
|
131
|
-
alt: appName,
|
|
132
|
-
style: {
|
|
133
|
-
height: 40
|
|
134
|
-
}
|
|
135
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
136
|
-
variant: "h6",
|
|
137
|
-
fontWeight: "bold",
|
|
138
|
-
children: appName || 'Application'
|
|
139
|
-
})
|
|
140
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(SidebarContent, {
|
|
141
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.List, {
|
|
142
|
-
component: "nav",
|
|
143
|
-
children: items && items.map(item => /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledListItem, {
|
|
144
|
-
button: true,
|
|
145
|
-
onClick: item.onClick,
|
|
146
|
-
className: activeItemId === item.id ? 'active' : '',
|
|
147
|
-
children: [item.icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemIcon, {
|
|
148
|
-
children: item.icon
|
|
149
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemText, {
|
|
150
|
-
primary: item.label,
|
|
151
|
-
primaryTypographyProps: {
|
|
152
|
-
fontSize: '0.9rem',
|
|
153
|
-
fontWeight: activeItemId === item.id ? 'bold' : 'normal'
|
|
154
|
-
}
|
|
155
|
-
})]
|
|
156
|
-
}, item.id))
|
|
157
|
-
})
|
|
158
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(SidebarFooter, {
|
|
159
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
160
|
-
display: "flex",
|
|
161
|
-
flexDirection: "column",
|
|
162
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
163
|
-
variant: "subtitle2",
|
|
164
|
-
fontWeight: "bold",
|
|
165
|
-
children: userName || 'Utilisateur'
|
|
166
|
-
}), userRole && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
167
|
-
variant: "caption",
|
|
168
|
-
color: "textSecondary",
|
|
169
|
-
children: userRole
|
|
170
|
-
})]
|
|
171
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(LogoutButton, {
|
|
172
|
-
onClick: onLogout,
|
|
173
|
-
title: "D\xE9connexion",
|
|
174
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_iconsMaterial.ExitToApp, {}), " "]
|
|
175
|
-
})]
|
|
176
|
-
})]
|
|
177
|
-
}));
|
|
178
|
-
};
|
|
179
|
-
Sidebar.propTypes = {
|
|
180
|
-
items: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
181
|
-
id: _propTypes.default.string.isRequired,
|
|
182
|
-
label: _propTypes.default.string.isRequired,
|
|
183
|
-
icon: _propTypes.default.node,
|
|
184
|
-
onClick: _propTypes.default.func
|
|
185
|
-
})),
|
|
186
|
-
logoUrl: _propTypes.default.string,
|
|
187
|
-
appName: _propTypes.default.string,
|
|
188
|
-
userName: _propTypes.default.string,
|
|
189
|
-
userRole: _propTypes.default.string,
|
|
190
|
-
onLogout: _propTypes.default.func,
|
|
191
|
-
activeItemId: _propTypes.default.string
|
|
192
|
-
};
|
|
193
|
-
var _default = exports.default = Sidebar;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Header", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _Header.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "Layout", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _Layout.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "Sidebar", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _Sidebar.default;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
exports.default = void 0;
|
|
25
|
-
var _Layout = _interopRequireDefault(require("./Layout"));
|
|
26
|
-
var _Sidebar = _interopRequireDefault(require("./Sidebar"));
|
|
27
|
-
var _Header = _interopRequireDefault(require("./Header"));
|
|
28
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
|
-
var _default = exports.default = _Layout.default;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _material = require("@mui/material");
|
|
8
|
-
var _system = require("@mui/system");
|
|
9
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
-
var _apperance = require("../../../../config/apperance");
|
|
11
|
-
var _PuiNavigation = _interopRequireDefault(require("../../../others/PuiNavigation"));
|
|
12
|
-
var _PuiMainTitle = _interopRequireDefault(require("../../../typography/PuiMainTitle"));
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
const PuiErrorBasePage = _ref => {
|
|
16
|
-
let {
|
|
17
|
-
title,
|
|
18
|
-
icon,
|
|
19
|
-
mainContent,
|
|
20
|
-
subContent,
|
|
21
|
-
onRetour,
|
|
22
|
-
children
|
|
23
|
-
} = _ref;
|
|
24
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
25
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiMainTitle.default, {
|
|
26
|
-
title: title,
|
|
27
|
-
icon: icon
|
|
28
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiNavigation.default, {
|
|
29
|
-
onRetour: onRetour,
|
|
30
|
-
retour: true
|
|
31
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_system.Box, {
|
|
32
|
-
sx: {
|
|
33
|
-
marginTop: "100px",
|
|
34
|
-
display: "flex",
|
|
35
|
-
flexDirection: "column",
|
|
36
|
-
alignItems: "center"
|
|
37
|
-
},
|
|
38
|
-
children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
39
|
-
variant: "h2",
|
|
40
|
-
sx: {
|
|
41
|
-
color: _apperance.palette.primary,
|
|
42
|
-
fontSize: "9em",
|
|
43
|
-
fontWeight: "bold",
|
|
44
|
-
paddingLeft: 2,
|
|
45
|
-
paddingRight: 2,
|
|
46
|
-
paddingTop: 0,
|
|
47
|
-
paddingBottom: 0
|
|
48
|
-
},
|
|
49
|
-
children: mainContent
|
|
50
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
51
|
-
variant: "h3",
|
|
52
|
-
sx: {
|
|
53
|
-
color: _apperance.palette.primary,
|
|
54
|
-
fontSize: "1.2em",
|
|
55
|
-
lineHeight: "1.6",
|
|
56
|
-
paddingLeft: 2,
|
|
57
|
-
paddingRight: 2,
|
|
58
|
-
paddingTop: 0,
|
|
59
|
-
paddingBottom: 0
|
|
60
|
-
},
|
|
61
|
-
children: subContent
|
|
62
|
-
})]
|
|
63
|
-
})]
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
PuiErrorBasePage.propTypes = {
|
|
67
|
-
title: _propTypes.default.any,
|
|
68
|
-
icon: _propTypes.default.element,
|
|
69
|
-
mainContent: _propTypes.default.any,
|
|
70
|
-
subContent: _propTypes.default.any,
|
|
71
|
-
onRetour: _propTypes.default.func
|
|
72
|
-
};
|
|
73
|
-
var _default = exports.default = PuiErrorBasePage;
|