@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
|
@@ -17,7 +17,6 @@ var _formik = require("formik");
|
|
|
17
17
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
18
18
|
var React = _interopRequireWildcard(require("react"));
|
|
19
19
|
var _useAxios = _interopRequireDefault(require("../../../hooks/useAxios"));
|
|
20
|
-
var _useCustomAxios = _interopRequireDefault(require("../../../hooks/useCustomAxios"));
|
|
21
20
|
var _PuiButton = _interopRequireDefault(require("../../buttons/PuiButton"));
|
|
22
21
|
var _PuiFormikForm = _interopRequireDefault(require("../../others/PuiFormikForm"));
|
|
23
22
|
var _PuiGrid = _interopRequireDefault(require("../../others/PuiGrid"));
|
|
@@ -107,9 +106,7 @@ const PuiSpecificReferentielField = _ref2 => {
|
|
|
107
106
|
getReturnedValue,
|
|
108
107
|
getRenderedValue,
|
|
109
108
|
onChange,
|
|
110
|
-
onError
|
|
111
|
-
searchApi,
|
|
112
|
-
customUrl
|
|
109
|
+
onError
|
|
113
110
|
} = _ref2;
|
|
114
111
|
const {
|
|
115
112
|
token,
|
|
@@ -117,7 +114,6 @@ const PuiSpecificReferentielField = _ref2 => {
|
|
|
117
114
|
baseURL
|
|
118
115
|
} = React.useContext(_ReferetielContext.default);
|
|
119
116
|
const axios = (0, _useAxios.default)(token, secret, baseURL);
|
|
120
|
-
const customAxios = (0, _useCustomAxios.default)(token, secret, customUrl);
|
|
121
117
|
const [dataFetchingState, dataFetchingDispatch] = React.useReducer(dataFetchingReducer, dataFetchingInitalState);
|
|
122
118
|
const [filtreredFilters, setFiltreredFilters] = React.useState([..._specificReferentielsBaseFilters.default[searchKey]]);
|
|
123
119
|
const formRef = React.useRef();
|
|
@@ -133,24 +129,12 @@ const PuiSpecificReferentielField = _ref2 => {
|
|
|
133
129
|
dataFetchingDispatch({
|
|
134
130
|
type: "GET_DATA"
|
|
135
131
|
});
|
|
136
|
-
let response;
|
|
137
|
-
if (customUrl) {
|
|
138
|
-
// Si customUrl est fourni, utiliser useCustomAxios
|
|
139
|
-
response = await customAxios.post("/getPage", _objectSpread(_objectSpread({}, specifications), {}, {
|
|
140
|
-
pageNumber: dataFetchingState.pageNumber,
|
|
141
|
-
pageSize: dataFetchingState.pageSize
|
|
142
|
-
}, values));
|
|
143
|
-
} else {
|
|
144
|
-
// Sinon, utiliser useAxios avec l'URL relative
|
|
145
|
-
const apiEndpoint = searchApi || _specificReferentielsApis.default[searchKey];
|
|
146
|
-
response = await axios.post("/api/".concat(apiEndpoint, "/getPage"), _objectSpread(_objectSpread({}, specifications), {}, {
|
|
147
|
-
pageNumber: dataFetchingState.pageNumber,
|
|
148
|
-
pageSize: dataFetchingState.pageSize
|
|
149
|
-
}, values));
|
|
150
|
-
}
|
|
151
132
|
const {
|
|
152
133
|
data
|
|
153
|
-
} =
|
|
134
|
+
} = await axios.post("/api/".concat(_specificReferentielsApis.default[searchKey], "/getPage"), _objectSpread(_objectSpread({}, specifications), {}, {
|
|
135
|
+
pageNumber: dataFetchingState.pageNumber,
|
|
136
|
+
pageSize: dataFetchingState.pageSize
|
|
137
|
+
}, values));
|
|
154
138
|
if (data.succes) {
|
|
155
139
|
dataFetchingDispatch({
|
|
156
140
|
type: "SUCCESSED",
|
|
@@ -325,9 +309,7 @@ PuiSpecificReferentielField.propTypes = {
|
|
|
325
309
|
getRenderedValue: _propTypes.default.func.isRequired,
|
|
326
310
|
getReturnedValue: _propTypes.default.func,
|
|
327
311
|
onChange: _propTypes.default.func,
|
|
328
|
-
onError: _propTypes.default.func
|
|
329
|
-
searchApi: _propTypes.default.string,
|
|
330
|
-
customUrl: _propTypes.default.string // URL de base personnalisée (ex: "https://api.example.com/preneur")
|
|
312
|
+
onError: _propTypes.default.func
|
|
331
313
|
};
|
|
332
314
|
PuiSpecificReferentielField.defaultProps = {
|
|
333
315
|
disabled: false,
|
|
@@ -33,13 +33,79 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
33
33
|
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; }
|
|
34
34
|
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; }
|
|
35
35
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
36
|
-
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
|
+
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
|
|
37
|
+
const getPalette = theme => {
|
|
38
|
+
// Check if theme has our custom palette properties
|
|
39
|
+
if (theme && theme.palette && theme.palette.gray && theme.palette.gray.darker) {
|
|
40
|
+
// Theme has our custom structure, now normalize it
|
|
41
|
+
return {
|
|
42
|
+
primary: theme.palette.primary.main || theme.palette.primary,
|
|
43
|
+
secondary: theme.palette.secondary.main || theme.palette.secondary,
|
|
44
|
+
error: theme.palette.error ? theme.palette.error.main || theme.palette.error : _apperance.palette.error,
|
|
45
|
+
warning: theme.palette.warning ? theme.palette.warning.main || theme.palette.warning : _apperance.palette.warning,
|
|
46
|
+
success: theme.palette.success ? theme.palette.success.main || theme.palette.success : _apperance.palette.success,
|
|
47
|
+
info: theme.palette.info ? theme.palette.info.main || theme.palette.info : _apperance.palette.info,
|
|
48
|
+
white: theme.palette.white || _apperance.palette.white,
|
|
49
|
+
dark: theme.palette.dark || _apperance.palette.dark,
|
|
50
|
+
gray: theme.palette.gray,
|
|
51
|
+
blue: theme.palette.blue || _apperance.palette.blue,
|
|
52
|
+
background: theme.palette.background || _apperance.palette.background,
|
|
53
|
+
border: theme.palette.border || _apperance.palette.border,
|
|
54
|
+
shadow: theme.palette.shadow || _apperance.palette.shadow
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
// Check if theme object itself has gray (root level)
|
|
58
|
+
if (theme && theme.gray && theme.gray.darker) {
|
|
59
|
+
return {
|
|
60
|
+
primary: theme.primary,
|
|
61
|
+
secondary: theme.secondary,
|
|
62
|
+
error: theme.error || _apperance.palette.error,
|
|
63
|
+
warning: theme.warning || _apperance.palette.warning,
|
|
64
|
+
success: theme.success || _apperance.palette.success,
|
|
65
|
+
info: theme.info || _apperance.palette.info,
|
|
66
|
+
white: theme.white || _apperance.palette.white,
|
|
67
|
+
dark: theme.dark || _apperance.palette.dark,
|
|
68
|
+
gray: theme.gray,
|
|
69
|
+
blue: theme.blue || _apperance.palette.blue,
|
|
70
|
+
background: theme.background || _apperance.palette.background,
|
|
71
|
+
border: theme.border || _apperance.palette.border,
|
|
72
|
+
shadow: theme.shadow || _apperance.palette.shadow
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
return _apperance.palette;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// Helper function to get PuiTable styles from theme
|
|
79
|
+
const getPuiTableStyles = theme => {
|
|
80
|
+
if (theme && theme.components && theme.components.PuiTable) {
|
|
81
|
+
return theme.components.PuiTable;
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
border: "2px solid ".concat(_apperance.palette.gray.dark),
|
|
85
|
+
marginTop: "0px",
|
|
86
|
+
rowHeight: {
|
|
87
|
+
maxHeight: "none",
|
|
88
|
+
minHeight: "auto",
|
|
89
|
+
lineHeight: "1.2em"
|
|
90
|
+
},
|
|
91
|
+
cellJustifyContent: "flex-start",
|
|
92
|
+
headerJustifyContent: "flex-start",
|
|
93
|
+
headerColor: _apperance.palette.primary,
|
|
94
|
+
headerFontSize: "1em",
|
|
95
|
+
virtualScrollerHeight: "auto"
|
|
96
|
+
};
|
|
97
|
+
};
|
|
37
98
|
const StyledMuiTable = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_xDataGrid.DataGrid, _objectSpread({
|
|
38
99
|
ref: ref
|
|
39
|
-
}, props))))(
|
|
100
|
+
}, props))))(props => {
|
|
101
|
+
var _themePalette$shadow, _palette$shadow;
|
|
102
|
+
const themePalette = getPalette(props.theme);
|
|
103
|
+
const tableStyles = getPuiTableStyles(props.theme);
|
|
40
104
|
return {
|
|
41
105
|
"&.MuiDataGrid-root": {
|
|
42
106
|
fontSize: ".8em",
|
|
107
|
+
border: "".concat(tableStyles.border, " !important"),
|
|
108
|
+
marginTop: "".concat(tableStyles.marginTop, " !important"),
|
|
43
109
|
"& .tableActionColumn": {
|
|
44
110
|
"& .MuiDataGrid-columnHeaderTitle": {
|
|
45
111
|
justifyContent: "center",
|
|
@@ -50,14 +116,13 @@ const StyledMuiTable = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props,
|
|
|
50
116
|
}
|
|
51
117
|
},
|
|
52
118
|
"&.elevate": {
|
|
53
|
-
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%)"
|
|
119
|
+
boxShadow: ((_themePalette$shadow = themePalette.shadow) === null || _themePalette$shadow === void 0 ? void 0 : _themePalette$shadow.medium) || ((_palette$shadow = _apperance.palette.shadow) === null || _palette$shadow === void 0 ? void 0 : _palette$shadow.medium) || "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%)"
|
|
54
120
|
},
|
|
55
|
-
backgroundColor:
|
|
56
|
-
border: "2px solid ".concat(_apperance.palette.gray.dark),
|
|
121
|
+
backgroundColor: themePalette.gray.light,
|
|
57
122
|
"& .MuiPaginationItem-root": {
|
|
58
123
|
"&.Mui-selected": {
|
|
59
|
-
color:
|
|
60
|
-
backgroundColor:
|
|
124
|
+
color: themePalette.white,
|
|
125
|
+
backgroundColor: themePalette.primary
|
|
61
126
|
}
|
|
62
127
|
},
|
|
63
128
|
"&.table-loading .MuiDataGrid-virtualScroller, &.table-loading .MuiDataGrid-footerContainer": {
|
|
@@ -66,7 +131,7 @@ const StyledMuiTable = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props,
|
|
|
66
131
|
content: "''",
|
|
67
132
|
width: "100%",
|
|
68
133
|
height: "100%",
|
|
69
|
-
backgroundColor:
|
|
134
|
+
backgroundColor: themePalette.white,
|
|
70
135
|
position: "absolute",
|
|
71
136
|
zIndex: 1,
|
|
72
137
|
display: "block",
|
|
@@ -75,26 +140,31 @@ const StyledMuiTable = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props,
|
|
|
75
140
|
},
|
|
76
141
|
"&.table-stripped .MuiDataGrid-row": {
|
|
77
142
|
"&:nth-of-type(even)": {
|
|
78
|
-
backgroundColor:
|
|
143
|
+
backgroundColor: themePalette.gray.light
|
|
79
144
|
}
|
|
80
145
|
},
|
|
81
146
|
"& .MuiLinearProgress-root": {
|
|
82
147
|
zIndex: 1,
|
|
83
|
-
backgroundColor:
|
|
148
|
+
backgroundColor: "#f4f9fa !important",
|
|
84
149
|
"& .MuiLinearProgress-bar": {
|
|
85
|
-
backgroundColor:
|
|
150
|
+
backgroundColor: themePalette.primary
|
|
86
151
|
}
|
|
87
152
|
},
|
|
88
153
|
"& .MuiDataGrid-columnHeaders": {
|
|
154
|
+
backgroundColor: "#F1F4F9 !important",
|
|
89
155
|
"& .MuiDataGrid-columnHeader": {
|
|
90
156
|
"& .MuiDataGrid-columnHeaderTitle": {
|
|
91
157
|
display: "flex",
|
|
92
158
|
alignItems: "center",
|
|
93
159
|
fontWeight: "600",
|
|
94
|
-
color:
|
|
160
|
+
color: "".concat(tableStyles.headerColor, " !important"),
|
|
161
|
+
fontSize: "".concat(tableStyles.headerFontSize, " !important"),
|
|
95
162
|
whiteSpace: "normal",
|
|
96
163
|
lineHeight: "1.2em"
|
|
97
164
|
},
|
|
165
|
+
"& .MuiDataGrid-columnHeaderTitleContainer": {
|
|
166
|
+
justifyContent: "".concat(tableStyles.headerJustifyContent, " !important")
|
|
167
|
+
},
|
|
98
168
|
"&:focus-within": {
|
|
99
169
|
outline: "none"
|
|
100
170
|
},
|
|
@@ -103,37 +173,45 @@ const StyledMuiTable = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props,
|
|
|
103
173
|
}
|
|
104
174
|
},
|
|
105
175
|
"& .MuiDataGrid-columnSeparator": {
|
|
106
|
-
|
|
176
|
+
display: "none !important"
|
|
107
177
|
}
|
|
108
178
|
},
|
|
109
179
|
"& .MuiDataGrid-cell": {
|
|
110
|
-
|
|
111
|
-
|
|
180
|
+
padding: "8px",
|
|
181
|
+
display: "flex",
|
|
182
|
+
alignItems: "center",
|
|
112
183
|
whiteSpace: "normal",
|
|
113
|
-
|
|
184
|
+
wordWrap: "break-word",
|
|
185
|
+
lineHeight: "1.4 !important",
|
|
114
186
|
overflow: "hidden",
|
|
115
|
-
|
|
116
|
-
minWidth: 'maxWidth',
|
|
117
|
-
wordBreak: "break-word",
|
|
187
|
+
justifyContent: "".concat(tableStyles.cellJustifyContent, " !important"),
|
|
118
188
|
"&.tableAction": {
|
|
119
|
-
justifyContent: "center",
|
|
189
|
+
justifyContent: "center !important",
|
|
120
190
|
position: "relative",
|
|
121
|
-
overflow: "initial !important"
|
|
191
|
+
overflow: "initial !important",
|
|
192
|
+
"& .MuiIconButton-root": {
|
|
193
|
+
opacity: 0,
|
|
194
|
+
transition: "opacity 0.2s ease-in-out"
|
|
195
|
+
}
|
|
122
196
|
},
|
|
123
197
|
"&:focus-within": {
|
|
124
198
|
outline: "none"
|
|
125
199
|
}
|
|
126
200
|
},
|
|
127
201
|
"& .MuiDataGrid-row": {
|
|
128
|
-
maxHeight: "none !important",
|
|
129
202
|
"&:nth-of-type(odd)": {
|
|
130
|
-
backgroundColor: "#ffffff"
|
|
203
|
+
backgroundColor: "#ffffff !important"
|
|
131
204
|
},
|
|
132
205
|
"&:nth-of-type(even)": {
|
|
133
|
-
backgroundColor: "#
|
|
206
|
+
backgroundColor: "#f4f9fa !important"
|
|
134
207
|
},
|
|
135
208
|
"&:hover": {
|
|
136
|
-
backgroundColor: "#
|
|
209
|
+
backgroundColor: "#e8f1f5 !important",
|
|
210
|
+
"& .tableAction": {
|
|
211
|
+
"& .MuiIconButton-root": {
|
|
212
|
+
opacity: 1
|
|
213
|
+
}
|
|
214
|
+
}
|
|
137
215
|
}
|
|
138
216
|
},
|
|
139
217
|
"& .MuiDataGrid-virtualScrollerContent": {
|
|
@@ -142,10 +220,10 @@ const StyledMuiTable = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props,
|
|
|
142
220
|
}
|
|
143
221
|
},
|
|
144
222
|
"& .MuiDataGrid-virtualScroller": {
|
|
145
|
-
backgroundColor:
|
|
223
|
+
backgroundColor: themePalette.white
|
|
146
224
|
},
|
|
147
225
|
"& .MuiDataGrid-footerContainer": {
|
|
148
|
-
backgroundColor:
|
|
226
|
+
backgroundColor: themePalette.white,
|
|
149
227
|
height: "28px",
|
|
150
228
|
minHeight: "28px"
|
|
151
229
|
}
|
|
@@ -209,19 +287,22 @@ const TableActions = _ref2 => {
|
|
|
209
287
|
}), Boolean(isOpen) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Paper, {
|
|
210
288
|
ref: actionsRef,
|
|
211
289
|
elevation: 1,
|
|
212
|
-
sx: {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
290
|
+
sx: theme => {
|
|
291
|
+
const themePalette = getPalette(theme);
|
|
292
|
+
return {
|
|
293
|
+
borderRadius: "5px",
|
|
294
|
+
position: "absolute",
|
|
295
|
+
right: "0",
|
|
296
|
+
top: "50%",
|
|
297
|
+
transform: "translate(0, -50%)",
|
|
298
|
+
display: "flex",
|
|
299
|
+
alignItems: "center",
|
|
300
|
+
gap: "8px",
|
|
301
|
+
paddingX: "11px",
|
|
302
|
+
height: "calc(100% - 4px)",
|
|
303
|
+
backgroundColor: themePalette.gray.light,
|
|
304
|
+
border: "2px solid ".concat(themePalette.gray.dark)
|
|
305
|
+
};
|
|
225
306
|
},
|
|
226
307
|
children: [actions.map((action, index) => /*#__PURE__*/React.cloneElement(action, {
|
|
227
308
|
row,
|
|
@@ -316,23 +397,18 @@ const PuiTable = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
316
397
|
sx: {
|
|
317
398
|
display: 'flex',
|
|
318
399
|
gap: '8px',
|
|
319
|
-
// Adjust the space between icons as needed
|
|
320
400
|
flexWrap: 'wrap',
|
|
321
|
-
// Keep icons on the same line; remove if you want them to wrap
|
|
322
401
|
justifyContent: 'center',
|
|
323
|
-
// Center the icons horizontally
|
|
324
402
|
alignItems: 'center',
|
|
325
|
-
|
|
326
|
-
minWidth: 0 // Prevent the flex container from stretching past its content width
|
|
403
|
+
minWidth: 0
|
|
327
404
|
},
|
|
328
405
|
children: actions.map((action, index) => /*#__PURE__*/React.cloneElement(action, {
|
|
329
406
|
row,
|
|
330
407
|
key: index,
|
|
331
408
|
sx: _objectSpread(_objectSpread({}, action.props.sx), {}, {
|
|
332
409
|
marginRight: 0,
|
|
333
|
-
// Remove any outer margins
|
|
334
410
|
'&:last-child': {
|
|
335
|
-
marginRight: 0
|
|
411
|
+
marginRight: 0
|
|
336
412
|
}
|
|
337
413
|
})
|
|
338
414
|
}))
|
|
@@ -364,7 +440,6 @@ const PuiTable = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
364
440
|
const {
|
|
365
441
|
data
|
|
366
442
|
} = params;
|
|
367
|
-
// Render the passed rowDetailPanel component with the row data
|
|
368
443
|
return /*#__PURE__*/React.cloneElement(rowDetailPanel, {
|
|
369
444
|
rowData: data
|
|
370
445
|
});
|
|
@@ -384,13 +459,12 @@ const PuiTable = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
384
459
|
className: "".concat(className, " ").concat(stripped ? "table-stripped" : "", " ").concat(loading ? "table-loading" : "", " ").concat(elevate ? "elevate" : ""),
|
|
385
460
|
sx: {
|
|
386
461
|
["& .".concat(_xDataGrid.gridClasses.cell)]: {
|
|
387
|
-
py:
|
|
462
|
+
py: 1
|
|
388
463
|
}
|
|
389
464
|
},
|
|
390
465
|
autoHeight: true,
|
|
391
466
|
headerHeight: 60,
|
|
392
467
|
footerHeight: 40,
|
|
393
|
-
rowHeight: 40,
|
|
394
468
|
rows: rows,
|
|
395
469
|
rowCount: rowCount,
|
|
396
470
|
columns: appColumns,
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
});
|
|
9
9
|
exports.default = void 0;
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
var _styles = require("@mui/material/styles");
|
|
11
12
|
var _PuiIconButton = _interopRequireDefault(require("../buttons/PuiIconButton"));
|
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -15,7 +16,14 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
15
16
|
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; }
|
|
16
17
|
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; }
|
|
17
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
18
|
-
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); }
|
|
19
|
+
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 PuiTableAction color from theme
|
|
20
|
+
const getPuiTableActionColor = theme => {
|
|
21
|
+
if (theme && theme.components && theme.components.PuiTableAction && theme.components.PuiTableAction.color) {
|
|
22
|
+
return theme.components.PuiTableAction.color;
|
|
23
|
+
}
|
|
24
|
+
// Fallback to default color
|
|
25
|
+
return "#1e498c";
|
|
26
|
+
};
|
|
19
27
|
const PuiTableAction = _ref => {
|
|
20
28
|
let {
|
|
21
29
|
id,
|
|
@@ -29,6 +37,8 @@ const PuiTableAction = _ref => {
|
|
|
29
37
|
onClick: _onClick,
|
|
30
38
|
children
|
|
31
39
|
} = _ref;
|
|
40
|
+
const theme = (0, _styles.useTheme)();
|
|
41
|
+
const actionColor = getPuiTableActionColor(theme);
|
|
32
42
|
return hide || hideFunc(row) ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_PuiIconButton.default, {
|
|
33
43
|
id: id,
|
|
34
44
|
className: className,
|
|
@@ -36,7 +46,7 @@ const PuiTableAction = _ref => {
|
|
|
36
46
|
"& .MuiSvgIcon-root": {
|
|
37
47
|
width: ".75em !important",
|
|
38
48
|
height: ".75em !important",
|
|
39
|
-
color:
|
|
49
|
+
color: actionColor
|
|
40
50
|
}
|
|
41
51
|
}),
|
|
42
52
|
title: title,
|
|
@@ -11,6 +11,7 @@ exports.default = void 0;
|
|
|
11
11
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
12
12
|
require("core-js/modules/esnext.iterator.map.js");
|
|
13
13
|
var _material = require("@mui/material");
|
|
14
|
+
var _styles = require("@mui/material/styles");
|
|
14
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
16
|
var React = _interopRequireWildcard(require("react"));
|
|
16
17
|
var _apperance = require("../../config/apperance");
|
|
@@ -21,7 +22,81 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
21
22
|
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
23
|
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
24
|
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); }
|
|
25
|
+
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
|
|
26
|
+
const getPalette = theme => {
|
|
27
|
+
// Check if theme has our custom palette properties
|
|
28
|
+
if (theme && theme.palette && theme.palette.gray && theme.palette.gray.darker) {
|
|
29
|
+
// Theme has our custom structure, now normalize it
|
|
30
|
+
return {
|
|
31
|
+
primary: theme.palette.primary.main || theme.palette.primary,
|
|
32
|
+
secondary: theme.palette.secondary.main || theme.palette.secondary,
|
|
33
|
+
error: theme.palette.error ? theme.palette.error.main || theme.palette.error : _apperance.palette.error,
|
|
34
|
+
warning: theme.palette.warning ? theme.palette.warning.main || theme.palette.warning : _apperance.palette.warning,
|
|
35
|
+
success: theme.palette.success ? theme.palette.success.main || theme.palette.success : _apperance.palette.success,
|
|
36
|
+
info: theme.palette.info ? theme.palette.info.main || theme.palette.info : _apperance.palette.info,
|
|
37
|
+
white: theme.palette.white || _apperance.palette.white,
|
|
38
|
+
dark: theme.palette.dark || _apperance.palette.dark,
|
|
39
|
+
gray: theme.palette.gray,
|
|
40
|
+
blue: theme.palette.blue || _apperance.palette.blue,
|
|
41
|
+
background: theme.palette.background || _apperance.palette.background,
|
|
42
|
+
border: theme.palette.border || _apperance.palette.border,
|
|
43
|
+
shadow: theme.palette.shadow || _apperance.palette.shadow
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// Check if theme object itself has gray (root level)
|
|
47
|
+
if (theme && theme.gray && theme.gray.darker) {
|
|
48
|
+
return {
|
|
49
|
+
primary: theme.primary,
|
|
50
|
+
secondary: theme.secondary,
|
|
51
|
+
error: theme.error || _apperance.palette.error,
|
|
52
|
+
warning: theme.warning || _apperance.palette.warning,
|
|
53
|
+
success: theme.success || _apperance.palette.success,
|
|
54
|
+
info: theme.info || _apperance.palette.info,
|
|
55
|
+
white: theme.white || _apperance.palette.white,
|
|
56
|
+
dark: theme.dark || _apperance.palette.dark,
|
|
57
|
+
gray: theme.gray,
|
|
58
|
+
blue: theme.blue || _apperance.palette.blue,
|
|
59
|
+
background: theme.background || _apperance.palette.background,
|
|
60
|
+
border: theme.border || _apperance.palette.border,
|
|
61
|
+
shadow: theme.shadow || _apperance.palette.shadow
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return _apperance.palette;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// Helper function to get PuiMainTitle color from theme
|
|
68
|
+
const getPuiMainTitleColor = theme => {
|
|
69
|
+
if (theme && theme.components && theme.components.PuiMainTitle && theme.components.PuiMainTitle.color) {
|
|
70
|
+
return theme.components.PuiMainTitle.color;
|
|
71
|
+
}
|
|
72
|
+
// Fall back to primary color
|
|
73
|
+
const themePalette = getPalette(theme);
|
|
74
|
+
return themePalette.primary;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// Helper function to get PuiMainTitle font family from theme
|
|
78
|
+
const getPuiMainTitleFontFamily = theme => {
|
|
79
|
+
if (theme && theme.components && theme.components.PuiMainTitle && theme.components.PuiMainTitle.fontFamily) {
|
|
80
|
+
return theme.components.PuiMainTitle.fontFamily;
|
|
81
|
+
}
|
|
82
|
+
return "'Poppins', sans-serif";
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
// Helper function to get PuiMainTitle font weight from theme
|
|
86
|
+
const getPuiMainTitleFontWeight = theme => {
|
|
87
|
+
if (theme && theme.components && theme.components.PuiMainTitle && theme.components.PuiMainTitle.fontWeight) {
|
|
88
|
+
return theme.components.PuiMainTitle.fontWeight;
|
|
89
|
+
}
|
|
90
|
+
return "bold";
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// Helper function to check if icon should be shown
|
|
94
|
+
const getPuiMainTitleShowIcon = theme => {
|
|
95
|
+
if (theme && theme.components && theme.components.PuiMainTitle && typeof theme.components.PuiMainTitle.showIcon !== 'undefined') {
|
|
96
|
+
return theme.components.PuiMainTitle.showIcon;
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
};
|
|
25
100
|
const PuiMainTitle = _ref => {
|
|
26
101
|
let {
|
|
27
102
|
id,
|
|
@@ -31,53 +106,67 @@ const PuiMainTitle = _ref => {
|
|
|
31
106
|
trace,
|
|
32
107
|
title
|
|
33
108
|
} = _ref;
|
|
34
|
-
|
|
109
|
+
const theme = (0, _styles.useTheme)();
|
|
110
|
+
const mainTitleColor = getPuiMainTitleColor(theme);
|
|
111
|
+
const mainTitleFontFamily = getPuiMainTitleFontFamily(theme);
|
|
112
|
+
const mainTitleFontWeight = getPuiMainTitleFontWeight(theme);
|
|
113
|
+
const showIcon = getPuiMainTitleShowIcon(theme);
|
|
114
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
35
115
|
id: id,
|
|
36
116
|
className: className,
|
|
37
117
|
sx: _objectSpread({
|
|
38
118
|
display: "flex",
|
|
39
|
-
|
|
40
|
-
marginBottom:
|
|
119
|
+
flexDirection: "column",
|
|
120
|
+
marginBottom: 3.5
|
|
41
121
|
}, sx),
|
|
42
|
-
children:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
fontSize: "1.8rem",
|
|
55
|
-
fontWeight: "bold"
|
|
56
|
-
},
|
|
57
|
-
variant: "h1",
|
|
58
|
-
children: title
|
|
59
|
-
}), Boolean(trace) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
60
|
-
sx: {
|
|
61
|
-
color: _apperance.palette.primary,
|
|
62
|
-
fontSize: ".8rem",
|
|
63
|
-
fontWeight: "bold"
|
|
64
|
-
},
|
|
65
|
-
variant: "h2",
|
|
66
|
-
children: trace.map((element, index) => {
|
|
67
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
68
|
-
component: "span",
|
|
69
|
-
children: "".concat(element).concat(index + 1 !== trace.length ? " > " : "")
|
|
70
|
-
}, index);
|
|
122
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
123
|
+
sx: {
|
|
124
|
+
display: "flex",
|
|
125
|
+
alignItems: "center"
|
|
126
|
+
},
|
|
127
|
+
children: [Boolean(icon) && showIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
128
|
+
children: /*#__PURE__*/React.cloneElement(icon, {
|
|
129
|
+
sx: {
|
|
130
|
+
marginRight: 1,
|
|
131
|
+
fontSize: "2.4em",
|
|
132
|
+
color: mainTitleColor
|
|
133
|
+
}
|
|
71
134
|
})
|
|
135
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
136
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
137
|
+
sx: {
|
|
138
|
+
color: mainTitleColor,
|
|
139
|
+
fontSize: "1.8rem",
|
|
140
|
+
fontWeight: mainTitleFontWeight,
|
|
141
|
+
fontFamily: mainTitleFontFamily,
|
|
142
|
+
marginBottom: 0.5
|
|
143
|
+
},
|
|
144
|
+
variant: "h1",
|
|
145
|
+
children: title
|
|
146
|
+
}), Boolean(trace) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
147
|
+
sx: {
|
|
148
|
+
color: mainTitleColor,
|
|
149
|
+
fontSize: ".8rem",
|
|
150
|
+
fontWeight: mainTitleFontWeight,
|
|
151
|
+
fontFamily: mainTitleFontFamily
|
|
152
|
+
},
|
|
153
|
+
variant: "h2",
|
|
154
|
+
children: trace.map((element, index) => {
|
|
155
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
156
|
+
component: "span",
|
|
157
|
+
children: "".concat(element).concat(index + 1 !== trace.length ? " > " : "")
|
|
158
|
+
}, index);
|
|
159
|
+
})
|
|
160
|
+
})]
|
|
72
161
|
})]
|
|
73
|
-
})
|
|
162
|
+
})
|
|
74
163
|
});
|
|
75
164
|
};
|
|
76
165
|
PuiMainTitle.propTypes = {
|
|
77
166
|
id: _propTypes.default.string,
|
|
78
167
|
className: _propTypes.default.string,
|
|
79
168
|
sx: _propTypes.default.object,
|
|
80
|
-
icon: _propTypes.default.element
|
|
169
|
+
icon: _propTypes.default.element,
|
|
81
170
|
trace: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
82
171
|
title: _propTypes.default.string.isRequired
|
|
83
172
|
};
|