|
28 | 28 | import com.vaadin.flow.component.dependency.JsModule; |
29 | 29 | import com.vaadin.flow.component.dependency.NpmPackage; |
30 | 30 | import com.vaadin.flow.component.html.Span; |
| 31 | +import com.vaadin.flow.component.shared.HasAriaRole; |
31 | 32 | import com.vaadin.flow.component.shared.HasThemeVariant; |
32 | 33 | import com.vaadin.flow.component.shared.SlotUtils; |
33 | 34 | import com.vaadin.flow.dom.Element; |
|
41 | 42 | @NpmPackage(value = "@vaadin/card", version = "25.2.0-rc2") |
42 | 43 | @JsModule("@vaadin/card/src/vaadin-card.js") |
43 | 44 | public class Card extends Component implements HasSize, |
44 | | - HasThemeVariant<CardVariant>, HasComponents, HasAriaLabel { |
| 45 | + HasThemeVariant<CardVariant>, HasComponents, HasAriaLabel, HasAriaRole { |
45 | 46 |
|
46 | 47 | private static final String MEDIA_SLOT_NAME = "media"; |
47 | 48 | private static final String TITLE_SLOT_NAME = "title"; |
@@ -340,29 +341,6 @@ public void addComponentAtIndex(int index, Component component) { |
340 | 341 | } |
341 | 342 | } |
342 | 343 |
|
343 | | - /** |
344 | | - * Sets the ARIA role attribute on the card. |
345 | | - * |
346 | | - * @param role |
347 | | - * the ARIA role, or {@code null} to clear |
348 | | - */ |
349 | | - public void setAriaRole(String role) { |
350 | | - if (role == null) { |
351 | | - getElement().removeAttribute("role"); |
352 | | - } else { |
353 | | - getElement().setAttribute("role", role); |
354 | | - } |
355 | | - } |
356 | | - |
357 | | - /** |
358 | | - * Gets the ARIA role attribute of the card. |
359 | | - * |
360 | | - * @return an optional ARIA role of the card if no ARIA role has been set |
361 | | - */ |
362 | | - public Optional<String> getAriaRole() { |
363 | | - return Optional.ofNullable(getElement().getAttribute("role")); |
364 | | - } |
365 | | - |
366 | 344 | private void doSetTitle(String title) { |
367 | 345 | if (title == null) { |
368 | 346 | getElement().removeProperty(CARD_TITLE_PROPERTY); |
|
0 commit comments