From 2b66ca8ba6cd61f1808733a864d693c0601a871d Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 27 Sep 2023 14:29:19 -0600 Subject: [PATCH] Docs: Get avatar widget in list, remove Et2 prefix from widget names --- api/js/etemplate/Et2Avatar/Et2Avatar.ts | 6 +++--- api/js/etemplate/Et2Avatar/Et2LAvatar.ts | 3 ++- doc/etemplate2/_includes/sidebar.njk | 2 +- doc/etemplate2/eleventy.config.cjs | 6 +++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/api/js/etemplate/Et2Avatar/Et2Avatar.ts b/api/js/etemplate/Et2Avatar/Et2Avatar.ts index 67dc3cef4e..3198ccb639 100644 --- a/api/js/etemplate/Et2Avatar/Et2Avatar.ts +++ b/api/js/etemplate/Et2Avatar/Et2Avatar.ts @@ -10,7 +10,6 @@ import {Et2Widget} from "../Et2Widget/Et2Widget"; import {css} from "lit"; -import {SlotMixin} from "@lion/core"; import {SlAvatar} from "@shoelace-style/shoelace"; import {et2_IDetachedDOM} from "../et2_core_interfaces"; import {egw} from "../../jsapi/egw_global"; @@ -19,7 +18,7 @@ import {Et2Dialog} from "../Et2Dialog/Et2Dialog"; import "../../../../vendor/bower-asset/cropper/dist/cropper.min.js"; import {cropperStyles} from "./cropperStyles"; -export class Et2Avatar extends Et2Widget(SlotMixin(SlAvatar)) implements et2_IDetachedDOM +export class Et2Avatar extends Et2Widget(SlAvatar) implements et2_IDetachedDOM { private _contactId; private _delBtn: HTMLElement; @@ -435,7 +434,8 @@ export class Et2Avatar extends Et2Widget(SlotMixin(SlAvatar)) implements et2_IDe } } } -customElements.define("et2-avatar", Et2Avatar as any); + +customElements.define("et2-avatar", Et2Avatar); // make et2_avatar publicly available as we need to call it from templates { window['et2_avatar'] = Et2Avatar; diff --git a/api/js/etemplate/Et2Avatar/Et2LAvatar.ts b/api/js/etemplate/Et2Avatar/Et2LAvatar.ts index 458ea945f1..27c8e03b35 100644 --- a/api/js/etemplate/Et2Avatar/Et2LAvatar.ts +++ b/api/js/etemplate/Et2Avatar/Et2LAvatar.ts @@ -126,4 +126,5 @@ export class Et2LAvatar extends Et2Avatar return {background: bg, initials: text}; } } -customElements.define("et2-lavatar", Et2LAvatar as any); \ No newline at end of file + +customElements.define("et2-lavatar", Et2LAvatar); \ No newline at end of file diff --git a/doc/etemplate2/_includes/sidebar.njk b/doc/etemplate2/_includes/sidebar.njk index 3996a89063..e9594ed343 100644 --- a/doc/etemplate2/_includes/sidebar.njk +++ b/doc/etemplate2/_includes/sidebar.njk @@ -25,7 +25,7 @@ {% for component in meta.components %}
  • {% if component.tagName %} - + {{ component.name | classNameToComponentName }} {% else %} diff --git a/doc/etemplate2/eleventy.config.cjs b/doc/etemplate2/eleventy.config.cjs index 7f1976e7d4..0f21b5994f 100644 --- a/doc/etemplate2/eleventy.config.cjs +++ b/doc/etemplate2/eleventy.config.cjs @@ -130,7 +130,7 @@ module.exports = function (eleventyConfig) eleventyConfig.addFilter('classNameToComponentName', className => { - let name = capitalCase(className.replace(/^Sl/, '')); + let name = capitalCase(className.replace(/^Et2/, '')); if (name === 'Qr Code') { name = 'QR Code'; @@ -138,9 +138,9 @@ module.exports = function (eleventyConfig) return name; }); - eleventyConfig.addFilter('removeSlPrefix', tagName => + eleventyConfig.addFilter('removeEt2Prefix', tagName => { - return tagName.replace(/^sl-/, ''); + return tagName.replace(/^et2-/, ''); }); //