@portnet/ui 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/buttons/PuiButton.js +2 -4
- package/dist/components/buttons/PuiIconButton.js +2 -4
- package/dist/components/common/StyledMuiButton.js +2 -4
- package/dist/components/common/StyledMuiTextField.js +2 -4
- package/dist/components/inputs/PuiAutocomplete.js +2 -4
- package/dist/components/inputs/PuiCheckbox.js +2 -2
- package/dist/components/inputs/PuiCheckboxItem.js +2 -4
- package/dist/components/inputs/PuiDateField.js +121 -59
- package/dist/components/inputs/PuiDateTimeField.js +2 -4
- package/dist/components/inputs/PuiFileField.js +2 -4
- package/dist/components/inputs/PuiRadioGroup.js +2 -4
- package/dist/components/inputs/PuiSelect.js +2 -4
- package/dist/components/inputs/PuiTextField.js +2 -4
- package/dist/components/others/DateTimePickerField.js +183 -52
- package/dist/components/others/PuiChip.js +2 -4
- package/dist/components/others/PuiDialog.js +2 -4
- package/dist/components/others/PuiIcon.js +2 -4
- package/dist/components/others/PuiMainContainer.js +2 -4
- package/dist/components/others/PuiTooltip.js +2 -4
- package/dist/components/providers/PuiLocalizationProvider.js +2 -4
- package/dist/components/referentiel/components/PuiSimpleReferentielField.js +2 -4
- package/dist/components/tab/PuiTabs.js +2 -4
- package/dist/components/table/PuiTable.js +12 -15
- package/dist/components/typography/PuiMainTitle.js +1 -1
- package/dist/components/ui/dialogs/PuiSearchDialog.js +2 -4
- package/dist/components/ui/pages/general/PuiSearchPage.js +35 -57
- package/package.json +2 -5
- package/dist/components/table/ActionPopover.js +0 -55
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.weak-map.js");
|
|
4
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
5
4
|
require("core-js/modules/esnext.iterator.filter.js");
|
|
6
5
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
6
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
10
|
exports.default = void 0;
|
|
11
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
11
12
|
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
13
|
var _formik = require("formik");
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
var React = _interopRequireWildcard(require("react"));
|
|
16
16
|
var _PuiButton = _interopRequireDefault(require("../../../buttons/PuiButton"));
|
|
17
17
|
var _PuiFormikForm = _interopRequireDefault(require("../../../others/PuiFormikForm"));
|
|
18
18
|
var _PuiGrid = _interopRequireDefault(require("../../../others/PuiGrid"));
|
|
@@ -20,17 +20,15 @@ var _PuiIcon = _interopRequireDefault(require("../../../others/PuiIcon"));
|
|
|
20
20
|
var _PuiSection = _interopRequireDefault(require("../../../others/PuiSection"));
|
|
21
21
|
var _PuiTable = _interopRequireDefault(require("../../../table/PuiTable"));
|
|
22
22
|
var _PuiDefaultPage = _interopRequireDefault(require("./PuiDefaultPage"));
|
|
23
|
-
var _ExpandMore = _interopRequireDefault(require("@mui/icons-material/ExpandMore"));
|
|
24
|
-
var _ExpandLess = _interopRequireDefault(require("@mui/icons-material/ExpandLess"));
|
|
25
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
27
24
|
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); }
|
|
28
25
|
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; }
|
|
26
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
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; }
|
|
30
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; }
|
|
31
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; }
|
|
32
30
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
33
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
31
|
+
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); }
|
|
34
32
|
const PuiStandardSearchPageContainer = _ref => {
|
|
35
33
|
let {
|
|
36
34
|
actions,
|
|
@@ -66,13 +64,8 @@ const PuiSearchPage = _ref2 => {
|
|
|
66
64
|
onReset,
|
|
67
65
|
onSubmit,
|
|
68
66
|
children: _children,
|
|
69
|
-
additionalActions
|
|
70
|
-
collapsibleSearchSection = true // Collapsible by default
|
|
67
|
+
additionalActions
|
|
71
68
|
} = _ref2;
|
|
72
|
-
const [isSearchSectionExpanded, setSearchSectionExpanded] = (0, _react.useState)(false);
|
|
73
|
-
const toggleSearchSection = () => {
|
|
74
|
-
setSearchSectionExpanded(prev => !prev);
|
|
75
|
-
};
|
|
76
69
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiDefaultPage.default, {
|
|
77
70
|
title: title,
|
|
78
71
|
titleIcon: titleIcon,
|
|
@@ -84,24 +77,11 @@ const PuiSearchPage = _ref2 => {
|
|
|
84
77
|
retour: retour,
|
|
85
78
|
onRetour: onRetour,
|
|
86
79
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiSection.default, {
|
|
87
|
-
title:
|
|
88
|
-
onClick: toggleSearchSection,
|
|
89
|
-
style: {
|
|
90
|
-
display: "flex",
|
|
91
|
-
alignItems: "center",
|
|
92
|
-
cursor: collapsibleSearchSection ? "pointer" : "default"
|
|
93
|
-
},
|
|
94
|
-
children: [collapsibleSearchSection && (isSearchSectionExpanded ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandLess.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandMore.default, {})), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
95
|
-
style: {
|
|
96
|
-
marginLeft: collapsibleSearchSection ? "8px" : "0px"
|
|
97
|
-
},
|
|
98
|
-
children: "Param\xE8tres de recherche"
|
|
99
|
-
})]
|
|
100
|
-
}),
|
|
80
|
+
title: "Param\xE8tres de recherche",
|
|
101
81
|
sx: {
|
|
102
82
|
marginBottom: 2
|
|
103
83
|
},
|
|
104
|
-
children:
|
|
84
|
+
children: formik ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_formik.Formik, _objectSpread(_objectSpread({
|
|
105
85
|
initialValues: {}
|
|
106
86
|
}, formikProps), {}, {
|
|
107
87
|
children: _ref3 => {
|
|
@@ -136,14 +116,16 @@ const PuiSearchPage = _ref2 => {
|
|
|
136
116
|
loadingPosition: "start",
|
|
137
117
|
children: "Rechercher"
|
|
138
118
|
})
|
|
139
|
-
}), additionalActions && additionalActions.map((actionItem, index) =>
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
119
|
+
}), additionalActions && additionalActions.map((actionItem, index) => {
|
|
120
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
121
|
+
item: true,
|
|
122
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
123
|
+
startIcon: actionItem.icon,
|
|
124
|
+
onClick: actionItem.action,
|
|
125
|
+
children: actionItem.name
|
|
126
|
+
})
|
|
127
|
+
}, index);
|
|
128
|
+
})]
|
|
147
129
|
}),
|
|
148
130
|
children: _children
|
|
149
131
|
})
|
|
@@ -175,22 +157,22 @@ const PuiSearchPage = _ref2 => {
|
|
|
175
157
|
loadingPosition: "start",
|
|
176
158
|
children: "Rechercher"
|
|
177
159
|
})
|
|
178
|
-
}), additionalActions && additionalActions.map((actionItem, index) =>
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
160
|
+
}), additionalActions && additionalActions.map((actionItem, index) => {
|
|
161
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
162
|
+
item: true,
|
|
163
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
164
|
+
startIcon: actionItem.icon,
|
|
165
|
+
onClick: actionItem.action,
|
|
166
|
+
children: actionItem.name
|
|
167
|
+
})
|
|
168
|
+
}, index);
|
|
169
|
+
})]
|
|
186
170
|
}),
|
|
187
171
|
children: _children
|
|
188
|
-
})
|
|
189
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTable.default, _objectSpread(
|
|
172
|
+
})
|
|
173
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTable.default, _objectSpread({
|
|
190
174
|
paginationMode: "server"
|
|
191
|
-
}, tableProps)
|
|
192
|
-
pinnedColumns: tableProps.pinnedColumns // Added pinnedColumns
|
|
193
|
-
}))]
|
|
175
|
+
}, tableProps))]
|
|
194
176
|
});
|
|
195
177
|
};
|
|
196
178
|
PuiSearchPage.propTypes = {
|
|
@@ -203,9 +185,7 @@ PuiSearchPage.propTypes = {
|
|
|
203
185
|
topNav: _propTypes.default.bool,
|
|
204
186
|
bottomNav: _propTypes.default.bool,
|
|
205
187
|
loading: _propTypes.default.bool,
|
|
206
|
-
tableProps: _propTypes.default.
|
|
207
|
-
pinnedColumns: _propTypes.default.object // Added pinnedColumns prop type
|
|
208
|
-
}),
|
|
188
|
+
tableProps: _propTypes.default.object,
|
|
209
189
|
retour: _propTypes.default.bool,
|
|
210
190
|
onRetour: _propTypes.default.func,
|
|
211
191
|
onReset: _propTypes.default.func,
|
|
@@ -214,13 +194,11 @@ PuiSearchPage.propTypes = {
|
|
|
214
194
|
name: _propTypes.default.string.isRequired,
|
|
215
195
|
action: _propTypes.default.func.isRequired,
|
|
216
196
|
icon: _propTypes.default.element
|
|
217
|
-
}))
|
|
218
|
-
collapsibleSearchSection: _propTypes.default.bool
|
|
197
|
+
}))
|
|
219
198
|
};
|
|
220
199
|
PuiSearchPage.defaultProps = {
|
|
221
200
|
formik: true,
|
|
222
201
|
loading: false,
|
|
223
|
-
additionalActions: []
|
|
224
|
-
collapsibleSearchSection: true
|
|
202
|
+
additionalActions: []
|
|
225
203
|
};
|
|
226
204
|
var _default = exports.default = PuiSearchPage;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portnet/ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "Portnet UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -21,14 +21,11 @@
|
|
|
21
21
|
"@mui/material": "^5.10.16",
|
|
22
22
|
"@mui/x-data-grid": "^5.17.26",
|
|
23
23
|
"@mui/x-data-grid-pro": "^5.17.26",
|
|
24
|
-
"@mui/x-date-pickers": "^
|
|
24
|
+
"@mui/x-date-pickers": "^7.26.0",
|
|
25
25
|
"@testing-library/jest-dom": "^5.16.5",
|
|
26
26
|
"@testing-library/react": "^13.4.0",
|
|
27
27
|
"@testing-library/user-event": "^13.5.0",
|
|
28
|
-
"ajv": "^8.17.1",
|
|
29
|
-
"ajv-keywords": "^5.1.0",
|
|
30
28
|
"axios": "^0.27.2",
|
|
31
|
-
"dayjs": "^1.11.13",
|
|
32
29
|
"formik": "^2.2.9",
|
|
33
30
|
"lodash": "^4.17.21",
|
|
34
31
|
"moment": "^2.29.4",
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
require("core-js/modules/esnext.iterator.map.js");
|
|
8
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
9
|
-
var _Popover = _interopRequireDefault(require("@mui/material/Popover"));
|
|
10
|
-
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
11
|
-
var _MoreVert = _interopRequireDefault(require("@mui/icons-material/MoreVert"));
|
|
12
|
-
var _system = require("@mui/system");
|
|
13
|
-
var _react = _interopRequireDefault(require("react"));
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
-
const ActionPopover = _ref => {
|
|
17
|
-
let {
|
|
18
|
-
row,
|
|
19
|
-
actions
|
|
20
|
-
} = _ref;
|
|
21
|
-
const [anchorEl, setAnchorEl] = _react.default.useState(null);
|
|
22
|
-
const handleClick = event => {
|
|
23
|
-
setAnchorEl(event.currentTarget);
|
|
24
|
-
};
|
|
25
|
-
const handleClose = () => {
|
|
26
|
-
setAnchorEl(null);
|
|
27
|
-
};
|
|
28
|
-
const open = Boolean(anchorEl);
|
|
29
|
-
const id = open ? 'simple-popover' : undefined;
|
|
30
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
31
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
32
|
-
"aria-describedby": id,
|
|
33
|
-
onClick: handleClick,
|
|
34
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MoreVert.default, {})
|
|
35
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Popover.default, {
|
|
36
|
-
id: id,
|
|
37
|
-
open: open,
|
|
38
|
-
anchorEl: anchorEl,
|
|
39
|
-
onClose: handleClose,
|
|
40
|
-
anchorOrigin: {
|
|
41
|
-
vertical: 'bottom',
|
|
42
|
-
horizontal: 'left'
|
|
43
|
-
},
|
|
44
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_system.Box, {
|
|
45
|
-
p: 2,
|
|
46
|
-
children: actions.map((action, index) => /*#__PURE__*/_react.default.cloneElement(action, {
|
|
47
|
-
row,
|
|
48
|
-
key: index,
|
|
49
|
-
onClick: handleClose // Assuming you want to close the popover when an action is clicked
|
|
50
|
-
}))
|
|
51
|
-
})
|
|
52
|
-
})]
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
var _default = exports.default = ActionPopover;
|