@ui5/webcomponents-fiori 2.19.2 → 2.20.0-rc.1
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/CHANGELOG.md +12 -3
- package/dist/.tsbuildinfo +1 -1
- package/dist/DynamicPage.js +8 -2
- package/dist/DynamicPage.js.map +1 -1
- package/dist/ShellBar.d.ts +231 -304
- package/dist/ShellBar.js +506 -980
- package/dist/ShellBar.js.map +1 -1
- package/dist/ShellBarItem.d.ts +15 -31
- package/dist/ShellBarItem.js +36 -25
- package/dist/ShellBarItem.js.map +1 -1
- package/dist/ShellBarItemTemplate.d.ts +2 -0
- package/dist/ShellBarItemTemplate.js +11 -0
- package/dist/ShellBarItemTemplate.js.map +1 -0
- package/dist/ShellBarTemplate.js +53 -55
- package/dist/ShellBarTemplate.js.map +1 -1
- package/dist/UserMenu.d.ts +10 -1
- package/dist/UserMenu.js +9 -1
- package/dist/UserMenu.js.map +1 -1
- package/dist/UserMenuAccount.js +0 -2
- package/dist/UserMenuAccount.js.map +1 -1
- package/dist/UserMenuItem.d.ts +0 -1
- package/dist/UserMenuItem.js +0 -1
- package/dist/UserMenuItem.js.map +1 -1
- package/dist/UserMenuItemGroup.d.ts +0 -1
- package/dist/UserMenuItemGroup.js +0 -1
- package/dist/UserMenuItemGroup.js.map +1 -1
- package/dist/UserMenuTemplate.js +3 -1
- package/dist/UserMenuTemplate.js.map +1 -1
- package/dist/UserSettingsAccountView.js +0 -2
- package/dist/UserSettingsAccountView.js.map +1 -1
- package/dist/UserSettingsAppearanceView.js +0 -2
- package/dist/UserSettingsAppearanceView.js.map +1 -1
- package/dist/UserSettingsAppearanceViewGroup.d.ts +0 -1
- package/dist/UserSettingsAppearanceViewGroup.js +0 -1
- package/dist/UserSettingsAppearanceViewGroup.js.map +1 -1
- package/dist/UserSettingsAppearanceViewItem.js +0 -2
- package/dist/UserSettingsAppearanceViewItem.js.map +1 -1
- package/dist/UserSettingsDialog.d.ts +0 -1
- package/dist/UserSettingsDialog.js +0 -1
- package/dist/UserSettingsDialog.js.map +1 -1
- package/dist/UserSettingsItem.d.ts +0 -1
- package/dist/UserSettingsItem.js +0 -1
- package/dist/UserSettingsItem.js.map +1 -1
- package/dist/UserSettingsView.d.ts +0 -1
- package/dist/UserSettingsView.js +0 -1
- package/dist/UserSettingsView.js.map +1 -1
- package/dist/css/themes/ShellBar.css +1 -1
- package/dist/css/themes/ShellBarItem.css +1 -0
- package/dist/css/themes/ShellBarLegacy.css +1 -0
- package/dist/css/themes/ShellBarSearchLegacy.css +1 -0
- package/dist/custom-elements-internal.json +363 -750
- package/dist/custom-elements.json +324 -609
- package/dist/generated/assets/i18n/messagebundle_ar.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_bg.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ca.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_cnr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_cs.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_cy.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_da.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_de.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_el.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_GB.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_es.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_es_MX.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_et.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_fr_CA.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_hi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_hr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_hu.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_id.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_it.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_iw.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ja.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_kk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ko.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_lt.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_lv.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_mk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ms.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_nl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_no.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pt.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_pt_PT.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ro.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_ru.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sh.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sl.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_sv.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_th.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_tr.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_uk.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_vi.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_zh_CN.json +1 -1
- package/dist/generated/assets/i18n/messagebundle_zh_TW.json +1 -1
- package/dist/generated/i18n/i18n-defaults.d.ts +2 -1
- package/dist/generated/i18n/i18n-defaults.js +2 -1
- package/dist/generated/i18n/i18n-defaults.js.map +1 -1
- package/dist/generated/themes/ShellBar.css.d.ts +1 -1
- package/dist/generated/themes/ShellBar.css.js +1 -1
- package/dist/generated/themes/ShellBar.css.js.map +1 -1
- package/dist/generated/themes/ShellBarItem.css.d.ts +2 -0
- package/dist/generated/themes/ShellBarItem.css.js +8 -0
- package/dist/generated/themes/ShellBarItem.css.js.map +1 -0
- package/dist/generated/themes/ShellBarLegacy.css.d.ts +2 -0
- package/dist/generated/themes/ShellBarLegacy.css.js +8 -0
- package/dist/generated/themes/ShellBarLegacy.css.js.map +1 -0
- package/dist/generated/themes/ShellBarSearchLegacy.css.d.ts +2 -0
- package/dist/generated/themes/ShellBarSearchLegacy.css.js +8 -0
- package/dist/generated/themes/ShellBarSearchLegacy.css.js.map +1 -0
- package/dist/shellbar/IShellBarSearchController.d.ts +28 -0
- package/dist/shellbar/IShellBarSearchController.js +2 -0
- package/dist/shellbar/IShellBarSearchController.js.map +1 -0
- package/dist/shellbar/ShellBarAccessibility.d.ts +42 -0
- package/dist/shellbar/ShellBarAccessibility.js +50 -0
- package/dist/shellbar/ShellBarAccessibility.js.map +1 -0
- package/dist/shellbar/ShellBarItemNavigation.d.ts +18 -0
- package/dist/shellbar/ShellBarItemNavigation.js +86 -0
- package/dist/shellbar/ShellBarItemNavigation.js.map +1 -0
- package/dist/shellbar/ShellBarLegacy.d.ts +46 -0
- package/dist/shellbar/ShellBarLegacy.js +138 -0
- package/dist/shellbar/ShellBarLegacy.js.map +1 -0
- package/dist/shellbar/ShellBarOverflow.d.ts +51 -0
- package/dist/shellbar/ShellBarOverflow.js +159 -0
- package/dist/shellbar/ShellBarOverflow.js.map +1 -0
- package/dist/shellbar/ShellBarSearch.d.ts +59 -0
- package/dist/shellbar/ShellBarSearch.js +145 -0
- package/dist/shellbar/ShellBarSearch.js.map +1 -0
- package/dist/shellbar/ShellBarSearchLegacy.d.ts +65 -0
- package/dist/shellbar/ShellBarSearchLegacy.js +116 -0
- package/dist/shellbar/ShellBarSearchLegacy.js.map +1 -0
- package/dist/shellbar/templates/ShellBarLegacyTemplate.d.ts +20 -0
- package/dist/shellbar/templates/ShellBarLegacyTemplate.js +71 -0
- package/dist/shellbar/templates/ShellBarLegacyTemplate.js.map +1 -0
- package/dist/shellbar/templates/ShellBarSearchLegacyTemplate.d.ts +5 -0
- package/dist/shellbar/templates/ShellBarSearchLegacyTemplate.js +18 -0
- package/dist/shellbar/templates/ShellBarSearchLegacyTemplate.js.map +1 -0
- package/dist/shellbar/templates/ShellBarSearchTemplate.d.ts +4 -0
- package/dist/shellbar/templates/ShellBarSearchTemplate.js +17 -0
- package/dist/shellbar/templates/ShellBarSearchTemplate.js.map +1 -0
- package/dist/vscode.html-custom-data.json +29 -79
- package/dist/web-types.json +75 -239
- package/package.json +8 -8
- package/src/ShellBarItemTemplate.tsx +36 -0
- package/src/ShellBarTemplate.tsx +222 -300
- package/src/UserMenuTemplate.tsx +11 -3
- package/src/i18n/messagebundle.properties +3 -0
- package/src/i18n/messagebundle_ar.properties +2 -0
- package/src/i18n/messagebundle_bg.properties +6 -4
- package/src/i18n/messagebundle_ca.properties +2 -0
- package/src/i18n/messagebundle_cnr.properties +2 -0
- package/src/i18n/messagebundle_cs.properties +2 -0
- package/src/i18n/messagebundle_cy.properties +2 -0
- package/src/i18n/messagebundle_da.properties +2 -0
- package/src/i18n/messagebundle_de.properties +2 -0
- package/src/i18n/messagebundle_el.properties +2 -0
- package/src/i18n/messagebundle_en.properties +2 -0
- package/src/i18n/messagebundle_en_GB.properties +2 -0
- package/src/i18n/messagebundle_en_US_sappsd.properties +2 -0
- package/src/i18n/messagebundle_en_US_saprigi.properties +2 -0
- package/src/i18n/messagebundle_en_US_saptrc.properties +2 -0
- package/src/i18n/messagebundle_es.properties +2 -0
- package/src/i18n/messagebundle_es_MX.properties +2 -0
- package/src/i18n/messagebundle_et.properties +2 -0
- package/src/i18n/messagebundle_fi.properties +2 -0
- package/src/i18n/messagebundle_fr.properties +2 -0
- package/src/i18n/messagebundle_fr_CA.properties +2 -0
- package/src/i18n/messagebundle_hi.properties +2 -0
- package/src/i18n/messagebundle_hr.properties +2 -0
- package/src/i18n/messagebundle_hu.properties +2 -0
- package/src/i18n/messagebundle_id.properties +3 -1
- package/src/i18n/messagebundle_it.properties +2 -0
- package/src/i18n/messagebundle_iw.properties +2 -0
- package/src/i18n/messagebundle_ja.properties +2 -0
- package/src/i18n/messagebundle_kk.properties +2 -0
- package/src/i18n/messagebundle_ko.properties +2 -0
- package/src/i18n/messagebundle_lt.properties +2 -0
- package/src/i18n/messagebundle_lv.properties +2 -0
- package/src/i18n/messagebundle_mk.properties +2 -0
- package/src/i18n/messagebundle_ms.properties +2 -0
- package/src/i18n/messagebundle_nl.properties +2 -0
- package/src/i18n/messagebundle_no.properties +2 -0
- package/src/i18n/messagebundle_pl.properties +2 -0
- package/src/i18n/messagebundle_pt.properties +2 -0
- package/src/i18n/messagebundle_pt_PT.properties +2 -0
- package/src/i18n/messagebundle_ro.properties +2 -0
- package/src/i18n/messagebundle_ru.properties +2 -0
- package/src/i18n/messagebundle_sh.properties +2 -0
- package/src/i18n/messagebundle_sk.properties +2 -0
- package/src/i18n/messagebundle_sl.properties +2 -0
- package/src/i18n/messagebundle_sr.properties +2 -0
- package/src/i18n/messagebundle_sv.properties +2 -0
- package/src/i18n/messagebundle_th.properties +2 -0
- package/src/i18n/messagebundle_tr.properties +2 -0
- package/src/i18n/messagebundle_uk.properties +2 -0
- package/src/i18n/messagebundle_vi.properties +2 -0
- package/src/i18n/messagebundle_zh_CN.properties +2 -0
- package/src/i18n/messagebundle_zh_TW.properties +2 -0
- package/src/shellbar/templates/ShellBarLegacyTemplate.tsx +190 -0
- package/src/shellbar/templates/ShellBarSearchLegacyTemplate.tsx +61 -0
- package/src/shellbar/templates/ShellBarSearchTemplate.tsx +40 -0
- package/src/themes/NavigationLayout.css +1 -0
- package/src/themes/ShellBar.css +189 -372
- package/src/themes/ShellBarItem.css +43 -0
- package/src/themes/ShellBarLegacy.css +174 -0
- package/src/themes/ShellBarSearchLegacy.css +44 -0
- package/dist/ShellBarPopoverTemplate.d.ts +0 -2
- package/dist/ShellBarPopoverTemplate.js +0 -9
- package/dist/ShellBarPopoverTemplate.js.map +0 -1
- package/src/ShellBarPopoverTemplate.tsx +0 -50
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShellBarItem.css.js","sourceRoot":"","sources":["../../../src/generated/themes/ShellBarItem.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yDAAyD,CAAC;AAExG,OAAO,gBAAgB,MAAM,uFAAuF,CAAC;AACrH,OAAO,YAAY,MAAM,wCAAwC,CAAC;AAElE,6BAA6B,CAAC,GAAG,GAAG,KAAK,GAAG,GAAG,GAAG,uBAAuB,EAAE,aAAa,EAAE,KAAK,IAAI,EAAE,CAAC,gBAAgB,CAAC,CAAC;AACxH,6BAA6B,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE,aAAa,EAAE,KAAK,IAAI,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;AAC9N,eAAe;CACd,CAAA","sourcesContent":["import { registerThemePropertiesLoader } from \"@ui5/webcomponents-base/dist/asset-registries/Themes.js\";\n\nimport defaultThemeBase from \"@ui5/webcomponents-theming/dist/generated/themes/sap_horizon/parameters-bundle.css.js\";\nimport defaultTheme from \"./sap_horizon/parameters-bundle.css.js\";\n\nregisterThemePropertiesLoader(\"@\" + \"ui5\" + \"/\" + \"webcomponents-theming\", \"sap_horizon\", async () => defaultThemeBase);\nregisterThemePropertiesLoader(\"@\" + \"u\" + \"i\" + \"5\" + \"/\" + \"w\" + \"e\" + \"b\" + \"c\" + \"o\" + \"m\" + \"p\" + \"o\" + \"n\" + \"e\" + \"n\" + \"t\" + \"s\" + \"-\" + \"f\" + \"i\" + \"o\" + \"r\" + \"i\", \"sap_horizon\", async () => defaultTheme, \"host\");\nexport default `.ui5-shellbar-action-button{width:2.25rem;height:2.25rem;color:var(--sapShell_TextColor)}.ui5-shellbar-action-button:hover{color:var(--sapShell_TextColor)}.ui5-shellbar-action-button[active]{color:var(--_ui5_shellbar_button_active_color)}[ui5-li]:after{position:relative;width:fit-content;height:1rem;min-width:1rem;background:var(--sapContent_BadgeBackground);border:var(--_ui5_shellbar_button_badge_border);color:var(--sapContent_BadgeTextColor);bottom:calc(100% + .0625rem);left:1.25rem;padding:0 .3125rem;border-radius:.5rem;display:flex;justify-content:center;align-items:center;font-size:var(--sapFontSmallSize);font-family:var(--sapFontFamily);z-index:2;box-sizing:border-box;pointer-events:none}[ui5-li][data-count]:after{content:attr(data-count)}\n`"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: ".ui5-shellbar-logo{overflow:hidden;cursor:pointer}.ui5-shellbar-logo-area,.ui5-shellbar-legacy-branding{overflow:hidden;display:flex;align-items:center;padding:.25rem .5rem .25rem .25rem;box-sizing:border-box;cursor:pointer;background:var(--sapButton_Lite_Background);border:1px solid var(--sapButton_Lite_BorderColor);color:var(--sapShell_TextColor);margin-inline-start:.125rem}.ui5-shellbar-logo:focus,.ui5-shellbar-logo-area:focus{outline:var(--_ui5_shellbar_logo_outline);outline-offset:calc(-1 * var(--sapContent_FocusWidth));border-radius:var(--_ui5_shellbar_logo_border_radius)}.ui5-shellbar-overflow-container>.ui5-shellbar-logo:hover,.ui5-shellbar-logo-area:hover{box-shadow:var(--_ui5_shellbar_button_box_shadow);border-radius:var(--_ui5_shellbar_logo_border_radius)}.ui5-shellbar-logo-area:active:focus{background:var(--sapShell_Active_Background);border:1px solid var(--sapButton_Lite_Active_BorderColor);color:var(--sapShell_Active_TextColor)}::slotted([slot=\"logo\"]){max-height:2rem}::slotted([slot=\"logo\"]):active{pointer-events:none}.ui5-shellbar-headings{display:flex;flex-direction:column;justify-content:center;height:100%;overflow:hidden;margin-inline-start:.25rem}.ui5-shellbar-primary-title,.ui5-shellbar-menu-button-title,.ui5-shellbar-title{display:inline-block;font-family:var(--sapFontSemiboldDuplexFamily);margin:0;font-size:var(--_ui5_shellbar_menu_button_title_font_size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--sapShell_SubBrand_TextColor)}.ui5-shellbar-secondary-title{display:inline-block;font-size:var(--sapFontSmallSize);color:var(--sapShell_TextColor);font-weight:400;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;text-align:start}.ui5-shellbar-menu-button{white-space:nowrap;overflow:hidden;display:flex;align-items:center;padding:.25rem .5rem;cursor:text;-webkit-user-select:text;-moz-user-select:text;user-select:text;margin-inline-start:.5rem;height:2.25rem;border:.0625rem solid var(--sapButton_Lite_BorderColor);background:var(--sapButton_Lite_Background);outline-color:var(--_ui5_shellbar_logo_outline_color);color:var(--sapShell_TextColor);box-sizing:border-box;border-radius:var(--_ui5_shellbar_button_border_radius);position:relative;font-weight:700}.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive{-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer;background:var(--sapButton_Lite_Background);border:var(--_ui5_shellbar_button_border);color:var(--sapShell_TextColor)}.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:hover{background:var(--sapShell_Hover_Background);border-color:var(--sapButton_Lite_Hover_BorderColor);color:var(--sapShell_TextColor);box-shadow:var(--_ui5_shellbar_button_box_shadow)}.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:active{background:var(--sapShell_Active_Background);border-color:var(--sapButton_Lite_Active_BorderColor);color:var(--_ui5_shellbar_button_active_color);box-shadow:var(--_ui5_shellbar_button_box_shadow_active)}.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:active .ui5-shellbar-menu-button-arrow,.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:active .ui5-shellbar-menu-button-title{color:var(--sapShell_Active_TextColor)}:host([desktop]) .ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:focus,.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:focus-visible{outline:var(--_ui5_shellbar_logo_outline);outline-offset:var(--_ui5_shellbar_outline_offset)}.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive::-moz-focus-inner{border:none}.ui5-shellbar-menu-button .ui5-shellbar-logo:hover{box-shadow:none}.ui5-shellbar-menu-button-arrow{display:inline-block;font-family:var(--sapFontSemiboldDuplexFamily);margin:0;font-size:var(--_ui5_shellbar_menu_button_title_font_size);color:var(--sapShell_SubBrand_TextColor)}.ui5-shellbar-menu-button--interactive .ui5-shellbar-menu-button-arrow{margin-inline-start:.375rem}:host(:not([primary-title])) .ui5-shellbar-menu-button{min-width:2.25rem;justify-content:center}:host(:not([with-logo])) .ui5-shellbar-menu-button{margin-inline-start:0}:host([breakpoint-size=\"S\"]) .ui5-shellbar-menu-button{margin-inline-start:0}\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { registerThemePropertiesLoader } from "@ui5/webcomponents-base/dist/asset-registries/Themes.js";
|
|
2
|
+
import defaultThemeBase from "@ui5/webcomponents-theming/dist/generated/themes/sap_horizon/parameters-bundle.css.js";
|
|
3
|
+
import defaultTheme from "./sap_horizon/parameters-bundle.css.js";
|
|
4
|
+
registerThemePropertiesLoader("@" + "ui5" + "/" + "webcomponents-theming", "sap_horizon", async () => defaultThemeBase);
|
|
5
|
+
registerThemePropertiesLoader("@" + "u" + "i" + "5" + "/" + "w" + "e" + "b" + "c" + "o" + "m" + "p" + "o" + "n" + "e" + "n" + "t" + "s" + "-" + "f" + "i" + "o" + "r" + "i", "sap_horizon", async () => defaultTheme, "host");
|
|
6
|
+
export default `.ui5-shellbar-logo{overflow:hidden;cursor:pointer}.ui5-shellbar-logo-area,.ui5-shellbar-legacy-branding{overflow:hidden;display:flex;align-items:center;padding:.25rem .5rem .25rem .25rem;box-sizing:border-box;cursor:pointer;background:var(--sapButton_Lite_Background);border:1px solid var(--sapButton_Lite_BorderColor);color:var(--sapShell_TextColor);margin-inline-start:.125rem}.ui5-shellbar-logo:focus,.ui5-shellbar-logo-area:focus{outline:var(--_ui5_shellbar_logo_outline);outline-offset:calc(-1 * var(--sapContent_FocusWidth));border-radius:var(--_ui5_shellbar_logo_border_radius)}.ui5-shellbar-overflow-container>.ui5-shellbar-logo:hover,.ui5-shellbar-logo-area:hover{box-shadow:var(--_ui5_shellbar_button_box_shadow);border-radius:var(--_ui5_shellbar_logo_border_radius)}.ui5-shellbar-logo-area:active:focus{background:var(--sapShell_Active_Background);border:1px solid var(--sapButton_Lite_Active_BorderColor);color:var(--sapShell_Active_TextColor)}::slotted([slot="logo"]){max-height:2rem}::slotted([slot="logo"]):active{pointer-events:none}.ui5-shellbar-headings{display:flex;flex-direction:column;justify-content:center;height:100%;overflow:hidden;margin-inline-start:.25rem}.ui5-shellbar-primary-title,.ui5-shellbar-menu-button-title,.ui5-shellbar-title{display:inline-block;font-family:var(--sapFontSemiboldDuplexFamily);margin:0;font-size:var(--_ui5_shellbar_menu_button_title_font_size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--sapShell_SubBrand_TextColor)}.ui5-shellbar-secondary-title{display:inline-block;font-size:var(--sapFontSmallSize);color:var(--sapShell_TextColor);font-weight:400;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;text-align:start}.ui5-shellbar-menu-button{white-space:nowrap;overflow:hidden;display:flex;align-items:center;padding:.25rem .5rem;cursor:text;-webkit-user-select:text;-moz-user-select:text;user-select:text;margin-inline-start:.5rem;height:2.25rem;border:.0625rem solid var(--sapButton_Lite_BorderColor);background:var(--sapButton_Lite_Background);outline-color:var(--_ui5_shellbar_logo_outline_color);color:var(--sapShell_TextColor);box-sizing:border-box;border-radius:var(--_ui5_shellbar_button_border_radius);position:relative;font-weight:700}.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive{-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer;background:var(--sapButton_Lite_Background);border:var(--_ui5_shellbar_button_border);color:var(--sapShell_TextColor)}.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:hover{background:var(--sapShell_Hover_Background);border-color:var(--sapButton_Lite_Hover_BorderColor);color:var(--sapShell_TextColor);box-shadow:var(--_ui5_shellbar_button_box_shadow)}.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:active{background:var(--sapShell_Active_Background);border-color:var(--sapButton_Lite_Active_BorderColor);color:var(--_ui5_shellbar_button_active_color);box-shadow:var(--_ui5_shellbar_button_box_shadow_active)}.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:active .ui5-shellbar-menu-button-arrow,.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:active .ui5-shellbar-menu-button-title{color:var(--sapShell_Active_TextColor)}:host([desktop]) .ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:focus,.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:focus-visible{outline:var(--_ui5_shellbar_logo_outline);outline-offset:var(--_ui5_shellbar_outline_offset)}.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive::-moz-focus-inner{border:none}.ui5-shellbar-menu-button .ui5-shellbar-logo:hover{box-shadow:none}.ui5-shellbar-menu-button-arrow{display:inline-block;font-family:var(--sapFontSemiboldDuplexFamily);margin:0;font-size:var(--_ui5_shellbar_menu_button_title_font_size);color:var(--sapShell_SubBrand_TextColor)}.ui5-shellbar-menu-button--interactive .ui5-shellbar-menu-button-arrow{margin-inline-start:.375rem}:host(:not([primary-title])) .ui5-shellbar-menu-button{min-width:2.25rem;justify-content:center}:host(:not([with-logo])) .ui5-shellbar-menu-button{margin-inline-start:0}:host([breakpoint-size="S"]) .ui5-shellbar-menu-button{margin-inline-start:0}
|
|
7
|
+
`;
|
|
8
|
+
//# sourceMappingURL=ShellBarLegacy.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShellBarLegacy.css.js","sourceRoot":"","sources":["../../../src/generated/themes/ShellBarLegacy.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yDAAyD,CAAC;AAExG,OAAO,gBAAgB,MAAM,uFAAuF,CAAC;AACrH,OAAO,YAAY,MAAM,wCAAwC,CAAC;AAElE,6BAA6B,CAAC,GAAG,GAAG,KAAK,GAAG,GAAG,GAAG,uBAAuB,EAAE,aAAa,EAAE,KAAK,IAAI,EAAE,CAAC,gBAAgB,CAAC,CAAC;AACxH,6BAA6B,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE,aAAa,EAAE,KAAK,IAAI,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;AAC9N,eAAe;CACd,CAAA","sourcesContent":["import { registerThemePropertiesLoader } from \"@ui5/webcomponents-base/dist/asset-registries/Themes.js\";\n\nimport defaultThemeBase from \"@ui5/webcomponents-theming/dist/generated/themes/sap_horizon/parameters-bundle.css.js\";\nimport defaultTheme from \"./sap_horizon/parameters-bundle.css.js\";\n\nregisterThemePropertiesLoader(\"@\" + \"ui5\" + \"/\" + \"webcomponents-theming\", \"sap_horizon\", async () => defaultThemeBase);\nregisterThemePropertiesLoader(\"@\" + \"u\" + \"i\" + \"5\" + \"/\" + \"w\" + \"e\" + \"b\" + \"c\" + \"o\" + \"m\" + \"p\" + \"o\" + \"n\" + \"e\" + \"n\" + \"t\" + \"s\" + \"-\" + \"f\" + \"i\" + \"o\" + \"r\" + \"i\", \"sap_horizon\", async () => defaultTheme, \"host\");\nexport default `.ui5-shellbar-logo{overflow:hidden;cursor:pointer}.ui5-shellbar-logo-area,.ui5-shellbar-legacy-branding{overflow:hidden;display:flex;align-items:center;padding:.25rem .5rem .25rem .25rem;box-sizing:border-box;cursor:pointer;background:var(--sapButton_Lite_Background);border:1px solid var(--sapButton_Lite_BorderColor);color:var(--sapShell_TextColor);margin-inline-start:.125rem}.ui5-shellbar-logo:focus,.ui5-shellbar-logo-area:focus{outline:var(--_ui5_shellbar_logo_outline);outline-offset:calc(-1 * var(--sapContent_FocusWidth));border-radius:var(--_ui5_shellbar_logo_border_radius)}.ui5-shellbar-overflow-container>.ui5-shellbar-logo:hover,.ui5-shellbar-logo-area:hover{box-shadow:var(--_ui5_shellbar_button_box_shadow);border-radius:var(--_ui5_shellbar_logo_border_radius)}.ui5-shellbar-logo-area:active:focus{background:var(--sapShell_Active_Background);border:1px solid var(--sapButton_Lite_Active_BorderColor);color:var(--sapShell_Active_TextColor)}::slotted([slot=\"logo\"]){max-height:2rem}::slotted([slot=\"logo\"]):active{pointer-events:none}.ui5-shellbar-headings{display:flex;flex-direction:column;justify-content:center;height:100%;overflow:hidden;margin-inline-start:.25rem}.ui5-shellbar-primary-title,.ui5-shellbar-menu-button-title,.ui5-shellbar-title{display:inline-block;font-family:var(--sapFontSemiboldDuplexFamily);margin:0;font-size:var(--_ui5_shellbar_menu_button_title_font_size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--sapShell_SubBrand_TextColor)}.ui5-shellbar-secondary-title{display:inline-block;font-size:var(--sapFontSmallSize);color:var(--sapShell_TextColor);font-weight:400;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;text-align:start}.ui5-shellbar-menu-button{white-space:nowrap;overflow:hidden;display:flex;align-items:center;padding:.25rem .5rem;cursor:text;-webkit-user-select:text;-moz-user-select:text;user-select:text;margin-inline-start:.5rem;height:2.25rem;border:.0625rem solid var(--sapButton_Lite_BorderColor);background:var(--sapButton_Lite_Background);outline-color:var(--_ui5_shellbar_logo_outline_color);color:var(--sapShell_TextColor);box-sizing:border-box;border-radius:var(--_ui5_shellbar_button_border_radius);position:relative;font-weight:700}.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive{-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer;background:var(--sapButton_Lite_Background);border:var(--_ui5_shellbar_button_border);color:var(--sapShell_TextColor)}.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:hover{background:var(--sapShell_Hover_Background);border-color:var(--sapButton_Lite_Hover_BorderColor);color:var(--sapShell_TextColor);box-shadow:var(--_ui5_shellbar_button_box_shadow)}.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:active{background:var(--sapShell_Active_Background);border-color:var(--sapButton_Lite_Active_BorderColor);color:var(--_ui5_shellbar_button_active_color);box-shadow:var(--_ui5_shellbar_button_box_shadow_active)}.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:active .ui5-shellbar-menu-button-arrow,.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:active .ui5-shellbar-menu-button-title{color:var(--sapShell_Active_TextColor)}:host([desktop]) .ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:focus,.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive:focus-visible{outline:var(--_ui5_shellbar_logo_outline);outline-offset:var(--_ui5_shellbar_outline_offset)}.ui5-shellbar-menu-button.ui5-shellbar-menu-button--interactive::-moz-focus-inner{border:none}.ui5-shellbar-menu-button .ui5-shellbar-logo:hover{box-shadow:none}.ui5-shellbar-menu-button-arrow{display:inline-block;font-family:var(--sapFontSemiboldDuplexFamily);margin:0;font-size:var(--_ui5_shellbar_menu_button_title_font_size);color:var(--sapShell_SubBrand_TextColor)}.ui5-shellbar-menu-button--interactive .ui5-shellbar-menu-button-arrow{margin-inline-start:.375rem}:host(:not([primary-title])) .ui5-shellbar-menu-button{min-width:2.25rem;justify-content:center}:host(:not([with-logo])) .ui5-shellbar-menu-button{margin-inline-start:0}:host([breakpoint-size=\"S\"]) .ui5-shellbar-menu-button{margin-inline-start:0}\n`"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "::slotted([ui5-input]){--_ui5_input_placeholder_color: var(--sapShell_InteractiveTextColor);--_ui5_input_border_radius: var(--_ui5_shellbar_input_border_radius);--_ui5_input_focus_border_radius: var(--_ui5_shellbar_input_focus_border_radius);--_ui5_input_background_color: var(--_ui5_shellbar_input_background_color);--_ui5_input_focus_outline_color: var(--_ui5_shellbar_input_focus_outline_color);--_ui5_input_margin_top_bottom: 0}::slotted([ui5-input]){background:var(--_ui5_shellbar_search_field_background);border:var(--_ui5_shellbar_search_field_border);box-shadow:var(--_ui5_shellbar_search_field_box_shadow);color:var(--_ui5_shellbar_search_field_color);height:2.25rem;width:100%;min-width:var(--_ui5_shellbar_search_field_width)}:host([breakpoint-size=\"M\"]) ::slotted([ui5-input]),:host([breakpoint-size=\"S\"]) ::slotted([ui5-input]){min-width:1rem}:host([breakpoint-size=\"M\"][show-search-field]) .ui5-shellbar-overflow-container-right-child{flex-grow:1}::slotted([ui5-input]:hover){background:var(--_ui5_shellbar_search_field_background_hover);box-shadow:var(--_ui5_shellbar_search_field_box_shadow_hover)}::slotted([ui5-input][focused]){outline:var(--_ui5_shellbar_search_field_outline_focused)}\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { registerThemePropertiesLoader } from "@ui5/webcomponents-base/dist/asset-registries/Themes.js";
|
|
2
|
+
import defaultThemeBase from "@ui5/webcomponents-theming/dist/generated/themes/sap_horizon/parameters-bundle.css.js";
|
|
3
|
+
import defaultTheme from "./sap_horizon/parameters-bundle.css.js";
|
|
4
|
+
registerThemePropertiesLoader("@" + "ui5" + "/" + "webcomponents-theming", "sap_horizon", async () => defaultThemeBase);
|
|
5
|
+
registerThemePropertiesLoader("@" + "u" + "i" + "5" + "/" + "w" + "e" + "b" + "c" + "o" + "m" + "p" + "o" + "n" + "e" + "n" + "t" + "s" + "-" + "f" + "i" + "o" + "r" + "i", "sap_horizon", async () => defaultTheme, "host");
|
|
6
|
+
export default `::slotted([ui5-input]){--_ui5_input_placeholder_color: var(--sapShell_InteractiveTextColor);--_ui5_input_border_radius: var(--_ui5_shellbar_input_border_radius);--_ui5_input_focus_border_radius: var(--_ui5_shellbar_input_focus_border_radius);--_ui5_input_background_color: var(--_ui5_shellbar_input_background_color);--_ui5_input_focus_outline_color: var(--_ui5_shellbar_input_focus_outline_color);--_ui5_input_margin_top_bottom: 0}::slotted([ui5-input]){background:var(--_ui5_shellbar_search_field_background);border:var(--_ui5_shellbar_search_field_border);box-shadow:var(--_ui5_shellbar_search_field_box_shadow);color:var(--_ui5_shellbar_search_field_color);height:2.25rem;width:100%;min-width:var(--_ui5_shellbar_search_field_width)}:host([breakpoint-size="M"]) ::slotted([ui5-input]),:host([breakpoint-size="S"]) ::slotted([ui5-input]){min-width:1rem}:host([breakpoint-size="M"][show-search-field]) .ui5-shellbar-overflow-container-right-child{flex-grow:1}::slotted([ui5-input]:hover){background:var(--_ui5_shellbar_search_field_background_hover);box-shadow:var(--_ui5_shellbar_search_field_box_shadow_hover)}::slotted([ui5-input][focused]){outline:var(--_ui5_shellbar_search_field_outline_focused)}
|
|
7
|
+
`;
|
|
8
|
+
//# sourceMappingURL=ShellBarSearchLegacy.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShellBarSearchLegacy.css.js","sourceRoot":"","sources":["../../../src/generated/themes/ShellBarSearchLegacy.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yDAAyD,CAAC;AAExG,OAAO,gBAAgB,MAAM,uFAAuF,CAAC;AACrH,OAAO,YAAY,MAAM,wCAAwC,CAAC;AAElE,6BAA6B,CAAC,GAAG,GAAG,KAAK,GAAG,GAAG,GAAG,uBAAuB,EAAE,aAAa,EAAE,KAAK,IAAI,EAAE,CAAC,gBAAgB,CAAC,CAAC;AACxH,6BAA6B,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE,aAAa,EAAE,KAAK,IAAI,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;AAC9N,eAAe;CACd,CAAA","sourcesContent":["import { registerThemePropertiesLoader } from \"@ui5/webcomponents-base/dist/asset-registries/Themes.js\";\n\nimport defaultThemeBase from \"@ui5/webcomponents-theming/dist/generated/themes/sap_horizon/parameters-bundle.css.js\";\nimport defaultTheme from \"./sap_horizon/parameters-bundle.css.js\";\n\nregisterThemePropertiesLoader(\"@\" + \"ui5\" + \"/\" + \"webcomponents-theming\", \"sap_horizon\", async () => defaultThemeBase);\nregisterThemePropertiesLoader(\"@\" + \"u\" + \"i\" + \"5\" + \"/\" + \"w\" + \"e\" + \"b\" + \"c\" + \"o\" + \"m\" + \"p\" + \"o\" + \"n\" + \"e\" + \"n\" + \"t\" + \"s\" + \"-\" + \"f\" + \"i\" + \"o\" + \"r\" + \"i\", \"sap_horizon\", async () => defaultTheme, \"host\");\nexport default `::slotted([ui5-input]){--_ui5_input_placeholder_color: var(--sapShell_InteractiveTextColor);--_ui5_input_border_radius: var(--_ui5_shellbar_input_border_radius);--_ui5_input_focus_border_radius: var(--_ui5_shellbar_input_focus_border_radius);--_ui5_input_background_color: var(--_ui5_shellbar_input_background_color);--_ui5_input_focus_outline_color: var(--_ui5_shellbar_input_focus_outline_color);--_ui5_input_margin_top_bottom: 0}::slotted([ui5-input]){background:var(--_ui5_shellbar_search_field_background);border:var(--_ui5_shellbar_search_field_border);box-shadow:var(--_ui5_shellbar_search_field_box_shadow);color:var(--_ui5_shellbar_search_field_color);height:2.25rem;width:100%;min-width:var(--_ui5_shellbar_search_field_width)}:host([breakpoint-size=\"M\"]) ::slotted([ui5-input]),:host([breakpoint-size=\"S\"]) ::slotted([ui5-input]){min-width:1rem}:host([breakpoint-size=\"M\"][show-search-field]) .ui5-shellbar-overflow-container-right-child{flex-grow:1}::slotted([ui5-input]:hover){background:var(--_ui5_shellbar_search_field_background_hover);box-shadow:var(--_ui5_shellbar_search_field_box_shadow_hover)}::slotted([ui5-input][focused]){outline:var(--_ui5_shellbar_search_field_outline_focused)}\n`"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for ShellBar search controllers.
|
|
3
|
+
*/
|
|
4
|
+
export interface IShellBarSearchController {
|
|
5
|
+
/**
|
|
6
|
+
* Subscribe to search field events.
|
|
7
|
+
*/
|
|
8
|
+
subscribe(): void;
|
|
9
|
+
/**
|
|
10
|
+
* Unsubscribe from search field events.
|
|
11
|
+
*/
|
|
12
|
+
unsubscribe(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Auto-collapse or expand search based on available space.
|
|
15
|
+
* @param hiddenItems Number of items currently hidden due to overflow
|
|
16
|
+
* @param availableSpace Available space in pixels (spacer width)
|
|
17
|
+
*/
|
|
18
|
+
autoManageSearchState(hiddenItems: number, availableSpace: number): void;
|
|
19
|
+
/**
|
|
20
|
+
* Sync component state (showSearchField) to search field.
|
|
21
|
+
*/
|
|
22
|
+
syncShowSearchFieldState(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Check if full-screen search should be shown.
|
|
25
|
+
* Returns true when shellbar is overflowing AND search is visible.
|
|
26
|
+
*/
|
|
27
|
+
shouldShowFullScreen(): boolean;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IShellBarSearchController.js","sourceRoot":"","sources":["../../src/shellbar/IShellBarSearchController.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Interface for ShellBar search controllers.\n */\nexport interface IShellBarSearchController {\n\t/**\n\t * Subscribe to search field events.\n\t */\n\tsubscribe(): void;\n\n\t/**\n\t * Unsubscribe from search field events.\n\t */\n\tunsubscribe(): void;\n\n\t/**\n\t * Auto-collapse or expand search based on available space.\n\t * @param hiddenItems Number of items currently hidden due to overflow\n\t * @param availableSpace Available space in pixels (spacer width)\n\t */\n\tautoManageSearchState(hiddenItems: number, availableSpace: number): void;\n\n\t/**\n\t * Sync component state (showSearchField) to search field.\n\t */\n\tsyncShowSearchFieldState(): void;\n\n\t/**\n\t * Check if full-screen search should be shown.\n\t * Returns true when shellbar is overflowing AND search is visible.\n\t */\n\tshouldShowFullScreen(): boolean;\n}\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AccessibilityAttributes, AriaRole } from "@ui5/webcomponents-base";
|
|
2
|
+
type ShellBarLogoAccessibilityAttributes = {
|
|
3
|
+
role?: Extract<AriaRole, "button" | "link">;
|
|
4
|
+
name?: string;
|
|
5
|
+
};
|
|
6
|
+
type ShellBarProfileAccessibilityAttributes = Pick<AccessibilityAttributes, "name" | "expanded" | "hasPopup">;
|
|
7
|
+
type ShellBarAreaAccessibilityAttributes = Pick<AccessibilityAttributes, "hasPopup" | "expanded">;
|
|
8
|
+
type ShellBarBrandingAccessibilityAttributes = Pick<AccessibilityAttributes, "name">;
|
|
9
|
+
type ShellBarAccessibilityAttributes = {
|
|
10
|
+
logo?: ShellBarLogoAccessibilityAttributes;
|
|
11
|
+
notifications?: ShellBarAreaAccessibilityAttributes;
|
|
12
|
+
profile?: ShellBarProfileAccessibilityAttributes;
|
|
13
|
+
product?: ShellBarAreaAccessibilityAttributes;
|
|
14
|
+
search?: ShellBarAreaAccessibilityAttributes;
|
|
15
|
+
overflow?: ShellBarAreaAccessibilityAttributes;
|
|
16
|
+
branding?: ShellBarBrandingAccessibilityAttributes;
|
|
17
|
+
};
|
|
18
|
+
interface ShellBarAreaAccessibilityInfo {
|
|
19
|
+
title: string | undefined;
|
|
20
|
+
accessibilityAttributes: {
|
|
21
|
+
name?: string;
|
|
22
|
+
hasPopup?: AccessibilityAttributes["hasPopup"];
|
|
23
|
+
expanded?: AccessibilityAttributes["expanded"];
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
type ShellBarAccessibilityInfo = {
|
|
27
|
+
notifications: ShellBarAreaAccessibilityInfo;
|
|
28
|
+
profile: ShellBarAreaAccessibilityInfo;
|
|
29
|
+
products: ShellBarAreaAccessibilityInfo;
|
|
30
|
+
overflow: ShellBarAreaAccessibilityInfo;
|
|
31
|
+
search: ShellBarAreaAccessibilityInfo;
|
|
32
|
+
};
|
|
33
|
+
declare class ShellBarAccessibility {
|
|
34
|
+
getActionsAccessibilityAttributes(defaultTexts: Record<string, string | undefined>, params: {
|
|
35
|
+
accessibilityAttributes: ShellBarAccessibilityAttributes;
|
|
36
|
+
overflowPopoverOpen: boolean;
|
|
37
|
+
}): ShellBarAccessibilityInfo;
|
|
38
|
+
getActionsRole(visibleItemsCount: number): "toolbar" | undefined;
|
|
39
|
+
getContentRole(visibleItemsCount: number): "group" | undefined;
|
|
40
|
+
}
|
|
41
|
+
export default ShellBarAccessibility;
|
|
42
|
+
export type { ShellBarAccessibilityInfo, ShellBarAreaAccessibilityInfo, ShellBarAccessibilityAttributes, ShellBarLogoAccessibilityAttributes, ShellBarAreaAccessibilityAttributes, ShellBarProfileAccessibilityAttributes, };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
class ShellBarAccessibility {
|
|
2
|
+
getActionsAccessibilityAttributes(defaultTexts, params) {
|
|
3
|
+
const { overflowPopoverOpen, accessibilityAttributes } = params;
|
|
4
|
+
const overflowExpanded = accessibilityAttributes.overflow?.expanded;
|
|
5
|
+
return {
|
|
6
|
+
notifications: {
|
|
7
|
+
title: defaultTexts.notifications,
|
|
8
|
+
accessibilityAttributes: {
|
|
9
|
+
expanded: accessibilityAttributes.notifications?.expanded,
|
|
10
|
+
hasPopup: accessibilityAttributes.notifications?.hasPopup,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
profile: {
|
|
14
|
+
title: accessibilityAttributes.profile?.name || defaultTexts.profile,
|
|
15
|
+
accessibilityAttributes: {
|
|
16
|
+
hasPopup: accessibilityAttributes.profile?.hasPopup,
|
|
17
|
+
expanded: accessibilityAttributes.profile?.expanded,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
products: {
|
|
21
|
+
title: defaultTexts.products,
|
|
22
|
+
accessibilityAttributes: {
|
|
23
|
+
hasPopup: accessibilityAttributes.product?.hasPopup,
|
|
24
|
+
expanded: accessibilityAttributes.product?.expanded,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
search: {
|
|
28
|
+
title: defaultTexts.search,
|
|
29
|
+
accessibilityAttributes: {
|
|
30
|
+
hasPopup: accessibilityAttributes.search?.hasPopup,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
overflow: {
|
|
34
|
+
title: defaultTexts.overflow,
|
|
35
|
+
accessibilityAttributes: {
|
|
36
|
+
hasPopup: accessibilityAttributes.overflow?.hasPopup || "menu",
|
|
37
|
+
expanded: overflowExpanded === undefined ? overflowPopoverOpen : overflowExpanded,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
getActionsRole(visibleItemsCount) {
|
|
43
|
+
return visibleItemsCount > 1 ? "toolbar" : undefined;
|
|
44
|
+
}
|
|
45
|
+
getContentRole(visibleItemsCount) {
|
|
46
|
+
return visibleItemsCount > 1 ? "group" : undefined;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export default ShellBarAccessibility;
|
|
50
|
+
//# sourceMappingURL=ShellBarAcc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,QAAQ,IAAI,MAAe;oBACvE,QAAQ,EAAE,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,gBAAgB;iBACjF;aACD;SACD,CAAC;IACH,CAAC;IAED,cAAc,CAAC,iBAAyB;QACvC,OAAO,iBAAiB,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;IACtD,CAAC;IAED,cAAc,CAAC,iBAAyB;QACvC,OAAO,iBAAiB,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IACpD,CAAC;CACD;AAED,eAAe,qBAAqB,CAAC","sourcesContent":["import type { AccessibilityAttributes, AriaRole } from \"@ui5/webcomponents-base\";\n\n// Legacy Type logo accessibility attributes\ntype ShellBarLogoAccessibilityAttributes = {\n\trole?: Extract<AriaRole, \"button\" | \"link\">;\n\tname?: string;\n};\n\ntype ShellBarProfileAccessibilityAttributes = Pick<AccessibilityAttributes, \"name\" | \"expanded\" | \"hasPopup\">;\ntype ShellBarAreaAccessibilityAttributes = Pick<AccessibilityAttributes, \"hasPopup\" | \"expanded\">;\ntype ShellBarBrandingAccessibilityAttributes = Pick<AccessibilityAttributes, \"name\">;\n\ntype ShellBarAccessibilityAttributes = {\n\tlogo?: ShellBarLogoAccessibilityAttributes;\n\tnotifications?: ShellBarAreaAccessibilityAttributes;\n\tprofile?: ShellBarProfileAccessibilityAttributes;\n\tproduct?: ShellBarAreaAccessibilityAttributes;\n\tsearch?: ShellBarAreaAccessibilityAttributes;\n\toverflow?: ShellBarAreaAccessibilityAttributes;\n\tbranding?: ShellBarBrandingAccessibilityAttributes;\n};\n\ninterface ShellBarAreaAccessibilityInfo {\n\ttitle: string | undefined;\n\taccessibilityAttributes: {\n\t\tname?: string;\n\t\thasPopup?: AccessibilityAttributes[\"hasPopup\"];\n\t\texpanded?: AccessibilityAttributes[\"expanded\"];\n\t};\n}\n\ntype ShellBarAccessibilityInfo = {\n\tnotifications: ShellBarAreaAccessibilityInfo;\n\tprofile: ShellBarAreaAccessibilityInfo;\n\tproducts: ShellBarAreaAccessibilityInfo;\n\toverflow: ShellBarAreaAccessibilityInfo;\n\tsearch: ShellBarAreaAccessibilityInfo;\n};\n\nclass ShellBarAccessibility {\n\tgetActionsAccessibilityAttributes(\n\t\tdefaultTexts: Record<string, string | undefined>,\n\t\tparams: {\n\t\t\taccessibilityAttributes: ShellBarAccessibilityAttributes;\n\t\t\toverflowPopoverOpen: boolean;\n\t\t},\n\t): ShellBarAccessibilityInfo {\n\t\tconst { overflowPopoverOpen, accessibilityAttributes } = params;\n\t\tconst overflowExpanded = accessibilityAttributes.overflow?.expanded;\n\n\t\treturn {\n\t\t\tnotifications: {\n\t\t\t\ttitle: defaultTexts.notifications,\n\t\t\t\taccessibilityAttributes: {\n\t\t\t\t\texpanded: accessibilityAttributes.notifications?.expanded,\n\t\t\t\t\thasPopup: accessibilityAttributes.notifications?.hasPopup,\n\t\t\t\t},\n\t\t\t},\n\t\t\tprofile: {\n\t\t\t\ttitle: accessibilityAttributes.profile?.name || defaultTexts.profile,\n\t\t\t\taccessibilityAttributes: {\n\t\t\t\t\thasPopup: accessibilityAttributes.profile?.hasPopup,\n\t\t\t\t\texpanded: accessibilityAttributes.profile?.expanded,\n\t\t\t\t},\n\t\t\t},\n\t\t\tproducts: {\n\t\t\t\ttitle: defaultTexts.products,\n\t\t\t\taccessibilityAttributes: {\n\t\t\t\t\thasPopup: accessibilityAttributes.product?.hasPopup,\n\t\t\t\t\texpanded: accessibilityAttributes.product?.expanded,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsearch: {\n\t\t\t\ttitle: defaultTexts.search,\n\t\t\t\taccessibilityAttributes: {\n\t\t\t\t\thasPopup: accessibilityAttributes.search?.hasPopup,\n\t\t\t\t},\n\t\t\t},\n\t\t\toverflow: {\n\t\t\t\ttitle: defaultTexts.overflow,\n\t\t\t\taccessibilityAttributes: {\n\t\t\t\t\thasPopup: accessibilityAttributes.overflow?.hasPopup || \"menu\" as const,\n\t\t\t\t\texpanded: overflowExpanded === undefined ? overflowPopoverOpen : overflowExpanded,\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\tgetActionsRole(visibleItemsCount: number): \"toolbar\" | undefined {\n\t\treturn visibleItemsCount > 1 ? \"toolbar\" : undefined;\n\t}\n\n\tgetContentRole(visibleItemsCount: number): \"group\" | undefined {\n\t\treturn visibleItemsCount > 1 ? \"group\" : undefined;\n\t}\n}\n\nexport default ShellBarAccessibility;\n\nexport type {\n\tShellBarAccessibilityInfo,\n\tShellBarAreaAccessibilityInfo,\n\tShellBarAccessibilityAttributes,\n\tShellBarLogoAccessibilityAttributes,\n\tShellBarAreaAccessibilityAttributes,\n\tShellBarProfileAccessibilityAttributes,\n};\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface ShellBarItemNavigationConstructorParams {
|
|
2
|
+
getDomRef: () => HTMLElement | null;
|
|
3
|
+
}
|
|
4
|
+
declare class ShellBarItemNavigation {
|
|
5
|
+
private params;
|
|
6
|
+
constructor(params: ShellBarItemNavigationConstructorParams);
|
|
7
|
+
handleKeyDown(e: KeyboardEvent): void;
|
|
8
|
+
private shouldHandle;
|
|
9
|
+
private shouldChildHandleNavigation;
|
|
10
|
+
private shouldInputHandleNavigation;
|
|
11
|
+
private getTabbableItems;
|
|
12
|
+
private isVisible;
|
|
13
|
+
private navigateToItem;
|
|
14
|
+
private focusPrevious;
|
|
15
|
+
private focusNext;
|
|
16
|
+
}
|
|
17
|
+
export default ShellBarItemNavigation;
|
|
18
|
+
export type { ShellBarItemNavigationConstructorParams, };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { isEnd, isHome, isLeft, isRight, } from "@ui5/webcomponents-base/dist/Keys.js";
|
|
2
|
+
import { getTabbableElements } from "@ui5/webcomponents-base/dist/util/TabbableElements.js";
|
|
3
|
+
import getActiveElement from "@ui5/webcomponents-base/dist/util/getActiveElement.js";
|
|
4
|
+
class ShellBarItemNavigation {
|
|
5
|
+
constructor(params) {
|
|
6
|
+
this.params = params;
|
|
7
|
+
}
|
|
8
|
+
handleKeyDown(e) {
|
|
9
|
+
if (!this.shouldHandle(e)) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const domRef = this.params.getDomRef();
|
|
13
|
+
if (!domRef) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const activeElement = getActiveElement();
|
|
17
|
+
if (!activeElement) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (this.shouldChildHandleNavigation(activeElement, e)) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const items = this.getTabbableItems(domRef);
|
|
24
|
+
const currentIndex = items.findIndex(el => el === activeElement);
|
|
25
|
+
if (currentIndex !== -1) {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
this.navigateToItem(items, currentIndex, e);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
shouldHandle(e) {
|
|
31
|
+
return isLeft(e) || isRight(e) || isHome(e) || isEnd(e);
|
|
32
|
+
}
|
|
33
|
+
shouldChildHandleNavigation(element, e) {
|
|
34
|
+
if (element.tagName === "INPUT" || element.tagName === "TEXTAREA") {
|
|
35
|
+
return this.shouldInputHandleNavigation(element, e);
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
shouldInputHandleNavigation(input, e) {
|
|
40
|
+
const cursorPos = input.selectionStart || 0;
|
|
41
|
+
const textLength = input.value.length;
|
|
42
|
+
if (isLeft(e) && cursorPos > 0) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
if (isRight(e) && cursorPos < textLength) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
getTabbableItems(domRef) {
|
|
51
|
+
return getTabbableElements(domRef).filter(el => this.isVisible(el));
|
|
52
|
+
}
|
|
53
|
+
isVisible(element) {
|
|
54
|
+
const style = getComputedStyle(element);
|
|
55
|
+
return style.display !== "none"
|
|
56
|
+
&& style.visibility !== "hidden"
|
|
57
|
+
&& element.offsetWidth > 0
|
|
58
|
+
&& element.offsetHeight > 0;
|
|
59
|
+
}
|
|
60
|
+
navigateToItem(items, currentIndex, e) {
|
|
61
|
+
if (isLeft(e)) {
|
|
62
|
+
this.focusPrevious(items, currentIndex);
|
|
63
|
+
}
|
|
64
|
+
else if (isRight(e)) {
|
|
65
|
+
this.focusNext(items, currentIndex);
|
|
66
|
+
}
|
|
67
|
+
else if (isHome(e)) {
|
|
68
|
+
items[0]?.focus();
|
|
69
|
+
}
|
|
70
|
+
else if (isEnd(e)) {
|
|
71
|
+
items[items.length - 1]?.focus();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
focusPrevious(items, currentIndex) {
|
|
75
|
+
if (currentIndex > 0) {
|
|
76
|
+
items[currentIndex - 1].focus();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
focusNext(items, currentIndex) {
|
|
80
|
+
if (currentIndex < items.length - 1) {
|
|
81
|
+
items[currentIndex + 1].focus();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export default ShellBarItemNavigation;
|
|
86
|
+
//# sourceMappingURL=ShellBarItemNavigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShellBarItemNavigation.js","sourceRoot":"","sources":["../../src/shellbar/ShellBarItemNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,EACL,MAAM,EACN,MAAM,EACN,OAAO,GACP,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAC5F,OAAO,gBAAgB,MAAM,uDAAuD,CAAC;AAMrF,MAAM,sBAAsB;IAG3B,YAAY,MAA+C;QAC1D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,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AI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACrB,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;QAClC,CAAC;IACF,CAAC;IAEO,aAAa,CAAC,KAAoB,EAAE,YAAoB;QAC/D,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;YACtB,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QACjC,CAAC;IACF,CAAC;IAEO,SAAS,CAAC,KAAoB,EAAE,YAAoB;QAC3D,IAAI,YAAY,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrC,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QACjC,CAAC;IACF,CAAC;CACD;AAED,eAAe,sBAAsB,CAAC","sourcesContent":["import {\n\tisEnd,\n\tisHome,\n\tisLeft,\n\tisRight,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport { getTabbableElements } from \"@ui5/webcomponents-base/dist/util/TabbableElements.js\";\nimport getActiveElement from \"@ui5/webcomponents-base/dist/util/getActiveElement.js\";\n\ninterface ShellBarItemNavigationConstructorParams {\n\tgetDomRef: () => HTMLElement | null;\n}\n\nclass ShellBarItemNavigation {\n\tprivate params: ShellBarItemNavigationConstructorParams;\n\n\tconstructor(params: ShellBarItemNavigationConstructorParams) {\n\t\tthis.params = params;\n\t}\n\n\thandleKeyDown(e: KeyboardEvent): void {\n\t\tif (!this.shouldHandle(e)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst domRef = this.params.getDomRef();\n\t\tif (!domRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst activeElement = getActiveElement();\n\t\tif (!activeElement) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.shouldChildHandleNavigation(activeElement as HTMLElement, e)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst items = this.getTabbableItems(domRef);\n\t\tconst currentIndex = items.findIndex(el => el === activeElement);\n\n\t\tif (currentIndex !== -1) {\n\t\t\te.preventDefault();\n\t\t\tthis.navigateToItem(items, currentIndex, e);\n\t\t}\n\t}\n\n\tprivate shouldHandle(e: KeyboardEvent): boolean {\n\t\treturn isLeft(e) || isRight(e) || isHome(e) || isEnd(e);\n\t}\n\n\tprivate shouldChildHandleNavigation(element: HTMLElement, e: KeyboardEvent): boolean {\n\t\tif (element.tagName === \"INPUT\" || element.tagName === \"TEXTAREA\") {\n\t\t\treturn this.shouldInputHandleNavigation(element as HTMLInputElement | HTMLTextAreaElement, e);\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate shouldInputHandleNavigation(input: HTMLInputElement | HTMLTextAreaElement, e: KeyboardEvent): boolean {\n\t\tconst cursorPos = input.selectionStart || 0;\n\t\tconst textLength = input.value.length;\n\n\t\tif (isLeft(e) && cursorPos > 0) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (isRight(e) && cursorPos < textLength) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprivate getTabbableItems(domRef: HTMLElement): HTMLElement[] {\n\t\treturn getTabbableElements(domRef).filter(el => this.isVisible(el));\n\t}\n\n\tprivate isVisible(element: HTMLElement): boolean {\n\t\tconst style = getComputedStyle(element);\n\t\treturn style.display !== \"none\"\n\t\t\t&& style.visibility !== \"hidden\"\n\t\t\t&& element.offsetWidth > 0\n\t\t\t&& element.offsetHeight > 0;\n\t}\n\n\tprivate navigateToItem(items: HTMLElement[], currentIndex: number, e: KeyboardEvent): void {\n\t\tif (isLeft(e)) {\n\t\t\tthis.focusPrevious(items, currentIndex);\n\t\t} else if (isRight(e)) {\n\t\t\tthis.focusNext(items, currentIndex);\n\t\t} else if (isHome(e)) {\n\t\t\titems[0]?.focus();\n\t\t} else if (isEnd(e)) {\n\t\t\titems[items.length - 1]?.focus();\n\t\t}\n\t}\n\n\tprivate focusPrevious(items: HTMLElement[], currentIndex: number): void {\n\t\tif (currentIndex > 0) {\n\t\t\titems[currentIndex - 1].focus();\n\t\t}\n\t}\n\n\tprivate focusNext(items: HTMLElement[], currentIndex: number): void {\n\t\tif (currentIndex < items.length - 1) {\n\t\t\titems[currentIndex + 1].focus();\n\t\t}\n\t}\n}\n\nexport default ShellBarItemNavigation;\nexport type {\n\tShellBarItemNavigationConstructorParams,\n};\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ListItemClickEventDetail } from "@ui5/webcomponents/dist/List.js";
|
|
2
|
+
import type ShellBar from "../ShellBar.js";
|
|
3
|
+
type ShellBarLegacyDeps = {
|
|
4
|
+
component: ShellBar;
|
|
5
|
+
getShadowRoot: () => ShadowRoot | null;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Controller for legacy ShellBar features that will be removed in future versions.
|
|
9
|
+
* Handles: logo slot, primaryTitle/secondaryTitle properties, menuItems slot.
|
|
10
|
+
*/
|
|
11
|
+
declare class ShellBarLegacy {
|
|
12
|
+
private component;
|
|
13
|
+
private getShadowRoot;
|
|
14
|
+
handleLogoClickBound: () => void;
|
|
15
|
+
handleLogoKeyupBound: (e: KeyboardEvent) => void;
|
|
16
|
+
handleLogoKeydownBound: (e: KeyboardEvent) => void;
|
|
17
|
+
handleMenuItemClickBound: (e: CustomEvent<ListItemClickEventDetail>) => void;
|
|
18
|
+
handleMenuButtonClickBound: () => void;
|
|
19
|
+
handleMenuPopoverBeforeOpenBound: () => void;
|
|
20
|
+
handleMenuPopoverAfterCloseBound: () => void;
|
|
21
|
+
constructor(deps: ShellBarLegacyDeps);
|
|
22
|
+
handleMenuButtonClick(): void;
|
|
23
|
+
handleMenuItemClick(e: CustomEvent<ListItemClickEventDetail>): void;
|
|
24
|
+
handleMenuPopoverBeforeOpen(): void;
|
|
25
|
+
handleMenuPopoverAfterClose(): void;
|
|
26
|
+
private getMenuPopover;
|
|
27
|
+
get hasMenuItems(): boolean;
|
|
28
|
+
get menuPopoverExpanded(): boolean;
|
|
29
|
+
handleLogoClick(): void;
|
|
30
|
+
handleLogoKeydown(e: KeyboardEvent): void;
|
|
31
|
+
handleLogoKeyup(e: KeyboardEvent): void;
|
|
32
|
+
get hasLogo(): boolean;
|
|
33
|
+
get logoRole(): "button" | "link";
|
|
34
|
+
get logoAriaLabel(): string;
|
|
35
|
+
get brandingText(): string;
|
|
36
|
+
get hasPrimaryTitle(): boolean;
|
|
37
|
+
get hasSecondaryTitle(): boolean;
|
|
38
|
+
get showSecondaryTitle(): boolean;
|
|
39
|
+
get primaryTitle(): string;
|
|
40
|
+
get secondaryTitle(): string;
|
|
41
|
+
get showMenuButton(): boolean;
|
|
42
|
+
get showLogoInMenuButton(): boolean;
|
|
43
|
+
get showTitleInMenuButton(): boolean;
|
|
44
|
+
get isSBreakPoint(): boolean;
|
|
45
|
+
}
|
|
46
|
+
export default ShellBarLegacy;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { isSpace, isEnter, } from "@ui5/webcomponents-base/dist/Keys.js";
|
|
2
|
+
import List from "@ui5/webcomponents/dist/List.js";
|
|
3
|
+
/**
|
|
4
|
+
* Controller for legacy ShellBar features that will be removed in future versions.
|
|
5
|
+
* Handles: logo slot, primaryTitle/secondaryTitle properties, menuItems slot.
|
|
6
|
+
*/
|
|
7
|
+
class ShellBarLegacy {
|
|
8
|
+
constructor(deps) {
|
|
9
|
+
// Bound handlers for event listeners
|
|
10
|
+
this.handleLogoClickBound = this.handleLogoClick.bind(this);
|
|
11
|
+
this.handleLogoKeyupBound = this.handleLogoKeyup.bind(this);
|
|
12
|
+
this.handleLogoKeydownBound = this.handleLogoKeydown.bind(this);
|
|
13
|
+
this.handleMenuItemClickBound = this.handleMenuItemClick.bind(this);
|
|
14
|
+
this.handleMenuButtonClickBound = this.handleMenuButtonClick.bind(this);
|
|
15
|
+
this.handleMenuPopoverBeforeOpenBound = this.handleMenuPopoverBeforeOpen.bind(this);
|
|
16
|
+
this.handleMenuPopoverAfterCloseBound = this.handleMenuPopoverAfterClose.bind(this);
|
|
17
|
+
this.component = deps.component;
|
|
18
|
+
this.getShadowRoot = deps.getShadowRoot;
|
|
19
|
+
}
|
|
20
|
+
/* ------------- Menu Management -------------- */
|
|
21
|
+
handleMenuButtonClick() {
|
|
22
|
+
const shadowRoot = this.getShadowRoot();
|
|
23
|
+
if (!shadowRoot) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const menuButton = shadowRoot.querySelector(".ui5-shellbar-menu-button");
|
|
27
|
+
const menuPopover = this.getMenuPopover();
|
|
28
|
+
if (menuPopover && menuButton) {
|
|
29
|
+
menuPopover.opener = menuButton;
|
|
30
|
+
menuPopover.open = true;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
handleMenuItemClick(e) {
|
|
34
|
+
const shouldContinue = this.component.fireDecoratorEvent("menu-item-click", {
|
|
35
|
+
item: e.detail.item,
|
|
36
|
+
});
|
|
37
|
+
if (shouldContinue) {
|
|
38
|
+
const menuPopover = this.getMenuPopover();
|
|
39
|
+
if (menuPopover) {
|
|
40
|
+
menuPopover.open = false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
handleMenuPopoverBeforeOpen() {
|
|
45
|
+
this.component.menuPopoverOpen = true;
|
|
46
|
+
const menuPopover = this.getMenuPopover();
|
|
47
|
+
if (menuPopover?.content && menuPopover.content.length) {
|
|
48
|
+
const list = menuPopover.content[0];
|
|
49
|
+
if (list instanceof List) {
|
|
50
|
+
list.focusFirstItem();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
handleMenuPopoverAfterClose() {
|
|
55
|
+
this.component.menuPopoverOpen = false;
|
|
56
|
+
}
|
|
57
|
+
getMenuPopover() {
|
|
58
|
+
const shadowRoot = this.getShadowRoot();
|
|
59
|
+
return shadowRoot?.querySelector(".ui5-shellbar-menu-popover");
|
|
60
|
+
}
|
|
61
|
+
get hasMenuItems() {
|
|
62
|
+
return this.component.menuItems.length > 0;
|
|
63
|
+
}
|
|
64
|
+
get menuPopoverExpanded() {
|
|
65
|
+
return this.component.menuPopoverOpen;
|
|
66
|
+
}
|
|
67
|
+
/* ------------- Logo Management -------------- */
|
|
68
|
+
handleLogoClick() {
|
|
69
|
+
const shadowRoot = this.getShadowRoot();
|
|
70
|
+
if (!shadowRoot) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const logoElement = shadowRoot.querySelector(".ui5-shellbar-logo");
|
|
74
|
+
if (logoElement) {
|
|
75
|
+
this.component.fireDecoratorEvent("logo-click", {
|
|
76
|
+
targetRef: logoElement,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
handleLogoKeydown(e) {
|
|
81
|
+
if (isSpace(e)) {
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (isEnter(e)) {
|
|
86
|
+
this.handleLogoClick();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
handleLogoKeyup(e) {
|
|
90
|
+
if (isSpace(e)) {
|
|
91
|
+
this.handleLogoClick();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
get hasLogo() {
|
|
95
|
+
return this.component.logo.length > 0;
|
|
96
|
+
}
|
|
97
|
+
get logoRole() {
|
|
98
|
+
return this.component.accessibilityAttributes.logo?.role || "link";
|
|
99
|
+
}
|
|
100
|
+
get logoAriaLabel() {
|
|
101
|
+
return this.component.accessibilityAttributes.logo?.name || "Logo";
|
|
102
|
+
}
|
|
103
|
+
get brandingText() {
|
|
104
|
+
return this.component.accessibilityAttributes.branding?.name || this.primaryTitle;
|
|
105
|
+
}
|
|
106
|
+
/* ------------- Title Management -------------- */
|
|
107
|
+
get hasPrimaryTitle() {
|
|
108
|
+
return !!this.component.primaryTitle;
|
|
109
|
+
}
|
|
110
|
+
get hasSecondaryTitle() {
|
|
111
|
+
return !!this.component.secondaryTitle;
|
|
112
|
+
}
|
|
113
|
+
get showSecondaryTitle() {
|
|
114
|
+
return this.hasSecondaryTitle && !this.component.isSBreakPoint;
|
|
115
|
+
}
|
|
116
|
+
get primaryTitle() {
|
|
117
|
+
return this.component.primaryTitle || "";
|
|
118
|
+
}
|
|
119
|
+
get secondaryTitle() {
|
|
120
|
+
return this.component.secondaryTitle || "";
|
|
121
|
+
}
|
|
122
|
+
/* ------------- Menu Button -------------- */
|
|
123
|
+
get showMenuButton() {
|
|
124
|
+
return this.hasPrimaryTitle || this.showLogoInMenuButton;
|
|
125
|
+
}
|
|
126
|
+
get showLogoInMenuButton() {
|
|
127
|
+
return this.hasLogo && this.isSBreakPoint;
|
|
128
|
+
}
|
|
129
|
+
get showTitleInMenuButton() {
|
|
130
|
+
return this.hasPrimaryTitle && !this.showLogoInMenuButton;
|
|
131
|
+
}
|
|
132
|
+
/* ------------- Common -------------- */
|
|
133
|
+
get isSBreakPoint() {
|
|
134
|
+
return this.component.isSBreakPoint;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
export default ShellBarLegacy;
|
|
138
|
+
//# sourceMappingURL=ShellBarLegacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShellBarLegacy.js","sourceRoot":"","sources":["../../src/shellbar/ShellBarLegacy.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,OAAO,EACP,OAAO,GACP,MAAM,sCAAsC,CAAC;AAG9C,OAAO,IAAI,MAAM,iCAAiC,CAAC;AAQnD;;;GAGG;AACH,MAAM,cAAc;IAanB,YAAY,IAAwB;QATpC,qCAAqC;QACrC,yBAAoB,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvD,yBAAoB,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvD,2BAAsB,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3D,6BAAwB,GAAG,IAAI,CAAC,mBAAmB,CAAC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I,CAAC,oBAAoB,CAAC;IAC1D,CAAC;IAED,IAAI,oBAAoB;QACvB,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,aAAa,CAAC;IAC3C,CAAC;IAED,IAAI,qBAAqB;QACxB,OAAO,IAAI,CAAC,eAAe,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC;IAC3D,CAAC;IAED,yCAAyC;IAEzC,IAAI,aAAa;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;IACrC,CAAC;CACD;AAED,eAAe,cAAc,CAAC","sourcesContent":["import {\n\tisSpace,\n\tisEnter,\n} from \"@ui5/webcomponents-base/dist/Keys.js\";\nimport type { ListItemClickEventDetail } from \"@ui5/webcomponents/dist/List.js\";\nimport type ShellBar from \"../ShellBar.js\";\nimport List from \"@ui5/webcomponents/dist/List.js\";\nimport type Popover from \"@ui5/webcomponents/dist/Popover.js\";\n\ntype ShellBarLegacyDeps = {\n\tcomponent: ShellBar;\n\tgetShadowRoot: () => ShadowRoot | null;\n};\n\n/**\n * Controller for legacy ShellBar features that will be removed in future versions.\n * Handles: logo slot, primaryTitle/secondaryTitle properties, menuItems slot.\n */\nclass ShellBarLegacy {\n\tprivate component: ShellBar;\n\tprivate getShadowRoot: () => ShadowRoot | null;\n\n\t// Bound handlers for event listeners\n\thandleLogoClickBound = this.handleLogoClick.bind(this);\n\thandleLogoKeyupBound = this.handleLogoKeyup.bind(this);\n\thandleLogoKeydownBound = this.handleLogoKeydown.bind(this);\n\thandleMenuItemClickBound = this.handleMenuItemClick.bind(this);\n\thandleMenuButtonClickBound = this.handleMenuButtonClick.bind(this);\n\thandleMenuPopoverBeforeOpenBound = this.handleMenuPopoverBeforeOpen.bind(this);\n\thandleMenuPopoverAfterCloseBound = this.handleMenuPopoverAfterClose.bind(this);\n\n\tconstructor(deps: ShellBarLegacyDeps) {\n\t\tthis.component = deps.component;\n\t\tthis.getShadowRoot = deps.getShadowRoot;\n\t}\n\n\t/* ------------- Menu Management -------------- */\n\n\thandleMenuButtonClick() {\n\t\tconst shadowRoot = this.getShadowRoot();\n\t\tif (!shadowRoot) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst menuButton = shadowRoot.querySelector(\".ui5-shellbar-menu-button\");\n\t\tconst menuPopover = this.getMenuPopover();\n\n\t\tif (menuPopover && menuButton) {\n\t\t\tmenuPopover.opener = menuButton as HTMLElement;\n\t\t\tmenuPopover.open = true;\n\t\t}\n\t}\n\n\thandleMenuItemClick(e: CustomEvent<ListItemClickEventDetail>) {\n\t\tconst shouldContinue = this.component.fireDecoratorEvent(\"menu-item-click\", {\n\t\t\titem: e.detail.item,\n\t\t});\n\n\t\tif (shouldContinue) {\n\t\t\tconst menuPopover = this.getMenuPopover();\n\t\t\tif (menuPopover) {\n\t\t\t\tmenuPopover.open = false;\n\t\t\t}\n\t\t}\n\t}\n\n\thandleMenuPopoverBeforeOpen() {\n\t\tthis.component.menuPopoverOpen = true;\n\t\tconst menuPopover = this.getMenuPopover();\n\t\tif (menuPopover?.content && menuPopover.content.length) {\n\t\t\tconst list = menuPopover.content[0];\n\t\t\tif (list instanceof List) {\n\t\t\t\tlist.focusFirstItem();\n\t\t\t}\n\t\t}\n\t}\n\n\thandleMenuPopoverAfterClose() {\n\t\tthis.component.menuPopoverOpen = false;\n\t}\n\n\tprivate getMenuPopover() {\n\t\tconst shadowRoot = this.getShadowRoot();\n\t\treturn shadowRoot?.querySelector<Popover>(\".ui5-shellbar-menu-popover\");\n\t}\n\n\tget hasMenuItems(): boolean {\n\t\treturn this.component.menuItems.length > 0;\n\t}\n\n\tget menuPopoverExpanded(): boolean {\n\t\treturn this.component.menuPopoverOpen;\n\t}\n\n\t/* ------------- Logo Management -------------- */\n\n\thandleLogoClick() {\n\t\tconst shadowRoot = this.getShadowRoot();\n\t\tif (!shadowRoot) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst logoElement = shadowRoot.querySelector(\".ui5-shellbar-logo\");\n\t\tif (logoElement) {\n\t\t\tthis.component.fireDecoratorEvent(\"logo-click\", {\n\t\t\t\ttargetRef: logoElement as HTMLElement,\n\t\t\t});\n\t\t}\n\t}\n\n\thandleLogoKeydown(e: KeyboardEvent) {\n\t\tif (isSpace(e)) {\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif (isEnter(e)) {\n\t\t\tthis.handleLogoClick();\n\t\t}\n\t}\n\n\thandleLogoKeyup(e: KeyboardEvent) {\n\t\tif (isSpace(e)) {\n\t\t\tthis.handleLogoClick();\n\t\t}\n\t}\n\n\tget hasLogo(): boolean {\n\t\treturn this.component.logo.length > 0;\n\t}\n\n\tget logoRole(): \"button\" | \"link\" {\n\t\treturn this.component.accessibilityAttributes.logo?.role || \"link\";\n\t}\n\n\tget logoAriaLabel(): string {\n\t\treturn this.component.accessibilityAttributes.logo?.name || \"Logo\";\n\t}\n\n\tget brandingText(): string {\n\t\treturn this.component.accessibilityAttributes.branding?.name || this.primaryTitle;\n\t}\n\n\t/* ------------- Title Management -------------- */\n\n\tget hasPrimaryTitle(): boolean {\n\t\treturn !!this.component.primaryTitle;\n\t}\n\n\tget hasSecondaryTitle(): boolean {\n\t\treturn !!this.component.secondaryTitle;\n\t}\n\n\tget showSecondaryTitle(): boolean {\n\t\treturn this.hasSecondaryTitle && !this.component.isSBreakPoint;\n\t}\n\n\tget primaryTitle(): string {\n\t\treturn this.component.primaryTitle || \"\";\n\t}\n\n\tget secondaryTitle(): string {\n\t\treturn this.component.secondaryTitle || \"\";\n\t}\n\n\t/* ------------- Menu Button -------------- */\n\n\tget showMenuButton(): boolean {\n\t\treturn this.hasPrimaryTitle || this.showLogoInMenuButton;\n\t}\n\n\tget showLogoInMenuButton(): boolean {\n\t\treturn this.hasLogo && this.isSBreakPoint;\n\t}\n\n\tget showTitleInMenuButton(): boolean {\n\t\treturn this.hasPrimaryTitle && !this.showLogoInMenuButton;\n\t}\n\n\t/* ------------- Common -------------- */\n\n\tget isSBreakPoint(): boolean {\n\t\treturn this.component.isSBreakPoint;\n\t}\n}\n\nexport default ShellBarLegacy;\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type ShellBarItem from "../ShellBarItem.js";
|
|
2
|
+
import type { ShellBarActionId, ShellBarActionItem } from "../ShellBar.js";
|
|
3
|
+
interface ShellBarHidableItem {
|
|
4
|
+
id: string;
|
|
5
|
+
selector: string;
|
|
6
|
+
hideOrder: number;
|
|
7
|
+
keepHidden: boolean;
|
|
8
|
+
showInOverflow?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface ShellBarOverflowParams {
|
|
11
|
+
actions: readonly ShellBarActionItem[];
|
|
12
|
+
content: readonly HTMLElement[];
|
|
13
|
+
customItems: readonly ShellBarItem[];
|
|
14
|
+
overflowOuter: HTMLElement;
|
|
15
|
+
overflowInner: HTMLElement;
|
|
16
|
+
hiddenItemsIds: readonly string[];
|
|
17
|
+
showSearchField: boolean;
|
|
18
|
+
setVisible: (selector: string, visible: boolean) => void;
|
|
19
|
+
}
|
|
20
|
+
interface ShellBarOverflowResult {
|
|
21
|
+
hiddenItemsIds: string[];
|
|
22
|
+
showOverflowButton: boolean;
|
|
23
|
+
}
|
|
24
|
+
type ShellBarOverflowItem = {
|
|
25
|
+
type: "action";
|
|
26
|
+
id: ShellBarActionId;
|
|
27
|
+
data: ShellBarActionItem;
|
|
28
|
+
order: number;
|
|
29
|
+
} | {
|
|
30
|
+
type: "item";
|
|
31
|
+
id: string;
|
|
32
|
+
data: ShellBarItem;
|
|
33
|
+
order: number;
|
|
34
|
+
};
|
|
35
|
+
declare class ShellBarOverflow {
|
|
36
|
+
private readonly CLOSED_SEARCH_STRATEGY;
|
|
37
|
+
private readonly OPEN_SEARCH_STRATEGY;
|
|
38
|
+
updateOverflow(params: ShellBarOverflowParams): ShellBarOverflowResult;
|
|
39
|
+
isOverflowing(overflowOuter: HTMLElement, overflowInner: HTMLElement): boolean;
|
|
40
|
+
private getOverflowStrategy;
|
|
41
|
+
private buildHidableItems;
|
|
42
|
+
private buildContent;
|
|
43
|
+
private buildActions;
|
|
44
|
+
getOverflowItems(params: {
|
|
45
|
+
actions: readonly ShellBarActionItem[];
|
|
46
|
+
customItems: readonly ShellBarItem[];
|
|
47
|
+
hiddenItemsIds: readonly string[];
|
|
48
|
+
}): ReadonlyArray<ShellBarOverflowItem>;
|
|
49
|
+
}
|
|
50
|
+
export default ShellBarOverflow;
|
|
51
|
+
export type { ShellBarHidableItem, ShellBarOverflowParams, ShellBarOverflowResult, ShellBarOverflowItem, };
|