@elementor/editor-controls 3.33.0-256 → 3.33.0-257
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 +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/repeater/repeater.tsx +11 -2
package/dist/index.d.mts
CHANGED
|
@@ -482,6 +482,7 @@ type RepeaterProps<T> = {
|
|
|
482
482
|
openOnAdd?: boolean;
|
|
483
483
|
setValues: (newValue: T[], _: CreateOptions, meta?: SetRepeaterValuesMeta<T>) => void;
|
|
484
484
|
disabled?: boolean;
|
|
485
|
+
disableAddItemButton?: boolean;
|
|
485
486
|
itemSettings: {
|
|
486
487
|
initialValues: T;
|
|
487
488
|
Label: React$1.ComponentType<{
|
|
@@ -492,12 +493,14 @@ type RepeaterProps<T> = {
|
|
|
492
493
|
value: T;
|
|
493
494
|
}>;
|
|
494
495
|
Content: RepeaterItemContent<T>;
|
|
496
|
+
actions?: React$1.ReactNode;
|
|
495
497
|
};
|
|
496
498
|
showDuplicate?: boolean;
|
|
497
499
|
showToggle?: boolean;
|
|
498
500
|
isSortable?: boolean;
|
|
501
|
+
openItem?: number;
|
|
499
502
|
};
|
|
500
|
-
declare const Repeater: <T>({ label, itemSettings, disabled, openOnAdd, addToBottom, values: repeaterValues, setValues: setRepeaterValues, showDuplicate, showToggle, isSortable, }: RepeaterProps<RepeaterItem<T>>) => React$1.JSX.Element;
|
|
503
|
+
declare const Repeater: <T>({ label, itemSettings, disabled, openOnAdd, addToBottom, values: repeaterValues, setValues: setRepeaterValues, showDuplicate, showToggle, isSortable, disableAddItemButton, openItem: initialOpenItem, }: RepeaterProps<RepeaterItem<T>>) => React$1.JSX.Element;
|
|
501
504
|
|
|
502
505
|
declare function FloatingActionsBar({ actions, children }: PropsWithChildren<{
|
|
503
506
|
actions: ReactElement[];
|
package/dist/index.d.ts
CHANGED
|
@@ -482,6 +482,7 @@ type RepeaterProps<T> = {
|
|
|
482
482
|
openOnAdd?: boolean;
|
|
483
483
|
setValues: (newValue: T[], _: CreateOptions, meta?: SetRepeaterValuesMeta<T>) => void;
|
|
484
484
|
disabled?: boolean;
|
|
485
|
+
disableAddItemButton?: boolean;
|
|
485
486
|
itemSettings: {
|
|
486
487
|
initialValues: T;
|
|
487
488
|
Label: React$1.ComponentType<{
|
|
@@ -492,12 +493,14 @@ type RepeaterProps<T> = {
|
|
|
492
493
|
value: T;
|
|
493
494
|
}>;
|
|
494
495
|
Content: RepeaterItemContent<T>;
|
|
496
|
+
actions?: React$1.ReactNode;
|
|
495
497
|
};
|
|
496
498
|
showDuplicate?: boolean;
|
|
497
499
|
showToggle?: boolean;
|
|
498
500
|
isSortable?: boolean;
|
|
501
|
+
openItem?: number;
|
|
499
502
|
};
|
|
500
|
-
declare const Repeater: <T>({ label, itemSettings, disabled, openOnAdd, addToBottom, values: repeaterValues, setValues: setRepeaterValues, showDuplicate, showToggle, isSortable, }: RepeaterProps<RepeaterItem<T>>) => React$1.JSX.Element;
|
|
503
|
+
declare const Repeater: <T>({ label, itemSettings, disabled, openOnAdd, addToBottom, values: repeaterValues, setValues: setRepeaterValues, showDuplicate, showToggle, isSortable, disableAddItemButton, openItem: initialOpenItem, }: RepeaterProps<RepeaterItem<T>>) => React$1.JSX.Element;
|
|
501
504
|
|
|
502
505
|
declare function FloatingActionsBar({ actions, children }: PropsWithChildren<{
|
|
503
506
|
actions: ReactElement[];
|
package/dist/index.js
CHANGED
|
@@ -5910,9 +5910,11 @@ var Repeater3 = ({
|
|
|
5910
5910
|
setValues: setRepeaterValues,
|
|
5911
5911
|
showDuplicate = true,
|
|
5912
5912
|
showToggle = true,
|
|
5913
|
-
isSortable = true
|
|
5913
|
+
isSortable = true,
|
|
5914
|
+
disableAddItemButton = false,
|
|
5915
|
+
openItem: initialOpenItem = EMPTY_OPEN_ITEM2
|
|
5914
5916
|
}) => {
|
|
5915
|
-
const [openItem, setOpenItem] = (0, import_react53.useState)(
|
|
5917
|
+
const [openItem, setOpenItem] = (0, import_react53.useState)(initialOpenItem);
|
|
5916
5918
|
const [items2, setItems] = useSyncExternalState({
|
|
5917
5919
|
external: repeaterValues,
|
|
5918
5920
|
// @ts-expect-error - as long as persistWhen => true, value will never be null
|
|
@@ -5996,7 +5998,7 @@ var Repeater3 = ({
|
|
|
5996
5998
|
{
|
|
5997
5999
|
size: SIZE9,
|
|
5998
6000
|
sx: { ml: "auto" },
|
|
5999
|
-
disabled,
|
|
6001
|
+
disabled: disabled || disableAddItemButton,
|
|
6000
6002
|
onClick: addRepeaterItem,
|
|
6001
6003
|
"aria-label": (0, import_i18n50.__)("Add item", "elementor")
|
|
6002
6004
|
},
|
|
@@ -6019,7 +6021,8 @@ var Repeater3 = ({
|
|
|
6019
6021
|
openOnMount: openOnAdd && openItem === key,
|
|
6020
6022
|
onOpen: () => setOpenItem(EMPTY_OPEN_ITEM2),
|
|
6021
6023
|
showDuplicate,
|
|
6022
|
-
showToggle
|
|
6024
|
+
showToggle,
|
|
6025
|
+
actions: itemSettings.actions
|
|
6023
6026
|
},
|
|
6024
6027
|
(props) => /* @__PURE__ */ React102.createElement(
|
|
6025
6028
|
itemSettings.Content,
|
|
@@ -6045,7 +6048,8 @@ var RepeaterItem = ({
|
|
|
6045
6048
|
onOpen,
|
|
6046
6049
|
showDuplicate,
|
|
6047
6050
|
showToggle,
|
|
6048
|
-
disabled
|
|
6051
|
+
disabled,
|
|
6052
|
+
actions
|
|
6049
6053
|
}) => {
|
|
6050
6054
|
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
|
|
6051
6055
|
const duplicateLabel = (0, import_i18n50.__)("Duplicate", "elementor");
|
|
@@ -6060,7 +6064,7 @@ var RepeaterItem = ({
|
|
|
6060
6064
|
"aria-label": (0, import_i18n50.__)("Open item", "elementor"),
|
|
6061
6065
|
...(0, import_ui87.bindTrigger)(popoverState),
|
|
6062
6066
|
startIcon,
|
|
6063
|
-
actions: /* @__PURE__ */ React102.createElement(React102.Fragment, null, showDuplicate && /* @__PURE__ */ React102.createElement(import_ui87.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React102.createElement(import_ui87.IconButton, { size: SIZE9, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React102.createElement(import_icons34.CopyIcon, { fontSize: SIZE9 }))), showToggle && /* @__PURE__ */ React102.createElement(import_ui87.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React102.createElement(import_ui87.IconButton, { size: SIZE9, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React102.createElement(import_icons34.EyeOffIcon, { fontSize: SIZE9 }) : /* @__PURE__ */ React102.createElement(import_icons34.EyeIcon, { fontSize: SIZE9 }))), /* @__PURE__ */ React102.createElement(import_ui87.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React102.createElement(import_ui87.IconButton, { size: SIZE9, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React102.createElement(import_icons34.XIcon, { fontSize: SIZE9 }))))
|
|
6067
|
+
actions: /* @__PURE__ */ React102.createElement(React102.Fragment, null, showDuplicate && /* @__PURE__ */ React102.createElement(import_ui87.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React102.createElement(import_ui87.IconButton, { size: SIZE9, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React102.createElement(import_icons34.CopyIcon, { fontSize: SIZE9 }))), showToggle && /* @__PURE__ */ React102.createElement(import_ui87.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React102.createElement(import_ui87.IconButton, { size: SIZE9, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React102.createElement(import_icons34.EyeOffIcon, { fontSize: SIZE9 }) : /* @__PURE__ */ React102.createElement(import_icons34.EyeIcon, { fontSize: SIZE9 }))), actions, /* @__PURE__ */ React102.createElement(import_ui87.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React102.createElement(import_ui87.IconButton, { size: SIZE9, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React102.createElement(import_icons34.XIcon, { fontSize: SIZE9 }))))
|
|
6064
6068
|
}
|
|
6065
6069
|
), /* @__PURE__ */ React102.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React102.createElement(import_ui87.Box, null, children({ anchorEl: ref }))));
|
|
6066
6070
|
};
|