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/04/23 09:09:08 UTC
(myfaces-tobago) branch tobago-5.x updated (f60e532490 -> e3e47516c4)
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 f60e532490 build(deps): Selenium standalone Firefox
new 0574033fc7 fix(sheet): column width index
new e3e47516c4 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:
.../internal/renderkit/renderer/SheetRenderer.java | 90 +++++++++++++---------
.../test/{ => sheet}/ColumnSelectorController.java | 2 +-
.../sheet/ColumnWidthController.java} | 20 ++++-
.../{ => sheet}/SelectableUseCaseController.java | 2 +-
.../Sheet_Column_Width.test.js | 67 +++++++++++++++-
.../20-sheet-column-width/Sheet_Column_Width.xhtml | 24 +++++-
.../tobago-theme-standard/src/main/js/tobago.js | 2 +-
.../src/main/js/tobago.js.map | 2 +-
.../src/main/ts/tobago-sheet.ts | 69 ++++++++++++-----
9 files changed, 211 insertions(+), 67 deletions(-)
rename tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/test/{ => sheet}/ColumnSelectorController.java (98%)
copy tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/{SheetEditableController.java => test/sheet/ColumnWidthController.java} (69%)
rename tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/test/{ => sheet}/SelectableUseCaseController.java (98%)
(myfaces-tobago) 01/02: fix(sheet): column width index
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 0574033fc734dc1d1c86dcd584cf9534cbd31943
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Thu Apr 17 09:51:27 2025 +0200
fix(sheet): column width index
* add test
* replace "sheetController" with "columnWidthController"
* refactor test controller java classes for sheet
* fix wrong column width (because of wrong index) if a previous column has rendered=false set
Issue: TOBAGO-2404
---
.../internal/renderkit/renderer/SheetRenderer.java | 90 +++++++++++++---------
.../test/{ => sheet}/ColumnSelectorController.java | 2 +-
.../demo/test/sheet/ColumnWidthController.java | 59 ++++++++++++++
.../{ => sheet}/SelectableUseCaseController.java | 2 +-
.../Sheet_Column_Width.test.js | 67 +++++++++++++++-
.../20-sheet-column-width/Sheet_Column_Width.xhtml | 24 +++++-
.../src/main/ts/tobago-sheet.ts | 69 ++++++++++++-----
7 files changed, 252 insertions(+), 61 deletions(-)
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 ff8d142f63..7048ef9b63 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
@@ -955,8 +955,8 @@ private void writeColgroup(
if (!(column instanceof AbstractUIRow) && !(column instanceof AbstractUIColumnPanel)) {
if (column.isRendered()) {
writeCol(writer, null);
+ numOfCols++;
}
- numOfCols++;
}
}
writeCol(writer, TobagoClass.ROW__FILLER);
@@ -967,52 +967,72 @@ private void writeColgroup(
final MeasureList columnLayout = sheet.getColumnLayout();
final String sheetId = sheet.getClientId(facesContext);
final String encodedSheetId = StyleRenderUtils.encodeIdSelector(sheetId);
- final boolean columnWidthSetByUser = columnWidths.stream().noneMatch(columnWidth -> columnWidth <= -1);
final boolean hasAutoOrFrValue = columnLayout.stream()
.anyMatch(measure -> measure.getUnit().equals(Measure.Unit.AUTO)
|| measure.getUnit().equals(Measure.Unit.FR));
+ boolean columnWidthSetByUser = false;
float fr = 0;
MeasureList tangibleMeasures = new MeasureList();
- for (int colIndex = 0; colIndex < numOfCols; colIndex++) {
- Measure measure;
- if (columnWidthSetByUser) {
- measure = new Measure(columnWidths.get(colIndex), Measure.Unit.PX);
- } else {
- measure = columnLayout.get(colIndex % columnLayout.getSize());
- }
- if (Measure.Unit.FR.equals(measure.getUnit())) {
- fr += measure.getValue();
- } else {
- if (Measure.Unit.AUTO.equals(measure.getUnit())) {
- tangibleMeasures.add(new Measure(100.0 / (numOfCols + 2), Measure.Unit.PERCENT));
- /* (numOfCols + 2) for backwards compatibility, because the
- previous initialization in TypeScript had included the COL.tobago-row-filler and
- COL.tobago-behavior-container in the calculation. */
- } else {
- tangibleMeasures.add(measure);
+
+ int columnIndex = 0;
+ int renderedColumnIndex = 0;
+ for (final AbstractUIColumnBase column : columns) {
+ if (!(column instanceof AbstractUIRow) && !(column instanceof AbstractUIColumnPanel)) {
+ if (column.isRendered()) {
+ Measure measure;
+ int columnWidth = columnWidths.get(columnIndex);
+ if (columnWidth > -1) {
+ columnWidthSetByUser = true;
+ measure = new Measure(columnWidth, Measure.Unit.PX);
+ } else {
+ measure = columnLayout.get(columnIndex % columnLayout.getSize());
+ }
+ if (Measure.Unit.FR.equals(measure.getUnit())) {
+ fr += measure.getValue();
+ } else {
+ if (Measure.Unit.AUTO.equals(measure.getUnit())) {
+ tangibleMeasures.add(new Measure(100.0 / (numOfCols + 2), Measure.Unit.PERCENT));
+ /* (numOfCols + 2) for backwards compatibility, because the
+ previous initialization in TypeScript had included the COL.tobago-row-filler and
+ COL.tobago-behavior-container in the calculation. */
+ } else {
+ tangibleMeasures.add(measure);
+ }
+ encodeColStyle(facesContext, encodedSheetId, null, renderedColumnIndex, measure);
+ }
+
+ renderedColumnIndex++;
}
- encodeColStyle(facesContext, encodedSheetId, null, colIndex, measure);
+ columnIndex++;
}
}
if (fr > 0) {
- for (int colIndex = 0; colIndex < numOfCols; colIndex++) {
- Measure measure = columnLayout.get(colIndex % columnLayout.getSize());
- if (Measure.Unit.FR.equals(measure.getUnit())) {
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append("calc((100%");
- for (Measure tangibleMeasure : tangibleMeasures) {
- stringBuilder.append(" - ");
- stringBuilder.append(tangibleMeasure.getValue());
- stringBuilder.append(tangibleMeasure.getUnit().getValue());
+ columnIndex = 0;
+ renderedColumnIndex = 0;
+ for (final AbstractUIColumnBase column : columns) {
+ if (!(column instanceof AbstractUIRow) && !(column instanceof AbstractUIColumnPanel)) {
+ if (column.isRendered()) {
+ Measure measure = columnLayout.get(columnIndex % columnLayout.getSize());
+ if (Measure.Unit.FR.equals(measure.getUnit())) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append("calc((100%");
+ for (Measure tangibleMeasure : tangibleMeasures) {
+ stringBuilder.append(" - ");
+ stringBuilder.append(tangibleMeasure.getValue());
+ stringBuilder.append(tangibleMeasure.getUnit().getValue());
+ }
+ stringBuilder.append(") / ");
+ stringBuilder.append(fr);
+ stringBuilder.append(" * ");
+ stringBuilder.append(measure.getValue());
+ stringBuilder.append(")");
+ encodeColStyle(facesContext, writer, encodedSheetId, renderedColumnIndex, stringBuilder.toString());
+ }
+ renderedColumnIndex++;
}
- stringBuilder.append(") / ");
- stringBuilder.append(fr);
- stringBuilder.append(" * ");
- stringBuilder.append(measure.getValue());
- stringBuilder.append(")");
- encodeColStyle(facesContext, writer, encodedSheetId, colIndex, stringBuilder.toString());
+ columnIndex++;
}
}
}
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/test/ColumnSelectorController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/test/sheet/ColumnSelectorController.java
similarity index 98%
rename from tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/test/ColumnSelectorController.java
rename to tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/test/sheet/ColumnSelectorController.java
index 7964a4042c..a1b7e8d3dc 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/test/ColumnSelectorController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/test/sheet/ColumnSelectorController.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.myfaces.tobago.example.demo.test;
+package org.apache.myfaces.tobago.example.demo.test.sheet;
import org.apache.myfaces.tobago.example.demo.AstroData;
import org.apache.myfaces.tobago.example.demo.SolarObject;
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/test/sheet/ColumnWidthController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/test/sheet/ColumnWidthController.java
new file mode 100644
index 0000000000..b02080b308
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/test/sheet/ColumnWidthController.java
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ */
+
+package org.apache.myfaces.tobago.example.demo.test.sheet;
+
+import org.apache.myfaces.tobago.example.demo.AstroData;
+import org.apache.myfaces.tobago.example.demo.SolarObject;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.SessionScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+import java.io.Serializable;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Named
+@SessionScoped
+public class ColumnWidthController implements Serializable {
+
+ @Inject
+ private AstroData astroData;
+
+ private List<SolarObject> solarList;
+ private boolean renderSecondColumn = true;
+
+ @PostConstruct
+ private void init() {
+ solarList = astroData.findAll().collect(Collectors.toList());
+ }
+
+ public List<SolarObject> getSolarList() {
+ return solarList;
+ }
+
+ public boolean isRenderSecondColumn() {
+ return renderSecondColumn;
+ }
+
+ public void setRenderSecondColumn(boolean renderSecondColumn) {
+ this.renderSecondColumn = renderSecondColumn;
+ }
+}
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/test/SelectableUseCaseController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/test/sheet/SelectableUseCaseController.java
similarity index 98%
rename from tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/test/SelectableUseCaseController.java
rename to tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/test/sheet/SelectableUseCaseController.java
index a2b59b3378..af7ad6df49 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/test/SelectableUseCaseController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/test/sheet/SelectableUseCaseController.java
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.myfaces.tobago.example.demo.test;
+package org.apache.myfaces.tobago.example.demo.test.sheet;
import org.apache.myfaces.tobago.example.demo.AstroData;
import org.apache.myfaces.tobago.example.demo.SolarObject;
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/3000-sheet/20-sheet-column-width/Sheet_Column_Width.test.js b/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/3000-sheet/20-sheet-column-width/Sheet_Column_Width.test.js
index 3ab8372b32..a559ca73d1 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/3000-sheet/20-sheet-column-width/Sheet_Column_Width.test.js
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/3000-sheet/20-sheet-column-width/Sheet_Column_Width.test.js
@@ -15,9 +15,54 @@
* limitations under the License.
*/
-import {querySelectorAllFn, querySelectorFn} from "/script/tobago-test.js";
+import {elementByIdFn, querySelectorAllFn, querySelectorFn} from "/script/tobago-test.js";
import {JasmineTestTool} from "/tobago/test/tobago-test-tool.js";
+it("Column width index", function (done) {
+ const hideButton = elementByIdFn("page:mainForm:hideColumn");
+ const showColumn = elementByIdFn("page:mainForm:showColumn");
+ const columnHeads = querySelectorAllFn("#page\\:mainForm\\:columnRenderedFalse header table thead tr th");
+
+ const test = new JasmineTestTool(done);
+ test.setup(() => columnHeads().length === 5, null, "click", showColumn);
+ test.do(() => expect(columnHeads().length).toBe(5));
+ test.do(() => expect(getComputedStyle(columnHeads()[0]).width).toBe("100px"));
+ test.do(() => expect(getComputedStyle(columnHeads()[1]).width).toBe("200px"));
+ test.do(() => expect(getComputedStyle(columnHeads()[2]).width).toBe("300px"));
+
+ test.event("click", hideButton, () => columnHeads().length === 4);
+ test.do(() => expect(columnHeads().length).toBe(4));
+ test.do(() => expect(getComputedStyle(columnHeads()[0]).width).toBe("100px"));
+ test.do(() => expect(getComputedStyle(columnHeads()[1]).width).toBe("300px"));
+
+ test.do(() => simulatingResize(columnHeads()[0], +5));
+ test.do(() => simulatingResize(columnHeads()[1], +5));
+ test.do(() => expect(columnHeads().length).toBe(4));
+ test.do(() => expect(getComputedStyle(columnHeads()[0]).width).toBe("105px"));
+ test.do(() => expect(getComputedStyle(columnHeads()[1]).width).toBe("305px"));
+
+ test.event("click", showColumn, () => columnHeads().length === 5);
+ test.do(() => expect(columnHeads().length).toBe(5));
+ test.do(() => expect(getComputedStyle(columnHeads()[0]).width).toBe("105px"));
+ test.do(() => expect(getComputedStyle(columnHeads()[1]).width).toBe("200px"));
+ test.do(() => expect(getComputedStyle(columnHeads()[2]).width).toBe("305px"));
+
+ test.do(() => simulatingResize(columnHeads()[0], +10));
+ test.do(() => simulatingResize(columnHeads()[1], +10));
+ test.do(() => simulatingResize(columnHeads()[2], +10));
+ test.do(() => expect(columnHeads().length).toBe(5));
+ test.do(() => expect(getComputedStyle(columnHeads()[0]).width).toBe("115px"));
+ test.do(() => expect(getComputedStyle(columnHeads()[1]).width).toBe("210px"));
+ test.do(() => expect(getComputedStyle(columnHeads()[2]).width).toBe("315px"));
+
+ test.event("click", hideButton, () => columnHeads().length === 4);
+ test.do(() => expect(columnHeads().length).toBe(4));
+ test.do(() => expect(getComputedStyle(columnHeads()[0]).width).toBe("115px"));
+ test.do(() => expect(getComputedStyle(columnHeads()[1]).width).toBe("315px"));
+
+ test.start();
+});
+
it("Only pixel values set", function (done) {
const columnHeads = querySelectorAllFn("#page\\:mainForm\\:pixelOnly header table thead tr th");
@@ -55,3 +100,23 @@ it("There must be no horizontal scrollbar", function (done) {
test.do(() => expect(sheetBody().clientWidth).toBeGreaterThanOrEqual(sheetBody().scrollWidth));
test.start();
});
+
+function simulatingResize(columnHead, movePx) {
+ const resizeElement = columnHead.querySelector(".tobago-resize");
+ const headerCols = columnHead.closest("table").querySelectorAll("col")
+ const columnIndex = parseInt(resizeElement.dataset.tobagoColumnIndex);
+ const headerColumn = headerCols.item(columnIndex);
+ const startClientX = resizeElement.getBoundingClientRect().x;
+ resizeElement.dispatchEvent(new MouseEvent("mousedown", {
+ columnIndex: columnIndex,
+ clientX: startClientX,
+ originalHeaderColumnWidth: parseInt(getComputedStyle(headerColumn).width),
+ }));
+
+ resizeElement.dispatchEvent(new MouseEvent("mousemove", {
+ bubbles: true,
+ clientX: startClientX + movePx
+ }));
+
+ resizeElement.dispatchEvent(new MouseEvent("mouseup", {bubbles: true}));
+}
diff --git a/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/3000-sheet/20-sheet-column-width/Sheet_Column_Width.xhtml b/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/3000-sheet/20-sheet-column-width/Sheet_Column_Width.xhtml
index c3ea23a435..9d34e95375 100644
--- a/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/3000-sheet/20-sheet-column-width/Sheet_Column_Width.xhtml
+++ b/tobago-example/tobago-example-demo/src/main/webapp/content/900-test/3000-sheet/20-sheet-column-width/Sheet_Column_Width.xhtml
@@ -23,7 +23,23 @@
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<tc:style file="#{request.contextPath}/css/demo.css"/>
- <tc:sheet id="pixelOnly" value="#{sheetController.solarList}" var="object" rows="2"
+ <tc:button id="hideColumn" label="hide second column" action="#{columnWidthController.setRenderSecondColumn(false)}"/>
+ <tc:button id="showColumn" label="show second column" action="#{columnWidthController.setRenderSecondColumn(true)}"/>
+
+ <tc:sheet id="columnRenderedFalse" value="#{columnWidthController.solarList}" var="object" rows="2"
+ columns="100px 200px 300px">
+ <tc:column label="Name">
+ <tc:out value="#{object.name}"/>
+ </tc:column>
+ <tc:column label="Orbit" rendered="#{columnWidthController.renderSecondColumn}">
+ <tc:out value="#{object.orbit}"/>
+ </tc:column>
+ <tc:column label="Period (Days)">
+ <tc:out value="#{object.period}"/>
+ </tc:column>
+ </tc:sheet>
+
+ <tc:sheet id="pixelOnly" value="#{columnWidthController.solarList}" var="object" rows="2"
columns="10px 20px 30px">
<tc:column label="Name">
<tc:out value="#{object.name}"/>
@@ -36,7 +52,7 @@
</tc:column>
</tc:sheet>
- <tc:sheet id="percentOnly" value="#{sheetController.solarList}" var="object" rows="2"
+ <tc:sheet id="percentOnly" value="#{columnWidthController.solarList}" var="object" rows="2"
columns="10% 20% 30%">
<tc:style width="1000px"/>
<tc:column label="Name">
@@ -50,7 +66,7 @@
</tc:column>
</tc:sheet>
- <tc:sheet id="autoOnly" value="#{sheetController.solarList}" var="object" rows="2"
+ <tc:sheet id="autoOnly" value="#{columnWidthController.solarList}" var="object" rows="2"
columns="auto">
<tc:style width="900px"/>
<tc:column label="Name">
@@ -64,7 +80,7 @@
</tc:column>
</tc:sheet>
- <tc:sheet id="testSheetColumnWidth" value="#{sheetController.solarList}" var="luminary"
+ <tc:sheet id="testSheetColumnWidth" value="#{columnWidthController.solarList}" var="luminary"
columns="200px 1fr 1fr" rows="5" markup="bordered">
<tc:style customClass="vertical-border-big"/>
<tc:column label="Name">
diff --git a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-sheet.ts b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-sheet.ts
index 8c563ad15f..64e06b33a7 100644
--- a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-sheet.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-sheet.ts
@@ -372,15 +372,6 @@ Status: ${data.status}
Type: ${data.type}`);
}
- saveColumnWidths(widths: number[]): void {
- const hidden = document.getElementById(this.id + "::widths");
- if (hidden) {
- hidden.setAttribute("value", JSON.stringify(widths));
- } else {
- console.warn("ignored, should not be called, id='%s'", this.id);
- }
- }
-
private initScrollbarFiller(): void {
// set width of the scrollbar filler
if (this.scrollbarFiller) {
@@ -458,16 +449,30 @@ Type: ${data.type}`);
// switch off the mouse move listener
document.removeEventListener("mousemove", this.mousemoveData.mousemoveListener);
document.removeEventListener("mouseup", this.mousemoveData.mouseupListener);
- const widths: number[] = [];
+ const renderedColWidths: number[] = [];
this.headerCols.forEach((col, i) => {
if (!col.classList.contains(Css.TOBAGO_ROW_FILLER) && !col.classList.contains(Css.TOBAGO_BEHAVIOR_CONTAINER)) {
- widths[i] = parseInt(getComputedStyle(col).width);
+ renderedColWidths[i] = parseInt(getComputedStyle(col).width);
+ }
+ });
+
+ const oldWidth: number[] = this.hiddenInputWidthValue;
+ const newWidth: number[] = [];
+
+ let renderedColWidthsIndex = 0;
+ this.hiddenInputRenderedValue.forEach((rendered, index) => {
+ if (rendered) {
+ newWidth[index] = renderedColWidths[renderedColWidthsIndex];
+ renderedColWidthsIndex++;
+ } else if (oldWidth[index]) {
+ newWidth[index] = oldWidth[index];
+ } else {
+ newWidth[index] = -1;
}
});
- // store the width values in a hidden field
- this.saveColumnWidths(widths);
+ this.hiddenInputWidthValue = newWidth;
}
scrollAction(event: Event): void {
@@ -604,7 +609,7 @@ Type: ${data.type}`);
const tableRows = this.rowElements;
tableRows.forEach((rowElement) => {
if (rowElement.hasAttribute("row-index")) {
- if(!this.columnSelector.rowElement(rowElement).disabled) {
+ if (!this.columnSelector.rowElement(rowElement).disabled) {
rowIndexes.push(Number(rowElement.getAttribute("row-index")));
}
}
@@ -660,7 +665,7 @@ Type: ${data.type}`);
if (!selected.has(i)) {
const factor = tableRows.length > this.rows ? 2 : 1; // columnPanel
const element = tableRows.item((i - this.first) * factor);
- const inputElement= this.columnSelector.rowElement(element);
+ const inputElement = this.columnSelector.rowElement(element);
if (inputElement == null || !inputElement.disabled) {
everyRowSelected = false;
}
@@ -722,6 +727,36 @@ Type: ${data.type}`);
}
}
+ public get selectable(): Selectable {
+ return Selectable[this.dataset.tobagoSelectionMode];
+ }
+
+ get hiddenInputWidthValue(): number[] {
+ return JSON.parse(this.hiddenInputWidth.value);
+ }
+
+ set hiddenInputWidthValue(value: number[]) {
+ this.hiddenInputWidth.value = JSON.stringify(value);
+ }
+
+ private get hiddenInputWidth(): HTMLInputElement {
+ const rootNode = this.getRootNode() as ShadowRoot | Document;
+ return rootNode.getElementById(this.id + "::widths") as HTMLInputElement;
+ }
+
+ get hiddenInputRenderedValue(): boolean[] {
+ return JSON.parse(this.hiddenInputRendered.value);
+ }
+
+ set hiddenInputRenderedValue(value: boolean[]) {
+ this.hiddenInputRendered.value = JSON.stringify(value);
+ }
+
+ private get hiddenInputRendered(): HTMLInputElement {
+ const rootNode = this.getRootNode() as ShadowRoot | Document;
+ return rootNode.getElementById(this.id + "::rendered") as HTMLInputElement;
+ }
+
get scrollPosition(): number[] {
return JSON.parse(this.hiddenInputScrollPosition.value);
}
@@ -735,10 +770,6 @@ Type: ${data.type}`);
return rootNode.getElementById(this.id + "::scrollPosition") as HTMLInputElement;
}
- public get selectable(): Selectable {
- return Selectable[this.dataset.tobagoSelectionMode];
- }
-
get selected(): Set<number> {
return new Set<number>(JSON.parse(this.hiddenInputSelected.value));
}
(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 tobago-5.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git
commit e3e47516c45b0a56306c06b1e4007ecca71439af
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Wed Apr 23 11:03:27 2025 +0200
build(theme): rebuild
---
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 b4dd9aa0f5..1cd85acf3d 100644
--- a/tobago-theme/tobago-theme-standard/src/main/js/tobago.js
+++ b/tobago-theme/tobago-theme-standard/src/main/js/tobago.js
@@ -15,5 +15,5 @@ const st=new Map,nt={set(e,t,s){st.has(e)||st.set(e,new Map);const n=st.get(e);n
${s>0?" tabindex='"+String(s)+"'":""}
@click="${this.removeBadge.bind(this)}"
@focus="${this.focusEvent.bind(this)}"
- @blur="${this.blurEvent.bind(this)}"><i class='bi-x-lg'></i></button>`}removeBadge(e){var t;const s=e.target.closest(".btn-group").dataset.tobagoValue,n=this.hiddenSelect.querySelector(`[value="${s}"]`);n.selected=!1;const i=this.badges.querySelector(`[data-tobago-value="${s}"]`),o=i.previousElementSibling,r="SPAN"===(null===(t=i.nextElementSibling)||void 0===t?void 0:t.tagName)?i.nextElementSibling:null;o?o.querySelector("button.btn.badge").focus():r?r.querySelector("button.btn.ba [...]
+ @blur="${this.blurEvent.bind(this)}"><i class='bi-x-lg'></i></button>`}removeBadge(e){var t;const s=e.target.closest(".btn-group").dataset.tobagoValue,n=this.hiddenSelect.querySelector(`[value="${s}"]`);n.selected=!1;const i=this.badges.querySelector(`[data-tobago-value="${s}"]`),o=i.previousElementSibling,r="SPAN"===(null===(t=i.nextElementSibling)||void 0===t?void 0:t.tagName)?i.nextElementSibling:null;o?o.querySelector("button.btn.badge").focus():r?r.querySelector("button.btn.ba [...]
//# sourceMappingURL=tobago.js.map
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 616c45bf1a..45e9b12803 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-client-behaviors.ts","../ts/tobago-dropdown-menu.ts","../ts/tobago-bar.ts","../ts/tobago-date.ts","../ts/tobago-menu-store.ts","../ts/tobago-dropdown-item-factory.ts","../ts/tobago-dropdown-item.ts","../ts/tobago-dropdown.ts","../ts/tobago-overlay-type.ts","../ts/tobago-suggest-filter.ts","../ts/tobago-page-static.ts","../ts/tobago-page.ts","../ts/tobago-overlay.ts","../ts/tobago-file.ts" [...]
\ No newline at end of file
+{"version":3,"file":"tobago.js","sources":["../ts/tobago-css.ts","../ts/tobago-key.ts","../ts/tobago-client-behaviors.ts","../ts/tobago-dropdown-menu.ts","../ts/tobago-bar.ts","../ts/tobago-date.ts","../ts/tobago-menu-store.ts","../ts/tobago-dropdown-item-factory.ts","../ts/tobago-dropdown-item.ts","../ts/tobago-dropdown.ts","../ts/tobago-overlay-type.ts","../ts/tobago-suggest-filter.ts","../ts/tobago-page-static.ts","../ts/tobago-page.ts","../ts/tobago-overlay.ts","../ts/tobago-file.ts" [...]
\ No newline at end of file