@portnet/ui 2.0.9 → 3.0.2
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,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _DoDisturbOn = _interopRequireDefault(require("@mui/icons-material/DoDisturbOn"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _PuiErrorBasePage = _interopRequireDefault(require("./PuiErrorBasePage"));
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
const PuiForbiddenErrorPage = _ref => {
|
|
13
|
-
let {
|
|
14
|
-
onRetour
|
|
15
|
-
} = _ref;
|
|
16
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiErrorBasePage.default, {
|
|
17
|
-
title: "Acc\xE8s interdit",
|
|
18
|
-
mainContent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DoDisturbOn.default, {
|
|
19
|
-
sx: {
|
|
20
|
-
fontSize: "inherit",
|
|
21
|
-
display: "block",
|
|
22
|
-
margin: "auto"
|
|
23
|
-
}
|
|
24
|
-
}),
|
|
25
|
-
subContent: "Acc\xE8s interdit !",
|
|
26
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DoDisturbOn.default, {}),
|
|
27
|
-
onRetour: onRetour
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
PuiForbiddenErrorPage.propTypes = {
|
|
31
|
-
onRetour: _propTypes.default.func.isRequired
|
|
32
|
-
};
|
|
33
|
-
PuiForbiddenErrorPage.defaultProps = {
|
|
34
|
-
onRetour: () => {}
|
|
35
|
-
};
|
|
36
|
-
var _default = exports.default = PuiForbiddenErrorPage;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _PortableWifiOff = _interopRequireDefault(require("@mui/icons-material/PortableWifiOff"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _PuiErrorBasePage = _interopRequireDefault(require("./PuiErrorBasePage"));
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
const PuiNetworkErrorPage = _ref => {
|
|
13
|
-
let {
|
|
14
|
-
onRetour
|
|
15
|
-
} = _ref;
|
|
16
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiErrorBasePage.default, {
|
|
17
|
-
title: "Erreur r\xE9seau",
|
|
18
|
-
mainContent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PortableWifiOff.default, {
|
|
19
|
-
sx: {
|
|
20
|
-
fontSize: "inherit",
|
|
21
|
-
display: "block",
|
|
22
|
-
margin: "auto"
|
|
23
|
-
}
|
|
24
|
-
}),
|
|
25
|
-
subContent: "Probl\xE9me de r\xE9seau, veuillez v\xE9rifier votre connexion internet.",
|
|
26
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PortableWifiOff.default, {}),
|
|
27
|
-
onRetour: onRetour
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
PuiNetworkErrorPage.propTypes = {
|
|
31
|
-
onRetour: _propTypes.default.func.isRequired
|
|
32
|
-
};
|
|
33
|
-
PuiNetworkErrorPage.defaultProps = {
|
|
34
|
-
onRetour: () => {}
|
|
35
|
-
};
|
|
36
|
-
var _default = exports.default = PuiNetworkErrorPage;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _BrowserNotSupported = _interopRequireDefault(require("@mui/icons-material/BrowserNotSupported"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _PuiErrorBasePage = _interopRequireDefault(require("./PuiErrorBasePage"));
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
const PuiNotFoundErrorPage = _ref => {
|
|
13
|
-
let {
|
|
14
|
-
onRetour
|
|
15
|
-
} = _ref;
|
|
16
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiErrorBasePage.default, {
|
|
17
|
-
title: "Page introuvable",
|
|
18
|
-
mainContent: "404",
|
|
19
|
-
subContent: "Page introuvable !",
|
|
20
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_BrowserNotSupported.default, {}),
|
|
21
|
-
onRetour: onRetour
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
PuiNotFoundErrorPage.propTypes = {
|
|
25
|
-
onRetour: _propTypes.default.func.isRequired
|
|
26
|
-
};
|
|
27
|
-
PuiNotFoundErrorPage.defaultProps = {
|
|
28
|
-
onRetour: () => {}
|
|
29
|
-
};
|
|
30
|
-
var _default = exports.default = PuiNotFoundErrorPage;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _Error = _interopRequireDefault(require("@mui/icons-material/Error"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _PuiErrorBasePage = _interopRequireDefault(require("./PuiErrorBasePage"));
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
const PuiServerErrorPage = _ref => {
|
|
13
|
-
let {
|
|
14
|
-
onRetour,
|
|
15
|
-
retour
|
|
16
|
-
} = _ref;
|
|
17
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiErrorBasePage.default, {
|
|
18
|
-
title: "Erreur serveur",
|
|
19
|
-
mainContent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Error.default, {
|
|
20
|
-
sx: {
|
|
21
|
-
fontSize: "inherit",
|
|
22
|
-
display: "block",
|
|
23
|
-
margin: "auto"
|
|
24
|
-
}
|
|
25
|
-
}),
|
|
26
|
-
subContent: "Une erreur inconnue est survenue, veuillez r\xE9essayer plus tard ou\r contacter le service client\xE8le.",
|
|
27
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Error.default, {}),
|
|
28
|
-
onRetour: onRetour
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
PuiServerErrorPage.propTypes = {
|
|
32
|
-
onRetour: _propTypes.default.func.isRequired
|
|
33
|
-
};
|
|
34
|
-
PuiServerErrorPage.defaultProps = {
|
|
35
|
-
onRetour: () => {}
|
|
36
|
-
};
|
|
37
|
-
var _default = exports.default = PuiServerErrorPage;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
-
var _PuiLoadingBackdrop = _interopRequireDefault(require("../../../others/PuiLoadingBackdrop"));
|
|
9
|
-
var _PuiNavigation = _interopRequireDefault(require("../../../others/PuiNavigation"));
|
|
10
|
-
var _PuiMainTitle = _interopRequireDefault(require("../../../typography/PuiMainTitle"));
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
const PuiDefaultPage = _ref => {
|
|
14
|
-
let {
|
|
15
|
-
title,
|
|
16
|
-
titleIcon,
|
|
17
|
-
trace,
|
|
18
|
-
navActions,
|
|
19
|
-
topNav,
|
|
20
|
-
bottomNav,
|
|
21
|
-
loading,
|
|
22
|
-
show,
|
|
23
|
-
retour,
|
|
24
|
-
onRetour,
|
|
25
|
-
children
|
|
26
|
-
} = _ref;
|
|
27
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
28
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiMainTitle.default, {
|
|
29
|
-
title: title,
|
|
30
|
-
icon: titleIcon,
|
|
31
|
-
trace: trace
|
|
32
|
-
}), show && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
33
|
-
children: [Boolean(topNav) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiNavigation.default, {
|
|
34
|
-
onRetour: onRetour,
|
|
35
|
-
retour: retour,
|
|
36
|
-
sx: {
|
|
37
|
-
marginBottom: 2
|
|
38
|
-
},
|
|
39
|
-
children: navActions
|
|
40
|
-
}), children, Boolean(bottomNav) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiNavigation.default, {
|
|
41
|
-
onRetour: onRetour,
|
|
42
|
-
retour: retour,
|
|
43
|
-
sx: {
|
|
44
|
-
marginTop: 2
|
|
45
|
-
},
|
|
46
|
-
children: navActions
|
|
47
|
-
})]
|
|
48
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiLoadingBackdrop.default, {
|
|
49
|
-
open: loading
|
|
50
|
-
})]
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
PuiDefaultPage.propTypes = {
|
|
54
|
-
title: _propTypes.default.string.isRequired,
|
|
55
|
-
titleIcon: _propTypes.default.element.isRequired,
|
|
56
|
-
trace: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
57
|
-
navActions: _propTypes.default.element,
|
|
58
|
-
topNav: _propTypes.default.bool,
|
|
59
|
-
bottomNav: _propTypes.default.bool,
|
|
60
|
-
loading: _propTypes.default.bool,
|
|
61
|
-
retour: _propTypes.default.bool,
|
|
62
|
-
onRetour: _propTypes.default.func
|
|
63
|
-
};
|
|
64
|
-
PuiDefaultPage.defaultProps = {
|
|
65
|
-
loading: false,
|
|
66
|
-
show: true
|
|
67
|
-
};
|
|
68
|
-
var _default = exports.default = PuiDefaultPage;
|
|
@@ -1,436 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.weak-map.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
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
11
|
-
require("core-js/modules/esnext.iterator.map.js");
|
|
12
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
13
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
var _formik = require("formik");
|
|
16
|
-
var _PuiFormikForm = _interopRequireDefault(require("../../../others/PuiFormikForm"));
|
|
17
|
-
var _PuiIcon = _interopRequireDefault(require("../../../others/PuiIcon"));
|
|
18
|
-
var _PuiTable = _interopRequireDefault(require("../../../table/PuiTable"));
|
|
19
|
-
var _PuiDefaultPage = _interopRequireDefault(require("./PuiDefaultPage"));
|
|
20
|
-
var _styleUtils = require("../../../../config/styleUtils");
|
|
21
|
-
var _antd = require("antd");
|
|
22
|
-
var _icons = require("@ant-design/icons");
|
|
23
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
25
|
-
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); }
|
|
26
|
-
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 && {}.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; }
|
|
27
|
-
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; }
|
|
28
|
-
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; }
|
|
29
|
-
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; }
|
|
30
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
31
|
-
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); } // Ant Design imports
|
|
32
|
-
const {
|
|
33
|
-
Title,
|
|
34
|
-
Text
|
|
35
|
-
} = _antd.Typography;
|
|
36
|
-
const {
|
|
37
|
-
Panel
|
|
38
|
-
} = _antd.Collapse;
|
|
39
|
-
|
|
40
|
-
// Définition des styles locaux pour éviter les problèmes d'importation
|
|
41
|
-
const styles = {
|
|
42
|
-
colors: {
|
|
43
|
-
headerBackground: '#f5f8fa',
|
|
44
|
-
rowBackgroundOdd: '#ffffff',
|
|
45
|
-
rowBackgroundEven: '#F6F9FF',
|
|
46
|
-
borderLight: 'rgba(224, 224, 224, 0.3)',
|
|
47
|
-
borderMedium: 'rgba(224, 224, 224, 0.5)'
|
|
48
|
-
},
|
|
49
|
-
sizes: {
|
|
50
|
-
borderRadius: '8px'
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// Styles CSS pour les boutons "Plus d'options" et "Moins d'options"
|
|
55
|
-
const toggleButtonStyle = {
|
|
56
|
-
color: '#1890ff',
|
|
57
|
-
fontWeight: 500,
|
|
58
|
-
padding: '4px 8px',
|
|
59
|
-
height: 'auto',
|
|
60
|
-
marginLeft: '8px',
|
|
61
|
-
pointerEvents: 'auto' // Assure que les événements sont capturés par le bouton
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
// Container pour le formulaire de recherche avec design Ant
|
|
65
|
-
const PuiStandardSearchPageContainer = _ref => {
|
|
66
|
-
let {
|
|
67
|
-
actions,
|
|
68
|
-
children
|
|
69
|
-
} = _ref;
|
|
70
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
71
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Card, {
|
|
72
|
-
bodyStyle: {
|
|
73
|
-
padding: '16px',
|
|
74
|
-
backgroundColor: '#fff'
|
|
75
|
-
},
|
|
76
|
-
children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Divider, {
|
|
77
|
-
style: {
|
|
78
|
-
margin: '16px 0'
|
|
79
|
-
}
|
|
80
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Row, {
|
|
81
|
-
justify: "end",
|
|
82
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Col, {
|
|
83
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Space, {
|
|
84
|
-
size: "middle",
|
|
85
|
-
children: actions
|
|
86
|
-
})
|
|
87
|
-
})
|
|
88
|
-
})]
|
|
89
|
-
})
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
const PuiSearchPage = _ref2 => {
|
|
93
|
-
let {
|
|
94
|
-
formik,
|
|
95
|
-
formikProps,
|
|
96
|
-
title,
|
|
97
|
-
titleIcon,
|
|
98
|
-
trace,
|
|
99
|
-
navActions,
|
|
100
|
-
topNav,
|
|
101
|
-
bottomNav,
|
|
102
|
-
loading,
|
|
103
|
-
tableProps,
|
|
104
|
-
retour,
|
|
105
|
-
onRetour,
|
|
106
|
-
onReset,
|
|
107
|
-
onSubmit,
|
|
108
|
-
children,
|
|
109
|
-
additionalActions,
|
|
110
|
-
collapsibleSearchSection = true,
|
|
111
|
-
alwaysVisibleFields = null,
|
|
112
|
-
collapsibleFields = null
|
|
113
|
-
} = _ref2;
|
|
114
|
-
const [isSearchSectionExpanded, setSearchSectionExpanded] = (0, _react.useState)(false);
|
|
115
|
-
|
|
116
|
-
// Ensure tableProps is properly initialized
|
|
117
|
-
(0, _react.useEffect)(() => {
|
|
118
|
-
if (!tableProps) {
|
|
119
|
-
console.warn('tableProps is undefined in PuiSearchPage');
|
|
120
|
-
}
|
|
121
|
-
}, [tableProps]);
|
|
122
|
-
|
|
123
|
-
// Si des champs spécifiques sont définis comme collapsibles
|
|
124
|
-
const hasCollapsibleFields = collapsibleFields !== null;
|
|
125
|
-
// Si des champs sont toujours visibles
|
|
126
|
-
const hasAlwaysVisibleFields = alwaysVisibleFields !== null;
|
|
127
|
-
|
|
128
|
-
// Fonction qui détermine si la section de recherche a des champs à afficher même si collapsée
|
|
129
|
-
const shouldRenderSearchContent = () => {
|
|
130
|
-
if (!collapsibleSearchSection) return true; // Si non collapsible, toujours afficher
|
|
131
|
-
if (hasAlwaysVisibleFields) return true; // Si des champs sont toujours visibles, les afficher
|
|
132
|
-
return isSearchSectionExpanded; // Sinon, afficher seulement si la section est étendue
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
// Fonction dédiée pour gérer le clic sur les boutons "Plus d'options" et "Moins d'options"
|
|
136
|
-
// Utilisation d'une fonction de type mousedown au lieu de click pour éviter les problèmes de propagation
|
|
137
|
-
const handleToggleMouseDown = e => {
|
|
138
|
-
// Empêcher explicitement le comportement par défaut et la propagation
|
|
139
|
-
if (e) {
|
|
140
|
-
e.preventDefault();
|
|
141
|
-
e.stopPropagation();
|
|
142
|
-
if (e.nativeEvent) {
|
|
143
|
-
e.nativeEvent.preventDefault();
|
|
144
|
-
e.nativeEvent.stopImmediatePropagation();
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// Utiliser setTimeout pour s'assurer que l'action se produit après la gestion de l'événement
|
|
149
|
-
setTimeout(() => {
|
|
150
|
-
setSearchSectionExpanded(prev => !prev);
|
|
151
|
-
}, 0);
|
|
152
|
-
return false; // Retourner false pour empêcher le comportement par défaut
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
// Fonction pour gérer le clic sur l'en-tête du panneau de recherche
|
|
156
|
-
const handleHeaderMouseDown = e => {
|
|
157
|
-
// Ne traiter le clic que s'il provient directement de l'en-tête
|
|
158
|
-
// et non d'un élément enfant comme un bouton
|
|
159
|
-
if (e.target === e.currentTarget || e.target.tagName === 'DIV' || e.target.tagName === 'SPAN') {
|
|
160
|
-
// Empêcher la propagation et le comportement par défaut
|
|
161
|
-
e.preventDefault();
|
|
162
|
-
e.stopPropagation();
|
|
163
|
-
if (e.nativeEvent) {
|
|
164
|
-
e.nativeEvent.preventDefault();
|
|
165
|
-
e.nativeEvent.stopImmediatePropagation();
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// Utiliser setTimeout pour s'assurer que l'action se produit après la gestion de l'événement
|
|
169
|
-
setTimeout(() => {
|
|
170
|
-
setSearchSectionExpanded(prev => !prev);
|
|
171
|
-
}, 0);
|
|
172
|
-
}
|
|
173
|
-
return false; // Retourner false pour empêcher le comportement par défaut
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
// Fonction pour rendre le contenu des champs en fonction de leur visibilité
|
|
177
|
-
const renderSearchFields = () => {
|
|
178
|
-
// Si pas de champs collapsibles ou toujours visibles spécifiés, on affiche tous les enfants
|
|
179
|
-
if (!hasCollapsibleFields && !hasAlwaysVisibleFields) {
|
|
180
|
-
return children;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// Si la section est étendue ou pas de champs collapsibles, on affiche tous les champs
|
|
184
|
-
if (isSearchSectionExpanded && hasCollapsibleFields) {
|
|
185
|
-
return collapsibleFields;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// Si la section est collapsée et qu'on a des champs toujours visibles, on les affiche
|
|
189
|
-
if (hasAlwaysVisibleFields) {
|
|
190
|
-
return alwaysVisibleFields;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
// Par défaut, afficher les enfants
|
|
194
|
-
return children;
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
// Bouton pour étendre/réduire les champs additionnels
|
|
198
|
-
const renderToggleButton = () => {
|
|
199
|
-
if (!hasCollapsibleFields) return null;
|
|
200
|
-
|
|
201
|
-
// Utiliser un div au lieu d'un Button pour éviter les problèmes de propagation
|
|
202
|
-
if (isSearchSectionExpanded) {
|
|
203
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
204
|
-
role: "button",
|
|
205
|
-
tabIndex: 0,
|
|
206
|
-
onMouseDown: handleToggleMouseDown,
|
|
207
|
-
onClick: e => e.preventDefault(),
|
|
208
|
-
style: _objectSpread(_objectSpread({}, toggleButtonStyle), {}, {
|
|
209
|
-
display: 'inline-flex',
|
|
210
|
-
alignItems: 'center',
|
|
211
|
-
cursor: 'pointer'
|
|
212
|
-
}),
|
|
213
|
-
className: "toggle-options-button",
|
|
214
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.UpOutlined, {
|
|
215
|
-
style: {
|
|
216
|
-
marginRight: '4px'
|
|
217
|
-
}
|
|
218
|
-
}), " Moins d'options"]
|
|
219
|
-
});
|
|
220
|
-
} else {
|
|
221
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
222
|
-
role: "button",
|
|
223
|
-
tabIndex: 0,
|
|
224
|
-
onMouseDown: handleToggleMouseDown,
|
|
225
|
-
onClick: e => e.preventDefault(),
|
|
226
|
-
style: _objectSpread(_objectSpread({}, toggleButtonStyle), {}, {
|
|
227
|
-
display: 'inline-flex',
|
|
228
|
-
alignItems: 'center',
|
|
229
|
-
cursor: 'pointer'
|
|
230
|
-
}),
|
|
231
|
-
className: "toggle-options-button",
|
|
232
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.DownOutlined, {
|
|
233
|
-
style: {
|
|
234
|
-
marginRight: '4px'
|
|
235
|
-
}
|
|
236
|
-
}), " Plus d'options"]
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
// Fonction pour créer un gestionnaire d'événements sécurisé pour les boutons sans paramètre
|
|
242
|
-
const createSafeHandler = action => e => {
|
|
243
|
-
// Empêcher la propagation de l'événement et le comportement par défaut
|
|
244
|
-
if (e) {
|
|
245
|
-
e.preventDefault();
|
|
246
|
-
e.stopPropagation();
|
|
247
|
-
if (e.nativeEvent) {
|
|
248
|
-
e.nativeEvent.preventDefault();
|
|
249
|
-
e.nativeEvent.stopImmediatePropagation();
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
// Utiliser setTimeout pour s'assurer que l'action se produit après la gestion de l'événement
|
|
254
|
-
setTimeout(() => {
|
|
255
|
-
if (typeof action === 'function') {
|
|
256
|
-
action();
|
|
257
|
-
}
|
|
258
|
-
}, 0);
|
|
259
|
-
return false; // Retourner false pour empêcher le comportement par défaut
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
// Fonction pour créer un gestionnaire d'événements sécurisé pour les actions avec paramètre row
|
|
263
|
-
const createRowActionHandler = (action, row) => e => {
|
|
264
|
-
// Empêcher la propagation de l'événement et le comportement par défaut
|
|
265
|
-
if (e) {
|
|
266
|
-
e.preventDefault();
|
|
267
|
-
e.stopPropagation();
|
|
268
|
-
if (e.nativeEvent) {
|
|
269
|
-
e.nativeEvent.preventDefault();
|
|
270
|
-
e.nativeEvent.stopImmediatePropagation();
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
// Utiliser setTimeout pour s'assurer que l'action se produit après la gestion de l'événement
|
|
275
|
-
setTimeout(() => {
|
|
276
|
-
if (typeof action === 'function') {
|
|
277
|
-
action(row);
|
|
278
|
-
} else {
|
|
279
|
-
console.warn('Action is not a function', action);
|
|
280
|
-
}
|
|
281
|
-
}, 0);
|
|
282
|
-
return false; // Retourner false pour empêcher le comportement par défaut
|
|
283
|
-
};
|
|
284
|
-
|
|
285
|
-
// Vérification de sécurité pour tableProps
|
|
286
|
-
const safeTableProps = tableProps || {
|
|
287
|
-
rows: [],
|
|
288
|
-
columns: []
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
// Calcul du titre du panel de recherche avec l'icône
|
|
292
|
-
const searchPanelHeader = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
293
|
-
onMouseDown: collapsibleSearchSection ? handleHeaderMouseDown : undefined,
|
|
294
|
-
onClick: e => e.preventDefault(),
|
|
295
|
-
style: {
|
|
296
|
-
cursor: collapsibleSearchSection ? 'pointer' : 'default',
|
|
297
|
-
userSelect: 'none' // Empêcher la sélection de texte
|
|
298
|
-
},
|
|
299
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
300
|
-
align: "center",
|
|
301
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SettingOutlined, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Text, {
|
|
302
|
-
strong: true,
|
|
303
|
-
children: "Param\xE8tres de recherche"
|
|
304
|
-
}), collapsibleSearchSection && (isSearchSectionExpanded ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.UpOutlined, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.DownOutlined, {}))]
|
|
305
|
-
})
|
|
306
|
-
});
|
|
307
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiDefaultPage.default, {
|
|
308
|
-
title: title,
|
|
309
|
-
titleIcon: titleIcon,
|
|
310
|
-
trace: trace,
|
|
311
|
-
navActions: navActions,
|
|
312
|
-
topNav: topNav,
|
|
313
|
-
bottomNav: bottomNav,
|
|
314
|
-
loading: loading,
|
|
315
|
-
retour: retour,
|
|
316
|
-
onRetour: onRetour,
|
|
317
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Collapse, {
|
|
318
|
-
defaultActiveKey: ['searchPanel'],
|
|
319
|
-
ghost: true,
|
|
320
|
-
expandIconPosition: "end",
|
|
321
|
-
style: {
|
|
322
|
-
marginBottom: 16
|
|
323
|
-
},
|
|
324
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Panel, {
|
|
325
|
-
header: searchPanelHeader,
|
|
326
|
-
children: shouldRenderSearchContent() && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
327
|
-
children: formik ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_formik.Formik, _objectSpread(_objectSpread({
|
|
328
|
-
initialValues: (formikProps === null || formikProps === void 0 ? void 0 : formikProps.initialValues) || {}
|
|
329
|
-
}, formikProps), {}, {
|
|
330
|
-
children: _ref3 => {
|
|
331
|
-
let {
|
|
332
|
-
resetForm,
|
|
333
|
-
submitForm
|
|
334
|
-
} = _ref3;
|
|
335
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiFormikForm.default, {
|
|
336
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PuiStandardSearchPageContainer, {
|
|
337
|
-
actions: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
338
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
339
|
-
title: "Effacer",
|
|
340
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Button, {
|
|
341
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ClearOutlined, {}),
|
|
342
|
-
onClick: createSafeHandler(resetForm),
|
|
343
|
-
children: "Effacer"
|
|
344
|
-
})
|
|
345
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
346
|
-
title: "Rechercher",
|
|
347
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Button, {
|
|
348
|
-
type: "primary",
|
|
349
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SearchOutlined, {}),
|
|
350
|
-
onClick: createSafeHandler(submitForm),
|
|
351
|
-
loading: loading,
|
|
352
|
-
children: "Rechercher"
|
|
353
|
-
})
|
|
354
|
-
}), additionalActions && additionalActions.map((actionItem, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Button, {
|
|
355
|
-
icon: actionItem.icon,
|
|
356
|
-
onClick: createSafeHandler(() => actionItem.action()),
|
|
357
|
-
children: actionItem.name
|
|
358
|
-
}, index)), hasCollapsibleFields && renderToggleButton()]
|
|
359
|
-
}),
|
|
360
|
-
children: renderSearchFields()
|
|
361
|
-
})
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
})) : /*#__PURE__*/(0, _jsxRuntime.jsx)(PuiStandardSearchPageContainer, {
|
|
365
|
-
actions: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
366
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
367
|
-
title: "Effacer",
|
|
368
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Button, {
|
|
369
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ClearOutlined, {}),
|
|
370
|
-
onClick: createSafeHandler(onReset),
|
|
371
|
-
children: "Effacer"
|
|
372
|
-
})
|
|
373
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
374
|
-
title: "Rechercher",
|
|
375
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Button, {
|
|
376
|
-
type: "primary",
|
|
377
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SearchOutlined, {}),
|
|
378
|
-
onClick: createSafeHandler(onSubmit),
|
|
379
|
-
loading: loading,
|
|
380
|
-
children: "Rechercher"
|
|
381
|
-
})
|
|
382
|
-
}), additionalActions && additionalActions.map((actionItem, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Button, {
|
|
383
|
-
icon: actionItem.icon,
|
|
384
|
-
onClick: createSafeHandler(() => actionItem.action()),
|
|
385
|
-
children: actionItem.name
|
|
386
|
-
}, index)), hasCollapsibleFields && renderToggleButton()]
|
|
387
|
-
}),
|
|
388
|
-
children: renderSearchFields()
|
|
389
|
-
})
|
|
390
|
-
})
|
|
391
|
-
}, "searchPanel")
|
|
392
|
-
}), tableProps && /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Card, {
|
|
393
|
-
style: {
|
|
394
|
-
marginTop: 16
|
|
395
|
-
},
|
|
396
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTable.default, _objectSpread(_objectSpread({}, tableProps), {}, {
|
|
397
|
-
loading: loading
|
|
398
|
-
}))
|
|
399
|
-
})]
|
|
400
|
-
});
|
|
401
|
-
};
|
|
402
|
-
PuiSearchPage.propTypes = {
|
|
403
|
-
formik: _propTypes.default.bool,
|
|
404
|
-
formikProps: _propTypes.default.object,
|
|
405
|
-
title: _propTypes.default.string.isRequired,
|
|
406
|
-
titleIcon: _propTypes.default.element.isRequired,
|
|
407
|
-
trace: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
408
|
-
navActions: _propTypes.default.element,
|
|
409
|
-
topNav: _propTypes.default.bool,
|
|
410
|
-
bottomNav: _propTypes.default.bool,
|
|
411
|
-
loading: _propTypes.default.bool,
|
|
412
|
-
tableProps: _propTypes.default.shape({
|
|
413
|
-
pinnedColumns: _propTypes.default.object // Added pinnedColumns prop type
|
|
414
|
-
}),
|
|
415
|
-
retour: _propTypes.default.bool,
|
|
416
|
-
onRetour: _propTypes.default.func,
|
|
417
|
-
onReset: _propTypes.default.func,
|
|
418
|
-
onSubmit: _propTypes.default.func,
|
|
419
|
-
additionalActions: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
420
|
-
name: _propTypes.default.string.isRequired,
|
|
421
|
-
action: _propTypes.default.func.isRequired,
|
|
422
|
-
icon: _propTypes.default.element
|
|
423
|
-
})),
|
|
424
|
-
collapsibleSearchSection: _propTypes.default.bool,
|
|
425
|
-
alwaysVisibleFields: _propTypes.default.node,
|
|
426
|
-
collapsibleFields: _propTypes.default.node
|
|
427
|
-
};
|
|
428
|
-
PuiSearchPage.defaultProps = {
|
|
429
|
-
formik: true,
|
|
430
|
-
loading: false,
|
|
431
|
-
additionalActions: [],
|
|
432
|
-
collapsibleSearchSection: true,
|
|
433
|
-
alwaysVisibleFields: null,
|
|
434
|
-
collapsibleFields: null
|
|
435
|
-
};
|
|
436
|
-
var _default = exports.default = PuiSearchPage;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _styles = require("@mui/material/styles");
|
|
9
|
-
var _CssBaseline = _interopRequireDefault(require("@mui/material/CssBaseline"));
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
var _theme = require("./theme");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
/**
|
|
15
|
-
* Fournisseur de thème pour l'application
|
|
16
|
-
* Enveloppe les composants avec le thème personnalisé
|
|
17
|
-
*/const ThemeProvider = _ref => {
|
|
18
|
-
let {
|
|
19
|
-
children
|
|
20
|
-
} = _ref;
|
|
21
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledEngineProvider, {
|
|
22
|
-
injectFirst: true,
|
|
23
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.ThemeProvider, {
|
|
24
|
-
theme: _theme.theme,
|
|
25
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CssBaseline.default, {}), children]
|
|
26
|
-
})
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
ThemeProvider.propTypes = {
|
|
30
|
-
children: _propTypes.default.node.isRequired
|
|
31
|
-
};
|
|
32
|
-
var _default = exports.default = ThemeProvider;
|