@portnet/ui 4.0.0 → 5.0.0
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 +18 -10
- package/dist/components/common/StyledMuiTextField.js +12 -4
- package/dist/components/inputs/PuiCheckbox.js +1 -2
- package/dist/components/inputs/PuiDateField.js +57 -121
- package/dist/components/inputs/PuiDateTimeField.js +180 -31
- package/dist/components/inputs/PuiSelect.js +116 -34
- package/dist/components/others/PuiSection.js +24 -30
- package/dist/components/table/PuiTable.js +22 -18
- package/dist/components/table/PuiTableAction.js +12 -2
- package/dist/components/typography/PuiMainTitle.js +70 -34
- package/dist/components/ui/pages/general/PuiSearchPage.js +34 -56
- package/package.json +4 -9
- package/dist/components/others/DateTimePickerField.js +0 -210
- package/dist/components/table/ActionPopover.js +0 -56
|
@@ -33,54 +33,130 @@ 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: "1.4375em",
|
|
112
|
+
height: selectStyles.inputRoot.height || "1.4375em",
|
|
113
|
+
lineHeight: selectStyles.inputRoot.lineHeight || "1",
|
|
44
114
|
display: "flex",
|
|
45
|
-
alignItems: "center"
|
|
46
|
-
lineHeight: "1"
|
|
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:
|
|
127
|
+
marginBottom: "".concat(selectStyles.label.marginBottom, " !important"),
|
|
128
|
+
color: "".concat(selectStyles.label.color, " !important"),
|
|
60
129
|
"&.Mui-focused ": {
|
|
61
130
|
lineHeight: "1.4375em",
|
|
62
|
-
color:
|
|
131
|
+
color: "".concat(themePalette.primary, " !important")
|
|
63
132
|
},
|
|
64
133
|
"&.Mui-disabled": {
|
|
65
|
-
color:
|
|
134
|
+
color: "".concat(((_selectStyles$disable = selectStyles.disabled) === null || _selectStyles$disable === void 0 ? void 0 : _selectStyles$disable.labelColor) || "#97969b", " !important")
|
|
66
135
|
},
|
|
67
136
|
"&.Mui-error": {
|
|
68
|
-
color:
|
|
137
|
+
color: "".concat(themePalette.error, " !important")
|
|
69
138
|
}
|
|
70
139
|
},
|
|
71
140
|
"& .MuiInputBase-root": {
|
|
72
|
-
backgroundColor:
|
|
73
|
-
border: "
|
|
74
|
-
borderRadius: "
|
|
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",
|
|
75
145
|
"&.Mui-focused ": {
|
|
76
|
-
border: "2px solid ".concat(
|
|
146
|
+
border: "2px solid ".concat(themePalette.primary, " !important")
|
|
77
147
|
},
|
|
78
148
|
"&.Mui-error ": {
|
|
79
|
-
border: "2px solid ".concat(
|
|
80
|
-
backgroundColor: _apperance.palette.background.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")
|
|
81
151
|
},
|
|
82
152
|
"&.Mui-disabled ": {
|
|
83
|
-
backgroundColor: "".concat(
|
|
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
|
+
}
|
|
84
160
|
},
|
|
85
161
|
"& .MuiInputBase-input": {
|
|
86
162
|
padding: "1px 6px",
|
|
@@ -93,7 +169,7 @@ const StyledMuiFormControl = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((
|
|
|
93
169
|
"& .MuiFormHelperText-root": {
|
|
94
170
|
fontWeight: "bold",
|
|
95
171
|
fontSize: ".7rem",
|
|
96
|
-
color:
|
|
172
|
+
color: themePalette.gray.darker
|
|
97
173
|
},
|
|
98
174
|
"& fieldset": {
|
|
99
175
|
display: "none"
|
|
@@ -104,10 +180,13 @@ const StyledMuiFormControl = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((
|
|
|
104
180
|
const LoadingProgress = () => {
|
|
105
181
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.CircularProgress, {
|
|
106
182
|
size: 16,
|
|
107
|
-
sx: {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
183
|
+
sx: theme => {
|
|
184
|
+
const themePalette = getPalette(theme);
|
|
185
|
+
return {
|
|
186
|
+
color: themePalette.primary,
|
|
187
|
+
position: "absolute",
|
|
188
|
+
right: "14px"
|
|
189
|
+
};
|
|
111
190
|
}
|
|
112
191
|
});
|
|
113
192
|
};
|
|
@@ -167,18 +246,21 @@ const PuiStandardSelect = _ref => {
|
|
|
167
246
|
name
|
|
168
247
|
},
|
|
169
248
|
MenuProps: {
|
|
170
|
-
sx: {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
"& .
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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)
|
|
256
|
+
},
|
|
257
|
+
"& .MuiMenuItem-root": {
|
|
258
|
+
fontSize: 13,
|
|
259
|
+
height: "fit-content",
|
|
260
|
+
minHeight: "auto"
|
|
261
|
+
}
|
|
180
262
|
}
|
|
181
|
-
}
|
|
263
|
+
};
|
|
182
264
|
}
|
|
183
265
|
}
|
|
184
266
|
}, rest), {}, {
|
|
@@ -73,7 +73,11 @@ const getPuiSectionStyles = theme => {
|
|
|
73
73
|
border: "2px solid ".concat(_apperance.palette.gray.dark),
|
|
74
74
|
borderRadius: "5px",
|
|
75
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
|
|
76
|
+
titleColor: _apperance.palette.primary,
|
|
77
|
+
titleFontFamily: "'Poppins', sans-serif",
|
|
78
|
+
titleFontWeight: "400",
|
|
79
|
+
titleFontSize: "1.1rem",
|
|
80
|
+
titlePosition: "16px"
|
|
77
81
|
};
|
|
78
82
|
};
|
|
79
83
|
const StyledMuiPaper = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Paper, _objectSpread({
|
|
@@ -103,46 +107,36 @@ const PuiSection = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
103
107
|
id: id,
|
|
104
108
|
className: className,
|
|
105
109
|
sx: _objectSpread({
|
|
106
|
-
|
|
110
|
+
paddingX: 3,
|
|
111
|
+
paddingY: 2,
|
|
112
|
+
paddingTop: title ? 6 : 2
|
|
107
113
|
}, sx),
|
|
108
114
|
ref: ref,
|
|
109
115
|
elevation: 1,
|
|
110
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
111
|
-
sx: {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
children: [Boolean(title) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
117
|
+
sx: theme => {
|
|
118
|
+
const sectionStyles = getPuiSectionStyles(theme);
|
|
119
|
+
return {
|
|
120
|
+
position: "absolute",
|
|
121
|
+
top: sectionStyles.titlePosition || "16px",
|
|
122
|
+
left: "24px"
|
|
123
|
+
};
|
|
116
124
|
},
|
|
117
|
-
children:
|
|
118
|
-
sx: theme => {
|
|
119
|
-
const themePalette = getPalette(theme);
|
|
120
|
-
return {
|
|
121
|
-
transform: "translateY(-50%)",
|
|
122
|
-
top: "50%",
|
|
123
|
-
zIndex: "-1",
|
|
124
|
-
position: "absolute",
|
|
125
|
-
width: "100%",
|
|
126
|
-
height: "4px",
|
|
127
|
-
backgroundColor: themePalette.gray.light
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
125
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
131
126
|
variant: titleVariant,
|
|
132
127
|
sx: theme => {
|
|
133
128
|
const sectionStyles = getPuiSectionStyles(theme);
|
|
134
|
-
const themePalette = getPalette(theme);
|
|
135
129
|
return {
|
|
136
|
-
textAlign: "
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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"
|
|
142
136
|
};
|
|
143
137
|
},
|
|
144
138
|
children: title
|
|
145
|
-
})
|
|
139
|
+
})
|
|
146
140
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
147
141
|
children: children
|
|
148
142
|
})]
|
|
@@ -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"];
|
|
@@ -145,12 +144,13 @@ const StyledMuiTable = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props,
|
|
|
145
144
|
},
|
|
146
145
|
"& .MuiLinearProgress-root": {
|
|
147
146
|
zIndex: 1,
|
|
148
|
-
backgroundColor:
|
|
147
|
+
backgroundColor: "#f4f9fa !important",
|
|
149
148
|
"& .MuiLinearProgress-bar": {
|
|
150
149
|
backgroundColor: themePalette.primary
|
|
151
150
|
}
|
|
152
151
|
},
|
|
153
152
|
"& .MuiDataGrid-columnHeaders": {
|
|
153
|
+
backgroundColor: "#F1F4F9 !important",
|
|
154
154
|
"& .MuiDataGrid-columnHeader": {
|
|
155
155
|
"& .MuiDataGrid-columnHeaderTitle": {
|
|
156
156
|
display: "flex",
|
|
@@ -172,40 +172,45 @@ const StyledMuiTable = (0, _styles.styled)(/*#__PURE__*/React.forwardRef((props,
|
|
|
172
172
|
}
|
|
173
173
|
},
|
|
174
174
|
"& .MuiDataGrid-columnSeparator": {
|
|
175
|
-
|
|
175
|
+
display: "none !important"
|
|
176
176
|
}
|
|
177
177
|
},
|
|
178
178
|
"& .MuiDataGrid-cell": {
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
padding: "8px",
|
|
180
|
+
display: "flex",
|
|
181
|
+
alignItems: "center",
|
|
181
182
|
whiteSpace: "normal",
|
|
182
|
-
|
|
183
|
+
wordWrap: "break-word",
|
|
184
|
+
lineHeight: "1.4 !important",
|
|
183
185
|
overflow: "hidden",
|
|
184
|
-
maxHeight: "".concat(tableStyles.rowHeight.maxHeight, " !important"),
|
|
185
|
-
minWidth: 'maxWidth',
|
|
186
|
-
wordBreak: "break-word",
|
|
187
186
|
justifyContent: "".concat(tableStyles.cellJustifyContent, " !important"),
|
|
188
187
|
"&.tableAction": {
|
|
189
188
|
justifyContent: "center !important",
|
|
190
189
|
position: "relative",
|
|
191
|
-
overflow: "initial !important"
|
|
190
|
+
overflow: "initial !important",
|
|
191
|
+
"& .MuiIconButton-root": {
|
|
192
|
+
opacity: 0,
|
|
193
|
+
transition: "opacity 0.2s ease-in-out"
|
|
194
|
+
}
|
|
192
195
|
},
|
|
193
196
|
"&:focus-within": {
|
|
194
197
|
outline: "none"
|
|
195
198
|
}
|
|
196
199
|
},
|
|
197
200
|
"& .MuiDataGrid-row": {
|
|
198
|
-
maxHeight: "".concat(tableStyles.rowHeight.maxHeight, " !important"),
|
|
199
|
-
minHeight: "".concat(tableStyles.rowHeight.minHeight, " !important"),
|
|
200
|
-
lineHeight: "".concat(tableStyles.rowHeight.lineHeight, " !important"),
|
|
201
201
|
"&:nth-of-type(odd)": {
|
|
202
|
-
backgroundColor: "#ffffff"
|
|
202
|
+
backgroundColor: "#ffffff !important"
|
|
203
203
|
},
|
|
204
204
|
"&:nth-of-type(even)": {
|
|
205
|
-
backgroundColor: "#
|
|
205
|
+
backgroundColor: "#f4f9fa !important"
|
|
206
206
|
},
|
|
207
207
|
"&:hover": {
|
|
208
|
-
backgroundColor: "#
|
|
208
|
+
backgroundColor: "#e8f1f5 !important",
|
|
209
|
+
"& .tableAction": {
|
|
210
|
+
"& .MuiIconButton-root": {
|
|
211
|
+
opacity: 1
|
|
212
|
+
}
|
|
213
|
+
}
|
|
209
214
|
}
|
|
210
215
|
},
|
|
211
216
|
"& .MuiDataGrid-virtualScrollerContent": {
|
|
@@ -453,13 +458,12 @@ const PuiTable = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
453
458
|
className: "".concat(className, " ").concat(stripped ? "table-stripped" : "", " ").concat(loading ? "table-loading" : "", " ").concat(elevate ? "elevate" : ""),
|
|
454
459
|
sx: {
|
|
455
460
|
["& .".concat(_xDataGrid.gridClasses.cell)]: {
|
|
456
|
-
py:
|
|
461
|
+
py: 1
|
|
457
462
|
}
|
|
458
463
|
},
|
|
459
464
|
autoHeight: true,
|
|
460
465
|
headerHeight: 60,
|
|
461
466
|
footerHeight: 40,
|
|
462
|
-
rowHeight: 40,
|
|
463
467
|
rows: rows,
|
|
464
468
|
rowCount: rowCount,
|
|
465
469
|
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,
|
|
@@ -73,6 +73,30 @@ const getPuiMainTitleColor = theme => {
|
|
|
73
73
|
const themePalette = getPalette(theme);
|
|
74
74
|
return themePalette.primary;
|
|
75
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
|
+
};
|
|
76
100
|
const PuiMainTitle = _ref => {
|
|
77
101
|
let {
|
|
78
102
|
id,
|
|
@@ -84,53 +108,65 @@ const PuiMainTitle = _ref => {
|
|
|
84
108
|
} = _ref;
|
|
85
109
|
const theme = (0, _styles.useTheme)();
|
|
86
110
|
const mainTitleColor = getPuiMainTitleColor(theme);
|
|
87
|
-
|
|
111
|
+
const mainTitleFontFamily = getPuiMainTitleFontFamily(theme);
|
|
112
|
+
const mainTitleFontWeight = getPuiMainTitleFontWeight(theme);
|
|
113
|
+
const showIcon = getPuiMainTitleShowIcon(theme);
|
|
114
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
88
115
|
id: id,
|
|
89
116
|
className: className,
|
|
90
117
|
sx: _objectSpread({
|
|
91
118
|
display: "flex",
|
|
92
|
-
|
|
93
|
-
marginBottom:
|
|
119
|
+
flexDirection: "column",
|
|
120
|
+
marginBottom: 3.5
|
|
94
121
|
}, sx),
|
|
95
|
-
children:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
fontSize: "1.8rem",
|
|
108
|
-
fontWeight: "bold"
|
|
109
|
-
},
|
|
110
|
-
variant: "h1",
|
|
111
|
-
children: title
|
|
112
|
-
}), Boolean(trace) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
113
|
-
sx: {
|
|
114
|
-
color: mainTitleColor,
|
|
115
|
-
fontSize: ".8rem",
|
|
116
|
-
fontWeight: "bold"
|
|
117
|
-
},
|
|
118
|
-
variant: "h2",
|
|
119
|
-
children: trace.map((element, index) => {
|
|
120
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
121
|
-
component: "span",
|
|
122
|
-
children: "".concat(element).concat(index + 1 !== trace.length ? " > " : "")
|
|
123
|
-
}, 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
|
+
}
|
|
124
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
|
+
})]
|
|
125
161
|
})]
|
|
126
|
-
})
|
|
162
|
+
})
|
|
127
163
|
});
|
|
128
164
|
};
|
|
129
165
|
PuiMainTitle.propTypes = {
|
|
130
166
|
id: _propTypes.default.string,
|
|
131
167
|
className: _propTypes.default.string,
|
|
132
168
|
sx: _propTypes.default.object,
|
|
133
|
-
icon: _propTypes.default.element
|
|
169
|
+
icon: _propTypes.default.element,
|
|
134
170
|
trace: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
135
171
|
title: _propTypes.default.string.isRequired
|
|
136
172
|
};
|