| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | |||
| 6 | 6 | ||
| 7 | 7 | ## [Unreleased] | |
| 8 | 8 | ||
| 9 | + ### Fixed | ||
| 10 | + | ||
| 11 | + - Fix drawer body components | ||
| 12 | + | ||
| 9 | 13 | ## [0.4.4] - 2026-01-08 | |
| 10 | 14 | ||
| 11 | 15 | ### Added | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,8 +16,8 @@ | |||
| 16 | 16 | package org.patternfly.component.drawer; | |
| 17 | 17 | ||
| 18 | 18 | import org.jboss.elemento.ElementTextMethods; | |
| 19 | + import org.patternfly.style.Modifiers.NoPadding; | ||
| 19 | 20 | import org.patternfly.style.Modifiers.Padding; | |
| 20 | - | ||
| 21 | 21 | import elemental2.dom.HTMLDivElement; | |
| 22 | 22 | ||
| 23 | 23 | import static org.jboss.elemento.Elements.div; | |
@@ -28,28 +28,29 @@ | |||
| 28 | 28 | /** | |
| 29 | 29 | * Subcomponent for elements in a {@link DrawerContent}. | |
| 30 | 30 | */ | |
| 31 | - public class DrawerContentBody extends DrawerSubComponent<HTMLDivElement, DrawerContentBody> implements | ||
| 32 | - ElementTextMethods<HTMLDivElement, DrawerContentBody>, | ||
| 33 | - Padding<HTMLDivElement, DrawerContentBody> { | ||
| 31 | + public class DrawerBody extends DrawerSubComponent<HTMLDivElement, DrawerBody> implements | ||
| 32 | + ElementTextMethods<HTMLDivElement, DrawerBody>, | ||
| 33 | + Padding<HTMLDivElement, DrawerBody>, | ||
| 34 | + NoPadding<HTMLDivElement, DrawerBody> { | ||
| 34 | 35 | ||
| 35 | 36 | // ------------------------------------------------------ factory | |
| 36 | 37 | ||
| 37 | - public static DrawerContentBody drawerContentBody() { | ||
| 38 | - return new DrawerContentBody(); | ||
| 38 | + public static DrawerBody drawerBody() { | ||
| 39 | + return new DrawerBody(); | ||
| 39 | 40 | } | |
| 40 | 41 | ||
| 41 | 42 | // ------------------------------------------------------ instance | |
| 42 | 43 | ||
| 43 | - public static final String SUB_COMPONENT_NAME = "dcb"; | ||
| 44 | + public static final String SUB_COMPONENT_NAME = "db"; | ||
| 44 | 45 | ||
| 45 | - DrawerContentBody() { | ||
| 46 | + DrawerBody() { | ||
| 46 | 47 | super(SUB_COMPONENT_NAME, div().css(component(drawer, body)).element()); | |
| 47 | 48 | } | |
| 48 | 49 | ||
| 49 | 50 | // ------------------------------------------------------ builder | |
| 50 | 51 | ||
| 51 | 52 | @Override | |
| 52 | - public DrawerContentBody that() { | ||
| 53 | + public DrawerBody that() { | ||
| 53 | 54 | return this; | |
| 54 | 55 | } | |
| 55 | 56 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,7 +44,7 @@ public static DrawerContent drawerContent() { | |||
| 44 | 44 | ||
| 45 | 45 | // ------------------------------------------------------ add | |
| 46 | 46 | ||
| 47 | - public DrawerContent addBody(DrawerContentBody body) { | ||
| 47 | + public DrawerContent addBody(DrawerBody body) { | ||
| 48 | 48 | return add(body); | |
| 49 | 49 | } | |
| 50 | 50 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -197,7 +197,7 @@ public DrawerPanel addHead(DrawerPanelHead head) { | |||
| 197 | 197 | return add(head); | |
| 198 | 198 | } | |
| 199 | 199 | ||
| 200 | - public DrawerPanel addBody(DrawerPanelBody body) { | ||
| 200 | + public DrawerPanel addBody(DrawerBody body) { | ||
| 201 | 201 | return add(body); | |
| 202 | 202 | } | |
| 203 | 203 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,17 +15,10 @@ | |||
| 15 | 15 | */ | |
| 16 | 16 | package org.patternfly.component.drawer; | |
| 17 | 17 | ||
| 18 | - import org.jboss.elemento.Attachable; | ||
| 19 | - import org.jboss.elemento.ElementContainerDelegate; | ||
| 20 | 18 | import org.patternfly.style.Modifiers.NoPadding; | |
| 21 | - | ||
| 22 | - import elemental2.dom.Element; | ||
| 23 | 19 | import elemental2.dom.HTMLDivElement; | |
| 24 | - import elemental2.dom.HTMLElement; | ||
| 25 | - import elemental2.dom.MutationRecord; | ||
| 26 | 20 | ||
| 27 | 21 | import static org.jboss.elemento.Elements.div; | |
| 28 | - import static org.patternfly.component.drawer.DrawerPanelBody.drawerPanelBody; | ||
| 29 | 22 | import static org.patternfly.style.Classes.component; | |
| 30 | 23 | import static org.patternfly.style.Classes.drawer; | |
| 31 | 24 | import static org.patternfly.style.Classes.head; | |
@@ -34,8 +27,6 @@ | |||
| 34 | 27 | * Subcomponent for the header inside a {@link DrawerPanel}. | |
| 35 | 28 | */ | |
| 36 | 29 | public class DrawerPanelHead extends DrawerSubComponent<HTMLDivElement, DrawerPanelHead> implements | |
| 37 | - Attachable, | ||
| 38 | - ElementContainerDelegate<HTMLDivElement, DrawerPanelHead>, | ||
| 39 | 30 | NoPadding<HTMLDivElement, DrawerPanelHead> { | |
| 40 | 31 | ||
| 41 | 32 | // ------------------------------------------------------ factory | |
@@ -47,29 +38,9 @@ public static DrawerPanelHead drawerPanelHead() { | |||
| 47 | 38 | // ------------------------------------------------------ instance | |
| 48 | 39 | ||
| 49 | 40 | public static final String SUB_COMPONENT_NAME = "dph"; | |
| 50 | - private final HTMLElement headContainer; | ||
| 51 | - private boolean adjustTabIndex; | ||
| 52 | 41 | ||
| 53 | 42 | DrawerPanelHead() { | |
| 54 | - super(SUB_COMPONENT_NAME, drawerPanelBody().element()); | ||
| 55 | - element().appendChild(headContainer = div().css(component(drawer, head)).element()); | ||
| 56 | - Attachable.register(this, this); | ||
| 57 | - } | ||
| 58 | - | ||
| 59 | - @Override | ||
| 60 | - public void attach(MutationRecord mutationRecord) { | ||
| 61 | - if (adjustTabIndex) { | ||
| 62 | - Drawer drawer = lookupComponent(); | ||
| 63 | - if (headContainer.firstElementChild instanceof HTMLElement) { | ||
| 64 | - HTMLElement firstElement = ((HTMLElement) headContainer.firstElementChild); | ||
| 65 | - drawer.onToggle((event, drw, expanded) -> firstElement.tabIndex = expanded ? 0 : -1); | ||
| 66 | - } | ||
| 67 | - } | ||
| 68 | - } | ||
| 69 | - | ||
| 70 | - @Override | ||
| 71 | - public Element containerDelegate() { | ||
| 72 | - return headContainer; | ||
| 43 | + super(SUB_COMPONENT_NAME, div().css(component(drawer, head)).element()); | ||
| 73 | 44 | } | |
| 74 | 45 | ||
| 75 | 46 | // ------------------------------------------------------ add | |
@@ -80,15 +51,6 @@ public DrawerPanelHead addCloseButton(DrawerCloseButton closeButton) { | |||
| 80 | 51 | ||
| 81 | 52 | // ------------------------------------------------------ builder | |
| 82 | 53 | ||
| 83 | - /** | ||
| 84 | - * By default, the tab index of the first HTML element is set to 0 if the drawer is expanded and to -1 if the drawer is | ||
| 85 | - * collapsed. Use this method to turn this feature off. | ||
| 86 | - */ | ||
| 87 | - public DrawerPanelHead noAutoTabIndex() { | ||
| 88 | - this.adjustTabIndex = false; | ||
| 89 | - return this; | ||
| 90 | - } | ||
| 91 | - | ||
| 92 | 54 | @Override | |
| 93 | 55 | public DrawerPanelHead that() { | |
| 94 | 56 | return this; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments