Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions packages/main/cypress/specs/VerticalAlignment.cy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import CheckBox from "../../src/CheckBox.js";
import Switch from "../../src/Switch.js";
import Link from "../../src/Link.js";
import Label from "../../src/Label.js";
import Text from "../../src/Text.js";
import RatingIndicator from "../../src/RatingIndicator.js";
import StepInput from "../../src/StepInput.js";
import Button from "../../src/Button.js";
import ComboBox from "../../src/ComboBox.js";
import ComboBoxItem from "../../src/ComboBoxItem.js";
import SegmentedButtonItem from "../../src/SegmentedButtonItem.js";
import SegmentedButton from "../../src/SegmentedButton.js";
import Input from "../../src/Input.js";
import DatePicker from "../../src/DatePicker.js";
import RadioButton from "../../src/RadioButton.js";
import RangeSlider from "../../src/RangeSlider.js";
import Slider from "../../src/Slider.js";
import Select from "../../src/Select.js";
import Option from "../../src/Option.js";
import FileUploader from "../../src/FileUploader.js";

describe("Vertical Alignment", () => {
it("tests container height to detect and avoid vertical misalignment", () => {
cy.mount(
<>
<div id="container">
<Input value="value"></Input>
<DatePicker value="today"></DatePicker>
<SegmentedButton accessibleName="Geographic location">
<SegmentedButtonItem>Map</SegmentedButtonItem>
<SegmentedButtonItem selected>Satellite</SegmentedButtonItem>
</SegmentedButton>
<ComboBox value="Bulgaria">
<ComboBoxItem text="Algeria" id="cbi"></ComboBoxItem>
<ComboBoxItem text="Argentina"></ComboBoxItem>
<ComboBoxItem text="Bosnia and Herzegovina"></ComboBoxItem>
<ComboBoxItem text="Brazil"></ComboBoxItem>
<ComboBoxItem text="Bulgaria"></ComboBoxItem>
<ComboBoxItem text="Canada"></ComboBoxItem>
<ComboBoxItem text="Chile"></ComboBoxItem>
</ComboBox>
<Select>
<Option>Option 1</Option>
<Option>Option 2</Option>
<Option>Option 3</Option>
</Select>
</div>

<div id="container2">
<CheckBox text="Check" checked></CheckBox>
<Switch textOn="On" textOff="Off"></Switch>
<RadioButton text="option c" checked></RadioButton>
<Label>Lorem ipsum dolor sit</Label>
<Text>Some text here</Text>
<Button>Click Me</Button>
<Link href="https://ui5webcomponents.github.io" target="_blank">Link</Link>
<StepInput></StepInput>
<FileUploader></FileUploader>
</div>

<div id="container3">
<RatingIndicator></RatingIndicator>
</div>

<div id="container4">
<RangeSlider id="range_slider1" style={{ width: "200px" }}></RangeSlider>
<Slider id="slider1" style={{ width: "200px" }}></Slider>
</div>
</>
);

cy.get("#container").should("have.css", "height", "44px");
cy.get("#container2").should("have.css", "height", "44px");
cy.get("#container3").should("have.css", "height", "48px");
cy.get("#container4").should("have.css", "height", "53px");
});
});
1 change: 1 addition & 0 deletions packages/main/src/themes/CheckBox.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import "./InvisibleTextStyles.css";
@import "./TapHighlightColor.css";
@import "./FormComponents.css";

