@ui5/webcomponents-base 0.0.0-9261ac932 → 0.0.0-95afb1087
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 +831 -0
- package/LICENSE.txt +201 -0
- package/README.md +7 -7
- package/cypress.config.js +1 -1
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/Assets-fetch.d.ts +1 -0
- package/dist/Assets-fetch.js +3 -0
- package/dist/Assets-fetch.js.map +1 -0
- package/dist/Assets-node.d.ts +12 -0
- package/dist/Assets-node.js +14 -0
- package/dist/Assets-node.js.map +1 -0
- package/dist/Assets.d.ts +1 -0
- package/dist/Assets.js +3 -0
- package/dist/Assets.js.map +1 -0
- package/dist/Boot.js +2 -0
- package/dist/Boot.js.map +1 -1
- package/dist/CustomElementsRegistry.d.ts +2 -1
- package/dist/CustomElementsRegistry.js +5 -2
- package/dist/CustomElementsRegistry.js.map +1 -1
- package/dist/CustomElementsScopeUtils.d.ts +4 -2
- package/dist/CustomElementsScopeUtils.js +8 -1
- package/dist/CustomElementsScopeUtils.js.map +1 -1
- package/dist/DragAndDrop.d.ts +2 -0
- package/dist/DragAndDrop.js +5 -0
- package/dist/DragAndDrop.js.map +1 -0
- package/dist/FeaturesRegistry.d.ts +1 -13
- package/dist/FeaturesRegistry.js +1 -37
- package/dist/FeaturesRegistry.js.map +1 -1
- package/dist/FontFace.js +0 -8
- package/dist/FontFace.js.map +1 -1
- package/dist/InitialConfiguration.js +7 -0
- package/dist/InitialConfiguration.js.map +1 -1
- package/dist/Keys.d.ts +4 -1
- package/dist/Keys.js +4 -1
- package/dist/Keys.js.map +1 -1
- package/dist/ManagedStyles.d.ts +4 -6
- package/dist/ManagedStyles.js +6 -16
- package/dist/ManagedStyles.js.map +1 -1
- package/dist/ScrollbarStyles.d.ts +2 -0
- package/dist/ScrollbarStyles.js +9 -0
- package/dist/ScrollbarStyles.js.map +1 -0
- package/dist/UI5Element.d.ts +48 -17
- package/dist/UI5Element.js +65 -42
- package/dist/UI5Element.js.map +1 -1
- package/dist/UI5ElementMetadata.d.ts +4 -9
- package/dist/UI5ElementMetadata.js +0 -7
- package/dist/UI5ElementMetadata.js.map +1 -1
- package/dist/asset-registries/Icons.d.ts +42 -8
- package/dist/asset-registries/Icons.js +51 -8
- package/dist/asset-registries/Icons.js.map +1 -1
- package/dist/asset-registries/Illustrations.d.ts +133 -8
- package/dist/asset-registries/Illustrations.js +82 -1
- package/dist/asset-registries/Illustrations.js.map +1 -1
- package/dist/asset-registries/LocaleData.js +2 -1
- package/dist/asset-registries/LocaleData.js.map +1 -1
- package/dist/asset-registries/Themes.d.ts +3 -6
- package/dist/asset-registries/Themes.js +1 -2
- package/dist/asset-registries/Themes.js.map +1 -1
- package/dist/config/Language.d.ts +2 -1
- package/dist/config/Language.js +12 -1
- package/dist/config/Language.js.map +1 -1
- package/dist/config/Theme.js +1 -2
- package/dist/config/Theme.js.map +1 -1
- package/dist/config/ThemeRoot.d.ts +3 -1
- package/dist/config/ThemeRoot.js +3 -1
- package/dist/config/ThemeRoot.js.map +1 -1
- package/dist/css/MultipleDragGhost.css +17 -0
- package/dist/css/OpenUI5PopupStyles.css +5 -0
- package/dist/css/ScrollbarStyles.css +3 -0
- package/dist/custom-elements-internal.json +1797 -1736
- package/dist/custom-elements.json +1424 -1301
- package/dist/decorators/bound.d.ts +1 -0
- package/dist/decorators/bound.js +34 -0
- package/dist/decorators/bound.js.map +1 -0
- package/dist/decorators/customElement.d.ts +38 -0
- package/dist/decorators/customElement.js +1 -4
- package/dist/decorators/customElement.js.map +1 -1
- package/dist/decorators/event-strict.d.ts +15 -0
- package/dist/decorators/event-strict.js +26 -0
- package/dist/decorators/event-strict.js.map +1 -0
- package/dist/decorators/event.d.ts +1 -0
- package/dist/decorators/event.js +1 -0
- package/dist/decorators/event.js.map +1 -1
- package/dist/decorators/i18n.js +6 -0
- package/dist/decorators/i18n.js.map +1 -1
- package/dist/decorators.d.ts +4 -1
- package/dist/decorators.js +4 -1
- package/dist/decorators.js.map +1 -1
- package/dist/features/F6Navigation.d.ts +1 -0
- package/dist/features/F6Navigation.js +39 -12
- package/dist/features/F6Navigation.js.map +1 -1
- package/dist/features/OpenUI5Enablement.d.ts +1 -1
- package/dist/features/OpenUI5Support.d.ts +5 -0
- package/dist/features/OpenUI5Support.js +42 -29
- package/dist/features/OpenUI5Support.js.map +1 -1
- package/dist/features/insertOpenUI5PopupStyles.d.ts +2 -0
- package/dist/features/insertOpenUI5PopupStyles.js +9 -0
- package/dist/features/insertOpenUI5PopupStyles.js.map +1 -0
- package/dist/features/patchPopup.d.ts +17 -4
- package/dist/features/patchPopup.js +67 -8
- package/dist/features/patchPopup.js.map +1 -1
- package/dist/generated/AssetParameters.js +1 -1
- package/dist/generated/AssetParameters.js.map +1 -1
- package/dist/generated/VersionInfo.js +6 -6
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -0
- package/dist/generated/css/BusyIndicator.css.d.ts +2 -3
- package/dist/generated/css/BusyIndicator.css.js +1 -6
- package/dist/generated/css/BusyIndicator.css.js.map +1 -1
- package/dist/generated/css/FontFace.css.d.ts +2 -3
- package/dist/generated/css/FontFace.css.js +36 -6
- package/dist/generated/css/FontFace.css.js.map +1 -1
- package/dist/generated/css/MultipleDragGhost.css.d.ts +2 -0
- package/dist/generated/css/MultipleDragGhost.css.js +2 -0
- package/dist/generated/css/MultipleDragGhost.css.js.map +1 -0
- package/dist/generated/css/OpenUI5PopupStyles.css.d.ts +2 -0
- package/dist/generated/css/OpenUI5PopupStyles.css.js +2 -0
- package/dist/generated/css/OpenUI5PopupStyles.css.js.map +1 -0
- package/dist/generated/css/ScrollbarStyles.css.d.ts +2 -0
- package/dist/generated/css/ScrollbarStyles.css.js +2 -0
- package/dist/generated/css/ScrollbarStyles.css.js.map +1 -0
- package/dist/generated/css/SystemCSSVars.css.d.ts +2 -3
- package/dist/generated/css/SystemCSSVars.css.js +1 -6
- package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/generated/i18n/i18n-defaults.d.ts +3 -0
- package/dist/generated/i18n/i18n-defaults.js +3 -0
- package/dist/generated/i18n/i18n-defaults.js.map +1 -0
- package/dist/generated/json-imports/i18n-fetch.d.ts +1 -0
- package/dist/generated/json-imports/i18n-fetch.js +2 -0
- package/dist/generated/json-imports/i18n-fetch.js.map +1 -0
- package/dist/generated/json-imports/i18n-node.d.ts +1 -0
- package/dist/generated/json-imports/i18n-node.js +2 -0
- package/dist/generated/json-imports/i18n-node.js.map +1 -0
- package/dist/generated/json-imports/i18n.d.ts +1 -0
- package/dist/generated/json-imports/i18n.js +2 -0
- package/dist/generated/json-imports/i18n.js.map +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx-dev-runtime.d.ts +4 -0
- package/dist/jsx-dev-runtime.js +43 -0
- package/dist/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx-runtime.d.ts +51 -0
- package/dist/jsx-runtime.js +27 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/jsx-utils.d.ts +3 -0
- package/dist/jsx-utils.js +48 -0
- package/dist/jsx-utils.js.map +1 -0
- package/dist/locale/nextFallbackLocale.js +6 -2
- package/dist/locale/nextFallbackLocale.js.map +1 -1
- package/dist/prod/Assets-fetch.js +2 -0
- package/dist/prod/Assets-fetch.js.map +7 -0
- package/dist/prod/Assets-node.js +2 -0
- package/dist/prod/Assets-node.js.map +7 -0
- package/dist/prod/Assets.js +2 -0
- package/dist/prod/Assets.js.map +7 -0
- package/dist/prod/Boot.js +1 -1
- package/dist/prod/Boot.js.map +3 -3
- package/dist/prod/CustomElementsRegistry.js +5 -5
- package/dist/prod/CustomElementsRegistry.js.map +3 -3
- package/dist/prod/CustomElementsScopeUtils.js +1 -1
- package/dist/prod/CustomElementsScopeUtils.js.map +3 -3
- package/dist/prod/DragAndDrop.js +2 -0
- package/dist/prod/DragAndDrop.js.map +7 -0
- package/dist/prod/FeaturesRegistry.js +1 -1
- package/dist/prod/FeaturesRegistry.js.map +3 -3
- package/dist/prod/FontFace.js +1 -1
- package/dist/prod/FontFace.js.map +3 -3
- package/dist/prod/InitialConfiguration.js +1 -1
- package/dist/prod/InitialConfiguration.js.map +2 -2
- package/dist/prod/Keys.js +1 -1
- package/dist/prod/Keys.js.map +3 -3
- package/dist/prod/ManagedStyles.js +1 -1
- package/dist/prod/ManagedStyles.js.map +3 -3
- package/dist/prod/ScrollbarStyles.js +2 -0
- package/dist/prod/ScrollbarStyles.js.map +7 -0
- package/dist/prod/UI5Element.js +1 -1
- package/dist/prod/UI5Element.js.map +3 -3
- package/dist/prod/UI5ElementMetadata.js +1 -1
- package/dist/prod/UI5ElementMetadata.js.map +2 -2
- package/dist/prod/asset-registries/Icons.js +1 -1
- package/dist/prod/asset-registries/Icons.js.map +3 -3
- package/dist/prod/asset-registries/Illustrations.js +1 -1
- package/dist/prod/asset-registries/Illustrations.js.map +3 -3
- package/dist/prod/asset-registries/LocaleData.js +1 -1
- package/dist/prod/asset-registries/LocaleData.js.map +2 -2
- package/dist/prod/asset-registries/Themes.js +1 -1
- package/dist/prod/asset-registries/Themes.js.map +2 -2
- package/dist/prod/config/Language.js +1 -1
- package/dist/prod/config/Language.js.map +3 -3
- package/dist/prod/config/Theme.js +1 -1
- package/dist/prod/config/Theme.js.map +3 -3
- package/dist/prod/config/ThemeRoot.js.map +2 -2
- package/dist/prod/decorators/bound.js +2 -0
- package/dist/prod/decorators/bound.js.map +7 -0
- package/dist/prod/decorators/customElement.js +1 -1
- package/dist/prod/decorators/customElement.js.map +3 -3
- package/dist/prod/decorators/event-strict.js +2 -0
- package/dist/prod/decorators/event-strict.js.map +7 -0
- package/dist/prod/decorators/event.js.map +2 -2
- package/dist/prod/decorators/i18n.js +1 -1
- package/dist/prod/decorators/i18n.js.map +2 -2
- package/dist/prod/decorators.js +1 -1
- package/dist/prod/decorators.js.map +3 -3
- package/dist/prod/features/F6Navigation.js +1 -1
- package/dist/prod/features/F6Navigation.js.map +3 -3
- package/dist/prod/features/OpenUI5Support.js +1 -1
- package/dist/prod/features/OpenUI5Support.js.map +3 -3
- package/dist/prod/features/insertOpenUI5PopupStyles.js +2 -0
- package/dist/prod/features/insertOpenUI5PopupStyles.js.map +7 -0
- package/dist/prod/features/patchPopup.js +1 -1
- package/dist/prod/features/patchPopup.js.map +3 -3
- package/dist/prod/generated/AssetParameters.js +1 -1
- package/dist/prod/generated/AssetParameters.js.map +2 -2
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +2 -2
- package/dist/prod/generated/assets/i18n/messagebundle_en.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -0
- package/dist/prod/generated/css/BusyIndicator.css.js +1 -1
- package/dist/prod/generated/css/BusyIndicator.css.js.map +3 -3
- package/dist/prod/generated/css/FontFace.css.js +36 -1
- package/dist/prod/generated/css/FontFace.css.js.map +3 -3
- package/dist/prod/generated/css/MultipleDragGhost.css.js +2 -0
- package/dist/prod/generated/css/MultipleDragGhost.css.js.map +7 -0
- package/dist/prod/generated/css/OpenUI5PopupStyles.css.js +2 -0
- package/dist/prod/generated/css/OpenUI5PopupStyles.css.js.map +7 -0
- package/dist/prod/generated/css/ScrollbarStyles.css.js +2 -0
- package/dist/prod/generated/css/ScrollbarStyles.css.js.map +7 -0
- package/dist/prod/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/prod/generated/css/SystemCSSVars.css.js.map +3 -3
- package/dist/prod/generated/i18n/i18n-defaults.js +2 -0
- package/dist/prod/generated/i18n/i18n-defaults.js.map +7 -0
- package/dist/prod/generated/json-imports/i18n-fetch.js +2 -0
- package/dist/prod/generated/json-imports/i18n-fetch.js.map +7 -0
- package/dist/prod/generated/json-imports/i18n-node.js +2 -0
- package/dist/prod/generated/json-imports/i18n-node.js.map +7 -0
- package/dist/prod/generated/json-imports/i18n.js +2 -0
- package/dist/prod/generated/json-imports/i18n.js.map +7 -0
- package/dist/prod/index.js +2 -0
- package/dist/prod/index.js.map +7 -0
- package/dist/prod/jsx-dev-runtime.js +2 -0
- package/dist/prod/jsx-dev-runtime.js.map +7 -0
- package/dist/prod/jsx-runtime.js +2 -0
- package/dist/prod/jsx-runtime.js.map +7 -0
- package/dist/prod/jsx-utils.js +2 -0
- package/dist/prod/jsx-utils.js.map +7 -0
- package/dist/prod/locale/nextFallbackLocale.js +1 -1
- package/dist/prod/locale/nextFallbackLocale.js.map +3 -3
- package/dist/prod/renderer/JsxRenderer.js +2 -0
- package/dist/prod/renderer/JsxRenderer.js.map +7 -0
- package/dist/prod/renderer/LitRenderer.js +1 -1
- package/dist/prod/renderer/LitRenderer.js.map +3 -3
- package/dist/prod/renderer/executeTemplate.js +1 -1
- package/dist/prod/renderer/executeTemplate.js.map +3 -3
- package/dist/prod/ssr-dom-shim.js +1 -1
- package/dist/prod/ssr-dom-shim.js.map +3 -3
- package/dist/prod/theming/applyTheme.js +1 -1
- package/dist/prod/theming/applyTheme.js.map +3 -3
- package/dist/prod/theming/getStylesString.js +1 -1
- package/dist/prod/theming/getStylesString.js.map +2 -2
- package/dist/prod/theming/getThemeDesignerTheme.js +1 -1
- package/dist/prod/theming/getThemeDesignerTheme.js.map +3 -3
- package/dist/prod/thirdparty/preact/jsx.d.js +2 -0
- package/dist/prod/thirdparty/preact/jsx.d.js.map +7 -0
- package/dist/prod/thirdparty/preact/jsxRuntime.module.d.js +2 -0
- package/dist/prod/thirdparty/preact/jsxRuntime.module.d.js.map +7 -0
- package/dist/prod/thirdparty/preact/jsxRuntime.module.js +1 -0
- package/dist/prod/thirdparty/preact/preact.module.d.js +2 -0
- package/dist/prod/thirdparty/preact/preact.module.d.js.map +7 -0
- package/dist/prod/thirdparty/preact/preact.module.js +1 -0
- package/dist/prod/types/SortOrder.js +2 -0
- package/dist/prod/types/SortOrder.js.map +7 -0
- package/dist/prod/updateShadowRoot.js +1 -1
- package/dist/prod/updateShadowRoot.js.map +3 -3
- package/dist/prod/util/AccessibilityTextsHelper.js +2 -0
- package/dist/prod/util/AccessibilityTextsHelper.js.map +7 -0
- package/dist/prod/util/ColorConversion.js +1 -1
- package/dist/prod/util/ColorConversion.js.map +3 -3
- package/dist/prod/util/FocusableElements.js +1 -1
- package/dist/prod/util/FocusableElements.js.map +3 -3
- package/dist/prod/util/HTMLSanitizer.js.map +1 -1
- package/dist/prod/util/SelectionAssistant.js +1 -1
- package/dist/prod/util/SelectionAssistant.js.map +3 -3
- package/dist/prod/util/StringHelper.js +1 -1
- package/dist/prod/util/StringHelper.js.map +3 -3
- package/dist/prod/util/TabbableElements.js +1 -1
- package/dist/prod/util/TabbableElements.js.map +2 -2
- package/dist/prod/util/dragAndDrop/DragRegistry.js +1 -1
- package/dist/prod/util/dragAndDrop/DragRegistry.js.map +3 -3
- package/dist/prod/util/dragAndDrop/findClosestPosition.js +1 -1
- package/dist/prod/util/dragAndDrop/findClosestPosition.js.map +3 -3
- package/dist/prod/util/dragAndDrop/handleDragOver.js +2 -0
- package/dist/prod/util/dragAndDrop/handleDragOver.js.map +7 -0
- package/dist/prod/util/dragAndDrop/handleDrop.js +2 -0
- package/dist/prod/util/dragAndDrop/handleDrop.js.map +7 -0
- package/dist/prod/util/getFastNavigationGroups.js +1 -1
- package/dist/prod/util/getFastNavigationGroups.js.map +2 -2
- package/dist/prod/util/getParentElement.js +1 -1
- package/dist/prod/util/getParentElement.js.map +3 -3
- package/dist/prod/util/hash2str.js +2 -0
- package/dist/prod/util/hash2str.js.map +7 -0
- package/dist/prod/util/isElementHidden.js +1 -1
- package/dist/prod/util/isElementHidden.js.map +3 -3
- package/dist/prod/util/isEventMarked.js +2 -0
- package/dist/prod/util/isEventMarked.js.map +7 -0
- package/dist/prod/util/throttle.js +2 -0
- package/dist/prod/util/throttle.js.map +7 -0
- package/dist/prod/util/toLowercaseEnumValue.js +2 -0
- package/dist/prod/util/toLowercaseEnumValue.js.map +7 -0
- package/dist/prod/util/valueStateNavigation.js +2 -0
- package/dist/prod/util/valueStateNavigation.js.map +7 -0
- package/dist/prod/validateThemeRoot.js +1 -1
- package/dist/prod/validateThemeRoot.js.map +2 -2
- package/dist/renderer/JsxRenderer.d.ts +3 -0
- package/dist/renderer/JsxRenderer.js +26 -0
- package/dist/renderer/JsxRenderer.js.map +1 -0
- package/dist/renderer/LitRenderer.js +4 -3
- package/dist/renderer/LitRenderer.js.map +1 -1
- package/dist/renderer/executeTemplate.d.ts +3 -12
- package/dist/renderer/executeTemplate.js +1 -20
- package/dist/renderer/executeTemplate.js.map +1 -1
- package/dist/ssr-dom-shim.js +52 -1
- package/dist/ssr-dom-shim.js.map +1 -1
- package/dist/theming/applyTheme.d.ts +2 -0
- package/dist/theming/applyTheme.js +21 -30
- package/dist/theming/applyTheme.js.map +1 -1
- package/dist/theming/getStylesString.js +2 -4
- package/dist/theming/getStylesString.js.map +1 -1
- package/dist/theming/getThemeDesignerTheme.js +2 -1
- package/dist/theming/getThemeDesignerTheme.js.map +1 -1
- package/dist/thirdparty/preact/jsx.d.ts +2616 -0
- package/dist/thirdparty/preact/jsxRuntime.module.d.ts +62 -0
- package/dist/thirdparty/preact/jsxRuntime.module.js +1 -0
- package/dist/thirdparty/preact/preact.module.d.ts +398 -0
- package/dist/thirdparty/preact/preact.module.js +1 -0
- package/dist/types/SortOrder.d.ts +24 -0
- package/dist/types/SortOrder.js +26 -0
- package/dist/types/SortOrder.js.map +1 -0
- package/dist/types.d.ts +30 -27
- package/dist/types.js.map +1 -1
- package/dist/updateShadowRoot.js +1 -2
- package/dist/updateShadowRoot.js.map +1 -1
- package/dist/util/{AriaLabelHelper.d.ts → AccessibilityTextsHelper.d.ts} +3 -1
- package/dist/util/{AriaLabelHelper.js → AccessibilityTextsHelper.js} +36 -8
- package/dist/util/AccessibilityTextsHelper.js.map +1 -0
- package/dist/util/ColorConversion.d.ts +2 -1
- package/dist/util/ColorConversion.js +35 -23
- package/dist/util/ColorConversion.js.map +1 -1
- package/dist/util/FocusableElements.js +43 -15
- package/dist/util/FocusableElements.js.map +1 -1
- package/dist/util/HTMLSanitizer.d.ts +2 -0
- package/dist/util/HTMLSanitizer.js +2 -2
- package/dist/util/HTMLSanitizer.js.map +1 -1
- package/dist/util/SelectionAssistant.js +0 -8
- package/dist/util/SelectionAssistant.js.map +1 -1
- package/dist/util/StringHelper.d.ts +2 -1
- package/dist/util/StringHelper.js +4 -1
- package/dist/util/StringHelper.js.map +1 -1
- package/dist/util/TabbableElements.js +2 -2
- package/dist/util/TabbableElements.js.map +1 -1
- package/dist/util/dragAndDrop/DragRegistry.d.ts +35 -8
- package/dist/util/dragAndDrop/DragRegistry.js +42 -50
- package/dist/util/dragAndDrop/DragRegistry.js.map +1 -1
- package/dist/util/dragAndDrop/findClosestPosition.d.ts +2 -1
- package/dist/util/dragAndDrop/findClosestPosition.js +45 -41
- package/dist/util/dragAndDrop/findClosestPosition.js.map +1 -1
- package/dist/util/dragAndDrop/handleDragOver.d.ts +16 -0
- package/dist/util/dragAndDrop/handleDragOver.js +42 -0
- package/dist/util/dragAndDrop/handleDragOver.js.map +1 -0
- package/dist/util/dragAndDrop/handleDrop.d.ts +5 -0
- package/dist/util/dragAndDrop/handleDrop.js +22 -0
- package/dist/util/dragAndDrop/handleDrop.js.map +1 -0
- package/dist/util/getClassCopy.d.ts +16 -5
- package/dist/util/getFastNavigationGroups.js +6 -1
- package/dist/util/getFastNavigationGroups.js.map +1 -1
- package/dist/util/getParentElement.d.ts +1 -1
- package/dist/util/getParentElement.js +2 -2
- package/dist/util/getParentElement.js.map +1 -1
- package/dist/util/hash2str.d.ts +1 -0
- package/dist/util/hash2str.js +14 -0
- package/dist/util/hash2str.js.map +1 -0
- package/dist/util/isElementHidden.js +2 -1
- package/dist/util/isElementHidden.js.map +1 -1
- package/dist/util/isEventMarked.d.ts +2 -0
- package/dist/util/isEventMarked.js +6 -0
- package/dist/util/isEventMarked.js.map +1 -0
- package/dist/util/throttle.d.ts +2 -0
- package/dist/util/throttle.js +20 -0
- package/dist/util/throttle.js.map +1 -0
- package/dist/util/toLowercaseEnumValue.d.ts +3 -0
- package/dist/util/toLowercaseEnumValue.js +4 -0
- package/dist/util/toLowercaseEnumValue.js.map +1 -0
- package/dist/util/valueStateNavigation.d.ts +8 -0
- package/dist/util/valueStateNavigation.js +40 -0
- package/dist/util/valueStateNavigation.js.map +1 -0
- package/dist/validateThemeRoot.js +6 -2
- package/dist/validateThemeRoot.js.map +1 -1
- package/dist/vscode.html-custom-data.json +1 -1
- package/package-scripts.cjs +65 -34
- package/package.json +38 -25
- package/src/css/MultipleDragGhost.css +17 -0
- package/src/css/OpenUI5PopupStyles.css +5 -0
- package/src/css/ScrollbarStyles.css +3 -0
- package/src/i18n/messagebundle.properties +5 -0
- package/src/i18n/messagebundle_en.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/thirdparty/preact/jsxRuntime.module.js +1 -0
- package/src/thirdparty/preact/preact.module.js +1 -0
- package/src/thirdparty/preact/version.txt +1 -0
- package/tsconfig.json +0 -1
- package/cypress/specs/Accessor.cy.ts +0 -79
- package/cypress/specs/Boot.cy.ts +0 -23
- package/cypress/specs/ConfigurationChange.cy.ts +0 -41
- package/cypress/specs/ConfigurationScript.cy.ts +0 -116
- package/cypress/specs/ConfigurationURL.cy.ts +0 -182
- package/cypress/specs/CustomMount.cy.ts +0 -34
- package/cypress/specs/CustomTheme.cy.ts +0 -36
- package/cypress/specs/EventProvider.cy.ts +0 -59
- package/cypress/specs/SystemDOMElements.cy.ts +0 -8
- package/cypress/specs/Theming.cy.ts +0 -74
- package/cypress/specs/UI5ElementInvalidation.cy.ts +0 -207
- package/cypress/specs/UI5ElementLifecycle.cy.ts +0 -82
- package/cypress/specs/UI5ElementListenForChildPropChanges.cy.ts +0 -62
- package/cypress/specs/UI5ElementMetadataExt.cy.ts +0 -42
- package/cypress/specs/UI5ElementPropertyValidation.cy.ts +0 -16
- package/cypress/specs/UI5ElementPropsAndAttrs.cy.ts +0 -113
- package/cypress/specs/UI5ElementShadowDOM.cy.ts +0 -30
- package/cypress/specs/UI5ElementSlots.cy.ts +0 -116
- package/cypress/specs/WithComplexTemplate.cy.ts +0 -32
- package/cypress/tsconfig.json +0 -20
- package/dist/MarkedEvents.d.ts +0 -9
- package/dist/MarkedEvents.js +0 -15
- package/dist/MarkedEvents.js.map +0 -1
- package/dist/css/FontFace.css +0 -96
- package/dist/css/OverrideFontFace.css +0 -32
- package/dist/generated/css/OverrideFontFace.css.d.ts +0 -3
- package/dist/generated/css/OverrideFontFace.css.js +0 -7
- package/dist/generated/css/OverrideFontFace.css.js.map +0 -1
- package/dist/prod/MarkedEvents.js +0 -2
- package/dist/prod/MarkedEvents.js.map +0 -7
- package/dist/prod/generated/css/OverrideFontFace.css.js +0 -2
- package/dist/prod/generated/css/OverrideFontFace.css.js.map +0 -7
- package/dist/prod/types/AriaHasPopup.js +0 -2
- package/dist/prod/types/AriaHasPopup.js.map +0 -7
- package/dist/prod/types/AriaLandmarkRole.js +0 -2
- package/dist/prod/types/AriaLandmarkRole.js.map +0 -7
- package/dist/prod/types/AriaRole.js +0 -2
- package/dist/prod/types/AriaRole.js.map +0 -7
- package/dist/prod/util/AriaLabelHelper.js +0 -2
- package/dist/prod/util/AriaLabelHelper.js.map +0 -7
- package/dist/prod/util/getEffectiveScrollbarStyle.js +0 -26
- package/dist/prod/util/getEffectiveScrollbarStyle.js.map +0 -7
- package/dist/prod/util/isElementContainingBlock.js +0 -2
- package/dist/prod/util/isElementContainingBlock.js.map +0 -7
- package/dist/types/AriaHasPopup.d.ts +0 -32
- package/dist/types/AriaHasPopup.js +0 -34
- package/dist/types/AriaHasPopup.js.map +0 -1
- package/dist/types/AriaLandmarkRole.d.ts +0 -79
- package/dist/types/AriaLandmarkRole.js +0 -81
- package/dist/types/AriaLandmarkRole.js.map +0 -1
- package/dist/types/AriaRole.d.ts +0 -27
- package/dist/types/AriaRole.js +0 -29
- package/dist/types/AriaRole.js.map +0 -1
- package/dist/util/AriaLabelHelper.js.map +0 -1
- package/dist/util/getEffectiveScrollbarStyle.d.ts +0 -2
- package/dist/util/getEffectiveScrollbarStyle.js +0 -34
- package/dist/util/getEffectiveScrollbarStyle.js.map +0 -1
- package/dist/util/isElementContainingBlock.d.ts +0 -2
- package/dist/util/isElementContainingBlock.js +0 -11
- package/dist/util/isElementContainingBlock.js.map +0 -1
- package/index.js +0 -214
- package/src/css/FontFace.css +0 -96
- package/src/css/OverrideFontFace.css +0 -32
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function bound(target: any, key: string | symbol, descriptor: any): any;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export default function bound(target, key, descriptor) {
|
|
2
|
+
if (!(typeof target[key] === "function")) {
|
|
3
|
+
throw new Error(`@bound decorator can only be applied to methods, received ${String(key)}: ${typeof target[key]}`);
|
|
4
|
+
}
|
|
5
|
+
let fn = descriptor.value;
|
|
6
|
+
return {
|
|
7
|
+
configurable: true,
|
|
8
|
+
get() {
|
|
9
|
+
if (!(this instanceof target.constructor)) {
|
|
10
|
+
return fn;
|
|
11
|
+
}
|
|
12
|
+
// if the property is already defined on the instance, then this call is a super call
|
|
13
|
+
if (Object.hasOwnProperty.call(this, key)) {
|
|
14
|
+
return fn;
|
|
15
|
+
}
|
|
16
|
+
let boundFn = fn.bind(this);
|
|
17
|
+
Object.defineProperty(this, key, {
|
|
18
|
+
configurable: true,
|
|
19
|
+
get() {
|
|
20
|
+
return boundFn;
|
|
21
|
+
},
|
|
22
|
+
set(value) {
|
|
23
|
+
// setting a value on the instance means they overwrite the default behaviour
|
|
24
|
+
boundFn = value;
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
return boundFn;
|
|
28
|
+
},
|
|
29
|
+
set(value) {
|
|
30
|
+
fn = value;
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=bound.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bound.js","sourceRoot":"","sources":["../../src/decorators/bound.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,MAAW,EAAE,GAAoB,EAAE,UAAe;IAC/E,IAAI,CAAC,CAAC,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,UAAU,CAAC,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,6DAA6D,MAAM,CAAC,GAAG,CAAC,KAAK,OAAO,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACpH,CAAC;IAED,IAAI,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC;IAC1B,OAAO;QACN,YAAY,EAAE,IAAI;QAClB,GAAG;YACF,IAAI,CAAC,CAAC,IAAI,YAAY,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC3C,OAAO,EAAE,CAAC;YACX,CAAC;YAED,qFAAqF;YACrF,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;gBAC3C,OAAO,EAAE,CAAC;YACX,CAAC;YAED,IAAI,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE5B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE;gBAChC,YAAY,EAAE,IAAI;gBAClB,GAAG;oBACF,OAAO,OAAO,CAAC;gBAChB,CAAC;gBACD,GAAG,CAAC,KAAU;oBACb,6EAA6E;oBAC7E,OAAO,GAAG,KAAK,CAAC;gBACjB,CAAC;aACD,CAAC,CAAC;YACH,OAAO,OAAO,CAAC;QAChB,CAAC;QACD,GAAG,CAAC,KAAU;YACb,EAAE,GAAG,KAAK,CAAC;QACZ,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["export default function bound(target: any, key: string | symbol, descriptor: any): any {\n\tif (!(typeof target[key] === \"function\")) {\n\t\tthrow new Error(`@bound decorator can only be applied to methods, received ${String(key)}: ${typeof target[key]}`);\n\t}\n\n\tlet fn = descriptor.value;\n\treturn {\n\t\tconfigurable: true,\n\t\tget(): any {\n\t\t\tif (!(this instanceof target.constructor)) {\n\t\t\t\treturn fn;\n\t\t\t}\n\n\t\t\t// if the property is already defined on the instance, then this call is a super call\n\t\t\tif (Object.hasOwnProperty.call(this, key)) {\n\t\t\t\treturn fn;\n\t\t\t}\n\n\t\t\tlet boundFn = fn.bind(this);\n\n\t\t\tObject.defineProperty(this, key, {\n\t\t\t\tconfigurable: true,\n\t\t\t\tget(): any {\n\t\t\t\t\treturn boundFn;\n\t\t\t\t},\n\t\t\t\tset(value: any): void {\n\t\t\t\t\t// setting a value on the instance means they overwrite the default behaviour\n\t\t\t\t\tboundFn = value;\n\t\t\t\t},\n\t\t\t});\n\t\t\treturn boundFn;\n\t\t},\n\t\tset(value: any): void {\n\t\t\tfn = value;\n\t\t},\n\t};\n}\n"]}
|
|
@@ -9,17 +9,55 @@ import type { ComponentStylesData as Styles } from "../types.js";
|
|
|
9
9
|
* @returns { ClassDecorator }
|
|
10
10
|
*/
|
|
11
11
|
declare const customElement: (tagNameOrComponentSettings?: string | {
|
|
12
|
+
/**
|
|
13
|
+
* The tag name of the custom element (will be suffixed if the scoping feature is used).
|
|
14
|
+
*/
|
|
12
15
|
tag?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The renderer of the custom element - officially supported are: jsxRenderer and litRender (deprecated).
|
|
18
|
+
*/
|
|
13
19
|
renderer?: Renderer;
|
|
20
|
+
/**
|
|
21
|
+
* The styles to be injected into the shadow root of the custom element.
|
|
22
|
+
*/
|
|
14
23
|
styles?: Styles;
|
|
24
|
+
/**
|
|
25
|
+
* The template function of the custom element - must match the renderer.
|
|
26
|
+
*/
|
|
15
27
|
template?: Template;
|
|
28
|
+
/**
|
|
29
|
+
* Other custom elements used in the shadow root of the custom element.
|
|
30
|
+
* @deprecated no longer necessary for jsxRenderer-enabled components
|
|
31
|
+
*/
|
|
16
32
|
dependencies?: Array<typeof UI5Element>;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the custom element should be re-rendered when the language changes.
|
|
35
|
+
*/
|
|
17
36
|
languageAware?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the custom element should be re-rendered when the theme changes.
|
|
39
|
+
*/
|
|
18
40
|
themeAware?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Whether the custom element needs the CLDR assets.
|
|
43
|
+
*/
|
|
19
44
|
cldr?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Whether the custom element supports the F6 Fast navigation feature (is a fast-navigation group).
|
|
47
|
+
*/
|
|
20
48
|
fastNavigation?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Whether the custom element is form-associated and implements form-relevant features.
|
|
51
|
+
*/
|
|
21
52
|
formAssociated?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* The shadow root options of the custom element.
|
|
55
|
+
*/
|
|
22
56
|
shadowRootOptions?: Partial<ShadowRootInit>;
|
|
57
|
+
/**
|
|
58
|
+
* A list of all features, supported by the custom element.
|
|
59
|
+
* @deprecated no longer necessary for jsxRenderer-enabled components
|
|
60
|
+
*/
|
|
23
61
|
features?: Array<string>;
|
|
24
62
|
}) => ClassDecorator;
|
|
25
63
|
export default customElement;
|
|
@@ -13,7 +13,7 @@ const customElement = (tagNameOrComponentSettings = {}) => {
|
|
|
13
13
|
target.metadata.tag = tagNameOrComponentSettings;
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
|
-
const { tag, languageAware, themeAware, cldr, fastNavigation, formAssociated, shadowRootOptions,
|
|
16
|
+
const { tag, languageAware, themeAware, cldr, fastNavigation, formAssociated, shadowRootOptions, } = tagNameOrComponentSettings;
|
|
17
17
|
target.metadata.tag = tag;
|
|
18
18
|
if (languageAware) {
|
|
19
19
|
target.metadata.languageAware = languageAware;
|
|
@@ -21,9 +21,6 @@ const customElement = (tagNameOrComponentSettings = {}) => {
|
|
|
21
21
|
if (cldr) {
|
|
22
22
|
target.metadata.cldr = cldr;
|
|
23
23
|
}
|
|
24
|
-
if (features) {
|
|
25
|
-
target.metadata.features = features;
|
|
26
|
-
}
|
|
27
24
|
if (themeAware) {
|
|
28
25
|
target.metadata.themeAware = themeAware;
|
|
29
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customElement.js","sourceRoot":"","sources":["../../src/decorators/customElement.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,aAAa,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"customElement.js","sourceRoot":"","sources":["../../src/decorators/customElement.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,MAAM,aAAa,GAAG,CAAC,6BAmDnB,EAAE,EAAkB,EAAE;IACzB,OAAO,CAAC,MAAW,EAAE,EAAE;QACtB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC;YAC/D,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;QACtB,CAAC;QAED,IAAI,OAAO,0BAA0B,KAAK,QAAQ,EAAE,CAAC;YACpD,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,0BAA0B,CAAC;YACjD,OAAO;QACR,CAAC;QAED,MAAM,EACL,GAAG,EACH,aAAa,EACb,UAAU,EACV,IAAI,EACJ,cAAc,EACd,cAAc,EACd,iBAAiB,GAChB,GAAG,0BAA0B,CAAC;QAEhC,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC;QAC1B,IAAI,aAAa,EAAE,CAAC;YACnB,MAAM,CAAC,QAAQ,CAAC,aAAa,GAAG,aAAa,CAAC;QAC/C,CAAC;QACD,IAAI,IAAI,EAAE,CAAC;YACV,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;QAC7B,CAAC;QAED,IAAI,UAAU,EAAE,CAAC;YAChB,MAAM,CAAC,QAAQ,CAAC,UAAU,GAAG,UAAU,CAAC;QACzC,CAAC;QACD,IAAI,cAAc,EAAE,CAAC;YACpB,MAAM,CAAC,QAAQ,CAAC,cAAc,GAAG,cAAc,CAAC;QACjD,CAAC;QACD,IAAI,cAAc,EAAE,CAAC;YACpB,MAAM,CAAC,QAAQ,CAAC,cAAc,GAAG,cAAc,CAAC;QACjD,CAAC;QAED,IAAI,iBAAiB,EAAE,CAAC;YACvB,MAAM,CAAC,QAAQ,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QACvD,CAAC;QAED,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,mBAA2B,EAAE,EAAE;YAC1F,MAAM,wBAAwB,GAAG,0BAA0B,CAAC,mBAAuC,CAAC,CAAC;YAErG,wBAAwB,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,mBAAmB,EAAE;gBAC9E,GAAG,EAAE,GAAG,EAAE,CAAC,0BAA0B,CAAC,mBAAuC,CAAC;aAC9E,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\nimport type { Renderer } from \"../UI5Element.js\";\nimport type { TemplateFunction as Template } from \"../renderer/executeTemplate.js\";\nimport type { ComponentStylesData as Styles } from \"../types.js\";\n\n/**\n * Returns a custom element class decorator.\n *\n * @param { string | object } tagNameOrComponentSettings\n * @returns { ClassDecorator }\n */\nconst customElement = (tagNameOrComponentSettings: string | {\n\t/**\n\t * The tag name of the custom element (will be suffixed if the scoping feature is used).\n\t */\n\ttag?: string,\n\t/**\n\t * The renderer of the custom element - officially supported are: jsxRenderer and litRender (deprecated).\n\t */\n\trenderer?: Renderer,\n\t/**\n\t * The styles to be injected into the shadow root of the custom element.\n\t */\n\tstyles?: Styles,\n\t/**\n\t * The template function of the custom element - must match the renderer.\n\t */\n\ttemplate?: Template,\n\t/**\n\t * Other custom elements used in the shadow root of the custom element.\n\t * @deprecated no longer necessary for jsxRenderer-enabled components\n\t */\n\tdependencies?: Array<typeof UI5Element>,\n\t/**\n\t * Whether the custom element should be re-rendered when the language changes.\n\t */\n\tlanguageAware?: boolean,\n\t/**\n\t * Whether the custom element should be re-rendered when the theme changes.\n\t */\n\tthemeAware?: boolean,\n\t/**\n\t * Whether the custom element needs the CLDR assets.\n\t */\n\tcldr?: boolean,\n\t/**\n\t * Whether the custom element supports the F6 Fast navigation feature (is a fast-navigation group).\n\t */\n\tfastNavigation?: boolean,\n\t/**\n\t * Whether the custom element is form-associated and implements form-relevant features.\n\t */\n\tformAssociated?: boolean,\n\t/**\n\t * The shadow root options of the custom element.\n\t */\n\tshadowRootOptions?: Partial<ShadowRootInit>,\n\t/**\n\t * A list of all features, supported by the custom element.\n\t * @deprecated no longer necessary for jsxRenderer-enabled components\n\t */\n\tfeatures?: Array<string>,\n} = {}): ClassDecorator => {\n\treturn (target: any) => {\n\t\tif (!Object.prototype.hasOwnProperty.call(target, \"metadata\")) {\n\t\t\ttarget.metadata = {};\n\t\t}\n\n\t\tif (typeof tagNameOrComponentSettings === \"string\") {\n\t\t\ttarget.metadata.tag = tagNameOrComponentSettings;\n\t\t\treturn;\n\t\t}\n\n\t\tconst {\n\t\t\ttag,\n\t\t\tlanguageAware,\n\t\t\tthemeAware,\n\t\t\tcldr,\n\t\t\tfastNavigation,\n\t\t\tformAssociated,\n\t\t\tshadowRootOptions,\n\t\t } = tagNameOrComponentSettings;\n\n\t\ttarget.metadata.tag = tag;\n\t\tif (languageAware) {\n\t\t\ttarget.metadata.languageAware = languageAware;\n\t\t}\n\t\tif (cldr) {\n\t\t\ttarget.metadata.cldr = cldr;\n\t\t}\n\n\t\tif (themeAware) {\n\t\t\ttarget.metadata.themeAware = themeAware;\n\t\t}\n\t\tif (fastNavigation) {\n\t\t\ttarget.metadata.fastNavigation = fastNavigation;\n\t\t}\n\t\tif (formAssociated) {\n\t\t\ttarget.metadata.formAssociated = formAssociated;\n\t\t}\n\n\t\tif (shadowRootOptions) {\n\t\t\ttarget.metadata.shadowRootOptions = shadowRootOptions;\n\t\t}\n\n\t\t[\"renderer\", \"template\", \"styles\", \"dependencies\"].forEach((customElementEntity: string) => {\n\t\t\tconst customElementEntityValue = tagNameOrComponentSettings[customElementEntity as keyof typeof tag];\n\n\t\t\tcustomElementEntityValue && Object.defineProperty(target, customElementEntity, {\n\t\t\t\tget: () => tagNameOrComponentSettings[customElementEntity as keyof typeof tag],\n\t\t\t});\n\t\t});\n\t};\n};\n\nexport default customElement;\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type UI5Element from "../UI5Element.js";
|
|
2
|
+
type EventDetailKeys<T extends typeof UI5Element> = keyof InstanceType<T>["eventDetails"];
|
|
3
|
+
type ExtractEventKeys<T extends typeof UI5Element> = EventDetailKeys<T> extends never ? "event name not found in `eventDetails` field" : EventDetailKeys<T>;
|
|
4
|
+
/**
|
|
5
|
+
* Returns an event class decorator.
|
|
6
|
+
*
|
|
7
|
+
* @param { string } name the event name
|
|
8
|
+
* @param { EventData } data the event data
|
|
9
|
+
* @returns { ClassDecorator }
|
|
10
|
+
*/
|
|
11
|
+
declare const event: <T extends typeof UI5Element, N extends ExtractEventKeys<T>>(name: N, data?: {
|
|
12
|
+
bubbles?: boolean;
|
|
13
|
+
cancelable?: boolean;
|
|
14
|
+
}) => (target: T) => T | void;
|
|
15
|
+
export default event;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns an event class decorator.
|
|
3
|
+
*
|
|
4
|
+
* @param { string } name the event name
|
|
5
|
+
* @param { EventData } data the event data
|
|
6
|
+
* @returns { ClassDecorator }
|
|
7
|
+
*/
|
|
8
|
+
const event = (name, data = {}) => {
|
|
9
|
+
return (target) => {
|
|
10
|
+
if (!Object.prototype.hasOwnProperty.call(target, "metadata")) {
|
|
11
|
+
target.metadata = {};
|
|
12
|
+
}
|
|
13
|
+
const metadata = target.metadata;
|
|
14
|
+
if (!metadata.events) {
|
|
15
|
+
metadata.events = {};
|
|
16
|
+
}
|
|
17
|
+
const eventsMetadata = metadata.events;
|
|
18
|
+
if (!eventsMetadata[name]) {
|
|
19
|
+
data.bubbles = !!data.bubbles;
|
|
20
|
+
data.cancelable = !!data.cancelable;
|
|
21
|
+
eventsMetadata[name] = data;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default event;
|
|
26
|
+
//# sourceMappingURL=event-strict.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-strict.js","sourceRoot":"","sources":["../../src/decorators/event-strict.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,MAAM,KAAK,GAAG,CAA6D,IAAO,EAAE,OAAoD,EAAE,EAA2B,EAAE;IACtK,OAAO,CAAC,MAAS,EAAE,EAAE;QACpB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC;YAC/D,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;QACtB,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YACtB,QAAQ,CAAC,MAAM,GAAG,EAAE,CAAC;QACtB,CAAC;QAED,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC;QACvC,IAAI,CAAC,cAAc,CAAC,IAAc,CAAC,EAAE,CAAC;YACrC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;YAC9B,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;YACpC,cAAc,CAAC,IAAc,CAAC,GAAG,IAAI,CAAC;QACvC,CAAC;IACF,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\n\ntype EventDetailKeys<T extends typeof UI5Element> = keyof InstanceType<T>[\"eventDetails\"];\ntype ExtractEventKeys<T extends typeof UI5Element> = EventDetailKeys<T> extends never ? \"event name not found in `eventDetails` field\" : EventDetailKeys<T>;\n\n/**\n * Returns an event class decorator.\n *\n * @param { string } name the event name\n * @param { EventData } data the event data\n * @returns { ClassDecorator }\n */\nconst event = <T extends typeof UI5Element, N extends ExtractEventKeys<T>>(name: N, data: { bubbles?: boolean, cancelable?: boolean } = {}): (target: T) => T | void => {\n\treturn (target: T) => {\n\t\tif (!Object.prototype.hasOwnProperty.call(target, \"metadata\")) {\n\t\t\ttarget.metadata = {};\n\t\t}\n\n\t\tconst metadata = target.metadata;\n\t\tif (!metadata.events) {\n\t\t\tmetadata.events = {};\n\t\t}\n\n\t\tconst eventsMetadata = metadata.events;\n\t\tif (!eventsMetadata[name as string]) {\n\t\t\tdata.bubbles = !!data.bubbles;\n\t\t\tdata.cancelable = !!data.cancelable;\n\t\t\teventsMetadata[name as string] = data;\n\t\t}\n\t};\n};\n\nexport default event;\n"]}
|
package/dist/decorators/event.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../src/decorators/event.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../src/decorators/event.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,KAAK,GAAG,CAAc,IAAY,EAAE,OAAuG,EAAE,EAAkB,EAAE;IACtK,OAAO,CAAC,MAAW,EAAE,EAAE;QACtB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC;YAC/D,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;QACtB,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;YACtB,QAAQ,CAAC,MAAM,GAAG,EAAE,CAAC;QACtB,CAAC;QAED,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC;QACvC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;YAC9B,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;YACpC,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;QAC7B,CAAC;IACF,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["/**\n * Returns an event class decorator.\n *\n * @deprecated Use `@ui5/webcomponents-base/dist/decorators/event-strict.js` instead.\n * @param { string } name the event name\n * @param { EventData } data the event data\n * @returns { ClassDecorator }\n */\nconst event = <EventDetail>(name: string, data: { detail?: Record<keyof EventDetail, { type: any }>, bubbles?: boolean, cancelable?: boolean } = {}): ClassDecorator => {\n\treturn (target: any) => {\n\t\tif (!Object.prototype.hasOwnProperty.call(target, \"metadata\")) {\n\t\t\ttarget.metadata = {};\n\t\t}\n\n\t\tconst metadata = target.metadata;\n\t\tif (!metadata.events) {\n\t\t\tmetadata.events = {};\n\t\t}\n\n\t\tconst eventsMetadata = metadata.events;\n\t\tif (!eventsMetadata[name]) {\n\t\t\tdata.bubbles = !!data.bubbles;\n\t\t\tdata.cancelable = !!data.cancelable;\n\t\t\teventsMetadata[name] = data;\n\t\t}\n\t};\n};\n\nexport default event;\n"]}
|
package/dist/decorators/i18n.js
CHANGED
|
@@ -16,6 +16,12 @@ const i18n = (bundleName) => {
|
|
|
16
16
|
if (!target.metadata.i18n) {
|
|
17
17
|
target.metadata.i18n = {};
|
|
18
18
|
}
|
|
19
|
+
Object.defineProperty(target, propertyName, {
|
|
20
|
+
get() {
|
|
21
|
+
return target.i18nBundles[bundleName];
|
|
22
|
+
},
|
|
23
|
+
set() { },
|
|
24
|
+
});
|
|
19
25
|
target.metadata.i18n[propertyName] = {
|
|
20
26
|
bundleName,
|
|
21
27
|
target,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/decorators/i18n.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,MAAM,IAAI,GAAG,CAAC,UAAkB,EAAiB,EAAE;IAClD,OAAO,CAAC,MAAyB,EAAE,YAAoB,EAAE,EAAE;QAC1D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC3B,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,EAAE,CAAC;QAC3B,CAAC;
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/decorators/i18n.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,MAAM,IAAI,GAAG,CAAC,UAAkB,EAAiB,EAAE;IAClD,OAAO,CAAC,MAAyB,EAAE,YAAoB,EAAE,EAAE;QAC1D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC3B,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,EAAE,CAAC;QAC3B,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE;YAC3C,GAAG;gBACF,OAAO,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;YACvC,CAAC;YACD,GAAG,KAAI,CAAC;SACR,CAAC,CAAC;QAEH,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG;YACpC,UAAU;YACV,MAAM;SACN,CAAC;IACH,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\n\ntype i18nDecorator = (target: typeof UI5Element, propertyName: string) => void;\n\n/**\n * A decorator that converts a static class member into an accessor for the i18n bundle with a specified name\n *\n * @param { string } bundleName name of the i18n bundle to load\n * @returns { i18nDecorator }\n *\n * ```ts\n * class MyComponnet extends UI5Element {\n * @i18n('@ui5/webcomponents')\n * i18nBundle: I18nBundle;\n * }\n * ```\n */\nconst i18n = (bundleName: string): i18nDecorator => {\n\treturn (target: typeof UI5Element, propertyName: string) => {\n\t\tif (!target.metadata.i18n) {\n\t\t\ttarget.metadata.i18n = {};\n\t\t}\n\n\t\tObject.defineProperty(target, propertyName, {\n\t\t\tget() {\n\t\t\t\treturn target.i18nBundles[bundleName];\n\t\t\t},\n\t\t\tset() {},\n\t\t});\n\n\t\ttarget.metadata.i18n[propertyName] = {\n\t\t\tbundleName,\n\t\t\ttarget,\n\t\t};\n\t};\n};\n\nexport default i18n;\n"]}
|
package/dist/decorators.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import customElement from "./decorators/customElement.js";
|
|
2
2
|
import event from "./decorators/event.js";
|
|
3
|
+
import eventStrict from "./decorators/event-strict.js";
|
|
3
4
|
import property from "./decorators/property.js";
|
|
4
5
|
import slot from "./decorators/slot.js";
|
|
5
|
-
|
|
6
|
+
import bound from "./decorators/bound.js";
|
|
7
|
+
import i18n from "./decorators/i18n.js";
|
|
8
|
+
export { customElement, event, eventStrict, property, slot, bound, i18n, };
|
package/dist/decorators.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import customElement from "./decorators/customElement.js";
|
|
2
2
|
import event from "./decorators/event.js";
|
|
3
|
+
import eventStrict from "./decorators/event-strict.js";
|
|
3
4
|
import property from "./decorators/property.js";
|
|
4
5
|
import slot from "./decorators/slot.js";
|
|
5
|
-
|
|
6
|
+
import bound from "./decorators/bound.js";
|
|
7
|
+
import i18n from "./decorators/i18n.js";
|
|
8
|
+
export { customElement, event, eventStrict, property, slot, bound, i18n, };
|
|
6
9
|
//# sourceMappingURL=decorators.js.map
|
package/dist/decorators.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC1C,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAExC,OAAO,EACN,aAAa,EACb,KAAK,EACL,QAAQ,EACR,IAAI,GACJ,CAAC","sourcesContent":["import customElement from \"./decorators/customElement.js\";\nimport event from \"./decorators/event.js\";\nimport property from \"./decorators/property.js\";\nimport slot from \"./decorators/slot.js\";\n\nexport {\n\tcustomElement,\n\tevent,\n\tproperty,\n\tslot,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC1C,OAAO,WAAW,MAAM,8BAA8B,CAAC;AACvD,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,IAAI,MAAM,sBAAsB,CAAC;AACxC,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC1C,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAExC,OAAO,EACN,aAAa,EACb,KAAK,EACL,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,IAAI,GACJ,CAAC","sourcesContent":["import customElement from \"./decorators/customElement.js\";\nimport event from \"./decorators/event.js\";\nimport eventStrict from \"./decorators/event-strict.js\";\nimport property from \"./decorators/property.js\";\nimport slot from \"./decorators/slot.js\";\nimport bound from \"./decorators/bound.js\";\nimport i18n from \"./decorators/i18n.js\";\n\nexport {\n\tcustomElement,\n\tevent,\n\teventStrict,\n\tproperty,\n\tslot,\n\tbound,\n\ti18n,\n};\n"]}
|
|
@@ -10,6 +10,7 @@ declare class F6Navigation {
|
|
|
10
10
|
findPreviousFocusableGroupElement(currentIndex: number): Promise<HTMLElement | undefined>;
|
|
11
11
|
_keydownHandler(event: KeyboardEvent): Promise<void>;
|
|
12
12
|
updateGroups(): void;
|
|
13
|
+
findContainer(): HTMLElement;
|
|
13
14
|
setSelectedGroup(root?: DocumentOrShadowRoot): void;
|
|
14
15
|
deepActive(root: DocumentOrShadowRoot): Element | null;
|
|
15
16
|
destroy(): void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { registerFeature } from "../FeaturesRegistry.js";
|
|
1
|
+
import { getFeature, registerFeature } from "../FeaturesRegistry.js";
|
|
2
2
|
import { isF6Next, isF6Previous } from "../Keys.js";
|
|
3
|
-
import { instanceOfUI5Element } from "../UI5Element.js";
|
|
4
3
|
import { getFirstFocusableElement } from "../util/FocusableElements.js";
|
|
5
4
|
import getFastNavigationGroups from "../util/getFastNavigationGroups.js";
|
|
6
5
|
import isElementClickable from "../util/isElementClickable.js";
|
|
7
6
|
import { getCurrentRuntimeIndex, compareRuntimes } from "../Runtimes.js";
|
|
8
7
|
import getSharedResource from "../getSharedResource.js";
|
|
8
|
+
import getParentElement from "../util/getParentElement.js";
|
|
9
9
|
const currentRuntimeINdex = getCurrentRuntimeIndex();
|
|
10
10
|
const shouldUpdate = (runtimeIndex) => {
|
|
11
11
|
if (runtimeIndex === undefined) {
|
|
@@ -27,12 +27,11 @@ class F6Navigation {
|
|
|
27
27
|
document.removeEventListener("keydown", this.keydownHandler);
|
|
28
28
|
}
|
|
29
29
|
async groupElementToFocus(nextElement) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return nextElementDomRef;
|
|
30
|
+
if (nextElement) {
|
|
31
|
+
if (isElementClickable(nextElement)) {
|
|
32
|
+
return nextElement;
|
|
34
33
|
}
|
|
35
|
-
const elementToFocus = await getFirstFocusableElement(
|
|
34
|
+
const elementToFocus = await getFirstFocusableElement(nextElement);
|
|
36
35
|
if (elementToFocus) {
|
|
37
36
|
return elementToFocus;
|
|
38
37
|
}
|
|
@@ -79,9 +78,18 @@ class F6Navigation {
|
|
|
79
78
|
// </ui5-list>
|
|
80
79
|
// </ui5-flexible-column-layout>
|
|
81
80
|
// Here for both FCL & List the firstFoccusableElement is the same (the ui5-li)
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
const currentGroupFocusable = await this.groupElementToFocus(this.groups[currentIndex]);
|
|
82
|
+
let distanceToNextGroup = 1;
|
|
83
|
+
for (let distanceIndex = 1; distanceIndex < this.groups.length; distanceIndex++) {
|
|
84
|
+
const firstFocusable = await this.groupElementToFocus(this.groups[currentIndex - distanceIndex]);
|
|
85
|
+
if (firstFocusable === currentGroupFocusable) {
|
|
86
|
+
distanceToNextGroup++;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
currentIndex -= distanceToNextGroup;
|
|
85
93
|
if (currentIndex < 0) {
|
|
86
94
|
currentIndex = this.groups.length - 1;
|
|
87
95
|
}
|
|
@@ -100,6 +108,12 @@ class F6Navigation {
|
|
|
100
108
|
return elementToFocus;
|
|
101
109
|
}
|
|
102
110
|
async _keydownHandler(event) {
|
|
111
|
+
const openUI5Support = getFeature("OpenUI5Support");
|
|
112
|
+
const isOpenUI5Detected = openUI5Support && openUI5Support.isOpenUI5Detected();
|
|
113
|
+
if (isOpenUI5Detected) {
|
|
114
|
+
this.destroy();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
103
117
|
const forward = isF6Next(event);
|
|
104
118
|
const backward = isF6Previous(event);
|
|
105
119
|
if (!(forward || backward)) {
|
|
@@ -128,14 +142,27 @@ class F6Navigation {
|
|
|
128
142
|
elementToFocus?.focus();
|
|
129
143
|
}
|
|
130
144
|
updateGroups() {
|
|
145
|
+
const container = this.findContainer();
|
|
131
146
|
this.setSelectedGroup();
|
|
132
|
-
this.groups = getFastNavigationGroups(
|
|
147
|
+
this.groups = getFastNavigationGroups(container);
|
|
148
|
+
}
|
|
149
|
+
findContainer() {
|
|
150
|
+
const htmlElement = window.document.querySelector("html");
|
|
151
|
+
let element = this.deepActive(window.document);
|
|
152
|
+
while (element && element !== htmlElement) {
|
|
153
|
+
const closestScopeEl = element.closest("[data-sap-ui-fastnavgroup-container='true']");
|
|
154
|
+
if (closestScopeEl) {
|
|
155
|
+
return closestScopeEl;
|
|
156
|
+
}
|
|
157
|
+
element = getParentElement(element);
|
|
158
|
+
}
|
|
159
|
+
return document.body;
|
|
133
160
|
}
|
|
134
161
|
setSelectedGroup(root = window.document) {
|
|
135
162
|
const htmlElement = window.document.querySelector("html");
|
|
136
163
|
let element = this.deepActive(root);
|
|
137
164
|
while (element && element.getAttribute("data-sap-ui-fastnavgroup") !== "true" && element !== htmlElement) {
|
|
138
|
-
element = element
|
|
165
|
+
element = getParentElement(element);
|
|
139
166
|
}
|
|
140
167
|
this.selectedGroup = element;
|
|
141
168
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"F6Navigation.js","sourceRoot":"","sources":["../../src/features/F6Navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAA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mB,CAAC,YAAY,CAAC,0BAA0B,CAAC,KAAK,MAAM,IAAI,OAAO,KAAK,WAAW,EAAE,CAAC;YACvH,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAE,OAAO,CAAC,UAAyB,CAAC,IAAI,CAAC;QAChG,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,OAAsB,CAAC;IAC7C,CAAC;IAED,UAAU,CAAC,IAA0B;QACpC,IAAI,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;YACpD,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QACvD,CAAC;QAED,OAAO,IAAI,CAAC,aAAa,CAAC;IAC3B,CAAC;IAED,OAAO;QACN,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,gBAAgB;QACnB,OAAO,mBAAmB,CAAC;IAC5B,CAAC;IAED,MAAM,CAAC,IAAI;QACV,MAAM,UAAU,GAAG,iBAAiB,CAAa,YAAY,EAAE,EAAE,CAAC,CAAC;QAEnE,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;YAC1B,UAAU,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;QAC1C,CAAC;aAAM,IAAI,YAAY,CAAC,UAAU,CAAC,QAAQ,EAAE,gBAAgB,CAAC,EAAE,CAAC;YAChE,UAAU,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC;YAC/B,UAAU,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;QAC1C,CAAC;IACF,CAAC;CACD;AAED,eAAe,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAE9C,eAAe,YAAY,CAAC","sourcesContent":["import { registerFeature } from \"../FeaturesRegistry.js\";\nimport { isF6Next, isF6Previous } from \"../Keys.js\";\nimport { instanceOfUI5Element } from \"../UI5Element.js\";\nimport { getFirstFocusableElement } from \"../util/FocusableElements.js\";\nimport getFastNavigationGroups from \"../util/getFastNavigationGroups.js\";\nimport isElementClickable from \"../util/isElementClickable.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes } from \"../Runtimes.js\";\nimport getSharedResource from \"../getSharedResource.js\";\n\ntype F6Registry = {\n\tinstance?: F6Navigation,\n}\n\nconst currentRuntimeINdex = getCurrentRuntimeIndex();\n\nconst shouldUpdate = (runtimeIndex: number | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(currentRuntimeINdex, runtimeIndex) === 1; // 1 means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nclass F6Navigation {\n\tkeydownHandler: (event: KeyboardEvent) => void;\n\tselectedGroup: HTMLElement | null = null;\n\tgroups: Array<HTMLElement> = [];\n\n\tconstructor() {\n\t\tthis.keydownHandler = this._keydownHandler.bind(this) as (event: KeyboardEvent) => void;\n\t\tthis.attachEventListeners();\n\t}\n\n\tattachEventListeners() {\n\t\tdocument.addEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tremoveEventListeners() {\n\t\tdocument.removeEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tasync groupElementToFocus(nextElement: HTMLElement) {\n\t\tconst nextElementDomRef = instanceOfUI5Element(nextElement) ? nextElement.getDomRef() : nextElement;\n\n\t\tif (nextElementDomRef) {\n\t\t\tif (isElementClickable(nextElementDomRef)) {\n\t\t\t\treturn nextElementDomRef;\n\t\t\t}\n\n\t\t\tconst elementToFocus = await getFirstFocusableElement(nextElementDomRef);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\treturn elementToFocus;\n\t\t\t}\n\t\t}\n\t}\n\n\tasync findNextFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > -1) {\n\t\t\t\tif (currentIndex + 1 >= this.groups.length) {\n\t\t\t\t\tcurrentIndex = 0;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t} else {\n\t\t\t\t\tcurrentIndex += 1;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrentIndex = 0;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync findPreviousFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > 0) {\n\t\t\t\t// Handle the situation where the first focusable element of two neighbor groups is the same\n\t\t\t\t// For example:\n\t\t\t\t// <ui5-flexible-column-layout>\n\t\t\t\t// <ui5-list>\n\t\t\t\t// <ui5-li>List Item</ui5-li>\n\t\t\t\t// </ui5-list>\n\t\t\t\t// </ui5-flexible-column-layout>\n\t\t\t\t// Here for both FCL & List the firstFoccusableElement is the same (the ui5-li)\n\t\t\t\tconst firstFocusable = await this.groupElementToFocus(this.groups[currentIndex - 1]);\n\t\t\t\tconst shouldSkipParent = firstFocusable === await this.groupElementToFocus(this.groups[currentIndex]);\n\n\t\t\t\tcurrentIndex = shouldSkipParent ? currentIndex - 2 : currentIndex - 1;\n\n\t\t\t\tif (currentIndex < 0) {\n\t\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\t}\n\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t} else {\n\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync _keydownHandler(event: KeyboardEvent) {\n\t\tconst forward = isF6Next(event);\n\t\tconst backward = isF6Previous(event);\n\t\tif (!(forward || backward)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateGroups();\n\n\t\tif (this.groups.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tlet elementToFocus;\n\n\t\tif (this.groups.length === 0) {\n\t\t\telementToFocus = await this.groupElementToFocus(this.groups[0]);\n\n\t\t\treturn elementToFocus?.focus();\n\t\t}\n\n\t\tlet currentIndex = -1;\n\n\t\tif (this.selectedGroup) {\n\t\t\tcurrentIndex = this.groups.indexOf(this.selectedGroup);\n\t\t}\n\n\t\tif (forward) {\n\t\t\telementToFocus = await this.findNextFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\tif (backward) {\n\t\t\telementToFocus = await this.findPreviousFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\telementToFocus?.focus();\n\t}\n\n\tupdateGroups() {\n\t\tthis.setSelectedGroup();\n\t\tthis.groups = getFastNavigationGroups(document.body);\n\t}\n\n\tsetSelectedGroup(root: DocumentOrShadowRoot = window.document) {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element: Element | null | ParentNode = this.deepActive(root);\n\n\t\twhile (element && (element as Element).getAttribute(\"data-sap-ui-fastnavgroup\") !== \"true\" && element !== htmlElement) {\n\t\t\telement = element.parentElement ? element.parentNode : (element.parentNode as ShadowRoot).host;\n\t\t}\n\n\t\tthis.selectedGroup = element as HTMLElement;\n\t}\n\n\tdeepActive(root: DocumentOrShadowRoot): Element | null {\n\t\tif (root?.activeElement?.shadowRoot?.activeElement) {\n\t\t\treturn this.deepActive(root.activeElement.shadowRoot);\n\t\t}\n\n\t\treturn root.activeElement;\n\t}\n\n\tdestroy() {\n\t\tthis.removeEventListeners();\n\t}\n\n\tget _ui5RuntimeIndex() {\n\t\treturn currentRuntimeINdex;\n\t}\n\n\tstatic init() {\n\t\tconst f6Registry = getSharedResource<F6Registry>(\"F6Registry\", {});\n\n\t\tif (!f6Registry.instance) {\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t} else if (shouldUpdate(f6Registry.instance?._ui5RuntimeIndex)) {\n\t\t\tf6Registry.instance?.destroy();\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t}\n\t}\n}\n\nregisterFeature(\"F6Navigation\", F6Navigation);\n\nexport default F6Navigation;\n"]}
|
|
1
|
+
{"version":3,"file":"F6Navigation.js","sourceRoot":"","sources":["../../src/features/F6Navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,uBAAuB,MAAM,oCAAoC,CAAC;AACzE,OAAO,kBAAkB,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AAExD,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAM3D,MAAM,mBAAmB,GAAG,sBAAsB,EAAE,CAAC;AAErD,MAAM,YAAY,GAAG,CAAC,YAAgC,EAAE,EAAE;IACzD,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,eAAe,CAAC,mBAAmB,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,2FAA2F;AAC7J,CAAC,CAAC;AAEF,MAAM,YAAY;IAKjB;QAHA,kBAAa,GAAuB,IAAI,CAAC;QACzC,W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C1C,CAAC;IACF,CAAC;CACD;AAED,eAAe,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAE9C,eAAe,YAAY,CAAC","sourcesContent":["import { getFeature, registerFeature } from \"../FeaturesRegistry.js\";\nimport { isF6Next, isF6Previous } from \"../Keys.js\";\nimport { getFirstFocusableElement } from \"../util/FocusableElements.js\";\nimport getFastNavigationGroups from \"../util/getFastNavigationGroups.js\";\nimport isElementClickable from \"../util/isElementClickable.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes } from \"../Runtimes.js\";\nimport getSharedResource from \"../getSharedResource.js\";\nimport type OpenUI5Support from \"./OpenUI5Support.js\";\nimport getParentElement from \"../util/getParentElement.js\";\n\ntype F6Registry = {\n\tinstance?: F6Navigation,\n}\n\nconst currentRuntimeINdex = getCurrentRuntimeIndex();\n\nconst shouldUpdate = (runtimeIndex: number | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(currentRuntimeINdex, runtimeIndex) === 1; // 1 means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nclass F6Navigation {\n\tkeydownHandler: (event: KeyboardEvent) => void;\n\tselectedGroup: HTMLElement | null = null;\n\tgroups: Array<HTMLElement> = [];\n\n\tconstructor() {\n\t\tthis.keydownHandler = this._keydownHandler.bind(this) as (event: KeyboardEvent) => void;\n\t\tthis.attachEventListeners();\n\t}\n\n\tattachEventListeners() {\n\t\tdocument.addEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tremoveEventListeners() {\n\t\tdocument.removeEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tasync groupElementToFocus(nextElement: HTMLElement) {\n\t\tif (nextElement) {\n\t\t\tif (isElementClickable(nextElement)) {\n\t\t\t\treturn nextElement;\n\t\t\t}\n\n\t\t\tconst elementToFocus = await getFirstFocusableElement(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\treturn elementToFocus;\n\t\t\t}\n\t\t}\n\t}\n\n\tasync findNextFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > -1) {\n\t\t\t\tif (currentIndex + 1 >= this.groups.length) {\n\t\t\t\t\tcurrentIndex = 0;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t} else {\n\t\t\t\t\tcurrentIndex += 1;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrentIndex = 0;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync findPreviousFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > 0) {\n\t\t\t\t// Handle the situation where the first focusable element of two neighbor groups is the same\n\t\t\t\t// For example:\n\t\t\t\t// <ui5-flexible-column-layout>\n\t\t\t\t// <ui5-list>\n\t\t\t\t// <ui5-li>List Item</ui5-li>\n\t\t\t\t// </ui5-list>\n\t\t\t\t// </ui5-flexible-column-layout>\n\t\t\t\t// Here for both FCL & List the firstFoccusableElement is the same (the ui5-li)\n\t\t\t\tconst currentGroupFocusable = await this.groupElementToFocus(this.groups[currentIndex]);\n\t\t\t\tlet distanceToNextGroup = 1;\n\n\t\t\t\tfor (let distanceIndex = 1; distanceIndex < this.groups.length; distanceIndex++) {\n\t\t\t\t\tconst firstFocusable = await this.groupElementToFocus(this.groups[currentIndex - distanceIndex]);\n\n\t\t\t\t\tif (firstFocusable === currentGroupFocusable) {\n\t\t\t\t\t\tdistanceToNextGroup++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcurrentIndex -= distanceToNextGroup;\n\n\t\t\t\tif (currentIndex < 0) {\n\t\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\t}\n\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t} else {\n\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync _keydownHandler(event: KeyboardEvent) {\n\t\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\t\tconst isOpenUI5Detected = openUI5Support && openUI5Support.isOpenUI5Detected();\n\n\t\tif (isOpenUI5Detected) {\n\t\t\tthis.destroy();\n\t\t\treturn;\n\t\t}\n\n\t\tconst forward = isF6Next(event);\n\t\tconst backward = isF6Previous(event);\n\t\tif (!(forward || backward)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateGroups();\n\n\t\tif (this.groups.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tlet elementToFocus;\n\n\t\tif (this.groups.length === 0) {\n\t\t\telementToFocus = await this.groupElementToFocus(this.groups[0]);\n\n\t\t\treturn elementToFocus?.focus();\n\t\t}\n\n\t\tlet currentIndex = -1;\n\n\t\tif (this.selectedGroup) {\n\t\t\tcurrentIndex = this.groups.indexOf(this.selectedGroup);\n\t\t}\n\n\t\tif (forward) {\n\t\t\telementToFocus = await this.findNextFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\tif (backward) {\n\t\t\telementToFocus = await this.findPreviousFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\telementToFocus?.focus();\n\t}\n\n\tupdateGroups() {\n\t\tconst container = this.findContainer();\n\n\t\tthis.setSelectedGroup();\n\t\tthis.groups = getFastNavigationGroups(container);\n\t}\n\n\tfindContainer() {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element = this.deepActive(window.document);\n\n\t\twhile (element && element !== htmlElement) {\n\t\t\tconst closestScopeEl = element.closest<HTMLElement>(\"[data-sap-ui-fastnavgroup-container='true']\");\n\n\t\t\tif (closestScopeEl) {\n\t\t\t\treturn closestScopeEl;\n\t\t\t}\n\n\t\t\telement = getParentElement(element);\n\t\t}\n\n\t\treturn document.body;\n\t}\n\n\tsetSelectedGroup(root: DocumentOrShadowRoot = window.document) {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element: Element | null = this.deepActive(root);\n\n\t\twhile (element && element.getAttribute(\"data-sap-ui-fastnavgroup\") !== \"true\" && element !== htmlElement) {\n\t\t\telement = getParentElement(element);\n\t\t}\n\n\t\tthis.selectedGroup = element as HTMLElement;\n\t}\n\n\tdeepActive(root: DocumentOrShadowRoot): Element | null {\n\t\tif (root?.activeElement?.shadowRoot?.activeElement) {\n\t\t\treturn this.deepActive(root.activeElement.shadowRoot);\n\t\t}\n\n\t\treturn root.activeElement;\n\t}\n\n\tdestroy() {\n\t\tthis.removeEventListeners();\n\t}\n\n\tget _ui5RuntimeIndex() {\n\t\treturn currentRuntimeINdex;\n\t}\n\n\tstatic init() {\n\t\tconst f6Registry = getSharedResource<F6Registry>(\"F6Registry\", {});\n\n\t\tif (!f6Registry.instance) {\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t} else if (shouldUpdate(f6Registry.instance?._ui5RuntimeIndex)) {\n\t\t\tf6Registry.instance?.destroy();\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t}\n\t}\n}\n\nregisterFeature(\"F6Navigation\", F6Navigation);\n\nexport default F6Navigation;\n"]}
|
|
@@ -6,6 +6,6 @@ declare class OpenUI5Enablement {
|
|
|
6
6
|
static enrichBusyIndicatorSettings(klass: typeof UI5Element): void;
|
|
7
7
|
static enrichBusyIndicatorMetadata(klass: typeof UI5Element): void;
|
|
8
8
|
static enrichBusyIndicatorMethods(UI5ElementPrototype: typeof OpenUI5Element.prototype): void;
|
|
9
|
-
static getBusyIndicatorStyles():
|
|
9
|
+
static getBusyIndicatorStyles(): string;
|
|
10
10
|
}
|
|
11
11
|
export default OpenUI5Enablement;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type { PopupInfo } from "./patchPopup.js";
|
|
1
2
|
import type { CLDRData } from "../asset-registries/LocaleData.js";
|
|
2
3
|
import type { LegacyDateCalendarCustomizing } from "../features/LegacyDateFormats.js";
|
|
3
4
|
declare class OpenUI5Support {
|
|
4
5
|
static isAtLeastVersion116(): boolean;
|
|
5
6
|
static isOpenUI5Detected(): boolean;
|
|
7
|
+
static initPromise?: Promise<void>;
|
|
6
8
|
static init(): Promise<void>;
|
|
7
9
|
static getConfigurationSettingsObject(): {
|
|
8
10
|
animationMode?: undefined;
|
|
@@ -30,5 +32,8 @@ declare class OpenUI5Support {
|
|
|
30
32
|
static _listenForThemeChange(): void;
|
|
31
33
|
static attachListeners(): void;
|
|
32
34
|
static cssVariablesLoaded(): boolean | undefined;
|
|
35
|
+
static addOpenedPopup(popupInfo: PopupInfo): void;
|
|
36
|
+
static removeOpenedPopup(popup: object): void;
|
|
37
|
+
static getTopmostPopup(): object;
|
|
33
38
|
}
|
|
34
39
|
export default OpenUI5Support;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import patchPatcher from "./patchPatcher.js";
|
|
2
|
-
import patchPopup from "./patchPopup.js";
|
|
2
|
+
import { patchPopup, addOpenedPopup, removeOpenedPopup, getTopmostPopup, } from "./patchPopup.js";
|
|
3
3
|
import { registerFeature } from "../FeaturesRegistry.js";
|
|
4
4
|
import { setTheme } from "../config/Theme.js";
|
|
5
5
|
class OpenUI5Support {
|
|
@@ -21,35 +21,38 @@ class OpenUI5Support {
|
|
|
21
21
|
if (!OpenUI5Support.isOpenUI5Detected()) {
|
|
22
22
|
return Promise.resolve();
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
if (!OpenUI5Support.initPromise) {
|
|
25
|
+
OpenUI5Support.initPromise = new Promise(resolve => {
|
|
26
|
+
window.sap.ui.require(["sap/ui/core/Core"], async (Core) => {
|
|
27
|
+
const callback = () => {
|
|
28
|
+
let deps = ["sap/ui/core/Popup", "sap/m/Dialog", "sap/m/Popover", "sap/ui/core/Patcher", "sap/ui/core/LocaleData"];
|
|
29
|
+
if (OpenUI5Support.isAtLeastVersion116()) { // for versions since 1.116.0 and onward, use the modular core
|
|
30
|
+
deps = [
|
|
31
|
+
...deps,
|
|
32
|
+
"sap/base/i18n/Formatting",
|
|
33
|
+
"sap/base/i18n/Localization",
|
|
34
|
+
"sap/ui/core/ControlBehavior",
|
|
35
|
+
"sap/ui/core/Theming",
|
|
36
|
+
"sap/ui/core/date/CalendarUtils",
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
window.sap.ui.require(deps, (Popup, Dialog, Popover, Patcher) => {
|
|
40
|
+
patchPatcher(Patcher);
|
|
41
|
+
patchPopup(Popup, Dialog, Popover);
|
|
42
|
+
resolve();
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
if (OpenUI5Support.isAtLeastVersion116()) {
|
|
46
|
+
await Core.ready();
|
|
47
|
+
callback();
|
|
37
48
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
if (OpenUI5Support.isAtLeastVersion116()) {
|
|
45
|
-
await Core.ready();
|
|
46
|
-
callback();
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
Core.attachInit(callback);
|
|
50
|
-
}
|
|
49
|
+
else {
|
|
50
|
+
Core.attachInit(callback);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
51
53
|
});
|
|
52
|
-
}
|
|
54
|
+
}
|
|
55
|
+
return OpenUI5Support.initPromise;
|
|
53
56
|
}
|
|
54
57
|
static getConfigurationSettingsObject() {
|
|
55
58
|
if (!OpenUI5Support.isOpenUI5Detected()) {
|
|
@@ -135,7 +138,17 @@ class OpenUI5Support {
|
|
|
135
138
|
if (!link) {
|
|
136
139
|
return false;
|
|
137
140
|
}
|
|
138
|
-
|
|
141
|
+
// The file name is "css_variables.css" until 1.127 and "library.css" from 1.127 onwards
|
|
142
|
+
return !!link.href.match(/\/css(-|_)variables\.css/) || !!link.href.match(/\/library\.css/);
|
|
143
|
+
}
|
|
144
|
+
static addOpenedPopup(popupInfo) {
|
|
145
|
+
addOpenedPopup(popupInfo);
|
|
146
|
+
}
|
|
147
|
+
static removeOpenedPopup(popup) {
|
|
148
|
+
removeOpenedPopup(popup);
|
|
149
|
+
}
|
|
150
|
+
static getTopmostPopup() {
|
|
151
|
+
return getTopmostPopup();
|
|
139
152
|
}
|
|
140
153
|
}
|
|
141
154
|
registerFeature("OpenUI5Support", OpenUI5Support);
|