@elementor/editor-controls 3.33.0-296 → 3.33.0-297

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.d.mts CHANGED
@@ -513,6 +513,7 @@ type RepeaterProps<T> = {
513
513
  setValues: (newValue: T[], _: CreateOptions, meta?: SetRepeaterValuesMeta<T>) => void;
514
514
  disabled?: boolean;
515
515
  disableAddItemButton?: boolean;
516
+ addButtonInfotipContent?: React$1.ReactNode;
516
517
  showDuplicate?: boolean;
517
518
  showToggle?: boolean;
518
519
  showRemove?: boolean;
@@ -526,6 +527,7 @@ type RepeaterProps<T> = {
526
527
  setValues: (newValue: T[], _: CreateOptions, meta?: SetRepeaterValuesMeta<T>) => void;
527
528
  disabled?: boolean;
528
529
  disableAddItemButton?: boolean;
530
+ addButtonInfotipContent?: React$1.ReactNode;
529
531
  showDuplicate?: boolean;
530
532
  showToggle?: boolean;
531
533
  showRemove?: boolean;
@@ -533,7 +535,7 @@ type RepeaterProps<T> = {
533
535
  isSortable?: true;
534
536
  itemSettings: SortableItemSettings<T>;
535
537
  };
536
- declare const Repeater: <T>({ label, itemSettings, disabled, openOnAdd, values: items, setValues: setItems, showDuplicate, showToggle, showRemove, disableAddItemButton, openItem: initialOpenItem, isSortable, }: RepeaterProps<RepeaterItem<T>>) => React$1.JSX.Element;
538
+ declare const Repeater: <T>({ label, itemSettings, disabled, openOnAdd, values: items, setValues: setItems, showDuplicate, showToggle, showRemove, disableAddItemButton, addButtonInfotipContent, openItem: initialOpenItem, isSortable, }: RepeaterProps<RepeaterItem<T>>) => React$1.JSX.Element;
537
539
 
538
540
  declare function FloatingActionsBar({ actions, children }: PropsWithChildren<{
539
541
  actions: ReactElement[];
package/dist/index.d.ts CHANGED
@@ -513,6 +513,7 @@ type RepeaterProps<T> = {
513
513
  setValues: (newValue: T[], _: CreateOptions, meta?: SetRepeaterValuesMeta<T>) => void;
514
514
  disabled?: boolean;
515
515
  disableAddItemButton?: boolean;
516
+ addButtonInfotipContent?: React$1.ReactNode;
516
517
  showDuplicate?: boolean;
517
518
  showToggle?: boolean;
518
519
  showRemove?: boolean;
@@ -526,6 +527,7 @@ type RepeaterProps<T> = {
526
527
  setValues: (newValue: T[], _: CreateOptions, meta?: SetRepeaterValuesMeta<T>) => void;
527
528
  disabled?: boolean;
528
529
  disableAddItemButton?: boolean;
530
+ addButtonInfotipContent?: React$1.ReactNode;
529
531
  showDuplicate?: boolean;
530
532
  showToggle?: boolean;
531
533
  showRemove?: boolean;
@@ -533,7 +535,7 @@ type RepeaterProps<T> = {
533
535
  isSortable?: true;
534
536
  itemSettings: SortableItemSettings<T>;
535
537
  };
536
- declare const Repeater: <T>({ label, itemSettings, disabled, openOnAdd, values: items, setValues: setItems, showDuplicate, showToggle, showRemove, disableAddItemButton, openItem: initialOpenItem, isSortable, }: RepeaterProps<RepeaterItem<T>>) => React$1.JSX.Element;
538
+ declare const Repeater: <T>({ label, itemSettings, disabled, openOnAdd, values: items, setValues: setItems, showDuplicate, showToggle, showRemove, disableAddItemButton, addButtonInfotipContent, openItem: initialOpenItem, isSortable, }: RepeaterProps<RepeaterItem<T>>) => React$1.JSX.Element;
537
539
 
538
540
  declare function FloatingActionsBar({ actions, children }: PropsWithChildren<{
539
541
  actions: ReactElement[];
package/dist/index.js CHANGED
@@ -6040,6 +6040,7 @@ var Repeater3 = ({
6040
6040
  showToggle = true,
6041
6041
  showRemove = true,
6042
6042
  disableAddItemButton = false,
6043
+ addButtonInfotipContent,
6043
6044
  openItem: initialOpenItem = EMPTY_OPEN_ITEM2,
6044
6045
  isSortable = true
6045
6046
  }) => {
@@ -6104,17 +6105,31 @@ var Repeater3 = ({
6104
6105
  { action: { type: "reorder", payload: { ...meta } } }
6105
6106
  );
6106
6107
  };
6107
- return /* @__PURE__ */ React102.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React102.createElement(RepeaterHeader, { label, adornment: ControlAdornments }, /* @__PURE__ */ React102.createElement(
6108
+ const isButtonDisabled = disabled || disableAddItemButton;
6109
+ const shouldShowInfotip = isButtonDisabled && addButtonInfotipContent;
6110
+ const addButton = /* @__PURE__ */ React102.createElement(
6108
6111
  import_ui87.IconButton,
6109
6112
  {
6110
6113
  size: SIZE9,
6111
- sx: { ml: "auto" },
6112
- disabled: disabled || disableAddItemButton,
6114
+ sx: {
6115
+ ml: "auto"
6116
+ },
6117
+ disabled: isButtonDisabled,
6113
6118
  onClick: addRepeaterItem,
6114
6119
  "aria-label": (0, import_i18n50.__)("Add item", "elementor")
6115
6120
  },
6116
6121
  /* @__PURE__ */ React102.createElement(import_icons34.PlusIcon, { fontSize: SIZE9 })
6117
- )), 0 < uniqueKeys.length && /* @__PURE__ */ React102.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
6122
+ );
6123
+ return /* @__PURE__ */ React102.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React102.createElement(RepeaterHeader, { label, adornment: ControlAdornments }, shouldShowInfotip ? /* @__PURE__ */ React102.createElement(
6124
+ import_ui87.Infotip,
6125
+ {
6126
+ placement: "right",
6127
+ content: addButtonInfotipContent,
6128
+ color: "secondary",
6129
+ slotProps: { popper: { sx: { width: 300 } } }
6130
+ },
6131
+ /* @__PURE__ */ React102.createElement(import_ui87.Box, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
6132
+ ) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React102.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
6118
6133
  const index = uniqueKeys.indexOf(key);
6119
6134
  const value = items2[index];
6120
6135
  if (!value) {