From 9ee3022285387258ec725fdaeb0165f717fb5fec Mon Sep 17 00:00:00 2001 From: Jordan Jones Date: Thu, 26 Sep 2024 13:08:17 -0700 Subject: [PATCH] feat: add tag name as attribute when custom registered --- src/auro-toast.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/auro-toast.js b/src/auro-toast.js index fc781ce..ddbb24f 100644 --- a/src/auro-toast.js +++ b/src/auro-toast.js @@ -19,6 +19,8 @@ import successIcon from '@alaskaairux/icons/dist/icons/interface/check-stroke.mj import errorIcon from '@alaskaairux/icons/dist/icons/alert/error-stroke.mjs'; import infoIcon from '@alaskaairux/icons/dist/icons/alert/information-stroke.mjs'; +import AuroLibraryRuntimeUtils from '@aurodesignsystem/auro-library/scripts/utils/runtimeUtils.mjs'; + import { AuroDependencyVersioning } from '@aurodesignsystem/auro-library/scripts/runtime/dependencyTagVersioning.mjs'; import { AuroButton } from '@aurodesignsystem/auro-button/src/auro-button.js'; @@ -65,6 +67,7 @@ export class AuroToast extends LitElement { * @private */ this.successSvg = this.successDom.body.firstChild; + this.successSvg.setAttribute('slot', 'svg'); /** @@ -101,6 +104,11 @@ export class AuroToast extends LitElement { */ this.iconTag = versioning.generateTag('auro-icon', iconVersion, AuroIcon); + /** + * @private + */ + this.runtimeUtils = new AuroLibraryRuntimeUtils(); + /** * @private */ @@ -135,6 +143,11 @@ export class AuroToast extends LitElement { ]; } + firstUpdated() { + // Add the tag name as an attribute if it is different than the component name + this.runtimeUtils.handleComponentTagRename(this, 'auro-toast'); + } + /** * @private * @returns {void}