@ui5/webcomponents-base 0.0.0-7d5f73b20 → 0.0.0-7d8c57f70
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.d.ts +10 -1
- package/dist/FeaturesRegistry.js +37 -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 +55 -39
- package/dist/UI5Element.js +129 -70
- package/dist/UI5Element.js.map +1 -1
- package/dist/UI5ElementMetadata.d.ts +12 -13
- package/dist/UI5ElementMetadata.js +24 -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 +18 -2
- package/dist/decorators/customElement.js +28 -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 +64 -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.5c683084.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.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,8 @@ 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";
|
|
23
|
+
import { subscribeForFeatureLoad } from "./FeaturesRegistry.js";
|
|
19
24
|
let autoId = 0;
|
|
20
25
|
const elementTimeouts = new Map();
|
|
21
26
|
const uniqueDependenciesCache = new Map();
|
|
@@ -34,16 +39,28 @@ function _invalidate(changeInfo) {
|
|
|
34
39
|
this.onInvalidation(changeInfo);
|
|
35
40
|
this._changedState.push(changeInfo);
|
|
36
41
|
renderDeferred(this);
|
|
37
|
-
this.
|
|
42
|
+
this._invalidationEventProvider.fireEvent("invalidate", { ...changeInfo, target: this });
|
|
38
43
|
}
|
|
39
|
-
let metadata = {};
|
|
40
44
|
/**
|
|
45
|
+
* looks up a property descsriptor including in the prototype chain
|
|
46
|
+
* @param proto the starting prototype
|
|
47
|
+
* @param name the property to look for
|
|
48
|
+
* @returns the property descriptor if found directly or in the prototype chaing, undefined if not found
|
|
49
|
+
*/
|
|
50
|
+
function getPropertyDescriptor(proto, name) {
|
|
51
|
+
do {
|
|
52
|
+
const descriptor = Object.getOwnPropertyDescriptor(proto, name);
|
|
53
|
+
if (descriptor) {
|
|
54
|
+
return descriptor;
|
|
55
|
+
}
|
|
56
|
+
// go up the prototype chain
|
|
57
|
+
proto = Object.getPrototypeOf(proto);
|
|
58
|
+
} while (proto && proto !== HTMLElement.prototype);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* @class
|
|
41
62
|
* Base class for all UI5 Web Components
|
|
42
63
|
*
|
|
43
|
-
* @class
|
|
44
|
-
* @constructor
|
|
45
|
-
* @author SAP SE
|
|
46
|
-
* @alias sap.ui.webc.base.UI5Element
|
|
47
64
|
* @extends HTMLElement
|
|
48
65
|
* @public
|
|
49
66
|
*/
|
|
@@ -57,7 +74,8 @@ class UI5Element extends HTMLElement {
|
|
|
57
74
|
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
75
|
this._childChangeListeners = new Map(); // used to store lazy listeners per slot for the child change event of every child inside that slot
|
|
59
76
|
this._slotChangeListeners = new Map(); // used to store lazy listeners per slot for the slotchange event of all slot children inside that slot
|
|
60
|
-
this.
|
|
77
|
+
this._invalidationEventProvider = new EventProvider(); // used by parent components for listening to changes to child components
|
|
78
|
+
this._componentStateFinalizedEventProvider = new EventProvider(); // used by friend classes for synchronization
|
|
61
79
|
let deferredResolve;
|
|
62
80
|
this._domRefReadyPromise = new Promise(resolve => {
|
|
63
81
|
deferredResolve = resolve;
|
|
@@ -82,6 +100,14 @@ class UI5Element extends HTMLElement {
|
|
|
82
100
|
}
|
|
83
101
|
return this.__id;
|
|
84
102
|
}
|
|
103
|
+
render() {
|
|
104
|
+
const template = this.constructor.template;
|
|
105
|
+
return executeTemplate(template, this);
|
|
106
|
+
}
|
|
107
|
+
renderStatic() {
|
|
108
|
+
const template = this.constructor.staticAreaTemplate;
|
|
109
|
+
return executeTemplate(template, this);
|
|
110
|
+
}
|
|
85
111
|
/**
|
|
86
112
|
* Do not call this method from derivatives of UI5Element, use "onEnterDOM" only
|
|
87
113
|
* @private
|
|
@@ -152,14 +178,16 @@ class UI5Element extends HTMLElement {
|
|
|
152
178
|
*/
|
|
153
179
|
_startObservingDOMChildren() {
|
|
154
180
|
const ctor = this.constructor;
|
|
155
|
-
const
|
|
181
|
+
const metadata = ctor.getMetadata();
|
|
182
|
+
const shouldObserveChildren = metadata.hasSlots();
|
|
156
183
|
if (!shouldObserveChildren) {
|
|
157
184
|
return;
|
|
158
185
|
}
|
|
159
|
-
const canSlotText =
|
|
186
|
+
const canSlotText = metadata.canSlotText();
|
|
187
|
+
const hasClonedSlot = Object.keys(metadata.getSlots()).some(slotName => metadata.getSlots()[slotName].cloned);
|
|
160
188
|
const mutationObserverOptions = {
|
|
161
189
|
childList: true,
|
|
162
|
-
subtree: canSlotText,
|
|
190
|
+
subtree: canSlotText || hasClonedSlot,
|
|
163
191
|
characterData: canSlotText,
|
|
164
192
|
};
|
|
165
193
|
observeDOMNode(this, this._processChildren.bind(this), mutationObserverOptions);
|
|
@@ -220,11 +248,11 @@ class UI5Element extends HTMLElement {
|
|
|
220
248
|
// Await for not-yet-defined custom elements
|
|
221
249
|
if (child instanceof HTMLElement) {
|
|
222
250
|
const localName = child.localName;
|
|
223
|
-
const
|
|
224
|
-
if (
|
|
225
|
-
const isDefined =
|
|
251
|
+
const shouldWaitForCustomElement = localName.includes("-") && !shouldIgnoreCustomElement(localName);
|
|
252
|
+
if (shouldWaitForCustomElement) {
|
|
253
|
+
const isDefined = customElements.get(localName);
|
|
226
254
|
if (!isDefined) {
|
|
227
|
-
const whenDefinedPromise =
|
|
255
|
+
const whenDefinedPromise = customElements.whenDefined(localName); // Class registered, but instances not upgraded yet
|
|
228
256
|
let timeoutPromise = elementTimeouts.get(localName);
|
|
229
257
|
if (!timeoutPromise) {
|
|
230
258
|
timeoutPromise = new Promise(resolve => setTimeout(resolve, 1000));
|
|
@@ -232,7 +260,7 @@ class UI5Element extends HTMLElement {
|
|
|
232
260
|
}
|
|
233
261
|
await Promise.race([whenDefinedPromise, timeoutPromise]);
|
|
234
262
|
}
|
|
235
|
-
|
|
263
|
+
customElements.upgrade(child);
|
|
236
264
|
}
|
|
237
265
|
}
|
|
238
266
|
child = ctor.getMetadata().constructor.validateSlotValue(child, slotData);
|
|
@@ -307,26 +335,26 @@ class UI5Element extends HTMLElement {
|
|
|
307
335
|
/**
|
|
308
336
|
* Attach a callback that will be executed whenever the component is invalidated
|
|
309
337
|
*
|
|
310
|
-
* @param
|
|
338
|
+
* @param callback
|
|
311
339
|
* @public
|
|
312
340
|
*/
|
|
313
341
|
attachInvalidate(callback) {
|
|
314
|
-
this.
|
|
342
|
+
this._invalidationEventProvider.attachEvent("invalidate", callback);
|
|
315
343
|
}
|
|
316
344
|
/**
|
|
317
345
|
* Detach the callback that is executed whenever the component is invalidated
|
|
318
346
|
*
|
|
319
|
-
* @param
|
|
347
|
+
* @param callback
|
|
320
348
|
* @public
|
|
321
349
|
*/
|
|
322
350
|
detachInvalidate(callback) {
|
|
323
|
-
this.
|
|
351
|
+
this._invalidationEventProvider.detachEvent("invalidate", callback);
|
|
324
352
|
}
|
|
325
353
|
/**
|
|
326
354
|
* Callback that is executed whenever a monitored child changes its state
|
|
327
355
|
*
|
|
328
|
-
* @param
|
|
329
|
-
* @param
|
|
356
|
+
* @param slotName the slot in which a child was invalidated
|
|
357
|
+
* @param childChangeInfo the changeInfo object for the child in the given slot
|
|
330
358
|
* @private
|
|
331
359
|
*/
|
|
332
360
|
_onChildChange(slotName, childChangeInfo) {
|
|
@@ -436,7 +464,6 @@ class UI5Element extends HTMLElement {
|
|
|
436
464
|
* Returns a singleton event listener for the "change" event of a child in a given slot
|
|
437
465
|
*
|
|
438
466
|
* @param slotName the name of the slot, where the child is
|
|
439
|
-
* @returns {ChildChangeListener}
|
|
440
467
|
* @private
|
|
441
468
|
*/
|
|
442
469
|
_getChildChangeListener(slotName) {
|
|
@@ -449,7 +476,6 @@ class UI5Element extends HTMLElement {
|
|
|
449
476
|
* Returns a singleton slotchange event listener that invalidates the component due to changes in the given slot
|
|
450
477
|
*
|
|
451
478
|
* @param slotName the name of the slot, where the slot element (whose slotchange event we're listening to) is
|
|
452
|
-
* @returns {SlotChangeListener}
|
|
453
479
|
* @private
|
|
454
480
|
*/
|
|
455
481
|
_getSlotChangeListener(slotName) {
|
|
@@ -525,9 +551,7 @@ class UI5Element extends HTMLElement {
|
|
|
525
551
|
this._suppressInvalidation = true;
|
|
526
552
|
this.onBeforeRendering();
|
|
527
553
|
// 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
|
-
}
|
|
554
|
+
this._componentStateFinalizedEventProvider.fireEvent("componentStateFinalized");
|
|
531
555
|
// resume normal invalidation handling
|
|
532
556
|
this._suppressInvalidation = false;
|
|
533
557
|
// Update the shadow root with the render result
|
|
@@ -627,7 +651,7 @@ class UI5Element extends HTMLElement {
|
|
|
627
651
|
}
|
|
628
652
|
/**
|
|
629
653
|
* Set the focus to the element, returned by "getFocusDomRef()" (marked by "data-sap-focus-ref")
|
|
630
|
-
* @param
|
|
654
|
+
* @param focusOptions additional options for the focus
|
|
631
655
|
* @public
|
|
632
656
|
*/
|
|
633
657
|
async focus(focusOptions) {
|
|
@@ -644,13 +668,13 @@ class UI5Element extends HTMLElement {
|
|
|
644
668
|
* @param data - additional data for the event
|
|
645
669
|
* @param cancelable - true, if the user can call preventDefault on the event object
|
|
646
670
|
* @param bubbles - true, if the event bubbles
|
|
647
|
-
* @returns
|
|
671
|
+
* @returns false, if the event was cancelled (preventDefault called), true otherwise
|
|
648
672
|
*/
|
|
649
673
|
fireEvent(name, data, cancelable = false, bubbles = true) {
|
|
650
674
|
const eventResult = this._fireEvent(name, data, cancelable, bubbles);
|
|
651
675
|
const camelCaseEventName = kebabToCamelCase(name);
|
|
652
676
|
if (camelCaseEventName !== name) {
|
|
653
|
-
return eventResult && this._fireEvent(camelCaseEventName, data, cancelable);
|
|
677
|
+
return eventResult && this._fireEvent(camelCaseEventName, data, cancelable, bubbles);
|
|
654
678
|
}
|
|
655
679
|
return eventResult;
|
|
656
680
|
}
|
|
@@ -685,12 +709,30 @@ class UI5Element extends HTMLElement {
|
|
|
685
709
|
getSlottedNodes(slotName) {
|
|
686
710
|
return getSlottedNodesList(this[slotName]);
|
|
687
711
|
}
|
|
712
|
+
/**
|
|
713
|
+
* Attach a callback that will be executed whenever the component's state is finalized
|
|
714
|
+
*
|
|
715
|
+
* @param callback
|
|
716
|
+
* @public
|
|
717
|
+
*/
|
|
718
|
+
attachComponentStateFinalized(callback) {
|
|
719
|
+
this._componentStateFinalizedEventProvider.attachEvent("componentStateFinalized", callback);
|
|
720
|
+
}
|
|
721
|
+
/**
|
|
722
|
+
* Detach the callback that is executed whenever the component's state is finalized
|
|
723
|
+
*
|
|
724
|
+
* @param callback
|
|
725
|
+
* @public
|
|
726
|
+
*/
|
|
727
|
+
detachComponentStateFinalized(callback) {
|
|
728
|
+
this._componentStateFinalizedEventProvider.detachEvent("componentStateFinalized", callback);
|
|
729
|
+
}
|
|
688
730
|
/**
|
|
689
731
|
* Determines whether the component should be rendered in RTL mode or not.
|
|
690
732
|
* Returns: "rtl", "ltr" or undefined
|
|
691
733
|
*
|
|
692
734
|
* @public
|
|
693
|
-
* @
|
|
735
|
+
* @default undefined
|
|
694
736
|
*/
|
|
695
737
|
get effectiveDir() {
|
|
696
738
|
markAsRtlAware(this.constructor); // if a UI5 Element calls this method, it's considered to be rtl-aware
|
|
@@ -698,8 +740,8 @@ class UI5Element extends HTMLElement {
|
|
|
698
740
|
}
|
|
699
741
|
/**
|
|
700
742
|
* Used to duck-type UI5 elements without using instanceof
|
|
701
|
-
* @returns {boolean}
|
|
702
743
|
* @public
|
|
744
|
+
* @default true
|
|
703
745
|
*/
|
|
704
746
|
get isUI5Element() {
|
|
705
747
|
return true;
|
|
@@ -707,6 +749,13 @@ class UI5Element extends HTMLElement {
|
|
|
707
749
|
get classes() {
|
|
708
750
|
return {};
|
|
709
751
|
}
|
|
752
|
+
/**
|
|
753
|
+
* Returns the component accessibility info.
|
|
754
|
+
* @private
|
|
755
|
+
*/
|
|
756
|
+
get accessibilityInfo() {
|
|
757
|
+
return {};
|
|
758
|
+
}
|
|
710
759
|
/**
|
|
711
760
|
* Do not override this method in derivatives of UI5Element, use metadata properties instead
|
|
712
761
|
* @private
|
|
@@ -718,13 +767,13 @@ class UI5Element extends HTMLElement {
|
|
|
718
767
|
* @private
|
|
719
768
|
*/
|
|
720
769
|
static _needsShadowDOM() {
|
|
721
|
-
return !!this.template;
|
|
770
|
+
return !!this.template || Object.prototype.hasOwnProperty.call(this.prototype, "render");
|
|
722
771
|
}
|
|
723
772
|
/**
|
|
724
773
|
* @private
|
|
725
774
|
*/
|
|
726
775
|
static _needsStaticArea() {
|
|
727
|
-
return !!this.staticAreaTemplate;
|
|
776
|
+
return !!this.staticAreaTemplate || Object.prototype.hasOwnProperty.call(this.prototype, "renderStatic");
|
|
728
777
|
}
|
|
729
778
|
/**
|
|
730
779
|
* @public
|
|
@@ -766,8 +815,25 @@ class UI5Element extends HTMLElement {
|
|
|
766
815
|
if (propData.multiple && propData.defaultValue) {
|
|
767
816
|
throw new Error(`Cannot set a default value for property "${prop}". All multiple properties are empty arrays by default.`);
|
|
768
817
|
}
|
|
818
|
+
const descriptor = getPropertyDescriptor(proto, prop);
|
|
819
|
+
// if the decorator is on a setter, proxy the new setter to it
|
|
820
|
+
let origSet;
|
|
821
|
+
if (descriptor?.set) {
|
|
822
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
823
|
+
origSet = descriptor.set;
|
|
824
|
+
}
|
|
825
|
+
// if the decorator is on a setter, there will be a corresponding getter - proxy the new getter to it
|
|
826
|
+
let origGet;
|
|
827
|
+
if (descriptor?.get) {
|
|
828
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
829
|
+
origGet = descriptor.get;
|
|
830
|
+
}
|
|
769
831
|
Object.defineProperty(proto, prop, {
|
|
770
832
|
get() {
|
|
833
|
+
// proxy the getter to the original accessor if there was one
|
|
834
|
+
if (origGet) {
|
|
835
|
+
return origGet.call(this);
|
|
836
|
+
}
|
|
771
837
|
if (this._state[prop] !== undefined) {
|
|
772
838
|
return this._state[prop];
|
|
773
839
|
}
|
|
@@ -792,7 +858,7 @@ class UI5Element extends HTMLElement {
|
|
|
792
858
|
value = metadataCtor.validatePropertyValue(value, propData);
|
|
793
859
|
const propertyType = propData.type;
|
|
794
860
|
let propertyValidator = propData.validator;
|
|
795
|
-
const oldState = this._state[prop];
|
|
861
|
+
const oldState = origGet ? origGet.call(this) : this._state[prop];
|
|
796
862
|
if (propertyType && propertyType.isDataTypeClass) {
|
|
797
863
|
propertyValidator = propertyType;
|
|
798
864
|
}
|
|
@@ -806,7 +872,13 @@ class UI5Element extends HTMLElement {
|
|
|
806
872
|
isDifferent = oldState !== value;
|
|
807
873
|
}
|
|
808
874
|
if (isDifferent) {
|
|
809
|
-
|
|
875
|
+
// if the decorator is on a setter, use it for storage
|
|
876
|
+
if (origSet) {
|
|
877
|
+
origSet.call(this, value);
|
|
878
|
+
}
|
|
879
|
+
else {
|
|
880
|
+
this._state[prop] = value;
|
|
881
|
+
}
|
|
810
882
|
_invalidate.call(this, {
|
|
811
883
|
type: "property",
|
|
812
884
|
name: prop,
|
|
@@ -840,27 +912,6 @@ class UI5Element extends HTMLElement {
|
|
|
840
912
|
}
|
|
841
913
|
}
|
|
842
914
|
}
|
|
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
915
|
/**
|
|
865
916
|
* Returns the Static Area CSS for this UI5 Web Component Class
|
|
866
917
|
* @protected
|
|
@@ -878,6 +929,10 @@ class UI5Element extends HTMLElement {
|
|
|
878
929
|
static get dependencies() {
|
|
879
930
|
return [];
|
|
880
931
|
}
|
|
932
|
+
static cacheUniqueDependencies() {
|
|
933
|
+
const filtered = this.dependencies.filter((dep, index, deps) => deps.indexOf(dep) === index);
|
|
934
|
+
uniqueDependenciesCache.set(this, filtered);
|
|
935
|
+
}
|
|
881
936
|
/**
|
|
882
937
|
* Returns a list of the unique dependencies for this UI5 Web Component
|
|
883
938
|
*
|
|
@@ -885,15 +940,12 @@ class UI5Element extends HTMLElement {
|
|
|
885
940
|
*/
|
|
886
941
|
static getUniqueDependencies() {
|
|
887
942
|
if (!uniqueDependenciesCache.has(this)) {
|
|
888
|
-
|
|
889
|
-
uniqueDependenciesCache.set(this, filtered);
|
|
943
|
+
this.cacheUniqueDependencies();
|
|
890
944
|
}
|
|
891
945
|
return uniqueDependenciesCache.get(this) || [];
|
|
892
946
|
}
|
|
893
947
|
/**
|
|
894
948
|
* Returns a promise that resolves whenever all dependencies for this UI5 Web Component have resolved
|
|
895
|
-
*
|
|
896
|
-
* @returns {Promise}
|
|
897
949
|
*/
|
|
898
950
|
static whenDependenciesDefined() {
|
|
899
951
|
return Promise.all(this.getUniqueDependencies().map(dep => dep.define()));
|
|
@@ -902,7 +954,6 @@ class UI5Element extends HTMLElement {
|
|
|
902
954
|
* Hook that will be called upon custom element definition
|
|
903
955
|
*
|
|
904
956
|
* @protected
|
|
905
|
-
* @returns {Promise<void>}
|
|
906
957
|
*/
|
|
907
958
|
static async onDefine() {
|
|
908
959
|
return Promise.resolve();
|
|
@@ -910,7 +961,6 @@ class UI5Element extends HTMLElement {
|
|
|
910
961
|
/**
|
|
911
962
|
* Registers a UI5 Web Component in the browser window object
|
|
912
963
|
* @public
|
|
913
|
-
* @returns {Promise<UI5Element>}
|
|
914
964
|
*/
|
|
915
965
|
static async define() {
|
|
916
966
|
await boot();
|
|
@@ -919,6 +969,10 @@ class UI5Element extends HTMLElement {
|
|
|
919
969
|
this.onDefine(),
|
|
920
970
|
]);
|
|
921
971
|
const tag = this.getMetadata().getTag();
|
|
972
|
+
const features = this.getMetadata().getFeatures();
|
|
973
|
+
features.forEach(feature => {
|
|
974
|
+
subscribeForFeatureLoad(feature, this, this.cacheUniqueDependencies.bind(this));
|
|
975
|
+
});
|
|
922
976
|
const definedLocally = isTagRegistered(tag);
|
|
923
977
|
const definedGlobally = customElements.get(tag);
|
|
924
978
|
if (definedGlobally && !definedLocally) {
|
|
@@ -927,7 +981,7 @@ class UI5Element extends HTMLElement {
|
|
|
927
981
|
else if (!definedGlobally) {
|
|
928
982
|
this._generateAccessors();
|
|
929
983
|
registerTag(tag);
|
|
930
|
-
|
|
984
|
+
customElements.define(tag, this);
|
|
931
985
|
preloadLinks(this);
|
|
932
986
|
}
|
|
933
987
|
return this;
|
|
@@ -936,29 +990,34 @@ class UI5Element extends HTMLElement {
|
|
|
936
990
|
* Returns an instance of UI5ElementMetadata.js representing this UI5 Web Component's full metadata (its and its parents')
|
|
937
991
|
* Note: not to be confused with the "get metadata()" method, which returns an object for this class's metadata only
|
|
938
992
|
* @public
|
|
939
|
-
* @returns {UI5ElementMetadata}
|
|
940
993
|
*/
|
|
941
994
|
static getMetadata() {
|
|
942
995
|
if (this.hasOwnProperty("_metadata")) { // eslint-disable-line
|
|
943
996
|
return this._metadata;
|
|
944
997
|
}
|
|
945
|
-
const
|
|
946
|
-
const metadataObjects = [effectiveMetadata];
|
|
998
|
+
const metadataObjects = [this.metadata];
|
|
947
999
|
let klass = this; // eslint-disable-line
|
|
948
1000
|
while (klass !== UI5Element) {
|
|
949
1001
|
klass = Object.getPrototypeOf(klass);
|
|
950
|
-
|
|
951
|
-
metadataObjects.unshift(effectiveKlassMetadata);
|
|
1002
|
+
metadataObjects.unshift(klass.metadata);
|
|
952
1003
|
}
|
|
953
1004
|
const mergedMetadata = merge({}, ...metadataObjects);
|
|
954
1005
|
this._metadata = new UI5ElementMetadata(mergedMetadata);
|
|
955
1006
|
return this._metadata;
|
|
956
1007
|
}
|
|
957
1008
|
}
|
|
958
|
-
|
|
1009
|
+
/**
|
|
1010
|
+
* Returns the metadata object for this UI5 Web Component Class
|
|
1011
|
+
* @protected
|
|
1012
|
+
*/
|
|
1013
|
+
UI5Element.metadata = {};
|
|
1014
|
+
/**
|
|
1015
|
+
* Returns the CSS for this UI5 Web Component Class
|
|
1016
|
+
* @protected
|
|
1017
|
+
*/
|
|
1018
|
+
UI5Element.styles = "";
|
|
959
1019
|
/**
|
|
960
1020
|
* Always use duck-typing to cover all runtimes on the page.
|
|
961
|
-
* @returns {boolean}
|
|
962
1021
|
*/
|
|
963
1022
|
const instanceOfUI5Element = (object) => {
|
|
964
1023
|
return "isUI5Element" in object;
|