@codezee/sixtify-brahma 0.2.76 → 0.2.77
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/package.json +1 -1
- package/packages/shared-components/dist/FormFields/DatePicker/DatePicker.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/DatePicker/DatePicker.js +11 -18
- package/packages/shared-components/dist/UserProfileMenu/UserProfileMenu.d.ts.map +1 -1
- package/packages/shared-components/dist/UserProfileMenu/UserProfileMenu.js +3 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/FormFields/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,IAAI,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAE5F,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG5E,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAKzB,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,WAAW,IAAI,kBAAkB,CAAC,CAAC,CAAC,GACxE,kBAAkB,CAAC,eAAe,CAAC,GACnC,OAAO,CAAC;IACN,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;IAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE,CACR,IAAI,EAAE,MAAM,CAA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C;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;IAClB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE,CACR,IAAI,EAAE,MAAM,CAAC,EACb,KAAK,EAAE,UAAU,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KACnD,IAAI,CAAC;CACX,CAAC,CAAC;AAEL,eAAO,MAAM,WAAW;;;CAGvB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAcjC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAclC,CAAC;AAEF,wBAAgB,UAAU,CAAC,CAAC,SAAS,WAAW,EAAE,EAChD,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,QAAgB,EAChB,KAAK,EACL,QAAgB,EAChB,IAAI,EACJ,KAAa,EACb,UAAU,EACV,OAAe,EACf,QAAgB,EAChB,SAAgB,EAChB,KAAK,EACL,oBAA4B,EAC5B,KAAgC,EAChC,MAAqC,EACrC,GAAG,SAAS,EACb,EAAE,eAAe,CAAC,CAAC,CAAC,2CAuIpB"}
|
|
@@ -41,7 +41,6 @@ const RightArrowIcon = () => {
|
|
|
41
41
|
};
|
|
42
42
|
exports.RightArrowIcon = RightArrowIcon;
|
|
43
43
|
function DatePicker({ setError, control, defaultValue, disabled = false, label, readOnly = false, name, error = false, helperText, loading = false, required = false, clearable = true, rules, disableKeyboardInput = false, views = ["year", "month", "day"], format = exports.dateFormats.dateWithEuropean, ...restProps }) {
|
|
44
|
-
const [localError, setLocalError] = (0, react_1.useState)();
|
|
45
44
|
const { field: { value, onChange, ...restField }, } = (0, react_hook_form_1.useController)({ name, control, defaultValue, rules });
|
|
46
45
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
47
46
|
const theme = (0, material_1.useTheme)();
|
|
@@ -61,8 +60,8 @@ function DatePicker({ setError, control, defaultValue, disabled = false, label,
|
|
|
61
60
|
},
|
|
62
61
|
textField: {
|
|
63
62
|
disabled,
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
helperText,
|
|
64
|
+
error,
|
|
66
65
|
InputProps: {
|
|
67
66
|
endAdornment: ((0, jsx_runtime_1.jsx)(Actions_1.CalendarIconAction, { disabled: disabled, onClick: () => setOpen(true) })),
|
|
68
67
|
sx: {
|
|
@@ -124,26 +123,20 @@ function DatePicker({ setError, control, defaultValue, disabled = false, label,
|
|
|
124
123
|
restProps.onAccept(value, details);
|
|
125
124
|
}
|
|
126
125
|
}, onChange: (value, details) => {
|
|
127
|
-
if (
|
|
128
|
-
onChange(
|
|
129
|
-
setLocalError(undefined);
|
|
126
|
+
if (restProps?.onChange) {
|
|
127
|
+
restProps.onChange(value, details);
|
|
130
128
|
return;
|
|
131
129
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
onChange(isValid ? value.toISODate() : null);
|
|
135
|
-
const errorMessage = hasError
|
|
136
|
-
? "Please enter a valid date"
|
|
137
|
-
: undefined;
|
|
138
|
-
setLocalError(errorMessage);
|
|
139
|
-
requestAnimationFrame(() => {
|
|
140
|
-
if ((0, isFunction_1.default)(setError) && hasError) {
|
|
130
|
+
if (details.validationError && value && value.year >= 1000) {
|
|
131
|
+
if ((0, isFunction_1.default)(setError)) {
|
|
141
132
|
setError(name, {
|
|
142
133
|
type: "manual",
|
|
143
|
-
message:
|
|
134
|
+
message: "common.date.invalid",
|
|
144
135
|
});
|
|
145
136
|
}
|
|
146
|
-
}
|
|
147
|
-
|
|
137
|
+
}
|
|
138
|
+
else if (value?.isValid) {
|
|
139
|
+
onChange(value.toISODate());
|
|
140
|
+
}
|
|
148
141
|
} })] }));
|
|
149
142
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserProfileMenu.d.ts","sourceRoot":"","sources":["../../src/UserProfileMenu/UserProfileMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAa/C,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"UserProfileMenu.d.ts","sourceRoot":"","sources":["../../src/UserProfileMenu/UserProfileMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAa/C,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,CAAC,GAAG;IACzE,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,SAAS,EAAE;QACT,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,SAAS,CAAC;QACjB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,EAAE,CAAC,EAAE,aAAa,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;KACtB,EAAE,CAAC;CACL,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,SAAS,GACV,EAAE,oBAAoB,2CAuItB"}
|
|
@@ -9,6 +9,7 @@ const icons_material_1 = require("@mui/icons-material");
|
|
|
9
9
|
const material_1 = require("@mui/material");
|
|
10
10
|
const isFunction_1 = __importDefault(require("lodash/isFunction"));
|
|
11
11
|
const react_1 = require("react");
|
|
12
|
+
const Tooltip_1 = require("../Tooltip");
|
|
12
13
|
const UserProfileMenu_styled_1 = require("./UserProfileMenu.styled");
|
|
13
14
|
function UserProfileMenu({ userDetails, menuItems, }) {
|
|
14
15
|
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
@@ -21,7 +22,8 @@ function UserProfileMenu({ userDetails, menuItems, }) {
|
|
|
21
22
|
const handleClose = () => {
|
|
22
23
|
setAnchorEl(null);
|
|
23
24
|
};
|
|
24
|
-
|
|
25
|
+
const { name } = userDetails;
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { position: "relative", children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: { display: "flex", alignItems: "center", textAlign: "center" }, children: (0, jsx_runtime_1.jsx)(UserProfileMenu_styled_1.IconButtonStyled, { onClick: handleClick, size: "small", sx: { ml: 2 }, "aria-controls": open ? "account-menu" : undefined, "aria-haspopup": "true", "aria-expanded": open ? "true" : undefined, children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", alignItems: "center", gap: 1, color: "black", children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { src: userDetails.avatar, sx: { border: `1px solid ${iron[700]}` } }), (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { toolTipLabel: name, children: (0, jsx_runtime_1.jsx)(material_1.Typography, { width: 150, noWrap: true, children: name }) }), open ? (0, jsx_runtime_1.jsx)(icons_material_1.KeyboardArrowUp, {}) : (0, jsx_runtime_1.jsx)(icons_material_1.KeyboardArrowDown, {})] }) }) }), (0, jsx_runtime_1.jsx)(material_1.Menu, { anchorEl: anchorEl, id: "account-menu", open: open, onClose: handleClose, onClick: handleClose, sx: {
|
|
25
27
|
"& .MuiPaper-root": {
|
|
26
28
|
width: "220px",
|
|
27
29
|
},
|