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/12/06 20:24:29 UTC
(myfaces-tobago) branch main updated (3252811b3f -> a729e29ca4)
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 3252811b3f test(playwright): multiple servers
new 685bc6be2a fix(sheet): markup "striped" with columnPanel
new a729e29ca4 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/internal/component/AbstractUISheet.java | 5 ++++
.../internal/renderkit/renderer/SheetRenderer.java | 2 ++
.../myfaces/tobago/renderkit/css/TobagoClass.java | 1 +
.../ColumnPanel.xhtml} | 17 +++++++------
.../src/test/typescript/sheet.test.ts | 29 ++++++++++++++++++++++
tobago-theme/src/main/scss/_tobago.scss | 22 ++++++++++++++++
.../src/main/css/tobago.css | 16 ++++++++++++
.../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 | 16 ++++++++++++
.../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 | 16 ++++++++++++
.../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 | 16 ++++++++++++
.../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 | 16 ++++++++++++
.../src/main/css/tobago.css.map | 2 +-
.../src/main/css/tobago.min.css | 2 +-
.../src/main/css/tobago.min.css.map | 2 +-
26 files changed, 164 insertions(+), 22 deletions(-)
copy tobago-example/tobago-example-demo/src/main/webapp/content/900-test/sheet/{86-empty-lazy/Empty_lazy_sheet.xhtml => columnPanel/ColumnPanel.xhtml} (75%)
(myfaces-tobago) 01/02: fix(sheet): markup "striped" with columnPanel
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 685bc6be2a5bdaace0d609bd78329876ff288bb2
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Wed Dec 3 22:14:05 2025 +0100
fix(sheet): markup "striped" with columnPanel
* add Playwright test
* add a "tobago-has-column-panel" CSS class
* fix CSS
Issue: TOBAGO-2451
---
.../tobago/internal/component/AbstractUISheet.java | 5 +++
.../internal/renderkit/renderer/SheetRenderer.java | 2 +
.../myfaces/tobago/renderkit/css/TobagoClass.java | 1 +
.../900-test/sheet/columnPanel/ColumnPanel.xhtml | 45 ++++++++++++++++++++++
.../src/test/typescript/sheet.test.ts | 29 ++++++++++++++
tobago-theme/src/main/scss/_tobago.scss | 22 +++++++++++
6 files changed, 104 insertions(+)
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
index 2e9023e160..956457a70e 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheet.java
@@ -102,6 +102,7 @@ public abstract class AbstractUISheet extends AbstractUIData
private transient Grid headerGrid;
private final transient SearchOnce abstractUIColumnSelectorSearch = new SearchOnce();
+ private final transient SearchOnce abstractUIColumnPanelSearch = new SearchOnce();
@Override
public void encodeAll(FacesContext facesContext) throws IOException {
@@ -932,6 +933,10 @@ public AbstractUIColumnSelector getColumnSelector() {
return abstractUIColumnSelectorSearch.findChild(this, AbstractUIColumnSelector.class);
}
+ public AbstractUIColumnPanel getColumnPanel() {
+ return abstractUIColumnPanelSearch.findChild(this, AbstractUIColumnPanel.class);
+ }
+
@Override
public boolean isRendersRowContainer() {
return true;
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
index 20bfc9b7cc..5a2970f007 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/SheetRenderer.java
@@ -533,6 +533,7 @@ private void encodeTableBody(
final boolean showHeader = sheet.isShowHeader();
final Markup sheetMarkup = sheet.getMarkup() != null ? sheet.getMarkup() : Markup.NULL;
+ final boolean hasColumnPanel = sheet.getColumnPanel() != null;
boolean nonLazyUpdate = !sheet.isLazyUpdate(facesContext);
writer.startElement(HtmlElements.DIV);
@@ -549,6 +550,7 @@ private void encodeTableBody(
sheetMarkup.contains(Markup.BORDERED) ? BootstrapClass.TABLE_BORDERED : null,
sheetMarkup.contains(Markup.HOVER) ? BootstrapClass.TABLE_HOVER : null,
sheetMarkup.contains(Markup.SMALL) ? BootstrapClass.TABLE_SM : null,
+ hasColumnPanel ? TobagoClass.HAS__COLUMN__PANEL : null,
!autoLayout ? TobagoClass.TABLE_LAYOUT__FIXED : null);
if (nonLazyUpdate) {
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
index 1df461d42c..625719343f 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/css/TobagoClass.java
@@ -66,6 +66,7 @@ public enum TobagoClass implements CssItem {
FOCUS("tobago-focus"),
FOLDER("tobago-folder"),
FILTER("tobago-filter"),
+ HAS__COLUMN__PANEL("tobago-has-column-panel"),
HEADER("tobago-header"),
HELP__CONTAINER("tobago-help-container"),
HIDE_CLOSE_BUTTON("tobago-hideCloseButton"),
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/sheet/columnPanel/ColumnPanel.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/sheet/columnPanel/ColumnPanel.xhtml
new file mode 100644
index 0000000000..f508087c42
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/sheet/columnPanel/ColumnPanel.xhtml
@@ -0,0 +1,45 @@
+<?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:tc="http://myfaces.apache.org/tobago/component"
+ xmlns:ui="jakarta.faces.facelets">
+
+ <tc:sheet id="sheet" markup="striped" value="#{sheetController.solarList}" var="object" rows="17" selectable="none">
+ <tc:column label="Name">
+ <tc:out 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:columnPanel>
+ this is a columnPanel
+ </tc:columnPanel>
+ </tc:sheet>
+</ui:composition>
diff --git a/tobago-example/tobago-example-demo/src/test/typescript/sheet.test.ts b/tobago-example/tobago-example-demo/src/test/typescript/sheet.test.ts
index 78ef854c07..d0f4ed4732 100644
--- a/tobago-example/tobago-example-demo/src/test/typescript/sheet.test.ts
+++ b/tobago-example/tobago-example-demo/src/test/typescript/sheet.test.ts
@@ -120,3 +120,32 @@ test.describe("sheet/columnNode/ColumnNode.xhtml", () => {
await expect(node13Out).not.toBeVisible();
});
});
+
+test.describe("sheet/columnPanel/ColumnPanel.xhtml", () => {
+
+ test.beforeEach(async ({page}, testInfo) => {
+ await goto(test, page, testInfo, "content/900-test/sheet/columnPanel/ColumnPanel.xhtml");
+ });
+
+ test("Markup 'striped'", async ({page}) => {
+ const colorWhite = "rgb(255, 255, 255)";
+ const boxShadowLightGray = "rgba(0, 0, 0, 0.05) 0px 0px 0px 9999px inset";
+ const boxShadowTransparent = "rgba(0, 0, 0, 0) 0px 0px 0px 9999px inset";
+
+ const sheet = page.locator("tobago-sheet[id='page:mainForm:sheet']");
+ await expect(sheet).toBeVisible();
+
+ const tableStriped = sheet.locator(".table-striped");
+ await expect(tableStriped).toBeVisible();
+
+ for (let i = 0; i < 17; i++) {
+ const rowTd = tableStriped.locator("tr[row-index='" + i + "'] td:first-child");
+ const columPanelTd = tableStriped.locator("tr[name='" + i + "'] td");
+
+ await expect(rowTd).toHaveCSS("background-color", colorWhite);
+ await expect(rowTd).toHaveCSS("box-shadow", i % 2 ? boxShadowTransparent : boxShadowLightGray);
+ await expect(columPanelTd).toHaveCSS("background-color", colorWhite);
+ await expect(columPanelTd).toHaveCSS("box-shadow", i % 2 ? boxShadowTransparent : boxShadowLightGray);
+ }
+ });
+});
diff --git a/tobago-theme/src/main/scss/_tobago.scss b/tobago-theme/src/main/scss/_tobago.scss
index 756c51c734..98772b0b55 100644
--- a/tobago-theme/src/main/scss/_tobago.scss
+++ b/tobago-theme/src/main/scss/_tobago.scss
@@ -1793,6 +1793,28 @@ tobago-sheet {
.table {
margin-bottom: 0; //remove bootstrap styling; margins are set on tobago-sheet
+ &.tobago-has-column-panel.table-striped > tbody {
+ > tr:nth-child(4n+1) > * {
+ --#{$prefix}table-color-type: var(--#{$prefix}table-striped-color);
+ --#{$prefix}table-bg-type: var(--#{$prefix}table-striped-bg);
+ }
+
+ > tr:nth-child(4n+2) > * {
+ --#{$prefix}table-color-type: var(--#{$prefix}table-striped-color);
+ --#{$prefix}table-bg-type: var(--#{$prefix}table-striped-bg);
+ }
+
+ > tr:nth-child(4n+3) > * {
+ --#{$prefix}table-color-type: initial;
+ --#{$prefix}table-bg-type: initial;
+ }
+
+ > tr:nth-child(4n+4) > * {
+ --#{$prefix}table-color-type: initial;
+ --#{$prefix}table-bg-type: initial;
+ }
+ }
+
.tobago-column-panel {
}