strapi-plugin-bulk-updater 1.2.0 → 1.2.3

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.
@@ -1454,23 +1454,34 @@ const BulkUpdater = () => {
1454
1454
  children: [
1455
1455
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", tag: "h2", marginBottom: 4, fontWeight: "semiBold", children: "1. Configure Attribute Update" }),
1456
1456
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, alignItems: "flex-end", wrap: "wrap", children: [
1457
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { minWidth: 260 }, children: /* @__PURE__ */ jsxRuntime.jsx(
1458
- designSystem.SingleSelect,
1459
- {
1460
- label: "Attribute to Update",
1461
- placeholder: "Select an attribute...",
1462
- value: selectedAttribute,
1463
- onChange: (val) => handleAttributeChange(String(val)),
1464
- children: attributes.map((attr) => {
1465
- const rel = relationsMeta[attr];
1466
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.SingleSelectOption, { value: attr, children: [
1467
- attr,
1468
- " ",
1469
- rel ? `(relation ➔ ${rel.targetDisplayName})` : ""
1470
- ] }, attr);
1471
- })
1472
- }
1473
- ) }),
1457
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { minWidth: 280, flex: 1, maxWidth: 440 }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
1458
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: "Attribute to Update" }),
1459
+ /* @__PURE__ */ jsxRuntime.jsx(
1460
+ designSystem.Combobox,
1461
+ {
1462
+ autocomplete: { type: "list", filter: "contains" },
1463
+ placeholder: "Search attribute by name or relation...",
1464
+ value: selectedAttribute,
1465
+ onChange: (val) => {
1466
+ if (val && typeof val === "string") {
1467
+ handleAttributeChange(val);
1468
+ }
1469
+ },
1470
+ children: attributes.map((attr) => {
1471
+ const rel = relationsMeta[attr];
1472
+ const cleanParts = attr.includes(".") ? attr.split(".").join(" ") : "";
1473
+ const labelText = `${attr} ${cleanParts} ${rel ? `relation ${rel.targetDisplayName}` : ""}`.trim();
1474
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: attr, textValue: labelText, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", width: "100%", gap: 2, children: [
1475
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: attr === selectedAttribute ? "bold" : "regular", children: attr }),
1476
+ rel ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Badge, { backgroundColor: "secondary100", textColor: "secondary700", size: "S", children: [
1477
+ "relation ➔ ",
1478
+ rel.targetDisplayName
1479
+ ] }) : attr.includes(".") ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "neutral150", textColor: "neutral700", size: "S", children: "component" }) : null
1480
+ ] }) }, attr);
1481
+ })
1482
+ }
1483
+ )
1484
+ ] }) }),
1474
1485
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { flex: 1, minWidth: 340 }, children: relationsMeta[selectedAttribute] ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, style: { width: "100%" }, children: [
1475
1486
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", wrap: "wrap", children: [
1476
1487
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral700", children: [
@@ -1486,28 +1497,31 @@ const BulkUpdater = () => {
1486
1497
  relationsMeta[selectedAttribute].isMulti && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "primary100", textColor: "primary700", children: "Multi-Relation" })
1487
1498
  ] }),
1488
1499
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", style: { width: "100%" }, children: [
1489
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { flex: 1, minWidth: 200 }, children: /* @__PURE__ */ jsxRuntime.jsxs(
1490
- designSystem.SingleSelect,
1491
- {
1492
- label: `Choose ${relationsMeta[selectedAttribute].targetDisplayName}`,
1493
- placeholder: relationOptionsLoading ? "Loading entities..." : `Pick a ${relationsMeta[selectedAttribute].targetDisplayName}...`,
1494
- value: selectedRelationDocId,
1495
- onChange: (val) => {
1496
- const docId = String(val);
1497
- setSelectedRelationDocId(docId);
1498
- if (docId === "__clear__") {
1499
- setAttributeValue(JSON.stringify({ mode: "clear", label: "(clear relation)" }));
1500
- } else {
1501
- const opt = relationOptions.find((o) => o.documentId === docId);
1502
- setAttributeValue(JSON.stringify({ mode: relationMode, documentIds: [docId], label: opt?.label || docId }));
1503
- }
1504
- },
1505
- children: [
1506
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "__clear__", children: "-- Clear / Unlink Relation --" }),
1507
- relationOptions.map((opt) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: opt.documentId, children: opt.label }, opt.documentId))
1508
- ]
1509
- }
1510
- ) }),
1500
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { flex: 1, minWidth: 200 }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
1501
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: `Choose ${relationsMeta[selectedAttribute].targetDisplayName}` }),
1502
+ /* @__PURE__ */ jsxRuntime.jsxs(
1503
+ designSystem.Combobox,
1504
+ {
1505
+ autocomplete: { type: "list", filter: "contains" },
1506
+ placeholder: relationOptionsLoading ? "Loading entities..." : `Search & pick ${relationsMeta[selectedAttribute].targetDisplayName}...`,
1507
+ value: selectedRelationDocId,
1508
+ onChange: (val) => {
1509
+ const docId = val ? String(val) : "";
1510
+ setSelectedRelationDocId(docId);
1511
+ if (docId === "__clear__") {
1512
+ setAttributeValue(JSON.stringify({ mode: "clear", label: "(clear relation)" }));
1513
+ } else {
1514
+ const opt = relationOptions.find((o) => o.documentId === docId);
1515
+ setAttributeValue(JSON.stringify({ mode: relationMode, documentIds: [docId], label: opt?.label || docId }));
1516
+ }
1517
+ },
1518
+ children: [
1519
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: "__clear__", textValue: "Clear / Unlink Relation", children: "-- Clear / Unlink Relation --" }),
1520
+ relationOptions.map((opt) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: opt.documentId, textValue: opt.label, children: opt.label }, opt.documentId))
1521
+ ]
1522
+ }
1523
+ )
1524
+ ] }) }),
1511
1525
  relationsMeta[selectedAttribute].isMulti && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: 170 }, children: /* @__PURE__ */ jsxRuntime.jsxs(
1512
1526
  designSystem.SingleSelect,
1513
1527
  {
@@ -2769,4 +2783,4 @@ exports.default = BulkUpdater;
2769
2783
  exports.formatDisplayValue = formatDisplayValue;
2770
2784
  exports.getAvailableColumnsForCollection = getAvailableColumnsForCollection;
2771
2785
  exports.getNestedValue = getNestedValue;
2772
- //# sourceMappingURL=BulkUpdater-DCrCPKSe.js.map
2786
+ //# sourceMappingURL=BulkUpdater-BdRJhVFh.js.map