Skip to content

Commit

Permalink
Merge branch 'main' into toolbar-namespace-refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
plamenivanov91 committed Nov 21, 2023
2 parents 3893e87 + 87535f1 commit bc03bd5
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 45 deletions.
2 changes: 1 addition & 1 deletion packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@buxlabs/amd-to-es6": "0.16.1",
"@openui5/sap.ui.core": "1.116.0",
"@ui5/webcomponents-tools": "1.20.0-rc.1",
"chromedriver": "118.0.1",
"chromedriver": "119.0.1",
"clean-css": "^5.2.2",
"copy-and-watch": "^0.1.5",
"cross-env": "^7.0.3",
Expand Down
8 changes: 5 additions & 3 deletions packages/base/src/ManagedStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,18 @@ const updateStyle = (data: StyleData, name: string, value = "", theme?: string)
}
};

const hasStyle = (name: string, value = "") => {
const hasStyle = (name: string, value = ""): boolean => {
if (shouldUseLinks()) {
return !!document.querySelector(`head>link[${name}="${value}"]`);
}

const styleElement = document.querySelector(`head>style[${name}="${value}"]`);

if (document.adoptedStyleSheets && !isSafari()) {
return !!document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));
return !!styleElement || !!document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));
}

return !!document.querySelector(`head>style[${name}="${value}"]`);
return !!styleElement;
};

const removeStyle = (name: string, value = "") => {
Expand Down
2 changes: 1 addition & 1 deletion packages/fiori/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@
},
"devDependencies": {
"@ui5/webcomponents-tools": "1.20.0-rc.1",
"chromedriver": "118.0.1"
"chromedriver": "119.0.1"
}
}
2 changes: 1 addition & 1 deletion packages/localization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"devDependencies": {
"@openui5/sap.ui.core": "1.116.0",
"@ui5/webcomponents-tools": "1.20.0-rc.1",
"chromedriver": "118.0.1",
"chromedriver": "119.0.1",
"mkdirp": "^1.0.4",
"resolve": "^1.20.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
},
"devDependencies": {
"@ui5/webcomponents-tools": "1.20.0-rc.1",
"chromedriver": "118.0.1"
"chromedriver": "119.0.1"
}
}
38 changes: 12 additions & 26 deletions packages/main/src/themes/Switch.css
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@

.ui5-switch-handle,
.ui5-switch-text {
left: var(--_ui5_switch_handle_left);
inset-inline-start: var(--_ui5_switch_handle_left);
top: 50%;
transform: translateY(-50%);
}
Expand All @@ -123,8 +123,8 @@
.ui5-switch-desktop.ui5-switch-root:focus::after {
content: "";
position: absolute;
left: var(--_ui5_switch_root_outline_left);
right: var(--_ui5_switch_root_outline_right);
inset-inline-start: var(--_ui5_switch_root_outline_left);
inset-inline-end: var(--_ui5_switch_root_outline_right);
top: var(--_ui5_switch_root_outline_top);
bottom: var(--_ui5_switch_root_outline_bottom);
border: var(--_ui5_switch_focus_outline);
Expand All @@ -137,11 +137,12 @@
/* switch hidden input */
.ui5-switch-root .ui5-switch-input {
position: absolute;
left: 0;
inset-inline-start: 0;
width: 0;
height: 0;
margin: 0;
visibility: hidden;
appearance: none;
-webkit-appearance: none;
}

Expand All @@ -160,12 +161,12 @@

.ui5-switch-root.ui5-switch--checked.ui5-switch--semantic .ui5-switch-text--on,
.ui5-switch-root.ui5-switch--checked.ui5-switch-desktop.ui5-switch--no-label .ui5-switch-text--on {
left: var(--_ui5_switch_text_active_left);
inset-inline-start: var(--_ui5_switch_text_active_left);
}
.ui5-switch-root:not(.ui5-switch--checked).ui5-switch--semantic .ui5-switch-text--off,
.ui5-switch-root:not(.ui5-switch--checked).ui5-switch-desktop.ui5-switch--no-label .ui5-switch-text--off {
left: var(--_ui5_switch_text_inactive_left);
right: var(--_ui5_switch_text_inactive_right);
inset-inline-start: var(--_ui5_switch_text_inactive_left);
inset-inline-end: var(--_ui5_switch_text_inactive_right);
}

/* handle */
Expand Down Expand Up @@ -337,14 +338,14 @@
color: var(--_ui5_switch_text_active_color);
overflow: var(--_ui5_switch_text_overflow);
text-overflow: ellipsis;
left: var(--_ui5_switch_text_active_left_alternate);
inset-inline-start: var(--_ui5_switch_text_active_left_alternate);
}
.ui5-switch-root .ui5-switch-text--off {
color: var(--_ui5_switch_text_inactive_color);
overflow: var(--_ui5_switch_text_overflow);
text-overflow: ellipsis;
left: var(--_ui5_switch_text_inactive_left_alternate);
right: var(--_ui5_switch_text_inactive_right_alternate);
inset-inline-start: var(--_ui5_switch_text_inactive_left_alternate);
inset-inline-end: var(--_ui5_switch_text_inactive_right_alternate);
}

.ui5-switch-root .ui5-switch-no-label-icon-on,
Expand All @@ -364,19 +365,4 @@

[dir="rtl"].ui5-switch-root.ui5-switch--checked .ui5-switch-slider {
transform: var(--_ui5_switch_rtl_transform);
}

[dir="rtl"].ui5-switch-root .ui5-switch-handle {
left: auto;
right: var(--_ui5_switch_handle_left);
}

[dir="rtl"].ui5-switch-root .ui5-switch-text--on {
right: var(--_ui5_switch_text_active_left);
left: var(--_ui5_switch_text_active_right);
}

