@elementor/editor-controls 3.35.0-337 → 3.35.0-338

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.mjs CHANGED
@@ -399,43 +399,52 @@ import * as React10 from "react";
399
399
  import { stringPropTypeUtil } from "@elementor/editor-props";
400
400
  import { MenuListItem } from "@elementor/editor-ui";
401
401
  import { Select, Typography } from "@elementor/ui";
402
- var SelectControl = createControl(({ options, onChange, MenuProps, ariaLabel }) => {
403
- const { value, setValue, disabled, placeholder } = useBoundProp(stringPropTypeUtil);
404
- const handleChange = (event) => {
405
- const newValue = event.target.value || null;
406
- onChange?.(newValue, value);
407
- setValue(newValue);
408
- };
409
- const isDisabled = disabled || options.length === 0;
410
- return /* @__PURE__ */ React10.createElement(ControlActions, null, /* @__PURE__ */ React10.createElement(
411
- Select,
412
- {
413
- sx: { overflow: "hidden" },
414
- displayEmpty: true,
415
- size: "tiny",
416
- MenuProps,
417
- "aria-label": ariaLabel || placeholder,
418
- renderValue: (selectedValue) => {
419
- const findOptionByValue = (searchValue) => options.find((opt) => opt.value === searchValue);
420
- if (!selectedValue || selectedValue === "") {
421
- if (placeholder) {
422
- const placeholderOption = findOptionByValue(placeholder);
423
- const displayText = placeholderOption?.label || placeholder;
424
- return /* @__PURE__ */ React10.createElement(Typography, { component: "span", variant: "caption", color: "text.tertiary" }, displayText);
402
+ var DEFAULT_MENU_PROPS = {
403
+ MenuListProps: {
404
+ sx: {
405
+ maxHeight: "160px"
406
+ }
407
+ }
408
+ };
409
+ var SelectControl = createControl(
410
+ ({ options, onChange, MenuProps = DEFAULT_MENU_PROPS, ariaLabel }) => {
411
+ const { value, setValue, disabled, placeholder } = useBoundProp(stringPropTypeUtil);
412
+ const handleChange = (event) => {
413
+ const newValue = event.target.value || null;
414
+ onChange?.(newValue, value);
415
+ setValue(newValue);
416
+ };
417
+ const isDisabled = disabled || options.length === 0;
418
+ return /* @__PURE__ */ React10.createElement(ControlActions, null, /* @__PURE__ */ React10.createElement(
419
+ Select,
420
+ {
421
+ sx: { overflow: "hidden" },
422
+ displayEmpty: true,
423
+ size: "tiny",
424
+ MenuProps,
425
+ "aria-label": ariaLabel || placeholder,
426
+ renderValue: (selectedValue) => {
427
+ const findOptionByValue = (searchValue) => options.find((opt) => opt.value === searchValue);
428
+ if (!selectedValue || selectedValue === "") {
429
+ if (placeholder) {
430
+ const placeholderOption = findOptionByValue(placeholder);
431
+ const displayText = placeholderOption?.label || placeholder;
432
+ return /* @__PURE__ */ React10.createElement(Typography, { component: "span", variant: "caption", color: "text.tertiary" }, displayText);
433
+ }
434
+ return "";
425
435
  }
426
- return "";
427
- }
428
- const option = findOptionByValue(selectedValue);
429
- return option?.label || selectedValue;
436
+ const option = findOptionByValue(selectedValue);
437
+ return option?.label || selectedValue;
438
+ },
439
+ value: value ?? "",
440
+ onChange: handleChange,
441
+ disabled: isDisabled,
442
+ fullWidth: true
430
443
  },
431
- value: value ?? "",
432
- onChange: handleChange,
433
- disabled: isDisabled,
434
- fullWidth: true
435
- },
436
- options.map(({ label, ...props }) => /* @__PURE__ */ React10.createElement(MenuListItem, { key: props.value, ...props, value: props.value ?? "" }, label))
437
- ));
438
- });
444
+ options.map(({ label, ...props }) => /* @__PURE__ */ React10.createElement(MenuListItem, { key: props.value, ...props, value: props.value ?? "" }, label))
445
+ ));
446
+ }
447
+ );
439
448
 
440
449
  // src/controls/image-control.tsx
441
450
  var ImageControl = createControl(({ sizes, showMode = "all" }) => {