@portnet/ui 3.1.6 → 4.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/buttons/PuiButton.js +96 -103
- package/dist/components/common/StyledMuiButton.js +3 -5
- package/dist/components/common/StyledMuiTextField.js +103 -59
- package/dist/components/inputs/PuiDateField.js +176 -52
- package/dist/components/inputs/PuiDateTimeField.js +204 -195
- package/dist/components/inputs/PuiSelect.js +124 -82
- package/dist/components/others/DateTimePickerField.js +210 -0
- package/dist/components/others/PuiSection.js +88 -31
- package/dist/components/referentiel/components/PuiSpecificReferentielField.js +6 -24
- package/dist/components/table/PuiTable.js +124 -50
- package/dist/components/table/PuiTableAction.js +12 -2
- package/dist/components/typography/PuiMainTitle.js +124 -35
- package/dist/components/ui/pages/general/PuiSearchPage.js +56 -34
- package/dist/config/apperance.js +13 -95
- package/dist/index.js +0 -42
- package/package.json +20 -25
- package/dist/components/providers/PuiAntdProvider.js +0 -70
- package/dist/components/providers/PuiThemeProvider.js +0 -230
- package/dist/components/stepper/PuiStepContent.js +0 -66
- package/dist/components/stepper/PuiStepper.js +0 -184
- package/dist/components/stepper/PuiStepperActions.js +0 -105
- package/dist/components/table/PuiModernTable.js +0 -541
- package/dist/components-antd-optional/PuiAntdForm.js +0 -328
- package/dist/components-antd-optional/PuiAntdStepper.js +0 -317
- package/dist/components-antd-optional/PuiAntdTable.js +0 -352
- package/dist/config/antdTheme.js +0 -227
- package/dist/hooks/useCustomAxios.js +0 -36
|
@@ -33,86 +33,143 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
33
33
|
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; }
|
|
34
34
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
35
35
|
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); }
|
|
36
|
+
const getPalette = theme => {
|
|
37
|
+
// Check if theme has our custom palette properties
|
|
38
|
+
if (theme && theme.palette && theme.palette.gray && theme.palette.gray.darker) {
|
|
39
|
+
// Theme has our custom structure, now normalize it
|
|
40
|
+
return {
|
|
41
|
+
primary: theme.palette.primary.main || theme.palette.primary,
|
|
42
|
+
secondary: theme.palette.secondary.main || theme.palette.secondary,
|
|
43
|
+
error: theme.palette.error ? theme.palette.error.main || theme.palette.error : _apperance.palette.error,
|
|
44
|
+
warning: theme.palette.warning ? theme.palette.warning.main || theme.palette.warning : _apperance.palette.warning,
|
|
45
|
+
success: theme.palette.success ? theme.palette.success.main || theme.palette.success : _apperance.palette.success,
|
|
46
|
+
info: theme.palette.info ? theme.palette.info.main || theme.palette.info : _apperance.palette.info,
|
|
47
|
+
white: theme.palette.white || _apperance.palette.white,
|
|
48
|
+
dark: theme.palette.dark || _apperance.palette.dark,
|
|
49
|
+
gray: theme.palette.gray,
|
|
50
|
+
blue: theme.palette.blue || _apperance.palette.blue,
|
|
51
|
+
background: theme.palette.background || _apperance.palette.background,
|
|
52
|
+
border: theme.palette.border || _apperance.palette.border,
|
|
53
|
+
shadow: theme.palette.shadow || _apperance.palette.shadow
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
// Check if theme object itself has gray (root level)
|
|
57
|
+
if (theme && theme.gray && theme.gray.darker) {
|
|
58
|
+
return {
|
|
59
|
+
primary: theme.primary,
|
|
60
|
+
secondary: theme.secondary,
|
|
61
|
+
error: theme.error || _apperance.palette.error,
|
|
62
|
+
warning: theme.warning || _apperance.palette.warning,
|
|
63
|
+
success: theme.success || _apperance.palette.success,
|
|
64
|
+
info: theme.info || _apperance.palette.info,
|
|
65
|
+
white: theme.white || _apperance.palette.white,
|
|
66
|
+
dark: theme.dark || _apperance.palette.dark,
|
|
67
|
+
gray: theme.gray,
|
|
68
|
+
blue: theme.blue || _apperance.palette.blue,
|
|
69
|
+
background: theme.background || _apperance.palette.background,
|
|
70
|
+
border: theme.border || _apperance.palette.border,
|
|
71
|
+
shadow: theme.shadow || _apperance.palette.shadow
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return _apperance.palette;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// Helper function to get Select styles from theme
|
|
78
|
+
const getSelectStyles = theme => {
|
|
79
|
+
if (theme && theme.components && theme.components.PuiSelect) {
|
|
80
|
+
return theme.components.PuiSelect;
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
inputRoot: {
|
|
84
|
+
backgroundColor: "#fafafa",
|
|
85
|
+
border: "1px solid #cecdd3",
|
|
86
|
+
borderRadius: "5px",
|
|
87
|
+
height: "33px",
|
|
88
|
+
lineHeight: "2em"
|
|
89
|
+
},
|
|
90
|
+
label: {
|
|
91
|
+
color: "#97969b",
|
|
92
|
+
marginBottom: "13px",
|
|
93
|
+
fontSize: "0.9rem"
|
|
94
|
+
},
|
|
95
|
+
disabled: {
|
|
96
|
+
backgroundColor: "#f5f5f5",
|
|
97
|
+
border: "1px solid #cecdd3",
|
|
98
|
+
labelColor: "#97969b"
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
};
|
|
36
102
|
const StyledMuiFormControl = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControl, _objectSpread(_objectSpread({}, props), {}, {
|
|
37
103
|
ref: ref
|
|
38
|
-
}))))(
|
|
104
|
+
}))))(props => {
|
|
105
|
+
var _themePalette$backgro, _selectStyles$disable, _themePalette$backgro2, _selectStyles$disable2, _selectStyles$disable3;
|
|
106
|
+
const themePalette = getPalette(props.theme);
|
|
107
|
+
const selectStyles = getSelectStyles(props.theme);
|
|
39
108
|
return {
|
|
40
109
|
"&.MuiFormControl-root": {
|
|
41
110
|
"& .MuiSelect-select": {
|
|
42
111
|
minHeight: "auto",
|
|
43
|
-
height: "
|
|
112
|
+
height: selectStyles.inputRoot.height || "1.4375em",
|
|
113
|
+
lineHeight: selectStyles.inputRoot.lineHeight || "1",
|
|
44
114
|
display: "flex",
|
|
45
|
-
alignItems: "center"
|
|
46
|
-
lineHeight: "1.5"
|
|
115
|
+
alignItems: "center"
|
|
47
116
|
},
|
|
48
117
|
"&.required .MuiInputBase-root": {
|
|
49
|
-
backgroundColor: _apperance.palette.background.required
|
|
118
|
+
backgroundColor: ((_themePalette$backgro = themePalette.background) === null || _themePalette$backgro === void 0 ? void 0 : _themePalette$backgro.required) || _apperance.palette.background.required
|
|
50
119
|
},
|
|
51
120
|
"& .MuiFormLabel-root": {
|
|
52
121
|
zIndex: 0,
|
|
53
122
|
lineSpacing: "-0.03em",
|
|
54
123
|
position: "initial",
|
|
55
124
|
transform: "none",
|
|
56
|
-
fontSize: "
|
|
125
|
+
fontSize: "".concat(selectStyles.label.fontSize, " !important"),
|
|
57
126
|
fontWeight: "600",
|
|
58
|
-
marginBottom: "
|
|
59
|
-
color:
|
|
60
|
-
"&.Mui-focused": {
|
|
61
|
-
|
|
127
|
+
marginBottom: "".concat(selectStyles.label.marginBottom, " !important"),
|
|
128
|
+
color: "".concat(selectStyles.label.color, " !important"),
|
|
129
|
+
"&.Mui-focused ": {
|
|
130
|
+
lineHeight: "1.4375em",
|
|
131
|
+
color: "".concat(themePalette.primary, " !important")
|
|
62
132
|
},
|
|
63
133
|
"&.Mui-disabled": {
|
|
64
|
-
color:
|
|
134
|
+
color: "".concat(((_selectStyles$disable = selectStyles.disabled) === null || _selectStyles$disable === void 0 ? void 0 : _selectStyles$disable.labelColor) || "#97969b", " !important")
|
|
65
135
|
},
|
|
66
136
|
"&.Mui-error": {
|
|
67
|
-
color:
|
|
137
|
+
color: "".concat(themePalette.error, " !important")
|
|
68
138
|
}
|
|
69
139
|
},
|
|
70
140
|
"& .MuiInputBase-root": {
|
|
71
|
-
backgroundColor:
|
|
72
|
-
border: "
|
|
73
|
-
borderRadius: "
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"&:hover": {
|
|
78
|
-
borderColor: _apperance.palette.gray[400],
|
|
79
|
-
boxShadow: "0 0 0 2px ".concat(_apperance.palette.primary, "10")
|
|
141
|
+
backgroundColor: "".concat(selectStyles.inputRoot.backgroundColor, " !important"),
|
|
142
|
+
border: "".concat(selectStyles.inputRoot.border, " !important"),
|
|
143
|
+
borderRadius: "".concat(selectStyles.inputRoot.borderRadius, " !important"),
|
|
144
|
+
height: selectStyles.inputRoot.height || "auto",
|
|
145
|
+
"&.Mui-focused ": {
|
|
146
|
+
border: "2px solid ".concat(themePalette.primary, " !important")
|
|
80
147
|
},
|
|
81
|
-
"&.Mui-
|
|
82
|
-
border: "2px solid ".concat(
|
|
83
|
-
|
|
84
|
-
outline: "none"
|
|
148
|
+
"&.Mui-error ": {
|
|
149
|
+
border: "2px solid ".concat(themePalette.error, " !important"),
|
|
150
|
+
backgroundColor: "".concat(((_themePalette$backgro2 = themePalette.background) === null || _themePalette$backgro2 === void 0 ? void 0 : _themePalette$backgro2.error) || _apperance.palette.background.error, " !important")
|
|
85
151
|
},
|
|
86
|
-
"&.Mui-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
cursor: "not-allowed"
|
|
152
|
+
"&.Mui-disabled ": {
|
|
153
|
+
backgroundColor: "".concat(((_selectStyles$disable2 = selectStyles.disabled) === null || _selectStyles$disable2 === void 0 ? void 0 : _selectStyles$disable2.backgroundColor) || "#f5f5f5", " !important"),
|
|
154
|
+
border: "".concat(((_selectStyles$disable3 = selectStyles.disabled) === null || _selectStyles$disable3 === void 0 ? void 0 : _selectStyles$disable3.border) || "1px solid #cecdd3", " !important"),
|
|
155
|
+
borderRadius: "".concat(selectStyles.inputRoot.borderRadius, " !important"),
|
|
156
|
+
"& .MuiSelect-select": {
|
|
157
|
+
color: "".concat(themePalette.gray.darker),
|
|
158
|
+
WebkitTextFillColor: "".concat(themePalette.gray.darker)
|
|
159
|
+
}
|
|
95
160
|
},
|
|
96
161
|
"& .MuiInputBase-input": {
|
|
97
|
-
padding: "
|
|
98
|
-
fontSize: "
|
|
99
|
-
fontWeight: 400
|
|
162
|
+
padding: "1px 6px",
|
|
163
|
+
fontSize: "0.7rem"
|
|
100
164
|
},
|
|
101
165
|
"& .MuiSvgIcon-root": {
|
|
102
|
-
marginRight: "
|
|
103
|
-
color: _apperance.palette.gray[500],
|
|
104
|
-
fontSize: "1.2rem",
|
|
105
|
-
transition: "transform 0.2s ease"
|
|
106
|
-
},
|
|
107
|
-
"&.Mui-focused .MuiSvgIcon-root": {
|
|
108
|
-
transform: "rotate(180deg)"
|
|
166
|
+
marginRight: "2px"
|
|
109
167
|
}
|
|
110
168
|
},
|
|
111
169
|
"& .MuiFormHelperText-root": {
|
|
112
|
-
fontWeight: "
|
|
113
|
-
fontSize: "
|
|
114
|
-
|
|
115
|
-
color: _apperance.palette.gray[600]
|
|
170
|
+
fontWeight: "bold",
|
|
171
|
+
fontSize: ".7rem",
|
|
172
|
+
color: themePalette.gray.darker
|
|
116
173
|
},
|
|
117
174
|
"& fieldset": {
|
|
118
175
|
display: "none"
|
|
@@ -123,10 +180,13 @@ const StyledMuiFormControl = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((
|
|
|
123
180
|
const LoadingProgress = () => {
|
|
124
181
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.CircularProgress, {
|
|
125
182
|
size: 16,
|
|
126
|
-
sx: {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
183
|
+
sx: theme => {
|
|
184
|
+
const themePalette = getPalette(theme);
|
|
185
|
+
return {
|
|
186
|
+
color: themePalette.primary,
|
|
187
|
+
position: "absolute",
|
|
188
|
+
right: "14px"
|
|
189
|
+
};
|
|
130
190
|
}
|
|
131
191
|
});
|
|
132
192
|
};
|
|
@@ -186,39 +246,21 @@ const PuiStandardSelect = _ref => {
|
|
|
186
246
|
name
|
|
187
247
|
},
|
|
188
248
|
MenuProps: {
|
|
189
|
-
sx: {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
},
|
|
197
|
-
"& .MuiMenu-list": {
|
|
198
|
-
padding: "6px",
|
|
199
|
-
"& .MuiMenuItem-root": {
|
|
200
|
-
fontSize: "14px",
|
|
201
|
-
fontWeight: 400,
|
|
202
|
-
padding: "10px 14px",
|
|
203
|
-
margin: "2px 0",
|
|
204
|
-
borderRadius: "6px",
|
|
205
|
-
height: "fit-content",
|
|
206
|
-
minHeight: "auto",
|
|
207
|
-
transition: "all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)",
|
|
208
|
-
"&:hover": {
|
|
209
|
-
backgroundColor: "".concat(_apperance.palette.primary, "08"),
|
|
210
|
-
color: _apperance.palette.primary
|
|
249
|
+
sx: theme => {
|
|
250
|
+
const themePalette = getPalette(theme);
|
|
251
|
+
return {
|
|
252
|
+
"& .MuiMenu-list": {
|
|
253
|
+
padding: 0,
|
|
254
|
+
"& .MuiMenuItem-root:not(:last-child)": {
|
|
255
|
+
borderBottom: "1px solid ".concat(themePalette.gray.light)
|
|
211
256
|
},
|
|
212
|
-
"
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
"&:hover": {
|
|
217
|
-
backgroundColor: "".concat(_apperance.palette.primary, "20")
|
|
218
|
-
}
|
|
257
|
+
"& .MuiMenuItem-root": {
|
|
258
|
+
fontSize: 13,
|
|
259
|
+
height: "fit-content",
|
|
260
|
+
minHeight: "auto"
|
|
219
261
|
}
|
|
220
262
|
}
|
|
221
|
-
}
|
|
263
|
+
};
|
|
222
264
|
}
|
|
223
265
|
}
|
|
224
266
|
}, rest), {}, {
|
|
@@ -0,0 +1,210 @@
|
|
|
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;
|
|
@@ -21,15 +21,75 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
21
21
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22
22
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
23
23
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
24
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
24
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // Helper function to get palette from theme or fallback to appearance
|
|
25
|
+
const getPalette = theme => {
|
|
26
|
+
// Check if theme has our custom palette properties
|
|
27
|
+
if (theme && theme.palette && theme.palette.gray && theme.palette.gray.darker) {
|
|
28
|
+
// Theme has our custom structure, now normalize it
|
|
29
|
+
return {
|
|
30
|
+
primary: theme.palette.primary.main || theme.palette.primary,
|
|
31
|
+
secondary: theme.palette.secondary.main || theme.palette.secondary,
|
|
32
|
+
error: theme.palette.error ? theme.palette.error.main || theme.palette.error : _apperance.palette.error,
|
|
33
|
+
warning: theme.palette.warning ? theme.palette.warning.main || theme.palette.warning : _apperance.palette.warning,
|
|
34
|
+
success: theme.palette.success ? theme.palette.success.main || theme.palette.success : _apperance.palette.success,
|
|
35
|
+
info: theme.palette.info ? theme.palette.info.main || theme.palette.info : _apperance.palette.info,
|
|
36
|
+
white: theme.palette.white || _apperance.palette.white,
|
|
37
|
+
dark: theme.palette.dark || _apperance.palette.dark,
|
|
38
|
+
gray: theme.palette.gray,
|
|
39
|
+
blue: theme.palette.blue || _apperance.palette.blue,
|
|
40
|
+
background: theme.palette.background || _apperance.palette.background,
|
|
41
|
+
border: theme.palette.border || _apperance.palette.border,
|
|
42
|
+
shadow: theme.palette.shadow || _apperance.palette.shadow
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
// Check if theme object itself has gray (root level)
|
|
46
|
+
if (theme && theme.gray && theme.gray.darker) {
|
|
47
|
+
return {
|
|
48
|
+
primary: theme.primary,
|
|
49
|
+
secondary: theme.secondary,
|
|
50
|
+
error: theme.error || _apperance.palette.error,
|
|
51
|
+
warning: theme.warning || _apperance.palette.warning,
|
|
52
|
+
success: theme.success || _apperance.palette.success,
|
|
53
|
+
info: theme.info || _apperance.palette.info,
|
|
54
|
+
white: theme.white || _apperance.palette.white,
|
|
55
|
+
dark: theme.dark || _apperance.palette.dark,
|
|
56
|
+
gray: theme.gray,
|
|
57
|
+
blue: theme.blue || _apperance.palette.blue,
|
|
58
|
+
background: theme.background || _apperance.palette.background,
|
|
59
|
+
border: theme.border || _apperance.palette.border,
|
|
60
|
+
shadow: theme.shadow || _apperance.palette.shadow
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
return _apperance.palette;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// Helper function to get PuiSection styles from theme
|
|
67
|
+
const getPuiSectionStyles = theme => {
|
|
68
|
+
if (theme && theme.components && theme.components.PuiSection) {
|
|
69
|
+
return theme.components.PuiSection;
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
backgroundColor: _apperance.palette.gray.light,
|
|
73
|
+
border: "2px solid ".concat(_apperance.palette.gray.dark),
|
|
74
|
+
borderRadius: "5px",
|
|
75
|
+
boxShadow: "0px 2px 1px -1px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%), 0px 1px 3px 0px rgb(0 0 0 / 12%)",
|
|
76
|
+
titleColor: _apperance.palette.primary,
|
|
77
|
+
titleFontFamily: "'Poppins', sans-serif",
|
|
78
|
+
titleFontWeight: "400",
|
|
79
|
+
titleFontSize: "1.1rem",
|
|
80
|
+
titlePosition: "16px"
|
|
81
|
+
};
|
|
82
|
+
};
|
|
25
83
|
const StyledMuiPaper = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Paper, _objectSpread({
|
|
26
84
|
ref: ref
|
|
27
|
-
}, props))))(
|
|
85
|
+
}, props))))(props => {
|
|
86
|
+
const sectionStyles = getPuiSectionStyles(props.theme);
|
|
28
87
|
return {
|
|
29
88
|
"&.MuiPaper-root": {
|
|
30
|
-
backgroundColor:
|
|
31
|
-
border: "
|
|
32
|
-
borderRadius: "
|
|
89
|
+
backgroundColor: "".concat(sectionStyles.backgroundColor, " !important"),
|
|
90
|
+
border: "".concat(sectionStyles.border, " !important"),
|
|
91
|
+
borderRadius: "".concat(sectionStyles.borderRadius, " !important"),
|
|
92
|
+
boxShadow: "".concat(sectionStyles.boxShadow, " !important"),
|
|
33
93
|
position: "relative"
|
|
34
94
|
}
|
|
35
95
|
};
|
|
@@ -47,39 +107,36 @@ const PuiSection = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
47
107
|
id: id,
|
|
48
108
|
className: className,
|
|
49
109
|
sx: _objectSpread({
|
|
50
|
-
|
|
110
|
+
paddingX: 3,
|
|
111
|
+
paddingY: 2,
|
|
112
|
+
paddingTop: title ? 6 : 2
|
|
51
113
|
}, sx),
|
|
52
114
|
ref: ref,
|
|
53
115
|
elevation: 1,
|
|
54
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
55
|
-
sx: {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
left: "30px",
|
|
59
|
-
transform: "translate(0,-50%)"
|
|
60
|
-
},
|
|
61
|
-
children: [Boolean(title) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
62
|
-
sx: {
|
|
63
|
-
transform: "translateY(-50%)",
|
|
64
|
-
top: "50%",
|
|
65
|
-
zIndex: "-1",
|
|
116
|
+
children: [Boolean(title) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
117
|
+
sx: theme => {
|
|
118
|
+
const sectionStyles = getPuiSectionStyles(theme);
|
|
119
|
+
return {
|
|
66
120
|
position: "absolute",
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
121
|
+
top: sectionStyles.titlePosition || "16px",
|
|
122
|
+
left: "24px"
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
72
126
|
variant: titleVariant,
|
|
73
|
-
sx: {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
127
|
+
sx: theme => {
|
|
128
|
+
const sectionStyles = getPuiSectionStyles(theme);
|
|
129
|
+
return {
|
|
130
|
+
textAlign: "left",
|
|
131
|
+
fontWeight: sectionStyles.titleFontWeight || "400",
|
|
132
|
+
fontFamily: sectionStyles.titleFontFamily || "'Poppins', sans-serif",
|
|
133
|
+
color: sectionStyles.titleColor || "#202224",
|
|
134
|
+
fontSize: sectionStyles.titleFontSize || "1.1rem",
|
|
135
|
+
lineHeight: "1.5"
|
|
136
|
+
};
|
|
80
137
|
},
|
|
81
138
|
children: title
|
|
82
|
-
})
|
|
139
|
+
})
|
|
83
140
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
84
141
|
children: children
|
|
85
142
|
})]
|