@sapudex/web-components 2.44.0 → 2.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/specs/DatePicker.cy.tsx +259 -0
- package/cypress/specs/MastheadItem.cy.tsx +88 -0
- package/cypress/specs/MastheadShell.cy.tsx +3 -1
- package/cypress/specs/TagGroup.cy.tsx +104 -0
- package/cypress/specs/TextField.cy.tsx +64 -1
- package/cypress/support/component-imports.instrumented.ts +2 -0
- package/cypress/support/component-imports.src.ts +2 -0
- package/dist/Carousel.d.ts +5 -1
- package/dist/Carousel.js +10 -1
- package/dist/Carousel.js.map +1 -1
- package/dist/DatePicker.d.ts +4 -0
- package/dist/DatePicker.js +19 -13
- package/dist/DatePicker.js.map +1 -1
- package/dist/DatePickerPopoverTemplate.js +1 -1
- package/dist/DatePickerPopoverTemplate.js.map +1 -1
- package/dist/DatePickerTemplate.js +1 -1
- package/dist/DatePickerTemplate.js.map +1 -1
- package/dist/MastheadItem.d.ts +6 -3
- package/dist/MastheadItem.js +18 -0
- package/dist/MastheadItem.js.map +1 -1
- package/dist/MastheadMobileMenu.d.ts +1 -0
- package/dist/MastheadMobileMenu.js +5 -0
- package/dist/MastheadMobileMenu.js.map +1 -1
- package/dist/MastheadProfileMenu.d.ts +5 -4
- package/dist/MastheadProfileMenu.js +15 -12
- package/dist/MastheadProfileMenu.js.map +1 -1
- package/dist/MastheadShell.d.ts +2 -0
- package/dist/MastheadShell.js +9 -2
- package/dist/MastheadShell.js.map +1 -1
- package/dist/SelectBoxTemplate.js +1 -1
- package/dist/SelectBoxTemplate.js.map +1 -1
- package/dist/TagGroup.d.ts +5 -1
- package/dist/TagGroup.js +51 -7
- package/dist/TagGroup.js.map +1 -1
- package/dist/TagGroupTemplate.js +1 -1
- package/dist/TagGroupTemplate.js.map +1 -1
- package/dist/TextField.d.ts +7 -0
- package/dist/TextField.js +10 -0
- package/dist/TextField.js.map +1 -1
- package/dist/TextFieldTemplate.js +1 -1
- package/dist/TextFieldTemplate.js.map +1 -1
- package/dist/Tooltip.js +2 -1
- package/dist/Tooltip.js.map +1 -1
- package/dist/assets/{InputSuggestions-B3D8lxAS.js → InputSuggestions-BwpJ8Exf.js} +1 -1
- package/dist/assets/{ListItemStandardExpandableTextTemplate-Is8_hDTt.js → ListItemStandardExpandableTextTemplate-7iRPZq6L.js} +1 -1
- package/dist/assets/{bundle.esm-6rH7NAG7.js → bundle.esm-BbkM4Bz9.js} +247 -245
- package/dist/assets/messagebundle_pt-D9rap3lj.js +1 -0
- package/dist/assets/messagebundle_ro-BTNJ9YdP.js +1 -0
- package/dist/css/themes/CountrySelector.css +1 -1
- package/dist/css/themes/MastheadCountrySelector.css +1 -1
- package/dist/css/themes/MastheadItem.css +1 -1
- package/dist/css/themes/MastheadMenu.css +1 -1
- package/dist/css/themes/MastheadMobileMenu.css +1 -1
- package/dist/css/themes/MastheadProfileMenu.css +1 -1
- package/dist/css/themes/TagGroup.css +1 -1
- package/dist/custom-elements-internal.json +68 -17
- package/dist/custom-elements.json +75 -17
- package/dist/generated/assets/i18n/messagebundle_pt.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ro.json +1 -1
- package/dist/generated/templates/MastheadProfileMenuTemplate.lit.js +2 -2
- package/dist/generated/templates/MastheadProfileMenuTemplate.lit.js.map +1 -1
- package/dist/generated/templates/MastheadShellTemplate.lit.js +2 -2
- package/dist/generated/templates/MastheadShellTemplate.lit.js.map +1 -1
- package/dist/generated/themes/CountrySelector.css.d.ts +1 -1
- package/dist/generated/themes/CountrySelector.css.js +1 -1
- package/dist/generated/themes/CountrySelector.css.js.map +1 -1
- package/dist/generated/themes/MastheadCountrySelector.css.d.ts +1 -1
- package/dist/generated/themes/MastheadCountrySelector.css.js +1 -1
- package/dist/generated/themes/MastheadCountrySelector.css.js.map +1 -1
- package/dist/generated/themes/MastheadItem.css.d.ts +1 -1
- package/dist/generated/themes/MastheadItem.css.js +1 -1
- package/dist/generated/themes/MastheadItem.css.js.map +1 -1
- package/dist/generated/themes/MastheadMenu.css.d.ts +1 -1
- package/dist/generated/themes/MastheadMenu.css.js +1 -1
- package/dist/generated/themes/MastheadMenu.css.js.map +1 -1
- package/dist/generated/themes/MastheadMobileMenu.css.d.ts +1 -1
- package/dist/generated/themes/MastheadMobileMenu.css.js +1 -1
- package/dist/generated/themes/MastheadMobileMenu.css.js.map +1 -1
- package/dist/generated/themes/MastheadProfileMenu.css.d.ts +1 -1
- package/dist/generated/themes/MastheadProfileMenu.css.js +1 -1
- package/dist/generated/themes/MastheadProfileMenu.css.js.map +1 -1
- package/dist/generated/themes/TagGroup.css.d.ts +1 -1
- package/dist/generated/themes/TagGroup.css.js +1 -1
- package/dist/generated/themes/TagGroup.css.js.map +1 -1
- package/dist/messagebundle_pt.properties +126 -0
- package/dist/messagebundle_ro.properties +126 -0
- package/dist/vscode.html-custom-data.json +11 -6
- package/dist/web-types.json +37 -14
- package/package.json +8 -8
- package/src/Carousel.ts +14 -1
- package/src/DatePicker.ts +29 -11
- package/src/DatePickerPopoverTemplate.tsx +2 -1
- package/src/DatePickerTemplate.tsx +1 -0
- package/src/MastheadItem.ts +24 -3
- package/src/MastheadMobileMenu.ts +6 -0
- package/src/MastheadProfileMenu.hbs +25 -25
- package/src/MastheadProfileMenu.ts +20 -16
- package/src/MastheadShell.hbs +3 -2
- package/src/MastheadShell.ts +11 -2
- package/src/SelectBoxTemplate.tsx +1 -1
- package/src/TagGroup.ts +59 -6
- package/src/TagGroupTemplate.tsx +1 -0
- package/src/TextField.ts +9 -0
- package/src/TextFieldTemplate.tsx +1 -0
- package/src/Tooltip.ts +2 -1
- package/src/generated/templates/MastheadProfileMenuTemplate.lit.ts +2 -2
- package/src/generated/templates/MastheadShellTemplate.lit.ts +2 -2
- package/src/generated/themes/CountrySelector.css.ts +1 -1
- package/src/generated/themes/MastheadCountrySelector.css.ts +1 -1
- package/src/generated/themes/MastheadItem.css.ts +1 -1
- package/src/generated/themes/MastheadMenu.css.ts +1 -1
- package/src/generated/themes/MastheadMobileMenu.css.ts +1 -1
- package/src/generated/themes/MastheadProfileMenu.css.ts +1 -1
- package/src/generated/themes/TagGroup.css.ts +1 -1
- package/src/i18n/messagebundle_pt.properties +126 -0
- package/src/i18n/messagebundle_ro.properties +126 -0
- package/src/themes/CountrySelector.css +5 -1
- package/src/themes/MastheadCountrySelector.css +29 -33
- package/src/themes/MastheadItem.css +53 -13
- package/src/themes/MastheadMenu.css +1 -11
- package/src/themes/MastheadMobileMenu.css +0 -12
- package/src/themes/MastheadProfileMenu.css +22 -16
- package/src/themes/TagGroup.css +1 -2
- package/dist/assets/messagebundle_pt-DPeE7NbC.js +0 -1
- package/dist/assets/messagebundle_ro-CN4kAAYE.js +0 -1
package/src/MastheadItem.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
2
|
-
import type { DefaultSlot } from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
2
|
+
import type { DefaultSlot, ChangeInfo } from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
3
3
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
4
4
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
5
5
|
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
|
@@ -15,16 +15,17 @@ import {
|
|
|
15
15
|
OPENS_IN_A_NEW_WINDOW, PROFILE, CART, COUNTRY_SELECTOR, SUPPORT, SEARCH,
|
|
16
16
|
} from "./generated/i18n/i18n-defaults.js";
|
|
17
17
|
import UDExMastheadMenu from "./MastheadMenu.js";
|
|
18
|
-
import type UDExAvatar from "./Avatar.js";
|
|
19
18
|
import "@ui5/webcomponents-icons/dist/slim-arrow-down.js";
|
|
20
19
|
import "@ui5/webcomponents-icons/dist/world.js";
|
|
20
|
+
import type UDExAvatar from "./Avatar.js";
|
|
21
21
|
import type UDExMastheadShell from "./MastheadShell.js";
|
|
22
|
+
import type UDExMastheadProfileMenu from "./MastheadProfileMenu.js";
|
|
23
|
+
import type UDExMastheadMobileMenu from "./MastheadMobileMenu.js";
|
|
22
24
|
import MastheadItemTemplate from "./generated/templates/MastheadItemTemplate.lit.js";
|
|
23
25
|
import { UDExTarget } from "./types/common.js";
|
|
24
26
|
import { BreakpointUtils } from "./utils/Breakpoints.js";
|
|
25
27
|
import parseArrayFromString from "./utils/parseArrayFromString.js";
|
|
26
28
|
import AnalyticsName from "./types/AnalyticsName.js";
|
|
27
|
-
import type UDExMastheadProfileMenu from "./MastheadProfileMenu.js";
|
|
28
29
|
import translate from "./utils/translate.js";
|
|
29
30
|
|
|
30
31
|
// Styles
|
|
@@ -363,6 +364,12 @@ class UDExMastheadItem extends UI5Element implements IMastheadItem {
|
|
|
363
364
|
this.handleOutsideClick();
|
|
364
365
|
}
|
|
365
366
|
|
|
367
|
+
onInvalidation({ name, newValue }: ChangeInfo): void {
|
|
368
|
+
if (name === "selected" && !newValue && this.isMobile) {
|
|
369
|
+
this.dropdownScrollToTop();
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
366
373
|
handleOutsideClick(): void {
|
|
367
374
|
document.addEventListener("click", (e: Event) => {
|
|
368
375
|
const target = e.target as HTMLElement;
|
|
@@ -496,6 +503,16 @@ class UDExMastheadItem extends UI5Element implements IMastheadItem {
|
|
|
496
503
|
});
|
|
497
504
|
}
|
|
498
505
|
|
|
506
|
+
dropdownScrollToTop(): void {
|
|
507
|
+
if (this.isMobileMenuOpenBtn) {
|
|
508
|
+
const menu = this.getSlottedNodes<UDExMastheadMobileMenu>("dropdown")[0];
|
|
509
|
+
menu.mobileMenuScrollToTop();
|
|
510
|
+
} else {
|
|
511
|
+
const dropdown = this.getDomElement(".udex-masthead-item__dropdown-holder");
|
|
512
|
+
dropdown?.scrollTo({ top: 0 });
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
499
516
|
setDropdownInsetStart(): void {
|
|
500
517
|
const dropdown = this.dropdownHolder;
|
|
501
518
|
if (dropdown) {
|
|
@@ -648,6 +665,10 @@ class UDExMastheadItem extends UI5Element implements IMastheadItem {
|
|
|
648
665
|
return this.hasDropdownSlot && this.selected;
|
|
649
666
|
}
|
|
650
667
|
|
|
668
|
+
get isMobileMenuOpenBtn(): boolean {
|
|
669
|
+
return this.hasAttribute("_is-menu-open-btn");
|
|
670
|
+
}
|
|
671
|
+
|
|
651
672
|
get hasDropdownSlot(): boolean {
|
|
652
673
|
return !!this.getSlottedNodes("dropdown").length;
|
|
653
674
|
}
|
|
@@ -377,6 +377,12 @@ class UDExMastheadMobileMenu extends UI5Element {
|
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
379
|
|
|
380
|
+
mobileMenuScrollToTop(): void {
|
|
381
|
+
this.shadowRoot
|
|
382
|
+
?.querySelector<HTMLElement>(".udex-masthead-mobile-menu__nav-holder")
|
|
383
|
+
?.scrollTo({ top: 0 });
|
|
384
|
+
}
|
|
385
|
+
|
|
380
386
|
setFocusItemByIndex(index: number) {
|
|
381
387
|
this._shouldFocusItemByIndex = true;
|
|
382
388
|
this._focusedItemIndex = index;
|
|
@@ -9,33 +9,33 @@
|
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
11
|
{{#*inline "account-profile"}}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
12
|
+
{{#if hasUserData}}
|
|
13
|
+
<div class="udex-masthead-profile-menu__header">
|
|
14
|
+
<udex-avatar
|
|
15
|
+
aria-hidden="true"
|
|
16
|
+
size="L"
|
|
17
|
+
initials="{{userData.avatarInitials}}"
|
|
18
|
+
fallback-icon="{{userData.fallbackIcon}}">
|
|
19
|
+
{{#if userData.avatarUrl}}
|
|
20
|
+
<img src="{{userData.avatarUrl}}" alt="avatar"/>
|
|
21
|
+
{{/if}}
|
|
22
|
+
</udex-avatar>
|
|
23
|
+
<div>
|
|
24
|
+
<p class="udex-profile-menu__account-name">{{userData.name}}</p>
|
|
25
|
+
<p class="udex-profile-menu__account-email">{{userData.email}}</p>
|
|
26
|
+
{{#if hasIdentities}}
|
|
27
|
+
<udex-button
|
|
28
|
+
@click="{{handleSwitcherClick}}"
|
|
29
|
+
class="udex-masthead-profile-menu__btn-switcher"
|
|
30
|
+
size="Large"
|
|
31
|
+
end-icon="slim-arrow-right"
|
|
32
|
+
design="Invisible">
|
|
33
|
+
{{switcherAccountText}}
|
|
34
|
+
</udex-button>
|
|
35
|
+
{{/if}}
|
|
36
|
+
</div>
|
|
36
37
|
</div>
|
|
37
38
|
{{/if}}
|
|
38
|
-
</div>
|
|
39
39
|
{{#if messageAvailable}}
|
|
40
40
|
<div class="udex-masthead-profile-menu__message">
|
|
41
41
|
<slot name="message"></slot>
|
|
@@ -425,26 +425,10 @@ class UDExMastheadProfileMenu extends UI5Element {
|
|
|
425
425
|
}
|
|
426
426
|
}
|
|
427
427
|
|
|
428
|
-
get scrollBottomIdentitiesList(): number {
|
|
429
|
-
return this.calculateScrollBottom(this.identitiesHTMLElement);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
get scrollBottomProfileMenu(): number {
|
|
433
|
-
return this.calculateScrollBottom(this.profileMenuHTMLElement);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
428
|
calculateScrollBottom(element: HTMLElement): number {
|
|
437
429
|
return element.scrollHeight - element.scrollTop - element.clientHeight;
|
|
438
430
|
}
|
|
439
431
|
|
|
440
|
-
get profileMenuHTMLElement(): HTMLElement {
|
|
441
|
-
return this.getElementByClassName(this._profileMenuLinksClassName);
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
get identitiesHTMLElement(): HTMLElement {
|
|
445
|
-
return this.getElementByClassName(this._identitiesListClassName);
|
|
446
|
-
}
|
|
447
|
-
|
|
448
432
|
getElementByClassName(className: string): HTMLElement {
|
|
449
433
|
return this.shadowRoot?.querySelector<HTMLElement>(`.${className}`) as HTMLElement;
|
|
450
434
|
}
|
|
@@ -464,6 +448,22 @@ class UDExMastheadProfileMenu extends UI5Element {
|
|
|
464
448
|
}
|
|
465
449
|
}
|
|
466
450
|
|
|
451
|
+
get scrollBottomIdentitiesList(): number {
|
|
452
|
+
return this.calculateScrollBottom(this.identitiesHTMLElement);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
get scrollBottomProfileMenu(): number {
|
|
456
|
+
return this.calculateScrollBottom(this.profileMenuHTMLElement);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
get profileMenuHTMLElement(): HTMLElement {
|
|
460
|
+
return this.getElementByClassName(this._profileMenuLinksClassName);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
get identitiesHTMLElement(): HTMLElement {
|
|
464
|
+
return this.getElementByClassName(this._identitiesListClassName);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
467
|
get linksList(): string {
|
|
468
468
|
return this.links ? JSON.stringify([{
|
|
469
469
|
subMenuLinkItems: JSON.parse(this.links),
|
|
@@ -478,6 +478,10 @@ class UDExMastheadProfileMenu extends UI5Element {
|
|
|
478
478
|
return parseArrayFromString(this.loggedInUser) as UserData;
|
|
479
479
|
}
|
|
480
480
|
|
|
481
|
+
get hasUserData(): boolean {
|
|
482
|
+
return typeof this.userData === "object" && this.userData !== null && !Array.isArray(this.userData);
|
|
483
|
+
}
|
|
484
|
+
|
|
481
485
|
get identitiesList(): Array<ExtendedUserIdentity> {
|
|
482
486
|
return parseArrayFromString<ExtendedUserIdentity>(this.identities).map((identity: UserIdentity) => ({
|
|
483
487
|
...identity,
|
package/src/MastheadShell.hbs
CHANGED
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
<div
|
|
101
101
|
class="udex-masthead-shell__profile udex-masthead-shell__item_icon"
|
|
102
102
|
@ui5-item-click="{{setSelectedItem}}"
|
|
103
|
-
@click="{{handleProfileClick}}">
|
|
103
|
+
@click-default="{{handleProfileClick}}">
|
|
104
104
|
<slot name="profile"></slot>
|
|
105
105
|
</div>
|
|
106
106
|
{{/if}}
|
|
@@ -119,7 +119,8 @@
|
|
|
119
119
|
accessible-role="button"
|
|
120
120
|
icon="menu2"
|
|
121
121
|
part="menu-open-btn"
|
|
122
|
-
accessible-name="menu"
|
|
122
|
+
accessible-name="menu"
|
|
123
|
+
_is-menu-open-btn>
|
|
123
124
|
<slot slot="dropdown" name="mobileMenu"></slot>
|
|
124
125
|
</udex-masthead-item>
|
|
125
126
|
<udex-masthead-item
|
package/src/MastheadShell.ts
CHANGED
|
@@ -546,6 +546,7 @@ class UDExMastheadShell extends UI5Element {
|
|
|
546
546
|
_desktopSearch!: UDExSearch | null | undefined;
|
|
547
547
|
_mobileMenu!: UDExMastheadMobileMenu | null | undefined;
|
|
548
548
|
_handleResizeBound: ResizeObserverCallback;
|
|
549
|
+
_handleWindowResizeBound: () => void;
|
|
549
550
|
_rootHolder!: HTMLElement | null | undefined;
|
|
550
551
|
_shouldHandleResize!: boolean;
|
|
551
552
|
_isVisible!: boolean;
|
|
@@ -553,6 +554,7 @@ class UDExMastheadShell extends UI5Element {
|
|
|
553
554
|
constructor() {
|
|
554
555
|
super();
|
|
555
556
|
this._handleResizeBound = this._handleResize.bind(this);
|
|
557
|
+
this._handleWindowResizeBound = this._handleWindowResize.bind(this);
|
|
556
558
|
}
|
|
557
559
|
|
|
558
560
|
onBeforeRendering() {
|
|
@@ -582,6 +584,7 @@ class UDExMastheadShell extends UI5Element {
|
|
|
582
584
|
|
|
583
585
|
onEnterDOM(): void {
|
|
584
586
|
ResizeHandler.register(this, this._handleResizeBound);
|
|
587
|
+
window.addEventListener("resize", this._handleWindowResizeBound);
|
|
585
588
|
if (isDesktop()) {
|
|
586
589
|
this.setAttribute("desktop", "");
|
|
587
590
|
}
|
|
@@ -589,6 +592,13 @@ class UDExMastheadShell extends UI5Element {
|
|
|
589
592
|
|
|
590
593
|
onExitDOM(): void {
|
|
591
594
|
ResizeHandler.deregister(this, this._handleResizeBound);
|
|
595
|
+
window.removeEventListener("resize", this._handleWindowResizeBound);
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
_handleWindowResize(): void {
|
|
599
|
+
if (this.isMobileMenuMode) {
|
|
600
|
+
this.setMobileMenuHeight();
|
|
601
|
+
}
|
|
592
602
|
}
|
|
593
603
|
|
|
594
604
|
onInvalidation({ name }: ChangeInfo): void {
|
|
@@ -996,9 +1006,8 @@ class UDExMastheadShell extends UI5Element {
|
|
|
996
1006
|
}
|
|
997
1007
|
|
|
998
1008
|
(this.mobileBtn as UDExMastheadItem).selected = false;
|
|
1009
|
+
this.mobileMenuReset();
|
|
999
1010
|
this._isMobileMenuOpen = false;
|
|
1000
|
-
this._mobileMenu?.showFirstLevelMenu();
|
|
1001
|
-
this._mobileMenu?.resetSearch();
|
|
1002
1011
|
|
|
1003
1012
|
if (this.bodyOverflow) {
|
|
1004
1013
|
this.removeOverflowBody();
|
|
@@ -24,7 +24,7 @@ export default function SelectBoxTemplate(this: UDExSelectBox) {
|
|
|
24
24
|
{this.label && (
|
|
25
25
|
<>
|
|
26
26
|
<label for="search-input" class={this.labelClass}>
|
|
27
|
-
{this.label}{this.required && "*"}
|
|
27
|
+
{this.label}{this.required && " * "}
|
|
28
28
|
</label>
|
|
29
29
|
<span class="hidden" id={`${this._id}-aria-describedby`}>{this.ariaDescribedbyText}</span>
|
|
30
30
|
</>
|
package/src/TagGroup.ts
CHANGED
|
@@ -3,7 +3,10 @@ import type { DefaultSlot } from "@ui5/webcomponents-base/dist/UI5Element.js";
|
|
|
3
3
|
import Tokenizer from "@ui5/webcomponents/dist/Tokenizer.js";
|
|
4
4
|
import ResizeHandler from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js";
|
|
5
5
|
import customElement from "@ui5/webcomponents-base/dist/decorators/customElement.js";
|
|
6
|
-
import
|
|
6
|
+
import getActiveElement from "@ui5/webcomponents-base/dist/util/getActiveElement.js";
|
|
7
|
+
import {
|
|
8
|
+
isEnter, isSpace, isEscape, isTabNext, isTabPrevious,
|
|
9
|
+
} from "@ui5/webcomponents-base/dist/Keys.js";
|
|
7
10
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
8
11
|
import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
|
9
12
|
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
|
@@ -183,28 +186,37 @@ class UDExTagGroup extends UI5Element {
|
|
|
183
186
|
_tokenizer!: Tokenizer;
|
|
184
187
|
_nMoreBtn!: HTMLElement | null;
|
|
185
188
|
_resizeHandler: () => void;
|
|
189
|
+
_keydownCaptureHandler: (e: KeyboardEvent) => void;
|
|
186
190
|
|
|
187
191
|
constructor() {
|
|
188
192
|
super();
|
|
189
193
|
this._resizeHandler = this._onResize.bind(this);
|
|
194
|
+
this._keydownCaptureHandler = this._onKeydownCapture.bind(this);
|
|
190
195
|
}
|
|
191
196
|
|
|
192
197
|
onEnterDOM(): void {
|
|
193
198
|
ResizeHandler.register(this, this._resizeHandler);
|
|
199
|
+
this.addEventListener("keydown", this._keydownCaptureHandler, true);
|
|
194
200
|
}
|
|
195
201
|
|
|
196
202
|
onExitDOM(): void {
|
|
197
203
|
ResizeHandler.deregister(this, this._resizeHandler);
|
|
198
|
-
this.
|
|
204
|
+
this.removeEventListener("keydown", this._keydownCaptureHandler, true);
|
|
205
|
+
this._nMoreBtn?.removeEventListener("keydown", this._nMoreKeyDownHandler);
|
|
199
206
|
}
|
|
200
207
|
|
|
201
208
|
onAfterRendering(): void {
|
|
202
209
|
this._tokenizer = this.tokenizer;
|
|
210
|
+
const prevMoreBtn = this._nMoreBtn;
|
|
203
211
|
this._nMoreBtn = this._tokenizer.moreLink || null;
|
|
204
212
|
|
|
205
|
-
if (
|
|
213
|
+
if (prevMoreBtn && prevMoreBtn !== this._nMoreBtn) {
|
|
214
|
+
prevMoreBtn.removeEventListener("keydown", this._nMoreKeyDownHandler);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (!this.disabled && this._nMoreBtn && this._nMoreBtn !== prevMoreBtn) {
|
|
206
218
|
this._nMoreBtn.setAttribute("tabindex", "0");
|
|
207
|
-
this._nMoreBtn.addEventListener("keydown", this._nMoreKeyDownHandler
|
|
219
|
+
this._nMoreBtn.addEventListener("keydown", this._nMoreKeyDownHandler);
|
|
208
220
|
}
|
|
209
221
|
|
|
210
222
|
if (!this.displayonly && this._skipMoreButtonFocus && this._nMoreBtn) {
|
|
@@ -218,10 +230,42 @@ class UDExTagGroup extends UI5Element {
|
|
|
218
230
|
}
|
|
219
231
|
}
|
|
220
232
|
|
|
221
|
-
_nMoreKeyDownHandler(e:
|
|
222
|
-
if (isSpace(e
|
|
233
|
+
_nMoreKeyDownHandler = (e: KeyboardEvent) => {
|
|
234
|
+
if (isSpace(e) || isEnter(e)) {
|
|
223
235
|
this.showMoreItems();
|
|
224
236
|
}
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
_onKeydownCapture(e: KeyboardEvent): void {
|
|
240
|
+
if (!this._isHiddenTags) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (isTabNext(e) && e.composedPath().includes(this._lastVisibleTag as EventTarget)) {
|
|
245
|
+
e.preventDefault();
|
|
246
|
+
this._nMoreBtn?.focus();
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (isTabPrevious(e) && !this.isReadOrDisplayOnly) {
|
|
251
|
+
const active = getActiveElement();
|
|
252
|
+
const moreLink = this._tokenizer.moreLink;
|
|
253
|
+
if (active === moreLink) {
|
|
254
|
+
e.preventDefault();
|
|
255
|
+
const focusDomRef = this._lastVisibleTag?.getFocusDomRef();
|
|
256
|
+
focusDomRef?.focus();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
handleTagFocusin(e: FocusEvent): void {
|
|
262
|
+
// Only block the Tokenizer's _onfocusin (which sets expanded=true and destroys
|
|
263
|
+
// the "n more" span) when there are actually hidden tags. When all tags are
|
|
264
|
+
// visible, let focusin propagate normally so consumers like SelectBox can use
|
|
265
|
+
// the expanded state for arrow-key navigation between tags.
|
|
266
|
+
if (this._isHiddenTags) {
|
|
267
|
+
e.stopPropagation();
|
|
268
|
+
}
|
|
225
269
|
}
|
|
226
270
|
|
|
227
271
|
_onResize(): void {
|
|
@@ -270,6 +314,15 @@ class UDExTagGroup extends UI5Element {
|
|
|
270
314
|
return this._tokenizer?.overflownTokens || [];
|
|
271
315
|
}
|
|
272
316
|
|
|
317
|
+
get _lastVisibleTag(): UDExTag | null {
|
|
318
|
+
const tokens = this._tokenizer?._tokens;
|
|
319
|
+
if (!tokens?.length) {
|
|
320
|
+
return null;
|
|
321
|
+
}
|
|
322
|
+
const visibleCount = tokens.length - (this._tokenizer._nMoreCount ?? 0);
|
|
323
|
+
return (tokens[visibleCount - 1] as unknown as UDExTag) ?? null;
|
|
324
|
+
}
|
|
325
|
+
|
|
273
326
|
get isReadOrDisplayOnly(): boolean {
|
|
274
327
|
return this.readonly || this.displayonly;
|
|
275
328
|
}
|
package/src/TagGroupTemplate.tsx
CHANGED
|
@@ -66,6 +66,7 @@ function tag(this: UDExTagGroup, rootClass: string, item: any, index: number) {
|
|
|
66
66
|
accessible-name={item.accessibleName}
|
|
67
67
|
non-selectable={item.nonSelectable}
|
|
68
68
|
data-overflows={item.overflows}
|
|
69
|
+
onFocusIn={this.handleTagFocusin}
|
|
69
70
|
onKeyDown={this.handleTagKeyDown}
|
|
70
71
|
onSelectionChange={this.handleTagClick}
|
|
71
72
|
onIconClick={this.tagIconClickHandler}
|
package/src/TextField.ts
CHANGED
|
@@ -264,6 +264,15 @@ class UDExTextField extends UI5Element {
|
|
|
264
264
|
@property({ type: Boolean })
|
|
265
265
|
iconActive!: boolean;
|
|
266
266
|
|
|
267
|
+
/**
|
|
268
|
+
* Defines the placeholder text of the input field.
|
|
269
|
+
*
|
|
270
|
+
* @default ""
|
|
271
|
+
* @public
|
|
272
|
+
*/
|
|
273
|
+
@property({ type: String })
|
|
274
|
+
placeholder: string = "";
|
|
275
|
+
|
|
267
276
|
/**
|
|
268
277
|
* Defines the behaviour of autocomplete.
|
|
269
278
|
* @default "off"
|
|
@@ -25,6 +25,7 @@ export default function TextFieldTemplate(this: TextField) {
|
|
|
25
25
|
required={this.required}
|
|
26
26
|
aria-required={this.required}
|
|
27
27
|
aria-readonly={this.isInputReadonly}
|
|
28
|
+
placeholder={this.active || !this.label ? this.placeholder : undefined}
|
|
28
29
|
autocomplete={this.autocomplete}
|
|
29
30
|
role={this.inputRole as AriaRole}
|
|
30
31
|
name={this.name}
|
package/src/Tooltip.ts
CHANGED
|
@@ -4,6 +4,7 @@ import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
|
|
|
4
4
|
import property from "@ui5/webcomponents-base/dist/decorators/property.js";
|
|
5
5
|
import event from "@ui5/webcomponents-base/dist/decorators/event-strict.js";
|
|
6
6
|
import jsxRenderer from "@ui5/webcomponents-base/renderer/JsxRenderer.js";
|
|
7
|
+
import DOMReferenceConverter from "@ui5/webcomponents-base/dist/converters/DOMReference.js";
|
|
7
8
|
import PopupAccessibleRole from "@ui5/webcomponents/dist/types/PopupAccessibleRole.js";
|
|
8
9
|
import type { PopupBeforeCloseEventDetail } from "@ui5/webcomponents/dist/Popup.js";
|
|
9
10
|
import { HorizontalAlign, Placement, VerticalAlign } from "./types/Dropdown.js";
|
|
@@ -131,7 +132,7 @@ class UDExTooltip extends UI5Element {
|
|
|
131
132
|
* @default undefined
|
|
132
133
|
* @public
|
|
133
134
|
*/
|
|
134
|
-
@property()
|
|
135
|
+
@property({ converter: DOMReferenceConverter })
|
|
135
136
|
opener!: HTMLElement | string;
|
|
136
137
|
|
|
137
138
|
/**
|
|
@@ -9,8 +9,8 @@ function block0 (this: MastheadProfileMenu, context: UI5Element, tags: string[],
|
|
|
9
9
|
function block1 (this: MastheadProfileMenu, context: UI5Element, tags: string[], suffix: string | undefined) { return suffix ? html`<div class="udex-masthead-profile-menu__header-wrap back-btn"><${scopeTag("udex-masthead-menu-item", tags, suffix)} class="udex-masthead-profile-menu__btn-back" @click="${this.handleSwitcherClick}" label="${ifDefined(this.btnBackText)}" type="Button" icon-start></${scopeTag("udex-masthead-menu-item", tags, suffix)}><span class="udex-masthead-profile-menu__switcher-title">${ifDefined(this.switcherAccountText)}</span></div><span class="udex-masthead-profile-menu__identities-list-title">${ifDefined(this.listTitleText)}</span><div class="udex-masthead-profile-menu__identities-list-wrap">${ this.identitiesList.length ? block2.call(this, context, tags, suffix) : undefined }</div><${scopeTag("udex-button", tags, suffix)} @click="${this.fireEventAddOrRemoveAccountClick}" class="udex-masthead-profile-menu__add-remove-btn" design="Primary" end-icon="action" size="Large">${ifDefined(this.addOrRemoveAccountText)}</${scopeTag("udex-button", tags, suffix)}>` : html`<div class="udex-masthead-profile-menu__header-wrap back-btn"><udex-masthead-menu-item class="udex-masthead-profile-menu__btn-back" @click="${this.handleSwitcherClick}" label="${ifDefined(this.btnBackText)}" type="Button" icon-start></udex-masthead-menu-item><span class="udex-masthead-profile-menu__switcher-title">${ifDefined(this.switcherAccountText)}</span></div><span class="udex-masthead-profile-menu__identities-list-title">${ifDefined(this.listTitleText)}</span><div class="udex-masthead-profile-menu__identities-list-wrap">${ this.identitiesList.length ? block2.call(this, context, tags, suffix) : undefined }</div><udex-button @click="${this.fireEventAddOrRemoveAccountClick}" class="udex-masthead-profile-menu__add-remove-btn" design="Primary" end-icon="action" size="Large">${ifDefined(this.addOrRemoveAccountText)}</udex-button>`;}
|
|
10
10
|
function block2 (this: MastheadProfileMenu, context: UI5Element, tags: string[], suffix: string | undefined) { return suffix ? html`<${scopeTag("udex-list", tags, suffix)} class="udex-masthead-profile-menu__identities-list" mode="SingleSelect" accessible-name="${ifDefined(this.listTitleText)}" @scroll="${this.handleIdentitiesListShadowVisible}" _scroll-into-view="Center" controlled>${ repeat(this.identitiesList, (item, index) => (item as typeof item & {_id?: any})._id || index, (item, index: number) => block3.call(this, context, tags, suffix, item, index)) }</${scopeTag("udex-list", tags, suffix)}>` : html`<udex-list class="udex-masthead-profile-menu__identities-list" mode="SingleSelect" accessible-name="${ifDefined(this.listTitleText)}" @scroll="${this.handleIdentitiesListShadowVisible}" _scroll-into-view="Center" controlled>${ repeat(this.identitiesList, (item, index) => (item as typeof item & {_id?: any})._id || index, (item, index: number) => block3.call(this, context, tags, suffix, item, index)) }</udex-list>`;}
|
|
11
11
|
function block3 (this: MastheadProfileMenu, context: UI5Element, tags: string[], suffix: string | undefined, item: any, index: number) { return suffix ? html`<${scopeTag("udex-list-item", tags, suffix)} id="${ifDefined(item.idsUser)}" class="udex-masthead-profile-menu__identities-list-item" @ui5-item-press="${ifDefined(this.fireEventIdentityItemClick)}" supporting-text="${ifDefined(item.supportingText)}" image-badge-state="${ifDefined(item.statusBadge)}" image="${ifDefined(item.avatarUrl)}" image-alt="${ifDefined(item.name)}">${ifDefined(item.email)}</${scopeTag("udex-list-item", tags, suffix)}>` : html`<udex-list-item id="${ifDefined(item.idsUser)}" class="udex-masthead-profile-menu__identities-list-item" @ui5-item-press="${ifDefined(this.fireEventIdentityItemClick)}" supporting-text="${ifDefined(item.supportingText)}" image-badge-state="${ifDefined(item.statusBadge)}" image="${ifDefined(item.avatarUrl)}" image-alt="${ifDefined(item.name)}">${ifDefined(item.email)}</udex-list-item>`;}
|
|
12
|
-
function block4 (this: MastheadProfileMenu, context: UI5Element, tags: string[], suffix: string | undefined) { return suffix ? html
|
|
13
|
-
function block5 (this: MastheadProfileMenu, context: UI5Element, tags: string[], suffix: string | undefined) { return suffix ? html
|
|
12
|
+
function block4 (this: MastheadProfileMenu, context: UI5Element, tags: string[], suffix: string | undefined) { return suffix ? html`${ this.hasUserData ? block5.call(this, context, tags, suffix) : undefined }${ this.messageAvailable ? block8.call(this, context, tags, suffix) : undefined }<div class="udex-masthead-profile-menu__content"><div class="udex-masthead-profile-menu__links" @scroll="${this.handleProfileMenuShadowVisible}"><${scopeTag("udex-masthead-menu", tags, suffix)} exportparts="badge, menu-item" part="menu" sub-items='${ifDefined(this.linksList)}' @ui5-menu-item-click="${ifDefined(this.handleProfileMenuItemClick)}" _scroll-into-view="Center"></${scopeTag("udex-masthead-menu", tags, suffix)}></div></div>${ this.hasActionButton ? block9.call(this, context, tags, suffix) : undefined }` : html`${ this.hasUserData ? block5.call(this, context, tags, suffix) : undefined }${ this.messageAvailable ? block8.call(this, context, tags, suffix) : undefined }<div class="udex-masthead-profile-menu__content"><div class="udex-masthead-profile-menu__links" @scroll="${this.handleProfileMenuShadowVisible}"><udex-masthead-menu exportparts="badge, menu-item" part="menu" sub-items='${ifDefined(this.linksList)}' @ui5-menu-item-click="${ifDefined(this.handleProfileMenuItemClick)}" _scroll-into-view="Center"></udex-masthead-menu></div></div>${ this.hasActionButton ? block9.call(this, context, tags, suffix) : undefined }`;}
|
|
13
|
+
function block5 (this: MastheadProfileMenu, context: UI5Element, tags: string[], suffix: string | undefined) { return suffix ? html`<div class="udex-masthead-profile-menu__header"><${scopeTag("udex-avatar", tags, suffix)} aria-hidden="true" size="L" initials="${ifDefined(this.userData.avatarInitials)}" fallback-icon="${ifDefined(this.userData.fallbackIcon)}">${ this.userData.avatarUrl ? block6.call(this, context, tags, suffix) : undefined }</${scopeTag("udex-avatar", tags, suffix)}><div><p class="udex-profile-menu__account-name">${ifDefined(this.userData.name)}</p><p class="udex-profile-menu__account-email">${ifDefined(this.userData.email)}</p>${ this.hasIdentities ? block7.call(this, context, tags, suffix) : undefined }</div></div>` : html`<div class="udex-masthead-profile-menu__header"><udex-avatar aria-hidden="true" size="L" initials="${ifDefined(this.userData.avatarInitials)}" fallback-icon="${ifDefined(this.userData.fallbackIcon)}">${ this.userData.avatarUrl ? block6.call(this, context, tags, suffix) : undefined }</udex-avatar><div><p class="udex-profile-menu__account-name">${ifDefined(this.userData.name)}</p><p class="udex-profile-menu__account-email">${ifDefined(this.userData.email)}</p>${ this.hasIdentities ? block7.call(this, context, tags, suffix) : undefined }</div></div>`;}
|
|
14
14
|
function block6 (this: MastheadProfileMenu, context: UI5Element, tags: string[], suffix: string | undefined) { return html`<img src="${ifDefined(this.userData.avatarUrl)}" alt="avatar"/>`;}
|
|
15
15
|
function block7 (this: MastheadProfileMenu, context: UI5Element, tags: string[], suffix: string | undefined) { return suffix ? html`<${scopeTag("udex-button", tags, suffix)} @click="${this.handleSwitcherClick}" class="udex-masthead-profile-menu__btn-switcher" size="Large" end-icon="slim-arrow-right" design="Invisible">${ifDefined(this.switcherAccountText)}</${scopeTag("udex-button", tags, suffix)}>` : html`<udex-button @click="${this.handleSwitcherClick}" class="udex-masthead-profile-menu__btn-switcher" size="Large" end-icon="slim-arrow-right" design="Invisible">${ifDefined(this.switcherAccountText)}</udex-button>`;}
|
|
16
16
|
function block8 (this: MastheadProfileMenu, context: UI5Element, tags: string[], suffix: string | undefined) { return html`<div class="udex-masthead-profile-menu__message"><slot name="message"></slot></div>`;}
|
|
@@ -24,9 +24,9 @@ function block15 (this: MastheadShell, context: UI5Element, tags: string[], suff
|
|
|
24
24
|
function block16 (this: MastheadShell, context: UI5Element, tags: string[], suffix: string | undefined) { return html`<div class="udex-masthead-shell__joule udex-masthead-shell__item_icon" @ui5-item-click="${ifDefined(this.setSelectedItem)}" @click="${this.handleJouleClick}"><slot name="joule"></slot></div>`;}
|
|
25
25
|
function block17 (this: MastheadShell, context: UI5Element, tags: string[], suffix: string | undefined) { return html`<div class="udex-masthead-shell__cart udex-masthead-shell__item_icon" @ui5-item-click="${ifDefined(this.setSelectedItem)}" @click="${this.handleCartClick}"><slot name="cart"></slot></div>`;}
|
|
26
26
|
function block18 (this: MastheadShell, context: UI5Element, tags: string[], suffix: string | undefined) { return html`<div class="udex-masthead-shell__support udex-masthead-shell__item_icon" @ui5-item-click="${ifDefined(this.setSelectedItem)}" @click="${this.handleSupportClick}"><slot name="support"></slot></div>`;}
|
|
27
|
-
function block19 (this: MastheadShell, context: UI5Element, tags: string[], suffix: string | undefined) { return html`<div class="udex-masthead-shell__profile udex-masthead-shell__item_icon" @ui5-item-click="${ifDefined(this.setSelectedItem)}" @click="${this.handleProfileClick}"><slot name="profile"></slot></div>`;}
|
|
27
|
+
function block19 (this: MastheadShell, context: UI5Element, tags: string[], suffix: string | undefined) { return html`<div class="udex-masthead-shell__profile udex-masthead-shell__item_icon" @ui5-item-click="${ifDefined(this.setSelectedItem)}" @click-default="${this.handleProfileClick}"><slot name="profile"></slot></div>`;}
|
|
28
28
|
function block20 (this: MastheadShell, context: UI5Element, tags: string[], suffix: string | undefined) { return html`<div class="udex-masthead-shell__country-selector udex-masthead-shell__item_icon" @ui5-item-click="${ifDefined(this.setSelectedItem)}" @click="${this.handleCountrySelectorClick}"><slot name="countrySelector"></slot></div>`;}
|
|
29
|
-
function block21 (this: MastheadShell, context: UI5Element, tags: string[], suffix: string | undefined) { return suffix ? html`<${scopeTag("udex-masthead-item", tags, suffix)} @ui5-item-click="${ifDefined(this.handleOpenMobileMenu)}" class="udex-masthead-shell__menu-btn" accessible-role="button" icon="menu2" part="menu-open-btn" accessible-name="menu"><slot slot="dropdown" name="mobileMenu"></slot></${scopeTag("udex-masthead-item", tags, suffix)}><${scopeTag("udex-masthead-item", tags, suffix)} @keydown="${this.handleEnterAndSpaceOnCloseBtn}" @ui5-item-click="${ifDefined(this.closeMobileMenu)}" class="udex-masthead-shell__close-btn" accessible-role="button" icon="decline" accessible-name="${ifDefined(this.mobileCloseButtonAccessibleName)}" part="menu-close-btn" hide-active-border _is-menu-close-btn></${scopeTag("udex-masthead-item", tags, suffix)}>` : html`<udex-masthead-item @ui5-item-click="${ifDefined(this.handleOpenMobileMenu)}" class="udex-masthead-shell__menu-btn" accessible-role="button" icon="menu2" part="menu-open-btn" accessible-name="menu"><slot slot="dropdown" name="mobileMenu"></slot></udex-masthead-item><udex-masthead-item @keydown="${this.handleEnterAndSpaceOnCloseBtn}" @ui5-item-click="${ifDefined(this.closeMobileMenu)}" class="udex-masthead-shell__close-btn" accessible-role="button" icon="decline" accessible-name="${ifDefined(this.mobileCloseButtonAccessibleName)}" part="menu-close-btn" hide-active-border _is-menu-close-btn></udex-masthead-item>`;}
|
|
29
|
+
function block21 (this: MastheadShell, context: UI5Element, tags: string[], suffix: string | undefined) { return suffix ? html`<${scopeTag("udex-masthead-item", tags, suffix)} @ui5-item-click="${ifDefined(this.handleOpenMobileMenu)}" class="udex-masthead-shell__menu-btn" accessible-role="button" icon="menu2" part="menu-open-btn" accessible-name="menu" _is-menu-open-btn><slot slot="dropdown" name="mobileMenu"></slot></${scopeTag("udex-masthead-item", tags, suffix)}><${scopeTag("udex-masthead-item", tags, suffix)} @keydown="${this.handleEnterAndSpaceOnCloseBtn}" @ui5-item-click="${ifDefined(this.closeMobileMenu)}" class="udex-masthead-shell__close-btn" accessible-role="button" icon="decline" accessible-name="${ifDefined(this.mobileCloseButtonAccessibleName)}" part="menu-close-btn" hide-active-border _is-menu-close-btn></${scopeTag("udex-masthead-item", tags, suffix)}>` : html`<udex-masthead-item @ui5-item-click="${ifDefined(this.handleOpenMobileMenu)}" class="udex-masthead-shell__menu-btn" accessible-role="button" icon="menu2" part="menu-open-btn" accessible-name="menu" _is-menu-open-btn><slot slot="dropdown" name="mobileMenu"></slot></udex-masthead-item><udex-masthead-item @keydown="${this.handleEnterAndSpaceOnCloseBtn}" @ui5-item-click="${ifDefined(this.closeMobileMenu)}" class="udex-masthead-shell__close-btn" accessible-role="button" icon="decline" accessible-name="${ifDefined(this.mobileCloseButtonAccessibleName)}" part="menu-close-btn" hide-active-border _is-menu-close-btn></udex-masthead-item>`;}
|
|
30
30
|
|
|
31
31
|
function template(this: MastheadShell) { return block0.call(this, this, (this.constructor as typeof UI5Element).tagsToScope, getCustomElementsScopingSuffix()); }
|
|
32
32
|
export default template;
|
|
@@ -5,5 +5,5 @@ import defaultTheme from "./sap_horizon/parameters-bundle.css.js";
|
|
|
5
5
|
|
|
6
6
|
registerThemePropertiesLoader("@" + "ui5" + "/" + "webcomponents-theming", "sap_horizon", async () => defaultThemeBase);
|
|
7
7
|
registerThemePropertiesLoader("@" + "s" + "a" + "p" + "u" + "d" + "e" + "x" + "/" + "w" + "e" + "b" + "-" + "c" + "o" + "m" + "p" + "o" + "n" + "e" + "n" + "t" + "s", "sap_horizon", async () => defaultTheme, "host");
|
|
8
|
-
export default `:host{--udex-country-selector-flag-width: 30px;--udex-country-selector-flag-height: 20px;--udex-country-selector-padding-start: 50px;--udex-country-selector-padding-end: 12px;--udex-country-selector-text-offset: 36px;--udex-country-selector-search-inset-end: 42px;--udex-country-selector-search-inset-start: 36px;--udex-country-selector-active-text-offset-y: -21px;--udex-country-selector-label-offset-y: 96px}:host([_country-selector]) .udex-text-field__label{max-width:calc(100% - var(--udex-country-selector-label-offset-y))}:host([_country-selector]) .udex-text-field__label{transform:translate(var(--udex-country-selector-text-offset))}:host([_country-selector]) .udex-text-field__label.udex-text-field__label_active{transform:translateY(var(--udex-country-selector-active-text-offset-y))}:host([_country-selector]) .udex-text-field__text-holder{inset:0 1px}:host([_country-selector]) [udex-list-item]::part(item){padding:var(--udexSpacer8) var(--udexSpacer12) var(--udexSpacer8) var(--udex-country-selector-padding-start)}:host([_country-selector]) .udex-text-field__search{inset:0;padding:var(--udexSpacer8) 0}:host([_country-selector][hide-flag-images]) .udex-text-field__search{--udex-country-selector-search-inset-start: 0;padding:var(--udexSpacer8) var(--udexSpacer12);inset:0 42px 0 0}:host([_country-selector][hide-flag-images]) .udex-text-field__text-holder{inset:0 13px}:host([_country-selector][hide-flag-images]) .udex-text-field__label{--udex-country-selector-text-offset: 0}:host([_country-selector][hide-flag-images]) [udex-list-item]::part(item),:host([_country-selector][hide-flag-images]) .udex-text-field__text-holder{--udex-country-selector-padding-start: var(--udexSpacer12);--udex-country-selector-padding-end: var(--udexSpacer12)}:host([_country-selector][hide-flag-images]) .udex-text-field__label{--udex-country-selector-label-offset-y: 56px}.udex-text-field__image{background-color:var(--udexColorGrey4, #A9B4BE);background-image:url(https://cdn.udex.services.sap.com/dds/design-tokens/assets/country_flag_iso3166.webp);background-repeat:no-repeat;background-position:1000px 0;position:absolute;top:0;transform:translateY(50%);z-index:1;min-width:var(--udex-country-selector-flag-width);width:var(--udex-country-selector-flag-width);height:var(--udex-country-selector-flag-height);inset-inline-start:var(--udexSpacer12);inset-inline-end:30px;pointer-events:none}.udex-text-field__input>.udex-text-field__image{position:relative;transform:translate(0);inset-inline-start:0;inset-inline-end:0;margin-inline-start:var(--udexSpacer12);margin-inline-end:var(--udexSpacer8)}
|
|
8
|
+
export default `:host{--udex-country-selector-flag-width: 30px;--udex-country-selector-flag-height: 20px;--udex-country-selector-padding-start: 50px;--udex-country-selector-padding-end: 12px;--udex-country-selector-text-offset: 36px;--udex-country-selector-search-inset-end: 42px;--udex-country-selector-search-inset-start: 36px;--udex-country-selector-active-text-offset-y: -21px;--udex-country-selector-label-offset-y: 96px}:host([_country-selector]) .udex-text-field__label{max-width:calc(100% - var(--udex-country-selector-label-offset-y))}:host(:dir(rtl)[_country-selector]) .udex-text-field__label{transform:translate(calc(var(--udex-country-selector-text-offset) * -1))}:host([_country-selector]) .udex-text-field__label{transform:translate(var(--udex-country-selector-text-offset))}:host([_country-selector]) .udex-text-field__label.udex-text-field__label_active{transform:translateY(var(--udex-country-selector-active-text-offset-y))}:host([_country-selector]) .udex-text-field__text-holder{inset:0 1px}:host([_country-selector]) [udex-list-item]::part(item){padding:var(--udexSpacer8) var(--udexSpacer12) var(--udexSpacer8) var(--udex-country-selector-padding-start)}:host([_country-selector]) .udex-text-field__search{inset:0;padding:var(--udexSpacer8) 0}:host([_country-selector][hide-flag-images]) .udex-text-field__search{--udex-country-selector-search-inset-start: 0;padding:var(--udexSpacer8) var(--udexSpacer12);inset:0 42px 0 0}:host([_country-selector][hide-flag-images]) .udex-text-field__text-holder{inset:0 13px}:host([_country-selector][hide-flag-images]) .udex-text-field__label{--udex-country-selector-text-offset: 0}:host([_country-selector][hide-flag-images]) [udex-list-item]::part(item),:host([_country-selector][hide-flag-images]) .udex-text-field__text-holder{--udex-country-selector-padding-start: var(--udexSpacer12);--udex-country-selector-padding-end: var(--udexSpacer12)}:host([_country-selector][hide-flag-images]) .udex-text-field__label{--udex-country-selector-label-offset-y: 56px}.udex-text-field__image{background-color:var(--udexColorGrey4, #A9B4BE);background-image:url(https://cdn.udex.services.sap.com/dds/design-tokens/assets/country_flag_iso3166.webp);background-repeat:no-repeat;background-position:1000px 0;position:absolute;top:0;transform:translateY(50%);z-index:1;min-width:var(--udex-country-selector-flag-width);width:var(--udex-country-selector-flag-width);height:var(--udex-country-selector-flag-height);inset-inline-start:var(--udexSpacer12);inset-inline-end:30px;pointer-events:none}.udex-text-field__input>.udex-text-field__image{position:relative;transform:translate(0);inset-inline-start:0;inset-inline-end:0;margin-inline-start:var(--udexSpacer12);margin-inline-end:var(--udexSpacer8)}
|
|
9
9
|
`
|
|
@@ -5,5 +5,5 @@ import defaultTheme from "./sap_horizon/parameters-bundle.css.js";
|
|
|
5
5
|
|
|
6
6
|
registerThemePropertiesLoader("@" + "ui5" + "/" + "webcomponents-theming", "sap_horizon", async () => defaultThemeBase);
|
|
7
7
|
registerThemePropertiesLoader("@" + "s" + "a" + "p" + "u" + "d" + "e" + "x" + "/" + "w" + "e" + "b" + "-" + "c" + "o" + "m" + "p" + "o" + "n" + "e" + "n" + "t" + "s", "sap_horizon", async () => defaultTheme, "host");
|
|
8
|
-
export default `:host{--udex-masthead-country-selector-background: var(--udexColorNeutralWhite, #fff);--udex-masthead-country-selector-
|
|
8
|
+
export default `:host{--udex-masthead-country-selector-background: var(--udexColorNeutralWhite, #fff);--udex-masthead-country-selector-desktop-max-height: 375px;--udex-masthead-country-selector-title-border-color: var(--udexColorGrey2, #EAECEE);--udex-masthead-country-selector-title-color: var(--udexColorNeutralBlack, #000000)}.udex-masthead-country-selector{background:var(--udex-masthead-country-selector-background)}.udex-masthead-country-selector__title{font-family:var(--sapFontFamily);font-weight:var(--udexTypographyFontWeightMedium);font-size:var(--udexTypographyBodyXSFontSize);line-height:var(--udexTypographyHeadingLineHeight);color:var(--sapTitleColor);padding:var(--udexSpacer16) 0;display:block;text-align:center}:host(:not([_is-active-region-open])) .udex-masthead-country-selector__title{border-bottom:1px solid var(--udex-masthead-country-selector-title-border-color)}.udex-masthead-country-selector__list{list-style:none;margin:0;padding:0}.udex-masthead-country-selector__search{margin:var(--udexSpacer2) 0 var(--udexSpacer16)}.udex-masthead-country-selector__region-back-item::part(menu-item-button){font-weight:var(--udexTypographyFontWeightMedium, 500);color:var(--udex-masthead-country-selector-title-color);justify-content:space-between}.udex-masthead-country-selector__region-back-item::part(left){margin-inline-end:var(--udexSpacer4);margin-inline-start:0}.udex-masthead-country-selector__region-back-item::part(menu-item-button):after{content:""}.udex-masthead-country-selector__region-back-item,.udex-masthead-country-selector__item{--udex-masthead-menu-item-padding-block-desktop: var(--udexSpacer16);--udex-masthead-menu-item-padding-inline-desktop: var(--udexSpacer8) var(--udexSpacer12)}.udex-masthead-country-selector__item::part(menu-item-link),.udex-masthead-country-selector__item_countries{--udex-masthead-menu-item-padding-block-desktop: var(--udexSpacer8);--udex-masthead-menu-item-padding-inline-desktop: var(--udexSpacer8) var(--udexSpacer12)}.udex-masthead-country-selector__item::part(menu-item-link){width:100%}[_is-active-country].udex-masthead-country-selector__item::part(menu-item-link){font-weight:var(--udexTypographyFontWeightMedium, 500)}.udex-masthead-country-selector__list-wrap{max-height:var(--udex-masthead-country-selector-desktop-max-height);overflow:auto}:host([_is-mobile-mode]) .udex-masthead-country-selector__list-wrap{max-height:initial}.hidden{position:absolute;width:0;height:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);border:0;padding:0}:host([_is-mobile-mode]) .udex-masthead-country-selector__item::part(menu-item-link){--udex-masthead-menu-item-padding-block-desktop: var(--udexSpacer16);--udex-masthead-menu-item-padding-inline-desktop: var(--udexSpacer8) var(--udexSpacer12)}:host([_is-mobile-mode]) .udex-masthead-country-selector__list-container{height:100%;overflow:auto}:host([_is-mobile-mode]) .udex-masthead-country-selector__list-wrap{height:100%;overflow:auto;max-height:initial}:host([_is-mobile-mode]) .udex-masthead-country-selector{height:100%;box-sizing:border-box;display:flex;flex-direction:column;padding-bottom:var(--udexSpacer24)}:host([_is-mobile-mode]) .udex-masthead-country-selector__item_countries{--udex-masthead-menu-item-padding-block-desktop: var(--udexSpacer16);--udex-masthead-menu-item-padding-inline-desktop: var(--udexSpacer8) var(--udexSpacer12);border-bottom:1px solid var(--udex-masthead-menu-item-border-color);max-height:initial;overflow:initial}:host([_is-mobile-mode]) .udex-masthead-country-selector{min-height:100%;box-sizing:border-box}.udex-masthead-country-selector__list-container{position:relative}:host(:dir(rtl)) .udex-masthead-country-selector__list-wrap_scrollable:before{left:0;right:0}.udex-masthead-country-selector__list-wrap_scrollable:before{content:"";position:absolute;left:0;right:0;bottom:0;height:40px;z-index:1;background:linear-gradient(180deg,rgba(255,255,255,0) 0%,#FFFFFF 100%)}:host([desktop]) .udex-masthead-country-selector__list-wrap_scrollable:before{right:15px}:host([desktop]:dir(rtl)) .udex-masthead-country-selector__list-wrap_scrollable:before{left:15px;right:0}@media (max-width: 1279px){.udex-masthead-country-selector__list-wrap{height:100%;overflow:auto;max-height:initial}.udex-masthead-country-selector{height:100%;box-sizing:border-box;display:flex;flex-direction:column}.udex-masthead-country-selector__list{padding-bottom:var(--udexSpacer24)}.udex-masthead-country-selector__item_countries{--udex-masthead-menu-item-padding-block-desktop: var(--udexSpacer16);--udex-masthead-menu-item-padding-inline-desktop: var(--udexSpacer8) var(--udexSpacer12);border-bottom:1px solid var(--udex-masthead-menu-item-border-color)}.udex-masthead-country-selector__list-container{height:100%;overflow:auto;padding-bottom:var(--udexSpacer24)}}@media (max-height: 550px){.udex-masthead-country-selector__list-container{min-height:100px}}
|
|
9
9
|
`
|