@czi-sds/components 22.13.2 → 22.13.3
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/index.cjs.d.ts +5 -0
- package/dist/index.cjs.js +10 -5
- package/dist/index.esm.d.ts +5 -0
- package/dist/index.esm.js +10 -5
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/index.cjs.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ import { AlertProps } from "@mui/lab";
|
|
|
41
41
|
import { AutocompleteChangeDetails, AutocompleteChangeReason, AutocompleteCloseReason, AutocompleteValue } from "@mui/base";
|
|
42
42
|
import { AlertTitleProps } from "@mui/material/AlertTitle";
|
|
43
43
|
import { AutocompleteValue as AutocompleteValue$1 } from "@mui/material/useAutocomplete";
|
|
44
|
+
import { AutocompleteCloseReason as AutocompleteCloseReason$1 } from "@mui/material/useAutocomplete";
|
|
44
45
|
interface SdsAccordionDetailsProps {
|
|
45
46
|
id?: string;
|
|
46
47
|
}
|
|
@@ -1276,6 +1277,8 @@ interface ExtraDropdownMenuProps extends StyleProps$1 {
|
|
|
1276
1277
|
onClickAway?: (event: MouseEvent | TouchEvent) => void;
|
|
1277
1278
|
ClickAwayListenerProps?: Partial<MUIClickAwayListenerProps>;
|
|
1278
1279
|
width?: number | CSSProperties["width"];
|
|
1280
|
+
onOpen?: (event: React.SyntheticEvent) => void;
|
|
1281
|
+
onClose?: (event: React.SyntheticEvent, reason: AutocompleteCloseReason$0) => void;
|
|
1279
1282
|
}
|
|
1280
1283
|
type CustomAutocompleteProps$1<T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined> = Omit<AutocompleteProps$0<T, Multiple, DisableClearable, FreeSolo>, "renderInput">;
|
|
1281
1284
|
type DropdownMenuProps<T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined> = CustomAutocompleteProps$1<T, Multiple, DisableClearable, FreeSolo> & ExtraDropdownMenuProps;
|
|
@@ -1330,6 +1333,8 @@ interface ExtraDropdownProps<T, Multiple extends boolean | undefined, DisableCle
|
|
|
1330
1333
|
className?: string;
|
|
1331
1334
|
InputDropdownComponent?: typeof InputDropdown;
|
|
1332
1335
|
isTriggerChangeOnOptionClick?: boolean;
|
|
1336
|
+
onOpen?: (event: React.SyntheticEvent) => void;
|
|
1337
|
+
onClose?: (event: React.SyntheticEvent, reason: AutocompleteCloseReason$1) => void;
|
|
1333
1338
|
}
|
|
1334
1339
|
type CustomAutocompleteProps$2<T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined> = Omit<AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>, "renderInput">;
|
|
1335
1340
|
type DropdownProps<T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined> = CustomAutocompleteProps$2<T, Multiple, DisableClearable, FreeSolo> & ExtraDropdownProps<T, Multiple, DisableClearable, FreeSolo>;
|
package/dist/index.cjs.js
CHANGED
|
@@ -6465,7 +6465,7 @@ var DEFAULT_POPPER_BASE_PROPS = {
|
|
|
6465
6465
|
var DropdownMenu = function (props) {
|
|
6466
6466
|
var _a, _b;
|
|
6467
6467
|
var theme = material.useTheme();
|
|
6468
|
-
var anchorEl = props.anchorEl, id = props.id, InputBaseProps = props.InputBaseProps, _c = props.open, open = _c === void 0 ? false : _c, _d = props.PopperComponent, PopperComponent = _d === void 0 ? StyledPopper : _d, _e = props.PaperComponent, PaperComponent = _e === void 0 ? StyledPaper$1 : _e, _f = props.PopperPlacement, PopperPlacement = _f === void 0 ? "bottom-start" : _f, _g = props.PopperBaseProps, PopperBaseProps = _g === void 0 ? {} : _g, _h = props.isSearchAutoFocus, isSearchAutoFocus = _h === void 0 ? true : _h, _j = props.search, search = _j === void 0 ? false : _j, title = props.title, headerComponentSlot = props.headerComponentSlot, _k = props.label, label = _k === void 0 ? "Search" : _k, children = props.children, options = props.options, _l = props.onClickAway, onClickAway = _l === void 0 ? noop : _l, ClickAwayListenerProps = props.ClickAwayListenerProps, _m = props.width, width = _m === void 0 ? MINIMUM_DROPDOWN_MENU_POPPER_WIDTH : _m, rest = __rest(props, ["anchorEl", "id", "InputBaseProps", "open", "PopperComponent", "PaperComponent", "PopperPlacement", "PopperBaseProps", "isSearchAutoFocus", "search", "title", "headerComponentSlot", "label", "children", "options", "onClickAway", "ClickAwayListenerProps", "width"]);
|
|
6468
|
+
var anchorEl = props.anchorEl, id = props.id, InputBaseProps = props.InputBaseProps, _c = props.open, open = _c === void 0 ? false : _c, _d = props.PopperComponent, PopperComponent = _d === void 0 ? StyledPopper : _d, _e = props.PaperComponent, PaperComponent = _e === void 0 ? StyledPaper$1 : _e, _f = props.PopperPlacement, PopperPlacement = _f === void 0 ? "bottom-start" : _f, _g = props.PopperBaseProps, PopperBaseProps = _g === void 0 ? {} : _g, _h = props.isSearchAutoFocus, isSearchAutoFocus = _h === void 0 ? true : _h, _j = props.search, search = _j === void 0 ? false : _j, title = props.title, headerComponentSlot = props.headerComponentSlot, _k = props.label, label = _k === void 0 ? "Search" : _k, children = props.children, options = props.options, _l = props.onClickAway, onClickAway = _l === void 0 ? noop : _l, ClickAwayListenerProps = props.ClickAwayListenerProps, _m = props.width, width = _m === void 0 ? MINIMUM_DROPDOWN_MENU_POPPER_WIDTH : _m, onOpen = props.onOpen, onClose = props.onClose, rest = __rest(props, ["anchorEl", "id", "InputBaseProps", "open", "PopperComponent", "PaperComponent", "PopperPlacement", "PopperBaseProps", "isSearchAutoFocus", "search", "title", "headerComponentSlot", "label", "children", "options", "onClickAway", "ClickAwayListenerProps", "width", "onOpen", "onClose"]);
|
|
6469
6469
|
var isMultiColumn = "options" in ((options === null || options === void 0 ? void 0 : options[0]) || EMPTY_OBJECT);
|
|
6470
6470
|
// (masoudmanson): The DropdownMenu's Popper component should have a minimum
|
|
6471
6471
|
// width of MINIMUM_DROPDOWN_MENU_POPPER_WIDTH pixels if the DropdownMenu is
|
|
@@ -6487,7 +6487,7 @@ var DropdownMenu = function (props) {
|
|
|
6487
6487
|
], open: open, anchorEl: anchorEl, placement: PopperPlacement }, PopperBaseProps, {
|
|
6488
6488
|
// (masoudmanson): To override the width of the Popper,
|
|
6489
6489
|
// the sx prop's value must be set after spreading the PopperBaseProps.
|
|
6490
|
-
sx: dropdownMenuPopperSx, children: jsxRuntime.jsx(PaperComponent, { children: jsxRuntime.jsx(material.ClickAwayListener, __assign({ onClickAway: onClickAway }, ClickAwayListenerProps, { children: jsxRuntime.jsxs(StyledDropdownMenuAutocompleteWrapper, { search: search, titleValue: !!(title || headerComponentSlot), children: [(title || headerComponentSlot) && (jsxRuntime.jsxs(StyledDropdownMenuHeader, { search: search, children: [title && jsxRuntime.jsx(StyledHeaderTitle, { children: title }), headerComponentSlot && jsxRuntime.jsx(jsxRuntime.Fragment, { children: headerComponentSlot })] })), anchorEl && (jsxRuntime.jsx(Autocomplete, __assign({ label: label, search: search, title: title, open: open, options: options, PopperBaseProps: DEFAULT_POPPER_BASE_PROPS, disablePortal: true, onClickAway: noop, onClick: noop }, rest, { InputBaseProps: DefaultInputBaseProps }))), children] }) })) }) })));
|
|
6490
|
+
sx: dropdownMenuPopperSx, children: jsxRuntime.jsx(PaperComponent, { children: jsxRuntime.jsx(material.ClickAwayListener, __assign({ onClickAway: onClickAway }, ClickAwayListenerProps, { children: jsxRuntime.jsxs(StyledDropdownMenuAutocompleteWrapper, { search: search, titleValue: !!(title || headerComponentSlot), children: [(title || headerComponentSlot) && (jsxRuntime.jsxs(StyledDropdownMenuHeader, { search: search, children: [title && jsxRuntime.jsx(StyledHeaderTitle, { children: title }), headerComponentSlot && jsxRuntime.jsx(jsxRuntime.Fragment, { children: headerComponentSlot })] })), anchorEl && (jsxRuntime.jsx(Autocomplete, __assign({ label: label, search: search, title: title, open: open, options: options, PopperBaseProps: DEFAULT_POPPER_BASE_PROPS, disablePortal: true, onClickAway: noop, onClick: noop, onOpen: onOpen, onClose: onClose }, rest, { InputBaseProps: DefaultInputBaseProps }))), children] }) })) }) })));
|
|
6491
6491
|
};
|
|
6492
6492
|
|
|
6493
6493
|
var doNotForwardProps$s = [
|
|
@@ -6783,7 +6783,7 @@ var Dropdown = function (props) {
|
|
|
6783
6783
|
// which by default will not close on blur. If closeOnBlur is enabled, clicking out
|
|
6784
6784
|
// is equivalent to clicking the Cancel button, closing the dropdown and losing
|
|
6785
6785
|
// unapplied changes.
|
|
6786
|
-
closeOnBlur = _g === void 0 ? !buttons : _g, onClose = props.onClose, onChange = props.onChange, title = props.title, _h = props.DropdownMenuProps, DropdownMenuProps = _h === void 0 ? {} : _h, InputDropdownProps = props.InputDropdownProps, _j = props.InputDropdownComponent, InputDropdownComponent = _j === void 0 ? InputDropdown : _j, _k = props.isTriggerChangeOnOptionClick, isTriggerChangeOnOptionClick = _k === void 0 ? false : _k, _l = props.disabled, disabled = _l === void 0 ? false : _l, propValue = props.value, onClick = props.onClick, rest = __rest(props, ["options", "label", "multiple", "search", "isSearchAutoFocus", "buttonPosition", "buttons", "closeOnBlur", "onClose", "onChange", "title", "DropdownMenuProps", "InputDropdownProps", "InputDropdownComponent", "isTriggerChangeOnOptionClick", "disabled", "value", "onClick"]);
|
|
6786
|
+
closeOnBlur = _g === void 0 ? !buttons : _g, onClose = props.onClose, onOpen = props.onOpen, onChange = props.onChange, title = props.title, _h = props.DropdownMenuProps, DropdownMenuProps = _h === void 0 ? {} : _h, InputDropdownProps = props.InputDropdownProps, _j = props.InputDropdownComponent, InputDropdownComponent = _j === void 0 ? InputDropdown : _j, _k = props.isTriggerChangeOnOptionClick, isTriggerChangeOnOptionClick = _k === void 0 ? false : _k, _l = props.disabled, disabled = _l === void 0 ? false : _l, propValue = props.value, onClick = props.onClick, rest = __rest(props, ["options", "label", "multiple", "search", "isSearchAutoFocus", "buttonPosition", "buttons", "closeOnBlur", "onClose", "onOpen", "onChange", "title", "DropdownMenuProps", "InputDropdownProps", "InputDropdownComponent", "isTriggerChangeOnOptionClick", "disabled", "value", "onClick"]);
|
|
6787
6787
|
if (buttons && !multiple) {
|
|
6788
6788
|
// eslint-disable-next-line no-console
|
|
6789
6789
|
console.warn("Warning: buttons are only supported for multiple select dropdowns.");
|
|
@@ -6880,6 +6880,7 @@ var Dropdown = function (props) {
|
|
|
6880
6880
|
}
|
|
6881
6881
|
setAnchorEl(event.currentTarget);
|
|
6882
6882
|
setOpen(true);
|
|
6883
|
+
onOpen === null || onOpen === void 0 ? void 0 : onOpen(event);
|
|
6883
6884
|
}
|
|
6884
6885
|
}, [
|
|
6885
6886
|
onClick,
|
|
@@ -6889,6 +6890,7 @@ var Dropdown = function (props) {
|
|
|
6889
6890
|
setPendingValue,
|
|
6890
6891
|
value,
|
|
6891
6892
|
handleDropdownClose,
|
|
6893
|
+
onOpen,
|
|
6892
6894
|
]);
|
|
6893
6895
|
var handleClose = React.useCallback(function (event, reason) {
|
|
6894
6896
|
if (reason === "toggleInput")
|
|
@@ -6941,7 +6943,10 @@ var Dropdown = function (props) {
|
|
|
6941
6943
|
}
|
|
6942
6944
|
anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.focus();
|
|
6943
6945
|
setOpen(false);
|
|
6944
|
-
|
|
6946
|
+
// Create a synthetic event for the onClose callback
|
|
6947
|
+
var syntheticEvent = new Event("cancel");
|
|
6948
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(syntheticEvent, "escape");
|
|
6949
|
+
}, [multiple, setPendingValue, value, anchorEl, onClose]);
|
|
6945
6950
|
// Helper function to count multi-column selections
|
|
6946
6951
|
var countMultiColumnSelections = React.useCallback(function (currentValue) {
|
|
6947
6952
|
if (!currentValue || typeof currentValue !== "object")
|
|
@@ -6989,7 +6994,7 @@ var Dropdown = function (props) {
|
|
|
6989
6994
|
countMultiColumnSelections,
|
|
6990
6995
|
getSingleSelectionProps,
|
|
6991
6996
|
]);
|
|
6992
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(InputDropdownComponent, __assign({ disabled: disabled, label: label, onClick: handleClick, "aria-expanded": open, "aria-haspopup": "listbox", multiple: multiple || isMultiColumn }, getInputDropdownProps, InputDropdownProps, rest)), jsxRuntime.jsx(DropdownMenu, __assign({ anchorEl: anchorEl, open: open, search: search, onClose: handleClose, multiple: multiple, disableCloseOnSelect: multiple, options: options, onClickAway: handleClickAway, width: 250, onChange: handleChange, value: multiple ? pendingValue : value, isSearchAutoFocus: isSearchAutoFocus, title: title }, DropdownMenuProps, rest, { children: shouldShowButtons ? (jsxRuntime.jsx(DropdownButtons, { buttonPosition: buttonPosition, onApply: handleButtonClose, onCancel: handleCancel })) : null }))] }));
|
|
6997
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(InputDropdownComponent, __assign({ disabled: disabled, label: label, onClick: handleClick, "aria-expanded": open, "aria-haspopup": "listbox", multiple: multiple || isMultiColumn }, getInputDropdownProps, InputDropdownProps, rest)), jsxRuntime.jsx(DropdownMenu, __assign({ anchorEl: anchorEl, open: open, search: search, onClose: handleClose, onOpen: onOpen, multiple: multiple, disableCloseOnSelect: multiple, options: options, onClickAway: handleClickAway, width: 250, onChange: handleChange, value: multiple ? pendingValue : value, isSearchAutoFocus: isSearchAutoFocus, title: title }, DropdownMenuProps, rest, { children: shouldShowButtons ? (jsxRuntime.jsx(DropdownButtons, { buttonPosition: buttonPosition, onApply: handleButtonClose, onCancel: handleCancel })) : null }))] }));
|
|
6993
6998
|
};
|
|
6994
6999
|
|
|
6995
7000
|
var tagSizeS = function (props) {
|
package/dist/index.esm.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ import { AlertProps } from "@mui/lab";
|
|
|
41
41
|
import { AutocompleteChangeDetails, AutocompleteChangeReason, AutocompleteCloseReason, AutocompleteValue } from "@mui/base";
|
|
42
42
|
import { AlertTitleProps } from "@mui/material/AlertTitle";
|
|
43
43
|
import { AutocompleteValue as AutocompleteValue$1 } from "@mui/material/useAutocomplete";
|
|
44
|
+
import { AutocompleteCloseReason as AutocompleteCloseReason$1 } from "@mui/material/useAutocomplete";
|
|
44
45
|
interface SdsAccordionDetailsProps {
|
|
45
46
|
id?: string;
|
|
46
47
|
}
|
|
@@ -1276,6 +1277,8 @@ interface ExtraDropdownMenuProps extends StyleProps$1 {
|
|
|
1276
1277
|
onClickAway?: (event: MouseEvent | TouchEvent) => void;
|
|
1277
1278
|
ClickAwayListenerProps?: Partial<MUIClickAwayListenerProps>;
|
|
1278
1279
|
width?: number | CSSProperties["width"];
|
|
1280
|
+
onOpen?: (event: React.SyntheticEvent) => void;
|
|
1281
|
+
onClose?: (event: React.SyntheticEvent, reason: AutocompleteCloseReason$0) => void;
|
|
1279
1282
|
}
|
|
1280
1283
|
type CustomAutocompleteProps$1<T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined> = Omit<AutocompleteProps$0<T, Multiple, DisableClearable, FreeSolo>, "renderInput">;
|
|
1281
1284
|
type DropdownMenuProps<T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined> = CustomAutocompleteProps$1<T, Multiple, DisableClearable, FreeSolo> & ExtraDropdownMenuProps;
|
|
@@ -1330,6 +1333,8 @@ interface ExtraDropdownProps<T, Multiple extends boolean | undefined, DisableCle
|
|
|
1330
1333
|
className?: string;
|
|
1331
1334
|
InputDropdownComponent?: typeof InputDropdown;
|
|
1332
1335
|
isTriggerChangeOnOptionClick?: boolean;
|
|
1336
|
+
onOpen?: (event: React.SyntheticEvent) => void;
|
|
1337
|
+
onClose?: (event: React.SyntheticEvent, reason: AutocompleteCloseReason$1) => void;
|
|
1333
1338
|
}
|
|
1334
1339
|
type CustomAutocompleteProps$2<T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined> = Omit<AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>, "renderInput">;
|
|
1335
1340
|
type DropdownProps<T, Multiple extends boolean | undefined, DisableClearable extends boolean | undefined, FreeSolo extends boolean | undefined> = CustomAutocompleteProps$2<T, Multiple, DisableClearable, FreeSolo> & ExtraDropdownProps<T, Multiple, DisableClearable, FreeSolo>;
|
package/dist/index.esm.js
CHANGED
|
@@ -6442,7 +6442,7 @@ var DEFAULT_POPPER_BASE_PROPS = {
|
|
|
6442
6442
|
var DropdownMenu = function (props) {
|
|
6443
6443
|
var _a, _b;
|
|
6444
6444
|
var theme = useTheme$4();
|
|
6445
|
-
var anchorEl = props.anchorEl, id = props.id, InputBaseProps = props.InputBaseProps, _c = props.open, open = _c === void 0 ? false : _c, _d = props.PopperComponent, PopperComponent = _d === void 0 ? StyledPopper : _d, _e = props.PaperComponent, PaperComponent = _e === void 0 ? StyledPaper$1 : _e, _f = props.PopperPlacement, PopperPlacement = _f === void 0 ? "bottom-start" : _f, _g = props.PopperBaseProps, PopperBaseProps = _g === void 0 ? {} : _g, _h = props.isSearchAutoFocus, isSearchAutoFocus = _h === void 0 ? true : _h, _j = props.search, search = _j === void 0 ? false : _j, title = props.title, headerComponentSlot = props.headerComponentSlot, _k = props.label, label = _k === void 0 ? "Search" : _k, children = props.children, options = props.options, _l = props.onClickAway, onClickAway = _l === void 0 ? noop : _l, ClickAwayListenerProps = props.ClickAwayListenerProps, _m = props.width, width = _m === void 0 ? MINIMUM_DROPDOWN_MENU_POPPER_WIDTH : _m, rest = __rest(props, ["anchorEl", "id", "InputBaseProps", "open", "PopperComponent", "PaperComponent", "PopperPlacement", "PopperBaseProps", "isSearchAutoFocus", "search", "title", "headerComponentSlot", "label", "children", "options", "onClickAway", "ClickAwayListenerProps", "width"]);
|
|
6445
|
+
var anchorEl = props.anchorEl, id = props.id, InputBaseProps = props.InputBaseProps, _c = props.open, open = _c === void 0 ? false : _c, _d = props.PopperComponent, PopperComponent = _d === void 0 ? StyledPopper : _d, _e = props.PaperComponent, PaperComponent = _e === void 0 ? StyledPaper$1 : _e, _f = props.PopperPlacement, PopperPlacement = _f === void 0 ? "bottom-start" : _f, _g = props.PopperBaseProps, PopperBaseProps = _g === void 0 ? {} : _g, _h = props.isSearchAutoFocus, isSearchAutoFocus = _h === void 0 ? true : _h, _j = props.search, search = _j === void 0 ? false : _j, title = props.title, headerComponentSlot = props.headerComponentSlot, _k = props.label, label = _k === void 0 ? "Search" : _k, children = props.children, options = props.options, _l = props.onClickAway, onClickAway = _l === void 0 ? noop : _l, ClickAwayListenerProps = props.ClickAwayListenerProps, _m = props.width, width = _m === void 0 ? MINIMUM_DROPDOWN_MENU_POPPER_WIDTH : _m, onOpen = props.onOpen, onClose = props.onClose, rest = __rest(props, ["anchorEl", "id", "InputBaseProps", "open", "PopperComponent", "PaperComponent", "PopperPlacement", "PopperBaseProps", "isSearchAutoFocus", "search", "title", "headerComponentSlot", "label", "children", "options", "onClickAway", "ClickAwayListenerProps", "width", "onOpen", "onClose"]);
|
|
6446
6446
|
var isMultiColumn = "options" in ((options === null || options === void 0 ? void 0 : options[0]) || EMPTY_OBJECT);
|
|
6447
6447
|
// (masoudmanson): The DropdownMenu's Popper component should have a minimum
|
|
6448
6448
|
// width of MINIMUM_DROPDOWN_MENU_POPPER_WIDTH pixels if the DropdownMenu is
|
|
@@ -6464,7 +6464,7 @@ var DropdownMenu = function (props) {
|
|
|
6464
6464
|
], open: open, anchorEl: anchorEl, placement: PopperPlacement }, PopperBaseProps, {
|
|
6465
6465
|
// (masoudmanson): To override the width of the Popper,
|
|
6466
6466
|
// the sx prop's value must be set after spreading the PopperBaseProps.
|
|
6467
|
-
sx: dropdownMenuPopperSx, children: jsx(PaperComponent, { children: jsx(ClickAwayListener, __assign({ onClickAway: onClickAway }, ClickAwayListenerProps, { children: jsxs(StyledDropdownMenuAutocompleteWrapper, { search: search, titleValue: !!(title || headerComponentSlot), children: [(title || headerComponentSlot) && (jsxs(StyledDropdownMenuHeader, { search: search, children: [title && jsx(StyledHeaderTitle, { children: title }), headerComponentSlot && jsx(Fragment, { children: headerComponentSlot })] })), anchorEl && (jsx(Autocomplete, __assign({ label: label, search: search, title: title, open: open, options: options, PopperBaseProps: DEFAULT_POPPER_BASE_PROPS, disablePortal: true, onClickAway: noop, onClick: noop }, rest, { InputBaseProps: DefaultInputBaseProps }))), children] }) })) }) })));
|
|
6467
|
+
sx: dropdownMenuPopperSx, children: jsx(PaperComponent, { children: jsx(ClickAwayListener, __assign({ onClickAway: onClickAway }, ClickAwayListenerProps, { children: jsxs(StyledDropdownMenuAutocompleteWrapper, { search: search, titleValue: !!(title || headerComponentSlot), children: [(title || headerComponentSlot) && (jsxs(StyledDropdownMenuHeader, { search: search, children: [title && jsx(StyledHeaderTitle, { children: title }), headerComponentSlot && jsx(Fragment, { children: headerComponentSlot })] })), anchorEl && (jsx(Autocomplete, __assign({ label: label, search: search, title: title, open: open, options: options, PopperBaseProps: DEFAULT_POPPER_BASE_PROPS, disablePortal: true, onClickAway: noop, onClick: noop, onOpen: onOpen, onClose: onClose }, rest, { InputBaseProps: DefaultInputBaseProps }))), children] }) })) }) })));
|
|
6468
6468
|
};
|
|
6469
6469
|
|
|
6470
6470
|
var doNotForwardProps$s = [
|
|
@@ -6760,7 +6760,7 @@ var Dropdown = function (props) {
|
|
|
6760
6760
|
// which by default will not close on blur. If closeOnBlur is enabled, clicking out
|
|
6761
6761
|
// is equivalent to clicking the Cancel button, closing the dropdown and losing
|
|
6762
6762
|
// unapplied changes.
|
|
6763
|
-
closeOnBlur = _g === void 0 ? !buttons : _g, onClose = props.onClose, onChange = props.onChange, title = props.title, _h = props.DropdownMenuProps, DropdownMenuProps = _h === void 0 ? {} : _h, InputDropdownProps = props.InputDropdownProps, _j = props.InputDropdownComponent, InputDropdownComponent = _j === void 0 ? InputDropdown : _j, _k = props.isTriggerChangeOnOptionClick, isTriggerChangeOnOptionClick = _k === void 0 ? false : _k, _l = props.disabled, disabled = _l === void 0 ? false : _l, propValue = props.value, onClick = props.onClick, rest = __rest(props, ["options", "label", "multiple", "search", "isSearchAutoFocus", "buttonPosition", "buttons", "closeOnBlur", "onClose", "onChange", "title", "DropdownMenuProps", "InputDropdownProps", "InputDropdownComponent", "isTriggerChangeOnOptionClick", "disabled", "value", "onClick"]);
|
|
6763
|
+
closeOnBlur = _g === void 0 ? !buttons : _g, onClose = props.onClose, onOpen = props.onOpen, onChange = props.onChange, title = props.title, _h = props.DropdownMenuProps, DropdownMenuProps = _h === void 0 ? {} : _h, InputDropdownProps = props.InputDropdownProps, _j = props.InputDropdownComponent, InputDropdownComponent = _j === void 0 ? InputDropdown : _j, _k = props.isTriggerChangeOnOptionClick, isTriggerChangeOnOptionClick = _k === void 0 ? false : _k, _l = props.disabled, disabled = _l === void 0 ? false : _l, propValue = props.value, onClick = props.onClick, rest = __rest(props, ["options", "label", "multiple", "search", "isSearchAutoFocus", "buttonPosition", "buttons", "closeOnBlur", "onClose", "onOpen", "onChange", "title", "DropdownMenuProps", "InputDropdownProps", "InputDropdownComponent", "isTriggerChangeOnOptionClick", "disabled", "value", "onClick"]);
|
|
6764
6764
|
if (buttons && !multiple) {
|
|
6765
6765
|
// eslint-disable-next-line no-console
|
|
6766
6766
|
console.warn("Warning: buttons are only supported for multiple select dropdowns.");
|
|
@@ -6857,6 +6857,7 @@ var Dropdown = function (props) {
|
|
|
6857
6857
|
}
|
|
6858
6858
|
setAnchorEl(event.currentTarget);
|
|
6859
6859
|
setOpen(true);
|
|
6860
|
+
onOpen === null || onOpen === void 0 ? void 0 : onOpen(event);
|
|
6860
6861
|
}
|
|
6861
6862
|
}, [
|
|
6862
6863
|
onClick,
|
|
@@ -6866,6 +6867,7 @@ var Dropdown = function (props) {
|
|
|
6866
6867
|
setPendingValue,
|
|
6867
6868
|
value,
|
|
6868
6869
|
handleDropdownClose,
|
|
6870
|
+
onOpen,
|
|
6869
6871
|
]);
|
|
6870
6872
|
var handleClose = useCallback(function (event, reason) {
|
|
6871
6873
|
if (reason === "toggleInput")
|
|
@@ -6918,7 +6920,10 @@ var Dropdown = function (props) {
|
|
|
6918
6920
|
}
|
|
6919
6921
|
anchorEl === null || anchorEl === void 0 ? void 0 : anchorEl.focus();
|
|
6920
6922
|
setOpen(false);
|
|
6921
|
-
|
|
6923
|
+
// Create a synthetic event for the onClose callback
|
|
6924
|
+
var syntheticEvent = new Event("cancel");
|
|
6925
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(syntheticEvent, "escape");
|
|
6926
|
+
}, [multiple, setPendingValue, value, anchorEl, onClose]);
|
|
6922
6927
|
// Helper function to count multi-column selections
|
|
6923
6928
|
var countMultiColumnSelections = useCallback(function (currentValue) {
|
|
6924
6929
|
if (!currentValue || typeof currentValue !== "object")
|
|
@@ -6966,7 +6971,7 @@ var Dropdown = function (props) {
|
|
|
6966
6971
|
countMultiColumnSelections,
|
|
6967
6972
|
getSingleSelectionProps,
|
|
6968
6973
|
]);
|
|
6969
|
-
return (jsxs(Fragment, { children: [jsx(InputDropdownComponent, __assign({ disabled: disabled, label: label, onClick: handleClick, "aria-expanded": open, "aria-haspopup": "listbox", multiple: multiple || isMultiColumn }, getInputDropdownProps, InputDropdownProps, rest)), jsx(DropdownMenu, __assign({ anchorEl: anchorEl, open: open, search: search, onClose: handleClose, multiple: multiple, disableCloseOnSelect: multiple, options: options, onClickAway: handleClickAway, width: 250, onChange: handleChange, value: multiple ? pendingValue : value, isSearchAutoFocus: isSearchAutoFocus, title: title }, DropdownMenuProps, rest, { children: shouldShowButtons ? (jsx(DropdownButtons, { buttonPosition: buttonPosition, onApply: handleButtonClose, onCancel: handleCancel })) : null }))] }));
|
|
6974
|
+
return (jsxs(Fragment, { children: [jsx(InputDropdownComponent, __assign({ disabled: disabled, label: label, onClick: handleClick, "aria-expanded": open, "aria-haspopup": "listbox", multiple: multiple || isMultiColumn }, getInputDropdownProps, InputDropdownProps, rest)), jsx(DropdownMenu, __assign({ anchorEl: anchorEl, open: open, search: search, onClose: handleClose, onOpen: onOpen, multiple: multiple, disableCloseOnSelect: multiple, options: options, onClickAway: handleClickAway, width: 250, onChange: handleChange, value: multiple ? pendingValue : value, isSearchAutoFocus: isSearchAutoFocus, title: title }, DropdownMenuProps, rest, { children: shouldShowButtons ? (jsx(DropdownButtons, { buttonPosition: buttonPosition, onApply: handleButtonClose, onCancel: handleCancel })) : null }))] }));
|
|
6970
6975
|
};
|
|
6971
6976
|
|
|
6972
6977
|
var tagSizeS = function (props) {
|