admin-lib-cms 1.2.15 → 1.2.16
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 +8 -0
- package/dist/index.mjs +8 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2591,6 +2591,14 @@ function CollectionEditor({ collection }) {
|
|
|
2591
2591
|
let val = String(finalEditing[sourceField] || finalEditing.id || "");
|
|
2592
2592
|
val = val.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)+/g, "");
|
|
2593
2593
|
finalEditing[f.id] = val;
|
|
2594
|
+
} else if (f.type === "list") {
|
|
2595
|
+
if (Array.isArray(finalEditing[f.id])) {
|
|
2596
|
+
finalEditing[f.id] = finalEditing[f.id].filter(
|
|
2597
|
+
(item) => item !== void 0 && item !== null && String(item).trim() !== ""
|
|
2598
|
+
);
|
|
2599
|
+
} else if (typeof finalEditing[f.id] === "string") {
|
|
2600
|
+
finalEditing[f.id] = String(finalEditing[f.id]).split("\n").map((s) => s.trim()).filter(Boolean);
|
|
2601
|
+
}
|
|
2594
2602
|
}
|
|
2595
2603
|
});
|
|
2596
2604
|
const isClientOrEmployee = collection.id === "clients" || collection.id === "employees";
|
package/dist/index.mjs
CHANGED
|
@@ -1830,6 +1830,14 @@ function CollectionEditor({ collection }) {
|
|
|
1830
1830
|
let val = String(finalEditing[sourceField] || finalEditing.id || "");
|
|
1831
1831
|
val = val.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)+/g, "");
|
|
1832
1832
|
finalEditing[f.id] = val;
|
|
1833
|
+
} else if (f.type === "list") {
|
|
1834
|
+
if (Array.isArray(finalEditing[f.id])) {
|
|
1835
|
+
finalEditing[f.id] = finalEditing[f.id].filter(
|
|
1836
|
+
(item) => item !== void 0 && item !== null && String(item).trim() !== ""
|
|
1837
|
+
);
|
|
1838
|
+
} else if (typeof finalEditing[f.id] === "string") {
|
|
1839
|
+
finalEditing[f.id] = String(finalEditing[f.id]).split("\n").map((s) => s.trim()).filter(Boolean);
|
|
1840
|
+
}
|
|
1833
1841
|
}
|
|
1834
1842
|
});
|
|
1835
1843
|
const isClientOrEmployee = collection.id === "clients" || collection.id === "employees";
|