@czi-sds/components 20.1.0 → 20.1.2
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 +19 -7
- package/dist/index.cjs.js +139 -34
- package/dist/index.esm.d.ts +19 -7
- package/dist/index.esm.js +139 -34
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -140,6 +140,9 @@ var SDSAppTheme = {
|
|
|
140
140
|
s: 2,
|
|
141
141
|
},
|
|
142
142
|
fontWeights: {
|
|
143
|
+
bold: 700,
|
|
144
|
+
light: 300,
|
|
145
|
+
medium: 800,
|
|
143
146
|
regular: 400,
|
|
144
147
|
semibold: 600,
|
|
145
148
|
},
|
|
@@ -441,6 +444,14 @@ var SDSAppTheme = {
|
|
|
441
444
|
},
|
|
442
445
|
},
|
|
443
446
|
};
|
|
447
|
+
/**
|
|
448
|
+
* (masoudmanson): This is to make sure that the old defaultAppTheme
|
|
449
|
+
* export is still available for backward compatibility.
|
|
450
|
+
*
|
|
451
|
+
* @deprecated
|
|
452
|
+
* Please use `SDSAppTheme` instead. This export will be removed in the future.
|
|
453
|
+
*/
|
|
454
|
+
var defaultAppTheme = SDSAppTheme;
|
|
444
455
|
// (mlila) whenever our theme uses colors, we need to make sure we allow consuming
|
|
445
456
|
// applications to override those colors using their own custom theme.
|
|
446
457
|
// By defining borders using SDSAppTheme.colors instead of defaultThemeColors,
|
|
@@ -799,10 +810,6 @@ function makeThemeOptions(appTheme) {
|
|
|
799
810
|
|
|
800
811
|
var defaultThemeOptions = makeThemeOptions(SDSAppTheme);
|
|
801
812
|
var defaultTheme = createTheme(defaultThemeOptions);
|
|
802
|
-
/**
|
|
803
|
-
* (masoudmanson): This is to keep the old defaultAppTheme export for backward compatibility.
|
|
804
|
-
*/
|
|
805
|
-
var defaultAppTheme = defaultTheme;
|
|
806
813
|
|
|
807
814
|
function focusVisibleA11yStyle() {
|
|
808
815
|
return "\n &.Mui-focusVisible, &:focus-visible {\n outline: 5px auto Highlight;\n outline: 5px auto -webkit-focus-ring-color;\n }\n ";
|
|
@@ -4238,25 +4245,37 @@ var StyledMenuItemText = styled("div")(templateObject_6$7 || (templateObject_6$7
|
|
|
4238
4245
|
var templateObject_1$K, templateObject_2$s, templateObject_3$k, templateObject_4$h, templateObject_5$b, templateObject_6$7;
|
|
4239
4246
|
|
|
4240
4247
|
var AutocompleteBase = function (props) {
|
|
4241
|
-
var multiple = props.multiple, _a = props.disableCloseOnSelect, disableCloseOnSelect = _a === void 0 ? multiple : _a, _b = props.getOptionLabel, getOptionLabel = _b === void 0 ? defaultGetOptionLabel : _b, _c = props.InputBaseProps, InputBaseProps = _c === void 0 ? EMPTY_OBJECT : _c, _d = props.isOptionEqualToValue, isOptionEqualToValue = _d === void 0 ? defaultIsOptionEqualToValue : _d, _e = props.keepSearchOnSelect, keepSearchOnSelect = _e === void 0 ? false : _e, _f = props.label, label = _f === void 0 ? "Label" : _f, _g = props.loading, loading = _g === void 0 ? false : _g, _h = props.loadingText, loadingText = _h === void 0 ? "" : _h, _j = props.noOptionsText, noOptionsText = _j === void 0 ? "No options" : _j, _k = props.onInputChange, onInputChange = _k === void 0 ? noop : _k, _l = props.renderOption, renderOption = _l === void 0 ? defaultRenderOption : _l, _m = props.renderTags, renderTags = _m === void 0 ? defaultRenderTags : _m, _o = props.search, search = _o === void 0 ? false : _o, _p = props.clearOnBlur, clearOnBlur = _p === void 0 ? false : _p, _q = props.blurOnSelect, blurOnSelect = _q === void 0 ? !multiple : _q;
|
|
4248
|
+
var multiple = props.multiple, _a = props.disableCloseOnSelect, disableCloseOnSelect = _a === void 0 ? multiple : _a, _b = props.getOptionLabel, getOptionLabel = _b === void 0 ? defaultGetOptionLabel : _b, _c = props.InputBaseProps, InputBaseProps = _c === void 0 ? EMPTY_OBJECT : _c, _d = props.isOptionEqualToValue, isOptionEqualToValue = _d === void 0 ? defaultIsOptionEqualToValue : _d, _e = props.keepSearchOnSelect, keepSearchOnSelect = _e === void 0 ? false : _e, _f = props.label, label = _f === void 0 ? "Label" : _f, _g = props.loading, loading = _g === void 0 ? false : _g, _h = props.loadingText, loadingText = _h === void 0 ? "" : _h, _j = props.noOptionsText, noOptionsText = _j === void 0 ? "No options" : _j, _k = props.onInputChange, onInputChange = _k === void 0 ? noop : _k, _l = props.renderOption, renderOption = _l === void 0 ? defaultRenderOption : _l, _m = props.renderTags, renderTags = _m === void 0 ? defaultRenderTags : _m, _o = props.search, search = _o === void 0 ? false : _o, _p = props.clearOnBlur, clearOnBlur = _p === void 0 ? false : _p, _q = props.blurOnSelect, blurOnSelect = _q === void 0 ? !multiple : _q, onClickAway = props.onClickAway, onClick = props.onClick, onOpen = props.onOpen, onClose = props.onClose;
|
|
4242
4249
|
var theme = useTheme();
|
|
4243
4250
|
var _r = useState(""), inputValue = _r[0], setInputValue = _r[1];
|
|
4244
|
-
return (jsx(StyledAutocompleteBase, __assign({ clearOnBlur: clearOnBlur, disableCloseOnSelect: disableCloseOnSelect, disablePortal: true, renderTags: renderTags, loading: loading, loadingText: loadingText, noOptionsText: noOptionsText, PaperComponent: StyledPaper$3, PopperComponent: useDefaultPopperComponent(), renderOption: renderOption, getOptionLabel: getOptionLabel, isOptionEqualToValue: isOptionEqualToValue, inputValue: inputValue, renderInput: defaultRenderInput, multiple: multiple
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4251
|
+
return (jsx(StyledAutocompleteBase, __assign({ clearOnBlur: clearOnBlur, disableCloseOnSelect: disableCloseOnSelect, disablePortal: true, renderTags: renderTags, loading: loading, loadingText: loadingText, noOptionsText: noOptionsText, PaperComponent: StyledPaper$3, PopperComponent: useDefaultPopperComponent(), renderOption: renderOption, getOptionLabel: getOptionLabel, isOptionEqualToValue: isOptionEqualToValue, inputValue: inputValue, renderInput: defaultRenderInput, multiple: multiple,
|
|
4252
|
+
/**
|
|
4253
|
+
* (masoudmanson): Overrides the onOpen and onClose handlers to ensure that
|
|
4254
|
+
* the onClick and onClickAway handlers are triggered when a controlled dropdown
|
|
4255
|
+
* is opened or closed, respectively.
|
|
4256
|
+
*/
|
|
4257
|
+
onOpen: defaultOnOpen, onClose: defaultOnClose }, props, {
|
|
4258
|
+
/**
|
|
4259
|
+
* (masoudmanson): For multiple options (multiple = true), setting blurOnSelect to false
|
|
4260
|
+
* keeps the dropdown open after selecting an option. This feature enhances user experience
|
|
4261
|
+
* by preventing the dropdown from closing, enabling users to select multiple options
|
|
4262
|
+
* without having to reopen the menu repeatedly.
|
|
4263
|
+
*/
|
|
4249
4264
|
blurOnSelect: multiple ? false : blurOnSelect,
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4265
|
+
/**
|
|
4266
|
+
* (masoudmanson): Given the necessity of maintaining consistent onBlur functionality,
|
|
4267
|
+
* and clearing the input value on blur, it's crucial to include the onBlur handler
|
|
4268
|
+
* after spreading other props. Furthermore, within the defaultOnBlur function, the
|
|
4269
|
+
* actual onBlur function is invoked for completeness.
|
|
4270
|
+
*/
|
|
4254
4271
|
onBlur: defaultOnBlur,
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4272
|
+
/**
|
|
4273
|
+
* (masoudmanson): To ensure component-level actions (changing the input field value)
|
|
4274
|
+
* trigger upon input changes, it's crucial to position the onInputChange handler after
|
|
4275
|
+
* spreading the other props. Furthermore, within the defaultOnInputChange function,
|
|
4276
|
+
* the provided onInputChange from props is called at the end to emit the input changes
|
|
4277
|
+
* to the user.
|
|
4278
|
+
*/
|
|
4260
4279
|
onInputChange: defaultOnInputChange })));
|
|
4261
4280
|
/**
|
|
4262
4281
|
* (masoudmanson): Using a custom Popper or Paper with the Autocomplete
|
|
@@ -4300,6 +4319,24 @@ var AutocompleteBase = function (props) {
|
|
|
4300
4319
|
setInputValue("");
|
|
4301
4320
|
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
4302
4321
|
}
|
|
4322
|
+
/**
|
|
4323
|
+
* (masoudmanson): The default onOpen handler is the Callback fired when the popup
|
|
4324
|
+
* requests to be opened. This function is responsible for invoking the onOpen and onClick
|
|
4325
|
+
* handlers when a controlled dropdown is opening.
|
|
4326
|
+
*/
|
|
4327
|
+
function defaultOnOpen(event) {
|
|
4328
|
+
onOpen === null || onOpen === void 0 ? void 0 : onOpen(event);
|
|
4329
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
4330
|
+
}
|
|
4331
|
+
/**
|
|
4332
|
+
* (masoudmanson): The default onClose handler is the callback fired when the popup
|
|
4333
|
+
* requests to be closed. This function is responsible for invoking the onClose and onClickAway
|
|
4334
|
+
* handlers when a controlled dropdown is closing.
|
|
4335
|
+
*/
|
|
4336
|
+
function defaultOnClose(event, reason) {
|
|
4337
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(event, reason);
|
|
4338
|
+
onClickAway === null || onClickAway === void 0 ? void 0 : onClickAway(event, reason);
|
|
4339
|
+
}
|
|
4303
4340
|
function defaultOnInputChange(event, value, reason) {
|
|
4304
4341
|
if (!multiple) {
|
|
4305
4342
|
if (reason === "input") {
|
|
@@ -4460,16 +4497,26 @@ var templateObject_1$I, templateObject_2$q, templateObject_3$i, templateObject_4
|
|
|
4460
4497
|
|
|
4461
4498
|
var AutocompleteMultiColumn = function (props) {
|
|
4462
4499
|
var _a;
|
|
4463
|
-
var InputBaseProps = props.InputBaseProps,
|
|
4500
|
+
var InputBaseProps = props.InputBaseProps, open = props.open, _b = props.PopperPlacement, PopperPlacement = _b === void 0 ? "bottom-start" : _b, PopperBaseProps = props.PopperBaseProps, _c = props.search, search = _c === void 0 ? false : _c, _d = props.label, label = _d === void 0 ? "Search" : _d, onClickAway = props.onClickAway, onClick = props.onClick, ClickAwayListenerProps = props.ClickAwayListenerProps, options = props.options, onInputChange = props.onInputChange, onBlur = props.onBlur, multiple = props.multiple, parentInitialValue = props.value, onChange = props.onChange, _e = props.PopperComponent, PopperComponent = _e === void 0 ? StyledPopper$2 : _e, rest = __rest(props, ["InputBaseProps", "open", "PopperPlacement", "PopperBaseProps", "search", "label", "onClickAway", "onClick", "ClickAwayListenerProps", "options", "onInputChange", "onBlur", "multiple", "value", "onChange", "PopperComponent"]);
|
|
4464
4501
|
var theme = useTheme();
|
|
4465
|
-
var
|
|
4466
|
-
var
|
|
4502
|
+
var isOpenControlled = open !== undefined;
|
|
4503
|
+
var _f = useState(""), inputValue = _f[0], setInputValue = _f[1];
|
|
4504
|
+
var _g = useState(isOpenControlled ? open : false), popperOpen = _g[0], setPopperOpen = _g[1];
|
|
4505
|
+
/**
|
|
4506
|
+
* (masoudmanson): This useEffect is used to update the popperOpen state
|
|
4507
|
+
* when the open prop is controlled.
|
|
4508
|
+
*/
|
|
4509
|
+
useEffect(function () {
|
|
4510
|
+
if (isOpenControlled) {
|
|
4511
|
+
setPopperOpen(open);
|
|
4512
|
+
}
|
|
4513
|
+
}, [isOpenControlled, open]);
|
|
4467
4514
|
var anchorRef = useRef(null);
|
|
4468
|
-
var
|
|
4515
|
+
var _h = React__default.useState(null), anchorEl = _h[0], setAnchorEl = _h[1];
|
|
4469
4516
|
useEffect(function () {
|
|
4470
4517
|
setAnchorEl(anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current);
|
|
4471
4518
|
}, [anchorRef]);
|
|
4472
|
-
var
|
|
4519
|
+
var _j = useState({}), autocompleteMultiColumnValue = _j[0], setAutocompleteMultiColumnValue = _j[1];
|
|
4473
4520
|
useEffect(function () {
|
|
4474
4521
|
if (parentInitialValue !== undefined) {
|
|
4475
4522
|
setAutocompleteMultiColumnValue(parentInitialValue);
|
|
@@ -4483,7 +4530,7 @@ var AutocompleteMultiColumn = function (props) {
|
|
|
4483
4530
|
});
|
|
4484
4531
|
onChange === null || onChange === void 0 ? void 0 : onChange(event, __assign(__assign({}, autocompleteMultiColumnValue), (_a = {}, _a[column] = val, _a)), reason, details);
|
|
4485
4532
|
};
|
|
4486
|
-
return (jsx(ClickAwayListener, __assign({ onClickAway:
|
|
4533
|
+
return (jsx(ClickAwayListener, __assign({ onClickAway: defaultOnClickAway }, ClickAwayListenerProps, { children: jsxs("div", { children: [jsx(StyledAutocompleteInput, __assign({ id: "location-search", label: label, placeholder: label, value: inputValue, onChange: handleInputChange, onClick: handleInputClick, onBlur: handleInputBlur, ref: anchorRef, search: search, onKeyDown: handleInputKeyDown, InputProps: __assign(__assign({}, InputBaseProps === null || InputBaseProps === void 0 ? void 0 : InputBaseProps.ref), { endAdornment: (jsx(StyledInputAdornment, { position: "end", children: inputValue && (jsx(Button, { "aria-label": "clear-button", className: "input-search-clear-icon", sdsType: "tertiary", sdsSize: "small", sdsStyle: "icon", sdsIconProps: {
|
|
4487
4534
|
sdsType: "iconButton",
|
|
4488
4535
|
}, icon: "XMarkCircle", onClick: clearInput })) })),
|
|
4489
4536
|
/**
|
|
@@ -4510,7 +4557,22 @@ var AutocompleteMultiColumn = function (props) {
|
|
|
4510
4557
|
*/
|
|
4511
4558
|
onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange({ target: { value: "" } }, "", "clear");
|
|
4512
4559
|
}
|
|
4513
|
-
function handleInputClick(
|
|
4560
|
+
function handleInputClick(event) {
|
|
4561
|
+
/**
|
|
4562
|
+
* (masoudmanson): Because the Autocomplete component overrides the
|
|
4563
|
+
* InputSearch's onClick, we must also include the parent onClick here.
|
|
4564
|
+
*/
|
|
4565
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
4566
|
+
/**
|
|
4567
|
+
* (masoudmanson): If the dropdown is controlled, we call the onClick prop to allow the parent
|
|
4568
|
+
* to handle the opening and closing of the dropdown.
|
|
4569
|
+
*/
|
|
4570
|
+
if (isOpenControlled) {
|
|
4571
|
+
return;
|
|
4572
|
+
}
|
|
4573
|
+
/**
|
|
4574
|
+
* (masoudmanson): If the dropdown is not controlled, we toggle the dropdown open and closed.
|
|
4575
|
+
*/
|
|
4514
4576
|
if (popperOpen) {
|
|
4515
4577
|
setPopperOpen(false);
|
|
4516
4578
|
}
|
|
@@ -4534,13 +4596,55 @@ var AutocompleteMultiColumn = function (props) {
|
|
|
4534
4596
|
setInputValue("");
|
|
4535
4597
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
4536
4598
|
}
|
|
4537
|
-
|
|
4538
|
-
|
|
4599
|
+
/**
|
|
4600
|
+
* (masoudmanson): This is the default onClickAway handler for the Autocomplete component.
|
|
4601
|
+
* It is used to close the dropdown when the user clicks away from the dropdown. It also
|
|
4602
|
+
* calls the parent onClickAway prop if it is provided.
|
|
4603
|
+
*/
|
|
4604
|
+
function defaultOnClickAway(event) {
|
|
4605
|
+
/**
|
|
4606
|
+
* (masoudmanson): We only want to close the dropdown if it is open.
|
|
4607
|
+
* This may sound unnecessary, but it is to prevent the dropdown from
|
|
4608
|
+
* calling the parent onClickAway prop when the dropdown is closed.
|
|
4609
|
+
*/
|
|
4610
|
+
if (popperOpen) {
|
|
4611
|
+
onClickAway === null || onClickAway === void 0 ? void 0 : onClickAway(event, "blur");
|
|
4612
|
+
/**
|
|
4613
|
+
* (masoudmanson): If the dropdown is controlled, we call the onClickAway prop to allow the parent
|
|
4614
|
+
* to handle the closing of the dropdown.
|
|
4615
|
+
*/
|
|
4616
|
+
if (isOpenControlled)
|
|
4617
|
+
return;
|
|
4618
|
+
// (masoudmanson): If the dropdown is not controlled, we close the dropdown.
|
|
4619
|
+
setPopperOpen(false);
|
|
4620
|
+
}
|
|
4539
4621
|
}
|
|
4540
4622
|
function handleInputKeyDown(event) {
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4623
|
+
var _a;
|
|
4624
|
+
/**
|
|
4625
|
+
* (masoudmanson): Because the Autocomplete component overrides the
|
|
4626
|
+
* InputSearch's onKeyDown, we must also include the user defined onKeyDown here.
|
|
4627
|
+
*/
|
|
4628
|
+
if (props === null || props === void 0 ? void 0 : props.onKeyDown) {
|
|
4629
|
+
(_a = props === null || props === void 0 ? void 0 : props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
4630
|
+
}
|
|
4631
|
+
else {
|
|
4632
|
+
// (masoudmanson): This prevents Backspace from deselecting selected dropdown options.
|
|
4633
|
+
if (event.key === "Backspace") {
|
|
4634
|
+
event.stopPropagation();
|
|
4635
|
+
}
|
|
4636
|
+
/**
|
|
4637
|
+
* (masoudmanson): This is to handle the Escape key to close the dropdown.
|
|
4638
|
+
* If the dropdown is controlled, we call the onClick prop to allow the parent
|
|
4639
|
+
* to handle the closing of the dropdown.
|
|
4640
|
+
*/
|
|
4641
|
+
if (event.key === "Escape") {
|
|
4642
|
+
if (isOpenControlled) {
|
|
4643
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
4644
|
+
return;
|
|
4645
|
+
}
|
|
4646
|
+
setPopperOpen(false);
|
|
4647
|
+
}
|
|
4544
4648
|
}
|
|
4545
4649
|
}
|
|
4546
4650
|
};
|
|
@@ -4552,7 +4656,7 @@ var Autocomplete = function (props) {
|
|
|
4552
4656
|
if (options.length > 1) {
|
|
4553
4657
|
return (jsx(AutocompleteMultiColumn, __assign({ options: options, value: value, onChange: onChange }, rest, {
|
|
4554
4658
|
// (masoudmanson): groupBy option is disabled on MultiColumn dropdowns
|
|
4555
|
-
groupBy: undefined
|
|
4659
|
+
groupBy: undefined })));
|
|
4556
4660
|
}
|
|
4557
4661
|
else {
|
|
4558
4662
|
return (jsx(AutocompleteBase, __assign({ options: options[0].options, value: value, onChange: onChange }, rest)));
|
|
@@ -5226,7 +5330,7 @@ var DropdownMenu = function (props) {
|
|
|
5226
5330
|
], open: open, anchorEl: anchorEl, placement: PopperPlacement }, PopperBaseProps, {
|
|
5227
5331
|
// (masoudmanson): To override the width of the Popper,
|
|
5228
5332
|
// the sx prop's value must be set after spreading the PopperBaseProps.
|
|
5229
|
-
sx: dropdownMenuPopperSx, children: jsx(PaperComponent, { children: jsx(ClickAwayListener, __assign({ onClickAway: onClickAway }, ClickAwayListenerProps, { children: jsxs(StyledDropdownMenuAutocompleteWrapper, { children: [title && (jsx(StyledHeaderTitle, { search: search, children: title })), anchorEl && (jsx(Autocomplete, __assign({ label: label, search: search, title: title, open: open, options: options, PopperBaseProps: DEFAULT_POPPER_BASE_PROPS, disablePortal: true, onClickAway: noop }, rest, { InputBaseProps: DefaultInputBaseProps }))), children] }) })) }) })));
|
|
5333
|
+
sx: dropdownMenuPopperSx, children: jsx(PaperComponent, { children: jsx(ClickAwayListener, __assign({ onClickAway: onClickAway }, ClickAwayListenerProps, { children: jsxs(StyledDropdownMenuAutocompleteWrapper, { children: [title && (jsx(StyledHeaderTitle, { search: search, children: title })), 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] }) })) }) })));
|
|
5230
5334
|
};
|
|
5231
5335
|
|
|
5232
5336
|
var doNotForwardProps$e = [
|
|
@@ -5823,7 +5927,7 @@ var Dropdown = function (props) {
|
|
|
5823
5927
|
// which by default will not close on blur. If closeOnBlur is enabled, clicking out
|
|
5824
5928
|
// is equivalent to clicking the Cancel button, closing the dropdown and losing
|
|
5825
5929
|
// unapplied changes.
|
|
5826
|
-
closeOnBlur = _f === void 0 ? !buttons : _f, onClose = props.onClose, onChange = props.onChange, _g = props.DropdownMenuProps, DropdownMenuProps = _g === void 0 ? {} : _g, _h = props.InputDropdownProps, InputDropdownProps = _h === void 0 ? { sdsStyle: "minimal" } : _h, _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, rest = __rest(props, ["options", "label", "multiple", "search", "buttonPosition", "buttons", "closeOnBlur", "onClose", "onChange", "DropdownMenuProps", "InputDropdownProps", "InputDropdownComponent", "isTriggerChangeOnOptionClick", "disabled", "value"]);
|
|
5930
|
+
closeOnBlur = _f === void 0 ? !buttons : _f, onClose = props.onClose, onChange = props.onChange, _g = props.DropdownMenuProps, DropdownMenuProps = _g === void 0 ? {} : _g, _h = props.InputDropdownProps, InputDropdownProps = _h === void 0 ? { sdsStyle: "minimal" } : _h, _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", "buttonPosition", "buttons", "closeOnBlur", "onClose", "onChange", "DropdownMenuProps", "InputDropdownProps", "InputDropdownComponent", "isTriggerChangeOnOptionClick", "disabled", "value", "onClick"]);
|
|
5827
5931
|
if (buttons && !multiple) {
|
|
5828
5932
|
// eslint-disable-next-line no-console
|
|
5829
5933
|
console.warn("Warning: buttons are only supported for multiple select dropdowns.");
|
|
@@ -5873,6 +5977,7 @@ var Dropdown = function (props) {
|
|
|
5873
5977
|
}
|
|
5874
5978
|
}
|
|
5875
5979
|
function handleClick(event) {
|
|
5980
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
5876
5981
|
if (open) {
|
|
5877
5982
|
if (!shouldShowButtons) {
|
|
5878
5983
|
if (multiple) {
|