@bigmath-ui-library/core 2.0.4 → 2.0.5
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/cjs/index.js +79 -115
- package/dist/esm/index.js +79 -115
- package/package.json +1 -1
- package/tsconfig.base.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -309,7 +309,7 @@ const BMAlertDiv = material.styled("div")(({ theme, position, isToast, width, va
|
|
|
309
309
|
borderRadius: theme.shape.borderRadius,
|
|
310
310
|
display: "flex",
|
|
311
311
|
alignItems: "center",
|
|
312
|
-
marginTop: (position
|
|
312
|
+
marginTop: (position ?? 0) * 58,
|
|
313
313
|
width: width === undefined ? "auto" : `${width}px`,
|
|
314
314
|
background: theme.palette[variant === exports.AlertVariant.InProgress ? exports.AlertVariant.Info : variant][100],
|
|
315
315
|
...(isToast && {
|
|
@@ -362,9 +362,9 @@ const BMAlert = (props) => {
|
|
|
362
362
|
};
|
|
363
363
|
const AlertIcon = GetAlertIcon(variant);
|
|
364
364
|
if (isToast) {
|
|
365
|
-
return (jsxRuntime.jsx(material.Snackbar, { open: open, autoHideDuration: autoDismiss
|
|
365
|
+
return (jsxRuntime.jsx(material.Snackbar, { open: open, autoHideDuration: autoDismiss ?? DEFAULT_AUTO_DISMISS_MS, TransitionComponent: material.Fade, anchorOrigin: { vertical: "top", horizontal: "center" }, onClose: handleClose, ...alertProps, children: jsxRuntime.jsxs(BMAlertDiv, { "data-testid": dataTestId, role: "alert", "aria-label": `alert ${variant}`, ...props, children: [icon ?? jsxRuntime.jsx(AlertIcon, {}), jsxRuntime.jsx(BMAlertText, { variant: "body2", children: text }), onClose && jsxRuntime.jsx(BMAlertCloseIcon, { onClick: onClose })] }) }));
|
|
366
366
|
}
|
|
367
|
-
return (jsxRuntime.jsx(material.Fade, { in: open, timeout: transitionTimeout, children: jsxRuntime.jsxs(BMAlertDiv, { role: "alert", "data-testid": dataTestId, "aria-label": `alert ${variant}`, ...props, children: [icon
|
|
367
|
+
return (jsxRuntime.jsx(material.Fade, { in: open, timeout: transitionTimeout, children: jsxRuntime.jsxs(BMAlertDiv, { role: "alert", "data-testid": dataTestId, "aria-label": `alert ${variant}`, ...props, children: [icon ?? jsxRuntime.jsx(AlertIcon, {}), jsxRuntime.jsx(BMAlertText, { children: text }), onClose && jsxRuntime.jsx(BMAlertCloseIcon, { onClick: onClose })] }) }));
|
|
368
368
|
};
|
|
369
369
|
|
|
370
370
|
var _g$l;
|
|
@@ -399,7 +399,7 @@ const BMTooltip$1 = ({ children, smart, ...props }) => {
|
|
|
399
399
|
setFitsContainer(childrenRef.current.scrollWidth <= childrenRef.current.clientWidth);
|
|
400
400
|
}
|
|
401
401
|
}, [smart, childrenRef]);
|
|
402
|
-
return (jsxRuntime.jsx(material.Tooltip, { ref: childrenRef, disableHoverListener: smart ? fitsContainer : false, arrow: true, placement: "top-start", ...props, children: children
|
|
402
|
+
return (jsxRuntime.jsx(material.Tooltip, { ref: childrenRef, disableHoverListener: smart ? fitsContainer : false, arrow: true, placement: "top-start", ...props, children: children ?? (jsxRuntime.jsx(material.Box, { sx: { lineHeight: 0, ml: 0.5 }, children: jsxRuntime.jsx(InfoStyledIcon, {}) })) }));
|
|
403
403
|
};
|
|
404
404
|
|
|
405
405
|
const BMInput$2 = ({ label, tooltip, dataTestId, ...props }) => (jsxRuntime.jsx(material.TextField, { ...props, label: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [label, " ", tooltip && jsxRuntime.jsx(BMTooltip$1, { title: tooltip })] }), variant: "standard", "data-testid": dataTestId }));
|
|
@@ -950,10 +950,9 @@ const HookFormContext = React__namespace.default.createContext(null);
|
|
|
950
950
|
HookFormContext.displayName = 'HookFormContext';
|
|
951
951
|
|
|
952
952
|
const BMInputField$1 = (props) => {
|
|
953
|
-
var _a, _b;
|
|
954
953
|
const { name, rules, defaultValue, control, shouldUnregister, ...bmInputProps } = props;
|
|
955
954
|
const { field: { ref, ...fieldProps }, fieldState, } = useController({ name, rules, defaultValue, control, shouldUnregister });
|
|
956
|
-
return (jsxRuntime.jsx(BMInput$2, { ...fieldProps, ...bmInputProps, inputRef: ref, error: !!fieldState.error, helperText:
|
|
955
|
+
return (jsxRuntime.jsx(BMInput$2, { ...fieldProps, ...bmInputProps, inputRef: ref, error: !!fieldState.error, helperText: fieldState.error?.message ?? bmInputProps.helperText }));
|
|
957
956
|
};
|
|
958
957
|
|
|
959
958
|
var _g$k;
|
|
@@ -1073,10 +1072,9 @@ const EditIconStyled = material.styled(SvgPencil)(() => ({
|
|
|
1073
1072
|
top: 7,
|
|
1074
1073
|
}));
|
|
1075
1074
|
const BMInputEditableCode = ({ content, onSave, tooltip, ...bmInputProps }) => {
|
|
1076
|
-
var _a;
|
|
1077
1075
|
const [isEditing, setIsEditing] = React.useState(false);
|
|
1078
1076
|
const fieldRef = React.useRef(null);
|
|
1079
|
-
const placeholder =
|
|
1077
|
+
const placeholder = bmInputProps.placeholder ?? "";
|
|
1080
1078
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: isEditing ? (jsxRuntime.jsxs(material.Box, { display: "inline-table", position: "relative", children: [jsxRuntime.jsx(material.Box, { sx: {
|
|
1081
1079
|
"& .MuiFormLabel-root": {
|
|
1082
1080
|
display: "none",
|
|
@@ -1091,10 +1089,9 @@ const BMInputEditableCode = ({ content, onSave, tooltip, ...bmInputProps }) => {
|
|
|
1091
1089
|
}
|
|
1092
1090
|
}
|
|
1093
1091
|
}, size: "small", children: jsxRuntime.jsx(SvgCloseCollapse, { viewBox: "-1 -1 17 17" }) }), jsxRuntime.jsx(IconButtonStyled, { onClick: () => {
|
|
1094
|
-
var _a, _b;
|
|
1095
1092
|
setIsEditing(false);
|
|
1096
|
-
onSave(
|
|
1097
|
-
}, size: "small", children: jsxRuntime.jsx(SvgCheck, {}) })] })] })) : (jsxRuntime.jsx(BMTooltip$1, { title: tooltip
|
|
1093
|
+
onSave(fieldRef?.current?.value ?? "");
|
|
1094
|
+
}, size: "small", children: jsxRuntime.jsx(SvgCheck, {}) })] })] })) : (jsxRuntime.jsx(BMTooltip$1, { title: tooltip ?? placeholder, children: jsxRuntime.jsxs(Content, { onClick: () => {
|
|
1098
1095
|
setIsEditing(true);
|
|
1099
1096
|
}, children: [jsxRuntime.jsx("span", { children: content.length ? content : placeholder }), jsxRuntime.jsx("span", { children: jsxRuntime.jsx(EditIconStyled, {}) })] }) })) }));
|
|
1100
1097
|
};
|
|
@@ -1140,15 +1137,12 @@ const BMAutoComplete$1 = ({ bmInputProps, options, getOptionLabel, getOptionDisa
|
|
|
1140
1137
|
deleteIcon: jsxRuntime.jsx(CloseStyledIcon, {}),
|
|
1141
1138
|
},
|
|
1142
1139
|
paper: memoPaperComp,
|
|
1143
|
-
}, "data-testid": dataTestId, renderInput: (params) => {
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
input
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
},
|
|
1150
|
-
} }) }) }));
|
|
1151
|
-
}, ...rest }));
|
|
1140
|
+
}, "data-testid": dataTestId, renderInput: (params) => (jsxRuntime.jsx(BMTooltip$1, { placement: "top-start", title: tooltipText ?? "", children: jsxRuntime.jsx("span", { children: jsxRuntime.jsx(BMInput$2, { dataTestId: `${dataTestId}-input`, ...params, ...bmInputProps, slotProps: {
|
|
1141
|
+
input: {
|
|
1142
|
+
...params.InputProps,
|
|
1143
|
+
...bmInputProps?.slotProps?.input,
|
|
1144
|
+
},
|
|
1145
|
+
} }) }) })), ...rest }));
|
|
1152
1146
|
};
|
|
1153
1147
|
|
|
1154
1148
|
const BMButton$2 = (props) => {
|
|
@@ -1163,7 +1157,7 @@ const BMButton$2 = (props) => {
|
|
|
1163
1157
|
: "primary",
|
|
1164
1158
|
}, thickness: 5 }) }));
|
|
1165
1159
|
}
|
|
1166
|
-
return (jsxRuntime.jsx(Button__default.default, { ...muiButtonProps, size: size, color: color
|
|
1160
|
+
return (jsxRuntime.jsx(Button__default.default, { ...muiButtonProps, size: size, color: color ?? muiButtonProps.color, variant: variant, "data-testid": props.dataTestId }));
|
|
1167
1161
|
};
|
|
1168
1162
|
|
|
1169
1163
|
const BMSplitButton$1 = ({ label, options, menuProps, ButtonComp = BMButton$2, ...props }) => {
|
|
@@ -1178,23 +1172,20 @@ const BMSplitButton$1 = ({ label, options, menuProps, ButtonComp = BMButton$2, .
|
|
|
1178
1172
|
};
|
|
1179
1173
|
return (jsxRuntime.jsxs("div", { style: { display: 'inline-flex', alignItems: 'center' }, children: [jsxRuntime.jsxs(ButtonComp, { onClick: handleDropdownClick, style: { marginLeft: '4px', padding: '0 8px' }, "data-testid": props.dataTestId, ...props, children: [label, jsxRuntime.jsx(ArrowDropDownIcon__default.default, {})] }), jsxRuntime.jsx(material.Menu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, transformOrigin: { vertical: 'top', horizontal: 'right' }, PaperProps: {
|
|
1180
1174
|
style: {
|
|
1181
|
-
width: buttonRef
|
|
1175
|
+
width: buttonRef?.clientWidth
|
|
1182
1176
|
}
|
|
1183
|
-
}, ...menuProps, children: options
|
|
1177
|
+
}, ...menuProps, children: options?.map((option, index) => (jsxRuntime.jsx(material.MenuItem, { onClick: () => {
|
|
1184
1178
|
option.onClick();
|
|
1185
1179
|
handleClose();
|
|
1186
1180
|
}, "data-testid": `${props.dataTestId}-${option.label}`, children: option.label }, index))) })] }));
|
|
1187
1181
|
};
|
|
1188
1182
|
|
|
1189
1183
|
const BMButtonGroup$1 = ({ buttons, className, active, dataTestId, orientation = 'horizontal', }) => {
|
|
1190
|
-
const [activeBut, setActiveBut] = React__namespace.default.useState(active
|
|
1191
|
-
return (jsxRuntime.jsx(material.ButtonGroup, { orientation: orientation, className: className, children: buttons.map((button, index) => {
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
button.onClick();
|
|
1196
|
-
}, ...button.buttonProps, className: `${(_a = button.buttonProps) === null || _a === void 0 ? void 0 : _a.className} ${button.label === activeBut ? 'bm-active' : ''}`, dataTestId: `${dataTestId}-${button.label}`, children: [button.label, (index !== buttons.length - 1 && activeBut !== button.label) && jsxRuntime.jsx("div", { className: "bm-divider" })] }, index) }));
|
|
1197
|
-
}) }));
|
|
1184
|
+
const [activeBut, setActiveBut] = React__namespace.default.useState(active ?? null);
|
|
1185
|
+
return (jsxRuntime.jsx(material.ButtonGroup, { orientation: orientation, className: className, children: buttons.map((button, index) => (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(BMButton$2, { onClick: () => {
|
|
1186
|
+
setActiveBut(button.label);
|
|
1187
|
+
button.onClick();
|
|
1188
|
+
}, ...button.buttonProps, className: `${button.buttonProps?.className} ${button.label === activeBut ? 'bm-active' : ''}`, dataTestId: `${dataTestId}-${button.label}`, children: [button.label, (index !== buttons.length - 1 && activeBut !== button.label) && jsxRuntime.jsx("div", { className: "bm-divider" })] }, index) }))) }));
|
|
1198
1189
|
};
|
|
1199
1190
|
|
|
1200
1191
|
const StyledFormControlLabel = material.styled(material.FormControlLabel)(({ theme }) => ({
|
|
@@ -1329,8 +1320,8 @@ const BMDialog = material.styled(material.Dialog)(({ isSidePanel, overrideWidth,
|
|
|
1329
1320
|
return {
|
|
1330
1321
|
[`& .${material.dialogClasses.paper}`]: {
|
|
1331
1322
|
...modalSize,
|
|
1332
|
-
width: overrideWidth
|
|
1333
|
-
height: overrideHeight
|
|
1323
|
+
width: overrideWidth ?? modalSize.width,
|
|
1324
|
+
height: overrideHeight ?? modalSize.height,
|
|
1334
1325
|
...(isSidePanel && {
|
|
1335
1326
|
width: 736,
|
|
1336
1327
|
height: "100%",
|
|
@@ -1387,7 +1378,6 @@ const CloseButton = material.styled("span")(({ theme }) => ({
|
|
|
1387
1378
|
cursor: "pointer",
|
|
1388
1379
|
}));
|
|
1389
1380
|
const BMModal = (props) => {
|
|
1390
|
-
var _a, _b;
|
|
1391
1381
|
const { title, titleSeparator, titleIcon, actionsInfo, onClose, onSubmit, children, cancelLabel, cancelTestId, submitLabel, submitTestId, enableBackdropDismiss, size, isSidePanel, buttonProps, customTitle, hideCloseBtn, customSubmitButton, submitButtonTooltip, cancelButtonTooltip, dialogContentProps = {}, gradientTag, ...dialogProps } = props;
|
|
1392
1382
|
const handleClose = () => {
|
|
1393
1383
|
if (onClose) {
|
|
@@ -1405,10 +1395,10 @@ const BMModal = (props) => {
|
|
|
1405
1395
|
if (isSidePanel) {
|
|
1406
1396
|
dialogProps.TransitionComponent = SlideTransition;
|
|
1407
1397
|
}
|
|
1408
|
-
const submitBtnProps =
|
|
1409
|
-
const cancelBtnProps =
|
|
1398
|
+
const submitBtnProps = buttonProps?.primary ?? {};
|
|
1399
|
+
const cancelBtnProps = buttonProps?.secondary ?? {};
|
|
1410
1400
|
const getCancelButton = () => {
|
|
1411
|
-
const returnComponent = cancelLabel ? (jsxRuntime.jsx(BMButton$2, { variant: "secondary", onClick: handleClose, ...cancelBtnProps, dataTestId: cancelTestId
|
|
1401
|
+
const returnComponent = cancelLabel ? (jsxRuntime.jsx(BMButton$2, { variant: "secondary", onClick: handleClose, ...cancelBtnProps, dataTestId: cancelTestId ?? 'modal-cancel-button', children: cancelLabel })) : undefined;
|
|
1412
1402
|
if (cancelButtonTooltip) {
|
|
1413
1403
|
return (jsxRuntime.jsx(BMTooltip$1, { title: cancelButtonTooltip, children: jsxRuntime.jsx("span", { children: returnComponent }) }));
|
|
1414
1404
|
}
|
|
@@ -1417,7 +1407,7 @@ const BMModal = (props) => {
|
|
|
1417
1407
|
const getSubmitButton = () => {
|
|
1418
1408
|
if (customSubmitButton)
|
|
1419
1409
|
return customSubmitButton;
|
|
1420
|
-
const returnComponent = submitLabel ? (jsxRuntime.jsx(BMButton$2, { variant: "primary", onClick: handleSubmitBtnClick, ...submitBtnProps, type: "submit", autoFocus: true, dataTestId: submitTestId
|
|
1410
|
+
const returnComponent = submitLabel ? (jsxRuntime.jsx(BMButton$2, { variant: "primary", onClick: handleSubmitBtnClick, ...submitBtnProps, type: "submit", autoFocus: true, dataTestId: submitTestId ?? 'modal-submit-button', children: submitLabel })) : undefined;
|
|
1421
1411
|
if (submitButtonTooltip) {
|
|
1422
1412
|
return (jsxRuntime.jsx(BMTooltip$1, { title: submitButtonTooltip, children: jsxRuntime.jsx("span", { children: returnComponent }) }));
|
|
1423
1413
|
}
|
|
@@ -18732,8 +18722,8 @@ const EntryWrapper = material.styled(material.Paper, {
|
|
|
18732
18722
|
gap: theme.spacing(0.5),
|
|
18733
18723
|
padding: theme.spacing(0.5, 0.5, 0, 0.875),
|
|
18734
18724
|
minHeight: 40,
|
|
18735
|
-
height: overrideHeight
|
|
18736
|
-
width: overrideWidth
|
|
18725
|
+
height: overrideHeight ?? "auto",
|
|
18726
|
+
width: overrideWidth ?? "100%",
|
|
18737
18727
|
overflowY: "auto",
|
|
18738
18728
|
overflowX: "hidden",
|
|
18739
18729
|
cursor: "text",
|
|
@@ -18791,18 +18781,17 @@ const ErrorIconStyled = material.styled(SvgFailedSolid)(({ theme }) => ({
|
|
|
18791
18781
|
},
|
|
18792
18782
|
}));
|
|
18793
18783
|
const BMMultiEntry = ({ tooltipFn, onChange, checkWarning, label, placeholderText, value, error, helperText, chipIcon, dataTestId, disabled, lowercaseEntry = false, overrideHeight, overrideWidth, subLabel, removeInvalidEntriesMsg, multiEntryHitEnterMsg, }) => {
|
|
18794
|
-
var _a, _b, _c, _d, _e, _f;
|
|
18795
18784
|
const textInputRef = React.useRef(null);
|
|
18796
18785
|
const [fieldInFocus, setFieldInFocus] = React.useState(false);
|
|
18797
18786
|
const errorArr = Array.isArray(error) ? error : [];
|
|
18798
18787
|
const entries = Array.isArray(value)
|
|
18799
18788
|
? value.map((item) => (lowercaseEntry ? item.toLowerCase() : item))
|
|
18800
|
-
: (value
|
|
18789
|
+
: (value ?? "")
|
|
18801
18790
|
.split(/[ ,]+/)
|
|
18802
18791
|
.map((item) => (lowercaseEntry ? item.toLowerCase() : item));
|
|
18803
18792
|
const updateEntries = (items) => {
|
|
18804
18793
|
const updated = items.map((item) => lowercaseEntry ? item.toLowerCase() : item);
|
|
18805
|
-
onChange
|
|
18794
|
+
onChange?.(updated);
|
|
18806
18795
|
};
|
|
18807
18796
|
const handleDelete = (entry) => {
|
|
18808
18797
|
updateEntries(entries.filter((e) => e !== entry));
|
|
@@ -18848,16 +18837,14 @@ const BMMultiEntry = ({ tooltipFn, onChange, checkWarning, label, placeholderTex
|
|
|
18848
18837
|
return undefined;
|
|
18849
18838
|
};
|
|
18850
18839
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [label && jsxRuntime.jsx(Label, { children: label }), jsxRuntime.jsxs(EntryWrapper, { onClick: () => {
|
|
18851
|
-
var _a;
|
|
18852
18840
|
setFieldInFocus(true);
|
|
18853
|
-
|
|
18841
|
+
textInputRef.current?.focus();
|
|
18854
18842
|
}, "data-testid": dataTestId, focus: fieldInFocus, overrideHeight: overrideHeight, overrideWidth: overrideWidth, children: [entries.map((entry, index) => {
|
|
18855
|
-
var _a, _b, _c;
|
|
18856
18843
|
const invalid = errorArr[index];
|
|
18857
|
-
const tooltip =
|
|
18858
|
-
const warning =
|
|
18844
|
+
const tooltip = invalid?.message ?? tooltipFn?.(entry) ?? undefined;
|
|
18845
|
+
const warning = checkWarning?.(entry) ?? false;
|
|
18859
18846
|
const ChipComp = warning ? WarningChip : StyledChip$1;
|
|
18860
|
-
return (jsxRuntime.jsx(BMTooltip$1, { title: tooltip
|
|
18847
|
+
return (jsxRuntime.jsx(BMTooltip$1, { title: tooltip ?? "", children: jsxRuntime.jsx(ChipComp, { label: entry, icon: getChipIcon(entry, invalid), deleteIcon: jsxRuntime.jsx(CloseIconStyled, {}), onDelete: () => handleDelete(entry), clickable: true, onClick: () => handleClick(entry) }) }, `${entry}-tooltip`));
|
|
18861
18848
|
}), jsxRuntime.jsx(TextInput, { inputRef: textInputRef, placeholder: placeholderText, disabled: disabled, onKeyDown: (e) => {
|
|
18862
18849
|
if (e.key === "Backspace")
|
|
18863
18850
|
handleBackspace(e);
|
|
@@ -18869,7 +18856,7 @@ const BMMultiEntry = ({ tooltipFn, onChange, checkWarning, label, placeholderTex
|
|
|
18869
18856
|
fontSize: "11.5px",
|
|
18870
18857
|
fontWeight: 400,
|
|
18871
18858
|
}, children: subLabel })), error &&
|
|
18872
|
-
(
|
|
18859
|
+
(textInputRef.current?.value?.length ?? 0) === 0 &&
|
|
18873
18860
|
helperText && (jsxRuntime.jsx(material.FormHelperText, { error: true, sx: {
|
|
18874
18861
|
mt: 1,
|
|
18875
18862
|
fontSize: "11.5px",
|
|
@@ -18879,7 +18866,7 @@ const BMMultiEntry = ({ tooltipFn, onChange, checkWarning, label, placeholderTex
|
|
|
18879
18866
|
fontSize: "11.5px",
|
|
18880
18867
|
fontWeight: 400,
|
|
18881
18868
|
}, error: true, children: removeInvalidEntriesMsg })), error &&
|
|
18882
|
-
(
|
|
18869
|
+
(textInputRef.current?.value?.length ?? 0) > 0 &&
|
|
18883
18870
|
multiEntryHitEnterMsg && (jsxRuntime.jsx(material.FormHelperText, { error: true, sx: {
|
|
18884
18871
|
mt: 1,
|
|
18885
18872
|
fontSize: "11.5px",
|
|
@@ -18888,7 +18875,6 @@ const BMMultiEntry = ({ tooltipFn, onChange, checkWarning, label, placeholderTex
|
|
|
18888
18875
|
};
|
|
18889
18876
|
|
|
18890
18877
|
const BMMultiEntryField = (props) => {
|
|
18891
|
-
var _a, _b;
|
|
18892
18878
|
const { name, rules, defaultValue, control, shouldUnregister, placeholderText, chipIcon, dataTestId, ...restInputProps } = props;
|
|
18893
18879
|
const { field, fieldState } = useController({
|
|
18894
18880
|
name,
|
|
@@ -18897,7 +18883,7 @@ const BMMultiEntryField = (props) => {
|
|
|
18897
18883
|
control,
|
|
18898
18884
|
shouldUnregister,
|
|
18899
18885
|
});
|
|
18900
|
-
return (jsxRuntime.jsx(BMMultiEntry, { ...restInputProps, label: props
|
|
18886
|
+
return (jsxRuntime.jsx(BMMultiEntry, { ...restInputProps, label: props?.label, onChange: field.onChange, value: field.value, error: fieldState.error, chipIcon: chipIcon, helperText: fieldState.error?.message ?? "", placeholderText: placeholderText, dataTestId: dataTestId }));
|
|
18901
18887
|
};
|
|
18902
18888
|
|
|
18903
18889
|
var _path$k;
|
|
@@ -19036,7 +19022,6 @@ const BMPassword = (props) => {
|
|
|
19036
19022
|
};
|
|
19037
19023
|
|
|
19038
19024
|
const BMPasswordField = (props) => {
|
|
19039
|
-
var _a, _b;
|
|
19040
19025
|
const inputElement = React.useRef(null);
|
|
19041
19026
|
const { name, rules, defaultValue, control, shouldUnregister, ...bmInputProps } = props;
|
|
19042
19027
|
const { field: { ref, value, ...fieldProps }, fieldState, } = useController({ name, rules, defaultValue, control, shouldUnregister });
|
|
@@ -19050,7 +19035,7 @@ const BMPasswordField = (props) => {
|
|
|
19050
19035
|
return (jsxRuntime.jsx(BMPassword, { ...fieldProps, ...bmInputProps, inputRef: (element) => {
|
|
19051
19036
|
inputElement.current = element;
|
|
19052
19037
|
ref(element);
|
|
19053
|
-
}, error: !!fieldState.error, helperText:
|
|
19038
|
+
}, error: !!fieldState.error, helperText: fieldState.error?.message ?? bmInputProps.helperText }));
|
|
19054
19039
|
};
|
|
19055
19040
|
|
|
19056
19041
|
const BMProgressBar = material.styled(material.LinearProgress)(({ theme, color }) => ({
|
|
@@ -19149,7 +19134,6 @@ const BMRadioGroup = ({ label, options = [], orientation = exports.RadioOrientat
|
|
|
19149
19134
|
};
|
|
19150
19135
|
|
|
19151
19136
|
const BMRadioGroupField = (props) => {
|
|
19152
|
-
var _a;
|
|
19153
19137
|
const { name, control, rules, defaultValue, shouldUnregister, ...restProps } = props;
|
|
19154
19138
|
const { field } = useController({
|
|
19155
19139
|
name,
|
|
@@ -19158,7 +19142,7 @@ const BMRadioGroupField = (props) => {
|
|
|
19158
19142
|
defaultValue,
|
|
19159
19143
|
shouldUnregister,
|
|
19160
19144
|
});
|
|
19161
|
-
return (jsxRuntime.jsx(BMRadioGroup, { name: field.name, value:
|
|
19145
|
+
return (jsxRuntime.jsx(BMRadioGroup, { name: field.name, value: field.value ?? "", onChange: field.onChange, onBlur: field.onBlur, label: restProps.label, orientation: restProps.orientation, className: restProps.className, ...restProps }));
|
|
19162
19146
|
};
|
|
19163
19147
|
|
|
19164
19148
|
const BMSelect = ({ label, tooltip, renderValue, menuProps, selectProps = {}, dataTestId, ...props }) => (jsxRuntime.jsx(material.TextField, { ...props, label: label ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [label, " ", tooltip && jsxRuntime.jsx(BMTooltip$1, { title: tooltip })] })) : null // don't render <Label> if it's empty
|
|
@@ -19179,10 +19163,9 @@ const BMSelect = ({ label, tooltip, renderValue, menuProps, selectProps = {}, da
|
|
|
19179
19163
|
}, variant: "standard" }));
|
|
19180
19164
|
|
|
19181
19165
|
const BMSelectField = (props) => {
|
|
19182
|
-
var _a;
|
|
19183
19166
|
const { name, rules, defaultValue, control, shouldUnregister, children, helperText, ...bmSelectProps } = props;
|
|
19184
19167
|
const { field: { onChange, onBlur, value, name: fieldName, ref }, fieldState: { error }, } = useController({ name, rules, defaultValue, control, shouldUnregister });
|
|
19185
|
-
return (jsxRuntime.jsx(BMSelect, { ...bmSelectProps, name: fieldName, value: value, onChange: onChange, onBlur: onBlur, inputRef: ref, error: !!error, helperText:
|
|
19168
|
+
return (jsxRuntime.jsx(BMSelect, { ...bmSelectProps, name: fieldName, value: value, onChange: onChange, onBlur: onBlur, inputRef: ref, error: !!error, helperText: error?.message ?? helperText, children: children }));
|
|
19186
19169
|
};
|
|
19187
19170
|
|
|
19188
19171
|
const BMToggle$1 = ({ label, formControlLabelProps, ...switchProps }) => {
|
|
@@ -19235,10 +19218,7 @@ const BMMultiToggleButton = ({ options, value, onChange, dense, ...rest }) => {
|
|
|
19235
19218
|
if (newValue !== null) {
|
|
19236
19219
|
onChange(newValue);
|
|
19237
19220
|
}
|
|
19238
|
-
}, ...rest, children: options.map((option) => {
|
|
19239
|
-
var _a;
|
|
19240
|
-
return (jsxRuntime.jsx(StyledToggleButton, { value: option.value, "data-testid": (_a = option.dataTestId) !== null && _a !== void 0 ? _a : `${option.label}ToggleButton`, children: option.label }, String(option.value)));
|
|
19241
|
-
}) }));
|
|
19221
|
+
}, ...rest, children: options.map((option) => (jsxRuntime.jsx(StyledToggleButton, { value: option.value, "data-testid": option.dataTestId ?? `${option.label}ToggleButton`, children: option.label }, String(option.value)))) }));
|
|
19242
19222
|
};
|
|
19243
19223
|
|
|
19244
19224
|
const Panel = material.styled('div')(({ theme }) => ({
|
|
@@ -19434,10 +19414,7 @@ const Circle = material.styled(SvgCircleUnselected)(({ theme }) => ({
|
|
|
19434
19414
|
color: theme.palette.grey[600]
|
|
19435
19415
|
}));
|
|
19436
19416
|
const BMCloudSelect = ({ overrideOptionWidth, options, value, onChange }) => {
|
|
19437
|
-
return (jsxRuntime.jsx(material.Box, { display: "flex", alignItems: "center", flexWrap: "wrap", rowGap: 1, children: options.map((item) => {
|
|
19438
|
-
var _a;
|
|
19439
|
-
return (jsxRuntime.jsxs(Card, { "data-testid": (_a = item.dataTestId) !== null && _a !== void 0 ? _a : item.value, onClick: () => onChange(item.value), selected: value === item.value, visible: item.visible, style: { width: overrideOptionWidth }, children: [jsxRuntime.jsxs(material.Box, { display: "flex", alignItems: "center", children: [jsxRuntime.jsx(IconLogo, { children: item.icon }), jsxRuntime.jsx(material.Typography, { variant: "body1", children: item.label })] }), value === item.value ? (jsxRuntime.jsx(CircleCheckIcon, {})) : (jsxRuntime.jsx(Circle, {}))] }, String(item.value)));
|
|
19440
|
-
}) }));
|
|
19417
|
+
return (jsxRuntime.jsx(material.Box, { display: "flex", alignItems: "center", flexWrap: "wrap", rowGap: 1, children: options.map((item) => (jsxRuntime.jsxs(Card, { "data-testid": item.dataTestId ?? item.value, onClick: () => onChange(item.value), selected: value === item.value, visible: item.visible, style: { width: overrideOptionWidth }, children: [jsxRuntime.jsxs(material.Box, { display: "flex", alignItems: "center", children: [jsxRuntime.jsx(IconLogo, { children: item.icon }), jsxRuntime.jsx(material.Typography, { variant: "body1", children: item.label })] }), value === item.value ? (jsxRuntime.jsx(CircleCheckIcon, {})) : (jsxRuntime.jsx(Circle, {}))] }, String(item.value)))) }));
|
|
19441
19418
|
};
|
|
19442
19419
|
|
|
19443
19420
|
const StyledLabel = material.styled(material.InputLabel)(({ theme }) => ({
|
|
@@ -34509,9 +34486,9 @@ const MAX_ZOOM_VAL = 5;
|
|
|
34509
34486
|
const MapBox = material.styled('div')(({ theme, mapHeight, mapWidth }) => ({
|
|
34510
34487
|
borderRadius: theme.spacing(1),
|
|
34511
34488
|
border: `1px solid ${theme.palette.grey[200]}`,
|
|
34512
|
-
width: mapWidth
|
|
34489
|
+
width: mapWidth ?? '100%',
|
|
34513
34490
|
'& .leaflet-container': {
|
|
34514
|
-
width: mapWidth
|
|
34491
|
+
width: mapWidth ?? '100%',
|
|
34515
34492
|
height: `${mapHeight}px`,
|
|
34516
34493
|
},
|
|
34517
34494
|
overflow: 'hidden'
|
|
@@ -70402,9 +70379,8 @@ const BMDropdown = ({ children, position = "bottom", growDirection, origin, keep
|
|
|
70402
70379
|
event.stopPropagation();
|
|
70403
70380
|
};
|
|
70404
70381
|
const handleClose = (event) => {
|
|
70405
|
-
var _a;
|
|
70406
70382
|
setAnchorEl(null);
|
|
70407
|
-
|
|
70383
|
+
event.stopPropagation?.();
|
|
70408
70384
|
};
|
|
70409
70385
|
const handleMenuClick = (event) => {
|
|
70410
70386
|
if (!keepOpenOnSelect) {
|
|
@@ -70438,7 +70414,7 @@ const BMDropdown = ({ children, position = "bottom", growDirection, origin, keep
|
|
|
70438
70414
|
horizontal: "left",
|
|
70439
70415
|
};
|
|
70440
70416
|
}
|
|
70441
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(BMTooltip$1, { title: tooltip
|
|
70417
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(BMTooltip$1, { title: tooltip ?? "", placement: "top", children: jsxRuntime.jsx(OriginWrapper, { onClick: handleClick, className: className, "data-testid": dataTestId, children: typeof origin === "function" ? origin(open) : origin }) }), jsxRuntime.jsx(material.Menu, { open: open, anchorEl: anchorEl, disableAutoFocusItem: true, onClose: handleClose, onClick: handleMenuClick, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, ...menuProps, children: children })] }));
|
|
70442
70418
|
};
|
|
70443
70419
|
|
|
70444
70420
|
const BMAvatarSizeMap = {
|
|
@@ -70448,7 +70424,7 @@ const BMAvatarSizeMap = {
|
|
|
70448
70424
|
};
|
|
70449
70425
|
|
|
70450
70426
|
const getSizeDimension = (_, size) => {
|
|
70451
|
-
return BMAvatarSizeMap[size] ||
|
|
70427
|
+
return BMAvatarSizeMap[size] || BMAvatarSizeMap?.medium;
|
|
70452
70428
|
};
|
|
70453
70429
|
const StyledImage = styles.styled("img")(({ theme, size }) => {
|
|
70454
70430
|
const dimension = getSizeDimension(theme, size);
|
|
@@ -70541,9 +70517,8 @@ const StyledChip = material.styled(material.Chip)(({ theme, $size = "md", $varia
|
|
|
70541
70517
|
},
|
|
70542
70518
|
}[$size];
|
|
70543
70519
|
const getVariantStyles = () => {
|
|
70544
|
-
var _a, _b, _c;
|
|
70545
70520
|
let gradientStyles;
|
|
70546
|
-
if (!$noGradient && !
|
|
70521
|
+
if (!$noGradient && !props?.customColor) {
|
|
70547
70522
|
gradientStyles = {
|
|
70548
70523
|
background: "linear-gradient(282.49deg, #ed35c5 0.48%, #7879f1 93.17%)",
|
|
70549
70524
|
WebkitTextFillColor: "transparent",
|
|
@@ -70552,11 +70527,11 @@ const StyledChip = material.styled(material.Chip)(({ theme, $size = "md", $varia
|
|
|
70552
70527
|
};
|
|
70553
70528
|
}
|
|
70554
70529
|
// If custom colors are provided, use them instead of variants
|
|
70555
|
-
if (props
|
|
70530
|
+
if (props?.customColor) {
|
|
70556
70531
|
return {
|
|
70557
|
-
background:
|
|
70558
|
-
color:
|
|
70559
|
-
border:
|
|
70532
|
+
background: props.customColor?.background || theme.palette.common.white,
|
|
70533
|
+
color: props.customColor?.color || theme.palette.grey[900],
|
|
70534
|
+
border: props.customColor?.border || `1px solid ${theme.palette.grey[300]}`,
|
|
70560
70535
|
};
|
|
70561
70536
|
}
|
|
70562
70537
|
const variantColors = {
|
|
@@ -70779,7 +70754,7 @@ const BMPagination = ({ pageSize = 4, onPageSelect, currentPage, hasMore, dataTe
|
|
|
70779
70754
|
setPage(newPage);
|
|
70780
70755
|
onPageSelect(newPage);
|
|
70781
70756
|
}, "data-testid": dataTestId, renderItem: (params) => {
|
|
70782
|
-
if (
|
|
70757
|
+
if (params?.type === "next" && hasMore) {
|
|
70783
70758
|
return (jsxRuntime.jsxs(material.Box, { component: "span", display: "flex", alignItems: "center", children: [jsxRuntime.jsx(material.PaginationItem, { ...params, "aria-label": "Go to end-ellipsis page", color: "standard", shape: "rounded", size: "medium", type: "end-ellipsis", variant: "text", sx: { display: "inline-flex", minWidth: 16 } }), jsxRuntime.jsx(material.PaginationItem, { ...params })] }));
|
|
70784
70759
|
}
|
|
70785
70760
|
return jsxRuntime.jsx(material.PaginationItem, { ...params });
|
|
@@ -70877,7 +70852,7 @@ const LoadingSection = material.styled(material.Box)(({ theme }) => ({
|
|
|
70877
70852
|
padding: theme.spacing(2, 0),
|
|
70878
70853
|
}));
|
|
70879
70854
|
const BMAddSection = ({ title, body, bodyVariant, controls, }) => {
|
|
70880
|
-
return (jsxRuntime.jsx(LoadingSection, { children: jsxRuntime.jsxs(BMLoadingBox, { children: [title && (jsxRuntime.jsx(material.Box, { sx: { mt: 1, mb: 2 }, children: jsxRuntime.jsx(material.Typography, { variant: "h2", children: title }) })), jsxRuntime.jsx(material.Box, { sx: { mb: controls ? 2 : 0 }, children: jsxRuntime.jsx(material.Typography, { variant: bodyVariant
|
|
70855
|
+
return (jsxRuntime.jsx(LoadingSection, { children: jsxRuntime.jsxs(BMLoadingBox, { children: [title && (jsxRuntime.jsx(material.Box, { sx: { mt: 1, mb: 2 }, children: jsxRuntime.jsx(material.Typography, { variant: "h2", children: title }) })), jsxRuntime.jsx(material.Box, { sx: { mb: controls ? 2 : 0 }, children: jsxRuntime.jsx(material.Typography, { variant: bodyVariant ?? "body2", children: body }) }), controls] }) }));
|
|
70881
70856
|
};
|
|
70882
70857
|
|
|
70883
70858
|
const Root = material.styled(material.Box)(({ theme }) => ({
|
|
@@ -132920,16 +132895,15 @@ const BMCodeBlock = ({ showCopyButton, multiBlock, text, codeClassName, preClass
|
|
|
132920
132895
|
const expandableBox = React.useRef(null);
|
|
132921
132896
|
const [expanded, setExpanded] = React.useState(!enabledExpandCollapse);
|
|
132922
132897
|
const [showToggle, setShowToggle] = React.useState(false);
|
|
132923
|
-
const syntaxLanguage = lang
|
|
132898
|
+
const syntaxLanguage = lang ?? "language-plaintext";
|
|
132924
132899
|
React.useEffect(() => {
|
|
132925
132900
|
HighlightJS.highlightAll();
|
|
132926
132901
|
}, [text]);
|
|
132927
132902
|
const didMountRef = React.useRef(false);
|
|
132928
132903
|
React.useEffect(() => {
|
|
132929
|
-
var _a;
|
|
132930
132904
|
if (didMountRef.current) {
|
|
132931
|
-
if (expanded &&
|
|
132932
|
-
|
|
132905
|
+
if (expanded && expandableBox?.current) {
|
|
132906
|
+
expandableBox?.current?.scrollTo({ top: 0 });
|
|
132933
132907
|
}
|
|
132934
132908
|
}
|
|
132935
132909
|
else {
|
|
@@ -132937,30 +132911,27 @@ const BMCodeBlock = ({ showCopyButton, multiBlock, text, codeClassName, preClass
|
|
|
132937
132911
|
}
|
|
132938
132912
|
}, [expanded]);
|
|
132939
132913
|
React.useLayoutEffect(() => {
|
|
132940
|
-
|
|
132941
|
-
if (expandableBox === null || expandableBox === void 0 ? void 0 : expandableBox.current) {
|
|
132914
|
+
if (expandableBox?.current) {
|
|
132942
132915
|
setShowToggle(enabledExpandCollapse &&
|
|
132943
|
-
Math.round(
|
|
132916
|
+
Math.round(expandableBox?.current?.clientHeight ?? 0) > collapseHeight);
|
|
132944
132917
|
}
|
|
132945
132918
|
}, [collapseHeight, enabledExpandCollapse]);
|
|
132946
132919
|
const copy = async (value) => {
|
|
132947
132920
|
try {
|
|
132948
132921
|
await navigator.clipboard.writeText(value);
|
|
132949
|
-
onCopySuccess
|
|
132922
|
+
onCopySuccess?.();
|
|
132950
132923
|
}
|
|
132951
132924
|
catch (err) {
|
|
132952
132925
|
console.error("Failed to copy:", err);
|
|
132953
132926
|
}
|
|
132954
132927
|
};
|
|
132955
132928
|
const copyBlock = () => {
|
|
132956
|
-
|
|
132957
|
-
const text = (_b = (_a = preRef.current) === null || _a === void 0 ? void 0 : _a.innerText) === null || _b === void 0 ? void 0 : _b.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/g, "$'");
|
|
132929
|
+
const text = preRef.current?.innerText?.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/g, "$'");
|
|
132958
132930
|
if (text)
|
|
132959
132931
|
copy(text);
|
|
132960
132932
|
};
|
|
132961
132933
|
const copyLineBlock = async (ev) => {
|
|
132962
|
-
|
|
132963
|
-
const line = (_b = (_a = ev.currentTarget.previousSibling) === null || _a === void 0 ? void 0 : _a.innerText) === null || _b === void 0 ? void 0 : _b.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/g, "$'");
|
|
132934
|
+
const line = ev.currentTarget.previousSibling?.innerText?.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/g, "$'");
|
|
132964
132935
|
if (line)
|
|
132965
132936
|
await copy(line);
|
|
132966
132937
|
};
|
|
@@ -133107,10 +133078,9 @@ const StyledPaper = styles.styled(material.Paper, {
|
|
|
133107
133078
|
color: theme.palette.text.primary,
|
|
133108
133079
|
}));
|
|
133109
133080
|
const BMTable = ({ tableTitle, selectableRows = "none", data, columns, withBorder = true, dataTestId, options, customHeaderRenderer, ...rest }) => {
|
|
133110
|
-
var _a, _b;
|
|
133111
133081
|
const theme = material.useTheme();
|
|
133112
|
-
const tablePropsFromOptions =
|
|
133113
|
-
const getRowId = (row) =>
|
|
133082
|
+
const tablePropsFromOptions = options?.setTableProps?.() ?? {};
|
|
133083
|
+
const getRowId = (row) => row.id ?? JSON.stringify(row);
|
|
133114
133084
|
const getCheckboxSelection = () => selectableRows === "multiple" ? true : undefined;
|
|
133115
133085
|
const getIsRowSelectable = () => selectableRows === "none" ? () => false : undefined;
|
|
133116
133086
|
const columnsWithCustomHeader = React__namespace.useMemo(() => {
|
|
@@ -133147,7 +133117,7 @@ const BMTable = ({ tableTitle, selectableRows = "none", data, columns, withBorde
|
|
|
133147
133117
|
backgroundColor: theme.palette.background.paper,
|
|
133148
133118
|
color: theme.palette.text.secondary,
|
|
133149
133119
|
},
|
|
133150
|
-
}, getRowId: getRowId, ...tablePropsFromOptions, disableRowSelectionOnClick: !
|
|
133120
|
+
}, getRowId: getRowId, ...tablePropsFromOptions, disableRowSelectionOnClick: !options?.selectableRowsOnClick, ...rest })] }));
|
|
133151
133121
|
};
|
|
133152
133122
|
|
|
133153
133123
|
const BMButton$1 = {
|
|
@@ -133344,7 +133314,7 @@ const BMInput$1 = {
|
|
|
133344
133314
|
fontWeight: 400,
|
|
133345
133315
|
fontSize: 13,
|
|
133346
133316
|
"&::placeholder": {
|
|
133347
|
-
color:
|
|
133317
|
+
color: ownerState?.error ? theme.palette.error[500] : colors.grey[600],
|
|
133348
133318
|
},
|
|
133349
133319
|
'&.Mui-disabled': {
|
|
133350
133320
|
pointerEvents: 'none',
|
|
@@ -133644,7 +133614,6 @@ const BMFormHelperText = {
|
|
|
133644
133614
|
}
|
|
133645
133615
|
};
|
|
133646
133616
|
|
|
133647
|
-
var _a$2;
|
|
133648
133617
|
const BMTabs = {
|
|
133649
133618
|
styleOverrides: {
|
|
133650
133619
|
indicator: {
|
|
@@ -133655,7 +133624,7 @@ const BMTabs = {
|
|
|
133655
133624
|
}
|
|
133656
133625
|
},
|
|
133657
133626
|
fixed: {
|
|
133658
|
-
boxShadow: `inset 0 -1px ${
|
|
133627
|
+
boxShadow: `inset 0 -1px ${colors.grey[300]}`
|
|
133659
133628
|
},
|
|
133660
133629
|
root: {
|
|
133661
133630
|
// custom "pill" style for vertical tabs
|
|
@@ -133987,7 +133956,6 @@ const getOverrideContents = (fn, theme) => {
|
|
|
133987
133956
|
}
|
|
133988
133957
|
};
|
|
133989
133958
|
|
|
133990
|
-
var _a$1, _b, _c, _d;
|
|
133991
133959
|
const BMAInput = {
|
|
133992
133960
|
defaultProps: {
|
|
133993
133961
|
disableUnderline: true,
|
|
@@ -133996,7 +133964,7 @@ const BMAInput = {
|
|
|
133996
133964
|
styleOverrides: {
|
|
133997
133965
|
root: {
|
|
133998
133966
|
variants: [
|
|
133999
|
-
...
|
|
133967
|
+
...coreTheme.components?.MuiInput?.styleOverrides?.root?.variants,
|
|
134000
133968
|
{
|
|
134001
133969
|
props: { size: 'large', multiline: false },
|
|
134002
133970
|
style: {
|
|
@@ -134013,26 +133981,22 @@ const BMInputLabel = {
|
|
|
134013
133981
|
},
|
|
134014
133982
|
styleOverrides: {
|
|
134015
133983
|
// biome-ignore lint: TODO for any
|
|
134016
|
-
root: ({ theme }) => {
|
|
134017
|
-
|
|
134018
|
-
|
|
134019
|
-
|
|
134020
|
-
|
|
134021
|
-
|
|
134022
|
-
|
|
134023
|
-
fontWeight: 500
|
|
134024
|
-
});
|
|
134025
|
-
},
|
|
133984
|
+
root: ({ theme }) => ({
|
|
133985
|
+
// ...(theme.components.MuiInputLabel.styleOverrides.root?.({ theme }) ?? {}),
|
|
133986
|
+
...getOverrideContents(coreTheme.components?.MuiInputLabel?.styleOverrides?.root, theme),
|
|
133987
|
+
// textTransform: 'lowercase',
|
|
133988
|
+
fontSize: theme.typography.body1.fontSize,
|
|
133989
|
+
fontWeight: 500
|
|
133990
|
+
}),
|
|
134026
133991
|
},
|
|
134027
133992
|
};
|
|
134028
133993
|
|
|
134029
|
-
var _a;
|
|
134030
133994
|
const BMAAutoComplete = {
|
|
134031
133995
|
...BMAutoComplete,
|
|
134032
133996
|
styleOverrides: {
|
|
134033
|
-
...BMAutoComplete
|
|
133997
|
+
...BMAutoComplete?.styleOverrides,
|
|
134034
133998
|
inputRoot: {
|
|
134035
|
-
...
|
|
133999
|
+
...BMAutoComplete?.styleOverrides?.inputRoot,
|
|
134036
134000
|
height: 40,
|
|
134037
134001
|
},
|
|
134038
134002
|
},
|
package/dist/esm/index.js
CHANGED
|
@@ -280,7 +280,7 @@ const BMAlertDiv = styled("div")(({ theme, position, isToast, width, variant = A
|
|
|
280
280
|
borderRadius: theme.shape.borderRadius,
|
|
281
281
|
display: "flex",
|
|
282
282
|
alignItems: "center",
|
|
283
|
-
marginTop: (position
|
|
283
|
+
marginTop: (position ?? 0) * 58,
|
|
284
284
|
width: width === undefined ? "auto" : `${width}px`,
|
|
285
285
|
background: theme.palette[variant === AlertVariant.InProgress ? AlertVariant.Info : variant][100],
|
|
286
286
|
...(isToast && {
|
|
@@ -333,9 +333,9 @@ const BMAlert = (props) => {
|
|
|
333
333
|
};
|
|
334
334
|
const AlertIcon = GetAlertIcon(variant);
|
|
335
335
|
if (isToast) {
|
|
336
|
-
return (jsx(Snackbar, { open: open, autoHideDuration: autoDismiss
|
|
336
|
+
return (jsx(Snackbar, { open: open, autoHideDuration: autoDismiss ?? DEFAULT_AUTO_DISMISS_MS, TransitionComponent: Fade, anchorOrigin: { vertical: "top", horizontal: "center" }, onClose: handleClose, ...alertProps, children: jsxs(BMAlertDiv, { "data-testid": dataTestId, role: "alert", "aria-label": `alert ${variant}`, ...props, children: [icon ?? jsx(AlertIcon, {}), jsx(BMAlertText, { variant: "body2", children: text }), onClose && jsx(BMAlertCloseIcon, { onClick: onClose })] }) }));
|
|
337
337
|
}
|
|
338
|
-
return (jsx(Fade, { in: open, timeout: transitionTimeout, children: jsxs(BMAlertDiv, { role: "alert", "data-testid": dataTestId, "aria-label": `alert ${variant}`, ...props, children: [icon
|
|
338
|
+
return (jsx(Fade, { in: open, timeout: transitionTimeout, children: jsxs(BMAlertDiv, { role: "alert", "data-testid": dataTestId, "aria-label": `alert ${variant}`, ...props, children: [icon ?? jsx(AlertIcon, {}), jsx(BMAlertText, { children: text }), onClose && jsx(BMAlertCloseIcon, { onClick: onClose })] }) }));
|
|
339
339
|
};
|
|
340
340
|
|
|
341
341
|
var _g$l;
|
|
@@ -370,7 +370,7 @@ const BMTooltip$1 = ({ children, smart, ...props }) => {
|
|
|
370
370
|
setFitsContainer(childrenRef.current.scrollWidth <= childrenRef.current.clientWidth);
|
|
371
371
|
}
|
|
372
372
|
}, [smart, childrenRef]);
|
|
373
|
-
return (jsx(Tooltip$1, { ref: childrenRef, disableHoverListener: smart ? fitsContainer : false, arrow: true, placement: "top-start", ...props, children: children
|
|
373
|
+
return (jsx(Tooltip$1, { ref: childrenRef, disableHoverListener: smart ? fitsContainer : false, arrow: true, placement: "top-start", ...props, children: children ?? (jsx(Box, { sx: { lineHeight: 0, ml: 0.5 }, children: jsx(InfoStyledIcon, {}) })) }));
|
|
374
374
|
};
|
|
375
375
|
|
|
376
376
|
const BMInput$2 = ({ label, tooltip, dataTestId, ...props }) => (jsx(TextField, { ...props, label: jsxs(Fragment, { children: [label, " ", tooltip && jsx(BMTooltip$1, { title: tooltip })] }), variant: "standard", "data-testid": dataTestId }));
|
|
@@ -921,10 +921,9 @@ const HookFormContext = React__default.createContext(null);
|
|
|
921
921
|
HookFormContext.displayName = 'HookFormContext';
|
|
922
922
|
|
|
923
923
|
const BMInputField$1 = (props) => {
|
|
924
|
-
var _a, _b;
|
|
925
924
|
const { name, rules, defaultValue, control, shouldUnregister, ...bmInputProps } = props;
|
|
926
925
|
const { field: { ref, ...fieldProps }, fieldState, } = useController({ name, rules, defaultValue, control, shouldUnregister });
|
|
927
|
-
return (jsx(BMInput$2, { ...fieldProps, ...bmInputProps, inputRef: ref, error: !!fieldState.error, helperText:
|
|
926
|
+
return (jsx(BMInput$2, { ...fieldProps, ...bmInputProps, inputRef: ref, error: !!fieldState.error, helperText: fieldState.error?.message ?? bmInputProps.helperText }));
|
|
928
927
|
};
|
|
929
928
|
|
|
930
929
|
var _g$k;
|
|
@@ -1044,10 +1043,9 @@ const EditIconStyled = styled(SvgPencil)(() => ({
|
|
|
1044
1043
|
top: 7,
|
|
1045
1044
|
}));
|
|
1046
1045
|
const BMInputEditableCode = ({ content, onSave, tooltip, ...bmInputProps }) => {
|
|
1047
|
-
var _a;
|
|
1048
1046
|
const [isEditing, setIsEditing] = useState(false);
|
|
1049
1047
|
const fieldRef = useRef(null);
|
|
1050
|
-
const placeholder =
|
|
1048
|
+
const placeholder = bmInputProps.placeholder ?? "";
|
|
1051
1049
|
return (jsx(Fragment, { children: isEditing ? (jsxs(Box, { display: "inline-table", position: "relative", children: [jsx(Box, { sx: {
|
|
1052
1050
|
"& .MuiFormLabel-root": {
|
|
1053
1051
|
display: "none",
|
|
@@ -1062,10 +1060,9 @@ const BMInputEditableCode = ({ content, onSave, tooltip, ...bmInputProps }) => {
|
|
|
1062
1060
|
}
|
|
1063
1061
|
}
|
|
1064
1062
|
}, size: "small", children: jsx(SvgCloseCollapse, { viewBox: "-1 -1 17 17" }) }), jsx(IconButtonStyled, { onClick: () => {
|
|
1065
|
-
var _a, _b;
|
|
1066
1063
|
setIsEditing(false);
|
|
1067
|
-
onSave(
|
|
1068
|
-
}, size: "small", children: jsx(SvgCheck, {}) })] })] })) : (jsx(BMTooltip$1, { title: tooltip
|
|
1064
|
+
onSave(fieldRef?.current?.value ?? "");
|
|
1065
|
+
}, size: "small", children: jsx(SvgCheck, {}) })] })] })) : (jsx(BMTooltip$1, { title: tooltip ?? placeholder, children: jsxs(Content, { onClick: () => {
|
|
1069
1066
|
setIsEditing(true);
|
|
1070
1067
|
}, children: [jsx("span", { children: content.length ? content : placeholder }), jsx("span", { children: jsx(EditIconStyled, {}) })] }) })) }));
|
|
1071
1068
|
};
|
|
@@ -1111,15 +1108,12 @@ const BMAutoComplete$1 = ({ bmInputProps, options, getOptionLabel, getOptionDisa
|
|
|
1111
1108
|
deleteIcon: jsx(CloseStyledIcon, {}),
|
|
1112
1109
|
},
|
|
1113
1110
|
paper: memoPaperComp,
|
|
1114
|
-
}, "data-testid": dataTestId, renderInput: (params) => {
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
input
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
},
|
|
1121
|
-
} }) }) }));
|
|
1122
|
-
}, ...rest }));
|
|
1111
|
+
}, "data-testid": dataTestId, renderInput: (params) => (jsx(BMTooltip$1, { placement: "top-start", title: tooltipText ?? "", children: jsx("span", { children: jsx(BMInput$2, { dataTestId: `${dataTestId}-input`, ...params, ...bmInputProps, slotProps: {
|
|
1112
|
+
input: {
|
|
1113
|
+
...params.InputProps,
|
|
1114
|
+
...bmInputProps?.slotProps?.input,
|
|
1115
|
+
},
|
|
1116
|
+
} }) }) })), ...rest }));
|
|
1123
1117
|
};
|
|
1124
1118
|
|
|
1125
1119
|
const BMButton$2 = (props) => {
|
|
@@ -1134,7 +1128,7 @@ const BMButton$2 = (props) => {
|
|
|
1134
1128
|
: "primary",
|
|
1135
1129
|
}, thickness: 5 }) }));
|
|
1136
1130
|
}
|
|
1137
|
-
return (jsx(Button, { ...muiButtonProps, size: size, color: color
|
|
1131
|
+
return (jsx(Button, { ...muiButtonProps, size: size, color: color ?? muiButtonProps.color, variant: variant, "data-testid": props.dataTestId }));
|
|
1138
1132
|
};
|
|
1139
1133
|
|
|
1140
1134
|
const BMSplitButton$1 = ({ label, options, menuProps, ButtonComp = BMButton$2, ...props }) => {
|
|
@@ -1149,23 +1143,20 @@ const BMSplitButton$1 = ({ label, options, menuProps, ButtonComp = BMButton$2, .
|
|
|
1149
1143
|
};
|
|
1150
1144
|
return (jsxs("div", { style: { display: 'inline-flex', alignItems: 'center' }, children: [jsxs(ButtonComp, { onClick: handleDropdownClick, style: { marginLeft: '4px', padding: '0 8px' }, "data-testid": props.dataTestId, ...props, children: [label, jsx(ArrowDropDownIcon, {})] }), jsx(Menu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, transformOrigin: { vertical: 'top', horizontal: 'right' }, PaperProps: {
|
|
1151
1145
|
style: {
|
|
1152
|
-
width: buttonRef
|
|
1146
|
+
width: buttonRef?.clientWidth
|
|
1153
1147
|
}
|
|
1154
|
-
}, ...menuProps, children: options
|
|
1148
|
+
}, ...menuProps, children: options?.map((option, index) => (jsx(MenuItem, { onClick: () => {
|
|
1155
1149
|
option.onClick();
|
|
1156
1150
|
handleClose();
|
|
1157
1151
|
}, "data-testid": `${props.dataTestId}-${option.label}`, children: option.label }, index))) })] }));
|
|
1158
1152
|
};
|
|
1159
1153
|
|
|
1160
1154
|
const BMButtonGroup$1 = ({ buttons, className, active, dataTestId, orientation = 'horizontal', }) => {
|
|
1161
|
-
const [activeBut, setActiveBut] = React__default.useState(active
|
|
1162
|
-
return (jsx(ButtonGroup, { orientation: orientation, className: className, children: buttons.map((button, index) => {
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
button.onClick();
|
|
1167
|
-
}, ...button.buttonProps, className: `${(_a = button.buttonProps) === null || _a === void 0 ? void 0 : _a.className} ${button.label === activeBut ? 'bm-active' : ''}`, dataTestId: `${dataTestId}-${button.label}`, children: [button.label, (index !== buttons.length - 1 && activeBut !== button.label) && jsx("div", { className: "bm-divider" })] }, index) }));
|
|
1168
|
-
}) }));
|
|
1155
|
+
const [activeBut, setActiveBut] = React__default.useState(active ?? null);
|
|
1156
|
+
return (jsx(ButtonGroup, { orientation: orientation, className: className, children: buttons.map((button, index) => (jsx(Fragment, { children: jsxs(BMButton$2, { onClick: () => {
|
|
1157
|
+
setActiveBut(button.label);
|
|
1158
|
+
button.onClick();
|
|
1159
|
+
}, ...button.buttonProps, className: `${button.buttonProps?.className} ${button.label === activeBut ? 'bm-active' : ''}`, dataTestId: `${dataTestId}-${button.label}`, children: [button.label, (index !== buttons.length - 1 && activeBut !== button.label) && jsx("div", { className: "bm-divider" })] }, index) }))) }));
|
|
1169
1160
|
};
|
|
1170
1161
|
|
|
1171
1162
|
const StyledFormControlLabel = styled(FormControlLabel)(({ theme }) => ({
|
|
@@ -1300,8 +1291,8 @@ const BMDialog = styled(Dialog)(({ isSidePanel, overrideWidth, overrideHeight, s
|
|
|
1300
1291
|
return {
|
|
1301
1292
|
[`& .${dialogClasses.paper}`]: {
|
|
1302
1293
|
...modalSize,
|
|
1303
|
-
width: overrideWidth
|
|
1304
|
-
height: overrideHeight
|
|
1294
|
+
width: overrideWidth ?? modalSize.width,
|
|
1295
|
+
height: overrideHeight ?? modalSize.height,
|
|
1305
1296
|
...(isSidePanel && {
|
|
1306
1297
|
width: 736,
|
|
1307
1298
|
height: "100%",
|
|
@@ -1358,7 +1349,6 @@ const CloseButton = styled("span")(({ theme }) => ({
|
|
|
1358
1349
|
cursor: "pointer",
|
|
1359
1350
|
}));
|
|
1360
1351
|
const BMModal = (props) => {
|
|
1361
|
-
var _a, _b;
|
|
1362
1352
|
const { title, titleSeparator, titleIcon, actionsInfo, onClose, onSubmit, children, cancelLabel, cancelTestId, submitLabel, submitTestId, enableBackdropDismiss, size, isSidePanel, buttonProps, customTitle, hideCloseBtn, customSubmitButton, submitButtonTooltip, cancelButtonTooltip, dialogContentProps = {}, gradientTag, ...dialogProps } = props;
|
|
1363
1353
|
const handleClose = () => {
|
|
1364
1354
|
if (onClose) {
|
|
@@ -1376,10 +1366,10 @@ const BMModal = (props) => {
|
|
|
1376
1366
|
if (isSidePanel) {
|
|
1377
1367
|
dialogProps.TransitionComponent = SlideTransition;
|
|
1378
1368
|
}
|
|
1379
|
-
const submitBtnProps =
|
|
1380
|
-
const cancelBtnProps =
|
|
1369
|
+
const submitBtnProps = buttonProps?.primary ?? {};
|
|
1370
|
+
const cancelBtnProps = buttonProps?.secondary ?? {};
|
|
1381
1371
|
const getCancelButton = () => {
|
|
1382
|
-
const returnComponent = cancelLabel ? (jsx(BMButton$2, { variant: "secondary", onClick: handleClose, ...cancelBtnProps, dataTestId: cancelTestId
|
|
1372
|
+
const returnComponent = cancelLabel ? (jsx(BMButton$2, { variant: "secondary", onClick: handleClose, ...cancelBtnProps, dataTestId: cancelTestId ?? 'modal-cancel-button', children: cancelLabel })) : undefined;
|
|
1383
1373
|
if (cancelButtonTooltip) {
|
|
1384
1374
|
return (jsx(BMTooltip$1, { title: cancelButtonTooltip, children: jsx("span", { children: returnComponent }) }));
|
|
1385
1375
|
}
|
|
@@ -1388,7 +1378,7 @@ const BMModal = (props) => {
|
|
|
1388
1378
|
const getSubmitButton = () => {
|
|
1389
1379
|
if (customSubmitButton)
|
|
1390
1380
|
return customSubmitButton;
|
|
1391
|
-
const returnComponent = submitLabel ? (jsx(BMButton$2, { variant: "primary", onClick: handleSubmitBtnClick, ...submitBtnProps, type: "submit", autoFocus: true, dataTestId: submitTestId
|
|
1381
|
+
const returnComponent = submitLabel ? (jsx(BMButton$2, { variant: "primary", onClick: handleSubmitBtnClick, ...submitBtnProps, type: "submit", autoFocus: true, dataTestId: submitTestId ?? 'modal-submit-button', children: submitLabel })) : undefined;
|
|
1392
1382
|
if (submitButtonTooltip) {
|
|
1393
1383
|
return (jsx(BMTooltip$1, { title: submitButtonTooltip, children: jsx("span", { children: returnComponent }) }));
|
|
1394
1384
|
}
|
|
@@ -18703,8 +18693,8 @@ const EntryWrapper = styled(Paper, {
|
|
|
18703
18693
|
gap: theme.spacing(0.5),
|
|
18704
18694
|
padding: theme.spacing(0.5, 0.5, 0, 0.875),
|
|
18705
18695
|
minHeight: 40,
|
|
18706
|
-
height: overrideHeight
|
|
18707
|
-
width: overrideWidth
|
|
18696
|
+
height: overrideHeight ?? "auto",
|
|
18697
|
+
width: overrideWidth ?? "100%",
|
|
18708
18698
|
overflowY: "auto",
|
|
18709
18699
|
overflowX: "hidden",
|
|
18710
18700
|
cursor: "text",
|
|
@@ -18762,18 +18752,17 @@ const ErrorIconStyled = styled(SvgFailedSolid)(({ theme }) => ({
|
|
|
18762
18752
|
},
|
|
18763
18753
|
}));
|
|
18764
18754
|
const BMMultiEntry = ({ tooltipFn, onChange, checkWarning, label, placeholderText, value, error, helperText, chipIcon, dataTestId, disabled, lowercaseEntry = false, overrideHeight, overrideWidth, subLabel, removeInvalidEntriesMsg, multiEntryHitEnterMsg, }) => {
|
|
18765
|
-
var _a, _b, _c, _d, _e, _f;
|
|
18766
18755
|
const textInputRef = useRef(null);
|
|
18767
18756
|
const [fieldInFocus, setFieldInFocus] = useState(false);
|
|
18768
18757
|
const errorArr = Array.isArray(error) ? error : [];
|
|
18769
18758
|
const entries = Array.isArray(value)
|
|
18770
18759
|
? value.map((item) => (lowercaseEntry ? item.toLowerCase() : item))
|
|
18771
|
-
: (value
|
|
18760
|
+
: (value ?? "")
|
|
18772
18761
|
.split(/[ ,]+/)
|
|
18773
18762
|
.map((item) => (lowercaseEntry ? item.toLowerCase() : item));
|
|
18774
18763
|
const updateEntries = (items) => {
|
|
18775
18764
|
const updated = items.map((item) => lowercaseEntry ? item.toLowerCase() : item);
|
|
18776
|
-
onChange
|
|
18765
|
+
onChange?.(updated);
|
|
18777
18766
|
};
|
|
18778
18767
|
const handleDelete = (entry) => {
|
|
18779
18768
|
updateEntries(entries.filter((e) => e !== entry));
|
|
@@ -18819,16 +18808,14 @@ const BMMultiEntry = ({ tooltipFn, onChange, checkWarning, label, placeholderTex
|
|
|
18819
18808
|
return undefined;
|
|
18820
18809
|
};
|
|
18821
18810
|
return (jsxs(Fragment, { children: [label && jsx(Label, { children: label }), jsxs(EntryWrapper, { onClick: () => {
|
|
18822
|
-
var _a;
|
|
18823
18811
|
setFieldInFocus(true);
|
|
18824
|
-
|
|
18812
|
+
textInputRef.current?.focus();
|
|
18825
18813
|
}, "data-testid": dataTestId, focus: fieldInFocus, overrideHeight: overrideHeight, overrideWidth: overrideWidth, children: [entries.map((entry, index) => {
|
|
18826
|
-
var _a, _b, _c;
|
|
18827
18814
|
const invalid = errorArr[index];
|
|
18828
|
-
const tooltip =
|
|
18829
|
-
const warning =
|
|
18815
|
+
const tooltip = invalid?.message ?? tooltipFn?.(entry) ?? undefined;
|
|
18816
|
+
const warning = checkWarning?.(entry) ?? false;
|
|
18830
18817
|
const ChipComp = warning ? WarningChip : StyledChip$1;
|
|
18831
|
-
return (jsx(BMTooltip$1, { title: tooltip
|
|
18818
|
+
return (jsx(BMTooltip$1, { title: tooltip ?? "", children: jsx(ChipComp, { label: entry, icon: getChipIcon(entry, invalid), deleteIcon: jsx(CloseIconStyled, {}), onDelete: () => handleDelete(entry), clickable: true, onClick: () => handleClick(entry) }) }, `${entry}-tooltip`));
|
|
18832
18819
|
}), jsx(TextInput, { inputRef: textInputRef, placeholder: placeholderText, disabled: disabled, onKeyDown: (e) => {
|
|
18833
18820
|
if (e.key === "Backspace")
|
|
18834
18821
|
handleBackspace(e);
|
|
@@ -18840,7 +18827,7 @@ const BMMultiEntry = ({ tooltipFn, onChange, checkWarning, label, placeholderTex
|
|
|
18840
18827
|
fontSize: "11.5px",
|
|
18841
18828
|
fontWeight: 400,
|
|
18842
18829
|
}, children: subLabel })), error &&
|
|
18843
|
-
(
|
|
18830
|
+
(textInputRef.current?.value?.length ?? 0) === 0 &&
|
|
18844
18831
|
helperText && (jsx(FormHelperText, { error: true, sx: {
|
|
18845
18832
|
mt: 1,
|
|
18846
18833
|
fontSize: "11.5px",
|
|
@@ -18850,7 +18837,7 @@ const BMMultiEntry = ({ tooltipFn, onChange, checkWarning, label, placeholderTex
|
|
|
18850
18837
|
fontSize: "11.5px",
|
|
18851
18838
|
fontWeight: 400,
|
|
18852
18839
|
}, error: true, children: removeInvalidEntriesMsg })), error &&
|
|
18853
|
-
(
|
|
18840
|
+
(textInputRef.current?.value?.length ?? 0) > 0 &&
|
|
18854
18841
|
multiEntryHitEnterMsg && (jsx(FormHelperText, { error: true, sx: {
|
|
18855
18842
|
mt: 1,
|
|
18856
18843
|
fontSize: "11.5px",
|
|
@@ -18859,7 +18846,6 @@ const BMMultiEntry = ({ tooltipFn, onChange, checkWarning, label, placeholderTex
|
|
|
18859
18846
|
};
|
|
18860
18847
|
|
|
18861
18848
|
const BMMultiEntryField = (props) => {
|
|
18862
|
-
var _a, _b;
|
|
18863
18849
|
const { name, rules, defaultValue, control, shouldUnregister, placeholderText, chipIcon, dataTestId, ...restInputProps } = props;
|
|
18864
18850
|
const { field, fieldState } = useController({
|
|
18865
18851
|
name,
|
|
@@ -18868,7 +18854,7 @@ const BMMultiEntryField = (props) => {
|
|
|
18868
18854
|
control,
|
|
18869
18855
|
shouldUnregister,
|
|
18870
18856
|
});
|
|
18871
|
-
return (jsx(BMMultiEntry, { ...restInputProps, label: props
|
|
18857
|
+
return (jsx(BMMultiEntry, { ...restInputProps, label: props?.label, onChange: field.onChange, value: field.value, error: fieldState.error, chipIcon: chipIcon, helperText: fieldState.error?.message ?? "", placeholderText: placeholderText, dataTestId: dataTestId }));
|
|
18872
18858
|
};
|
|
18873
18859
|
|
|
18874
18860
|
var _path$k;
|
|
@@ -19007,7 +18993,6 @@ const BMPassword = (props) => {
|
|
|
19007
18993
|
};
|
|
19008
18994
|
|
|
19009
18995
|
const BMPasswordField = (props) => {
|
|
19010
|
-
var _a, _b;
|
|
19011
18996
|
const inputElement = useRef(null);
|
|
19012
18997
|
const { name, rules, defaultValue, control, shouldUnregister, ...bmInputProps } = props;
|
|
19013
18998
|
const { field: { ref, value, ...fieldProps }, fieldState, } = useController({ name, rules, defaultValue, control, shouldUnregister });
|
|
@@ -19021,7 +19006,7 @@ const BMPasswordField = (props) => {
|
|
|
19021
19006
|
return (jsx(BMPassword, { ...fieldProps, ...bmInputProps, inputRef: (element) => {
|
|
19022
19007
|
inputElement.current = element;
|
|
19023
19008
|
ref(element);
|
|
19024
|
-
}, error: !!fieldState.error, helperText:
|
|
19009
|
+
}, error: !!fieldState.error, helperText: fieldState.error?.message ?? bmInputProps.helperText }));
|
|
19025
19010
|
};
|
|
19026
19011
|
|
|
19027
19012
|
const BMProgressBar = styled(LinearProgress)(({ theme, color }) => ({
|
|
@@ -19120,7 +19105,6 @@ const BMRadioGroup = ({ label, options = [], orientation = RadioOrientation.Vert
|
|
|
19120
19105
|
};
|
|
19121
19106
|
|
|
19122
19107
|
const BMRadioGroupField = (props) => {
|
|
19123
|
-
var _a;
|
|
19124
19108
|
const { name, control, rules, defaultValue, shouldUnregister, ...restProps } = props;
|
|
19125
19109
|
const { field } = useController({
|
|
19126
19110
|
name,
|
|
@@ -19129,7 +19113,7 @@ const BMRadioGroupField = (props) => {
|
|
|
19129
19113
|
defaultValue,
|
|
19130
19114
|
shouldUnregister,
|
|
19131
19115
|
});
|
|
19132
|
-
return (jsx(BMRadioGroup, { name: field.name, value:
|
|
19116
|
+
return (jsx(BMRadioGroup, { name: field.name, value: field.value ?? "", onChange: field.onChange, onBlur: field.onBlur, label: restProps.label, orientation: restProps.orientation, className: restProps.className, ...restProps }));
|
|
19133
19117
|
};
|
|
19134
19118
|
|
|
19135
19119
|
const BMSelect = ({ label, tooltip, renderValue, menuProps, selectProps = {}, dataTestId, ...props }) => (jsx(TextField, { ...props, label: label ? (jsxs(Fragment, { children: [label, " ", tooltip && jsx(BMTooltip$1, { title: tooltip })] })) : null // don't render <Label> if it's empty
|
|
@@ -19150,10 +19134,9 @@ const BMSelect = ({ label, tooltip, renderValue, menuProps, selectProps = {}, da
|
|
|
19150
19134
|
}, variant: "standard" }));
|
|
19151
19135
|
|
|
19152
19136
|
const BMSelectField = (props) => {
|
|
19153
|
-
var _a;
|
|
19154
19137
|
const { name, rules, defaultValue, control, shouldUnregister, children, helperText, ...bmSelectProps } = props;
|
|
19155
19138
|
const { field: { onChange, onBlur, value, name: fieldName, ref }, fieldState: { error }, } = useController({ name, rules, defaultValue, control, shouldUnregister });
|
|
19156
|
-
return (jsx(BMSelect, { ...bmSelectProps, name: fieldName, value: value, onChange: onChange, onBlur: onBlur, inputRef: ref, error: !!error, helperText:
|
|
19139
|
+
return (jsx(BMSelect, { ...bmSelectProps, name: fieldName, value: value, onChange: onChange, onBlur: onBlur, inputRef: ref, error: !!error, helperText: error?.message ?? helperText, children: children }));
|
|
19157
19140
|
};
|
|
19158
19141
|
|
|
19159
19142
|
const BMToggle$1 = ({ label, formControlLabelProps, ...switchProps }) => {
|
|
@@ -19206,10 +19189,7 @@ const BMMultiToggleButton = ({ options, value, onChange, dense, ...rest }) => {
|
|
|
19206
19189
|
if (newValue !== null) {
|
|
19207
19190
|
onChange(newValue);
|
|
19208
19191
|
}
|
|
19209
|
-
}, ...rest, children: options.map((option) => {
|
|
19210
|
-
var _a;
|
|
19211
|
-
return (jsx(StyledToggleButton, { value: option.value, "data-testid": (_a = option.dataTestId) !== null && _a !== void 0 ? _a : `${option.label}ToggleButton`, children: option.label }, String(option.value)));
|
|
19212
|
-
}) }));
|
|
19192
|
+
}, ...rest, children: options.map((option) => (jsx(StyledToggleButton, { value: option.value, "data-testid": option.dataTestId ?? `${option.label}ToggleButton`, children: option.label }, String(option.value)))) }));
|
|
19213
19193
|
};
|
|
19214
19194
|
|
|
19215
19195
|
const Panel = styled('div')(({ theme }) => ({
|
|
@@ -19405,10 +19385,7 @@ const Circle = styled(SvgCircleUnselected)(({ theme }) => ({
|
|
|
19405
19385
|
color: theme.palette.grey[600]
|
|
19406
19386
|
}));
|
|
19407
19387
|
const BMCloudSelect = ({ overrideOptionWidth, options, value, onChange }) => {
|
|
19408
|
-
return (jsx(Box, { display: "flex", alignItems: "center", flexWrap: "wrap", rowGap: 1, children: options.map((item) => {
|
|
19409
|
-
var _a;
|
|
19410
|
-
return (jsxs(Card, { "data-testid": (_a = item.dataTestId) !== null && _a !== void 0 ? _a : item.value, onClick: () => onChange(item.value), selected: value === item.value, visible: item.visible, style: { width: overrideOptionWidth }, children: [jsxs(Box, { display: "flex", alignItems: "center", children: [jsx(IconLogo, { children: item.icon }), jsx(Typography, { variant: "body1", children: item.label })] }), value === item.value ? (jsx(CircleCheckIcon, {})) : (jsx(Circle, {}))] }, String(item.value)));
|
|
19411
|
-
}) }));
|
|
19388
|
+
return (jsx(Box, { display: "flex", alignItems: "center", flexWrap: "wrap", rowGap: 1, children: options.map((item) => (jsxs(Card, { "data-testid": item.dataTestId ?? item.value, onClick: () => onChange(item.value), selected: value === item.value, visible: item.visible, style: { width: overrideOptionWidth }, children: [jsxs(Box, { display: "flex", alignItems: "center", children: [jsx(IconLogo, { children: item.icon }), jsx(Typography, { variant: "body1", children: item.label })] }), value === item.value ? (jsx(CircleCheckIcon, {})) : (jsx(Circle, {}))] }, String(item.value)))) }));
|
|
19412
19389
|
};
|
|
19413
19390
|
|
|
19414
19391
|
const StyledLabel = styled(InputLabel)(({ theme }) => ({
|
|
@@ -34480,9 +34457,9 @@ const MAX_ZOOM_VAL = 5;
|
|
|
34480
34457
|
const MapBox = styled('div')(({ theme, mapHeight, mapWidth }) => ({
|
|
34481
34458
|
borderRadius: theme.spacing(1),
|
|
34482
34459
|
border: `1px solid ${theme.palette.grey[200]}`,
|
|
34483
|
-
width: mapWidth
|
|
34460
|
+
width: mapWidth ?? '100%',
|
|
34484
34461
|
'& .leaflet-container': {
|
|
34485
|
-
width: mapWidth
|
|
34462
|
+
width: mapWidth ?? '100%',
|
|
34486
34463
|
height: `${mapHeight}px`,
|
|
34487
34464
|
},
|
|
34488
34465
|
overflow: 'hidden'
|
|
@@ -70373,9 +70350,8 @@ const BMDropdown = ({ children, position = "bottom", growDirection, origin, keep
|
|
|
70373
70350
|
event.stopPropagation();
|
|
70374
70351
|
};
|
|
70375
70352
|
const handleClose = (event) => {
|
|
70376
|
-
var _a;
|
|
70377
70353
|
setAnchorEl(null);
|
|
70378
|
-
|
|
70354
|
+
event.stopPropagation?.();
|
|
70379
70355
|
};
|
|
70380
70356
|
const handleMenuClick = (event) => {
|
|
70381
70357
|
if (!keepOpenOnSelect) {
|
|
@@ -70409,7 +70385,7 @@ const BMDropdown = ({ children, position = "bottom", growDirection, origin, keep
|
|
|
70409
70385
|
horizontal: "left",
|
|
70410
70386
|
};
|
|
70411
70387
|
}
|
|
70412
|
-
return (jsxs(Fragment, { children: [jsx(BMTooltip$1, { title: tooltip
|
|
70388
|
+
return (jsxs(Fragment, { children: [jsx(BMTooltip$1, { title: tooltip ?? "", placement: "top", children: jsx(OriginWrapper, { onClick: handleClick, className: className, "data-testid": dataTestId, children: typeof origin === "function" ? origin(open) : origin }) }), jsx(Menu, { open: open, anchorEl: anchorEl, disableAutoFocusItem: true, onClose: handleClose, onClick: handleMenuClick, anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, ...menuProps, children: children })] }));
|
|
70413
70389
|
};
|
|
70414
70390
|
|
|
70415
70391
|
const BMAvatarSizeMap = {
|
|
@@ -70419,7 +70395,7 @@ const BMAvatarSizeMap = {
|
|
|
70419
70395
|
};
|
|
70420
70396
|
|
|
70421
70397
|
const getSizeDimension = (_, size) => {
|
|
70422
|
-
return BMAvatarSizeMap[size] ||
|
|
70398
|
+
return BMAvatarSizeMap[size] || BMAvatarSizeMap?.medium;
|
|
70423
70399
|
};
|
|
70424
70400
|
const StyledImage = styled$1("img")(({ theme, size }) => {
|
|
70425
70401
|
const dimension = getSizeDimension(theme, size);
|
|
@@ -70512,9 +70488,8 @@ const StyledChip = styled(Chip$1)(({ theme, $size = "md", $variant = "default",
|
|
|
70512
70488
|
},
|
|
70513
70489
|
}[$size];
|
|
70514
70490
|
const getVariantStyles = () => {
|
|
70515
|
-
var _a, _b, _c;
|
|
70516
70491
|
let gradientStyles;
|
|
70517
|
-
if (!$noGradient && !
|
|
70492
|
+
if (!$noGradient && !props?.customColor) {
|
|
70518
70493
|
gradientStyles = {
|
|
70519
70494
|
background: "linear-gradient(282.49deg, #ed35c5 0.48%, #7879f1 93.17%)",
|
|
70520
70495
|
WebkitTextFillColor: "transparent",
|
|
@@ -70523,11 +70498,11 @@ const StyledChip = styled(Chip$1)(({ theme, $size = "md", $variant = "default",
|
|
|
70523
70498
|
};
|
|
70524
70499
|
}
|
|
70525
70500
|
// If custom colors are provided, use them instead of variants
|
|
70526
|
-
if (props
|
|
70501
|
+
if (props?.customColor) {
|
|
70527
70502
|
return {
|
|
70528
|
-
background:
|
|
70529
|
-
color:
|
|
70530
|
-
border:
|
|
70503
|
+
background: props.customColor?.background || theme.palette.common.white,
|
|
70504
|
+
color: props.customColor?.color || theme.palette.grey[900],
|
|
70505
|
+
border: props.customColor?.border || `1px solid ${theme.palette.grey[300]}`,
|
|
70531
70506
|
};
|
|
70532
70507
|
}
|
|
70533
70508
|
const variantColors = {
|
|
@@ -70750,7 +70725,7 @@ const BMPagination = ({ pageSize = 4, onPageSelect, currentPage, hasMore, dataTe
|
|
|
70750
70725
|
setPage(newPage);
|
|
70751
70726
|
onPageSelect(newPage);
|
|
70752
70727
|
}, "data-testid": dataTestId, renderItem: (params) => {
|
|
70753
|
-
if (
|
|
70728
|
+
if (params?.type === "next" && hasMore) {
|
|
70754
70729
|
return (jsxs(Box, { component: "span", display: "flex", alignItems: "center", children: [jsx(PaginationItem, { ...params, "aria-label": "Go to end-ellipsis page", color: "standard", shape: "rounded", size: "medium", type: "end-ellipsis", variant: "text", sx: { display: "inline-flex", minWidth: 16 } }), jsx(PaginationItem, { ...params })] }));
|
|
70755
70730
|
}
|
|
70756
70731
|
return jsx(PaginationItem, { ...params });
|
|
@@ -70848,7 +70823,7 @@ const LoadingSection = styled(Box)(({ theme }) => ({
|
|
|
70848
70823
|
padding: theme.spacing(2, 0),
|
|
70849
70824
|
}));
|
|
70850
70825
|
const BMAddSection = ({ title, body, bodyVariant, controls, }) => {
|
|
70851
|
-
return (jsx(LoadingSection, { children: jsxs(BMLoadingBox, { children: [title && (jsx(Box, { sx: { mt: 1, mb: 2 }, children: jsx(Typography, { variant: "h2", children: title }) })), jsx(Box, { sx: { mb: controls ? 2 : 0 }, children: jsx(Typography, { variant: bodyVariant
|
|
70826
|
+
return (jsx(LoadingSection, { children: jsxs(BMLoadingBox, { children: [title && (jsx(Box, { sx: { mt: 1, mb: 2 }, children: jsx(Typography, { variant: "h2", children: title }) })), jsx(Box, { sx: { mb: controls ? 2 : 0 }, children: jsx(Typography, { variant: bodyVariant ?? "body2", children: body }) }), controls] }) }));
|
|
70852
70827
|
};
|
|
70853
70828
|
|
|
70854
70829
|
const Root = styled(Box)(({ theme }) => ({
|
|
@@ -132891,16 +132866,15 @@ const BMCodeBlock = ({ showCopyButton, multiBlock, text, codeClassName, preClass
|
|
|
132891
132866
|
const expandableBox = useRef(null);
|
|
132892
132867
|
const [expanded, setExpanded] = useState(!enabledExpandCollapse);
|
|
132893
132868
|
const [showToggle, setShowToggle] = useState(false);
|
|
132894
|
-
const syntaxLanguage = lang
|
|
132869
|
+
const syntaxLanguage = lang ?? "language-plaintext";
|
|
132895
132870
|
useEffect(() => {
|
|
132896
132871
|
HighlightJS.highlightAll();
|
|
132897
132872
|
}, [text]);
|
|
132898
132873
|
const didMountRef = useRef(false);
|
|
132899
132874
|
useEffect(() => {
|
|
132900
|
-
var _a;
|
|
132901
132875
|
if (didMountRef.current) {
|
|
132902
|
-
if (expanded &&
|
|
132903
|
-
|
|
132876
|
+
if (expanded && expandableBox?.current) {
|
|
132877
|
+
expandableBox?.current?.scrollTo({ top: 0 });
|
|
132904
132878
|
}
|
|
132905
132879
|
}
|
|
132906
132880
|
else {
|
|
@@ -132908,30 +132882,27 @@ const BMCodeBlock = ({ showCopyButton, multiBlock, text, codeClassName, preClass
|
|
|
132908
132882
|
}
|
|
132909
132883
|
}, [expanded]);
|
|
132910
132884
|
useLayoutEffect(() => {
|
|
132911
|
-
|
|
132912
|
-
if (expandableBox === null || expandableBox === void 0 ? void 0 : expandableBox.current) {
|
|
132885
|
+
if (expandableBox?.current) {
|
|
132913
132886
|
setShowToggle(enabledExpandCollapse &&
|
|
132914
|
-
Math.round(
|
|
132887
|
+
Math.round(expandableBox?.current?.clientHeight ?? 0) > collapseHeight);
|
|
132915
132888
|
}
|
|
132916
132889
|
}, [collapseHeight, enabledExpandCollapse]);
|
|
132917
132890
|
const copy = async (value) => {
|
|
132918
132891
|
try {
|
|
132919
132892
|
await navigator.clipboard.writeText(value);
|
|
132920
|
-
onCopySuccess
|
|
132893
|
+
onCopySuccess?.();
|
|
132921
132894
|
}
|
|
132922
132895
|
catch (err) {
|
|
132923
132896
|
console.error("Failed to copy:", err);
|
|
132924
132897
|
}
|
|
132925
132898
|
};
|
|
132926
132899
|
const copyBlock = () => {
|
|
132927
|
-
|
|
132928
|
-
const text = (_b = (_a = preRef.current) === null || _a === void 0 ? void 0 : _a.innerText) === null || _b === void 0 ? void 0 : _b.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/g, "$'");
|
|
132900
|
+
const text = preRef.current?.innerText?.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/g, "$'");
|
|
132929
132901
|
if (text)
|
|
132930
132902
|
copy(text);
|
|
132931
132903
|
};
|
|
132932
132904
|
const copyLineBlock = async (ev) => {
|
|
132933
|
-
|
|
132934
|
-
const line = (_b = (_a = ev.currentTarget.previousSibling) === null || _a === void 0 ? void 0 : _a.innerText) === null || _b === void 0 ? void 0 : _b.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/g, "$'");
|
|
132905
|
+
const line = ev.currentTarget.previousSibling?.innerText?.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/g, "$'");
|
|
132935
132906
|
if (line)
|
|
132936
132907
|
await copy(line);
|
|
132937
132908
|
};
|
|
@@ -133078,10 +133049,9 @@ const StyledPaper = styled$1(Paper, {
|
|
|
133078
133049
|
color: theme.palette.text.primary,
|
|
133079
133050
|
}));
|
|
133080
133051
|
const BMTable = ({ tableTitle, selectableRows = "none", data, columns, withBorder = true, dataTestId, options, customHeaderRenderer, ...rest }) => {
|
|
133081
|
-
var _a, _b;
|
|
133082
133052
|
const theme = useTheme();
|
|
133083
|
-
const tablePropsFromOptions =
|
|
133084
|
-
const getRowId = (row) =>
|
|
133053
|
+
const tablePropsFromOptions = options?.setTableProps?.() ?? {};
|
|
133054
|
+
const getRowId = (row) => row.id ?? JSON.stringify(row);
|
|
133085
133055
|
const getCheckboxSelection = () => selectableRows === "multiple" ? true : undefined;
|
|
133086
133056
|
const getIsRowSelectable = () => selectableRows === "none" ? () => false : undefined;
|
|
133087
133057
|
const columnsWithCustomHeader = React.useMemo(() => {
|
|
@@ -133118,7 +133088,7 @@ const BMTable = ({ tableTitle, selectableRows = "none", data, columns, withBorde
|
|
|
133118
133088
|
backgroundColor: theme.palette.background.paper,
|
|
133119
133089
|
color: theme.palette.text.secondary,
|
|
133120
133090
|
},
|
|
133121
|
-
}, getRowId: getRowId, ...tablePropsFromOptions, disableRowSelectionOnClick: !
|
|
133091
|
+
}, getRowId: getRowId, ...tablePropsFromOptions, disableRowSelectionOnClick: !options?.selectableRowsOnClick, ...rest })] }));
|
|
133122
133092
|
};
|
|
133123
133093
|
|
|
133124
133094
|
const BMButton$1 = {
|
|
@@ -133315,7 +133285,7 @@ const BMInput$1 = {
|
|
|
133315
133285
|
fontWeight: 400,
|
|
133316
133286
|
fontSize: 13,
|
|
133317
133287
|
"&::placeholder": {
|
|
133318
|
-
color:
|
|
133288
|
+
color: ownerState?.error ? theme.palette.error[500] : colors.grey[600],
|
|
133319
133289
|
},
|
|
133320
133290
|
'&.Mui-disabled': {
|
|
133321
133291
|
pointerEvents: 'none',
|
|
@@ -133615,7 +133585,6 @@ const BMFormHelperText = {
|
|
|
133615
133585
|
}
|
|
133616
133586
|
};
|
|
133617
133587
|
|
|
133618
|
-
var _a$2;
|
|
133619
133588
|
const BMTabs = {
|
|
133620
133589
|
styleOverrides: {
|
|
133621
133590
|
indicator: {
|
|
@@ -133626,7 +133595,7 @@ const BMTabs = {
|
|
|
133626
133595
|
}
|
|
133627
133596
|
},
|
|
133628
133597
|
fixed: {
|
|
133629
|
-
boxShadow: `inset 0 -1px ${
|
|
133598
|
+
boxShadow: `inset 0 -1px ${colors.grey[300]}`
|
|
133630
133599
|
},
|
|
133631
133600
|
root: {
|
|
133632
133601
|
// custom "pill" style for vertical tabs
|
|
@@ -133958,7 +133927,6 @@ const getOverrideContents = (fn, theme) => {
|
|
|
133958
133927
|
}
|
|
133959
133928
|
};
|
|
133960
133929
|
|
|
133961
|
-
var _a$1, _b, _c, _d;
|
|
133962
133930
|
const BMAInput = {
|
|
133963
133931
|
defaultProps: {
|
|
133964
133932
|
disableUnderline: true,
|
|
@@ -133967,7 +133935,7 @@ const BMAInput = {
|
|
|
133967
133935
|
styleOverrides: {
|
|
133968
133936
|
root: {
|
|
133969
133937
|
variants: [
|
|
133970
|
-
...
|
|
133938
|
+
...coreTheme.components?.MuiInput?.styleOverrides?.root?.variants,
|
|
133971
133939
|
{
|
|
133972
133940
|
props: { size: 'large', multiline: false },
|
|
133973
133941
|
style: {
|
|
@@ -133984,26 +133952,22 @@ const BMInputLabel = {
|
|
|
133984
133952
|
},
|
|
133985
133953
|
styleOverrides: {
|
|
133986
133954
|
// biome-ignore lint: TODO for any
|
|
133987
|
-
root: ({ theme }) => {
|
|
133988
|
-
|
|
133989
|
-
|
|
133990
|
-
|
|
133991
|
-
|
|
133992
|
-
|
|
133993
|
-
|
|
133994
|
-
fontWeight: 500
|
|
133995
|
-
});
|
|
133996
|
-
},
|
|
133955
|
+
root: ({ theme }) => ({
|
|
133956
|
+
// ...(theme.components.MuiInputLabel.styleOverrides.root?.({ theme }) ?? {}),
|
|
133957
|
+
...getOverrideContents(coreTheme.components?.MuiInputLabel?.styleOverrides?.root, theme),
|
|
133958
|
+
// textTransform: 'lowercase',
|
|
133959
|
+
fontSize: theme.typography.body1.fontSize,
|
|
133960
|
+
fontWeight: 500
|
|
133961
|
+
}),
|
|
133997
133962
|
},
|
|
133998
133963
|
};
|
|
133999
133964
|
|
|
134000
|
-
var _a;
|
|
134001
133965
|
const BMAAutoComplete = {
|
|
134002
133966
|
...BMAutoComplete,
|
|
134003
133967
|
styleOverrides: {
|
|
134004
|
-
...BMAutoComplete
|
|
133968
|
+
...BMAutoComplete?.styleOverrides,
|
|
134005
133969
|
inputRoot: {
|
|
134006
|
-
...
|
|
133970
|
+
...BMAutoComplete?.styleOverrides?.inputRoot,
|
|
134007
133971
|
height: 40,
|
|
134008
133972
|
},
|
|
134009
133973
|
},
|
package/package.json
CHANGED
package/tsconfig.base.json
CHANGED