@codezee/sixtify-brahma 0.2.195 → 0.2.197
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/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/packages/shared-components/dist/FormFields/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/DateRangePicker/DateRangePicker.js +2 -2
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartTextField.d.ts +5 -0
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartTextField.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartTextField.js +59 -0
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/index.d.ts +1 -0
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/index.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/index.js +1 -0
- package/packages/shared-components/dist/UserProfileMenu/UserProfileMenu.d.ts +2 -1
- package/packages/shared-components/dist/UserProfileMenu/UserProfileMenu.d.ts.map +1 -1
- package/packages/shared-components/dist/UserProfileMenu/UserProfileMenu.js +4 -1
package/package.json
CHANGED
|
@@ -10,5 +10,5 @@ export type DateRangePickerProps<P extends FieldValues> = UseControllerProps<P>
|
|
|
10
10
|
maxDate?: Date;
|
|
11
11
|
months?: number;
|
|
12
12
|
};
|
|
13
|
-
export declare function DateRangePicker<P extends FieldValues>({ control, defaultValue, disabled, label, name, error, helperText, loading, required, months, rules, }: DateRangePickerProps<P>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function DateRangePicker<P extends FieldValues>({ control, defaultValue, disabled, label, name, error, helperText, loading, required, months, rules, minDate, maxDate, }: DateRangePickerProps<P>): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
//# sourceMappingURL=DateRangePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../../src/FormFields/DateRangePicker/DateRangePicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAIvE,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,WAAW,IACpD,kBAAkB,CAAC,CAAC,CAAC,GAAG;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEJ,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW,EAAE,EACrD,OAAO,EACP,YAAY,EACZ,QAAgB,EAChB,KAAK,EACL,IAAI,EACJ,KAAa,EACb,UAAU,EACV,OAAe,EACf,QAAgB,EAChB,MAAU,EACV,KAAK,
|
|
1
|
+
{"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../../src/FormFields/DateRangePicker/DateRangePicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAIvE,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,WAAW,IACpD,kBAAkB,CAAC,CAAC,CAAC,GAAG;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEJ,wBAAgB,eAAe,CAAC,CAAC,SAAS,WAAW,EAAE,EACrD,OAAO,EACP,YAAY,EACZ,QAAgB,EAChB,KAAK,EACL,IAAI,EACJ,KAAa,EACb,UAAU,EACV,OAAe,EACf,QAAgB,EAChB,MAAU,EACV,KAAK,EACL,OAAO,EACP,OAAO,GACR,EAAE,oBAAoB,CAAC,CAAC,CAAC,2CAoEzB"}
|
|
@@ -8,7 +8,7 @@ const react_1 = require("react");
|
|
|
8
8
|
const react_date_range_1 = require("react-date-range");
|
|
9
9
|
const react_hook_form_1 = require("react-hook-form");
|
|
10
10
|
const Skeleton_1 = require("./Skeleton");
|
|
11
|
-
function DateRangePicker({ control, defaultValue, disabled = false, label, name, error = false, helperText, loading = false, required = false, months = 1, rules, }) {
|
|
11
|
+
function DateRangePicker({ control, defaultValue, disabled = false, label, name, error = false, helperText, loading = false, required = false, months = 1, rules, minDate, maxDate, }) {
|
|
12
12
|
const { field: { onChange }, } = (0, react_hook_form_1.useController)({ name, control, defaultValue, rules });
|
|
13
13
|
const [range, setRange] = (0, react_1.useState)([
|
|
14
14
|
{
|
|
@@ -36,5 +36,5 @@ function DateRangePicker({ control, defaultValue, disabled = false, label, name,
|
|
|
36
36
|
const endDate = luxon_1.DateTime.fromJSDate(selectedRange.endDate).toISODate();
|
|
37
37
|
onChange([startDate, endDate]);
|
|
38
38
|
}
|
|
39
|
-
}, months: months, direction: "horizontal", calendarFocus: "backwards", staticRanges: [], inputRanges: [], moveRangeOnFirstSelection: false, preventSnapRefocus: true }), error && (0, jsx_runtime_1.jsx)(material_1.Typography, { color: "red", children: helperText })] }));
|
|
39
|
+
}, months: months, direction: "horizontal", calendarFocus: "backwards", staticRanges: [], inputRanges: [], moveRangeOnFirstSelection: false, preventSnapRefocus: true, minDate: minDate, maxDate: maxDate }), error && (0, jsx_runtime_1.jsx)(material_1.Typography, { color: "red", children: helperText })] }));
|
|
40
40
|
}
|
package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartTextField.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { InputHTMLAttributes } from "react";
|
|
2
|
+
export declare const SmartTextField: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<{
|
|
3
|
+
errorMessage?: string;
|
|
4
|
+
} & InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>>;
|
|
5
|
+
//# sourceMappingURL=SmartTextField.d.ts.map
|
package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartTextField.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SmartTextField.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/EditableFields/SmartTextField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAiFjD,eAAO,MAAM,cAAc;mBA5EV,MAAM;6FAwFtB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SmartTextField = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const SmartTooltip_1 = require("./SmartTooltip");
|
|
8
|
+
const SmartTextFieldComponent = (0, react_1.forwardRef)(({ errorMessage, ...rest }, ref) => {
|
|
9
|
+
const theme = (0, material_1.useTheme)();
|
|
10
|
+
const { butterflyBlue, lipstickRed, iron } = theme.palette.app.color;
|
|
11
|
+
const [isFocused, setIsFocused] = (0, react_1.useState)(false);
|
|
12
|
+
const getBorderColor = () => {
|
|
13
|
+
if (errorMessage && !isFocused) {
|
|
14
|
+
return lipstickRed[900];
|
|
15
|
+
}
|
|
16
|
+
if (isFocused) {
|
|
17
|
+
return butterflyBlue[900];
|
|
18
|
+
}
|
|
19
|
+
return iron[800];
|
|
20
|
+
};
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(SmartTooltip_1.SmartTooltip, { title: errorMessage ?? "", position: "top", delay: 50, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
22
|
+
display: "flex",
|
|
23
|
+
flexDirection: "column",
|
|
24
|
+
gap: "4px",
|
|
25
|
+
width: "100%",
|
|
26
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
27
|
+
display: "flex",
|
|
28
|
+
alignItems: "center",
|
|
29
|
+
border: `2px solid ${getBorderColor()}`,
|
|
30
|
+
borderRadius: "4px",
|
|
31
|
+
padding: "4px 8px",
|
|
32
|
+
background: "white",
|
|
33
|
+
minHeight: "20px",
|
|
34
|
+
}, children: (0, jsx_runtime_1.jsx)("input", { ref: ref, ...rest, style: {
|
|
35
|
+
width: "100%",
|
|
36
|
+
border: "none",
|
|
37
|
+
background: "transparent",
|
|
38
|
+
padding: "0",
|
|
39
|
+
fontSize: "14px",
|
|
40
|
+
outline: "none",
|
|
41
|
+
}, onClick: (e) => e.stopPropagation(), onFocus: (e) => {
|
|
42
|
+
e.stopPropagation();
|
|
43
|
+
setIsFocused(true);
|
|
44
|
+
}, onBlur: (e) => {
|
|
45
|
+
e.stopPropagation();
|
|
46
|
+
setIsFocused(false);
|
|
47
|
+
} }) }) }) }));
|
|
48
|
+
});
|
|
49
|
+
SmartTextFieldComponent.displayName = "SmartTextFieldComponent";
|
|
50
|
+
// Memoize with custom comparison to prevent unnecessary re-renders
|
|
51
|
+
exports.SmartTextField = (0, react_1.memo)(SmartTextFieldComponent, (prevProps, nextProps) => {
|
|
52
|
+
// Only re-render if these specific props change
|
|
53
|
+
return (prevProps.name === nextProps.name &&
|
|
54
|
+
prevProps.value === nextProps.value &&
|
|
55
|
+
prevProps.disabled === nextProps.disabled &&
|
|
56
|
+
prevProps.type === nextProps.type &&
|
|
57
|
+
prevProps.errorMessage === nextProps.errorMessage);
|
|
58
|
+
});
|
|
59
|
+
exports.SmartTextField.displayName = "SmartTextField";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/EditableFields/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/EditableFields/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./SmartSelectField"), exports);
|
|
18
18
|
__exportStar(require("./SmartTooltip"), exports);
|
|
19
|
+
__exportStar(require("./SmartTextField"), exports);
|
|
@@ -15,6 +15,7 @@ export type UserProfileMenuProps = Omit<MenuProps, "open" | "closeMenu"> & {
|
|
|
15
15
|
sx?: CSSProperties;
|
|
16
16
|
onClick?: OnAction;
|
|
17
17
|
}[];
|
|
18
|
+
shouldCloseOnClick?: boolean;
|
|
18
19
|
};
|
|
19
|
-
export declare function UserProfileMenu({ userDetails, menuItems, }: UserProfileMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function UserProfileMenu({ userDetails, menuItems, shouldCloseOnClick, }: UserProfileMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
//# sourceMappingURL=UserProfileMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserProfileMenu.d.ts","sourceRoot":"","sources":["../../src/UserProfileMenu/UserProfileMenu.tsx"],"names":[],"mappings":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B,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,EAAE,CAAC,EAAE,aAAa,CAAC;QACnB,OAAO,CAAC,EAAE,QAAQ,CAAC;KACpB,EAAE,CAAC;IACJ,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,SAAS,EACT,kBAAyB,GAC1B,EAAE,oBAAoB,2CA8ItB"}
|
|
@@ -11,7 +11,7 @@ const isFunction_1 = __importDefault(require("lodash/isFunction"));
|
|
|
11
11
|
const react_1 = require("react");
|
|
12
12
|
const utils_1 = require("../utils");
|
|
13
13
|
const UserProfileMenu_styled_1 = require("./UserProfileMenu.styled");
|
|
14
|
-
function UserProfileMenu({ userDetails, menuItems, }) {
|
|
14
|
+
function UserProfileMenu({ userDetails, menuItems, shouldCloseOnClick = true, }) {
|
|
15
15
|
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
16
16
|
const buttonRef = (0, react_1.useRef)(null);
|
|
17
17
|
const { layout } = (0, utils_1.useGetDeviceType)();
|
|
@@ -58,6 +58,9 @@ function UserProfileMenu({ userDetails, menuItems, }) {
|
|
|
58
58
|
}, children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { padding: "4px 0" }, children: menuItems.map(({ key, divider, label, icon, sx, onClick }) => ((0, jsx_runtime_1.jsxs)(material_1.Box, { children: [divider && (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(material_1.ListItemButton, { onClick: () => {
|
|
59
59
|
if ((0, isFunction_1.default)(onClick)) {
|
|
60
60
|
onClick();
|
|
61
|
+
if (shouldCloseOnClick) {
|
|
62
|
+
handleClose();
|
|
63
|
+
}
|
|
61
64
|
}
|
|
62
65
|
}, children: (icon || label) && ((0, jsx_runtime_1.jsxs)(material_1.Stack, { gap: "16px", alignItems: "center", width: "100%", flexDirection: "row", sx: { ...sx }, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { sx: {
|
|
63
66
|
minWidth: "20px",
|