@thecb/components 11.3.4 → 11.3.5-beta.0
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.cjs.js +6 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +6 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/util/general.js +8 -3
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
package/dist/index.esm.js
CHANGED
|
@@ -1717,7 +1717,12 @@ var createIdFromString = function createIdFromString(text, postscript) {
|
|
|
1717
1717
|
// "first name", undefined, false -> "first-name"
|
|
1718
1718
|
// "email address", "error message", false -> "email-address-error-message"
|
|
1719
1719
|
// "shopping cart", "order item", true -> "shopping-cart-order-item_2ahtlz608"
|
|
1720
|
-
|
|
1720
|
+
var formatIdString = function formatIdString(str) {
|
|
1721
|
+
return str && typeof str === "string" ? str.trim().replace(/\s+/g, "-") : "";
|
|
1722
|
+
};
|
|
1723
|
+
var textId = formatIdString(text === null || text === void 0 ? void 0 : text.toString());
|
|
1724
|
+
var postscriptId = formatIdString(postscript === null || postscript === void 0 ? void 0 : postscript.toString());
|
|
1725
|
+
return "".concat(textId).concat(postscriptId ? "-".concat(postscriptId) : "").concat(unique ? createUniqueId() : "");
|
|
1721
1726
|
}
|
|
1722
1727
|
};
|
|
1723
1728
|
var safeChildren = function safeChildren(children) {
|