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 2022/11/02 08:13:58 UTC

[myfaces-tobago] branch t5_selectMany updated (84f548f022 -> 9749585ceb)

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

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


    from 84f548f022 checkstyle
     new 24b9c5ecf2 feat(selectMany): hide dropdown-menu manually
     add 4e8c47ba1b remove code committed by mistake
     add 4443bc534d build(deps): bump gson from 2.9.1 to 2.10 (#3367)
     add b92cfe2070 refactor(typescript): MenuStore
     add 3580529b60 build(theme): rebuild after refactoring typescript (menuStore)
     add 519c99a7aa build(deps): bump jackson-databind from 2.14.0-rc2 to 2.14.0-rc3 (#3369)
     add f96dc9e8c6 build: update npm and rebuild (#3390)
     new 9749585ceb Merge remote-tracking branch 'origin/tobago-5.x' into t5_selectMany

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:
 .../renderkit/renderer/SelectManyRenderer.java     |    1 -
 .../tobago-example-demo/package-lock.json          |  336 +--
 tobago-example/tobago-example-demo/package.json    |    4 +-
 .../src/main/webapp/js/jasmine.js                  |  268 +--
 tobago-example/tobago-example-spring-boot/pom.xml  |    2 +-
 tobago-theme/package-lock.json                     | 2241 ++++++++++----------
 tobago-theme/package.json                          |   20 +-
 .../src/main/css/tobago.css                        |   52 -
 .../src/main/css/tobago.css.map                    |    2 +-
 .../src/main/css/tobago.min.css                    |    2 +-
 .../src/main/css/tobago.min.css.map                |    2 +-
 .../src/main/css/tobago.css                        |   52 -
 .../src/main/css/tobago.css.map                    |    2 +-
 .../src/main/css/tobago.min.css                    |    2 +-
 .../src/main/css/tobago.min.css.map                |    2 +-
 .../src/main/css/tobago.css                        |   52 -
 .../src/main/css/tobago.css.map                    |    2 +-
 .../src/main/css/tobago.min.css                    |    2 +-
 .../src/main/css/tobago.min.css.map                |    2 +-
 .../tobago-theme-speyside/src/main/css/tobago.css  |   52 -
 .../src/main/css/tobago.css.map                    |    2 +-
 .../src/main/css/tobago.min.css                    |    2 +-
 .../src/main/css/tobago.min.css.map                |    2 +-
 .../tobago-theme-standard/src/main/css/tobago.css  |   52 -
 .../src/main/css/tobago.css.map                    |    2 +-
 .../src/main/css/tobago.min.css                    |    2 +-
 .../src/main/css/tobago.min.css.map                |    2 +-
 .../tobago-theme-standard/src/main/js/jsf.js       |    2 +-
 .../tobago-theme-standard/src/main/js/jsf.js.map   |    2 +-
 .../src/main/ts/tobago-dropdown.ts                 |   14 +-
 .../src/main/ts/tobago-select-many.ts              |   40 +-
 31 files changed, 1531 insertions(+), 1689 deletions(-)


[myfaces-tobago] 01/02: feat(selectMany): hide dropdown-menu manually

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

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

commit 24b9c5ecf288e711db613e58c31ff9397c6d9eaa
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Wed Nov 2 09:03:07 2022 +0100

    feat(selectMany): hide dropdown-menu manually
    
    Issue: TOBAGO-2159
---
 .../renderkit/renderer/SelectManyRenderer.java     |  1 -
 .../src/main/ts/tobago-select-many.ts              | 40 +++++++++++++++++++---
 2 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyRenderer.java
index 76bbf572ee..ccd7cc34ce 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SelectManyRenderer.java
@@ -180,7 +180,6 @@ public class SelectManyRenderer<T extends AbstractUISelectMany> extends SelectMa
     writer.writeAttribute(HtmlAttributes.TITLE, title, true);
     if (!inline) {
       writer.writeAttribute(DataAttributes.BS_TOGGLE, "dropdown", false);
-      writer.writeAttribute(DataAttributes.BS_AUTO_CLOSE, "outside", false);
     }
     writer.writeAttribute(Arias.EXPANDED, Boolean.FALSE.toString(), false);
 
diff --git a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-many.ts b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-many.ts
index 7b2788bb32..ef4516196c 100644
--- a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-many.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-select-many.ts
@@ -24,6 +24,10 @@ class SelectMany extends HTMLElement {
     SHOW: "show"
   };
 
+  private readonly Key = {
+    ESCAPE: "Escape"
+  };
+
   constructor() {
     super();
   }
@@ -65,9 +69,11 @@ class SelectMany extends HTMLElement {
     // todo: implement remove badge
 
     window.addEventListener("resize", this.resizeEvent.bind(this));
+    document.addEventListener("click", this.clickEvent.bind(this));
+    document.addEventListener("keydown", this.keydownEvent.bind(this));
     this.addEventListener(BootstrapEvents.DROPDOWN_SHOW, this.showDropdown.bind(this));
     this.addEventListener(BootstrapEvents.DROPDOWN_SHOWN, this.shownDropdown.bind(this));
-    this.addEventListener(BootstrapEvents.DROPDOWN_HIDE, this.hideDropdown.bind(this));
+    this.addEventListener(BootstrapEvents.DROPDOWN_HIDE, this.preventBootstrapHide.bind(this));
     this.addEventListener(BootstrapEvents.DROPDOWN_HIDDEN, this.HiddenDropdown.bind(this));
 
     // init badges
@@ -118,7 +124,7 @@ class SelectMany extends HTMLElement {
       this.filterInput.insertAdjacentHTML("beforebegin", this.getRowTemplate(itemValue, row.innerText));
 
       // todo: nicer adding the @click with lit-html
-      const current = this.filterInput.parentElement.querySelector(".btn-group[data-tobago-value='"+ itemValue +"']");
+      const current = this.filterInput.parentElement.querySelector(".btn-group[data-tobago-value='" + itemValue + "']");
       current.addEventListener("click", this.removeBadge.bind(this));
 
       // highlight list row
@@ -173,8 +179,34 @@ class SelectMany extends HTMLElement {
     // console.log("### shownDropdown");
   }
 
-  private hideDropdown(event: Event): void {
-    // console.log("### hideDropdown");
+  private preventBootstrapHide(event: CustomEvent): void {
+    event.stopPropagation();
+    event.preventDefault();
+  }
+
+  private clickEvent(event: MouseEvent): void {
+    console.log("click auf this?");
+    event.composedPath().forEach(
+
+      (value, index, array) => {
+        if(value === this) {
+          console.log("yo");
+          return;
+        }
+        console.log("ding!");
+    });
+
+    console.log(`### clickEvent ${event.relatedTarget} ${event.target} ${event.currentTarget}`);
+  }
+
+  private keydownEvent(event: KeyboardEvent) {
+    if (event.key === this.Key.ESCAPE) {
+      this.hideDropdown();
+    }
+  }
+
+  private hideDropdown(): void {
+    console.log("### hideDropdown");
   }
 
   private HiddenDropdown(event: Event): void {


[myfaces-tobago] 02/02: Merge remote-tracking branch 'origin/tobago-5.x' into t5_selectMany

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

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

commit 9749585ceb666eebfd0d032eb5b55f8aa7d31f51
Merge: 24b9c5ecf2 f96dc9e8c6
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Wed Nov 2 09:13:25 2022 +0100

    Merge remote-tracking branch 'origin/tobago-5.x' into t5_selectMany
    
    # Conflicts:
    #       tobago-theme/tobago-theme-standard/src/main/ts/tobago-dropdown.ts

 .../tobago-example-demo/package-lock.json          |  336 +--
 tobago-example/tobago-example-demo/package.json    |    4 +-
 .../src/main/webapp/js/jasmine.js                  |  268 +--
 tobago-example/tobago-example-spring-boot/pom.xml  |    2 +-
 tobago-theme/package-lock.json                     | 2241 ++++++++++----------
 tobago-theme/package.json                          |   20 +-
 .../src/main/css/tobago.css                        |   52 -
 .../src/main/css/tobago.css.map                    |    2 +-
 .../src/main/css/tobago.min.css                    |    2 +-
 .../src/main/css/tobago.min.css.map                |    2 +-
 .../src/main/css/tobago.css                        |   52 -
 .../src/main/css/tobago.css.map                    |    2 +-
 .../src/main/css/tobago.min.css                    |    2 +-
 .../src/main/css/tobago.min.css.map                |    2 +-
 .../src/main/css/tobago.css                        |   52 -
 .../src/main/css/tobago.css.map                    |    2 +-
 .../src/main/css/tobago.min.css                    |    2 +-
 .../src/main/css/tobago.min.css.map                |    2 +-
 .../tobago-theme-speyside/src/main/css/tobago.css  |   52 -
 .../src/main/css/tobago.css.map                    |    2 +-
 .../src/main/css/tobago.min.css                    |    2 +-
 .../src/main/css/tobago.min.css.map                |    2 +-
 .../tobago-theme-standard/src/main/css/tobago.css  |   52 -
 .../src/main/css/tobago.css.map                    |    2 +-
 .../src/main/css/tobago.min.css                    |    2 +-
 .../src/main/css/tobago.min.css.map                |    2 +-
 .../tobago-theme-standard/src/main/js/jsf.js       |    2 +-
 .../tobago-theme-standard/src/main/js/jsf.js.map   |    2 +-
 .../src/main/ts/tobago-dropdown.ts                 |   14 +-
 29 files changed, 1495 insertions(+), 1684 deletions(-)

diff --cc tobago-theme/tobago-theme-standard/src/main/ts/tobago-dropdown.ts
index a89102f0ed,edcfbd2194..545b4d0152
--- a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-dropdown.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-dropdown.ts
@@@ -16,8 -16,14 +16,15 @@@
   */
  
  import {MenuStore} from "./tobago-menu-store";
 +import {BootstrapEvents} from "./BootstrapEvents";
  
+ const TobagoDropdownEvent = {
+   HIDE: "tobago.dropdown.hide",
+   HIDDEN: "tobago.dropdown.hidden",
+   SHOW: "tobago.dropdown.show",
+   SHOWN: "tobago.dropdown.shown"
+ };
+ 
  /**
   * The dropdown implementation of Bootstrap does not move the menu to the tobago-page-menuStore. This behavior is
   * implemented in this class.