@portnet/ui 2.0.8 → 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 -99
- 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
package/dist/components/referentiel/common/constants/specificReferentielsValidationSchemas.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.weak-map.js");
|
|
4
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var Yup = _interopRequireWildcard(require("yup"));
|
|
10
|
-
var _yupValidationErrors = require("../../../../general/yupValidationErrors");
|
|
11
|
-
var _specificReferentielsKeys = require("./specificReferentielsKeys");
|
|
12
|
-
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); }
|
|
13
|
-
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; }
|
|
14
|
-
const specificReferentielsValidationSchemas = {
|
|
15
|
-
[_specificReferentielsKeys.SPECIFIC_REFERENTIEL_LOCALITES]: Yup.object().shape({
|
|
16
|
-
code: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
17
|
-
codePays: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
18
|
-
description: Yup.string().typeError(_yupValidationErrors.TYPE_STRING)
|
|
19
|
-
}),
|
|
20
|
-
[_specificReferentielsKeys.SPECIFIC_REFERENTIEL_OPERATEURS_MANUTENTION]: Yup.object().shape({
|
|
21
|
-
code: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
22
|
-
idPort: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER),
|
|
23
|
-
description: Yup.string().typeError(_yupValidationErrors.TYPE_STRING)
|
|
24
|
-
}),
|
|
25
|
-
[_specificReferentielsKeys.SPECIFIC_REFERENTIEL_ESCALES]: Yup.object().shape({
|
|
26
|
-
id: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER),
|
|
27
|
-
numVoyage: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER),
|
|
28
|
-
numEscale: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER),
|
|
29
|
-
dateCreationFormatted: Yup.string().typeError(_yupValidationErrors.TYPE_STRING)
|
|
30
|
-
}),
|
|
31
|
-
[_specificReferentielsKeys.SPECIFIC_REFERENTIEL_OPERATEURS_IMP_EXP]: Yup.object().shape({
|
|
32
|
-
code: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
33
|
-
description: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
34
|
-
codePin: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
35
|
-
ifu: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER),
|
|
36
|
-
ice: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER),
|
|
37
|
-
numeroRc: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER),
|
|
38
|
-
centreRc: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER)
|
|
39
|
-
}),
|
|
40
|
-
[_specificReferentielsKeys.SPECIFIC_REFERENTIEL_BANQUES]: Yup.object().shape({
|
|
41
|
-
code: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
42
|
-
description: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
43
|
-
codeEDI: Yup.string().typeError(_yupValidationErrors.TYPE_STRING)
|
|
44
|
-
}),
|
|
45
|
-
[_specificReferentielsKeys.SPECIFIC_REFERENTIEL_TRANSITAIRES]: Yup.object().shape({
|
|
46
|
-
code: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
47
|
-
description: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
48
|
-
ifu: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER),
|
|
49
|
-
ice: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER),
|
|
50
|
-
numeroRc: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER),
|
|
51
|
-
centreRc: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER)
|
|
52
|
-
}),
|
|
53
|
-
[_specificReferentielsKeys.SPECIFIC_REFERENTIEL_NAVIRES]: Yup.object().shape({
|
|
54
|
-
imo: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
55
|
-
nom: Yup.string().typeError(_yupValidationErrors.TYPE_STRING)
|
|
56
|
-
}),
|
|
57
|
-
[_specificReferentielsKeys.SPECIFIC_REFERENTIEL_CONSIGNATAIRES]: Yup.object().shape({
|
|
58
|
-
codeEDI: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
59
|
-
code: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
60
|
-
description: Yup.string().typeError(_yupValidationErrors.TYPE_STRING)
|
|
61
|
-
}),
|
|
62
|
-
[_specificReferentielsKeys.SPECIFIC_REFERENTIEL_COMPTES_BANCAIRE]: Yup.object().shape({
|
|
63
|
-
rib: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
64
|
-
idBanque: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER),
|
|
65
|
-
mois: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER),
|
|
66
|
-
anne: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER)
|
|
67
|
-
}),
|
|
68
|
-
[_specificReferentielsKeys.SPECIFIC_REFERENTIEL_GUICHETS]: Yup.object().shape({
|
|
69
|
-
code: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
70
|
-
description: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
71
|
-
adresse: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
72
|
-
idBanque: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER),
|
|
73
|
-
idTypeLocalite: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER)
|
|
74
|
-
}),
|
|
75
|
-
[_specificReferentielsKeys.SPECIFIC_REFERENTIEL_NOMENCLATURES_DOUANIERES]: Yup.object().shape({
|
|
76
|
-
code: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
77
|
-
description: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
78
|
-
idTypeTitreImportation: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER),
|
|
79
|
-
idTypeTitreExportation: Yup.number().typeError(_yupValidationErrors.TYPE_NUMBER)
|
|
80
|
-
}),
|
|
81
|
-
[_specificReferentielsKeys.SPECIFIC_REFERENTIEL_TEST]: Yup.object().shape({
|
|
82
|
-
code: Yup.string().typeError(_yupValidationErrors.TYPE_STRING),
|
|
83
|
-
description: Yup.string().typeError(_yupValidationErrors.TYPE_STRING)
|
|
84
|
-
})
|
|
85
|
-
};
|
|
86
|
-
var _default = exports.default = specificReferentielsValidationSchemas;
|
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.weak-map.js");
|
|
4
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
5
|
-
require("core-js/modules/esnext.iterator.filter.js");
|
|
6
|
-
require("core-js/modules/esnext.iterator.for-each.js");
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.default = void 0;
|
|
11
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
12
|
-
var _formik = require("formik");
|
|
13
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
-
var React = _interopRequireWildcard(require("react"));
|
|
15
|
-
var _PuiTextField = _interopRequireDefault(require("../../inputs/PuiTextField"));
|
|
16
|
-
var _PuiIcon = _interopRequireDefault(require("../../others/PuiIcon"));
|
|
17
|
-
var _PuiTableAction = _interopRequireDefault(require("../../table/PuiTableAction"));
|
|
18
|
-
var _PuiSearchDialog = _interopRequireDefault(require("../../ui/dialogs/PuiSearchDialog"));
|
|
19
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
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); }
|
|
21
|
-
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; }
|
|
22
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
23
|
-
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; }
|
|
24
|
-
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; }
|
|
25
|
-
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; }
|
|
26
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
27
|
-
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); }
|
|
28
|
-
const CommunComponent = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
29
|
-
var _getRenderedValue;
|
|
30
|
-
let {
|
|
31
|
-
id,
|
|
32
|
-
className,
|
|
33
|
-
selectedRow,
|
|
34
|
-
sx,
|
|
35
|
-
title,
|
|
36
|
-
label,
|
|
37
|
-
error,
|
|
38
|
-
disabled,
|
|
39
|
-
loading,
|
|
40
|
-
rowCount,
|
|
41
|
-
rows,
|
|
42
|
-
page,
|
|
43
|
-
pageSize,
|
|
44
|
-
columns,
|
|
45
|
-
required,
|
|
46
|
-
focused,
|
|
47
|
-
fullWidth,
|
|
48
|
-
helperText,
|
|
49
|
-
getRenderedValue,
|
|
50
|
-
tableProps,
|
|
51
|
-
onSelect,
|
|
52
|
-
onPageChange,
|
|
53
|
-
children
|
|
54
|
-
} = _ref;
|
|
55
|
-
const [isDialogOpen, setIsDialogOpen] = React.useState(false);
|
|
56
|
-
const selectHandler = row => {
|
|
57
|
-
setIsDialogOpen(false);
|
|
58
|
-
onSelect(row);
|
|
59
|
-
};
|
|
60
|
-
const tableActions = [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTableAction.default, {
|
|
61
|
-
title: "Choisir",
|
|
62
|
-
onClick: selectHandler,
|
|
63
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiIcon.default, {
|
|
64
|
-
type: "choisir"
|
|
65
|
-
})
|
|
66
|
-
})];
|
|
67
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
68
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTextField.default, {
|
|
69
|
-
id: id,
|
|
70
|
-
ref: ref,
|
|
71
|
-
className: className,
|
|
72
|
-
sx: sx,
|
|
73
|
-
formik: false,
|
|
74
|
-
focused: focused,
|
|
75
|
-
required: required,
|
|
76
|
-
disabled: disabled,
|
|
77
|
-
fullWidth: fullWidth,
|
|
78
|
-
value: Boolean(selectedRow) ? (_getRenderedValue = getRenderedValue(selectedRow)) !== null && _getRenderedValue !== void 0 ? _getRenderedValue : "" : "",
|
|
79
|
-
readOnly: true,
|
|
80
|
-
error: error,
|
|
81
|
-
helperText: helperText,
|
|
82
|
-
label: label,
|
|
83
|
-
InputProps: {
|
|
84
|
-
endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiIcon.default, {
|
|
85
|
-
type: "rechercher",
|
|
86
|
-
size: "small",
|
|
87
|
-
sx: {
|
|
88
|
-
marginRight: "-5px"
|
|
89
|
-
}
|
|
90
|
-
})
|
|
91
|
-
},
|
|
92
|
-
onClick: disabled ? () => {} : () => setIsDialogOpen(true)
|
|
93
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiSearchDialog.default, {
|
|
94
|
-
open: isDialogOpen,
|
|
95
|
-
title: title,
|
|
96
|
-
onClose: () => setIsDialogOpen(false),
|
|
97
|
-
loading: loading,
|
|
98
|
-
rowCount: rowCount,
|
|
99
|
-
rows: rows,
|
|
100
|
-
page: page,
|
|
101
|
-
pageSize: pageSize,
|
|
102
|
-
columns: columns,
|
|
103
|
-
actions: tableActions,
|
|
104
|
-
onPageChange: onPageChange,
|
|
105
|
-
tableProps: _objectSpread({
|
|
106
|
-
paginationMode: "server",
|
|
107
|
-
oneActionOnly: true
|
|
108
|
-
}, tableProps),
|
|
109
|
-
children: children
|
|
110
|
-
})]
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
const PuiBaseStandardPopupReferentielField = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
114
|
-
let {
|
|
115
|
-
id,
|
|
116
|
-
className,
|
|
117
|
-
sx,
|
|
118
|
-
loading,
|
|
119
|
-
rowCount,
|
|
120
|
-
rows,
|
|
121
|
-
page,
|
|
122
|
-
pageSize,
|
|
123
|
-
columns,
|
|
124
|
-
title,
|
|
125
|
-
label,
|
|
126
|
-
name,
|
|
127
|
-
value,
|
|
128
|
-
error,
|
|
129
|
-
disabled,
|
|
130
|
-
required,
|
|
131
|
-
focused,
|
|
132
|
-
fullWidth,
|
|
133
|
-
helperText,
|
|
134
|
-
tableProps,
|
|
135
|
-
getReturnedValue,
|
|
136
|
-
getRenderedValue,
|
|
137
|
-
onChange,
|
|
138
|
-
onPageChange,
|
|
139
|
-
children
|
|
140
|
-
} = _ref2;
|
|
141
|
-
const [selectedRow, setSelectedRow] = React.useState(null);
|
|
142
|
-
const selectHandler = row => {
|
|
143
|
-
setSelectedRow(row);
|
|
144
|
-
onChange(getReturnedValue(row));
|
|
145
|
-
};
|
|
146
|
-
React.useEffect(() => {
|
|
147
|
-
if (value !== undefined && value !== null) {
|
|
148
|
-
setSelectedRow(value);
|
|
149
|
-
}
|
|
150
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
151
|
-
}, [value]);
|
|
152
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CommunComponent, {
|
|
153
|
-
ref: ref,
|
|
154
|
-
id: id,
|
|
155
|
-
className: className,
|
|
156
|
-
sx: sx,
|
|
157
|
-
selectedRow: selectedRow,
|
|
158
|
-
loading: loading,
|
|
159
|
-
rowCount: rowCount,
|
|
160
|
-
rows: rows,
|
|
161
|
-
page: page,
|
|
162
|
-
pageSize: pageSize,
|
|
163
|
-
columns: columns,
|
|
164
|
-
title: title,
|
|
165
|
-
label: label,
|
|
166
|
-
name: name,
|
|
167
|
-
error: error,
|
|
168
|
-
disabled: disabled,
|
|
169
|
-
required: required,
|
|
170
|
-
focused: focused,
|
|
171
|
-
fullWidth: fullWidth,
|
|
172
|
-
helperText: helperText,
|
|
173
|
-
tableProps: tableProps,
|
|
174
|
-
getRenderedValue: getRenderedValue,
|
|
175
|
-
onSelect: selectHandler,
|
|
176
|
-
onPageChange: onPageChange,
|
|
177
|
-
children: children
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
const PuiBaseFormikPopupReferentielField = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
181
|
-
let {
|
|
182
|
-
id,
|
|
183
|
-
className,
|
|
184
|
-
sx,
|
|
185
|
-
loading,
|
|
186
|
-
rowCount,
|
|
187
|
-
rows,
|
|
188
|
-
page,
|
|
189
|
-
pageSize,
|
|
190
|
-
columns,
|
|
191
|
-
title,
|
|
192
|
-
label,
|
|
193
|
-
name,
|
|
194
|
-
value,
|
|
195
|
-
error,
|
|
196
|
-
disabled,
|
|
197
|
-
required,
|
|
198
|
-
focused,
|
|
199
|
-
fullWidth,
|
|
200
|
-
helperText,
|
|
201
|
-
tableProps,
|
|
202
|
-
getReturnedValue,
|
|
203
|
-
getRenderedValue,
|
|
204
|
-
onChange,
|
|
205
|
-
onPageChange,
|
|
206
|
-
children
|
|
207
|
-
} = _ref3;
|
|
208
|
-
const [field, meta] = (0, _formik.useField)(name);
|
|
209
|
-
const formikContext = (0, _formik.useFormikContext)();
|
|
210
|
-
const [selectedRow, setSelectedRow] = React.useState(null);
|
|
211
|
-
const [hasError, setHasError] = React.useState(false);
|
|
212
|
-
const selectHandler = row => {
|
|
213
|
-
setSelectedRow(row);
|
|
214
|
-
formikContext.setFieldValue(name, getReturnedValue(row));
|
|
215
|
-
onChange(row);
|
|
216
|
-
};
|
|
217
|
-
React.useEffect(() => {
|
|
218
|
-
setHasError(Boolean(meta) && Boolean(meta.touched) && Boolean(meta.error));
|
|
219
|
-
}, [meta]);
|
|
220
|
-
React.useEffect(() => {
|
|
221
|
-
if (value !== undefined && value !== null) {
|
|
222
|
-
formikContext.setFieldValue(name, getReturnedValue(value));
|
|
223
|
-
setSelectedRow(value);
|
|
224
|
-
}
|
|
225
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
226
|
-
}, [value]);
|
|
227
|
-
React.useEffect(() => {
|
|
228
|
-
if (field.value === formikContext.initialValues[name] || field.value === "" || field.value === null || field.value === undefined) {
|
|
229
|
-
setSelectedRow(null);
|
|
230
|
-
}
|
|
231
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
232
|
-
}, [field.value]);
|
|
233
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CommunComponent, {
|
|
234
|
-
ref: ref,
|
|
235
|
-
id: id,
|
|
236
|
-
className: className,
|
|
237
|
-
sx: sx,
|
|
238
|
-
selectedRow: selectedRow,
|
|
239
|
-
loading: loading,
|
|
240
|
-
rowCount: rowCount,
|
|
241
|
-
rows: rows,
|
|
242
|
-
page: page,
|
|
243
|
-
pageSize: pageSize,
|
|
244
|
-
columns: columns,
|
|
245
|
-
title: title,
|
|
246
|
-
label: label,
|
|
247
|
-
name: name,
|
|
248
|
-
error: error || hasError,
|
|
249
|
-
disabled: disabled,
|
|
250
|
-
required: required,
|
|
251
|
-
focused: focused,
|
|
252
|
-
fullWidth: fullWidth,
|
|
253
|
-
tableProps: tableProps,
|
|
254
|
-
helperText: hasError && Boolean(meta.error) ? meta.error : helperText !== null && helperText !== void 0 ? helperText : "",
|
|
255
|
-
getRenderedValue: getRenderedValue,
|
|
256
|
-
onSelect: selectHandler,
|
|
257
|
-
onPageChange: onPageChange,
|
|
258
|
-
children: children
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
const PuiBasePopupReferentielField = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
|
|
262
|
-
let {
|
|
263
|
-
id,
|
|
264
|
-
className,
|
|
265
|
-
sx,
|
|
266
|
-
formik,
|
|
267
|
-
loading,
|
|
268
|
-
rowCount,
|
|
269
|
-
rows,
|
|
270
|
-
page,
|
|
271
|
-
pageSize,
|
|
272
|
-
columns,
|
|
273
|
-
title,
|
|
274
|
-
label,
|
|
275
|
-
name,
|
|
276
|
-
value,
|
|
277
|
-
error,
|
|
278
|
-
disabled,
|
|
279
|
-
required,
|
|
280
|
-
focused,
|
|
281
|
-
fullWidth,
|
|
282
|
-
helperText,
|
|
283
|
-
tableProps,
|
|
284
|
-
getReturnedValue,
|
|
285
|
-
getRenderedValue,
|
|
286
|
-
onChange,
|
|
287
|
-
onPageChange,
|
|
288
|
-
children
|
|
289
|
-
} = _ref4;
|
|
290
|
-
return /*#__PURE__*/React.createElement(formik ? PuiBaseFormikPopupReferentielField : PuiBaseStandardPopupReferentielField, {
|
|
291
|
-
id,
|
|
292
|
-
ref,
|
|
293
|
-
className,
|
|
294
|
-
sx,
|
|
295
|
-
title,
|
|
296
|
-
label,
|
|
297
|
-
loading,
|
|
298
|
-
rowCount,
|
|
299
|
-
rows,
|
|
300
|
-
page,
|
|
301
|
-
pageSize,
|
|
302
|
-
columns,
|
|
303
|
-
name,
|
|
304
|
-
value,
|
|
305
|
-
error,
|
|
306
|
-
disabled,
|
|
307
|
-
required,
|
|
308
|
-
focused,
|
|
309
|
-
fullWidth,
|
|
310
|
-
helperText,
|
|
311
|
-
tableProps,
|
|
312
|
-
onPageChange,
|
|
313
|
-
getRenderedValue,
|
|
314
|
-
getReturnedValue,
|
|
315
|
-
onChange,
|
|
316
|
-
children
|
|
317
|
-
});
|
|
318
|
-
});
|
|
319
|
-
PuiBasePopupReferentielField.propTypes = {
|
|
320
|
-
id: _propTypes.default.string,
|
|
321
|
-
className: _propTypes.default.string,
|
|
322
|
-
sx: _propTypes.default.object,
|
|
323
|
-
title: _propTypes.default.string.isRequired,
|
|
324
|
-
label: _propTypes.default.string,
|
|
325
|
-
loading: _propTypes.default.bool,
|
|
326
|
-
rowCount: _propTypes.default.number,
|
|
327
|
-
rows: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
328
|
-
page: _propTypes.default.number,
|
|
329
|
-
pageSize: _propTypes.default.number,
|
|
330
|
-
columns: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
331
|
-
name: _propTypes.default.string,
|
|
332
|
-
formik: _propTypes.default.bool,
|
|
333
|
-
error: _propTypes.default.bool,
|
|
334
|
-
disabled: _propTypes.default.bool,
|
|
335
|
-
required: _propTypes.default.bool,
|
|
336
|
-
focused: _propTypes.default.bool,
|
|
337
|
-
fullWidth: _propTypes.default.bool,
|
|
338
|
-
helperText: _propTypes.default.string,
|
|
339
|
-
tableProps: _propTypes.default.object,
|
|
340
|
-
getRenderedValue: _propTypes.default.func.isRequired,
|
|
341
|
-
getReturnedValue: _propTypes.default.func,
|
|
342
|
-
onChange: _propTypes.default.func,
|
|
343
|
-
onPageChange: _propTypes.default.func
|
|
344
|
-
};
|
|
345
|
-
PuiBasePopupReferentielField.defaultProps = {
|
|
346
|
-
formik: true,
|
|
347
|
-
disabled: false,
|
|
348
|
-
required: false,
|
|
349
|
-
error: false,
|
|
350
|
-
fullWidth: true,
|
|
351
|
-
loading: false,
|
|
352
|
-
tableProps: {},
|
|
353
|
-
getReturnedValue: value => value,
|
|
354
|
-
onChange: () => {},
|
|
355
|
-
onPageChange: () => {}
|
|
356
|
-
};
|
|
357
|
-
var _default = exports.default = PuiBasePopupReferentielField;
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/es.weak-map.js");
|
|
4
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
5
|
-
require("core-js/modules/esnext.iterator.filter.js");
|
|
6
|
-
require("core-js/modules/esnext.iterator.for-each.js");
|
|
7
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
8
|
-
Object.defineProperty(exports, "__esModule", {
|
|
9
|
-
value: true
|
|
10
|
-
});
|
|
11
|
-
exports.default = void 0;
|
|
12
|
-
var _formik = require("formik");
|
|
13
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
-
var React = _interopRequireWildcard(require("react"));
|
|
15
|
-
var _PuiButton = _interopRequireDefault(require("../../buttons/PuiButton"));
|
|
16
|
-
var _PuiFormikForm = _interopRequireDefault(require("../../others/PuiFormikForm"));
|
|
17
|
-
var _PuiGrid = _interopRequireDefault(require("../../others/PuiGrid"));
|
|
18
|
-
var _PuiIcon = _interopRequireDefault(require("../../others/PuiIcon"));
|
|
19
|
-
var _PuiBasePopupReferentielField = _interopRequireDefault(require("./PuiBasePopupReferentielField"));
|
|
20
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
24
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
|
-
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; }
|
|
27
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
28
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
29
|
-
const PuiCustomPopupReferentielField = _ref => {
|
|
30
|
-
let {
|
|
31
|
-
id,
|
|
32
|
-
className,
|
|
33
|
-
sx,
|
|
34
|
-
title,
|
|
35
|
-
label,
|
|
36
|
-
formikProps,
|
|
37
|
-
columns,
|
|
38
|
-
name,
|
|
39
|
-
value,
|
|
40
|
-
formik,
|
|
41
|
-
error,
|
|
42
|
-
disabled,
|
|
43
|
-
required,
|
|
44
|
-
focused,
|
|
45
|
-
fullWidth,
|
|
46
|
-
helperText,
|
|
47
|
-
loading,
|
|
48
|
-
rowCount,
|
|
49
|
-
rows,
|
|
50
|
-
page,
|
|
51
|
-
pageSize,
|
|
52
|
-
tableProps,
|
|
53
|
-
getReturnedValue,
|
|
54
|
-
getRenderedValue,
|
|
55
|
-
onPageChange,
|
|
56
|
-
onChange,
|
|
57
|
-
onSubmit,
|
|
58
|
-
children: _children
|
|
59
|
-
} = _ref;
|
|
60
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiBasePopupReferentielField.default, {
|
|
61
|
-
id: id,
|
|
62
|
-
className: className,
|
|
63
|
-
sx: sx,
|
|
64
|
-
name: name,
|
|
65
|
-
formik: formik,
|
|
66
|
-
loading: loading,
|
|
67
|
-
rowCount: rowCount,
|
|
68
|
-
rows: rows,
|
|
69
|
-
page: page,
|
|
70
|
-
pageSize: pageSize,
|
|
71
|
-
columns: columns,
|
|
72
|
-
focused: focused,
|
|
73
|
-
required: required,
|
|
74
|
-
disabled: disabled,
|
|
75
|
-
fullWidth: fullWidth,
|
|
76
|
-
value: value,
|
|
77
|
-
readOnly: true,
|
|
78
|
-
error: error,
|
|
79
|
-
helperText: helperText,
|
|
80
|
-
label: label,
|
|
81
|
-
title: title,
|
|
82
|
-
tableProps: tableProps,
|
|
83
|
-
getReturnedValue: getReturnedValue,
|
|
84
|
-
getRenderedValue: getRenderedValue,
|
|
85
|
-
onPageChange: onPageChange,
|
|
86
|
-
onChange: onChange,
|
|
87
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_formik.Formik, _objectSpread(_objectSpread({}, formikProps), {}, {
|
|
88
|
-
onSubmit: onSubmit,
|
|
89
|
-
children: _ref2 => {
|
|
90
|
-
let {
|
|
91
|
-
resetForm,
|
|
92
|
-
submitForm
|
|
93
|
-
} = _ref2;
|
|
94
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiFormikForm.default, {
|
|
95
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
|
|
96
|
-
container: true,
|
|
97
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
98
|
-
item: true,
|
|
99
|
-
xs: 12,
|
|
100
|
-
children: _children
|
|
101
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
102
|
-
item: true,
|
|
103
|
-
xs: 12,
|
|
104
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiGrid.default, {
|
|
105
|
-
container: true,
|
|
106
|
-
justifyContent: "end",
|
|
107
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
108
|
-
item: true,
|
|
109
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
110
|
-
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiIcon.default, {
|
|
111
|
-
type: "effacer",
|
|
112
|
-
size: "small"
|
|
113
|
-
}),
|
|
114
|
-
onClick: resetForm,
|
|
115
|
-
color: "tertiary",
|
|
116
|
-
children: "Effacer"
|
|
117
|
-
})
|
|
118
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
119
|
-
item: true,
|
|
120
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
121
|
-
startIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiIcon.default, {
|
|
122
|
-
type: "rechercher",
|
|
123
|
-
size: "small"
|
|
124
|
-
}),
|
|
125
|
-
onClick: submitForm,
|
|
126
|
-
loading: loading,
|
|
127
|
-
loadingPosition: "start",
|
|
128
|
-
children: "Rechercher"
|
|
129
|
-
})
|
|
130
|
-
})]
|
|
131
|
-
})
|
|
132
|
-
})]
|
|
133
|
-
})
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
}))
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
|
-
PuiCustomPopupReferentielField.propTypes = {
|
|
140
|
-
id: _propTypes.default.string,
|
|
141
|
-
className: _propTypes.default.string,
|
|
142
|
-
sx: _propTypes.default.object,
|
|
143
|
-
name: _propTypes.default.string,
|
|
144
|
-
title: _propTypes.default.string.isRequired,
|
|
145
|
-
label: _propTypes.default.string,
|
|
146
|
-
formikProps: _propTypes.default.object,
|
|
147
|
-
loading: _propTypes.default.bool,
|
|
148
|
-
rowCount: _propTypes.default.number,
|
|
149
|
-
rows: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
150
|
-
page: _propTypes.default.number,
|
|
151
|
-
pageSize: _propTypes.default.number,
|
|
152
|
-
columns: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
153
|
-
helperText: _propTypes.default.string,
|
|
154
|
-
formik: _propTypes.default.bool,
|
|
155
|
-
disabled: _propTypes.default.bool,
|
|
156
|
-
required: _propTypes.default.bool,
|
|
157
|
-
error: _propTypes.default.bool,
|
|
158
|
-
focused: _propTypes.default.bool,
|
|
159
|
-
fullWidth: _propTypes.default.bool,
|
|
160
|
-
tableProps: _propTypes.default.object,
|
|
161
|
-
getRenderedValue: _propTypes.default.func.isRequired,
|
|
162
|
-
getReturnedValue: _propTypes.default.func,
|
|
163
|
-
onPageChange: _propTypes.default.func.isRequired,
|
|
164
|
-
onChange: _propTypes.default.func,
|
|
165
|
-
onSubmit: _propTypes.default.func.isRequired
|
|
166
|
-
};
|
|
167
|
-
PuiCustomPopupReferentielField.defaultProps = {
|
|
168
|
-
disabled: false,
|
|
169
|
-
required: false,
|
|
170
|
-
error: false,
|
|
171
|
-
formik: true,
|
|
172
|
-
fullWidth: true,
|
|
173
|
-
loading: false,
|
|
174
|
-
formikProps: {
|
|
175
|
-
initialValues: {}
|
|
176
|
-
},
|
|
177
|
-
tableProps: {},
|
|
178
|
-
getReturnedValue: row => row,
|
|
179
|
-
onPageChange: () => {},
|
|
180
|
-
onChange: () => {}
|
|
181
|
-
};
|
|
182
|
-
var _default = exports.default = PuiCustomPopupReferentielField;
|