@ui5/webcomponents-base 0.0.0-4e88b8243 → 0.0.0-50f1454ef
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +256 -0
- package/cypress/specs/{Accessor.cy.ts → Accessor.cy.tsx} +4 -4
- package/cypress/specs/{ConfigurationScript.cy.ts → ConfigurationScript.cy.tsx} +21 -4
- package/cypress/specs/{ConfigurationURL.cy.ts → ConfigurationURL.cy.tsx} +27 -8
- package/cypress/specs/CustomMount.cy.tsx +9 -0
- package/cypress/specs/{CustomTheme.cy.ts → CustomTheme.cy.tsx} +2 -2
- package/cypress/specs/Events.cy.tsx +28 -0
- package/cypress/specs/{UI5ElementInvalidation.cy.ts → UI5ElementInvalidation.cy.tsx} +55 -10
- package/cypress/specs/{UI5ElementLifecycle.cy.ts → UI5ElementLifecycle.cy.tsx} +4 -4
- package/cypress/specs/{UI5ElementListenForChildPropChanges.cy.ts → UI5ElementListenForChildPropChanges.cy.tsx} +32 -11
- package/cypress/specs/{UI5ElementMetadataExt.cy.ts → UI5ElementMetadataExt.cy.tsx} +3 -3
- package/cypress/specs/{UI5ElementPropertyValidation.cy.ts → UI5ElementPropertyValidation.cy.tsx} +2 -2
- package/cypress/specs/{UI5ElementPropsAndAttrs.cy.ts → UI5ElementPropsAndAttrs.cy.tsx} +8 -8
- package/cypress/specs/{UI5ElementShadowDOM.cy.ts → UI5ElementShadowDOM.cy.tsx} +4 -4
- package/cypress/specs/{UI5ElementSlots.cy.ts → UI5ElementSlots.cy.tsx} +47 -27
- package/cypress/specs/{WithComplexTemplate.cy.ts → WithComplexTemplate.cy.tsx} +2 -2
- package/cypress/specs/i18n_texts.cy.tsx +129 -0
- package/cypress/specs/util/FocusableElements.cy.tsx +48 -0
- package/cypress/support/commands.ts +39 -0
- package/cypress/support/component-index.html +12 -0
- package/cypress/support/component.ts +17 -0
- package/cypress/tsconfig.json +2 -1
- package/cypress.config.js +1 -1
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/CustomElementsRegistry.d.ts +2 -1
- package/dist/CustomElementsRegistry.js +4 -1
- package/dist/CustomElementsRegistry.js.map +1 -1
- package/dist/CustomElementsScopeUtils.d.ts +3 -1
- package/dist/CustomElementsScopeUtils.js +8 -1
- package/dist/CustomElementsScopeUtils.js.map +1 -1
- package/dist/FeaturesRegistry.d.ts +1 -16
- package/dist/FeaturesRegistry.js +1 -37
- package/dist/FeaturesRegistry.js.map +1 -1
- package/dist/UI5Element.d.ts +15 -4
- package/dist/UI5Element.js +25 -15
- package/dist/UI5Element.js.map +1 -1
- package/dist/UI5ElementMetadata.d.ts +0 -5
- package/dist/UI5ElementMetadata.js +0 -7
- package/dist/UI5ElementMetadata.js.map +1 -1
- package/dist/config/Theme.js +1 -2
- package/dist/config/Theme.js.map +1 -1
- package/dist/custom-elements-internal.json +2803 -0
- package/dist/custom-elements.json +2500 -0
- package/dist/decorators/customElement.d.ts +1 -0
- package/dist/decorators/customElement.js +1 -4
- package/dist/decorators/customElement.js.map +1 -1
- package/dist/decorators/i18n.js +6 -0
- package/dist/decorators/i18n.js.map +1 -1
- package/dist/features/F6Navigation.d.ts +1 -0
- package/dist/features/F6Navigation.js +21 -2
- package/dist/features/F6Navigation.js.map +1 -1
- package/dist/features/patchPopup.js +10 -1
- package/dist/features/patchPopup.js.map +1 -1
- package/dist/generated/AssetParameters.js +1 -1
- package/dist/generated/AssetParameters.js.map +1 -1
- package/dist/generated/VersionInfo.js +4 -4
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/index.d.ts +43 -3
- package/dist/index.js +88 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx-utils.js +11 -2
- package/dist/jsx-utils.js.map +1 -1
- package/dist/locale/nextFallbackLocale.js +6 -2
- package/dist/locale/nextFallbackLocale.js.map +1 -1
- package/dist/prod/AssetRegistry.js +2 -0
- package/dist/prod/AssetRegistry.js.map +7 -0
- package/dist/prod/Boot.js +2 -0
- package/dist/prod/Boot.js.map +7 -0
- package/dist/prod/CustomElementsRegistry.js +10 -0
- package/dist/prod/CustomElementsRegistry.js.map +7 -0
- package/dist/prod/CustomElementsScope.js +2 -0
- package/dist/prod/CustomElementsScope.js.map +7 -0
- package/dist/prod/CustomElementsScopeUtils.js +2 -0
- package/dist/prod/CustomElementsScopeUtils.js.map +7 -0
- package/dist/prod/DOMObserver.js +2 -0
- package/dist/prod/DOMObserver.js.map +7 -0
- package/dist/prod/Device.js +2 -0
- package/dist/prod/Device.js.map +7 -0
- package/dist/prod/EventProvider.js +2 -0
- package/dist/prod/EventProvider.js.map +7 -0
- package/dist/prod/FeaturesRegistry.js +2 -0
- package/dist/prod/FeaturesRegistry.js.map +7 -0
- package/dist/prod/FontFace.js +2 -0
- package/dist/prod/FontFace.js.map +7 -0
- package/dist/prod/IgnoreCustomElements.js +2 -0
- package/dist/prod/IgnoreCustomElements.js.map +7 -0
- package/dist/prod/InitialConfiguration.js +2 -0
- package/dist/prod/InitialConfiguration.js.map +7 -0
- package/dist/prod/Keys.js +2 -0
- package/dist/prod/Keys.js.map +7 -0
- package/dist/prod/Location.js +2 -0
- package/dist/prod/Location.js.map +7 -0
- package/dist/prod/ManagedStyles.js +2 -0
- package/dist/prod/ManagedStyles.js.map +7 -0
- package/dist/prod/MediaRange.js +2 -0
- package/dist/prod/MediaRange.js.map +7 -0
- package/dist/prod/PropertiesFileFormat.js +3 -0
- package/dist/prod/PropertiesFileFormat.js.map +7 -0
- package/dist/prod/Render.js +2 -0
- package/dist/prod/Render.js.map +7 -0
- package/dist/prod/RenderQueue.js +2 -0
- package/dist/prod/RenderQueue.js.map +7 -0
- package/dist/prod/Runtimes.js +2 -0
- package/dist/prod/Runtimes.js.map +7 -0
- package/dist/prod/SystemCSSVars.js +2 -0
- package/dist/prod/SystemCSSVars.js.map +7 -0
- package/dist/prod/Theming.js +2 -0
- package/dist/prod/Theming.js.map +7 -0
- package/dist/prod/UI5Element.js +2 -0
- package/dist/prod/UI5Element.js.map +7 -0
- package/dist/prod/UI5ElementMetadata.js +2 -0
- package/dist/prod/UI5ElementMetadata.js.map +7 -0
- package/dist/prod/animations/AnimationQueue.js +2 -0
- package/dist/prod/animations/AnimationQueue.js.map +7 -0
- package/dist/prod/animations/animate.js +2 -0
- package/dist/prod/animations/animate.js.map +7 -0
- package/dist/prod/animations/scroll.js +2 -0
- package/dist/prod/animations/scroll.js.map +7 -0
- package/dist/prod/animations/slideDown.js +2 -0
- package/dist/prod/animations/slideDown.js.map +7 -0
- package/dist/prod/animations/slideUp.js +2 -0
- package/dist/prod/animations/slideUp.js.map +7 -0
- package/dist/prod/asset-registries/Icons.js +2 -0
- package/dist/prod/asset-registries/Icons.js.map +7 -0
- package/dist/prod/asset-registries/Illustrations.js +2 -0
- package/dist/prod/asset-registries/Illustrations.js.map +7 -0
- package/dist/prod/asset-registries/LocaleData.js +2 -0
- package/dist/prod/asset-registries/LocaleData.js.map +7 -0
- package/dist/prod/asset-registries/Themes.js +2 -0
- package/dist/prod/asset-registries/Themes.js.map +7 -0
- package/dist/prod/asset-registries/i18n.js +2 -0
- package/dist/prod/asset-registries/i18n.js.map +7 -0
- package/dist/prod/asset-registries/util/IconCollectionsAlias.js +2 -0
- package/dist/prod/asset-registries/util/IconCollectionsAlias.js.map +7 -0
- package/dist/prod/asset-registries/util/IconCollectionsByTheme.js +2 -0
- package/dist/prod/asset-registries/util/IconCollectionsByTheme.js.map +7 -0
- package/dist/prod/asset-registries/util/getIconCollectionByTheme.js +2 -0
- package/dist/prod/asset-registries/util/getIconCollectionByTheme.js.map +7 -0
- package/dist/prod/config/AnimationMode.js +2 -0
- package/dist/prod/config/AnimationMode.js.map +7 -0
- package/dist/prod/config/CalendarType.js +2 -0
- package/dist/prod/config/CalendarType.js.map +7 -0
- package/dist/prod/config/ConfigurationReset.js +2 -0
- package/dist/prod/config/ConfigurationReset.js.map +7 -0
- package/dist/prod/config/Fonts.js +2 -0
- package/dist/prod/config/Fonts.js.map +7 -0
- package/dist/prod/config/FormatSettings.js +2 -0
- package/dist/prod/config/FormatSettings.js.map +7 -0
- package/dist/prod/config/Icons.js +2 -0
- package/dist/prod/config/Icons.js.map +7 -0
- package/dist/prod/config/Language.js +2 -0
- package/dist/prod/config/Language.js.map +7 -0
- package/dist/prod/config/NoConflict.js +2 -0
- package/dist/prod/config/NoConflict.js.map +7 -0
- package/dist/prod/config/Theme.js +2 -0
- package/dist/prod/config/Theme.js.map +7 -0
- package/dist/prod/config/ThemeRoot.js +2 -0
- package/dist/prod/config/ThemeRoot.js.map +7 -0
- package/dist/prod/config/Timezone.js +2 -0
- package/dist/prod/config/Timezone.js.map +7 -0
- package/dist/prod/config/Tooltips.js +2 -0
- package/dist/prod/config/Tooltips.js.map +7 -0
- package/dist/prod/connectToComponent.js +2 -0
- package/dist/prod/connectToComponent.js.map +7 -0
- package/dist/prod/converters/DOMReference.js +2 -0
- package/dist/prod/converters/DOMReference.js.map +7 -0
- package/dist/prod/decorators/bound.js +2 -0
- package/dist/prod/decorators/bound.js.map +7 -0
- package/dist/prod/decorators/customElement.js +2 -0
- package/dist/prod/decorators/customElement.js.map +7 -0
- package/dist/prod/decorators/event-strict.js +2 -0
- package/dist/prod/decorators/event-strict.js.map +7 -0
- package/dist/prod/decorators/event.js +2 -0
- package/dist/prod/decorators/event.js.map +7 -0
- package/dist/prod/decorators/i18n.js +2 -0
- package/dist/prod/decorators/i18n.js.map +7 -0
- package/dist/prod/decorators/property.js +2 -0
- package/dist/prod/decorators/property.js.map +7 -0
- package/dist/prod/decorators/query.js +2 -0
- package/dist/prod/decorators/query.js.map +7 -0
- package/dist/prod/decorators/queryAll.js +2 -0
- package/dist/prod/decorators/queryAll.js.map +7 -0
- package/dist/prod/decorators/slot.js +2 -0
- package/dist/prod/decorators/slot.js.map +7 -0
- package/dist/prod/decorators.js +2 -0
- package/dist/prod/decorators.js.map +7 -0
- package/dist/prod/delegate/ItemNavigation.js +2 -0
- package/dist/prod/delegate/ItemNavigation.js.map +7 -0
- package/dist/prod/delegate/ResizeHandler.js +2 -0
- package/dist/prod/delegate/ResizeHandler.js.map +7 -0
- package/dist/prod/delegate/ScrollEnablement.js +2 -0
- package/dist/prod/delegate/ScrollEnablement.js.map +7 -0
- package/dist/prod/features/F6Navigation.js +2 -0
- package/dist/prod/features/F6Navigation.js.map +7 -0
- package/dist/prod/features/InputElementsFormSupport.js +2 -0
- package/dist/prod/features/InputElementsFormSupport.js.map +7 -0
- package/dist/prod/features/LegacyDateFormats.js +2 -0
- package/dist/prod/features/LegacyDateFormats.js.map +7 -0
- package/dist/prod/features/OpenUI5Element.js +2 -0
- package/dist/prod/features/OpenUI5Element.js.map +7 -0
- package/dist/prod/features/OpenUI5Enablement.js +21 -0
- package/dist/prod/features/OpenUI5Enablement.js.map +7 -0
- package/dist/prod/features/OpenUI5Support.js +2 -0
- package/dist/prod/features/OpenUI5Support.js.map +7 -0
- package/dist/prod/features/patchPatcher.js +2 -0
- package/dist/prod/features/patchPatcher.js.map +7 -0
- package/dist/prod/features/patchPopup.js +2 -0
- package/dist/prod/features/patchPopup.js.map +7 -0
- package/dist/prod/generated/AssetParameters.js +2 -0
- package/dist/prod/generated/AssetParameters.js.map +7 -0
- package/dist/prod/generated/VersionInfo.js +2 -0
- package/dist/prod/generated/VersionInfo.js.map +7 -0
- package/dist/prod/generated/css/BusyIndicator.css.js +2 -0
- package/dist/prod/generated/css/BusyIndicator.css.js.map +7 -0
- package/dist/prod/generated/css/FontFace.css.js +2 -0
- package/dist/prod/generated/css/FontFace.css.js.map +7 -0
- package/dist/prod/generated/css/OverrideFontFace.css.js +2 -0
- package/dist/prod/generated/css/OverrideFontFace.css.js.map +7 -0
- package/dist/prod/generated/css/SystemCSSVars.css.js +2 -0
- package/dist/prod/generated/css/SystemCSSVars.css.js.map +7 -0
- package/dist/prod/getSharedResource.js +2 -0
- package/dist/prod/getSharedResource.js.map +7 -0
- package/dist/prod/global.d.js +2 -0
- package/dist/prod/global.d.js.map +7 -0
- package/dist/prod/i18nBundle.js +2 -0
- package/dist/prod/i18nBundle.js.map +7 -0
- package/dist/prod/index.js +2 -0
- package/dist/prod/index.js.map +7 -0
- package/dist/prod/jsx-dev-runtime.js +2 -0
- package/dist/prod/jsx-dev-runtime.js.map +7 -0
- package/dist/prod/jsx-runtime.js +2 -0
- package/dist/prod/jsx-runtime.js.map +7 -0
- package/dist/prod/jsx-utils.js +2 -0
- package/dist/prod/jsx-utils.js.map +7 -0
- package/dist/prod/locale/Locale.js +2 -0
- package/dist/prod/locale/Locale.js.map +7 -0
- package/dist/prod/locale/RTLAwareRegistry.js +2 -0
- package/dist/prod/locale/RTLAwareRegistry.js.map +7 -0
- package/dist/prod/locale/applyDirection.js +2 -0
- package/dist/prod/locale/applyDirection.js.map +7 -0
- package/dist/prod/locale/directionChange.js +2 -0
- package/dist/prod/locale/directionChange.js.map +7 -0
- package/dist/prod/locale/getEffectiveDir.js +2 -0
- package/dist/prod/locale/getEffectiveDir.js.map +7 -0
- package/dist/prod/locale/getLocale.js +2 -0
- package/dist/prod/locale/getLocale.js.map +7 -0
- package/dist/prod/locale/languageChange.js +2 -0
- package/dist/prod/locale/languageChange.js.map +7 -0
- package/dist/prod/locale/nextFallbackLocale.js +2 -0
- package/dist/prod/locale/nextFallbackLocale.js.map +7 -0
- package/dist/prod/locale/normalizeLocale.js +2 -0
- package/dist/prod/locale/normalizeLocale.js.map +7 -0
- package/dist/prod/renderer/JsxRenderer.js +2 -0
- package/dist/prod/renderer/JsxRenderer.js.map +7 -0
- package/dist/prod/renderer/LitRenderer.js +2 -0
- package/dist/prod/renderer/LitRenderer.js.map +7 -0
- package/dist/prod/renderer/directives/style-map.js +6 -0
- package/dist/prod/renderer/directives/style-map.js.map +7 -0
- package/dist/prod/renderer/executeTemplate.js +2 -0
- package/dist/prod/renderer/executeTemplate.js.map +7 -0
- package/dist/prod/sap/base/Log.js +750 -0
- package/dist/prod/sap/base/assert.js +34 -0
- package/dist/prod/sap/base/config/MemoryConfigurationProvider.js +20 -0
- package/dist/prod/sap/base/security/URLListValidator.js +406 -0
- package/dist/prod/sap/base/security/encodeCSS.js +40 -0
- package/dist/prod/sap/base/security/encodeXML.js +53 -0
- package/dist/prod/sap/base/security/sanitizeHTML.js +38 -0
- package/dist/prod/sap/base/strings/toHex.js +33 -0
- package/dist/prod/sap/base/util/now.js +28 -0
- package/dist/prod/sap/base/util/uid.js +27 -0
- package/dist/prod/sap/ui/thirdparty/caja-html-sanitizer.js +3600 -0
- package/dist/prod/ssr-dom-shim.js +2 -0
- package/dist/prod/ssr-dom-shim.js.map +7 -0
- package/dist/prod/ssr-dom.js +2 -0
- package/dist/prod/ssr-dom.js.map +7 -0
- package/dist/prod/theming/CustomStyle.js +2 -0
- package/dist/prod/theming/CustomStyle.js.map +7 -0
- package/dist/prod/theming/ThemeLoaded.js +2 -0
- package/dist/prod/theming/ThemeLoaded.js.map +7 -0
- package/dist/prod/theming/ThemeRegistered.js +2 -0
- package/dist/prod/theming/ThemeRegistered.js.map +7 -0
- package/dist/prod/theming/applyTheme.js +2 -0
- package/dist/prod/theming/applyTheme.js.map +7 -0
- package/dist/prod/theming/getConstructableStyle.js +2 -0
- package/dist/prod/theming/getConstructableStyle.js.map +7 -0
- package/dist/prod/theming/getEffectiveStyle.js +2 -0
- package/dist/prod/theming/getEffectiveStyle.js.map +7 -0
- package/dist/prod/theming/getStylesString.js +2 -0
- package/dist/prod/theming/getStylesString.js.map +7 -0
- package/dist/prod/theming/getThemeDesignerTheme.js +2 -0
- package/dist/prod/theming/getThemeDesignerTheme.js.map +7 -0
- package/dist/prod/thirdparty/_merge.js +2 -0
- package/dist/prod/thirdparty/_merge.js.map +7 -0
- package/dist/prod/thirdparty/isPlainObject.js +2 -0
- package/dist/prod/thirdparty/isPlainObject.js.map +7 -0
- package/dist/prod/thirdparty/merge.js +2 -0
- package/dist/prod/thirdparty/merge.js.map +7 -0
- package/dist/prod/thirdparty/preact/jsx.d.js +2 -0
- package/dist/prod/thirdparty/preact/jsx.d.js.map +7 -0
- package/dist/prod/thirdparty/preact/jsxRuntime.module.d.js +2 -0
- package/dist/prod/thirdparty/preact/jsxRuntime.module.d.js.map +7 -0
- package/dist/prod/thirdparty/preact/jsxRuntime.module.js +1 -0
- package/dist/prod/thirdparty/preact/preact.module.d.js +2 -0
- package/dist/prod/thirdparty/preact/preact.module.d.js.map +7 -0
- package/dist/prod/thirdparty/preact/preact.module.js +1 -0
- package/dist/prod/types/AnimationMode.js +2 -0
- package/dist/prod/types/AnimationMode.js.map +7 -0
- package/dist/prod/types/CalendarType.js +2 -0
- package/dist/prod/types/CalendarType.js.map +7 -0
- package/dist/prod/types/InvisibleMessageMode.js +2 -0
- package/dist/prod/types/InvisibleMessageMode.js.map +7 -0
- package/dist/prod/types/ItemNavigationBehavior.js +2 -0
- package/dist/prod/types/ItemNavigationBehavior.js.map +7 -0
- package/dist/prod/types/MovePlacement.js +2 -0
- package/dist/prod/types/MovePlacement.js.map +7 -0
- package/dist/prod/types/NavigationMode.js +2 -0
- package/dist/prod/types/NavigationMode.js.map +7 -0
- package/dist/prod/types/Orientation.js +2 -0
- package/dist/prod/types/Orientation.js.map +7 -0
- package/dist/prod/types/SortOrder.js +2 -0
- package/dist/prod/types/SortOrder.js.map +7 -0
- package/dist/prod/types/ValueState.js +2 -0
- package/dist/prod/types/ValueState.js.map +7 -0
- package/dist/prod/types.js +2 -0
- package/dist/prod/types.js.map +7 -0
- package/dist/prod/updateShadowRoot.js +2 -0
- package/dist/prod/updateShadowRoot.js.map +7 -0
- package/dist/prod/util/AccessibilityTextsHelper.js +2 -0
- package/dist/prod/util/AccessibilityTextsHelper.js.map +7 -0
- package/dist/prod/util/Caret.js +2 -0
- package/dist/prod/util/Caret.js.map +7 -0
- package/dist/prod/util/ColorConversion.js +2 -0
- package/dist/prod/util/ColorConversion.js.map +7 -0
- package/dist/prod/util/FetchHelper.js +2 -0
- package/dist/prod/util/FetchHelper.js.map +7 -0
- package/dist/prod/util/FocusableElements.js +2 -0
- package/dist/prod/util/FocusableElements.js.map +7 -0
- package/dist/prod/util/HTMLSanitizer.js +2 -0
- package/dist/prod/util/HTMLSanitizer.js.map +7 -0
- package/dist/prod/util/InvisibleMessage.js +2 -0
- package/dist/prod/util/InvisibleMessage.js.map +7 -0
- package/dist/prod/util/PopupUtils.js +2 -0
- package/dist/prod/util/PopupUtils.js.map +7 -0
- package/dist/prod/util/SelectionAssistant.js +2 -0
- package/dist/prod/util/SelectionAssistant.js.map +7 -0
- package/dist/prod/util/SlotsHelper.js +2 -0
- package/dist/prod/util/SlotsHelper.js.map +7 -0
- package/dist/prod/util/StringHelper.js +2 -0
- package/dist/prod/util/StringHelper.js.map +7 -0
- package/dist/prod/util/TabbableElements.js +2 -0
- package/dist/prod/util/TabbableElements.js.map +7 -0
- package/dist/prod/util/arraysAreEqual.js +2 -0
- package/dist/prod/util/arraysAreEqual.js.map +7 -0
- package/dist/prod/util/clamp.js +2 -0
- package/dist/prod/util/clamp.js.map +7 -0
- package/dist/prod/util/createLinkInHead.js +2 -0
- package/dist/prod/util/createLinkInHead.js.map +7 -0
- package/dist/prod/util/debounce.js +2 -0
- package/dist/prod/util/debounce.js.map +7 -0
- package/dist/prod/util/detectNavigatorLanguage.js +2 -0
- package/dist/prod/util/detectNavigatorLanguage.js.map +7 -0
- package/dist/prod/util/dragAndDrop/DragRegistry.js +2 -0
- package/dist/prod/util/dragAndDrop/DragRegistry.js.map +7 -0
- package/dist/prod/util/dragAndDrop/findClosestPosition.js +2 -0
- package/dist/prod/util/dragAndDrop/findClosestPosition.js.map +7 -0
- package/dist/prod/util/dragAndDrop/handleDragOver.js +2 -0
- package/dist/prod/util/dragAndDrop/handleDragOver.js.map +7 -0
- package/dist/prod/util/dragAndDrop/handleDrop.js +2 -0
- package/dist/prod/util/dragAndDrop/handleDrop.js.map +7 -0
- package/dist/prod/util/dragAndDrop/longDragOverHandler.js +2 -0
- package/dist/prod/util/dragAndDrop/longDragOverHandler.js.map +7 -0
- package/dist/prod/util/escapeRegex.js +2 -0
- package/dist/prod/util/escapeRegex.js.map +7 -0
- package/dist/prod/util/fixSafariActiveState.js +2 -0
- package/dist/prod/util/fixSafariActiveState.js.map +7 -0
- package/dist/prod/util/formatMessage.js +2 -0
- package/dist/prod/util/formatMessage.js.map +7 -0
- package/dist/prod/util/generateHighlightedMarkup.js +2 -0
- package/dist/prod/util/generateHighlightedMarkup.js.map +7 -0
- package/dist/prod/util/getActiveElement.js +2 -0
- package/dist/prod/util/getActiveElement.js.map +7 -0
- package/dist/prod/util/getClassCopy.js +2 -0
- package/dist/prod/util/getClassCopy.js.map +7 -0
- package/dist/prod/util/getDesigntimePropertyAsArray.js +2 -0
- package/dist/prod/util/getDesigntimePropertyAsArray.js.map +7 -0
- package/dist/prod/util/getEffectiveContentDensity.js +2 -0
- package/dist/prod/util/getEffectiveContentDensity.js.map +7 -0
- package/dist/prod/util/getEffectiveScrollbarStyle.js +28 -0
- package/dist/prod/util/getEffectiveScrollbarStyle.js.map +7 -0
- package/dist/prod/util/getFastNavigationGroups.js +2 -0
- package/dist/prod/util/getFastNavigationGroups.js.map +7 -0
- package/dist/prod/util/getFileExtension.js +2 -0
- package/dist/prod/util/getFileExtension.js.map +7 -0
- package/dist/prod/util/getNormalizedTarget.js +2 -0
- package/dist/prod/util/getNormalizedTarget.js.map +7 -0
- package/dist/prod/util/getSingletonElementInstance.js +2 -0
- package/dist/prod/util/getSingletonElementInstance.js.map +7 -0
- package/dist/prod/util/hash2str.js +2 -0
- package/dist/prod/util/hash2str.js.map +7 -0
- package/dist/prod/util/isElementClickable.js +2 -0
- package/dist/prod/util/isElementClickable.js.map +7 -0
- package/dist/prod/util/isElementHidden.js +2 -0
- package/dist/prod/util/isElementHidden.js.map +7 -0
- package/dist/prod/util/isElementInView.js +2 -0
- package/dist/prod/util/isElementInView.js.map +7 -0
- package/dist/prod/util/isElementTabbable.js +2 -0
- package/dist/prod/util/isElementTabbable.js.map +7 -0
- package/dist/prod/util/isValidPropertyName.js +2 -0
- package/dist/prod/util/isValidPropertyName.js.map +7 -0
- package/dist/prod/util/throttle.js +2 -0
- package/dist/prod/util/throttle.js.map +7 -0
- package/dist/prod/util/toLowercaseEnumValue.js +2 -0
- package/dist/prod/util/toLowercaseEnumValue.js.map +7 -0
- package/dist/prod/util/whenDOMReady.js +2 -0
- package/dist/prod/util/whenDOMReady.js.map +7 -0
- package/dist/prod/util/willShowContent.js +2 -0
- package/dist/prod/util/willShowContent.js.map +7 -0
- package/dist/prod/validateThemeRoot.js +2 -0
- package/dist/prod/validateThemeRoot.js.map +7 -0
- package/dist/renderer/JsxRenderer.js +12 -2
- package/dist/renderer/JsxRenderer.js.map +1 -1
- package/dist/ssr-dom-shim.js +51 -1
- package/dist/ssr-dom-shim.js.map +1 -1
- package/dist/thirdparty/preact/jsx.d.ts +1 -1
- package/dist/thirdparty/preact/jsxRuntime.module.d.ts +3 -3
- package/dist/thirdparty/preact/jsxRuntime.module.js +0 -1
- package/dist/thirdparty/preact/preact.module.js +1 -2
- package/dist/types/SortOrder.d.ts +24 -0
- package/dist/types/SortOrder.js +26 -0
- package/dist/types/SortOrder.js.map +1 -0
- package/dist/util/ColorConversion.js +24 -22
- package/dist/util/ColorConversion.js.map +1 -1
- package/dist/util/FocusableElements.js +28 -2
- package/dist/util/FocusableElements.js.map +1 -1
- package/dist/util/HTMLSanitizer.d.ts +2 -0
- package/dist/util/HTMLSanitizer.js +2 -2
- package/dist/util/HTMLSanitizer.js.map +1 -1
- package/dist/util/dragAndDrop/findClosestPosition.d.ts +2 -1
- package/dist/util/dragAndDrop/findClosestPosition.js +45 -41
- package/dist/util/dragAndDrop/findClosestPosition.js.map +1 -1
- package/dist/util/getClassCopy.d.ts +4 -0
- package/dist/util/getEffectiveScrollbarStyle.d.ts +1 -1
- package/dist/util/getEffectiveScrollbarStyle.js +3 -1
- package/dist/util/getEffectiveScrollbarStyle.js.map +1 -1
- package/dist/util/getFastNavigationGroups.js +6 -1
- package/dist/util/getFastNavigationGroups.js.map +1 -1
- package/dist/util/throttle.d.ts +2 -0
- package/dist/util/throttle.js +20 -0
- package/dist/util/throttle.js.map +1 -0
- package/dist/vscode.html-custom-data.json +22 -0
- package/package-scripts.cjs +4 -4
- package/package.json +12 -7
- package/src/thirdparty/preact/jsxRuntime.module.js +0 -1
- package/src/thirdparty/preact/preact.module.js +1 -2
- package/tsconfig.json +0 -1
- package/cypress/specs/CustomMount.cy.ts +0 -34
- package/index.js +0 -208
- /package/cypress/specs/{Boot.cy.ts → Boot.cy.tsx} +0 -0
- /package/cypress/specs/{ConfigurationChange.cy.ts → ConfigurationChange.cy.tsx} +0 -0
- /package/cypress/specs/{EventProvider.cy.ts → EventProvider.cy.tsx} +0 -0
- /package/cypress/specs/{SystemDOMElements.cy.ts → SystemDOMElements.cy.tsx} +0 -0
- /package/cypress/specs/{Theming.cy.ts → Theming.cy.tsx} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const registerTag: (tag: string) => void;
|
|
2
2
|
declare const isTagRegistered: (tag: string) => boolean;
|
|
3
|
+
declare const hasRegisteredTags: () => boolean;
|
|
3
4
|
declare const getAllRegisteredTags: () => string[];
|
|
4
5
|
declare const recordTagRegistrationFailure: (tag: string) => void;
|
|
5
|
-
export { registerTag, isTagRegistered, getAllRegisteredTags, recordTagRegistrationFailure, };
|
|
6
|
+
export { registerTag, isTagRegistered, hasRegisteredTags, getAllRegisteredTags, recordTagRegistrationFailure, };
|
|
@@ -12,6 +12,9 @@ const registerTag = (tag) => {
|
|
|
12
12
|
const isTagRegistered = (tag) => {
|
|
13
13
|
return Definitions.has(tag);
|
|
14
14
|
};
|
|
15
|
+
const hasRegisteredTags = () => {
|
|
16
|
+
return Definitions.size > 0;
|
|
17
|
+
};
|
|
15
18
|
const getAllRegisteredTags = () => {
|
|
16
19
|
return [...Definitions.values()];
|
|
17
20
|
};
|
|
@@ -74,5 +77,5 @@ const displayFailedRegistrations = () => {
|
|
|
74
77
|
message = `${message}\n\nTo prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/06-scoping.md.`;
|
|
75
78
|
console.warn(message); // eslint-disable-line
|
|
76
79
|
};
|
|
77
|
-
export { registerTag, isTagRegistered, getAllRegisteredTags, recordTagRegistrationFailure, };
|
|
80
|
+
export { registerTag, isTagRegistered, hasRegisteredTags, getAllRegisteredTags, recordTagRegistrationFailure, };
|
|
78
81
|
//# sourceMappingURL=CustomElementsRegistry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomElementsRegistry.js","sourceRoot":"","sources":["../src/CustomElementsRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGxF,MAAM,IAAI,GAAG,iBAAiB,CAAsB,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AACvE,MAAM,WAAW,GAAG,IAAI,GAAG,EAAU,CAAC;AAEtC,IAAI,QAAQ,GAAG,IAAI,GAAG,EAAuB,CAAC;AAC9C,IAAI,cAAmC,CAAC;AAExC,MAAM,eAAe,GAAG,CAAC,CAAC,CAAC;AAE3B,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE;IACnC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,sBAAsB,EAAE,CAAC,CAAC;AACzC,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,GAAW,EAAE,EAAE;IACvC,OAAO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACjC,OAAO,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;AAClC,CAAC,CAAC;AAEF,MAAM,4BAA4B,GAAG,CAAC,GA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EF,OAAO,EACN,WAAW,EACX,eAAe,EACf,oBAAoB,EACpB,4BAA4B,GAC5B,CAAC","sourcesContent":["import getSharedResource from \"./getSharedResource.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes, getAllRuntimes } from \"./Runtimes.js\";\nimport type { Timeout } from \"./types.js\";\n\nconst Tags = getSharedResource<Map<string, number>>(\"Tags\", new Map());\nconst Definitions = new Set<string>();\n\nlet Failures = new Map<number, Set<string>>();\nlet failureTimeout: Timeout | undefined;\n\nconst UNKNOWN_RUNTIME = -1;\n\nconst registerTag = (tag: string) => {\n\tDefinitions.add(tag);\n\tTags.set(tag, getCurrentRuntimeIndex());\n};\n\nconst isTagRegistered = (tag: string) => {\n\treturn Definitions.has(tag);\n};\n\nconst getAllRegisteredTags = () => {\n\treturn [...Definitions.values()];\n};\n\nconst recordTagRegistrationFailure = (tag: string) => {\n\tlet tagRegRuntimeIndex = Tags.get(tag);\n\tif (tagRegRuntimeIndex === undefined) {\n\t\ttagRegRuntimeIndex = UNKNOWN_RUNTIME; // If the tag is taken, but not registered in Tags, then a version before 1.1.0 defined it => use the \"unknown\" key\n\t}\n\n\tif (!Failures.has(tagRegRuntimeIndex)) {\n\t\tFailures.set(tagRegRuntimeIndex, new Set());\n\t}\n\tFailures.get(tagRegRuntimeIndex)!.add(tag);\n\n\tif (!failureTimeout) {\n\t\tfailureTimeout = setTimeout(() => {\n\t\t\tdisplayFailedRegistrations();\n\t\t\tFailures = new Map();\n\t\t\tfailureTimeout = undefined;\n\t\t}, 1000);\n\t}\n};\n\nconst displayFailedRegistrations = () => {\n\tconst allRuntimes = getAllRuntimes();\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\tconst currentRuntime = allRuntimes[currentRuntimeIndex];\n\n\tlet message = `Multiple UI5 Web Components instances detected.`;\n\n\tif (allRuntimes.length > 1) {\n\t\tmessage = `${message}\\nLoading order (versions before 1.1.0 not listed): ${allRuntimes.map(runtime => `\\n${runtime.description}`).join(\"\")}`;\n\t}\n\n\t[...Failures.keys()].forEach(otherRuntimeIndex => {\n\t\tlet comparison: number;\n\t\tlet otherRuntime;\n\n\t\tif (otherRuntimeIndex === UNKNOWN_RUNTIME) { // version < 1.1.0 defined the tag\n\t\t\tcomparison = 1; // the current runtime is considered newer\n\t\t\totherRuntime = {\n\t\t\t\tdescription: `Older unknown runtime`,\n\t\t\t};\n\t\t} else {\n\t\t\tcomparison = compareRuntimes(currentRuntimeIndex, otherRuntimeIndex);\n\t\t\totherRuntime = allRuntimes[otherRuntimeIndex];\n\t\t}\n\n\t\tlet compareWord;\n\t\tif (comparison > 0) {\n\t\t\tcompareWord = \"an older\";\n\t\t} else if (comparison < 0) {\n\t\t\tcompareWord = \"a newer\";\n\t\t} else {\n\t\t\tcompareWord = \"the same\";\n\t\t}\n\t\tmessage = `${message}\\n\\n\"${currentRuntime.description}\" failed to define ${Failures.get(otherRuntimeIndex)!.size} tag(s) as they were defined by a runtime of ${compareWord} version \"${otherRuntime.description}\": ${([...Failures.get(otherRuntimeIndex)!]).sort().join(\", \")}.`;\n\n\t\tif (comparison > 0) {\n\t\t\tmessage = `${message}\\nWARNING! If your code uses features of the above web components, unavailable in ${otherRuntime.description}, it might not work as expected!`;\n\t\t} else {\n\t\t\tmessage = `${message}\\nSince the above web components were defined by the same or newer version runtime, they should be compatible with your code.`;\n\t\t}\n\t});\n\n\tmessage = `${message}\\n\\nTo prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/06-scoping.md.`;\n\n\tconsole.warn(message); // eslint-disable-line\n};\n\nexport {\n\tregisterTag,\n\tisTagRegistered,\n\tgetAllRegisteredTags,\n\trecordTagRegistrationFailure,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"CustomElementsRegistry.js","sourceRoot":"","sources":["../src/CustomElementsRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,sBA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,CAAC;QAChB,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;YACpB,WAAW,GAAG,UAAU,CAAC;QAC1B,CAAC;aAAM,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;YAC3B,WAAW,GAAG,SAAS,CAAC;QACzB,CAAC;aAAM,CAAC;YACP,WAAW,GAAG,UAAU,CAAC;QAC1B,CAAC;QACD,OAAO,GAAG,GAAG,OAAO,QAAQ,cAAc,CAAC,WAAW,sBAAsB,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAE,CAAC,IAAI,gDAAgD,WAAW,aAAa,YAAY,CAAC,WAAW,MAAM,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QAEpR,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;YACpB,OAAO,GAAG,GAAG,OAAO,qFAAqF,YAAY,CAAC,WAAW,kCAAkC,CAAC;QACrK,CAAC;aAAM,CAAC;YACP,OAAO,GAAG,GAAG,OAAO,+HAA+H,CAAC;QACrJ,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,GAAG,OAAO,oNAAoN,CAAC;IAEzO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,sBAAsB;AAC9C,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,4BAA4B,GAC5B,CAAC","sourcesContent":["import getSharedResource from \"./getSharedResource.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes, getAllRuntimes } from \"./Runtimes.js\";\nimport type { Timeout } from \"./types.js\";\n\nconst Tags = getSharedResource<Map<string, number>>(\"Tags\", new Map());\nconst Definitions = new Set<string>();\n\nlet Failures = new Map<number, Set<string>>();\nlet failureTimeout: Timeout | undefined;\n\nconst UNKNOWN_RUNTIME = -1;\n\nconst registerTag = (tag: string) => {\n\tDefinitions.add(tag);\n\tTags.set(tag, getCurrentRuntimeIndex());\n};\n\nconst isTagRegistered = (tag: string) => {\n\treturn Definitions.has(tag);\n};\n\nconst hasRegisteredTags = () => {\n\treturn Definitions.size > 0;\n};\n\nconst getAllRegisteredTags = () => {\n\treturn [...Definitions.values()];\n};\n\nconst recordTagRegistrationFailure = (tag: string) => {\n\tlet tagRegRuntimeIndex = Tags.get(tag);\n\tif (tagRegRuntimeIndex === undefined) {\n\t\ttagRegRuntimeIndex = UNKNOWN_RUNTIME; // If the tag is taken, but not registered in Tags, then a version before 1.1.0 defined it => use the \"unknown\" key\n\t}\n\n\tif (!Failures.has(tagRegRuntimeIndex)) {\n\t\tFailures.set(tagRegRuntimeIndex, new Set());\n\t}\n\tFailures.get(tagRegRuntimeIndex)!.add(tag);\n\n\tif (!failureTimeout) {\n\t\tfailureTimeout = setTimeout(() => {\n\t\t\tdisplayFailedRegistrations();\n\t\t\tFailures = new Map();\n\t\t\tfailureTimeout = undefined;\n\t\t}, 1000);\n\t}\n};\n\nconst displayFailedRegistrations = () => {\n\tconst allRuntimes = getAllRuntimes();\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\tconst currentRuntime = allRuntimes[currentRuntimeIndex];\n\n\tlet message = `Multiple UI5 Web Components instances detected.`;\n\n\tif (allRuntimes.length > 1) {\n\t\tmessage = `${message}\\nLoading order (versions before 1.1.0 not listed): ${allRuntimes.map(runtime => `\\n${runtime.description}`).join(\"\")}`;\n\t}\n\n\t[...Failures.keys()].forEach(otherRuntimeIndex => {\n\t\tlet comparison: number;\n\t\tlet otherRuntime;\n\n\t\tif (otherRuntimeIndex === UNKNOWN_RUNTIME) { // version < 1.1.0 defined the tag\n\t\t\tcomparison = 1; // the current runtime is considered newer\n\t\t\totherRuntime = {\n\t\t\t\tdescription: `Older unknown runtime`,\n\t\t\t};\n\t\t} else {\n\t\t\tcomparison = compareRuntimes(currentRuntimeIndex, otherRuntimeIndex);\n\t\t\totherRuntime = allRuntimes[otherRuntimeIndex];\n\t\t}\n\n\t\tlet compareWord;\n\t\tif (comparison > 0) {\n\t\t\tcompareWord = \"an older\";\n\t\t} else if (comparison < 0) {\n\t\t\tcompareWord = \"a newer\";\n\t\t} else {\n\t\t\tcompareWord = \"the same\";\n\t\t}\n\t\tmessage = `${message}\\n\\n\"${currentRuntime.description}\" failed to define ${Failures.get(otherRuntimeIndex)!.size} tag(s) as they were defined by a runtime of ${compareWord} version \"${otherRuntime.description}\": ${([...Failures.get(otherRuntimeIndex)!]).sort().join(\", \")}.`;\n\n\t\tif (comparison > 0) {\n\t\t\tmessage = `${message}\\nWARNING! If your code uses features of the above web components, unavailable in ${otherRuntime.description}, it might not work as expected!`;\n\t\t} else {\n\t\t\tmessage = `${message}\\nSince the above web components were defined by the same or newer version runtime, they should be compatible with your code.`;\n\t\t}\n\t});\n\n\tmessage = `${message}\\n\\nTo prevent other runtimes from defining tags that you use, consider using scoping or have third-party libraries use scoping: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/06-scoping.md.`;\n\n\tconsole.warn(message); // eslint-disable-line\n};\n\nexport {\n\tregisterTag,\n\tisTagRegistered,\n\thasRegisteredTags,\n\tgetAllRegisteredTags,\n\trecordTagRegistrationFailure,\n};\n"]}
|
|
@@ -4,7 +4,9 @@ type Rules = {
|
|
|
4
4
|
};
|
|
5
5
|
/**
|
|
6
6
|
* Sets the suffix to be used for custom elements scoping, f.e. pass "demo" to get tags such as "ui5-button-demo".
|
|
7
|
-
*
|
|
7
|
+
*
|
|
8
|
+
* **Note:** By default all tags starting with "ui5-" will be scoped, unless you change this by calling "setCustomElementsScopingRules"
|
|
9
|
+
* **Note:** Setting the scoping suffix must be done before importing any components.
|
|
8
10
|
*
|
|
9
11
|
* @public
|
|
10
12
|
* @param suffix The scoping suffix
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hasRegisteredTags } from "./CustomElementsRegistry.js";
|
|
1
2
|
import VersionInfo from "./generated/VersionInfo.js";
|
|
2
3
|
let suf;
|
|
3
4
|
let rulesObj = {
|
|
@@ -7,7 +8,9 @@ let rulesObj = {
|
|
|
7
8
|
const tagsCache = new Map(); // true/false means the tag should/should not be cached, undefined means not known yet.
|
|
8
9
|
/**
|
|
9
10
|
* Sets the suffix to be used for custom elements scoping, f.e. pass "demo" to get tags such as "ui5-button-demo".
|
|
10
|
-
*
|
|
11
|
+
*
|
|
12
|
+
* **Note:** By default all tags starting with "ui5-" will be scoped, unless you change this by calling "setCustomElementsScopingRules"
|
|
13
|
+
* **Note:** Setting the scoping suffix must be done before importing any components.
|
|
11
14
|
*
|
|
12
15
|
* @public
|
|
13
16
|
* @param suffix The scoping suffix
|
|
@@ -16,6 +19,10 @@ const setCustomElementsScopingSuffix = (suffix) => {
|
|
|
16
19
|
if (!suffix.match(/^[a-zA-Z0-9_-]+$/)) {
|
|
17
20
|
throw new Error("Only alphanumeric characters and dashes allowed for the scoping suffix");
|
|
18
21
|
}
|
|
22
|
+
if (hasRegisteredTags()) {
|
|
23
|
+
// eslint-disable-next-line no-console
|
|
24
|
+
console.warn("Setting the scoping suffix must be done before importing any components. For proper usage, read the scoping section: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/06-scoping.md.");
|
|
25
|
+
}
|
|
19
26
|
suf = suffix;
|
|
20
27
|
};
|
|
21
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomElementsScopeUtils.js","sourceRoot":"","sources":["../src/CustomElementsScopeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,4BAA4B,CAAC;AAErD,IAAI,GAAW,CAAC;AAOhB,IAAI,QAAQ,GAAU;IACrB,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,OAAO,EAAE,EAAE;CACX,CAAC;AAEF,MAAM,SAAS,GAAG,IAAI,GAAG,EAAmB,CAAC,CAAC,uFAAuF;AAErI
|
|
1
|
+
{"version":3,"file":"CustomElementsScopeUtils.js","sour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AAC;IACzC,CAAC;AACF,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,EAAE;IACzC,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAClE,MAAM,IAAI,GAAG,uBAAuB,CAAC;IACrC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,UAAU,IAAI,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,OAAO,EACN,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,gBAAgB,GAChB,CAAC","sourcesContent":["import { hasRegisteredTags } from \"./CustomElementsRegistry.js\";\nimport VersionInfo from \"./generated/VersionInfo.js\";\n\nlet suf: string;\n\ntype Rules = {\n\tinclude: Array<RegExp>,\n\texclude: Array<RegExp>,\n};\n\nlet rulesObj: Rules = {\n\tinclude: [/^ui5-/],\n\texclude: [],\n};\n\nconst tagsCache = new Map<string, boolean>(); // true/false means the tag should/should not be cached, undefined means not known yet.\n\n/**\n * Sets the suffix to be used for custom elements scoping, f.e. pass \"demo\" to get tags such as \"ui5-button-demo\".\n *\n * **Note:** By default all tags starting with \"ui5-\" will be scoped, unless you change this by calling \"setCustomElementsScopingRules\"\n * **Note:** Setting the scoping suffix must be done before importing any components.\n *\n * @public\n * @param suffix The scoping suffix\n */\nconst setCustomElementsScopingSuffix = (suffix: string) => {\n\tif (!suffix.match(/^[a-zA-Z0-9_-]+$/)) {\n\t\tthrow new Error(\"Only alphanumeric characters and dashes allowed for the scoping suffix\");\n\t}\n\n\tif (hasRegisteredTags()) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\"Setting the scoping suffix must be done before importing any components. For proper usage, read the scoping section: https://github.com/SAP/ui5-webcomponents/blob/main/docs/2-advanced/06-scoping.md.\");\n\t}\n\n\tsuf = suffix;\n};\n\n/**\n * Returns the currently set scoping suffix, or undefined if not set.\n *\n * @public\n * @returns {String|undefined}\n */\nconst getCustomElementsScopingSuffix = () => {\n\treturn suf;\n};\n\n/**\n * Sets the rules, governing which custom element tags to scope and which not, f.e.\n * setCustomElementsScopingRules({include: [/^ui5-/]}, exclude: [/^ui5-mylib-/, /^ui5-carousel$/]);\n * will scope all elements starting with \"ui5-\" but not the ones starting with \"ui5-mylib-\" and not \"ui5-carousel\".\n *\n * @public\n * @param rules Object with \"include\" and \"exclude\" properties, both arrays of regular expressions. Note that \"include\"\n * rules are applied first and \"exclude\" rules second.\n */\nconst setCustomElementsScopingRules = (rules: Rules) => {\n\tif (!rules || !rules.include) {\n\t\tthrow new Error(`\"rules\" must be an object with at least an \"include\" property`);\n\t}\n\n\tif (!Array.isArray(rules.include) || rules.include.some(rule => !(rule instanceof RegExp))) {\n\t\tthrow new Error(`\"rules.include\" must be an array of regular expressions`);\n\t}\n\n\tif (rules.exclude && (!Array.isArray(rules.exclude) || rules.exclude.some(rule => !(rule instanceof RegExp)))) {\n\t\tthrow new Error(`\"rules.exclude\" must be an array of regular expressions`);\n\t}\n\n\trules.exclude = rules.exclude || [];\n\trulesObj = rules;\n\ttagsCache.clear(); // reset the cache upon setting new rules\n};\n\n/**\n * Returns the rules, governing which custom element tags to scope and which not. By default, all elements\n * starting with \"ui5-\" are scoped. The default rules are: {include: [/^ui5-/]}.\n *\n * @public\n * @returns {Object}\n */\nconst getCustomElementsScopingRules = () => {\n\treturn rulesObj;\n};\n\n/**\n * Determines whether custom elements with the given tag should be scoped or not.\n * The tag is first matched against the \"include\" rules and then against the \"exclude\" rules and the\n * result is cached until new rules are set.\n *\n * @public\n * @param tag\n */\nconst shouldScopeCustomElement = (tag: string) => {\n\tif (!tagsCache.has(tag)) {\n\t\tconst result = rulesObj.include.some(rule => tag.match(rule)) && !rulesObj.exclude.some(rule => tag.match(rule));\n\t\ttagsCache.set(tag, result);\n\t}\n\n\treturn tagsCache.get(tag);\n};\n\n/**\n * Returns the currently set scoping suffix, if any and if the tag should be scoped, or undefined otherwise.\n *\n * @public\n * @param tag\n * @returns {String}\n */\nconst getEffectiveScopingSuffixForTag = (tag: string) => {\n\tif (shouldScopeCustomElement(tag)) {\n\t\treturn getCustomElementsScopingSuffix();\n\t}\n};\n\n/**\n * @public\n * Used for getting a scoped name for a CSS variable using the same transformation used in the build\n * @name the name of the css variable as written in the code\n * @returns a variable name with the current version inserted as available at runtime\n */\nconst getScopedVarName = (name: string) => {\n\tconst versionStr = `v${VersionInfo.version.replaceAll(\".\", \"-\")}`;\n\tconst expr = /(--_?ui5)([^,:)\\s]+)/g;\n\treturn name.replaceAll(expr, `$1-${versionStr}$2`);\n};\n\nexport {\n\tsetCustomElementsScopingSuffix,\n\tgetCustomElementsScopingSuffix,\n\tsetCustomElementsScopingRules,\n\tgetCustomElementsScopingRules,\n\tshouldScopeCustomElement,\n\tgetEffectiveScopingSuffixForTag,\n\tgetScopedVarName,\n};\n"]}
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
import type UI5Element from "./UI5Element.js";
|
|
2
|
-
declare abstract class ComponentFeature {
|
|
3
|
-
constructor(...args: any[]);
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated assign the feature's "i18nBundle" static member directly from the component that uses the feature
|
|
6
|
-
*/
|
|
7
|
-
static define?: () => Promise<void>;
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated no longer necessary for jsxRenderer-enabled components
|
|
10
|
-
*/
|
|
11
|
-
static dependencies?: Array<typeof UI5Element>;
|
|
12
|
-
}
|
|
13
1
|
declare const registerFeature: (name: string, feature: object) => void;
|
|
14
2
|
declare const getFeature: <T>(name: string) => T;
|
|
15
|
-
|
|
16
|
-
declare const getComponentFeature: <T>(name: string) => T | undefined;
|
|
17
|
-
declare const subscribeForFeatureLoad: (name: string, klass: typeof UI5Element, callback: () => void) => void;
|
|
18
|
-
export { registerFeature, getFeature, registerComponentFeature, getComponentFeature, subscribeForFeatureLoad, ComponentFeature, };
|
|
3
|
+
export { registerFeature, getFeature, };
|
package/dist/FeaturesRegistry.js
CHANGED
|
@@ -1,45 +1,9 @@
|
|
|
1
|
-
import EventProvider from "./EventProvider.js";
|
|
2
|
-
class ComponentFeature {
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-empty-function
|
|
4
|
-
constructor(...args) { }
|
|
5
|
-
}
|
|
6
1
|
const features = new Map();
|
|
7
|
-
const componentFeatures = new Map();
|
|
8
|
-
const subscribers = new Map();
|
|
9
|
-
const EVENT_NAME = "componentFeatureLoad";
|
|
10
|
-
const eventProvider = new EventProvider();
|
|
11
|
-
const featureLoadEventName = (name) => `${EVENT_NAME}_${name}`;
|
|
12
2
|
const registerFeature = (name, feature) => {
|
|
13
3
|
features.set(name, feature);
|
|
14
4
|
};
|
|
15
5
|
const getFeature = (name) => {
|
|
16
6
|
return features.get(name);
|
|
17
7
|
};
|
|
18
|
-
|
|
19
|
-
await Promise.all(feature.dependencies?.map(dep => dep.define()) || []);
|
|
20
|
-
await feature.define?.();
|
|
21
|
-
componentFeatures.set(name, feature);
|
|
22
|
-
notifyForFeatureLoad(name);
|
|
23
|
-
};
|
|
24
|
-
const getComponentFeature = (name) => {
|
|
25
|
-
return componentFeatures.get(name);
|
|
26
|
-
};
|
|
27
|
-
const subscribeForFeatureLoad = (name, klass, callback) => {
|
|
28
|
-
const subscriber = subscribers.get(klass);
|
|
29
|
-
const isSubscribed = subscriber?.includes(name);
|
|
30
|
-
if (isSubscribed) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (!subscriber) {
|
|
34
|
-
subscribers.set(klass, [name]);
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
subscriber.push(name);
|
|
38
|
-
}
|
|
39
|
-
eventProvider.attachEvent(featureLoadEventName(name), callback);
|
|
40
|
-
};
|
|
41
|
-
const notifyForFeatureLoad = (name) => {
|
|
42
|
-
eventProvider.fireEvent(featureLoadEventName(name), undefined);
|
|
43
|
-
};
|
|
44
|
-
export { registerFeature, getFeature, registerComponentFeature, getComponentFeature, subscribeForFeatureLoad, ComponentFeature, };
|
|
8
|
+
export { registerFeature, getFeature, };
|
|
45
9
|
//# sourceMappingURL=FeaturesRegistry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeaturesRegistry.js","sourceRoot":"","sources":["../src/FeaturesRegistry.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"FeaturesRegistry.js","sourceRoot":"","sources":["../src/FeaturesRegistry.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAe,CAAC;AAExC,MAAM,eAAe,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,EAAE;IACzD,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAI,IAAY,EAAK,EAAE;IACzC,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAM,CAAC;AAChC,CAAC,CAAC;AAEF,OAAO,EACN,eAAe,EACf,UAAU,GACV,CAAC","sourcesContent":["const features = new Map<string, any>();\n\nconst registerFeature = (name: string, feature: object) => {\n\tfeatures.set(name, feature);\n};\n\nconst getFeature = <T>(name: string): T => {\n\treturn features.get(name) as T;\n};\n\nexport {\n\tregisterFeature,\n\tgetFeature,\n};\n"]}
|
package/dist/UI5Element.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { Slot, SlotValue, State, PropertyValue, Metadata } from "./UI5Eleme
|
|
|
5
5
|
import EventProvider from "./EventProvider.js";
|
|
6
6
|
import type { TemplateFunction } from "./renderer/executeTemplate.js";
|
|
7
7
|
import type { AccessibilityInfo, PromiseResolve, ComponentStylesData, ClassMap } from "./types.js";
|
|
8
|
+
import type I18nBundle from "./i18nBundle.js";
|
|
8
9
|
type Renderer = (instance: UI5Element, container: HTMLElement | DocumentFragment) => void;
|
|
9
10
|
type ChangeInfo = {
|
|
10
11
|
type: "property" | "slot";
|
|
@@ -28,8 +29,14 @@ type KebabToCamel<T extends string> = T extends `${infer H}-${infer J}${infer K}
|
|
|
28
29
|
type KebabToPascal<T extends string> = Capitalize<KebabToCamel<T>>;
|
|
29
30
|
type GlobalHTMLAttributeNames = "accesskey" | "autocapitalize" | "autofocus" | "autocomplete" | "contenteditable" | "contextmenu" | "class" | "dir" | "draggable" | "enterkeyhint" | "hidden" | "id" | "inputmode" | "lang" | "nonce" | "part" | "exportparts" | "pattern" | "slot" | "spellcheck" | "style" | "tabIndex" | "tabindex" | "title" | "translate" | "ref" | "inert";
|
|
30
31
|
type ElementProps<I> = Partial<Omit<I, keyof HTMLElement>>;
|
|
31
|
-
type
|
|
32
|
-
|
|
32
|
+
type TargetedCustomEvent<D, T> = Omit<CustomEvent<D>, "currentTarget"> & {
|
|
33
|
+
currentTarget: T;
|
|
34
|
+
};
|
|
35
|
+
type TargetedEventHandler<D, T> = {
|
|
36
|
+
asMethod(e: TargetedCustomEvent<D, T>): void;
|
|
37
|
+
}["asMethod"];
|
|
38
|
+
type Convert<T, K extends UI5Element> = {
|
|
39
|
+
[Property in keyof T as `on${KebabToPascal<string & Property>}`]: IsAny<T[Property], any, TargetedEventHandler<T[Property], K>>;
|
|
33
40
|
};
|
|
34
41
|
/**
|
|
35
42
|
* @class
|
|
@@ -42,7 +49,7 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
42
49
|
eventDetails: NotEqual<this, UI5Element> extends true ? object : {
|
|
43
50
|
[k: string]: any;
|
|
44
51
|
};
|
|
45
|
-
_jsxEvents: Omit<JSX.DOMAttributes<this>, keyof Convert<this["eventDetails"]> | "onClose" | "onToggle" | "onChange" | "onSelect" | "onInput"> & Convert<this["eventDetails"]>;
|
|
52
|
+
_jsxEvents: Omit<JSX.DOMAttributes<this>, keyof Convert<this["eventDetails"], this> | "onClose" | "onToggle" | "onChange" | "onSelect" | "onInput"> & Convert<this["eventDetails"], this>;
|
|
46
53
|
_jsxProps: Pick<JSX.AllHTMLAttributes<HTMLElement>, GlobalHTMLAttributeNames> & ElementProps<this> & Partial<this["_jsxEvents"]> & {
|
|
47
54
|
key?: any;
|
|
48
55
|
};
|
|
@@ -60,6 +67,7 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
60
67
|
_deferredResolve?: PromiseResolve;
|
|
61
68
|
};
|
|
62
69
|
_doNotSyncAttributes: Set<string>;
|
|
70
|
+
__shouldHydrate: boolean;
|
|
63
71
|
_state: State;
|
|
64
72
|
_internals: ElementInternals;
|
|
65
73
|
_individualSlot?: string;
|
|
@@ -327,6 +335,7 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
327
335
|
* @default true
|
|
328
336
|
*/
|
|
329
337
|
get isUI5Element(): boolean;
|
|
338
|
+
get isUI5AbstractElement(): boolean;
|
|
330
339
|
get classes(): ClassMap;
|
|
331
340
|
/**
|
|
332
341
|
* Returns the component accessibility info.
|
|
@@ -385,10 +394,12 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
385
394
|
* @deprecated use the "i18n" decorator for fetching message bundles and the "cldr" option in the "customElements" decorator for fetching CLDR
|
|
386
395
|
*/
|
|
387
396
|
static onDefine(): Promise<void>;
|
|
388
|
-
static fetchI18nBundles(): Promise<
|
|
397
|
+
static fetchI18nBundles(): Promise<I18nBundle[]>;
|
|
389
398
|
static fetchCLDR(): Promise<void>;
|
|
390
399
|
static asyncFinished: boolean;
|
|
391
400
|
static definePromise: Promise<void> | undefined;
|
|
401
|
+
static i18nBundleStorage: Record<string, I18nBundle>;
|
|
402
|
+
static get i18nBundles(): Record<string, I18nBundle>;
|
|
392
403
|
/**
|
|
393
404
|
* Registers a UI5 Web Component in the browser window object
|
|
394
405
|
* @public
|
package/dist/UI5Element.js
CHANGED
|
@@ -19,7 +19,6 @@ import { markAsRtlAware } from "./locale/RTLAwareRegistry.js";
|
|
|
19
19
|
import executeTemplate from "./renderer/executeTemplate.js";
|
|
20
20
|
import { shouldScopeCustomElement } from "./CustomElementsScopeUtils.js";
|
|
21
21
|
import { updateFormValue, setFormValue } from "./features/InputElementsFormSupport.js";
|
|
22
|
-
import { getComponentFeature, subscribeForFeatureLoad } from "./FeaturesRegistry.js";
|
|
23
22
|
import { getI18nBundle } from "./i18nBundle.js";
|
|
24
23
|
import { fetchCldr } from "./asset-registries/LocaleData.js";
|
|
25
24
|
import getLocale from "./locale/getLocale.js";
|
|
@@ -95,6 +94,7 @@ function getPropertyDescriptor(proto, name) {
|
|
|
95
94
|
class UI5Element extends HTMLElement {
|
|
96
95
|
constructor() {
|
|
97
96
|
super();
|
|
97
|
+
this.__shouldHydrate = false;
|
|
98
98
|
// used to differentiate whether a setter is called from the constructor (from an initializer) or later
|
|
99
99
|
// setters from the constructor should not set attributes, this is delegated after the first rendering but is async
|
|
100
100
|
// setters after the constructor can set attributes synchronously for more convinient development
|
|
@@ -132,7 +132,14 @@ class UI5Element extends HTMLElement {
|
|
|
132
132
|
const ctor = this.constructor;
|
|
133
133
|
if (ctor._needsShadowDOM()) {
|
|
134
134
|
const defaultOptions = { mode: "open" };
|
|
135
|
-
|
|
135
|
+
if (!this.shadowRoot) {
|
|
136
|
+
this.attachShadow({ ...defaultOptions, ...ctor.getMetadata().getShadowRootOptions() });
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
// The shadow root is initially rendered. This applies to case where the component's template
|
|
140
|
+
// is inserted into the DOM declaratively using a <template> tag.
|
|
141
|
+
this.__shouldHydrate = true;
|
|
142
|
+
}
|
|
136
143
|
const slotsAreManaged = ctor.getMetadata().slotsAreManaged();
|
|
137
144
|
if (slotsAreManaged) {
|
|
138
145
|
this.shadowRoot.addEventListener("slotchange", this._onShadowRootSlotChange.bind(this));
|
|
@@ -181,7 +188,7 @@ class UI5Element extends HTMLElement {
|
|
|
181
188
|
}
|
|
182
189
|
const ctor = this.constructor;
|
|
183
190
|
this.setAttribute(ctor.getMetadata().getPureTag(), "");
|
|
184
|
-
if (ctor.getMetadata().supportsF6FastNavigation()) {
|
|
191
|
+
if (ctor.getMetadata().supportsF6FastNavigation() && !this.hasAttribute("data-sap-ui-fastnavgroup")) {
|
|
185
192
|
this.setAttribute("data-sap-ui-fastnavgroup", "true");
|
|
186
193
|
}
|
|
187
194
|
const slotsAreManaged = ctor.getMetadata().slotsAreManaged();
|
|
@@ -863,6 +870,9 @@ class UI5Element extends HTMLElement {
|
|
|
863
870
|
get isUI5Element() {
|
|
864
871
|
return true;
|
|
865
872
|
}
|
|
873
|
+
get isUI5AbstractElement() {
|
|
874
|
+
return !this.constructor._needsShadowDOM();
|
|
875
|
+
}
|
|
866
876
|
get classes() {
|
|
867
877
|
return {};
|
|
868
878
|
}
|
|
@@ -951,8 +961,12 @@ class UI5Element extends HTMLElement {
|
|
|
951
961
|
oldValue: oldState,
|
|
952
962
|
});
|
|
953
963
|
if (this._rendered) {
|
|
954
|
-
// is already rendered
|
|
955
|
-
|
|
964
|
+
// the component is already rendered, indicating it is not the constructor -
|
|
965
|
+
// therefore the attribute can be set synchronously.
|
|
966
|
+
// get the effective value of the property,
|
|
967
|
+
// as it might differ from the provided value
|
|
968
|
+
const newValue = origGet ? origGet.call(this) : this._state[prop];
|
|
969
|
+
this._updateAttribute(prop, newValue);
|
|
956
970
|
}
|
|
957
971
|
if (ctor.getMetadata().isFormAssociated()) {
|
|
958
972
|
setFormValue(this);
|
|
@@ -1034,6 +1048,9 @@ class UI5Element extends HTMLElement {
|
|
|
1034
1048
|
}
|
|
1035
1049
|
return Promise.resolve();
|
|
1036
1050
|
}
|
|
1051
|
+
static get i18nBundles() {
|
|
1052
|
+
return this.i18nBundleStorage;
|
|
1053
|
+
}
|
|
1037
1054
|
/**
|
|
1038
1055
|
* Registers a UI5 Web Component in the browser window object
|
|
1039
1056
|
* @public
|
|
@@ -1048,21 +1065,13 @@ class UI5Element extends HTMLElement {
|
|
|
1048
1065
|
]);
|
|
1049
1066
|
const [i18nBundles] = result;
|
|
1050
1067
|
Object.entries(this.getMetadata().getI18n()).forEach((pair, index) => {
|
|
1051
|
-
const
|
|
1052
|
-
|
|
1053
|
-
targetClass[propertyName] = i18nBundles[index];
|
|
1068
|
+
const bundleName = pair[1].bundleName;
|
|
1069
|
+
this.i18nBundleStorage[bundleName] = i18nBundles[index];
|
|
1054
1070
|
});
|
|
1055
1071
|
this.asyncFinished = true;
|
|
1056
1072
|
};
|
|
1057
1073
|
this.definePromise = defineSequence();
|
|
1058
1074
|
const tag = this.getMetadata().getTag();
|
|
1059
|
-
const features = this.getMetadata().getFeatures();
|
|
1060
|
-
features.forEach(feature => {
|
|
1061
|
-
if (getComponentFeature(feature)) {
|
|
1062
|
-
this.cacheUniqueDependencies();
|
|
1063
|
-
}
|
|
1064
|
-
subscribeForFeatureLoad(feature, this, this.cacheUniqueDependencies.bind(this));
|
|
1065
|
-
});
|
|
1066
1075
|
const definedLocally = isTagRegistered(tag);
|
|
1067
1076
|
const definedGlobally = customElements.get(tag);
|
|
1068
1077
|
if (definedGlobally && !definedLocally) {
|
|
@@ -1109,6 +1118,7 @@ UI5Element.metadata = {};
|
|
|
1109
1118
|
* @protected
|
|
1110
1119
|
*/
|
|
1111
1120
|
UI5Element.styles = "";
|
|
1121
|
+
UI5Element.i18nBundleStorage = {};
|
|
1112
1122
|
/**
|
|
1113
1123
|
* Always use duck-typing to cover all runtimes on the page.
|
|
1114
1124
|
*/
|