-
Notifications
You must be signed in to change notification settings - Fork 59
[BACKPORT(FORMS-23760)]: Private release/table-component IRS #1908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
76d56d4
added basic config files for the table component
1d5f5cb
added .content.xml for the table component
9315681
added edit toolbar for the table component _cq_editConfig.xml
2a5723e
added table.html
1b4bfb8
added site clientlibs for the table component
4b398e0
added basic css and js for the table authoring currently refering the…
0148204
added basic config files for the tableheader
ba3063f
added basic config files for the tablerow
ae06102
added site clientlibs for tableheader
2b2dff8
added clientlibs folder in the tablerow
c413719
added the table component in examples folder along with cq_template
b8ec4bd
added runtime dependencies in the runtime all for the table component
b35d101
replaced the tr elements from the div elements to fix the selecting i…
adf8f06
added action configs in the edit toolbar for the table component
aca5d93
added action configs for the table row and the tableroweditorhook.js …
8bd6756
removed the add row option from the tableHeaderRow
a3b60d0
updated the header cells from the textinput to text type in the templ…
ec7a8d9
added the addCol and deleteCol actions and also there handlers
e25e3f9
removed cell numbers from dynamic addition of the table cols and rows
409d474
added the feature of repeatable panels to the table row at runtime
edce421
added the replace feature for the tablecell to any component which is…
fe8c783
removed the delete options from the table cells in the table row
a566d04
in this commit table tags have gone -> repeatable panels not working …
60fea30
added files to fix the repeatative panels with the table tags
635b522
fixed the repeatable rows with indexing
02fea0c
changed the authoring from divs to tabletags sacirificing the touch u…
44c0686
fixed the touch ui with the table tags
7b1b0bd
fixed the tablecell css having controls
cd324ab
removed the tableeditor.css file
33a9e0c
added replace feature to the components of the table Header also
f871869
fixed the refresh issue by adding authoring dialogs for table row and…
3e6c7b7
added cypress tests and collaterals for testing
e16098e
added sling folder for collaterals
64c5921
fixed the test cases
39e5194
fixed the content.xml
358e811
fixed the failing testcases
1de1eec
updated the year to 2026
099a0ec
fixed the short and long description for the table component
ae74f82
removed unsupported authoring from the table component
7292787
refactored the table.html
4224ff8
updated README for the table Component
ab85642
Resolved Conflicts
db233e8
added sorting feature for the table component
6dcec2f
enabled sorting button during authoring too
ef40c92
added feature to disable/enable sorting on a particular column of the…
fe125df
added authoring options for sorting and column width
75df314
added dor support for table component
a207098
added dor testing
d5373dc
added the feature of merge and split cell during runtime by adding co…
d8a7ef9
updated README for table, tableheader, tablerow
569d399
added the feature for merge row cells and commented out the header ce…
3dbac3c
added testing for second phase features
c4ca4ec
fixed review comments 1
798a659
fixed review comments 2
490826a
fixed cypress tests
82a1718
fixed coverage
8db65c3
fixed the sorting behaviour to improve the archaic behavior
e76b217
fixed cypress testing mergesplit feature
4b44957
fixed cypress testing
2379b94
removed css and moved it to canvas theme
270baaf
Updating regex for private release tag
244b9ad
Fix Nexus staging URL for central.sonatype.com
3e7cee4
@releng [maven-scm] :prepare release core-forms-components-reactor-1.…
c4771c3
@releng [maven-scm] :prepare for next development iteration
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/TableHeaderImpl.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| ~ Copyright 2026 Adobe | ||
| ~ | ||
| ~ Licensed 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 com.adobe.cq.forms.core.components.internal.models.v1.form; | ||
|
|
||
| import org.apache.sling.api.SlingHttpServletRequest; | ||
| import org.apache.sling.api.resource.Resource; | ||
| import org.apache.sling.models.annotations.Exporter; | ||
| import org.apache.sling.models.annotations.Model; | ||
| import org.jetbrains.annotations.NotNull; | ||
|
|
||
| import com.adobe.cq.export.json.ComponentExporter; | ||
| import com.adobe.cq.export.json.ExporterConstants; | ||
| import com.adobe.cq.forms.core.components.internal.form.FormConstants; | ||
| import com.adobe.cq.forms.core.components.internal.form.ReservedProperties; | ||
| import com.adobe.cq.forms.core.components.models.form.Panel; | ||
|
|
||
| @Model( | ||
| adaptables = { SlingHttpServletRequest.class, Resource.class }, | ||
| adapters = { Panel.class, ComponentExporter.class }, | ||
| resourceType = { FormConstants.RT_FD_FORM_TABLE_HEADER_V1 }) | ||
| @Exporter(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, extensions = ExporterConstants.SLING_MODEL_EXTENSION) | ||
| public class TableHeaderImpl extends PanelImpl { | ||
|
|
||
| @Override | ||
| @NotNull | ||
| public String getExportedType() { | ||
| return ReservedProperties.VT_TABLE_HEADER; | ||
| } | ||
| } |
142 changes: 142 additions & 0 deletions
142
...e/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/TableImpl.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| ~ Copyright 2026 Adobe | ||
| ~ | ||
| ~ Licensed 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 com.adobe.cq.forms.core.components.internal.models.v1.form; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.Collections; | ||
| import java.util.LinkedHashMap; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| import javax.annotation.Nullable; | ||
|
|
||
| import org.apache.sling.api.SlingHttpServletRequest; | ||
| import org.apache.sling.api.resource.Resource; | ||
| import org.apache.sling.models.annotations.Exporter; | ||
| import org.apache.sling.models.annotations.Model; | ||
| import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy; | ||
| import org.apache.sling.models.annotations.injectorspecific.ValueMapValue; | ||
| import org.jetbrains.annotations.NotNull; | ||
|
|
||
| import com.adobe.cq.export.json.ComponentExporter; | ||
| import com.adobe.cq.export.json.ExporterConstants; | ||
| import com.adobe.cq.forms.core.components.internal.form.FormConstants; | ||
| import com.adobe.cq.forms.core.components.internal.form.ReservedProperties; | ||
| import com.adobe.cq.forms.core.components.models.form.Panel; | ||
| import com.fasterxml.jackson.annotation.JsonIgnore; | ||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
|
||
| @Model( | ||
| adaptables = { SlingHttpServletRequest.class, Resource.class }, | ||
| adapters = { Panel.class, ComponentExporter.class }, | ||
| resourceType = { FormConstants.RT_FD_FORM_TABLE_V1 }) | ||
| @Exporter(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, extensions = ExporterConstants.SLING_MODEL_EXTENSION) | ||
| public class TableImpl extends PanelImpl { | ||
|
|
||
| @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = ReservedProperties.PN_DOR_COLUMN_WIDTHS) | ||
| @Nullable | ||
| protected String columnWidth; | ||
|
|
||
| @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = ReservedProperties.PN_ENABLE_SORTING) | ||
| @Nullable | ||
| protected Boolean enableSorting; | ||
|
|
||
| /** | ||
| * When {@code true}, runtime (publish) enables client-side column sorting. | ||
| * Omitted from JSON when {@code false} (see {@link JsonInclude.Include#NON_DEFAULT}). | ||
| */ | ||
| @JsonProperty("enableSorting") | ||
| @JsonInclude(JsonInclude.Include.NON_DEFAULT) | ||
| public boolean isEnableSorting() { | ||
| return Boolean.TRUE.equals(enableSorting); | ||
| } | ||
|
|
||
| /** | ||
| * Returns the raw comma-separated column width string from JCR (e.g. "1,1,4"). | ||
| * Used in edit mode as the {@code data-column-widths} attribute. | ||
| */ | ||
| @JsonIgnore | ||
| public String getColumnWidth() { | ||
| return columnWidth; | ||
| } | ||
|
|
||
| /** | ||
| * True when {@link #getColumnWidthColStyles()} would return a non-empty list (valid authored widths). | ||
| */ | ||
| @JsonIgnore | ||
| public boolean isColumnWidthsConfigured() { | ||
| return !getColumnWidthColStyles().isEmpty(); | ||
| } | ||
|
|
||
| @Override | ||
| @NotNull | ||
| public String getExportedType() { | ||
| return ReservedProperties.VT_TABLE; | ||
| } | ||
|
|
||
| @Override | ||
| @JsonIgnore | ||
| @NotNull | ||
| public Map<String, Object> getDorProperties() { | ||
| Map<String, Object> props = new LinkedHashMap<>(super.getDorProperties()); | ||
| if (columnWidth != null && !columnWidth.isEmpty()) { | ||
| // Pass authored proportional widths into fd:dor so DoRTableElement can compute | ||
| // proportional XFA column widths (e.g. "1,2,1" → relative pixel widths). | ||
| props.put(ReservedProperties.PN_DOR_COLUMN_WIDTHS, columnWidth); | ||
| } | ||
| return props; | ||
| } | ||
|
|
||
| /** | ||
| * One entry per column for {@code <col style="...">}: {@code width: N%} (no HTL string concatenation). | ||
| * For example, proportional {@code "1,1,4"} becomes {@code width: 16%}, {@code width: 16%}, {@code width: 66%}. | ||
| * Negative or non-numeric values are treated as 1. The last column absorbs any rounding remainder so widths sum to 100%. | ||
| */ | ||
| @JsonIgnore | ||
| public List<String> getColumnWidthColStyles() { | ||
| if (columnWidth == null || columnWidth.isEmpty()) { | ||
| return Collections.emptyList(); | ||
| } | ||
| String[] parts = columnWidth.split(","); | ||
| int[] values = new int[parts.length]; | ||
| int sum = 0; | ||
| for (int i = 0; i < parts.length; i++) { | ||
| try { | ||
| values[i] = Integer.parseInt(parts[i].trim()); | ||
| } catch (NumberFormatException e) { | ||
| values[i] = 1; | ||
| } | ||
| if (values[i] < 0) { | ||
| values[i] = 0; | ||
| } | ||
| sum += values[i]; | ||
| } | ||
| if (sum == 0) { | ||
| return Collections.emptyList(); | ||
| } | ||
| List<String> result = new ArrayList<>(); | ||
| int allocated = 0; | ||
| for (int i = 0; i < values.length; i++) { | ||
| int pct = (i == values.length - 1) | ||
| ? (100 - allocated) | ||
| : (int) Math.floor((values[i] * 100.0) / sum); | ||
| allocated += pct; | ||
| result.add("width: " + pct + "%"); | ||
| } | ||
| return result; | ||
| } | ||
| } |
42 changes: 42 additions & 0 deletions
42
...rc/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/TableRowImpl.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| ~ Copyright 2026 Adobe | ||
| ~ | ||
| ~ Licensed 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 com.adobe.cq.forms.core.components.internal.models.v1.form; | ||
|
|
||
| import org.apache.sling.api.SlingHttpServletRequest; | ||
| import org.apache.sling.api.resource.Resource; | ||
| import org.apache.sling.models.annotations.Exporter; | ||
| import org.apache.sling.models.annotations.Model; | ||
| import org.jetbrains.annotations.NotNull; | ||
|
|
||
| import com.adobe.cq.export.json.ComponentExporter; | ||
| import com.adobe.cq.export.json.ExporterConstants; | ||
| import com.adobe.cq.forms.core.components.internal.form.FormConstants; | ||
| import com.adobe.cq.forms.core.components.internal.form.ReservedProperties; | ||
| import com.adobe.cq.forms.core.components.models.form.Panel; | ||
|
|
||
| @Model( | ||
| adaptables = { SlingHttpServletRequest.class, Resource.class }, | ||
| adapters = { Panel.class, ComponentExporter.class }, | ||
| resourceType = { FormConstants.RT_FD_FORM_TABLE_ROW_V1 }) | ||
| @Exporter(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, extensions = ExporterConstants.SLING_MODEL_EXTENSION) | ||
| public class TableRowImpl extends PanelImpl { | ||
|
|
||
| @Override | ||
| @NotNull | ||
| public String getExportedType() { | ||
| return ReservedProperties.VT_TABLE_ROW; | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this is needed?