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 2024/01/29 12:49:09 UTC

(myfaces-tobago) branch tobago-5.x updated (5aacb6bd06 -> 9928d33fb2)

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

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


    from 5aacb6bd06 build(deps-dev): bump testcontainers.version from 1.19.3 to 1.19.4
     new 04fdb4cfe2 fix(sheet): dropdown menu in header
     new 9928d33fb2 build(theme): rebuild after fixing dropdown menu in sheet header

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:
 .../Dropdown_in_header.test.js                     | 37 ++++++++++++++++++++++
 .../Dropdown_in_header.xhtml}                      | 26 ++++++++-------
 .../tobago-theme-standard/src/main/js/tobago.js    |  2 +-
 .../src/main/js/tobago.js.map                      |  2 +-
 .../src/main/ts/tobago-dropdown.ts                 |  5 +++
 5 files changed, 59 insertions(+), 13 deletions(-)
 create mode 100644 tobago-example/tobago-example-demo/src/main/webapp/content/900-test/3000-sheet/60-dropdown-in-header/Dropdown_in_header.test.js
 copy tobago-example/tobago-example-demo/src/main/webapp/content/{080-sheet/90-lazy/Sheet_Lazy.xhtml => 900-test/3000-sheet/60-dropdown-in-header/Dropdown_in_header.xhtml} (67%)


(myfaces-tobago) 01/02: fix(sheet): dropdown menu in header

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

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

commit 04fdb4cfe24973e275e04a81b6643556ae5ff545
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Mon Jan 29 10:50:49 2024 +0100

    fix(sheet): dropdown menu in header
    
    * add a test
    * fix dropdown menu in sheet header
    
    Issue: TOBAGO-2278
---
 .../Dropdown_in_header.test.js                     | 37 ++++++++++++++++
 .../60-dropdown-in-header/Dropdown_in_header.xhtml | 49 ++++++++++++++++++++++
 .../src/main/ts/tobago-dropdown.ts                 |  5 +++
 3 files changed, 91 insertions(+)

diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/3000-sheet/60-dropdown-in-header/Dropdown_in_header.test.js b/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/3000-sheet/60-dropdown-in-header/Dropdown_in_header.test.js
new file mode 100644
index 0000000000..b8673e5cee
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/3000-sheet/60-dropdown-in-header/Dropdown_in_header.test.js
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import {elementByIdFn, querySelectorFn} from "/script/tobago-test.js";
+import {JasmineTestTool} from "/tobago/test/tobago-test-tool.js";
+
+it("open dropdown menu", function (done) {
+  const dropdownButton = elementByIdFn("page:mainForm:sheet:dropdown::command");
+  const dropdownMenu = querySelectorFn(".tobago-dropdown-menu[name='page:mainForm:sheet:dropdown']");
+  const outName = querySelectorFn("#page\\:mainForm\\:sheet\\:0\\:outName .form-control-plaintext");
+  let timestamp;
+  let firstRowName;
+
+  const test = new JasmineTestTool(done);
+  test.do(() => firstRowName = outName().textContent);
+  test.event("click", dropdownButton, () => dropdownMenu().classList.contains("show"));
+  test.do(() => timestamp = Date.now());
+  test.wait(() => Date.now() - timestamp > 500);
+  test.do(() => expect(dropdownMenu().classList).toContain("show"));
+  test.do(() => expect(outName().textContent).toEqual(firstRowName));
+  test.start();
+});
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/3000-sheet/60-dropdown-in-header/Dropdown_in_header.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/3000-sheet/60-dropdown-in-header/Dropdown_in_header.xhtml
new file mode 100644
index 0000000000..2b2f8001d2
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/3000-sheet/60-dropdown-in-header/Dropdown_in_header.xhtml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<ui:composition template="/main.xhtml"
+                xmlns="http://www.w3.org/1999/xhtml"
+                xmlns:f="http://xmlns.jcp.org/jsf/core"
+                xmlns:tc="http://myfaces.apache.org/tobago/component"
+                xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
+
+  <tc:sheet id="sheet" value="#{sheetController.solarList}" var="object" rows="4">
+    <tc:column id="colName" label="Name" sortable="true">
+      <f:facet name="bar">
+        <tc:button id="dropdown" label="Dropdown" omit="true">
+          <tc:link label="Entry"/>
+          <tc:link label="Entry"/>
+        </tc:button>
+      </f:facet>
+      <tc:out id="outName" value="#{object.name}"/>
+    </tc:column>
+    <tc:column label="Orbit">
+      <tc:out value="#{object.orbit}"/>
+    </tc:column>
+    <tc:column label="Period (Days)">
+      <tc:out value="#{object.period}"/>
+    </tc:column>
+    <tc:column label="Discoverer">
+      <tc:out value="#{object.discoverer}"/>
+    </tc:column>
+    <tc:column label="Year">
+      <tc:out value="#{object.discoverYear}"/>
+    </tc:column>
+  </tc:sheet>
+</ui:composition>
diff --git a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-dropdown.ts b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-dropdown.ts
index 34b07a8af7..063692e025 100644
--- a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-dropdown.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-dropdown.ts
@@ -63,6 +63,11 @@ class Dropdown extends HTMLElement {
     if (this.closest("tr") != null) {
       this.addEventListener("click", (event) => {
         event.stopPropagation();
+        if (this.expanded) {
+          this.hideDropdown();
+        } else {
+          this.showDropdown();
+        }
       });
     }
   }


(myfaces-tobago) 02/02: build(theme): rebuild after fixing dropdown menu in sheet header

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

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

commit 9928d33fb2e25cedd5a47eadd925bbd88c92f875
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Mon Jan 29 13:38:52 2024 +0100

    build(theme): rebuild after fixing dropdown menu in sheet header
---
 tobago-theme/tobago-theme-standard/src/main/js/tobago.js     | 2 +-
 tobago-theme/tobago-theme-standard/src/main/js/tobago.js.map | 2 +-
 2 files changed, 2 insertions(+), 2 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 e5a54da7c9..8dcf3c163c 100644
--- a/tobago-theme/tobago-theme-standard/src/main/js/tobago.js
+++ b/tobago-theme/tobago-theme-standard/src/main/js/tobago.js
@@ -4,7 +4,7 @@
       * Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
       * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
       */
-const $e=new Map,Me={set(e,t,s){$e.has(e)||$e.set(e,new Map);const n=$e.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)=>$e.has(e)&&$e.get(e).get(t)||null,remove(e,t){if(!$e.has(e))return;const s=$e.get(e);s.delete(t),0===s.size&&$e.delete(e)}},Be="transitionend",Pe=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,((e,t)=>`#${CSS.escape(t)}`))),e),H [...]
+const $e=new Map,Me={set(e,t,s){$e.has(e)||$e.set(e,new Map);const n=$e.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)=>$e.has(e)&&$e.get(e).get(t)||null,remove(e,t){if(!$e.has(e))return;const s=$e.get(e);s.delete(t),0===s.size&&$e.delete(e)}},Be="transitionend",Pe=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,((e,t)=>`#${CSS.escape(t)}`))),e),H [...]
 /**
      * @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 b1669b3718..7cc2832641 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-bar.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.js","../../../../node_modules/@popperjs/core/lib/utils/getBasePlacement.j [...]
\ No newline at end of file
+{"version":3,"file":"tobago.js","sources":["../ts/tobago-css.ts","../ts/tobago-bar.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.js","../../../../node_modules/@popperjs/core/lib/utils/getBasePlacement.j [...]
\ No newline at end of file