Skip to content

Commit e2ff06f

Browse files
authored
refactor!: remove setOverlayClassName from overlay components (#7813)
1 parent a6f56ee commit e2ff06f

File tree

18 files changed

+16
-192
lines changed
  • vaadin-avatar-flow-parent/vaadin-avatar-flow/src
  • vaadin-combo-box-flow-parent/vaadin-combo-box-flow/src
  • vaadin-context-menu-flow-parent/vaadin-context-menu-flow/src
  • vaadin-date-picker-flow-parent/vaadin-date-picker-flow/src
  • vaadin-date-time-picker-flow-parent/vaadin-date-time-picker-flow/src
  • vaadin-flow-components-shared-parent/vaadin-flow-components-base/src
  • vaadin-menu-bar-flow-parent/vaadin-menu-bar-flow/src
  • vaadin-select-flow-parent/vaadin-select-flow/src
  • vaadin-time-picker-flow-parent/vaadin-time-picker-flow/src

18 files changed

+16
-192
lines changed

vaadin-avatar-flow-parent/vaadin-avatar-flow/src/main/java/com/vaadin/flow/component/avatar/AvatarGroup.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import com.vaadin.flow.component.UI;
3838
import com.vaadin.flow.component.dependency.JsModule;
3939
import com.vaadin.flow.component.dependency.NpmPackage;
40-
import com.vaadin.flow.component.shared.HasOverlayClassName;
4140
import com.vaadin.flow.component.shared.HasThemeVariant;
4241
import com.vaadin.flow.internal.JsonSerializer;
4342
import com.vaadin.flow.internal.NodeOwner;
@@ -70,8 +69,8 @@
7069
@Tag("vaadin-avatar-group")
7170
@JsModule("@vaadin/avatar-group/src/vaadin-avatar-group.js")
7271
@NpmPackage(value = "@vaadin/avatar-group", version = "25.0.0-alpha12")
73-
public class AvatarGroup extends Component implements HasOverlayClassName,
74-
HasStyle, HasSize, HasThemeVariant<AvatarGroupVariant> {
72+
public class AvatarGroup extends Component
73+
implements HasStyle, HasSize, HasThemeVariant<AvatarGroupVariant> {
7574

7675
/**
7776
* Item to be set as an avatar for the avatar group.

vaadin-avatar-flow-parent/vaadin-avatar-flow/src/test/java/com/vaadin/flow/component/avatar/tests/AvatarGroupTest.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import com.vaadin.flow.component.avatar.AvatarGroup.AvatarGroupItem;
2727
import com.vaadin.flow.component.avatar.AvatarGroupVariant;
2828
import com.vaadin.flow.component.avatar.AvatarVariant;
29-
import com.vaadin.flow.component.shared.HasOverlayClassName;
3029

3130
public class AvatarGroupTest {
3231

@@ -166,11 +165,4 @@ public void setI18n() {
166165
avatarGroup.setI18n(i18n);
167166
Assert.assertEquals(i18n, avatarGroup.getI18n());
168167
}
169-
170-
@Test
171-
public void implementsHasOverlayClassName() {
172-
Assert.assertTrue("AvatarGroup should support overlay class name",
173-
HasOverlayClassName.class
174-
.isAssignableFrom(new AvatarGroup().getClass()));
175-
}
176168
}

vaadin-combo-box-flow-parent/vaadin-combo-box-flow/src/main/java/com/vaadin/flow/component/combobox/ComboBoxBase.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
import com.vaadin.flow.component.shared.HasAllowedCharPattern;
5050
import com.vaadin.flow.component.shared.HasAutoOpen;
5151
import com.vaadin.flow.component.shared.HasClearButton;
52-
import com.vaadin.flow.component.shared.HasOverlayClassName;
5352
import com.vaadin.flow.component.shared.HasValidationProperties;
5453
import com.vaadin.flow.component.shared.InputField;
5554
import com.vaadin.flow.component.shared.ValidationUtil;
@@ -91,10 +90,9 @@
9190
* Type of the selection / value of the extending component
9291
*/
9392
public abstract class ComboBoxBase<TComponent extends ComboBoxBase<TComponent, TItem, TValue>, TItem, TValue>
94-
extends AbstractSinglePropertyField<TComponent, TValue>
95-
implements Focusable<TComponent>, HasAllowedCharPattern, HasAriaLabel,
96-
HasAutoOpen, HasClearButton, HasOverlayClassName,
97-
HasDataView<TItem, String, ComboBoxDataView<TItem>>,
93+
extends AbstractSinglePropertyField<TComponent, TValue> implements
94+
Focusable<TComponent>, HasAllowedCharPattern, HasAriaLabel, HasAutoOpen,
95+
HasClearButton, HasDataView<TItem, String, ComboBoxDataView<TItem>>,
9896
InputField<AbstractField.ComponentValueChangeEvent<TComponent, TValue>, TValue>,
9997
HasLazyDataView<TItem, String, ComboBoxLazyDataView<TItem>>,
10098
HasListDataView<TItem, ComboBoxListDataView<TItem>>, HasTheme,

vaadin-combo-box-flow-parent/vaadin-combo-box-flow/src/test/java/com/vaadin/flow/component/combobox/ComboBoxBaseTest.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import com.vaadin.flow.component.UI;
3131
import com.vaadin.flow.component.combobox.dataview.ComboBoxListDataView;
3232
import com.vaadin.flow.component.shared.HasAllowedCharPattern;
33-
import com.vaadin.flow.component.shared.HasOverlayClassName;
3433
import com.vaadin.flow.component.shared.HasTooltip;
3534
import com.vaadin.flow.data.provider.AbstractDataProvider;
3635
import com.vaadin.flow.data.provider.DataCommunicator;
@@ -81,13 +80,6 @@ public void implementsHasAllowedCharPattern() {
8180
createComboBox(String.class).getClass()));
8281
}
8382

84-
@Test
85-
public void implementsHasOverlayClassName() {
86-
Assert.assertTrue("ComboBox should support overlay class name",
87-
HasOverlayClassName.class.isAssignableFrom(
88-
createComboBox(String.class).getClass()));
89-
}
90-
9183
@Test
9284
public void implementsHasTooltip() {
9385
Assert.assertTrue("ComboBox should support setting a tooltip",

vaadin-context-menu-flow-parent/vaadin-context-menu-flow/src/main/java/com/vaadin/flow/component/contextmenu/ContextMenu.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import com.vaadin.flow.component.ClickEvent;
1919
import com.vaadin.flow.component.Component;
2020
import com.vaadin.flow.component.ComponentEventListener;
21-
import com.vaadin.flow.component.shared.HasOverlayClassName;
2221
import com.vaadin.flow.function.SerializableRunnable;
2322

2423
/**
@@ -49,7 +48,7 @@
4948
*/
5049
@SuppressWarnings("serial")
5150
public class ContextMenu extends ContextMenuBase<ContextMenu, MenuItem, SubMenu>
52-
implements HasMenuItems, HasOverlayClassName {
51+
implements HasMenuItems {
5352

5453
/**
5554
* Creates an empty context menu.

vaadin-context-menu-flow-parent/vaadin-context-menu-flow/src/test/java/com/vaadin/flow/component/contextmenu/ContextMenuTest.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import com.vaadin.flow.component.html.Div;
3131
import com.vaadin.flow.component.html.NativeButton;
3232
import com.vaadin.flow.component.html.Span;
33-
import com.vaadin.flow.component.shared.HasOverlayClassName;
3433

3534
/**
3635
* Unit tests for the ContextMenu.
@@ -216,13 +215,6 @@ public void serializeContextMenu() throws IOException {
216215
out.writeObject(menu);
217216
}
218217

219-
@Test
220-
public void implementsHasOverlayClassName() {
221-
Assert.assertTrue("ContextMenu should support overlay class name",
222-
HasOverlayClassName.class
223-
.isAssignableFrom(new ContextMenu().getClass()));
224-
}
225-
226218
private void addDivAtIndex(int index) {
227219
ContextMenu contextMenu = new ContextMenu();
228220

vaadin-date-picker-flow-parent/vaadin-date-picker-flow/src/main/java/com/vaadin/flow/component/datepicker/DatePicker.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
import com.vaadin.flow.component.shared.HasAllowedCharPattern;
4848
import com.vaadin.flow.component.shared.HasAutoOpen;
4949
import com.vaadin.flow.component.shared.HasClearButton;
50-
import com.vaadin.flow.component.shared.HasOverlayClassName;
5150
import com.vaadin.flow.component.shared.HasPrefix;
5251
import com.vaadin.flow.component.shared.HasThemeVariant;
5352
import com.vaadin.flow.component.shared.HasValidationProperties;
@@ -135,8 +134,8 @@ public class DatePicker
135134
implements Focusable<DatePicker>, HasAllowedCharPattern, HasAriaLabel,
136135
HasAutoOpen, HasClearButton,
137136
InputField<AbstractField.ComponentValueChangeEvent<DatePicker, LocalDate>, LocalDate>,
138-
HasOverlayClassName, HasPrefix, HasThemeVariant<DatePickerVariant>,
139-
HasValidationProperties, HasValidator<LocalDate>, HasPlaceholder {
137+
HasPrefix, HasThemeVariant<DatePickerVariant>, HasValidationProperties,
138+
HasValidator<LocalDate>, HasPlaceholder {
140139

141140
private DatePickerI18n i18n;
142141

vaadin-date-picker-flow-parent/vaadin-date-picker-flow/src/test/java/com/vaadin/flow/component/datepicker/DatePickerTest.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import com.vaadin.flow.component.UI;
3434
import com.vaadin.flow.component.datepicker.DatePicker.DatePickerI18n;
3535
import com.vaadin.flow.component.shared.HasAllowedCharPattern;
36-
import com.vaadin.flow.component.shared.HasOverlayClassName;
3736
import com.vaadin.flow.component.shared.HasTooltip;
3837
import com.vaadin.flow.component.shared.InputField;
3938
import com.vaadin.flow.data.binder.Result;
@@ -293,13 +292,6 @@ public void implementsHasAllowedCharPattern() {
293292
.isAssignableFrom(new DatePicker().getClass()));
294293
}
295294

296-
@Test
297-
public void implementsHasOverlayClassName() {
298-
Assert.assertTrue("DatePicker should support overlay class name",
299-
HasOverlayClassName.class
300-
.isAssignableFrom(new DatePicker().getClass()));
301-
}
302-
303295
@Test
304296
public void implementsHasTooltip() {
305297
DatePicker picker = new DatePicker();

vaadin-date-time-picker-flow-parent/vaadin-date-time-picker-flow/src/main/java/com/vaadin/flow/component/datetimepicker/DateTimePicker.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import com.vaadin.flow.component.dependency.JsModule;
3535
import com.vaadin.flow.component.dependency.NpmPackage;
3636
import com.vaadin.flow.component.shared.HasAutoOpen;
37-
import com.vaadin.flow.component.shared.HasOverlayClassName;
3837
import com.vaadin.flow.component.shared.HasThemeVariant;
3938
import com.vaadin.flow.component.shared.HasValidationProperties;
4039
import com.vaadin.flow.component.shared.InputField;
@@ -95,8 +94,8 @@ public class DateTimePicker
9594
extends AbstractSinglePropertyField<DateTimePicker, LocalDateTime>
9695
implements Focusable<DateTimePicker>, HasAutoOpen,
9796
InputField<AbstractField.ComponentValueChangeEvent<DateTimePicker, LocalDateTime>, LocalDateTime>,
98-
HasOverlayClassName, HasThemeVariant<DateTimePickerVariant>,
99-
HasValidationProperties, HasValidator<LocalDateTime> {
97+
HasThemeVariant<DateTimePickerVariant>, HasValidationProperties,
98+
HasValidator<LocalDateTime> {
10099

101100
private final DateTimePickerDatePicker datePicker = new DateTimePickerDatePicker();
102101
private final DateTimePickerTimePicker timePicker = new DateTimePickerTimePicker();

vaadin-date-time-picker-flow-parent/vaadin-date-time-picker-flow/src/test/java/com/vaadin/flow/component/datetimepicker/DateTimePickerTest.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import com.vaadin.flow.component.Component;
3434
import com.vaadin.flow.component.UI;
3535
import com.vaadin.flow.component.datepicker.DatePicker;
36-
import com.vaadin.flow.component.shared.HasOverlayClassName;
3736
import com.vaadin.flow.component.shared.HasTooltip;
3837
import com.vaadin.flow.component.shared.InputField;
3938
import com.vaadin.flow.di.Instantiator;
@@ -249,13 +248,6 @@ public void setTimeAriaLabel() {
249248
Assert.assertTrue(picker.getTimeAriaLabel().isEmpty());
250249
}
251250

252-
@Test
253-
public void implementsHasOverlayClassName() {
254-
Assert.assertTrue("DateTimePicker should support overlay class name",
255-
HasOverlayClassName.class
256-
.isAssignableFrom(new DateTimePicker().getClass()));
257-
}
258-
259251
@Test
260252
public void implementsHasTooltip() {
261253
DateTimePicker picker = new DateTimePicker();

0 commit comments

Comments
 (0)