diff --git a/packages/core/src/part.mjs b/packages/core/src/part.mjs index 5943bb4d925..16257650cd4 100644 --- a/packages/core/src/part.mjs +++ b/packages/core/src/part.mjs @@ -78,6 +78,17 @@ Part.prototype.attr = function (name, value, overwrite = false) { return this } +/** + * Gets a free ID to use in the part + * + * @return {string} id - A free ID to use + */ +Part.prototype.getId = function (prefix = '') { + this.freeId += 1 + + return prefix + this.freeId +} + /** * Hide the part *