You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by hn...@apache.org on 2025/02/27 09:39:24 UTC

(myfaces-tobago) branch main updated (b43d2738ff -> 5f853bf5ed)

This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


    from b43d2738ff build(theme): rebuild
     new bef29a6ec6 fix(dropdown): select[One/Many]List
     new 5f853bf5ed build(theme): rebuild

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../tobago-theme-standard/src/main/js/tobago.js       |  4 ++--
 .../tobago-theme-standard/src/main/js/tobago.js.map   |  2 +-
 .../tobago-theme-standard/src/main/ts/tobago-css.ts   |  1 +
 .../src/main/ts/tobago-dropdown-menu.ts               | 19 +++++++++++++++----
 .../src/main/ts/tobago-menu-store.ts                  |  4 +++-
 .../src/main/ts/tobago-select-list-base.ts            |  2 +-
 6 files changed, 23 insertions(+), 9 deletions(-)


(myfaces-tobago) 02/02: build(theme): rebuild

Posted by hn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit 5f853bf5ed2c409e707b5a68a4ef6a79ab8c66e3
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Thu Feb 27 10:26:43 2025 +0100

    build(theme): rebuild
---
 tobago-theme/tobago-theme-standard/src/main/js/tobago.js     | 4 ++--
 tobago-theme/tobago-theme-standard/src/main/js/tobago.js.map | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tobago-theme/tobago-theme-standard/src/main/js/tobago.js b/tobago-theme/tobago-theme-standard/src/main/js/tobago.js
index d40fb6d2dd..79b8643d8d 100644
--- a/tobago-theme/tobago-theme-standard/src/main/js/tobago.js
+++ b/tobago-theme/tobago-theme-standard/src/main/js/tobago.js
@@ -1,10 +1,10 @@
-!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";var e,t;!function(e){e.ACTIVE="active",e.AUTOCOMPLETE="autocomplete",e.AUTOCOMPLETE_INPUT="autocomplete-input",e.BOTTOM_0="bottom-0",e.COLLAPSE="collapse",e.COLLAPSING="collapsing",e.D_NONE="d-none",e.DISABLED="disabled",e.DROPDOWN="dropdown",e.DROPDOWN_ITEM="dropdown-item",e.DROPDOWN_MENU="dropdown-menu",e.DROPDOWN_MENU_END="dropdown-menu-end",e.END_0="end-0",e.FADE="fade",e.FIXED_BOTTOM="fixed-bo [...]
+!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";var e,t;!function(e){e.ACTIVE="active",e.AUTOCOMPLETE="autocomplete",e.AUTOCOMPLETE_INPUT="autocomplete-input",e.BOTTOM_0="bottom-0",e.COLLAPSE="collapse",e.COLLAPSING="collapsing",e.D_NONE="d-none",e.DISABLED="disabled",e.DROPDOWN="dropdown",e.DROPDOWN_ITEM="dropdown-item",e.DROPDOWN_MENU="dropdown-menu",e.DROPDOWN_MENU_END="dropdown-menu-end",e.END_0="end-0",e.FADE="fade",e.FIXED_BOTTOM="fixed-bo [...]
 /*!
       * Bootstrap v5.3.3 (https://getbootstrap.com/)
       * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
       * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
       */
