@ui5/webcomponents-base 0.0.0-2f7664755 → 0.0.0-31ad69296
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/.eslintignore +6 -4
- package/.eslintrc.cjs +3 -0
- package/.npsrc.json +3 -0
- package/CHANGELOG.md +895 -0
- package/README.md +6 -1
- package/bundle.esm.js +9 -3
- package/config/wdio.conf.cjs +400 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/AssetRegistry.d.ts +2 -2
- package/dist/AssetRegistry.js +2 -2
- package/dist/AssetRegistry.js.map +1 -1
- package/dist/Boot.d.ts +6 -4
- package/dist/Boot.js +36 -6
- package/dist/Boot.js.map +1 -1
- package/dist/CSP.d.ts +9 -6
- package/dist/CSP.js +9 -6
- package/dist/CSP.js.map +1 -1
- package/dist/CustomElementsRegistry.js.map +1 -1
- package/dist/CustomElementsScope.d.ts +4 -4
- package/dist/CustomElementsScope.js +2 -2
- package/dist/CustomElementsScope.js.map +1 -1
- package/dist/CustomElementsScopeUtils.d.ts +8 -1
- package/dist/CustomElementsScopeUtils.js +13 -1
- package/dist/CustomElementsScopeUtils.js.map +1 -1
- package/dist/DOMObserver.js.map +1 -1
- package/dist/Device.d.ts +2 -1
- package/dist/Device.js +119 -35
- package/dist/Device.js.map +1 -1
- package/dist/EventProvider.js +1 -1
- package/dist/EventProvider.js.map +1 -1
- package/dist/FeaturesRegistry.js.map +1 -1
- package/dist/FontFace.js +1 -1
- package/dist/FontFace.js.map +1 -1
- package/dist/IgnoreCustomElements.d.ts +25 -0
- package/dist/IgnoreCustomElements.js +37 -0
- package/dist/IgnoreCustomElements.js.map +1 -0
- package/dist/InitialConfiguration.d.ts +7 -2
- package/dist/InitialConfiguration.js +17 -7
- package/dist/InitialConfiguration.js.map +1 -1
- package/dist/Keys.d.ts +5 -1
- package/dist/Keys.js +109 -106
- package/dist/Keys.js.map +1 -1
- package/dist/ManagedStyles.d.ts +5 -4
- package/dist/ManagedStyles.js +95 -15
- package/dist/ManagedStyles.js.map +1 -1
- package/dist/MarkedEvents.js.map +1 -1
- package/dist/MediaRange.d.ts +6 -12
- package/dist/MediaRange.js +21 -31
- package/dist/MediaRange.js.map +1 -1
- package/dist/PropertiesFileFormat.js.map +1 -1
- package/dist/Render.js.map +1 -1
- package/dist/RenderQueue.js.map +1 -1
- package/dist/Runtimes.js.map +1 -1
- package/dist/StaticArea.d.ts +3 -0
- package/dist/StaticArea.js +4 -3
- package/dist/StaticArea.js.map +1 -1
- package/dist/StaticAreaItem.d.ts +3 -4
- package/dist/StaticAreaItem.js +10 -9
- package/dist/StaticAreaItem.js.map +1 -1
- package/dist/SystemCSSVars.js.map +1 -1
- package/dist/Theming.js.map +1 -1
- package/dist/UI5Element.d.ts +54 -39
- package/dist/UI5Element.js +119 -68
- package/dist/UI5Element.js.map +1 -1
- package/dist/UI5ElementMetadata.d.ts +6 -13
- package/dist/UI5ElementMetadata.js +17 -15
- package/dist/UI5ElementMetadata.js.map +1 -1
- package/dist/animations/AnimationQueue.js.map +1 -1
- package/dist/animations/animate.js.map +1 -1
- package/dist/animations/scroll.js.map +1 -1
- package/dist/animations/slideDown.js.map +1 -1
- package/dist/animations/slideUp.js.map +1 -1
- package/dist/asset-registries/Icons.d.ts +22 -13
- package/dist/asset-registries/Icons.js +63 -31
- package/dist/asset-registries/Icons.js.map +1 -1
- package/dist/asset-registries/Illustrations.d.ts +3 -1
- package/dist/asset-registries/Illustrations.js +51 -20
- package/dist/asset-registries/Illustrations.js.map +1 -1
- package/dist/asset-registries/LocaleData.js +1 -1
- package/dist/asset-registries/LocaleData.js.map +1 -1
- package/dist/asset-registries/Themes.d.ts +5 -3
- package/dist/asset-registries/Themes.js +28 -10
- package/dist/asset-registries/Themes.js.map +1 -1
- package/dist/asset-registries/i18n.d.ts +2 -2
- package/dist/asset-registries/i18n.js +12 -5
- package/dist/asset-registries/i18n.js.map +1 -1
- package/dist/asset-registries/util/IconCollectionsAlias.d.ts +30 -0
- package/dist/asset-registries/util/IconCollectionsAlias.js +37 -0
- package/dist/asset-registries/util/IconCollectionsAlias.js.map +1 -0
- package/dist/asset-registries/util/IconCollectionsByTheme.d.ts +20 -0
- package/dist/asset-registries/util/IconCollectionsByTheme.js +42 -0
- package/dist/asset-registries/util/IconCollectionsByTheme.js.map +1 -0
- package/dist/asset-registries/util/getIconCollectionByTheme.d.ts +13 -0
- package/dist/asset-registries/util/getIconCollectionByTheme.js +29 -0
- package/dist/asset-registries/util/getIconCollectionByTheme.js.map +1 -0
- package/dist/config/AnimationMode.d.ts +2 -2
- package/dist/config/AnimationMode.js +1 -1
- package/dist/config/AnimationMode.js.map +1 -1
- package/dist/config/CalendarType.d.ts +8 -1
- package/dist/config/CalendarType.js +18 -2
- package/dist/config/CalendarType.js.map +1 -1
- package/dist/config/FormatSettings.d.ts +5 -1
- package/dist/config/FormatSettings.js +5 -1
- package/dist/config/FormatSettings.js.map +1 -1
- package/dist/config/Icons.d.ts +31 -21
- package/dist/config/Icons.js +28 -32
- package/dist/config/Icons.js.map +1 -1
- package/dist/config/Language.d.ts +11 -2
- package/dist/config/Language.js +19 -4
- package/dist/config/Language.js.map +1 -1
- package/dist/config/NoConflict.js +1 -0
- package/dist/config/NoConflict.js.map +1 -1
- package/dist/config/Theme.d.ts +15 -5
- package/dist/config/Theme.js +31 -9
- package/dist/config/Theme.js.map +1 -1
- package/dist/config/ThemeRoot.d.ts +27 -0
- package/dist/config/ThemeRoot.js +57 -0
- package/dist/config/ThemeRoot.js.map +1 -0
- package/dist/config/Timezone.d.ts +17 -0
- package/dist/config/Timezone.js +30 -0
- package/dist/config/Timezone.js.map +1 -0
- package/dist/connectToComponent.d.ts +9 -0
- package/dist/connectToComponent.js +59 -0
- package/dist/connectToComponent.js.map +1 -0
- package/dist/css/FontFace.css +47 -17
- package/dist/css/SystemCSSVars.css +0 -8
- package/dist/custom-elements-internal.json +2863 -0
- package/dist/custom-elements.json +2593 -0
- package/dist/decorators/customElement.d.ts +17 -2
- package/dist/decorators/customElement.js +25 -5
- package/dist/decorators/customElement.js.map +1 -1
- package/dist/decorators/event.d.ts +5 -2
- package/dist/decorators/event.js +6 -6
- package/dist/decorators/event.js.map +1 -1
- package/dist/decorators/property.js +6 -6
- package/dist/decorators/property.js.map +1 -1
- package/dist/decorators/slot.js +9 -9
- package/dist/decorators/slot.js.map +1 -1
- package/dist/decorators.d.ts +5 -0
- package/dist/decorators.js +6 -0
- package/dist/decorators.js.map +1 -0
- package/dist/delegate/ItemNavigation.d.ts +9 -8
- package/dist/delegate/ItemNavigation.js +13 -14
- package/dist/delegate/ItemNavigation.js.map +1 -1
- package/dist/delegate/ResizeHandler.d.ts +6 -7
- package/dist/delegate/ResizeHandler.js +11 -9
- package/dist/delegate/ResizeHandler.js.map +1 -1
- package/dist/delegate/ScrollEnablement.js +2 -2
- package/dist/delegate/ScrollEnablement.js.map +1 -1
- package/dist/features/F6Navigation.d.ts +3 -0
- package/dist/features/F6Navigation.js +77 -38
- package/dist/features/F6Navigation.js.map +1 -1
- package/dist/features/LegacyDateFormats.d.ts +18 -0
- package/dist/features/LegacyDateFormats.js +20 -0
- package/dist/features/LegacyDateFormats.js.map +1 -0
- package/dist/features/OpenUI5Element.js.map +1 -1
- package/dist/features/OpenUI5Enablement.d.ts +1 -1
- package/dist/features/OpenUI5Enablement.js.map +1 -1
- package/dist/features/OpenUI5Support.d.ts +16 -3
- package/dist/features/OpenUI5Support.js +96 -33
- package/dist/features/OpenUI5Support.js.map +1 -1
- package/dist/features/patchPopup.d.ts +10 -0
- package/dist/features/patchPopup.js +15 -0
- package/dist/features/patchPopup.js.map +1 -0
- package/dist/generated/AssetParameters.d.ts +6 -0
- package/dist/generated/AssetParameters.js +4 -9
- package/dist/generated/AssetParameters.js.map +1 -0
- package/dist/generated/VersionInfo.d.ts +10 -0
- package/dist/generated/VersionInfo.js +9 -8
- package/dist/generated/VersionInfo.js.map +1 -0
- package/dist/generated/css/BusyIndicator.css.js.map +1 -1
- package/dist/generated/css/FontFace.css.js +1 -1
- package/dist/generated/css/FontFace.css.js.map +1 -1
- package/dist/generated/css/OverrideFontFace.css.js.map +1 -1
- package/dist/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/generated/templates/elements/WithComplexTemplateTemplate.lit.d.ts +4 -0
- package/dist/generated/templates/elements/WithComplexTemplateTemplate.lit.js +8 -10
- package/dist/generated/templates/elements/WithComplexTemplateTemplate.lit.js.map +1 -0
- package/dist/getSharedResource.d.ts +1 -1
- package/dist/getSharedResource.js +16 -2
- package/dist/getSharedResource.js.map +1 -1
- package/dist/global.d.ts +2 -0
- package/dist/i18nBundle.d.ts +2 -4
- package/dist/i18nBundle.js +3 -5
- package/dist/i18nBundle.js.map +1 -1
- package/dist/locale/Locale.js.map +1 -1
- package/dist/locale/RTLAwareRegistry.d.ts +1 -1
- package/dist/locale/RTLAwareRegistry.js.map +1 -1
- package/dist/locale/applyDirection.d.ts +3 -2
- package/dist/locale/applyDirection.js +3 -2
- package/dist/locale/applyDirection.js.map +1 -1
- package/dist/locale/directionChange.js.map +1 -1
- package/dist/locale/getEffectiveDir.d.ts +1 -1
- package/dist/locale/getEffectiveDir.js +3 -19
- package/dist/locale/getEffectiveDir.js.map +1 -1
- package/dist/locale/getLocale.js.map +1 -1
- package/dist/locale/languageChange.js.map +1 -1
- package/dist/locale/nextFallbackLocale.js.map +1 -1
- package/dist/locale/normalizeLocale.js.map +1 -1
- package/dist/renderer/LitRenderer.d.ts +5 -5
- package/dist/renderer/LitRenderer.js.map +1 -1
- package/dist/renderer/directives/style-map.d.ts +13 -0
- package/dist/renderer/directives/style-map.js +59 -59
- package/dist/renderer/directives/style-map.js.map +1 -0
- package/dist/renderer/executeTemplate.js +1 -1
- package/dist/renderer/executeTemplate.js.map +1 -1
- package/dist/sap/base/Log.js +698 -188
- package/dist/sap/base/assert.js +28 -1
- package/dist/sap/base/config/MemoryConfigurationProvider.js +20 -0
- package/dist/sap/base/security/URLListValidator.js +253 -6
- package/dist/sap/base/security/encodeCSS.js +34 -8
- package/dist/sap/base/security/encodeXML.js +47 -17
- package/dist/sap/base/security/sanitizeHTML.js +35 -13
- package/dist/sap/base/strings/toHex.js +27 -2
- package/dist/sap/base/util/now.js +24 -3
- package/dist/sap/base/util/uid.js +27 -0
- package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +113 -98
- package/dist/ssr-dom-shim.d.ts +1 -0
- package/dist/ssr-dom-shim.js +12 -0
- package/dist/ssr-dom-shim.js.map +1 -0
- package/dist/ssr-dom.d.ts +0 -0
- package/dist/ssr-dom.js +3 -0
- package/dist/ssr-dom.js.map +1 -0
- package/dist/theming/CustomStyle.js +7 -5
- package/dist/theming/CustomStyle.js.map +1 -1
- package/dist/theming/ThemeLoaded.js.map +1 -1
- package/dist/theming/ThemeRegistered.d.ts +4 -0
- package/dist/theming/ThemeRegistered.js +11 -0
- package/dist/theming/ThemeRegistered.js.map +1 -0
- package/dist/theming/applyTheme.js +8 -7
- package/dist/theming/applyTheme.js.map +1 -1
- package/dist/theming/getConstructableStyle.js.map +1 -1
- package/dist/theming/getEffectiveLinksHrefs.js.map +1 -1
- package/dist/theming/getEffectiveStyle.js.map +1 -1
- package/dist/theming/getStylesString.d.ts +1 -1
- package/dist/theming/getStylesString.js.map +1 -1
- package/dist/theming/getThemeDesignerTheme.js.map +1 -1
- package/dist/theming/preloadLinks.js.map +1 -1
- package/dist/thirdparty/_merge.js.map +1 -1
- package/dist/thirdparty/isPlainObject.js.map +1 -1
- package/dist/thirdparty/merge.js.map +1 -1
- package/dist/types/AnimationMode.d.ts +0 -8
- package/dist/types/AnimationMode.js +0 -8
- package/dist/types/AnimationMode.js.map +1 -1
- package/dist/types/CSSColor.d.ts +0 -5
- package/dist/types/CSSColor.js +0 -5
- package/dist/types/CSSColor.js.map +1 -1
- package/dist/types/CSSSize.d.ts +11 -0
- package/dist/types/CSSSize.js +14 -0
- package/dist/types/CSSSize.js.map +1 -0
- package/dist/types/CalendarType.d.ts +0 -9
- package/dist/types/CalendarType.js +0 -9
- package/dist/types/CalendarType.js.map +1 -1
- package/dist/types/DOMReference.d.ts +1 -5
- package/dist/types/DOMReference.js +1 -5
- package/dist/types/DOMReference.js.map +1 -1
- package/dist/types/DataType.d.ts +1 -6
- package/dist/types/DataType.js +1 -6
- package/dist/types/DataType.js.map +1 -1
- package/dist/types/Float.d.ts +0 -4
- package/dist/types/Float.js +0 -4
- package/dist/types/Float.js.map +1 -1
- package/dist/types/Integer.d.ts +0 -4
- package/dist/types/Integer.js +0 -4
- package/dist/types/Integer.js.map +1 -1
- package/dist/types/InvisibleMessageMode.d.ts +5 -10
- package/dist/types/InvisibleMessageMode.js +4 -11
- package/dist/types/InvisibleMessageMode.js.map +1 -1
- package/dist/types/ItemNavigationBehavior.d.ts +0 -6
- package/dist/types/ItemNavigationBehavior.js +0 -6
- package/dist/types/ItemNavigationBehavior.js.map +1 -1
- package/dist/types/MovePlacement.d.ts +20 -0
- package/dist/types/MovePlacement.js +22 -0
- package/dist/types/MovePlacement.js.map +1 -0
- package/dist/types/NavigationMode.d.ts +0 -8
- package/dist/types/NavigationMode.js +0 -8
- package/dist/types/NavigationMode.js.map +1 -1
- package/dist/types/Orientation.d.ts +16 -0
- package/dist/types/Orientation.js +18 -0
- package/dist/types/Orientation.js.map +1 -0
- package/dist/types/ValueState.d.ts +0 -14
- package/dist/types/ValueState.js +0 -14
- package/dist/types/ValueState.js.map +1 -1
- package/dist/types.d.ts +11 -1
- package/dist/types.js.map +1 -1
- package/dist/updateShadowRoot.js +13 -5
- package/dist/updateShadowRoot.js.map +1 -1
- package/dist/util/AriaLabelHelper.d.ts +10 -1
- package/dist/util/AriaLabelHelper.js +135 -8
- package/dist/util/AriaLabelHelper.js.map +1 -1
- package/dist/util/Caret.js.map +1 -1
- package/dist/util/ColorConversion.js +200 -195
- package/dist/util/ColorConversion.js.map +1 -1
- package/dist/util/FetchHelper.js.map +1 -1
- package/dist/util/FocusableElements.js +4 -3
- package/dist/util/FocusableElements.js.map +1 -1
- package/dist/util/HTMLSanitizer.js.map +1 -1
- package/dist/util/InvisibleMessage.js.map +1 -1
- package/dist/util/PopupUtils.js +1 -1
- package/dist/util/PopupUtils.js.map +1 -1
- package/dist/util/SlotsHelper.js.map +1 -1
- package/dist/util/StringHelper.js.map +1 -1
- package/dist/util/TabbableElements.js.map +1 -1
- package/dist/util/arraysAreEqual.js.map +1 -1
- package/dist/util/clamp.js +2 -1
- package/dist/util/clamp.js.map +1 -1
- package/dist/util/createLinkInHead.d.ts +1 -1
- package/dist/util/createLinkInHead.js +1 -1
- package/dist/util/createLinkInHead.js.map +1 -1
- package/dist/util/createStyleInHead.d.ts +1 -1
- package/dist/util/createStyleInHead.js +1 -1
- package/dist/util/createStyleInHead.js.map +1 -1
- package/dist/util/debounce.js.map +1 -1
- package/dist/util/detectNavigatorLanguage.d.ts +2 -2
- package/dist/util/detectNavigatorLanguage.js +6 -1
- package/dist/util/detectNavigatorLanguage.js.map +1 -1
- package/dist/util/dragAndDrop/DragRegistry.d.ts +12 -0
- package/dist/util/dragAndDrop/DragRegistry.js +66 -0
- package/dist/util/dragAndDrop/DragRegistry.js.map +1 -0
- package/dist/util/dragAndDrop/findClosestPosition.d.ts +7 -0
- package/dist/util/dragAndDrop/findClosestPosition.js +59 -0
- package/dist/util/dragAndDrop/findClosestPosition.js.map +1 -0
- package/dist/util/dragAndDrop/longDragOverHandler.d.ts +2 -0
- package/dist/util/dragAndDrop/longDragOverHandler.js +25 -0
- package/dist/util/dragAndDrop/longDragOverHandler.js.map +1 -0
- package/dist/util/escapeRegex.js.map +1 -1
- package/dist/util/formatMessage.js.map +1 -1
- package/dist/util/generateHighlightedMarkup.js.map +1 -1
- package/dist/util/getActiveElement.js.map +1 -1
- package/dist/util/getClassCopy.d.ts +63 -43
- package/dist/util/getClassCopy.js.map +1 -1
- package/dist/util/getDesigntimePropertyAsArray.d.ts +2 -2
- package/dist/util/getDesigntimePropertyAsArray.js +2 -1
- package/dist/util/getDesigntimePropertyAsArray.js.map +1 -1
- package/dist/util/getEffectiveContentDensity.js.map +1 -1
- package/dist/util/getEffectiveScrollbarStyle.js.map +1 -1
- package/dist/util/getFastNavigationGroups.js.map +1 -1
- package/dist/util/getFileExtension.js.map +1 -1
- package/dist/util/getNormalizedTarget.js.map +1 -1
- package/dist/util/getParentElement.d.ts +2 -0
- package/dist/util/getParentElement.js +5 -0
- package/dist/util/getParentElement.js.map +1 -0
- package/dist/util/getSingletonElementInstance.d.ts +10 -1
- package/dist/util/getSingletonElementInstance.js +11 -2
- package/dist/util/getSingletonElementInstance.js.map +1 -1
- package/dist/util/isElementClickable.js.map +1 -1
- package/dist/util/isElementContainingBlock.d.ts +2 -0
- package/dist/util/isElementContainingBlock.js +11 -0
- package/dist/util/isElementContainingBlock.js.map +1 -0
- package/dist/util/isElementHidden.js.map +1 -1
- package/dist/util/isElementInView.js.map +1 -1
- package/dist/util/isElementTabbable.js.map +1 -1
- package/dist/util/isValidPropertyName.js.map +1 -1
- package/dist/util/whenDOMReady.js.map +1 -1
- package/dist/util/willShowContent.js.map +1 -1
- package/dist/validateThemeRoot.js +14 -13
- package/dist/validateThemeRoot.js.map +1 -1
- package/dist/vscode.html-custom-data.json +22 -0
- package/index.js +225 -1
- package/lib/generate-asset-parameters/index.js +6 -4
- package/lib/generate-styles/index.js +3 -3
- package/lib/generate-version-info/index.js +3 -3
- package/{package-scripts.js → package-scripts.cjs} +22 -22
- package/package.json +15 -6
- package/src/css/FontFace.css +47 -17
- package/src/css/SystemCSSVars.css +0 -8
- package/tsconfig.json +7 -0
- package/used-modules.txt +4 -0
- package/config/wdio.conf.js +0 -1
- package/dist/api.json +0 -1
- package/dist/assets/bundle.esm.8fc86dc4.js +0 -56
- package/dist/assets-meta/IconCollectionsAlias.d.ts +0 -17
- package/dist/assets-meta/IconCollectionsAlias.js +0 -18
- package/dist/assets-meta/IconCollectionsAlias.js.map +0 -1
- package/dist/config/RTL.d.ts +0 -7
- package/dist/config/RTL.js +0 -34
- package/dist/config/RTL.js.map +0 -1
- package/dist/config/ThemeRoots.d.ts +0 -4
- package/dist/config/ThemeRoots.js +0 -28
- package/dist/config/ThemeRoots.js.map +0 -1
- package/dist/decorators/fastNavigation.d.ts +0 -7
- package/dist/decorators/fastNavigation.js +0 -13
- package/dist/decorators/fastNavigation.js.map +0 -1
- package/dist/decorators/languageAware.d.ts +0 -7
- package/dist/decorators/languageAware.js +0 -13
- package/dist/decorators/languageAware.js.map +0 -1
- package/dist/decorators/themeAware.d.ts +0 -7
- package/dist/decorators/themeAware.js +0 -13
- package/dist/decorators/themeAware.js.map +0 -1
- package/src/AssetRegistry.ts +0 -11
- package/src/Boot.ts +0 -61
- package/src/CSP.ts +0 -66
- package/src/CustomElementsRegistry.ts +0 -98
- package/src/CustomElementsScope.ts +0 -33
- package/src/CustomElementsScopeUtils.ts +0 -115
- package/src/DOMObserver.ts +0 -28
- package/src/Device.ts +0 -124
- package/src/EventProvider.ts +0 -87
- package/src/FeaturesRegistry.ts +0 -14
- package/src/FontFace.ts +0 -31
- package/src/InitialConfiguration.ts +0 -207
- package/src/Keys.ts +0 -295
- package/src/ManagedStyles.ts +0 -92
- package/src/MarkedEvents.ts +0 -20
- package/src/MediaRange.ts +0 -110
- package/src/PropertiesFileFormat.ts +0 -95
- package/src/Render.ts +0 -180
- package/src/RenderQueue.ts +0 -71
- package/src/Runtimes.ts +0 -114
- package/src/StaticArea.ts +0 -3
- package/src/StaticAreaItem.ts +0 -113
- package/src/SystemCSSVars.ts +0 -10
- package/src/Theming.ts +0 -4
- package/src/UI5Element.ts +0 -1156
- package/src/UI5ElementMetadata.ts +0 -389
- package/src/animations/AnimationQueue.ts +0 -43
- package/src/animations/animate.ts +0 -64
- package/src/animations/scroll.ts +0 -21
- package/src/animations/slideDown.ts +0 -72
- package/src/animations/slideUp.ts +0 -67
- package/src/asset-registries/Icons.ts +0 -162
- package/src/asset-registries/Illustrations.ts +0 -75
- package/src/asset-registries/LocaleData.ts +0 -172
- package/src/asset-registries/Themes.ts +0 -67
- package/src/asset-registries/i18n.ts +0 -118
- package/src/assets-meta/IconCollectionsAlias.ts +0 -18
- package/src/config/AnimationMode.ts +0 -33
- package/src/config/CalendarType.ts +0 -23
- package/src/config/FormatSettings.ts +0 -21
- package/src/config/Icons.ts +0 -59
- package/src/config/Language.ts +0 -72
- package/src/config/NoConflict.ts +0 -67
- package/src/config/RTL.ts +0 -41
- package/src/config/Theme.ts +0 -64
- package/src/config/ThemeRoots.ts +0 -41
- package/src/decorators/customElement.ts +0 -17
- package/src/decorators/event.ts +0 -28
- package/src/decorators/fastNavigation.ts +0 -14
- package/src/decorators/languageAware.ts +0 -14
- package/src/decorators/property.ts +0 -30
- package/src/decorators/slot.ts +0 -49
- package/src/decorators/themeAware.ts +0 -14
- package/src/delegate/ItemNavigation.ts +0 -393
- package/src/delegate/ResizeHandler.ts +0 -95
- package/src/delegate/ScrollEnablement.ts +0 -224
- package/src/features/F6Navigation.ts +0 -141
- package/src/features/OpenUI5Element.ts +0 -11
- package/src/features/OpenUI5Enablement.ts +0 -117
- package/src/features/OpenUI5Support.ts +0 -148
- package/src/generated/css/BusyIndicator.css.ts +0 -9
- package/src/generated/css/FontFace.css.ts +0 -9
- package/src/generated/css/OverrideFontFace.css.ts +0 -9
- package/src/generated/css/SystemCSSVars.css.ts +0 -9
- package/src/getSharedResource.ts +0 -30
- package/src/global.d.ts +0 -38
- package/src/i18nBundle.ts +0 -108
- package/src/locale/Locale.ts +0 -101
- package/src/locale/RTLAwareRegistry.ts +0 -16
- package/src/locale/applyDirection.ts +0 -18
- package/src/locale/directionChange.ts +0 -34
- package/src/locale/getEffectiveDir.ts +0 -28
- package/src/locale/getLocale.ts +0 -46
- package/src/locale/languageChange.ts +0 -24
- package/src/locale/nextFallbackLocale.ts +0 -28
- package/src/locale/normalizeLocale.ts +0 -56
- package/src/renderer/LitRenderer.ts +0 -60
- package/src/renderer/directives/style-map.js +0 -72
- package/src/renderer/executeTemplate.ts +0 -40
- package/src/theming/CustomStyle.ts +0 -62
- package/src/theming/ThemeLoaded.ts +0 -24
- package/src/theming/applyTheme.ts +0 -90
- package/src/theming/getConstructableStyle.ts +0 -31
- package/src/theming/getEffectiveLinksHrefs.ts +0 -26
- package/src/theming/getEffectiveStyle.ts +0 -41
- package/src/theming/getStylesString.ts +0 -15
- package/src/theming/getThemeDesignerTheme.ts +0 -101
- package/src/theming/preloadLinks.ts +0 -24
- package/src/thirdparty/_merge.ts +0 -32
- package/src/thirdparty/isPlainObject.ts +0 -18
- package/src/thirdparty/merge.ts +0 -5
- package/src/types/AnimationMode.ts +0 -33
- package/src/types/CSSColor.ts +0 -20
- package/src/types/CalendarType.ts +0 -38
- package/src/types/DOMReference.ts +0 -28
- package/src/types/DataType.ts +0 -51
- package/src/types/Float.ts +0 -25
- package/src/types/Integer.ts +0 -25
- package/src/types/InvisibleMessageMode.ts +0 -27
- package/src/types/ItemNavigationBehavior.ts +0 -26
- package/src/types/NavigationMode.ts +0 -33
- package/src/types/ValueState.ts +0 -47
- package/src/types.ts +0 -30
- package/src/updateShadowRoot.ts +0 -37
- package/src/util/AriaLabelHelper.ts +0 -63
- package/src/util/Caret.ts +0 -28
- package/src/util/ColorConversion.ts +0 -399
- package/src/util/FetchHelper.ts +0 -31
- package/src/util/FocusableElements.ts +0 -92
- package/src/util/HTMLSanitizer.ts +0 -9
- package/src/util/InvisibleMessage.ts +0 -69
- package/src/util/PopupUtils.ts +0 -112
- package/src/util/SlotsHelper.ts +0 -39
- package/src/util/StringHelper.ts +0 -26
- package/src/util/TabbableElements.ts +0 -70
- package/src/util/arraysAreEqual.ts +0 -15
- package/src/util/clamp.ts +0 -12
- package/src/util/createLinkInHead.ts +0 -25
- package/src/util/createStyleInHead.ts +0 -20
- package/src/util/debounce.ts +0 -18
- package/src/util/detectNavigatorLanguage.ts +0 -13
- package/src/util/escapeRegex.ts +0 -11
- package/src/util/formatMessage.ts +0 -24
- package/src/util/generateHighlightedMarkup.ts +0 -43
- package/src/util/getActiveElement.ts +0 -11
- package/src/util/getClassCopy.ts +0 -12
- package/src/util/getDesigntimePropertyAsArray.ts +0 -4
- package/src/util/getEffectiveContentDensity.ts +0 -5
- package/src/util/getEffectiveScrollbarStyle.ts +0 -5
- package/src/util/getFastNavigationGroups.ts +0 -63
- package/src/util/getFileExtension.ts +0 -21
- package/src/util/getNormalizedTarget.ts +0 -16
- package/src/util/getSingletonElementInstance.ts +0 -13
- package/src/util/isElementClickable.ts +0 -19
- package/src/util/isElementHidden.ts +0 -9
- package/src/util/isElementInView.ts +0 -15
- package/src/util/isElementTabbable.ts +0 -37
- package/src/util/isValidPropertyName.ts +0 -29
- package/src/util/whenDOMReady.ts +0 -13
- package/src/util/willShowContent.ts +0 -7
- package/src/validateThemeRoot.ts +0 -58
package/dist/UI5Element.d.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
import "@ui5/webcomponents-base/dist/ssr-dom.js";
|
|
1
2
|
import UI5ElementMetadata, { Slot, SlotValue, State, PropertyValue, Metadata } from "./UI5ElementMetadata.js";
|
|
2
3
|
import EventProvider from "./EventProvider.js";
|
|
3
4
|
import StaticAreaItem from "./StaticAreaItem.js";
|
|
4
|
-
import { TemplateFunction, TemplateFunctionResult } from "./renderer/executeTemplate.js";
|
|
5
|
-
import { PromiseResolve, ComponentStylesData, ClassMap } from "./types.js";
|
|
5
|
+
import type { TemplateFunction, TemplateFunctionResult } from "./renderer/executeTemplate.js";
|
|
6
|
+
import type { AccessibilityInfo, PromiseResolve, ComponentStylesData, ClassMap } from "./types.js";
|
|
7
|
+
type Renderer = (templateResult: TemplateFunctionResult, container: HTMLElement | DocumentFragment, styleStrOrHrefsArr: string | Array<string> | undefined, forStaticArea: boolean, options: RendererOptions) => void;
|
|
8
|
+
type RendererOptions = {
|
|
9
|
+
/**
|
|
10
|
+
* An object to use as the `this` value for event listeners. It's often
|
|
11
|
+
* useful to set this to the host component rendering a template.
|
|
12
|
+
*/
|
|
13
|
+
host?: object;
|
|
14
|
+
};
|
|
6
15
|
type ChangeInfo = {
|
|
7
16
|
type: "property" | "slot";
|
|
8
17
|
name: string;
|
|
@@ -18,12 +27,9 @@ type InvalidationInfo = ChangeInfo & {
|
|
|
18
27
|
type ChildChangeListener = (param: InvalidationInfo) => void;
|
|
19
28
|
type SlotChangeListener = (this: HTMLSlotElement, ev: Event) => void;
|
|
20
29
|
/**
|
|
30
|
+
* @class
|
|
21
31
|
* Base class for all UI5 Web Components
|
|
22
32
|
*
|
|
23
|
-
* @class
|
|
24
|
-
* @constructor
|
|
25
|
-
* @author SAP SE
|
|
26
|
-
* @alias sap.ui.webc.base.UI5Element
|
|
27
33
|
* @extends HTMLElement
|
|
28
34
|
* @public
|
|
29
35
|
*/
|
|
@@ -31,7 +37,8 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
31
37
|
__id?: string;
|
|
32
38
|
_suppressInvalidation: boolean;
|
|
33
39
|
_changedState: Array<ChangeInfo>;
|
|
34
|
-
|
|
40
|
+
_invalidationEventProvider: EventProvider<InvalidationInfo, void>;
|
|
41
|
+
_componentStateFinalizedEventProvider: EventProvider<void, void>;
|
|
35
42
|
_inDOM: boolean;
|
|
36
43
|
_fullyConnected: boolean;
|
|
37
44
|
_childChangeListeners: Map<string, ChildChangeListener>;
|
|
@@ -41,15 +48,16 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
41
48
|
};
|
|
42
49
|
_doNotSyncAttributes: Set<string>;
|
|
43
50
|
_state: State;
|
|
44
|
-
_onComponentStateFinalized?: () => void;
|
|
45
51
|
_getRealDomRef?: () => HTMLElement;
|
|
46
52
|
staticAreaItem?: StaticAreaItem;
|
|
47
53
|
static template?: TemplateFunction;
|
|
48
54
|
static staticAreaTemplate?: TemplateFunction;
|
|
49
55
|
static _metadata: UI5ElementMetadata;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated
|
|
58
|
+
*/
|
|
59
|
+
static render: Renderer;
|
|
60
|
+
static renderer?: Renderer;
|
|
53
61
|
constructor();
|
|
54
62
|
/**
|
|
55
63
|
* Returns a unique ID for this UI5 Element
|
|
@@ -58,6 +66,8 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
58
66
|
* @protected
|
|
59
67
|
*/
|
|
60
68
|
get _id(): string;
|
|
69
|
+
render(): object;
|
|
70
|
+
renderStatic(): object;
|
|
61
71
|
/**
|
|
62
72
|
* Do not call this method from derivatives of UI5Element, use "onEnterDOM" only
|
|
63
73
|
* @private
|
|
@@ -113,22 +123,22 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
113
123
|
/**
|
|
114
124
|
* Attach a callback that will be executed whenever the component is invalidated
|
|
115
125
|
*
|
|
116
|
-
* @param
|
|
126
|
+
* @param callback
|
|
117
127
|
* @public
|
|
118
128
|
*/
|
|
119
129
|
attachInvalidate(callback: (param: InvalidationInfo) => void): void;
|
|
120
130
|
/**
|
|
121
131
|
* Detach the callback that is executed whenever the component is invalidated
|
|
122
132
|
*
|
|
123
|
-
* @param
|
|
133
|
+
* @param callback
|
|
124
134
|
* @public
|
|
125
135
|
*/
|
|
126
136
|
detachInvalidate(callback: (param: InvalidationInfo) => void): void;
|
|
127
137
|
/**
|
|
128
138
|
* Callback that is executed whenever a monitored child changes its state
|
|
129
139
|
*
|
|
130
|
-
* @param
|
|
131
|
-
* @param
|
|
140
|
+
* @param slotName the slot in which a child was invalidated
|
|
141
|
+
* @param childChangeInfo the changeInfo object for the child in the given slot
|
|
132
142
|
* @private
|
|
133
143
|
*/
|
|
134
144
|
_onChildChange(slotName: string, childChangeInfo: ChangeInfo): void;
|
|
@@ -153,15 +163,13 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
153
163
|
* Returns a singleton event listener for the "change" event of a child in a given slot
|
|
154
164
|
*
|
|
155
165
|
* @param slotName the name of the slot, where the child is
|
|
156
|
-
* @returns {ChildChangeListener}
|
|
157
166
|
* @private
|
|
158
167
|
*/
|
|
159
|
-
_getChildChangeListener(slotName: string): ChildChangeListener
|
|
168
|
+
_getChildChangeListener(slotName: string): ChildChangeListener;
|
|
160
169
|
/**
|
|
161
170
|
* Returns a singleton slotchange event listener that invalidates the component due to changes in the given slot
|
|
162
171
|
*
|
|
163
172
|
* @param slotName the name of the slot, where the slot element (whose slotchange event we're listening to) is
|
|
164
|
-
* @returns {SlotChangeListener}
|
|
165
173
|
* @private
|
|
166
174
|
*/
|
|
167
175
|
_getSlotChangeListener(slotName: string): SlotChangeListener;
|
|
@@ -245,7 +253,7 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
245
253
|
getFocusDomRefAsync(): Promise<HTMLElement | undefined>;
|
|
246
254
|
/**
|
|
247
255
|
* Set the focus to the element, returned by "getFocusDomRef()" (marked by "data-sap-focus-ref")
|
|
248
|
-
* @param
|
|
256
|
+
* @param focusOptions additional options for the focus
|
|
249
257
|
* @public
|
|
250
258
|
*/
|
|
251
259
|
focus(focusOptions?: FocusOptions): Promise<void>;
|
|
@@ -256,7 +264,7 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
256
264
|
* @param data - additional data for the event
|
|
257
265
|
* @param cancelable - true, if the user can call preventDefault on the event object
|
|
258
266
|
* @param bubbles - true, if the event bubbles
|
|
259
|
-
* @returns
|
|
267
|
+
* @returns false, if the event was cancelled (preventDefault called), true otherwise
|
|
260
268
|
*/
|
|
261
269
|
fireEvent<T>(name: string, data?: T, cancelable?: boolean, bubbles?: boolean): boolean;
|
|
262
270
|
_fireEvent<T>(name: string, data?: T, cancelable?: boolean, bubbles?: boolean): boolean;
|
|
@@ -265,22 +273,41 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
265
273
|
* Useful when there are transitive slots in nested component scenarios and you don't want to get a list of the slots, but rather of their content.
|
|
266
274
|
* @public
|
|
267
275
|
*/
|
|
268
|
-
getSlottedNodes(slotName: string):
|
|
276
|
+
getSlottedNodes<T = Node>(slotName: string): Array<T>;
|
|
277
|
+
/**
|
|
278
|
+
* Attach a callback that will be executed whenever the component's state is finalized
|
|
279
|
+
*
|
|
280
|
+
* @param callback
|
|
281
|
+
* @public
|
|
282
|
+
*/
|
|
283
|
+
attachComponentStateFinalized(callback: () => void): void;
|
|
284
|
+
/**
|
|
285
|
+
* Detach the callback that is executed whenever the component's state is finalized
|
|
286
|
+
*
|
|
287
|
+
* @param callback
|
|
288
|
+
* @public
|
|
289
|
+
*/
|
|
290
|
+
detachComponentStateFinalized(callback: () => void): void;
|
|
269
291
|
/**
|
|
270
292
|
* Determines whether the component should be rendered in RTL mode or not.
|
|
271
293
|
* Returns: "rtl", "ltr" or undefined
|
|
272
294
|
*
|
|
273
295
|
* @public
|
|
274
|
-
* @
|
|
296
|
+
* @default undefined
|
|
275
297
|
*/
|
|
276
298
|
get effectiveDir(): string | undefined;
|
|
277
299
|
/**
|
|
278
300
|
* Used to duck-type UI5 elements without using instanceof
|
|
279
|
-
* @returns {boolean}
|
|
280
301
|
* @public
|
|
302
|
+
* @default true
|
|
281
303
|
*/
|
|
282
304
|
get isUI5Element(): boolean;
|
|
283
305
|
get classes(): ClassMap;
|
|
306
|
+
/**
|
|
307
|
+
* Returns the component accessibility info.
|
|
308
|
+
* @private
|
|
309
|
+
*/
|
|
310
|
+
get accessibilityInfo(): AccessibilityInfo;
|
|
284
311
|
/**
|
|
285
312
|
* Do not override this method in derivatives of UI5Element, use metadata properties instead
|
|
286
313
|
* @private
|
|
@@ -306,17 +333,12 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
306
333
|
* Returns the metadata object for this UI5 Web Component Class
|
|
307
334
|
* @protected
|
|
308
335
|
*/
|
|
309
|
-
static
|
|
310
|
-
/**
|
|
311
|
-
* Sets a new metadata object for this UI5 Web Component Class
|
|
312
|
-
* @protected
|
|
313
|
-
*/
|
|
314
|
-
static set metadata(newMetadata: Metadata);
|
|
336
|
+
static metadata: Metadata;
|
|
315
337
|
/**
|
|
316
338
|
* Returns the CSS for this UI5 Web Component Class
|
|
317
339
|
* @protected
|
|
318
340
|
*/
|
|
319
|
-
static
|
|
341
|
+
static styles: ComponentStylesData;
|
|
320
342
|
/**
|
|
321
343
|
* Returns the Static Area CSS for this UI5 Web Component Class
|
|
322
344
|
* @protected
|
|
@@ -335,40 +357,33 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
335
357
|
*
|
|
336
358
|
* @public
|
|
337
359
|
*/
|
|
338
|
-
static getUniqueDependencies(this: typeof UI5Element):
|
|
360
|
+
static getUniqueDependencies(this: typeof UI5Element): Array<typeof UI5Element>;
|
|
339
361
|
/**
|
|
340
362
|
* Returns a promise that resolves whenever all dependencies for this UI5 Web Component have resolved
|
|
341
|
-
*
|
|
342
|
-
* @returns {Promise}
|
|
343
363
|
*/
|
|
344
364
|
static whenDependenciesDefined(): Promise<Array<typeof UI5Element>>;
|
|
345
365
|
/**
|
|
346
366
|
* Hook that will be called upon custom element definition
|
|
347
367
|
*
|
|
348
368
|
* @protected
|
|
349
|
-
* @returns {Promise<void>}
|
|
350
369
|
*/
|
|
351
370
|
static onDefine(): Promise<void>;
|
|
352
371
|
/**
|
|
353
372
|
* Registers a UI5 Web Component in the browser window object
|
|
354
373
|
* @public
|
|
355
|
-
* @returns {Promise<UI5Element>}
|
|
356
374
|
*/
|
|
357
375
|
static define(): Promise<typeof UI5Element>;
|
|
358
376
|
/**
|
|
359
377
|
* Returns an instance of UI5ElementMetadata.js representing this UI5 Web Component's full metadata (its and its parents')
|
|
360
378
|
* Note: not to be confused with the "get metadata()" method, which returns an object for this class's metadata only
|
|
361
379
|
* @public
|
|
362
|
-
* @returns {UI5ElementMetadata}
|
|
363
380
|
*/
|
|
364
381
|
static getMetadata(): UI5ElementMetadata;
|
|
365
|
-
static decoratorMetadata: Metadata;
|
|
366
382
|
}
|
|
367
383
|
/**
|
|
368
384
|
* Always use duck-typing to cover all runtimes on the page.
|
|
369
|
-
* @returns {boolean}
|
|
370
385
|
*/
|
|
371
386
|
declare const instanceOfUI5Element: (object: any) => object is UI5Element;
|
|
372
387
|
export default UI5Element;
|
|
373
388
|
export { instanceOfUI5Element };
|
|
374
|
-
export type { ChangeInfo };
|
|
389
|
+
export type { ChangeInfo, Renderer, RendererOptions, };
|
package/dist/UI5Element.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
+
import "@ui5/webcomponents-base/dist/ssr-dom.js";
|
|
1
3
|
import merge from "./thirdparty/merge.js";
|
|
2
4
|
import { boot } from "./Boot.js";
|
|
3
5
|
import UI5ElementMetadata from "./UI5ElementMetadata.js";
|
|
@@ -5,6 +7,7 @@ import EventProvider from "./EventProvider.js";
|
|
|
5
7
|
import getSingletonElementInstance from "./util/getSingletonElementInstance.js";
|
|
6
8
|
import StaticAreaItem from "./StaticAreaItem.js";
|
|
7
9
|
import updateShadowRoot from "./updateShadowRoot.js";
|
|
10
|
+
import { shouldIgnoreCustomElement } from "./IgnoreCustomElements.js";
|
|
8
11
|
import { renderDeferred, renderImmediately, cancelRender } from "./Render.js";
|
|
9
12
|
import { registerTag, isTagRegistered, recordTagRegistrationFailure } from "./CustomElementsRegistry.js";
|
|
10
13
|
import { observeDOMNode, unobserveDOMNode } from "./DOMObserver.js";
|
|
@@ -16,6 +19,7 @@ import { getSlotName, getSlottedNodesList } from "./util/SlotsHelper.js";
|
|
|
16
19
|
import arraysAreEqual from "./util/arraysAreEqual.js";
|
|
17
20
|
import { markAsRtlAware } from "./locale/RTLAwareRegistry.js";
|
|
18
21
|
import preloadLinks from "./theming/preloadLinks.js";
|
|
22
|
+
import executeTemplate from "./renderer/executeTemplate.js";
|
|
19
23
|
let autoId = 0;
|
|
20
24
|
const elementTimeouts = new Map();
|
|
21
25
|
const uniqueDependenciesCache = new Map();
|
|
@@ -34,16 +38,28 @@ function _invalidate(changeInfo) {
|
|
|
34
38
|
this.onInvalidation(changeInfo);
|
|
35
39
|
this._changedState.push(changeInfo);
|
|
36
40
|
renderDeferred(this);
|
|
37
|
-
this.
|
|
41
|
+
this._invalidationEventProvider.fireEvent("invalidate", { ...changeInfo, target: this });
|
|
38
42
|
}
|
|
39
|
-
let metadata = {};
|
|
40
43
|
/**
|
|
44
|
+
* looks up a property descsriptor including in the prototype chain
|
|
45
|
+
* @param proto the starting prototype
|
|
46
|
+
* @param name the property to look for
|
|
47
|
+
* @returns the property descriptor if found directly or in the prototype chaing, undefined if not found
|
|
48
|
+
*/
|
|
49
|
+
function getPropertyDescriptor(proto, name) {
|
|
50
|
+
do {
|
|
51
|
+
const descriptor = Object.getOwnPropertyDescriptor(proto, name);
|
|
52
|
+
if (descriptor) {
|
|
53
|
+
return descriptor;
|
|
54
|
+
}
|
|
55
|
+
// go up the prototype chain
|
|
56
|
+
proto = Object.getPrototypeOf(proto);
|
|
57
|
+
} while (proto && proto !== HTMLElement.prototype);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @class
|
|
41
61
|
* Base class for all UI5 Web Components
|
|
42
62
|
*
|
|
43
|
-
* @class
|
|
44
|
-
* @constructor
|
|
45
|
-
* @author SAP SE
|
|
46
|
-
* @alias sap.ui.webc.base.UI5Element
|
|
47
63
|
* @extends HTMLElement
|
|
48
64
|
* @public
|
|
49
65
|
*/
|
|
@@ -57,7 +73,8 @@ class UI5Element extends HTMLElement {
|
|
|
57
73
|
this._fullyConnected = false; // A flag telling whether the UI5Element's onEnterDOM hook was called (since it's possible to have the element removed from DOM before that)
|
|
58
74
|
this._childChangeListeners = new Map(); // used to store lazy listeners per slot for the child change event of every child inside that slot
|
|
59
75
|
this._slotChangeListeners = new Map(); // used to store lazy listeners per slot for the slotchange event of all slot children inside that slot
|
|
60
|
-
this.
|
|
76
|
+
this._invalidationEventProvider = new EventProvider(); // used by parent components for listening to changes to child components
|
|
77
|
+
this._componentStateFinalizedEventProvider = new EventProvider(); // used by friend classes for synchronization
|
|
61
78
|
let deferredResolve;
|
|
62
79
|
this._domRefReadyPromise = new Promise(resolve => {
|
|
63
80
|
deferredResolve = resolve;
|
|
@@ -82,6 +99,14 @@ class UI5Element extends HTMLElement {
|
|
|
82
99
|
}
|
|
83
100
|
return this.__id;
|
|
84
101
|
}
|
|
102
|
+
render() {
|
|
103
|
+
const template = this.constructor.template;
|
|
104
|
+
return executeTemplate(template, this);
|
|
105
|
+
}
|
|
106
|
+
renderStatic() {
|
|
107
|
+
const template = this.constructor.staticAreaTemplate;
|
|
108
|
+
return executeTemplate(template, this);
|
|
109
|
+
}
|
|
85
110
|
/**
|
|
86
111
|
* Do not call this method from derivatives of UI5Element, use "onEnterDOM" only
|
|
87
112
|
* @private
|
|
@@ -152,14 +177,16 @@ class UI5Element extends HTMLElement {
|
|
|
152
177
|
*/
|
|
153
178
|
_startObservingDOMChildren() {
|
|
154
179
|
const ctor = this.constructor;
|
|
155
|
-
const
|
|
180
|
+
const metadata = ctor.getMetadata();
|
|
181
|
+
const shouldObserveChildren = metadata.hasSlots();
|
|
156
182
|
if (!shouldObserveChildren) {
|
|
157
183
|
return;
|
|
158
184
|
}
|
|
159
|
-
const canSlotText =
|
|
185
|
+
const canSlotText = metadata.canSlotText();
|
|
186
|
+
const hasClonedSlot = Object.keys(metadata.getSlots()).some(slotName => metadata.getSlots()[slotName].cloned);
|
|
160
187
|
const mutationObserverOptions = {
|
|
161
188
|
childList: true,
|
|
162
|
-
subtree: canSlotText,
|
|
189
|
+
subtree: canSlotText || hasClonedSlot,
|
|
163
190
|
characterData: canSlotText,
|
|
164
191
|
};
|
|
165
192
|
observeDOMNode(this, this._processChildren.bind(this), mutationObserverOptions);
|
|
@@ -220,11 +247,11 @@ class UI5Element extends HTMLElement {
|
|
|
220
247
|
// Await for not-yet-defined custom elements
|
|
221
248
|
if (child instanceof HTMLElement) {
|
|
222
249
|
const localName = child.localName;
|
|
223
|
-
const
|
|
224
|
-
if (
|
|
225
|
-
const isDefined =
|
|
250
|
+
const shouldWaitForCustomElement = localName.includes("-") && !shouldIgnoreCustomElement(localName);
|
|
251
|
+
if (shouldWaitForCustomElement) {
|
|
252
|
+
const isDefined = customElements.get(localName);
|
|
226
253
|
if (!isDefined) {
|
|
227
|
-
const whenDefinedPromise =
|
|
254
|
+
const whenDefinedPromise = customElements.whenDefined(localName); // Class registered, but instances not upgraded yet
|
|
228
255
|
let timeoutPromise = elementTimeouts.get(localName);
|
|
229
256
|
if (!timeoutPromise) {
|
|
230
257
|
timeoutPromise = new Promise(resolve => setTimeout(resolve, 1000));
|
|
@@ -232,7 +259,7 @@ class UI5Element extends HTMLElement {
|
|
|
232
259
|
}
|
|
233
260
|
await Promise.race([whenDefinedPromise, timeoutPromise]);
|
|
234
261
|
}
|
|
235
|
-
|
|
262
|
+
customElements.upgrade(child);
|
|
236
263
|
}
|
|
237
264
|
}
|
|
238
265
|
child = ctor.getMetadata().constructor.validateSlotValue(child, slotData);
|
|
@@ -307,26 +334,26 @@ class UI5Element extends HTMLElement {
|
|
|
307
334
|
/**
|
|
308
335
|
* Attach a callback that will be executed whenever the component is invalidated
|
|
309
336
|
*
|
|
310
|
-
* @param
|
|
337
|
+
* @param callback
|
|
311
338
|
* @public
|
|
312
339
|
*/
|
|
313
340
|
attachInvalidate(callback) {
|
|
314
|
-
this.
|
|
341
|
+
this._invalidationEventProvider.attachEvent("invalidate", callback);
|
|
315
342
|
}
|
|
316
343
|
/**
|
|
317
344
|
* Detach the callback that is executed whenever the component is invalidated
|
|
318
345
|
*
|
|
319
|
-
* @param
|
|
346
|
+
* @param callback
|
|
320
347
|
* @public
|
|
321
348
|
*/
|
|
322
349
|
detachInvalidate(callback) {
|
|
323
|
-
this.
|
|
350
|
+
this._invalidationEventProvider.detachEvent("invalidate", callback);
|
|
324
351
|
}
|
|
325
352
|
/**
|
|
326
353
|
* Callback that is executed whenever a monitored child changes its state
|
|
327
354
|
*
|
|
328
|
-
* @param
|
|
329
|
-
* @param
|
|
355
|
+
* @param slotName the slot in which a child was invalidated
|
|
356
|
+
* @param childChangeInfo the changeInfo object for the child in the given slot
|
|
330
357
|
* @private
|
|
331
358
|
*/
|
|
332
359
|
_onChildChange(slotName, childChangeInfo) {
|
|
@@ -436,7 +463,6 @@ class UI5Element extends HTMLElement {
|
|
|
436
463
|
* Returns a singleton event listener for the "change" event of a child in a given slot
|
|
437
464
|
*
|
|
438
465
|
* @param slotName the name of the slot, where the child is
|
|
439
|
-
* @returns {ChildChangeListener}
|
|
440
466
|
* @private
|
|
441
467
|
*/
|
|
442
468
|
_getChildChangeListener(slotName) {
|
|
@@ -449,7 +475,6 @@ class UI5Element extends HTMLElement {
|
|
|
449
475
|
* Returns a singleton slotchange event listener that invalidates the component due to changes in the given slot
|
|
450
476
|
*
|
|
451
477
|
* @param slotName the name of the slot, where the slot element (whose slotchange event we're listening to) is
|
|
452
|
-
* @returns {SlotChangeListener}
|
|
453
478
|
* @private
|
|
454
479
|
*/
|
|
455
480
|
_getSlotChangeListener(slotName) {
|
|
@@ -525,9 +550,7 @@ class UI5Element extends HTMLElement {
|
|
|
525
550
|
this._suppressInvalidation = true;
|
|
526
551
|
this.onBeforeRendering();
|
|
527
552
|
// Intended for framework usage only. Currently ItemNavigation updates tab indexes after the component has updated its state but before the template is rendered
|
|
528
|
-
|
|
529
|
-
this._onComponentStateFinalized();
|
|
530
|
-
}
|
|
553
|
+
this._componentStateFinalizedEventProvider.fireEvent("componentStateFinalized");
|
|
531
554
|
// resume normal invalidation handling
|
|
532
555
|
this._suppressInvalidation = false;
|
|
533
556
|
// Update the shadow root with the render result
|
|
@@ -627,7 +650,7 @@ class UI5Element extends HTMLElement {
|
|
|
627
650
|
}
|
|
628
651
|
/**
|
|
629
652
|
* Set the focus to the element, returned by "getFocusDomRef()" (marked by "data-sap-focus-ref")
|
|
630
|
-
* @param
|
|
653
|
+
* @param focusOptions additional options for the focus
|
|
631
654
|
* @public
|
|
632
655
|
*/
|
|
633
656
|
async focus(focusOptions) {
|
|
@@ -644,13 +667,13 @@ class UI5Element extends HTMLElement {
|
|
|
644
667
|
* @param data - additional data for the event
|
|
645
668
|
* @param cancelable - true, if the user can call preventDefault on the event object
|
|
646
669
|
* @param bubbles - true, if the event bubbles
|
|
647
|
-
* @returns
|
|
670
|
+
* @returns false, if the event was cancelled (preventDefault called), true otherwise
|
|
648
671
|
*/
|
|
649
672
|
fireEvent(name, data, cancelable = false, bubbles = true) {
|
|
650
673
|
const eventResult = this._fireEvent(name, data, cancelable, bubbles);
|
|
651
674
|
const camelCaseEventName = kebabToCamelCase(name);
|
|
652
675
|
if (camelCaseEventName !== name) {
|
|
653
|
-
return eventResult && this._fireEvent(camelCaseEventName, data, cancelable);
|
|
676
|
+
return eventResult && this._fireEvent(camelCaseEventName, data, cancelable, bubbles);
|
|
654
677
|
}
|
|
655
678
|
return eventResult;
|
|
656
679
|
}
|
|
@@ -685,12 +708,30 @@ class UI5Element extends HTMLElement {
|
|
|
685
708
|
getSlottedNodes(slotName) {
|
|
686
709
|
return getSlottedNodesList(this[slotName]);
|
|
687
710
|
}
|
|
711
|
+
/**
|
|
712
|
+
* Attach a callback that will be executed whenever the component's state is finalized
|
|
713
|
+
*
|
|
714
|
+
* @param callback
|
|
715
|
+
* @public
|
|
716
|
+
*/
|
|
717
|
+
attachComponentStateFinalized(callback) {
|
|
718
|
+
this._componentStateFinalizedEventProvider.attachEvent("componentStateFinalized", callback);
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* Detach the callback that is executed whenever the component's state is finalized
|
|
722
|
+
*
|
|
723
|
+
* @param callback
|
|
724
|
+
* @public
|
|
725
|
+
*/
|
|
726
|
+
detachComponentStateFinalized(callback) {
|
|
727
|
+
this._componentStateFinalizedEventProvider.detachEvent("componentStateFinalized", callback);
|
|
728
|
+
}
|
|
688
729
|
/**
|
|
689
730
|
* Determines whether the component should be rendered in RTL mode or not.
|
|
690
731
|
* Returns: "rtl", "ltr" or undefined
|
|
691
732
|
*
|
|
692
733
|
* @public
|
|
693
|
-
* @
|
|
734
|
+
* @default undefined
|
|
694
735
|
*/
|
|
695
736
|
get effectiveDir() {
|
|
696
737
|
markAsRtlAware(this.constructor); // if a UI5 Element calls this method, it's considered to be rtl-aware
|
|
@@ -698,8 +739,8 @@ class UI5Element extends HTMLElement {
|
|
|
698
739
|
}
|
|
699
740
|
/**
|
|
700
741
|
* Used to duck-type UI5 elements without using instanceof
|
|
701
|
-
* @returns {boolean}
|
|
702
742
|
* @public
|
|
743
|
+
* @default true
|
|
703
744
|
*/
|
|
704
745
|
get isUI5Element() {
|
|
705
746
|
return true;
|
|
@@ -707,6 +748,13 @@ class UI5Element extends HTMLElement {
|
|
|
707
748
|
get classes() {
|
|
708
749
|
return {};
|
|
709
750
|
}
|
|
751
|
+
/**
|
|
752
|
+
* Returns the component accessibility info.
|
|
753
|
+
* @private
|
|
754
|
+
*/
|
|
755
|
+
get accessibilityInfo() {
|
|
756
|
+
return {};
|
|
757
|
+
}
|
|
710
758
|
/**
|
|
711
759
|
* Do not override this method in derivatives of UI5Element, use metadata properties instead
|
|
712
760
|
* @private
|
|
@@ -718,13 +766,13 @@ class UI5Element extends HTMLElement {
|
|
|
718
766
|
* @private
|
|
719
767
|
*/
|
|
720
768
|
static _needsShadowDOM() {
|
|
721
|
-
return !!this.template;
|
|
769
|
+
return !!this.template || Object.prototype.hasOwnProperty.call(this.prototype, "render");
|
|
722
770
|
}
|
|
723
771
|
/**
|
|
724
772
|
* @private
|
|
725
773
|
*/
|
|
726
774
|
static _needsStaticArea() {
|
|
727
|
-
return !!this.staticAreaTemplate;
|
|
775
|
+
return !!this.staticAreaTemplate || Object.prototype.hasOwnProperty.call(this.prototype, "renderStatic");
|
|
728
776
|
}
|
|
729
777
|
/**
|
|
730
778
|
* @public
|
|
@@ -766,8 +814,25 @@ class UI5Element extends HTMLElement {
|
|
|
766
814
|
if (propData.multiple && propData.defaultValue) {
|
|
767
815
|
throw new Error(`Cannot set a default value for property "${prop}". All multiple properties are empty arrays by default.`);
|
|
768
816
|
}
|
|
817
|
+
const descriptor = getPropertyDescriptor(proto, prop);
|
|
818
|
+
// if the decorator is on a setter, proxy the new setter to it
|
|
819
|
+
let origSet;
|
|
820
|
+
if (descriptor?.set) {
|
|
821
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
822
|
+
origSet = descriptor.set;
|
|
823
|
+
}
|
|
824
|
+
// if the decorator is on a setter, there will be a corresponding getter - proxy the new getter to it
|
|
825
|
+
let origGet;
|
|
826
|
+
if (descriptor?.get) {
|
|
827
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
828
|
+
origGet = descriptor.get;
|
|
829
|
+
}
|
|
769
830
|
Object.defineProperty(proto, prop, {
|
|
770
831
|
get() {
|
|
832
|
+
// proxy the getter to the original accessor if there was one
|
|
833
|
+
if (origGet) {
|
|
834
|
+
return origGet.call(this);
|
|
835
|
+
}
|
|
771
836
|
if (this._state[prop] !== undefined) {
|
|
772
837
|
return this._state[prop];
|
|
773
838
|
}
|
|
@@ -792,7 +857,7 @@ class UI5Element extends HTMLElement {
|
|
|
792
857
|
value = metadataCtor.validatePropertyValue(value, propData);
|
|
793
858
|
const propertyType = propData.type;
|
|
794
859
|
let propertyValidator = propData.validator;
|
|
795
|
-
const oldState = this._state[prop];
|
|
860
|
+
const oldState = origGet ? origGet.call(this) : this._state[prop];
|
|
796
861
|
if (propertyType && propertyType.isDataTypeClass) {
|
|
797
862
|
propertyValidator = propertyType;
|
|
798
863
|
}
|
|
@@ -806,7 +871,13 @@ class UI5Element extends HTMLElement {
|
|
|
806
871
|
isDifferent = oldState !== value;
|
|
807
872
|
}
|
|
808
873
|
if (isDifferent) {
|
|
809
|
-
|
|
874
|
+
// if the decorator is on a setter, use it for storage
|
|
875
|
+
if (origSet) {
|
|
876
|
+
origSet.call(this, value);
|
|
877
|
+
}
|
|
878
|
+
else {
|
|
879
|
+
this._state[prop] = value;
|
|
880
|
+
}
|
|
810
881
|
_invalidate.call(this, {
|
|
811
882
|
type: "property",
|
|
812
883
|
name: prop,
|
|
@@ -840,27 +911,6 @@ class UI5Element extends HTMLElement {
|
|
|
840
911
|
}
|
|
841
912
|
}
|
|
842
913
|
}
|
|
843
|
-
/**
|
|
844
|
-
* Returns the metadata object for this UI5 Web Component Class
|
|
845
|
-
* @protected
|
|
846
|
-
*/
|
|
847
|
-
static get metadata() {
|
|
848
|
-
return metadata;
|
|
849
|
-
}
|
|
850
|
-
/**
|
|
851
|
-
* Sets a new metadata object for this UI5 Web Component Class
|
|
852
|
-
* @protected
|
|
853
|
-
*/
|
|
854
|
-
static set metadata(newMetadata) {
|
|
855
|
-
metadata = newMetadata;
|
|
856
|
-
}
|
|
857
|
-
/**
|
|
858
|
-
* Returns the CSS for this UI5 Web Component Class
|
|
859
|
-
* @protected
|
|
860
|
-
*/
|
|
861
|
-
static get styles() {
|
|
862
|
-
return "";
|
|
863
|
-
}
|
|
864
914
|
/**
|
|
865
915
|
* Returns the Static Area CSS for this UI5 Web Component Class
|
|
866
916
|
* @protected
|
|
@@ -892,8 +942,6 @@ class UI5Element extends HTMLElement {
|
|
|
892
942
|
}
|
|
893
943
|
/**
|
|
894
944
|
* Returns a promise that resolves whenever all dependencies for this UI5 Web Component have resolved
|
|
895
|
-
*
|
|
896
|
-
* @returns {Promise}
|
|
897
945
|
*/
|
|
898
946
|
static whenDependenciesDefined() {
|
|
899
947
|
return Promise.all(this.getUniqueDependencies().map(dep => dep.define()));
|
|
@@ -902,7 +950,6 @@ class UI5Element extends HTMLElement {
|
|
|
902
950
|
* Hook that will be called upon custom element definition
|
|
903
951
|
*
|
|
904
952
|
* @protected
|
|
905
|
-
* @returns {Promise<void>}
|
|
906
953
|
*/
|
|
907
954
|
static async onDefine() {
|
|
908
955
|
return Promise.resolve();
|
|
@@ -910,7 +957,6 @@ class UI5Element extends HTMLElement {
|
|
|
910
957
|
/**
|
|
911
958
|
* Registers a UI5 Web Component in the browser window object
|
|
912
959
|
* @public
|
|
913
|
-
* @returns {Promise<UI5Element>}
|
|
914
960
|
*/
|
|
915
961
|
static async define() {
|
|
916
962
|
await boot();
|
|
@@ -927,7 +973,7 @@ class UI5Element extends HTMLElement {
|
|
|
927
973
|
else if (!definedGlobally) {
|
|
928
974
|
this._generateAccessors();
|
|
929
975
|
registerTag(tag);
|
|
930
|
-
|
|
976
|
+
customElements.define(tag, this);
|
|
931
977
|
preloadLinks(this);
|
|
932
978
|
}
|
|
933
979
|
return this;
|
|
@@ -936,29 +982,34 @@ class UI5Element extends HTMLElement {
|
|
|
936
982
|
* Returns an instance of UI5ElementMetadata.js representing this UI5 Web Component's full metadata (its and its parents')
|
|
937
983
|
* Note: not to be confused with the "get metadata()" method, which returns an object for this class's metadata only
|
|
938
984
|
* @public
|
|
939
|
-
* @returns {UI5ElementMetadata}
|
|
940
985
|
*/
|
|
941
986
|
static getMetadata() {
|
|
942
987
|
if (this.hasOwnProperty("_metadata")) { // eslint-disable-line
|
|
943
988
|
return this._metadata;
|
|
944
989
|
}
|
|
945
|
-
const
|
|
946
|
-
const metadataObjects = [effectiveMetadata];
|
|
990
|
+
const metadataObjects = [this.metadata];
|
|
947
991
|
let klass = this; // eslint-disable-line
|
|
948
992
|
while (klass !== UI5Element) {
|
|
949
993
|
klass = Object.getPrototypeOf(klass);
|
|
950
|
-
|
|
951
|
-
metadataObjects.unshift(effectiveKlassMetadata);
|
|
994
|
+
metadataObjects.unshift(klass.metadata);
|
|
952
995
|
}
|
|
953
996
|
const mergedMetadata = merge({}, ...metadataObjects);
|
|
954
997
|
this._metadata = new UI5ElementMetadata(mergedMetadata);
|
|
955
998
|
return this._metadata;
|
|
956
999
|
}
|
|
957
1000
|
}
|
|
958
|
-
|
|
1001
|
+
/**
|
|
1002
|
+
* Returns the metadata object for this UI5 Web Component Class
|
|
1003
|
+
* @protected
|
|
1004
|
+
*/
|
|
1005
|
+
UI5Element.metadata = {};
|
|
1006
|
+
/**
|
|
1007
|
+
* Returns the CSS for this UI5 Web Component Class
|
|
1008
|
+
* @protected
|
|
1009
|
+
*/
|
|
1010
|
+
UI5Element.styles = "";
|
|
959
1011
|
/**
|
|
960
1012
|
* Always use duck-typing to cover all runtimes on the page.
|
|
961
|
-
* @returns {boolean}
|
|
962
1013
|
*/
|
|
963
1014
|
const instanceOfUI5Element = (object) => {
|
|
964
1015
|
return "isUI5Element" in object;
|