@portnet/ui 4.0.1 → 5.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/dist/components/inputs/PuiCheckbox.js +1 -2
- package/dist/components/inputs/PuiDateField.js +52 -176
- package/dist/components/inputs/PuiDateTimeField.js +5 -4
- package/dist/components/table/PuiTable.js +0 -1
- package/dist/components/ui/pages/general/PuiSearchPage.js +34 -56
- package/package.json +99 -105
- package/dist/components/others/DateTimePickerField.js +0 -210
- package/dist/components/table/ActionPopover.js +0 -56
|
@@ -14,7 +14,6 @@ require("core-js/modules/esnext.iterator.filter.js");
|
|
|
14
14
|
require("core-js/modules/esnext.iterator.map.js");
|
|
15
15
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
16
16
|
var _CheckBoxOutlineBlankRounded = _interopRequireDefault(require("@mui/icons-material/CheckBoxOutlineBlankRounded"));
|
|
17
|
-
var _CheckBoxRounded = _interopRequireDefault(require("@mui/icons-material/CheckBoxRounded"));
|
|
18
17
|
var _material = require("@mui/material");
|
|
19
18
|
var _styles = require("@mui/material/styles");
|
|
20
19
|
var _formik = require("formik");
|
|
@@ -142,7 +141,7 @@ const PuiStandardCheckbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
142
141
|
disabled: disabled,
|
|
143
142
|
value: value !== null && value !== void 0 ? value : true,
|
|
144
143
|
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckBoxOutlineBlankRounded.default, {}),
|
|
145
|
-
checkedIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
144
|
+
checkedIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckBoxOutlineBlankRounded.default, {}),
|
|
146
145
|
onChange: onChange
|
|
147
146
|
}, rest))
|
|
148
147
|
}), !disableHelperText && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormHelperText, {
|
|
@@ -9,163 +9,50 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.default = void 0;
|
|
11
11
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
12
|
-
var
|
|
12
|
+
var _styles = require("@mui/material/styles");
|
|
13
13
|
var _DesktopDatePicker = require("@mui/x-date-pickers/DesktopDatePicker");
|
|
14
|
-
var _LocalizationProvider = require("@mui/x-date-pickers/LocalizationProvider");
|
|
15
14
|
var _formik = require("formik");
|
|
16
15
|
var _moment = _interopRequireDefault(require("moment"));
|
|
17
16
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
17
|
var React = _interopRequireWildcard(require("react"));
|
|
19
18
|
var _apperance = require("../../config/apperance");
|
|
19
|
+
var _StyledMuiTextField = _interopRequireDefault(require("../common/StyledMuiTextField"));
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
21
|
const _excluded = ["id", "className", "sx", "label", "name", "required", "value", "minDate", "maxDate", "inputFormat", "format", "disablePast", "disableFuture", "error", "readOnly", "fullWidth", "disabled", "helperText", "onChange", "onBlur"],
|
|
22
22
|
_excluded2 = ["id", "className", "sx", "label", "name", "required", "value", "minDate", "maxDate", "inputFormat", "format", "disablePast", "disableFuture", "error", "readOnly", "fullWidth", "disabled", "helperText", "onChange", "onBlur"],
|
|
23
|
-
_excluded3 = ["formik", "id", "className", "sx", "label", "name", "required", "value", "minDate", "maxDate", "inputFormat", "format", "disablePast", "disableFuture", "error", "readOnly", "fullWidth", "disabled", "helperText", "onChange", "onBlur"];
|
|
23
|
+
_excluded3 = ["formik", "id", "className", "sx", "label", "name", "required", "value", "minDate", "maxDate", "inputFormat", "format", "disablePast", "disableFuture", "error", "readOnly", "fullWidth", "disabled", "helperText", "onChange", "onBlur"];
|
|
24
24
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
25
25
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
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; }
|
|
26
28
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27
29
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28
30
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
29
31
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
30
32
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// Check if theme has our custom palette properties
|
|
35
|
-
if (theme && theme.palette && theme.palette.gray && theme.palette.gray.darker) {
|
|
36
|
-
// Theme has our custom structure, now normalize it
|
|
37
|
-
return {
|
|
38
|
-
primary: theme.palette.primary.main || theme.palette.primary,
|
|
39
|
-
secondary: theme.palette.secondary.main || theme.palette.secondary,
|
|
40
|
-
error: theme.palette.error ? theme.palette.error.main || theme.palette.error : _apperance.palette.error,
|
|
41
|
-
warning: theme.palette.warning ? theme.palette.warning.main || theme.palette.warning : _apperance.palette.warning,
|
|
42
|
-
success: theme.palette.success ? theme.palette.success.main || theme.palette.success : _apperance.palette.success,
|
|
43
|
-
info: theme.palette.info ? theme.palette.info.main || theme.palette.info : _apperance.palette.info,
|
|
44
|
-
white: theme.palette.white || _apperance.palette.white,
|
|
45
|
-
dark: theme.palette.dark || _apperance.palette.dark,
|
|
46
|
-
gray: theme.palette.gray,
|
|
47
|
-
blue: theme.palette.blue || _apperance.palette.blue,
|
|
48
|
-
background: theme.palette.background || _apperance.palette.background,
|
|
49
|
-
border: theme.palette.border || _apperance.palette.border,
|
|
50
|
-
shadow: theme.palette.shadow || _apperance.palette.shadow
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
// Check if theme object itself has gray (root level)
|
|
54
|
-
if (theme && theme.gray && theme.gray.darker) {
|
|
55
|
-
return {
|
|
56
|
-
primary: theme.primary,
|
|
57
|
-
secondary: theme.secondary,
|
|
58
|
-
error: theme.error || _apperance.palette.error,
|
|
59
|
-
warning: theme.warning || _apperance.palette.warning,
|
|
60
|
-
success: theme.success || _apperance.palette.success,
|
|
61
|
-
info: theme.info || _apperance.palette.info,
|
|
62
|
-
white: theme.white || _apperance.palette.white,
|
|
63
|
-
dark: theme.dark || _apperance.palette.dark,
|
|
64
|
-
gray: theme.gray,
|
|
65
|
-
blue: theme.blue || _apperance.palette.blue,
|
|
66
|
-
background: theme.background || _apperance.palette.background,
|
|
67
|
-
border: theme.border || _apperance.palette.border,
|
|
68
|
-
shadow: theme.shadow || _apperance.palette.shadow
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
return _apperance.palette;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
// Helper function to get DateField styles from theme
|
|
75
|
-
const getDateFieldStyles = theme => {
|
|
76
|
-
if (theme && theme.components && theme.components.PuiDateField) {
|
|
77
|
-
return theme.components.PuiDateField;
|
|
78
|
-
}
|
|
79
|
-
return {
|
|
80
|
-
inputRoot: {
|
|
81
|
-
backgroundColor: _apperance.palette.white,
|
|
82
|
-
border: "2px solid ".concat(_apperance.palette.gray.dark),
|
|
83
|
-
borderRadius: "5px",
|
|
84
|
-
height: "auto",
|
|
85
|
-
lineHeight: "1"
|
|
86
|
-
},
|
|
87
|
-
label: {
|
|
88
|
-
color: _apperance.palette.gray.darker,
|
|
89
|
-
marginBottom: "4px",
|
|
90
|
-
fontSize: "0.8rem"
|
|
91
|
-
},
|
|
92
|
-
disabled: {
|
|
93
|
-
backgroundColor: "#f5f5f5",
|
|
94
|
-
border: "1px solid #cecdd3",
|
|
95
|
-
labelColor: "#97969b"
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
const getTextFieldStyles = (theme, required) => {
|
|
100
|
-
var _themePalette$backgro, _palette$background, _dateFieldStyles$disa, _themePalette$backgro2, _palette$background2, _dateFieldStyles$disa2, _dateFieldStyles$disa3;
|
|
101
|
-
const themePalette = getPalette(theme);
|
|
102
|
-
const dateFieldStyles = getDateFieldStyles(theme);
|
|
33
|
+
const StyledDateMuiTextField = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_StyledMuiTextField.default, _objectSpread({
|
|
34
|
+
ref: ref
|
|
35
|
+
}, props))))(() => {
|
|
103
36
|
return {
|
|
104
37
|
"&.MuiFormControl-root": {
|
|
105
|
-
|
|
106
|
-
backgroundColor: required ? ((_themePalette$backgro = themePalette.background) === null || _themePalette$backgro === void 0 ? void 0 : _themePalette$backgro.required) || ((_palette$background = _apperance.palette.background) === null || _palette$background === void 0 ? void 0 : _palette$background.required) : dateFieldStyles.inputRoot.backgroundColor
|
|
107
|
-
},
|
|
38
|
+
display: "block",
|
|
108
39
|
"& .MuiFormLabel-root": {
|
|
109
|
-
|
|
110
|
-
lineSpacing: "-0.03em",
|
|
111
|
-
position: "initial",
|
|
112
|
-
transform: "none",
|
|
113
|
-
fontSize: "".concat(dateFieldStyles.label.fontSize, " !important"),
|
|
114
|
-
fontWeight: "600",
|
|
115
|
-
marginBottom: "".concat(dateFieldStyles.label.marginBottom, " !important"),
|
|
116
|
-
color: "".concat(dateFieldStyles.label.color, " !important"),
|
|
117
|
-
"&.Mui-focused ": {
|
|
118
|
-
color: "".concat(themePalette.primary, " !important")
|
|
119
|
-
},
|
|
120
|
-
"&.Mui-disabled": {
|
|
121
|
-
color: "".concat(((_dateFieldStyles$disa = dateFieldStyles.disabled) === null || _dateFieldStyles$disa === void 0 ? void 0 : _dateFieldStyles$disa.labelColor) || "#97969b", " !important")
|
|
122
|
-
},
|
|
123
|
-
"&.Mui-error": {
|
|
124
|
-
color: "".concat(themePalette.error, " !important")
|
|
125
|
-
}
|
|
40
|
+
marginBottom: "0.65px"
|
|
126
41
|
},
|
|
127
|
-
"& .
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
borderRadius: "".concat(dateFieldStyles.inputRoot.borderRadius, " !important"),
|
|
131
|
-
height: "".concat(dateFieldStyles.inputRoot.height, " !important"),
|
|
132
|
-
"&.MuiInputBase-multiline": {
|
|
133
|
-
padding: "8px 0",
|
|
134
|
-
height: "auto !important"
|
|
135
|
-
},
|
|
136
|
-
"&.Mui-focused ": {
|
|
137
|
-
border: "2px solid ".concat(themePalette.primary, " !important")
|
|
138
|
-
},
|
|
139
|
-
"&.Mui-error ": {
|
|
140
|
-
border: "2px solid ".concat(themePalette.error, " !important"),
|
|
141
|
-
backgroundColor: "".concat(((_themePalette$backgro2 = themePalette.background) === null || _themePalette$backgro2 === void 0 ? void 0 : _themePalette$backgro2.error) || ((_palette$background2 = _apperance.palette.background) === null || _palette$background2 === void 0 ? void 0 : _palette$background2.error), " !important")
|
|
42
|
+
"& .MuiInputAdornment-root .MuiButtonBase-root": {
|
|
43
|
+
"&:hover": {
|
|
44
|
+
backgroundColor: "transparent"
|
|
142
45
|
},
|
|
143
|
-
"
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
color: "".concat(themePalette.gray.darker),
|
|
149
|
-
WebkitTextFillColor: "".concat(themePalette.gray.darker)
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
"& .MuiInputBase-input": {
|
|
153
|
-
lineHeight: "".concat(dateFieldStyles.inputRoot.lineHeight, " !important"),
|
|
154
|
-
padding: "1px 6px",
|
|
155
|
-
fontSize: "0.7rem"
|
|
46
|
+
padding: "0 6px",
|
|
47
|
+
marginRight: "-8px",
|
|
48
|
+
"& .MuiSvgIcon-root": {
|
|
49
|
+
width: "16px",
|
|
50
|
+
height: "16px"
|
|
156
51
|
}
|
|
157
|
-
},
|
|
158
|
-
"& .MuiFormHelperText-root": {
|
|
159
|
-
fontWeight: "bold",
|
|
160
|
-
fontSize: ".7rem",
|
|
161
|
-
color: "red"
|
|
162
|
-
},
|
|
163
|
-
"& fieldset": {
|
|
164
|
-
display: "none"
|
|
165
52
|
}
|
|
166
53
|
}
|
|
167
54
|
};
|
|
168
|
-
};
|
|
55
|
+
});
|
|
169
56
|
const PuiStandardDateField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
170
57
|
let {
|
|
171
58
|
id,
|
|
@@ -198,52 +85,41 @@ const PuiStandardDateField = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
198
85
|
onChange(null);
|
|
199
86
|
}
|
|
200
87
|
};
|
|
201
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
name,
|
|
219
|
-
sx: theme => getTextFieldStyles(theme, required),
|
|
220
|
-
fullWidth,
|
|
221
|
-
required,
|
|
222
|
-
error,
|
|
223
|
-
helperText,
|
|
224
|
-
className: required ? "required" : ""
|
|
225
|
-
},
|
|
226
|
-
popper: {
|
|
227
|
-
sx: theme => {
|
|
228
|
-
const themePalette = getPalette(theme);
|
|
229
|
-
return {
|
|
230
|
-
"& .MuiPaper-root": {
|
|
231
|
-
boxShadow: "none !important",
|
|
232
|
-
border: "1px solid #e0e0e0",
|
|
233
|
-
backgroundColor: "white"
|
|
234
|
-
},
|
|
235
|
-
"& .MuiPickersDay-root.Mui-selected": {
|
|
236
|
-
backgroundColor: "".concat(themePalette.primary, " !important")
|
|
237
|
-
},
|
|
238
|
-
"& .Mui-selected": {
|
|
239
|
-
backgroundColor: "".concat(themePalette.primary, " !important")
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
}
|
|
88
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DesktopDatePicker.DesktopDatePicker, _objectSpread({
|
|
89
|
+
ref: ref,
|
|
90
|
+
sx: sx,
|
|
91
|
+
label: label,
|
|
92
|
+
inputFormat: inputFormat,
|
|
93
|
+
value: value,
|
|
94
|
+
onChange: handleChange,
|
|
95
|
+
disablePast: disablePast,
|
|
96
|
+
disableFuture: disableFuture,
|
|
97
|
+
disabled: disabled,
|
|
98
|
+
maxDate: maxDate,
|
|
99
|
+
minDate: minDate,
|
|
100
|
+
readOnly: readOnly,
|
|
101
|
+
PopperProps: {
|
|
102
|
+
sx: {
|
|
103
|
+
"& .MuiButtonBase-root.Mui-selected, & .MuiButtonBase-root.Mui-selected:focus, & .MuiButtonBase-root.Mui-selected:hover": {
|
|
104
|
+
backgroundColor: _apperance.palette.primary
|
|
243
105
|
}
|
|
244
106
|
}
|
|
245
|
-
},
|
|
246
|
-
|
|
107
|
+
},
|
|
108
|
+
renderInput: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledDateMuiTextField, _objectSpread(_objectSpread({
|
|
109
|
+
id: id,
|
|
110
|
+
className: className,
|
|
111
|
+
name: name,
|
|
112
|
+
required: required,
|
|
113
|
+
fullWidth: fullWidth,
|
|
114
|
+
onBlur: onBlur,
|
|
115
|
+
helperText: helperText
|
|
116
|
+
}, params), {}, {
|
|
117
|
+
error: params.error || error,
|
|
118
|
+
inputProps: _objectSpread({
|
|
119
|
+
name
|
|
120
|
+
}, params.inputProps)
|
|
121
|
+
}))
|
|
122
|
+
}, rest));
|
|
247
123
|
});
|
|
248
124
|
const PuiFormikDateField = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
249
125
|
let {
|
|
@@ -9,13 +9,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.default = void 0;
|
|
10
10
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
|
-
var
|
|
12
|
+
var _styles = require("@mui/material/styles");
|
|
13
|
+
var _DateTimePicker = require("@mui/x-date-pickers/DateTimePicker");
|
|
13
14
|
var _formik = require("formik");
|
|
14
15
|
var _moment = _interopRequireDefault(require("moment"));
|
|
15
16
|
var _AdapterDayjs = require("@mui/x-date-pickers/AdapterDayjs");
|
|
16
|
-
var
|
|
17
|
-
var _LocalizationProvider = require("@mui/x-date-pickers/LocalizationProvider");
|
|
17
|
+
var _xDatePickers = require("@mui/x-date-pickers");
|
|
18
18
|
var _apperance = require("../../config/apperance");
|
|
19
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
21
|
const _excluded = ["id", "className", "sx", "label", "name", "required", "value", "minDate", "maxDate", "inputFormat", "format", "disablePast", "disableFuture", "error", "readOnly", "fullWidth", "disabled", "helperText", "onChange", "onBlur"],
|
|
21
22
|
_excluded2 = ["id", "className", "sx", "label", "name", "required", "value", "minDate", "maxDate", "inputFormat", "format", "disablePast", "disableFuture", "error", "readOnly", "fullWidth", "disabled", "helperText", "onChange", "onBlur"],
|
|
@@ -196,7 +197,7 @@ const PuiStandardDateTimeField = /*#__PURE__*/_react.default.forwardRef((_ref, r
|
|
|
196
197
|
onChange(null);
|
|
197
198
|
}
|
|
198
199
|
};
|
|
199
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
200
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDatePickers.LocalizationProvider, {
|
|
200
201
|
dateAdapter: _AdapterDayjs.AdapterDayjs,
|
|
201
202
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DateTimePicker.DateTimePicker, _objectSpread({
|
|
202
203
|
ref: ref,
|
|
@@ -21,7 +21,6 @@ var _PuiCheckbox = _interopRequireDefault(require("../inputs/PuiCheckbox"));
|
|
|
21
21
|
var _PuiIcon = _interopRequireDefault(require("../others/PuiIcon"));
|
|
22
22
|
var _PuiTooltip = _interopRequireDefault(require("../others/PuiTooltip"));
|
|
23
23
|
var _PuiTableAction = _interopRequireDefault(require("./PuiTableAction"));
|
|
24
|
-
var _ActionPopover = _interopRequireDefault(require("./ActionPopover"));
|
|
25
24
|
var _system = require("@mui/system");
|
|
26
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
26
|
const _excluded = ["id", "className", "sx", "elevate", "rows", "rowCount", "columns", "paginationMode", "page", "pageSize", "checkboxSelection", "loading", "stripped", "actions", "oneActionOnly", "onSelect", "onPageChange", "onPageSizeChange", "rowDetailPanel"];
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
require("core-js/modules/es.weak-map.js");
|
|
4
4
|
require("core-js/modules/esnext.iterator.filter.js");
|
|
5
5
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
6
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
6
7
|
Object.defineProperty(exports, "__esModule", {
|
|
7
8
|
value: true
|
|
8
9
|
});
|
|
9
10
|
exports.default = void 0;
|
|
10
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,16 +20,14 @@ 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 _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
25
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
28
26
|
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; }
|
|
29
27
|
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; }
|
|
30
28
|
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; }
|
|
31
29
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
32
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
30
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
33
31
|
const PuiStandardSearchPageContainer = _ref => {
|
|
34
32
|
let {
|
|
35
33
|
actions,
|
|
@@ -65,13 +63,8 @@ const PuiSearchPage = _ref2 => {
|
|
|
65
63
|
onReset,
|
|
66
64
|
onSubmit,
|
|
67
65
|
children: _children,
|
|
68
|
-
additionalActions
|
|
69
|
-
collapsibleSearchSection = true // Collapsible by default
|
|
66
|
+
additionalActions
|
|
70
67
|
} = _ref2;
|
|
71
|
-
const [isSearchSectionExpanded, setSearchSectionExpanded] = (0, _react.useState)(false);
|
|
72
|
-
const toggleSearchSection = () => {
|
|
73
|
-
setSearchSectionExpanded(prev => !prev);
|
|
74
|
-
};
|
|
75
68
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PuiDefaultPage.default, {
|
|
76
69
|
title: title,
|
|
77
70
|
titleIcon: titleIcon,
|
|
@@ -83,24 +76,11 @@ const PuiSearchPage = _ref2 => {
|
|
|
83
76
|
retour: retour,
|
|
84
77
|
onRetour: onRetour,
|
|
85
78
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiSection.default, {
|
|
86
|
-
title:
|
|
87
|
-
onClick: toggleSearchSection,
|
|
88
|
-
style: {
|
|
89
|
-
display: "flex",
|
|
90
|
-
alignItems: "center",
|
|
91
|
-
cursor: collapsibleSearchSection ? "pointer" : "default"
|
|
92
|
-
},
|
|
93
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
94
|
-
style: {
|
|
95
|
-
marginRight: collapsibleSearchSection ? "8px" : "0px"
|
|
96
|
-
},
|
|
97
|
-
children: "Param\xE8tres de recherche"
|
|
98
|
-
}), collapsibleSearchSection && (isSearchSectionExpanded ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandLess.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandMore.default, {}))]
|
|
99
|
-
}),
|
|
79
|
+
title: "Param\xE8tres de recherche",
|
|
100
80
|
sx: {
|
|
101
81
|
marginBottom: 2
|
|
102
82
|
},
|
|
103
|
-
children:
|
|
83
|
+
children: formik ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_formik.Formik, _objectSpread(_objectSpread({
|
|
104
84
|
initialValues: {}
|
|
105
85
|
}, formikProps), {}, {
|
|
106
86
|
children: _ref3 => {
|
|
@@ -135,14 +115,16 @@ const PuiSearchPage = _ref2 => {
|
|
|
135
115
|
loadingPosition: "start",
|
|
136
116
|
children: "Rechercher"
|
|
137
117
|
})
|
|
138
|
-
}), additionalActions && additionalActions.map((actionItem, index) =>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
118
|
+
}), additionalActions && additionalActions.map((actionItem, index) => {
|
|
119
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
120
|
+
item: true,
|
|
121
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
122
|
+
startIcon: actionItem.icon,
|
|
123
|
+
onClick: actionItem.action,
|
|
124
|
+
children: actionItem.name
|
|
125
|
+
})
|
|
126
|
+
}, index);
|
|
127
|
+
})]
|
|
146
128
|
}),
|
|
147
129
|
children: _children
|
|
148
130
|
})
|
|
@@ -174,22 +156,22 @@ const PuiSearchPage = _ref2 => {
|
|
|
174
156
|
loadingPosition: "start",
|
|
175
157
|
children: "Rechercher"
|
|
176
158
|
})
|
|
177
|
-
}), additionalActions && additionalActions.map((actionItem, index) =>
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
159
|
+
}), additionalActions && additionalActions.map((actionItem, index) => {
|
|
160
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiGrid.default, {
|
|
161
|
+
item: true,
|
|
162
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiButton.default, {
|
|
163
|
+
startIcon: actionItem.icon,
|
|
164
|
+
onClick: actionItem.action,
|
|
165
|
+
children: actionItem.name
|
|
166
|
+
})
|
|
167
|
+
}, index);
|
|
168
|
+
})]
|
|
185
169
|
}),
|
|
186
170
|
children: _children
|
|
187
|
-
})
|
|
188
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTable.default, _objectSpread(
|
|
171
|
+
})
|
|
172
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiTable.default, _objectSpread({
|
|
189
173
|
paginationMode: "server"
|
|
190
|
-
}, tableProps)
|
|
191
|
-
pinnedColumns: tableProps.pinnedColumns // Added pinnedColumns
|
|
192
|
-
}))]
|
|
174
|
+
}, tableProps))]
|
|
193
175
|
});
|
|
194
176
|
};
|
|
195
177
|
PuiSearchPage.propTypes = {
|
|
@@ -202,9 +184,7 @@ PuiSearchPage.propTypes = {
|
|
|
202
184
|
topNav: _propTypes.default.bool,
|
|
203
185
|
bottomNav: _propTypes.default.bool,
|
|
204
186
|
loading: _propTypes.default.bool,
|
|
205
|
-
tableProps: _propTypes.default.
|
|
206
|
-
pinnedColumns: _propTypes.default.object // Added pinnedColumns prop type
|
|
207
|
-
}),
|
|
187
|
+
tableProps: _propTypes.default.object,
|
|
208
188
|
retour: _propTypes.default.bool,
|
|
209
189
|
onRetour: _propTypes.default.func,
|
|
210
190
|
onReset: _propTypes.default.func,
|
|
@@ -213,13 +193,11 @@ PuiSearchPage.propTypes = {
|
|
|
213
193
|
name: _propTypes.default.string.isRequired,
|
|
214
194
|
action: _propTypes.default.func.isRequired,
|
|
215
195
|
icon: _propTypes.default.element
|
|
216
|
-
}))
|
|
217
|
-
collapsibleSearchSection: _propTypes.default.bool
|
|
196
|
+
}))
|
|
218
197
|
};
|
|
219
198
|
PuiSearchPage.defaultProps = {
|
|
220
199
|
formik: true,
|
|
221
200
|
loading: false,
|
|
222
|
-
additionalActions: []
|
|
223
|
-
collapsibleSearchSection: true
|
|
201
|
+
additionalActions: []
|
|
224
202
|
};
|
|
225
203
|
var _default = exports.default = PuiSearchPage;
|
package/package.json
CHANGED
|
@@ -1,105 +1,99 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@portnet/ui",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Portnet UI",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"react",
|
|
7
|
-
"components",
|
|
8
|
-
"ui"
|
|
9
|
-
],
|
|
10
|
-
"main": "dist/index.js",
|
|
11
|
-
"private": false,
|
|
12
|
-
"files": [
|
|
13
|
-
"dist",
|
|
14
|
-
"README.md"
|
|
15
|
-
],
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"@emotion/react": "^11.10.5",
|
|
18
|
-
"@emotion/styled": "^11.10.5",
|
|
19
|
-
"@mui/icons-material": "^5.10.16",
|
|
20
|
-
"@mui/lab": "^5.0.0-alpha.60",
|
|
21
|
-
"@mui/material": "^5.10.16",
|
|
22
|
-
"@mui/x-data-grid": "^5.17.26",
|
|
23
|
-
"@mui/x-data-grid-pro": "^5.17.26",
|
|
24
|
-
"@mui/x-date-pickers": "^
|
|
25
|
-
"@testing-library/jest-dom": "^5.16.5",
|
|
26
|
-
"@testing-library/react": "^13.4.0",
|
|
27
|
-
"@testing-library/user-event": "^13.5.0",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"react": "^
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"@
|
|
86
|
-
"@
|
|
87
|
-
"@
|
|
88
|
-
"@
|
|
89
|
-
"@storybook/
|
|
90
|
-
"@storybook/
|
|
91
|
-
"@storybook/
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"prop-types": "^15.8.1",
|
|
101
|
-
"rimraf": "^5.0.5",
|
|
102
|
-
"storybook": "^7.6.4",
|
|
103
|
-
"webpack": "^5.75.0"
|
|
104
|
-
}
|
|
105
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@portnet/ui",
|
|
3
|
+
"version": "5.0.1",
|
|
4
|
+
"description": "Portnet UI",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"components",
|
|
8
|
+
"ui"
|
|
9
|
+
],
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"private": false,
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@emotion/react": "^11.10.5",
|
|
18
|
+
"@emotion/styled": "^11.10.5",
|
|
19
|
+
"@mui/icons-material": "^5.10.16",
|
|
20
|
+
"@mui/lab": "^5.0.0-alpha.60",
|
|
21
|
+
"@mui/material": "^5.10.16",
|
|
22
|
+
"@mui/x-data-grid": "^5.17.26",
|
|
23
|
+
"@mui/x-data-grid-pro": "^5.17.26",
|
|
24
|
+
"@mui/x-date-pickers": "^5.0.4",
|
|
25
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
26
|
+
"@testing-library/react": "^13.4.0",
|
|
27
|
+
"@testing-library/user-event": "^13.5.0",
|
|
28
|
+
"axios": "^1.2.2",
|
|
29
|
+
"dayjs": "^1.11.19",
|
|
30
|
+
"formik": "^2.2.9",
|
|
31
|
+
"lodash": "^4.17.21",
|
|
32
|
+
"moment": "^2.29.4",
|
|
33
|
+
"react": "^18.2.0",
|
|
34
|
+
"react-dom": "^18.2.0",
|
|
35
|
+
"react-scripts": "^5.0.1",
|
|
36
|
+
"react-transition-group": "^4.4.5",
|
|
37
|
+
"styled-components": "^6.1.3",
|
|
38
|
+
"uuid": "^9.0.0",
|
|
39
|
+
"web-vitals": "^2.1.4",
|
|
40
|
+
"yup": "^0.32.11"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"start": "react-scripts start",
|
|
44
|
+
"build": "rimraf dist && cross-env NODE_ENV=production babel src/lib --out-dir dist --copy-files",
|
|
45
|
+
"test": "react-scripts test",
|
|
46
|
+
"eject": "react-scripts eject",
|
|
47
|
+
"storybook": "storybook dev -p 6006 -s public",
|
|
48
|
+
"build-storybook": "storybook build -s public"
|
|
49
|
+
},
|
|
50
|
+
"eslintConfig": {
|
|
51
|
+
"extends": [
|
|
52
|
+
"react-app",
|
|
53
|
+
"react-app/jest"
|
|
54
|
+
],
|
|
55
|
+
"overrides": [
|
|
56
|
+
{
|
|
57
|
+
"files": [
|
|
58
|
+
"**/*.stories.*"
|
|
59
|
+
],
|
|
60
|
+
"rules": {
|
|
61
|
+
"import/no-anonymous-default-export": "off"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"browserslist": {
|
|
67
|
+
"production": [
|
|
68
|
+
">0.2%",
|
|
69
|
+
"not dead",
|
|
70
|
+
"not op_mini all"
|
|
71
|
+
],
|
|
72
|
+
"development": [
|
|
73
|
+
"last 1 chrome version",
|
|
74
|
+
"last 1 firefox version",
|
|
75
|
+
"last 1 safari version"
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
"devDependencies": {
|
|
79
|
+
"@babel/cli": "^7.19.3",
|
|
80
|
+
"@babel/core": "^7.20.5",
|
|
81
|
+
"@babel/preset-env": "^7.20.2",
|
|
82
|
+
"@babel/preset-react": "^7.18.6",
|
|
83
|
+
"@storybook/addon-actions": "^7.6.4",
|
|
84
|
+
"@storybook/addon-essentials": "^7.6.4",
|
|
85
|
+
"@storybook/addon-interactions": "^7.6.4",
|
|
86
|
+
"@storybook/addon-links": "^7.6.4",
|
|
87
|
+
"@storybook/node-logger": "^7.6.4",
|
|
88
|
+
"@storybook/preset-create-react-app": "^7.6.4",
|
|
89
|
+
"@storybook/react": "^7.6.4",
|
|
90
|
+
"@storybook/react-webpack5": "^7.6.4",
|
|
91
|
+
"@storybook/testing-library": "^0.2.2",
|
|
92
|
+
"cross-env": "^7.0.3",
|
|
93
|
+
"husky": "^4.3.8",
|
|
94
|
+
"prop-types": "^15.8.1",
|
|
95
|
+
"rimraf": "^5.0.5",
|
|
96
|
+
"storybook": "^7.6.4",
|
|
97
|
+
"webpack": "^5.75.0"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -1,210 +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/web.dom-collections.iterator.js");
|
|
8
|
-
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
9
|
-
require("dayjs/locale/fr");
|
|
10
|
-
var _utc = _interopRequireDefault(require("dayjs/plugin/utc"));
|
|
11
|
-
var _formik = require("formik");
|
|
12
|
-
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
var _xDatePickers = require("@mui/x-date-pickers");
|
|
14
|
-
var _AdapterDayjs = require("@mui/x-date-pickers/AdapterDayjs");
|
|
15
|
-
var _DateTimePicker = require("@mui/x-date-pickers/DateTimePicker");
|
|
16
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
|
-
_dayjs.default.extend(_utc.default);
|
|
19
|
-
_dayjs.default.locale("fr");
|
|
20
|
-
const frenchLocaleText = {
|
|
21
|
-
cancelButtonLabel: "Annuler",
|
|
22
|
-
okButtonLabel: "Appliquer",
|
|
23
|
-
toolbarTitle: "Sélectionner la date et l'heure",
|
|
24
|
-
todayButtonLabel: "Aujourd’hui",
|
|
25
|
-
clockLabelText: "Sélectionnez l’heure",
|
|
26
|
-
calendarWeekNumberHeaderLabel: "Semaine",
|
|
27
|
-
calendarWeekNumberLabel: "Semaine {weekNumber}"
|
|
28
|
-
};
|
|
29
|
-
const palette = {
|
|
30
|
-
inherit: "inherit",
|
|
31
|
-
primary: "#232f66",
|
|
32
|
-
secondary: "#e7e7e7",
|
|
33
|
-
error: "#d32f2f",
|
|
34
|
-
warning: "#FD9727",
|
|
35
|
-
success: "#48AC24",
|
|
36
|
-
info: "#2278CF",
|
|
37
|
-
white: "#FFF",
|
|
38
|
-
dark: "#000",
|
|
39
|
-
gray: {
|
|
40
|
-
darker: "#505050",
|
|
41
|
-
dark: "#b6b6b6",
|
|
42
|
-
light: "#F1F1F1"
|
|
43
|
-
},
|
|
44
|
-
background: {
|
|
45
|
-
required: "#FFFBE3",
|
|
46
|
-
error: "#FFE5E5"
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const textFieldStyles = {
|
|
50
|
-
"&.MuiFormControl-root": {
|
|
51
|
-
"&.required .MuiInputBase-root": {
|
|
52
|
-
backgroundColor: required => required ? palette.background.required : "white"
|
|
53
|
-
},
|
|
54
|
-
"& .MuiFormLabel-root": {
|
|
55
|
-
zIndex: 0,
|
|
56
|
-
lineSpacing: "-0.03em",
|
|
57
|
-
position: "initial",
|
|
58
|
-
transform: "none",
|
|
59
|
-
fontSize: "0.8rem",
|
|
60
|
-
fontWeight: "600",
|
|
61
|
-
marginBottom: "4px",
|
|
62
|
-
color: palette.gray.darker,
|
|
63
|
-
"&.Mui-focused ": {
|
|
64
|
-
color: palette.primary
|
|
65
|
-
},
|
|
66
|
-
"&.Mui-disabled": {
|
|
67
|
-
color: palette.gray.darker
|
|
68
|
-
},
|
|
69
|
-
"&.Mui-error": {
|
|
70
|
-
color: palette.error
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
"& .MuiInputBase-root": {
|
|
74
|
-
backgroundColor: required => required ? palette.background.required : "white",
|
|
75
|
-
border: "2px solid ".concat(palette.gray.dark),
|
|
76
|
-
borderRadius: "5px",
|
|
77
|
-
"&.MuiInputBase-multiline": {
|
|
78
|
-
padding: "8px 0"
|
|
79
|
-
},
|
|
80
|
-
"&.Mui-focused ": {
|
|
81
|
-
border: "2px solid ".concat(palette.primary)
|
|
82
|
-
},
|
|
83
|
-
"&.Mui-error ": {
|
|
84
|
-
border: "2px solid ".concat(palette.error),
|
|
85
|
-
backgroundColor: palette.background.error
|
|
86
|
-
},
|
|
87
|
-
"&.Mui-disabled ": {
|
|
88
|
-
"& input": {
|
|
89
|
-
color: "".concat(palette.gray.darker),
|
|
90
|
-
WebkitTextFillColor: "".concat(palette.gray.darker)
|
|
91
|
-
},
|
|
92
|
-
backgroundColor: "".concat(palette.secondary)
|
|
93
|
-
},
|
|
94
|
-
"& .MuiInputBase-input": {
|
|
95
|
-
lineHeight: "1",
|
|
96
|
-
padding: "1px 6px",
|
|
97
|
-
fontSize: "0.7rem"
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
"& .MuiFormHelperText-root": {
|
|
101
|
-
fontWeight: "bold",
|
|
102
|
-
fontSize: ".7rem",
|
|
103
|
-
color: "red"
|
|
104
|
-
},
|
|
105
|
-
"& fieldset": {
|
|
106
|
-
display: "none"
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
const DateTimePickerField = _ref => {
|
|
111
|
-
let {
|
|
112
|
-
label,
|
|
113
|
-
name,
|
|
114
|
-
value: propValue,
|
|
115
|
-
onChange,
|
|
116
|
-
required = true,
|
|
117
|
-
error = false,
|
|
118
|
-
helperText = null,
|
|
119
|
-
fullWidth = true
|
|
120
|
-
} = _ref;
|
|
121
|
-
const [field, meta, helpers] = (0, _formik.useField)(name || "default");
|
|
122
|
-
if (!name) {
|
|
123
|
-
console.error("DateTimePickerField requires a `name` prop to work with Formik.");
|
|
124
|
-
}
|
|
125
|
-
const {
|
|
126
|
-
setValue,
|
|
127
|
-
setTouched
|
|
128
|
-
} = helpers;
|
|
129
|
-
const handleChange = newValue => {
|
|
130
|
-
setValue(_dayjs.default.utc(newValue).format("YYYY-MM-DDTHH:mm:ss.SSS[Z]"));
|
|
131
|
-
if (onChange) {
|
|
132
|
-
onChange(_dayjs.default.utc(newValue).format("YYYY-MM-DDTHH:mm:ss.SSS[Z]"));
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
const handleBlur = () => {
|
|
136
|
-
setTouched(true);
|
|
137
|
-
};
|
|
138
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDatePickers.LocalizationProvider, {
|
|
139
|
-
dateAdapter: _AdapterDayjs.AdapterDayjs,
|
|
140
|
-
localeText: frenchLocaleText,
|
|
141
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DateTimePicker.DateTimePicker, {
|
|
142
|
-
label: label,
|
|
143
|
-
ampm: false,
|
|
144
|
-
value: field.value ? _dayjs.default.utc(field.value) : !!propValue ? _dayjs.default.utc(propValue) : null,
|
|
145
|
-
closeOnSelect: false,
|
|
146
|
-
onChange: handleChange,
|
|
147
|
-
onBlur: handleBlur,
|
|
148
|
-
views: ["year", "month", "day", "hours", "minutes"],
|
|
149
|
-
timeSteps: {
|
|
150
|
-
hours: 1,
|
|
151
|
-
minutes: 1,
|
|
152
|
-
seconds: 5
|
|
153
|
-
},
|
|
154
|
-
slotProps: {
|
|
155
|
-
textField: {
|
|
156
|
-
name: name,
|
|
157
|
-
sx: textFieldStyles,
|
|
158
|
-
fullWidth: fullWidth,
|
|
159
|
-
required: required,
|
|
160
|
-
error: Boolean(meta.touched && meta.error || error),
|
|
161
|
-
helperText: meta.touched && meta.error ? meta.error : !!helperText ? helperText : ""
|
|
162
|
-
},
|
|
163
|
-
actionBar: {
|
|
164
|
-
actions: ["cancel", "accept"],
|
|
165
|
-
sx: {
|
|
166
|
-
display: "flex",
|
|
167
|
-
justifyContent: "flex-end",
|
|
168
|
-
gap: 1,
|
|
169
|
-
padding: "8px",
|
|
170
|
-
"& .MuiButton-root": {
|
|
171
|
-
borderRadius: "4px",
|
|
172
|
-
padding: "6px 16px",
|
|
173
|
-
textTransform: "none",
|
|
174
|
-
fontSize: "0.875rem",
|
|
175
|
-
fontWeight: "bold"
|
|
176
|
-
},
|
|
177
|
-
"& .MuiButton-root:nth-of-type(1)": {
|
|
178
|
-
backgroundColor: "white",
|
|
179
|
-
color: "".concat(palette.primary, " !important"),
|
|
180
|
-
border: "1px solid ".concat(palette.primary, " !important"),
|
|
181
|
-
paddingY: 0
|
|
182
|
-
},
|
|
183
|
-
"& .MuiButton-root:nth-of-type(2)": {
|
|
184
|
-
backgroundColor: "".concat(palette.primary, " !important"),
|
|
185
|
-
color: "white !important",
|
|
186
|
-
border: "1px solid ".concat(palette.primary, " !important"),
|
|
187
|
-
paddingY: 0
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
popper: {
|
|
192
|
-
sx: {
|
|
193
|
-
"& .MuiPaper-root": {
|
|
194
|
-
boxShadow: "none !important",
|
|
195
|
-
border: "1px solid #e0e0e0",
|
|
196
|
-
backgroundColor: "white"
|
|
197
|
-
},
|
|
198
|
-
"& .MuiPickersDay-root.Mui-selected": {
|
|
199
|
-
backgroundColor: "".concat(palette.primary, " !important")
|
|
200
|
-
},
|
|
201
|
-
"& .Mui-selected": {
|
|
202
|
-
backgroundColor: "".concat(palette.primary, " !important")
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
})
|
|
208
|
-
});
|
|
209
|
-
};
|
|
210
|
-
var _default = exports.default = DateTimePickerField;
|
|
@@ -1,56 +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.constructor.js");
|
|
8
|
-
require("core-js/modules/esnext.iterator.map.js");
|
|
9
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
10
|
-
var _Popover = _interopRequireDefault(require("@mui/material/Popover"));
|
|
11
|
-
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
12
|
-
var _MoreVert = _interopRequireDefault(require("@mui/icons-material/MoreVert"));
|
|
13
|
-
var _system = require("@mui/system");
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
-
const ActionPopover = _ref => {
|
|
18
|
-
let {
|
|
19
|
-
row,
|
|
20
|
-
actions
|
|
21
|
-
} = _ref;
|
|
22
|
-
const [anchorEl, setAnchorEl] = _react.default.useState(null);
|
|
23
|
-
const handleClick = event => {
|
|
24
|
-
setAnchorEl(event.currentTarget);
|
|
25
|
-
};
|
|
26
|
-
const handleClose = () => {
|
|
27
|
-
setAnchorEl(null);
|
|
28
|
-
};
|
|
29
|
-
const open = Boolean(anchorEl);
|
|
30
|
-
const id = open ? 'simple-popover' : undefined;
|
|
31
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
32
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
33
|
-
"aria-describedby": id,
|
|
34
|
-
onClick: handleClick,
|
|
35
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MoreVert.default, {})
|
|
36
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Popover.default, {
|
|
37
|
-
id: id,
|
|
38
|
-
open: open,
|
|
39
|
-
anchorEl: anchorEl,
|
|
40
|
-
onClose: handleClose,
|
|
41
|
-
anchorOrigin: {
|
|
42
|
-
vertical: 'bottom',
|
|
43
|
-
horizontal: 'left'
|
|
44
|
-
},
|
|
45
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_system.Box, {
|
|
46
|
-
p: 2,
|
|
47
|
-
children: actions.map((action, index) => /*#__PURE__*/_react.default.cloneElement(action, {
|
|
48
|
-
row,
|
|
49
|
-
key: index,
|
|
50
|
-
onClick: handleClose // Assuming you want to close the popover when an action is clicked
|
|
51
|
-
}))
|
|
52
|
-
})
|
|
53
|
-
})]
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
var _default = exports.default = ActionPopover;
|