-const pt=new Map,gt={set(e,t,s){pt.has(e)||pt.set(e,new Map);const n=pt.get(e);n.has(t)||0===n.size?n.set(t,s):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(n.keys())[0]}.`)},get:(e,t)=>pt.has(e)&&pt.get(e).get(t)||null,remove(e,t){if(!pt.has(e))return;const s=pt.get(e);s.delete(t),0===s.size&&pt.delete(e)}},mt="transitionend",ft=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,((e,t)=>`#${CSS.escape(t)}`))),e),b [...]
+const pt=new Map,gt={set(e,t,s){pt.has(e)||pt.set(e,new Map);const n=pt.get(e);n.has(t)||0===n.size?n.set(t,s):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(n.keys())[0]}.`)},get:(e,t)=>pt.has(e)&&pt.get(e).get(t)||null,remove(e,t){if(!pt.has(e))return;const s=pt.get(e);s.delete(t),0===s.size&&pt.delete(e)}},mt="transitionend",ft=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,((e,t)=>`#${CSS.escape(t)}`))),e),b [...]
 /**
      * @license
      * Copyright 2017 Google LLC
diff --git a/tobago-theme/tobago-theme-standard/src/main/js/tobago.js.map b/tobago-theme/tobago-theme-standard/src/main/js/tobago.js.map
index 5aad98cddf..4498fb2646 100644
--- a/tobago-theme/tobago-theme-standard/src/main/js/tobago.js.map
+++ b/tobago-theme/tobago-theme-standard/src/main/js/tobago.js.map
@@ -1 +1 @@
-{"version":3,"file":"tobago.js","sources":["../ts/tobago-css.ts","../ts/tobago-key.ts","../ts/tobago-bar.ts","../ts/tobago-date.ts","../ts/tobago-menu-store.ts","../../../../node_modules/@popperjs/core/lib/enums.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js","../../../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","../../../../node_modules/@popperjs/core/lib/modifiers/applyStyles [...]
\ No newline at end of file
+{"version":3,"file":"tobago.js","sources":["../ts/tobago-css.ts","../ts/tobago-key.ts","../ts/tobago-bar.ts","../ts/tobago-date.ts","../ts/tobago-menu-store.ts","../../../../node_modules/@popperjs/core/lib/enums.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js","../../../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","../../../../node_modules/@popperjs/core/lib/modifiers/applyStyles [...]
\ No newline at end of file


(myfaces-tobago) 01/02: fix(dropdown): select[One/Many]List

Posted by hn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit bef29a6ec6b9f7a71e083cb3a281cc2ab99cc0a6
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Thu Feb 27 09:17:46 2025 +0100

    fix(dropdown): select[One/Many]List
    
    The DropdownMenu.destroy() method causes a NPE.
    
    * better name destroy() -> disconnect()
    * delete all local object references to avoid using the wrong HTMLElement (in this issue the referenceElement was outdated).
    
    Issue: TOBAGO-2389, TOBAGO-2390
---
 .../tobago-theme-standard/src/main/ts/tobago-css.ts   |  1 +
 .../src/main/ts/tobago-dropdown-menu.ts               | 19 +++++++++++++++----
 .../src/main/ts/tobago-menu-store.ts                  |  4 +++-
 .../src/main/ts/tobago-select-list-base.ts            |  2 +-
 4 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-css.ts b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-css.ts
index 3620df0032..2092d4779b 100644
--- a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-css.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-css.ts
@@ -57,6 +57,7 @@ export enum Css {
   TOBAGO_FOCUS = "tobago-focus",
   TOBAGO_NO_ENTRIES = "tobago-no-entries",
   TOBAGO_OPTIONS = "tobago-options",
+  TOBAGO_PAGE_MENU_STORE = "tobago-page-menuStore",
   TOBAGO_PLACEHOLDER = "tobago-placeholder",
   TOBAGO_PRESELECT = "tobago-preselect",
   TOBAGO_ROW_FILLER = "tobago-row-filler",
diff --git a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-dropdown-menu.ts b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-dropdown-menu.ts
index 39b0b8ed5b..14d49fe822 100644
--- a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-dropdown-menu.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-dropdown-menu.ts
@@ -61,9 +61,20 @@ export class DropdownMenu {
     }
   }
 
-  destroy(): void {
+  /**
+   * Call this in the disconnectedCallback() method.
+   */
+  disconnect(): void {
     this.hide();
-    this.dropdownMenuElement?.remove();
+    if (this.dropdownMenuElement?.parentElement.classList.contains(Css.TOBAGO_PAGE_MENU_STORE)) {
+      this.dropdownMenuElement?.remove();
+    }
+
+    delete this.dropdownMenuElementId;
+    delete this.referenceElement;
+    delete this.parent;
+    delete this.localMenu;
+    delete this.alignment;
   }
 
   show(): void {
@@ -86,7 +97,7 @@ export class DropdownMenu {
 
       this.dropdownMenuElement.classList.remove(Css.SHOW);
       if (!this.localMenu) {
-        this.parent.appendChild(this.dropdownMenuElement);
+        this.parent?.appendChild(this.dropdownMenuElement);
       }
     }
   }
@@ -144,7 +155,7 @@ export class DropdownMenu {
 
   private get menuStore(): HTMLDivElement {
     const root = document.getRootNode() as ShadowRoot | Document;
-    return root.querySelector<HTMLDivElement>(".tobago-page-menuStore");
+    return root.querySelector<HTMLDivElement>(`.${Css.TOBAGO_PAGE_MENU_STORE}`);
   }
 
   private get dropdownMenuElement(): HTMLElement {
diff --git a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-menu-store.ts b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-menu-store.ts
index 2d988b0bf9..21deb82586 100644
--- a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-menu-store.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-menu-store.ts
@@ -17,6 +17,8 @@
  * under the License.
  */
 
+import {Css} from "./tobago-css";
+
 export class MenuStore {
   static appendChild<T extends Node>(node: T): T {
     return MenuStore.get().appendChild(node);
@@ -24,6 +26,6 @@ export class MenuStore {
 
   static get(): HTMLDivElement {
     const root = document.getRootNode() as ShadowRoot | Document;
-    return root.querySelector<HTMLDivElement>(".tobago-page-menuStore");
+    return root.querySelector<HTMLDivElement>(`.${Css.TOBAGO_PAGE_MENU_STORE}`);
   }
 }
diff --git a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-list-base.ts b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-list-base.ts
index 4e41814bf9..7504e53bcb 100644
--- a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-list-base.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-list-base.ts
@@ -121,7 +121,7 @@ export abstract class SelectListBase extends HTMLElement {
   }
 
   disconnectedCallback(): void {
-    this.dropdownMenu.destroy();
+    this.dropdownMenu.disconnect();
   }
 
   protected abstract globalClickEvent(event: MouseEvent): void;