@elementor/editor-components 3.35.0-477 → 3.35.0-479
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.js
CHANGED
|
@@ -1368,8 +1368,9 @@ function validatePropLabel(label, existingLabels, currentLabel) {
|
|
|
1368
1368
|
var SIZE = "tiny";
|
|
1369
1369
|
var DEFAULT_GROUP = { value: null, label: (0, import_i18n6.__)("Default", "elementor") };
|
|
1370
1370
|
function OverridablePropForm({ onSubmit, groups, currentValue, existingLabels = [], sx }) {
|
|
1371
|
+
const selectGroups = groups?.length ? groups : [DEFAULT_GROUP];
|
|
1371
1372
|
const [propLabel, setPropLabel] = (0, import_react3.useState)(currentValue?.label ?? null);
|
|
1372
|
-
const [group, setGroup] = (0, import_react3.useState)(currentValue?.groupId ??
|
|
1373
|
+
const [group, setGroup] = (0, import_react3.useState)(currentValue?.groupId ?? selectGroups[0]?.value ?? null);
|
|
1373
1374
|
const [error, setError] = (0, import_react3.useState)(null);
|
|
1374
1375
|
const name = (0, import_i18n6.__)("Name", "elementor");
|
|
1375
1376
|
const groupName = (0, import_i18n6.__)("Group Name", "elementor");
|
|
@@ -1425,14 +1426,13 @@ function OverridablePropForm({ onSubmit, groups, currentValue, existingLabels =
|
|
|
1425
1426
|
onChange: (e) => setGroup(e.target.value),
|
|
1426
1427
|
displayEmpty: true,
|
|
1427
1428
|
renderValue: (selectedValue) => {
|
|
1428
|
-
if (!selectedValue
|
|
1429
|
-
|
|
1430
|
-
return firstGroup.label;
|
|
1429
|
+
if (!selectedValue) {
|
|
1430
|
+
return selectGroups[0].label;
|
|
1431
1431
|
}
|
|
1432
|
-
return
|
|
1432
|
+
return selectGroups.find(({ value }) => value === selectedValue)?.label ?? selectedValue;
|
|
1433
1433
|
}
|
|
1434
1434
|
},
|
|
1435
|
-
|
|
1435
|
+
selectGroups.map(({ label: groupLabel, ...props }) => /* @__PURE__ */ React3.createElement(import_editor_ui2.MenuListItem, { key: props.value, ...props, value: props.value ?? "" }, groupLabel))
|
|
1436
1436
|
))), /* @__PURE__ */ React3.createElement(import_ui3.Stack, { direction: "row", justifyContent: "flex-end", alignSelf: "end", mt: 1.5, py: 1, px: 1.5 }, /* @__PURE__ */ React3.createElement(
|
|
1437
1437
|
import_ui3.Button,
|
|
1438
1438
|
{
|