:host(:not([hidden])) {
display: inline-block;
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/themes/DatePicker.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import "./InvisibleTextStyles.css";
@import "./InputIcon.css";
@import "./InputSharedStyles.css";
@import "./FormComponents.css";

:host(:not([hidden])) {
display: inline-block;
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/themes/RadioButton.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "./InvisibleTextStyles.css";
@import "./FormComponents.css";

:host(:not([hidden])) {
display: inline-block;
Expand Down
2 changes: 2 additions & 0 deletions packages/main/src/themes/RatingIndicator.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import "./FormComponents.css";

:host(:not([hidden])) {
display: inline-block;
font-size: 24px;
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/themes/SliderBase.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "./InvisibleTextStyles.css";
@import "./FormComponents.css";

:host([disabled]) {
opacity: var(--_ui5_slider_disabled_opacity);
Expand All @@ -9,7 +10,6 @@
:host {
box-sizing: border-box;
cursor: pointer;
vertical-align: top;
width: 100%;
}

Expand Down
1 change: 0 additions & 1 deletion packages/main/src/themes/StepInput.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

:host(:not([hidden])) {
display: inline-block;
width: 100%;
line-height: normal;
letter-spacing: normal;
word-spacing: normal;
Expand Down
1 change: 1 addition & 0 deletions packages/main/src/themes/Switch.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import "./InvisibleTextStyles.css";
@import "./TapHighlightColor.css";
@import "./FormComponents.css";

:host(:not([hidden])) {
display: inline-block;
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/themes/Text.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}

:host(:not([max-lines="1"])) {
display: -webkit-box;
display: -webkit-inline-box;
-webkit-line-clamp: var(--_ui5_text_max_lines);
line-clamp: var(--_ui5_text_max_lines);
-webkit-box-orient: vertical;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

--_ui5_range_slider_handle_active_background: var(--sapSlider_Active_RangeHandleBackground);
--_ui5_range_slider_active_handle_icon_display: none;
--_ui5_range_slider_progress_focus_top: -15px;
--_ui5_range_slider_progress_focus_top: -1.063rem;
--_ui5_range_slider_progress_focus_left: calc(-1 * (var(--_ui5_slider_handle_width) / 2) - 5px);
--_ui5_range_slider_progress_focus_padding: 0 1rem 0 1rem;
--_ui5_range_slider_progress_focus_width: calc(100% + var(--_ui5_slider_handle_width) + 10px);
Expand All @@ -64,7 +64,7 @@
--_ui5_slider_handle_width: 1.5rem;
--_ui5_range_slider_progress_focus_width: calc(100% + var(--_ui5_slider_handle_width) + 10px);
--_ui5_range_slider_progress_focus_height: calc(var(--_ui5_slider_handle_height) + 10px);
--_ui5_range_slider_progress_focus_top: -.8125rem;
--_ui5_range_slider_progress_focus_top: -.938rem;
--_ui5_slider_tooltip_bottom: 1.75rem;
--_ui5_slider_handle_focused_tooltip_distance: calc(var(--_ui5_slider_tooltip_bottom) - var(--_ui5_slider_handle_focus_width));
--_ui5_range_slider_progress_focus_left: calc(-1 * (var(--_ui5_slider_handle_width) / 2) - 5px);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

--_ui5_range_slider_handle_active_background: var(--sapSlider_Active_RangeHandleBackground);
--_ui5_range_slider_active_handle_icon_display: none;
--_ui5_range_slider_progress_focus_top: -15px;
--_ui5_range_slider_progress_focus_top: -1.063rem;
--_ui5_range_slider_progress_focus_left: calc(-1 * (var(--_ui5_slider_handle_width) / 2) - 5px);
--_ui5_range_slider_progress_focus_padding: 0 1rem 0 1rem;
--_ui5_range_slider_progress_focus_width: calc(100% + var(--_ui5_slider_handle_width) + 10px);
Expand All @@ -64,7 +64,7 @@
--_ui5_slider_handle_width: 1.5rem;
--_ui5_range_slider_progress_focus_width: calc(100% + var(--_ui5_slider_handle_width) + 10px);
--_ui5_range_slider_progress_focus_height: calc(var(--_ui5_slider_handle_height) + 10px);
--_ui5_range_slider_progress_focus_top: -.8125rem;
--_ui5_range_slider_progress_focus_top: -.938rem;
--_ui5_slider_tooltip_bottom: 1.75rem;
--_ui5_slider_handle_focused_tooltip_distance: calc(var(--_ui5_slider_tooltip_bottom) - var(--_ui5_slider_handle_focus_width));
--_ui5_range_slider_progress_focus_left: calc(-1 * (var(--_ui5_slider_handle_width) / 2) - 5px);
Expand Down
Loading
Loading