[dir="rtl"].ui5-switch-root .ui5-switch-text--off {
right: var(--_ui5_switch_text_inactive_left);
left: var(--_ui5_switch_text_inactive_right);
}
}
26 changes: 26 additions & 0 deletions packages/main/src/themes/sap_horizon_hcb/Switch-parameters.css
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,30 @@

--_ui5_switch_icon_width: 1rem;
--_ui5_switch_icon_height: 1rem;
}

[data-ui5-compact-size],
.ui5-content-density-compact,
.sapUiSizeCompact {
--_ui5_switch_width: 3rem;
--_ui5_switch_min_width: none;
--_ui5_switch_with_label_width: 3.75rem;
--_ui5_switch_root_outline_top: 0.25rem;
--_ui5_switch_root_outline_bottom: 0.25rem;
--_ui5_switch_transform: translateX(100%) translateX(-1.375rem);
--_ui5_switch_transform_with_label: translateX(100%) translateX(-1.875rem);
--_ui5_switch_rtl_transform: translateX(1.375rem) translateX(-100%);
--_ui5_switch_rtl_transform_with_label: translateX(1.875rem) translateX(-100%);
--_ui5_switch_track_width: 2rem;
--_ui5_switch_track_height: 1.25rem;
--_ui5_switch_track_with_label_width: 2.75rem;
--_ui5_switch_track_with_label_height: 1.25rem;
--_ui5_switch_handle_width: 1.25rem;
--_ui5_switch_handle_height: 1rem;
--_ui5_switch_handle_with_label_width: 1.75rem;
--_ui5_switch_handle_with_label_height: 1rem;
--_ui5_switch_text_font_size: var(--sapFontSize);
--_ui5_switch_text_width: 1rem;
--_ui5_switch_text_active_left: 0.1875rem;
--_ui5_switch_text_active_left_alternate: 0.0625rem;
}
24 changes: 12 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3189,7 +3189,7 @@
dependencies:
defer-to-connect "^2.0.0"

"@testim/chrome-version@^1.1.3":
"@testim/chrome-version@^1.1.4":
version "1.1.4"
resolved "https://registry.yarnpkg.com/@testim/chrome-version/-/chrome-version-1.1.4.tgz#86e04e677cd6c05fa230dd15ac223fa72d1d7090"
integrity sha512-kIhULpw9TrGYnHp/8VfdcneIcxKnLixmADtukQRtJUmsVlMg0niMkwV0xZmi8hqa57xqilIHjWFA0GKvEjVU5g==
Expand Down Expand Up @@ -4593,7 +4593,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.2.3.tgz#2a3afc332f0031b42f602f4a3de03c211ca98f72"
integrity sha512-pXnVMfJKSIWU2Ml4JHP7pZEPIrgBO1Fd3WGx+fPBsS+KRGhE4vxooD8XBGWbQOIVSZsVK7pUDBBkCicNu80yzQ==

axios@^1.0.0, axios@^1.4.0:
axios@^1.0.0, axios@^1.6.0:
version "1.6.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.2.tgz#de67d42c755b571d3e698df1b6504cde9b0ee9f2"
integrity sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==
Expand Down Expand Up @@ -5242,18 +5242,18 @@ chrome-launcher@^0.15.0:
is-wsl "^2.2.0"
lighthouse-logger "^1.0.0"

chromedriver@118.0.1:
version "118.0.1"
resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-118.0.1.tgz#76bf821bb11dd85a45a7e3df7ee48e8d464677dd"
integrity sha512-GlGfyRE47IuSJnuadIiDy89EMDMQFBVWxUmiclLJKzQhFsiWAtcIr/mNOxjljZdsw9IwIOQEkrB9wympKYFPLw==
chromedriver@119.0.1:
version "119.0.1"
resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-119.0.1.tgz#064f3650790ccea055e9bfd95c600f5ea60295e9"
integrity sha512-lpCFFLaXPpvElTaUOWKdP74pFb/sJhWtWqMjn7Ju1YriWn8dT5JBk84BGXMPvZQs70WfCYWecxdMmwfIu1Mupg==
dependencies:
"@testim/chrome-version" "^1.1.3"
axios "^1.4.0"
compare-versions "^6.0.0"
"@testim/chrome-version" "^1.1.4"
axios "^1.6.0"
compare-versions "^6.1.0"
extract-zip "^2.0.1"
https-proxy-agent "^5.0.1"
proxy-from-env "^1.1.0"
tcp-port-used "^1.0.1"
tcp-port-used "^1.0.2"

ci-info@^2.0.0:
version "2.0.0"
Expand Down Expand Up @@ -5490,7 +5490,7 @@ compare-func@^2.0.0:
array-ify "^1.0.0"
dot-prop "^5.1.0"

compare-versions@^6.0.0:
compare-versions@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-6.1.0.tgz#3f2131e3ae93577df111dba133e6db876ffe127a"
integrity sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg==
Expand Down Expand Up @@ -13659,7 +13659,7 @@ tar@^6.1.11, tar@^6.1.13, tar@^6.1.2:
mkdirp "^1.0.3"
yallist "^4.0.0"

tcp-port-used@^1.0.1:
tcp-port-used@^1.0.1, tcp-port-used@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/tcp-port-used/-/tcp-port-used-1.0.2.tgz#9652b7436eb1f4cfae111c79b558a25769f6faea"
integrity sha512-l7ar8lLUD3XS1V2lfoJlCBaeoaWo/2xfYt81hM7VlvR4RrMVFqfmzfhLVk40hAb368uitje5gPtBRL1m/DGvLA==
Expand Down

0 comments on commit bc03bd5

Please sign in to comment.