| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ba95c45 commit f32a23d
9 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -358,7 +358,7 @@ private void afterWire() { | |||
| 358 | 358 | // content after toggle => direction = down | |
| 359 | 359 | directionUp = false; | |
| 360 | 360 | } | |
| 361 | - if (directionUp) { | ||
| 361 | + if (directionUp && truncate == 0) { | ||
| 362 | 362 | contentEsElement.classList.add(modifier(expandTop)); | |
| 363 | 363 | } | |
| 364 | 364 | if (truncate > 0) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,6 +16,7 @@ | |||
| 16 | 16 | package org.patternfly.component.expandable; | |
| 17 | 17 | ||
| 18 | 18 | import org.jboss.elemento.ElementContainerDelegate; | |
| 19 | + import org.jboss.elemento.HTMLContainerBuilder; | ||
| 19 | 20 | import org.patternfly.component.button.Button; | |
| 20 | 21 | ||
| 21 | 22 | import elemental2.dom.Element; | |
@@ -44,15 +45,29 @@ public class ExpandableSectionToggle extends ExpandableSectionSubComponent<HTMLE | |||
| 44 | 45 | // ------------------------------------------------------ factory | |
| 45 | 46 | ||
| 46 | 47 | public static ExpandableSectionToggle expandableSectionToggle() { | |
| 47 | - return new ExpandableSectionToggle(null, null); | ||
| 48 | + return new ExpandableSectionToggle(div(), null, null); | ||
| 48 | 49 | } | |
| 49 | 50 | ||
| 50 | 51 | public static ExpandableSectionToggle expandableSectionToggle(String moreText) { | |
| 51 | - return new ExpandableSectionToggle(moreText, null); | ||
| 52 | + return new ExpandableSectionToggle(div(), moreText, null); | ||
| 52 | 53 | } | |
| 53 | 54 | ||
| 54 | 55 | public static ExpandableSectionToggle expandableSectionToggle(String moreText, String lessText) { | |
| 55 | - return new ExpandableSectionToggle(moreText, lessText); | ||
| 56 | + return new ExpandableSectionToggle(div(), moreText, lessText); | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + public static <E extends HTMLElement> ExpandableSectionToggle expandableSectionToggle(HTMLContainerBuilder<E> builder) { | ||
| 60 | + return new ExpandableSectionToggle(builder, null, null); | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + public static <E extends HTMLElement> ExpandableSectionToggle expandableSectionToggle(HTMLContainerBuilder<E> builder, | ||
| 64 | + String moreText) { | ||
| 65 | + return new ExpandableSectionToggle(builder, moreText, null); | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + public static <E extends HTMLElement> ExpandableSectionToggle expandableSectionToggle(HTMLContainerBuilder<E> builder, | ||
| 69 | + String moreText, String lessText) { | ||
| 70 | + return new ExpandableSectionToggle(builder, moreText, lessText); | ||
| 56 | 71 | } | |
| 57 | 72 | ||
| 58 | 73 | // ------------------------------------------------------ instance | |
@@ -65,14 +80,14 @@ public static ExpandableSectionToggle expandableSectionToggle(String moreText, S | |||
| 65 | 80 | private String moreText; | |
| 66 | 81 | private String lessText; | |
| 67 | 82 | ||
| 68 | - ExpandableSectionToggle(String moreText, String lessText) { | ||
| 69 | - super(SUB_COMPONENT_ID, SUB_COMPONENT_NAME, div().css(component(expandableSection, toggle)).element()); | ||
| 83 | + <E extends HTMLElement> ExpandableSectionToggle(HTMLContainerBuilder<E> builder, String moreText, String lessText) { | ||
| 84 | + super(SUB_COMPONENT_ID, SUB_COMPONENT_NAME, builder.css(component(expandableSection, toggle)).element()); | ||
| 70 | 85 | this.moreText = moreText; | |
| 71 | 86 | this.lessText = lessText; | |
| 72 | 87 | this.iconContainer = span().css(component(expandableSection, toggle, icon)) | |
| 73 | 88 | .add(caretRight()) | |
| 74 | 89 | .element(); | |
| 75 | - this.button = button().css(component(expandableSection, toggle)) | ||
| 90 | + this.button = button() | ||
| 76 | 91 | .link() | |
| 77 | 92 | .aria(expanded, false) | |
| 78 | 93 | .iconAndText(iconContainer, moreText, start) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -82,7 +82,7 @@ public static FormFieldGroup formFieldGroup(boolean expandable) { | |||
| 82 | 82 | .attr(role, group) | |
| 83 | 83 | .element()); | |
| 84 | 84 | this.titleId = Id.unique(ComponentType.Form.id, SUB_COMPONENT_ID, "title"); | |
| 85 | - this.expandable = false; | ||
| 85 | + this.expandable = expandable; | ||
| 86 | 86 | storeSubComponent(); | |
| 87 | 87 | Attachable.register(this, this); | |
| 88 | 88 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -89,7 +89,7 @@ | |||
| 89 | 89 | <version.gwt.safehtml>1.0.0-RC1</version.gwt.safehtml> <!-- Only used to link the API doc --> | |
| 90 | 90 | <version.junit>6.1.1</version.junit> | |
| 91 | 91 | <version.node>v26.3.1</version.node> | |
| 92 | - <version.patternfly>6.5.2</version.patternfly> | ||
| 92 | + <version.patternfly>6.6.0</version.patternfly> | ||
| 93 | 93 | ||
| 94 | 94 | <!-- Plugin versions --> | |
| 95 | 95 | <version.central.publishing.plugin>0.11.0</version.central.publishing.plugin> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,125 @@ | |||
| 1 | + --- | ||
| 2 | + component: expandable-section | ||
| 3 | + date: 2026-07-07 | ||
| 4 | + pf_version: Release 6.6.0 | ||
| 5 | + pf_url: https://www.patternfly.org/components/expandable-section | ||
| 6 | + pfj_url: http://localhost:1234/components/expandable-section | ||
| 7 | + sections: | ||
| 8 | + pf_count: 10 | ||
| 9 | + pfj_count: 8 | ||
| 10 | + matched: 7 | ||
| 11 | + missing_in_pfj: | ||
| 12 | + - Uncontrolled | ||
| 13 | + - Uncontrolled with dynamic toggle content (function) | ||
| 14 | + - With heading semantics | ||
| 15 | + extra_in_pfj: | ||
| 16 | + - Detached (after) | ||
| 17 | + --- | ||
| 18 | + | ||
| 19 | + # PF Compare: expandable-section | ||
| 20 | + | ||
| 21 | + ## Section Coverage | ||
| 22 | + | ||
| 23 | + | # | PF Section | PFJ Section | Group | Status | | ||
| 24 | + |---|------------|-------------|-------|--------| | ||
| 25 | + | 1 | Basic | Basic | Examples | matched | | ||
| 26 | + | 2 | Uncontrolled | --- | Examples | missing_in_pfj | | ||
| 27 | + | 3 | Uncontrolled with dynamic toggle text | Basic with dynamic toggle text | Examples | semantic_match | | ||
| 28 | + | 4 | Uncontrolled with dynamic toggle content (function) | --- | Examples | missing_in_pfj | | ||
| 29 | + | 5 | Detached | Detached (before) | Examples | semantic_match | | ||
| 30 | + | 6 | --- | Detached (after) | Examples | extra_in_pfj | | ||
| 31 | + | 7 | Disclosure variation | Disclosure variation | Examples | matched | | ||
| 32 | + | 8 | Indented expandable content | Indented | Examples | semantic_match | | ||
| 33 | + | 9 | With custom toggle content | With custom toggle content | Examples | matched | | ||
| 34 | + | 10 | With heading semantics | --- | Examples | missing_in_pfj | | ||
| 35 | + | 11 | Truncate expansion | Truncate | Examples | semantic_match | | ||
| 36 | + | ||
| 37 | + ## DOM Differences | ||
| 38 | + | ||
| 39 | + ### Basic | ||
| 40 | + | ||
| 41 | + **Status:** differences_found | ||
| 42 | + | ||
| 43 | + #### P2: Modifier Differences | ||
| 44 | + - PFJ `<button>` has extra class `pf-v6-c-expandable-section__toggle` alongside `pf-v6-c-button`. PF only has `pf-v6-c-button` on the button; the `__toggle` class is on the wrapper `<div>`. | ||
| 45 | + | ||
| 46 | + #### P4: Icon Differences | ||
| 47 | + - Toggle icon: PF viewBox `0 0 20 20` (chevron-down), PFJ viewBox `0 0 32 32` (caret-right with CSS rotation) | ||
| 48 | + | ||
| 49 | + ### Basic with dynamic toggle text | ||
| 50 | + | ||
| 51 | + **Status:** differences_found | ||
| 52 | + | ||
| 53 | + #### P2: Modifier Differences | ||
| 54 | + - Same as Basic: PFJ button has extra `pf-v6-c-expandable-section__toggle` class. | ||
| 55 | + | ||
| 56 | + #### P4: Icon Differences | ||
| 57 | + - Same as Basic: PF viewBox `0 0 20 20`, PFJ viewBox `0 0 32 32`. | ||
| 58 | + | ||
| 59 | + ### Detached | ||
| 60 | + | ||
| 61 | + **Status:** differences_found | ||
| 62 | + | ||
| 63 | + #### P2: Modifier Differences | ||
| 64 | + - Same as Basic: PFJ button has extra `pf-v6-c-expandable-section__toggle` class. | ||
| 65 | + | ||
| 66 | + #### P4: Icon Differences | ||
| 67 | + - Same as Basic: PF viewBox `0 0 20 20`, PFJ viewBox `0 0 32 32`. | ||
| 68 | + | ||
| 69 | + ### Disclosure variation | ||
| 70 | + | ||
| 71 | + **Status:** differences_found | ||
| 72 | + | ||
| 73 | + #### P2: Modifier Differences | ||
| 74 | + - Same as Basic: PFJ button has extra `pf-v6-c-expandable-section__toggle` class. | ||
| 75 | + - Root modifiers `pf-m-display-lg pf-m-limit-width` match correctly. | ||
| 76 | + | ||
| 77 | + #### P4: Icon Differences | ||
| 78 | + - Same as Basic: PF viewBox `0 0 20 20`, PFJ viewBox `0 0 32 32`. | ||
| 79 | + | ||
| 80 | + ### Indented | ||
| 81 | + | ||
| 82 | + **Status:** differences_found | ||
| 83 | + | ||
| 84 | + #### P2: Modifier Differences | ||
| 85 | + - Same as Basic: PFJ button has extra `pf-v6-c-expandable-section__toggle` class. | ||
| 86 | + - Root `pf-m-indented` modifier matches correctly. | ||
| 87 | + | ||
| 88 | + #### P4: Icon Differences | ||
| 89 | + - Same as Basic: PF viewBox `0 0 20 20`, PFJ viewBox `0 0 32 32`. | ||
| 90 | + | ||
| 91 | + #### P5: Cosmetic Differences | ||
| 92 | + - PF demo shows expanded state (`pf-m-expanded`) with a checkbox to toggle `displaySize`. PFJ shows collapsed state without checkbox. This is a showcase layout difference only. | ||
| 93 | + | ||
| 94 | + ### With custom toggle content | ||
| 95 | + | ||
| 96 | + **Status:** differences_found | ||
| 97 | + | ||
| 98 | + #### P2: Modifier Differences | ||
| 99 | + - Same as Basic: PFJ button has extra `pf-v6-c-expandable-section__toggle` class. | ||
| 100 | + | ||
| 101 | + #### P4: Icon Differences | ||
| 102 | + - Toggle icon: PF viewBox `0 0 20 20`, PFJ viewBox `0 0 32 32`. | ||
| 103 | + - Check-circle icon inside toggle content: Both use viewBox `0 0 32 32` — OK. | ||
| 104 | + - Badge `pf-v6-c-badge pf-m-read` — matches correctly. | ||
| 105 | + | ||
| 106 | + #### P5: Cosmetic Differences | ||
| 107 | + - PF wraps in `pf-v6-l-stack` with an accessibility note section. PFJ shows only the expandable section without the note. This is showcase layout only. | ||
| 108 | + | ||
| 109 | + ### Truncate | ||
| 110 | + | ||
| 111 | + **Status:** differences_found | ||
| 112 | + | ||
| 113 | + #### P2: Modifier Differences | ||
| 114 | + - Same as Basic: PFJ button has extra `pf-v6-c-expandable-section__toggle` class. | ||
| 115 | + - PFJ root has extra `pf-m-expand-top` modifier not present in PF. PF achieves content-first order through DOM ordering alone. | ||
| 116 | + - Button `pf-m-inline pf-m-link` modifiers match correctly. | ||
| 117 | + | ||
| 118 | + ## Action Items | ||
| 119 | + | ||
| 120 | + 1. **[P1] Add section: Uncontrolled** — PF has an "Uncontrolled" demo showing controlled state management. Add equivalent PFJ demo or document why it's not applicable. | ||
| 121 | + 2. **[P1] Add section: Uncontrolled with dynamic toggle content (function)** — PF shows a `toggleContent` function that receives expanded state and returns dynamic JSX. Evaluate whether PFJ needs an equivalent callback-based API for dynamic toggle content. | ||
| 122 | + 3. **[P1] Add section: With heading semantics** — PF uses `toggleWrapper` prop to wrap the toggle button in a heading element (h1-h6) for document structure. PFJ should support this for accessibility. | ||
| 123 | + 4. **[P2] Fix toggle button class** — PFJ button has extra `pf-v6-c-expandable-section__toggle` class. PF only applies this class to the wrapper `<div>`, not the `<button>` itself. Remove the extra class from the button element. Affects all sections. | ||
| 124 | + 5. **[P2] Fix truncate modifier** — PFJ truncate adds `pf-m-expand-top` on the root element. PF truncate does not use this modifier. Remove it if not required by CSS. | ||
| 125 | + 6. **[P4] Fix toggle icon** — PFJ uses caret-right (viewBox `0 0 32 32`) while PF uses chevron-down (viewBox `0 0 20 20`). This reflects a Red Hat vs FontAwesome icon set difference. Affects all sections with toggle icons. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,17 @@ | |||
| 1 | 1 | { | |
| 2 | + "name": "patternfly-java-showcase", | ||
| 3 | + "packageManager": "pnpm@11.10.0", | ||
| 4 | + "private": true, | ||
| 5 | + "scripts": { | ||
| 6 | + "audit:fix": "node audit.mjs", | ||
| 7 | + "code": "node code.mjs", | ||
| 8 | + "http-server": "http-server target/showcase --ssl --cert cert.pem", | ||
| 9 | + "images:clean": "rm -rf src/web/images/*", | ||
| 10 | + "images:download": "node images.mjs", | ||
| 11 | + "markdown": "node markdown.mjs", | ||
| 12 | + "prod": "vite build", | ||
| 13 | + "watch": "vite" | ||
| 14 | + }, | ||
| 2 | 15 | "dependencies": { | |
| 3 | 16 | "@github/relative-time-element": "^5.2.0", | |
| 4 | 17 | "@patternfly/patternfly": "^6.6.0" | |
@@ -18,18 +31,5 @@ | |||
| 18 | 31 | "unified": "^11.0.5", | |
| 19 | 32 | "vite": "^8.1.3", | |
| 20 | 33 | "yaml": "^2.9.0" | |
| 21 | - }, | ||
| 22 | - "name": "patternfly-java-showcase", | ||
| 23 | - "packageManager": "pnpm@11.10.0", | ||
| 24 | - "private": true, | ||
| 25 | - "scripts": { | ||
| 26 | - "audit:fix": "node audit.mjs", | ||
| 27 | - "code": "node code.mjs", | ||
| 28 | - "http-server": "http-server target/showcase --ssl --cert cert.pem", | ||
| 29 | - "images:clean": "rm -rf src/web/images/*", | ||
| 30 | - "images:download": "node images.mjs", | ||
| 31 | - "markdown": "node markdown.mjs", | ||
| 32 | - "prod": "vite build", | ||
| 33 | - "watch": "vite" | ||
| 34 | 34 | } | |
| 35 | 35 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -111,6 +111,15 @@ auditConfig: | |||
| 111 | 111 | - GHSA-vxr8-fq34-vvx9 | |
| 112 | 112 | - GHSA-x4vx-rjvf-j5p4 | |
| 113 | 113 | ||
| 114 | + # @patternfly/documentation-framework declares peer dependencies on React packages | ||
| 115 | + # that we don't use — we only import CSS files from it. | ||
| 116 | + peerDependencyRules: | ||
| 117 | + allowAny: | ||
| 118 | + - '@patternfly/react-code-editor' | ||
| 119 | + - '@patternfly/react-core' | ||
| 120 | + - '@patternfly/react-icons' | ||
| 121 | + - '@patternfly/react-table' | ||
| 122 | + | ||
| 114 | 123 | overrides: | |
| 115 | 124 | '@babel/core@<=7.29.0': '>=7.29.1' | |
| 116 | 125 | axios@>=1.0.0 <1.15.1: '>=1.15.1' | |
| Back | FazBrowse Home | New Git URL |
0 commit comments