@ui5/webcomponents-base 0.0.0-4e00e5559 → 0.0.0-4e88b8243
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/.npsrc.json +3 -0
- package/CHANGELOG.md +2286 -0
- package/README.md +50 -10
- package/cypress/specs/Accessor.cy.ts +79 -0
- package/cypress/specs/Boot.cy.ts +19 -0
- package/cypress/specs/ConfigurationChange.cy.ts +41 -0
- package/cypress/specs/ConfigurationScript.cy.ts +116 -0
- package/cypress/specs/ConfigurationURL.cy.ts +182 -0
- package/cypress/specs/CustomMount.cy.ts +34 -0
- package/cypress/specs/CustomTheme.cy.ts +36 -0
- package/cypress/specs/EventProvider.cy.ts +59 -0
- package/cypress/specs/SystemDOMElements.cy.ts +8 -0
- package/cypress/specs/Theming.cy.ts +74 -0
- package/cypress/specs/UI5ElementInvalidation.cy.ts +207 -0
- package/cypress/specs/UI5ElementLifecycle.cy.ts +82 -0
- package/cypress/specs/UI5ElementListenForChildPropChanges.cy.ts +62 -0
- package/cypress/specs/UI5ElementMetadataExt.cy.ts +42 -0
- package/cypress/specs/UI5ElementPropertyValidation.cy.ts +16 -0
- package/cypress/specs/UI5ElementPropsAndAttrs.cy.ts +113 -0
- package/cypress/specs/UI5ElementShadowDOM.cy.ts +30 -0
- package/cypress/specs/UI5ElementSlots.cy.ts +116 -0
- package/cypress/specs/WithComplexTemplate.cy.ts +32 -0
- package/cypress/tsconfig.json +20 -0
- package/cypress.config.js +3 -0
- package/dist/.tsbuildinfobuild +1 -0
- package/dist/AssetRegistry.d.ts +5 -0
- package/dist/AssetRegistry.js +6 -9
- package/dist/AssetRegistry.js.map +1 -0
- package/dist/Boot.d.ts +10 -0
- package/dist/Boot.js +75 -0
- package/dist/Boot.js.map +1 -0
- package/dist/CustomElementsRegistry.d.ts +5 -0
- package/dist/CustomElementsRegistry.js +78 -0
- package/dist/CustomElementsRegistry.js.map +1 -0
- package/dist/CustomElementsScope.d.ts +7 -0
- package/dist/CustomElementsScope.js +11 -0
- package/dist/CustomElementsScope.js.map +1 -0
- package/dist/CustomElementsScopeUtils.d.ts +62 -0
- package/dist/CustomElementsScopeUtils.js +102 -0
- package/dist/CustomElementsScopeUtils.js.map +1 -0
- package/dist/DOMObserver.d.ts +11 -0
- package/dist/DOMObserver.js +23 -0
- package/dist/DOMObserver.js.map +1 -0
- package/dist/Device.d.ts +27 -0
- package/dist/Device.js +163 -815
- package/dist/Device.js.map +1 -0
- package/dist/EventProvider.d.ts +25 -0
- package/dist/EventProvider.js +67 -70
- package/dist/EventProvider.js.map +1 -0
- package/dist/FeaturesRegistry.d.ts +18 -0
- package/dist/FeaturesRegistry.js +41 -7
- package/dist/FeaturesRegistry.js.map +1 -0
- package/dist/FontFace.d.ts +2 -0
- package/dist/FontFace.js +26 -69
- package/dist/FontFace.js.map +1 -0
- 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 +34 -0
- package/dist/InitialConfiguration.js +152 -104
- package/dist/InitialConfiguration.js.map +1 -0
- package/dist/Keys.d.ts +64 -0
- package/dist/Keys.js +182 -157
- package/dist/Keys.js.map +1 -0
- package/dist/Location.d.ts +11 -0
- package/dist/Location.js +49 -0
- package/dist/Location.js.map +1 -0
- package/dist/ManagedStyles.d.ts +7 -0
- package/dist/ManagedStyles.js +69 -0
- package/dist/ManagedStyles.js.map +1 -0
- package/dist/MediaRange.d.ts +31 -0
- package/dist/MediaRange.js +88 -0
- package/dist/MediaRange.js.map +1 -0
- package/dist/PropertiesFileFormat.d.ts +8 -0
- package/dist/PropertiesFileFormat.js +85 -0
- package/dist/PropertiesFileFormat.js.map +1 -0
- package/dist/Render.d.ts +47 -0
- package/dist/Render.js +143 -0
- package/dist/Render.js.map +1 -0
- package/dist/RenderQueue.d.ts +19 -0
- package/dist/RenderQueue.js +53 -39
- package/dist/RenderQueue.js.map +1 -0
- package/dist/Runtimes.d.ts +27 -0
- package/dist/Runtimes.js +97 -0
- package/dist/Runtimes.js.map +1 -0
- package/dist/SystemCSSVars.d.ts +2 -0
- package/dist/SystemCSSVars.js +9 -0
- package/dist/SystemCSSVars.js.map +1 -0
- package/dist/Theming.d.ts +3 -0
- package/dist/Theming.js +3 -2
- package/dist/Theming.js.map +1 -0
- package/dist/UI5Element.d.ts +414 -0
- package/dist/UI5Element.js +1105 -883
- package/dist/UI5Element.js.map +1 -0
- package/dist/UI5ElementMetadata.d.ts +164 -0
- package/dist/UI5ElementMetadata.js +244 -164
- package/dist/UI5ElementMetadata.js.map +1 -0
- package/dist/animations/AnimationQueue.d.ts +8 -0
- package/dist/animations/AnimationQueue.js +31 -38
- package/dist/animations/AnimationQueue.js.map +1 -0
- package/dist/animations/animate.d.ts +14 -0
- package/dist/animations/animate.js +46 -51
- package/dist/animations/animate.js.map +1 -0
- package/dist/animations/scroll.d.ts +5 -0
- package/dist/animations/scroll.js +18 -27
- package/dist/animations/scroll.js.map +1 -0
- package/dist/animations/slideDown.d.ts +5 -0
- package/dist/animations/slideDown.js +53 -78
- package/dist/animations/slideDown.js.map +1 -0
- package/dist/animations/slideUp.d.ts +5 -0
- package/dist/animations/slideUp.js +49 -70
- package/dist/animations/slideUp.js.map +1 -0
- package/dist/asset-registries/Icons.d.ts +39 -0
- package/dist/asset-registries/Icons.js +136 -24
- package/dist/asset-registries/Icons.js.map +1 -0
- package/dist/asset-registries/Illustrations.d.ts +19 -0
- package/dist/asset-registries/Illustrations.js +77 -0
- package/dist/asset-registries/Illustrations.js.map +1 -0
- package/dist/asset-registries/LocaleData.d.ts +7 -0
- package/dist/asset-registries/LocaleData.js +125 -114
- package/dist/asset-registries/LocaleData.js.map +1 -0
- package/dist/asset-registries/Themes.d.ts +9 -0
- package/dist/asset-registries/Themes.js +57 -77
- package/dist/asset-registries/Themes.js.map +1 -0
- package/dist/asset-registries/i18n.d.ts +23 -0
- package/dist/asset-registries/i18n.js +83 -60
- package/dist/asset-registries/i18n.js.map +1 -0
- 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 +14 -0
- package/dist/config/AnimationMode.js +28 -10
- package/dist/config/AnimationMode.js.map +1 -0
- package/dist/config/CalendarType.d.ts +15 -0
- package/dist/config/CalendarType.js +36 -14
- package/dist/config/CalendarType.js.map +1 -0
- package/dist/config/ConfigurationReset.d.ts +4 -0
- package/dist/config/ConfigurationReset.js +11 -0
- package/dist/config/ConfigurationReset.js.map +1 -0
- package/dist/config/Fonts.d.ts +16 -0
- package/dist/config/Fonts.js +30 -0
- package/dist/config/Fonts.js.map +1 -0
- package/dist/config/FormatSettings.d.ts +15 -0
- package/dist/config/FormatSettings.js +19 -9
- package/dist/config/FormatSettings.js.map +1 -0
- package/dist/config/Icons.d.ts +40 -0
- package/dist/config/Icons.js +44 -0
- package/dist/config/Icons.js.map +1 -0
- package/dist/config/Language.d.ts +40 -0
- package/dist/config/Language.js +74 -10
- package/dist/config/Language.js.map +1 -0
- package/dist/config/NoConflict.d.ts +20 -0
- package/dist/config/NoConflict.js +45 -41
- package/dist/config/NoConflict.js.map +1 -0
- package/dist/config/Theme.d.ts +39 -0
- package/dist/config/Theme.js +75 -22
- package/dist/config/Theme.js.map +1 -0
- package/dist/config/ThemeRoot.d.ts +27 -0
- package/dist/config/ThemeRoot.js +61 -0
- package/dist/config/ThemeRoot.js.map +1 -0
- package/dist/config/Timezone.d.ts +17 -0
- package/dist/config/Timezone.js +34 -0
- package/dist/config/Timezone.js.map +1 -0
- package/dist/config/Tooltips.d.ts +19 -0
- package/dist/config/Tooltips.js +29 -0
- package/dist/config/Tooltips.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/converters/DOMReference.d.ts +5 -0
- package/dist/converters/DOMReference.js +13 -0
- package/dist/converters/DOMReference.js.map +1 -0
- package/dist/css/BusyIndicator.css +80 -0
- package/dist/css/FontFace.css +96 -0
- package/dist/css/OverrideFontFace.css +32 -0
- package/dist/css/SystemCSSVars.css +9 -0
- package/dist/decorators/bound.d.ts +1 -0
- package/dist/decorators/bound.js +34 -0
- package/dist/decorators/bound.js.map +1 -0
- package/dist/decorators/customElement.d.ts +62 -0
- package/dist/decorators/customElement.js +48 -0
- package/dist/decorators/customElement.js.map +1 -0
- package/dist/decorators/event-strict.d.ts +15 -0
- package/dist/decorators/event-strict.js +26 -0
- package/dist/decorators/event-strict.js.map +1 -0
- package/dist/decorators/event.d.ts +16 -0
- package/dist/decorators/event.js +27 -0
- package/dist/decorators/event.js.map +1 -0
- package/dist/decorators/i18n.d.ts +17 -0
- package/dist/decorators/i18n.js +26 -0
- package/dist/decorators/i18n.js.map +1 -0
- package/dist/decorators/property.d.ts +9 -0
- package/dist/decorators/property.js +24 -0
- package/dist/decorators/property.js.map +1 -0
- package/dist/decorators/query.d.ts +25 -0
- package/dist/decorators/query.js +32 -0
- package/dist/decorators/query.js.map +1 -0
- package/dist/decorators/queryAll.d.ts +27 -0
- package/dist/decorators/queryAll.js +34 -0
- package/dist/decorators/queryAll.js.map +1 -0
- package/dist/decorators/slot.d.ts +9 -0
- package/dist/decorators/slot.js +37 -0
- package/dist/decorators/slot.js.map +1 -0
- package/dist/decorators.d.ts +8 -0
- package/dist/decorators.js +9 -0
- package/dist/decorators.js.map +1 -0
- package/dist/delegate/ItemNavigation.d.ts +114 -0
- package/dist/delegate/ItemNavigation.js +311 -274
- package/dist/delegate/ItemNavigation.js.map +1 -0
- package/dist/delegate/ResizeHandler.d.ts +23 -0
- package/dist/delegate/ResizeHandler.js +82 -63
- package/dist/delegate/ResizeHandler.js.map +1 -0
- package/dist/delegate/ScrollEnablement.d.ts +49 -0
- package/dist/delegate/ScrollEnablement.js +159 -120
- package/dist/delegate/ScrollEnablement.js.map +1 -0
- package/dist/features/F6Navigation.d.ts +19 -0
- package/dist/features/F6Navigation.js +170 -0
- package/dist/features/F6Navigation.js.map +1 -0
- package/dist/features/InputElementsFormSupport.d.ts +15 -0
- package/dist/features/InputElementsFormSupport.js +39 -0
- package/dist/features/InputElementsFormSupport.js.map +1 -0
- 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.d.ts +9 -0
- package/dist/features/OpenUI5Element.js +5 -0
- package/dist/features/OpenUI5Element.js.map +1 -0
- package/dist/features/OpenUI5Enablement.d.ts +11 -0
- package/dist/features/OpenUI5Enablement.js +96 -0
- package/dist/features/OpenUI5Enablement.js.map +1 -0
- package/dist/features/OpenUI5Support.d.ts +34 -0
- package/dist/features/OpenUI5Support.js +140 -87
- package/dist/features/OpenUI5Support.js.map +1 -0
- package/dist/features/patchPatcher.d.ts +11 -0
- package/dist/features/patchPatcher.js +11 -0
- package/dist/features/patchPatcher.js.map +1 -0
- package/dist/features/patchPopup.d.ts +15 -0
- package/dist/features/patchPopup.js +61 -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 +11 -0
- package/dist/generated/VersionInfo.js.map +1 -0
- package/dist/generated/css/BusyIndicator.css.d.ts +2 -0
- package/dist/generated/css/BusyIndicator.css.js +2 -0
- package/dist/generated/css/BusyIndicator.css.js.map +1 -0
- package/dist/generated/css/FontFace.css.d.ts +2 -0
- package/dist/generated/css/FontFace.css.js +2 -0
- package/dist/generated/css/FontFace.css.js.map +1 -0
- package/dist/generated/css/OverrideFontFace.css.d.ts +2 -0
- package/dist/generated/css/OverrideFontFace.css.js +2 -0
- package/dist/generated/css/OverrideFontFace.css.js.map +1 -0
- package/dist/generated/css/SystemCSSVars.css.d.ts +2 -0
- package/dist/generated/css/SystemCSSVars.css.js +2 -0
- package/dist/generated/css/SystemCSSVars.css.js.map +1 -0
- package/dist/getSharedResource.d.ts +11 -0
- package/dist/getSharedResource.js +40 -0
- package/dist/getSharedResource.js.map +1 -0
- package/dist/global.d.ts +40 -0
- package/dist/i18nBundle.d.ts +41 -0
- package/dist/i18nBundle.js +71 -28
- package/dist/i18nBundle.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/jsx-dev-runtime.d.ts +4 -0
- package/dist/jsx-dev-runtime.js +43 -0
- package/dist/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx-runtime.d.ts +50 -0
- package/dist/jsx-runtime.js +27 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/jsx-utils.d.ts +3 -0
- package/dist/jsx-utils.js +39 -0
- package/dist/jsx-utils.js.map +1 -0
- package/dist/locale/Locale.d.ts +22 -0
- package/dist/locale/Locale.js +75 -87
- package/dist/locale/Locale.js.map +1 -0
- package/dist/locale/RTLAwareRegistry.d.ts +4 -0
- package/dist/locale/RTLAwareRegistry.js +9 -0
- package/dist/locale/RTLAwareRegistry.js.map +1 -0
- package/dist/locale/applyDirection.d.ts +11 -0
- package/dist/locale/applyDirection.js +18 -0
- package/dist/locale/applyDirection.js.map +1 -0
- package/dist/locale/directionChange.d.ts +15 -0
- package/dist/locale/directionChange.js +24 -0
- package/dist/locale/directionChange.js.map +1 -0
- package/dist/locale/getEffectiveDir.d.ts +2 -0
- package/dist/locale/getEffectiveDir.js +8 -0
- package/dist/locale/getEffectiveDir.js.map +1 -0
- package/dist/locale/getLocale.d.ts +7 -0
- package/dist/locale/getLocale.js +28 -21
- package/dist/locale/getLocale.js.map +1 -0
- package/dist/locale/languageChange.d.ts +5 -0
- package/dist/locale/languageChange.js +14 -0
- package/dist/locale/languageChange.js.map +1 -0
- package/dist/locale/nextFallbackLocale.d.ts +8 -0
- package/dist/locale/nextFallbackLocale.js +15 -19
- package/dist/locale/nextFallbackLocale.js.map +1 -0
- package/dist/locale/normalizeLocale.d.ts +7 -0
- package/dist/locale/normalizeLocale.js +34 -41
- package/dist/locale/normalizeLocale.js.map +1 -0
- package/dist/renderer/JsxRenderer.d.ts +3 -0
- package/dist/renderer/JsxRenderer.js +16 -0
- package/dist/renderer/JsxRenderer.js.map +1 -0
- package/dist/renderer/LitRenderer.d.ts +14 -0
- package/dist/renderer/LitRenderer.js +33 -12
- package/dist/renderer/LitRenderer.js.map +1 -0
- package/dist/renderer/directives/style-map.d.ts +13 -0
- package/dist/renderer/directives/style-map.js +72 -0
- package/dist/renderer/directives/style-map.js.map +1 -0
- package/dist/renderer/executeTemplate.d.ts +12 -0
- package/dist/renderer/executeTemplate.js +12 -0
- package/dist/renderer/executeTemplate.js.map +1 -0
- package/dist/sap/base/Log.js +750 -0
- package/dist/sap/base/assert.js +34 -0
- package/dist/sap/base/config/MemoryConfigurationProvider.js +20 -0
- package/dist/sap/base/security/URLListValidator.js +406 -0
- package/dist/sap/base/security/encodeCSS.js +40 -0
- package/dist/sap/base/security/encodeXML.js +53 -0
- package/dist/sap/base/security/sanitizeHTML.js +38 -0
- package/dist/sap/base/strings/toHex.js +33 -0
- package/dist/sap/base/util/now.js +28 -0
- package/dist/sap/base/util/uid.js +27 -0
- package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +3600 -0
- 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 +1 -0
- package/dist/ssr-dom.js +3 -0
- package/dist/ssr-dom.js.map +1 -0
- package/dist/theming/CustomStyle.d.ts +6 -0
- package/dist/theming/CustomStyle.js +46 -17
- package/dist/theming/CustomStyle.js.map +1 -0
- package/dist/theming/ThemeLoaded.d.ts +5 -0
- package/dist/theming/ThemeLoaded.js +14 -0
- package/dist/theming/ThemeLoaded.js.map +1 -0
- 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.d.ts +2 -0
- package/dist/theming/applyTheme.js +64 -69
- package/dist/theming/applyTheme.js.map +1 -0
- package/dist/theming/getConstructableStyle.d.ts +9 -0
- package/dist/theming/getConstructableStyle.js +15 -15
- package/dist/theming/getConstructableStyle.js.map +1 -0
- package/dist/theming/getEffectiveStyle.d.ts +3 -0
- package/dist/theming/getEffectiveStyle.js +23 -13
- package/dist/theming/getEffectiveStyle.js.map +1 -0
- package/dist/theming/getStylesString.d.ts +3 -0
- package/dist/theming/getStylesString.js +9 -0
- package/dist/theming/getStylesString.js.map +1 -0
- package/dist/theming/getThemeDesignerTheme.d.ts +7 -0
- package/dist/theming/getThemeDesignerTheme.js +74 -60
- package/dist/theming/getThemeDesignerTheme.js.map +1 -0
- package/dist/thirdparty/_merge.d.ts +2 -0
- package/dist/thirdparty/_merge.js +7 -4
- package/dist/thirdparty/_merge.js.map +1 -0
- package/dist/thirdparty/isPlainObject.d.ts +2 -0
- package/dist/thirdparty/isPlainObject.js +11 -10
- package/dist/thirdparty/isPlainObject.js.map +1 -0
- package/dist/thirdparty/merge.d.ts +2 -0
- package/dist/thirdparty/merge.js +4 -8
- package/dist/thirdparty/merge.js.map +1 -0
- package/dist/thirdparty/preact/jsx.d.ts +2616 -0
- package/dist/thirdparty/preact/jsxRuntime.module.d.ts +62 -0
- package/dist/thirdparty/preact/jsxRuntime.module.js +2 -0
- package/dist/thirdparty/preact/preact.module.d.ts +398 -0
- package/dist/thirdparty/preact/preact.module.js +2 -0
- package/dist/types/AnimationMode.d.ts +24 -0
- package/dist/types/AnimationMode.js +25 -6
- package/dist/types/AnimationMode.js.map +1 -0
- package/dist/types/CalendarType.d.ts +28 -0
- package/dist/types/CalendarType.js +26 -18
- package/dist/types/CalendarType.js.map +1 -0
- package/dist/types/InvisibleMessageMode.d.ts +20 -0
- package/dist/types/InvisibleMessageMode.js +20 -0
- package/dist/types/InvisibleMessageMode.js.map +1 -0
- package/dist/types/ItemNavigationBehavior.d.ts +18 -0
- package/dist/types/ItemNavigationBehavior.js +16 -17
- package/dist/types/ItemNavigationBehavior.js.map +1 -0
- 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 +24 -0
- package/dist/types/NavigationMode.js +25 -5
- package/dist/types/NavigationMode.js.map +1 -0
- 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 +28 -0
- package/dist/types/ValueState.js +27 -19
- package/dist/types/ValueState.js.map +1 -0
- package/dist/types.d.ts +41 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/updateShadowRoot.d.ts +7 -0
- package/dist/updateShadowRoot.js +17 -0
- package/dist/updateShadowRoot.js.map +1 -0
- package/dist/util/AccessibilityTextsHelper.d.ts +17 -0
- package/dist/util/AccessibilityTextsHelper.js +199 -0
- package/dist/util/AccessibilityTextsHelper.js.map +1 -0
- package/dist/util/Caret.d.ts +7 -0
- package/dist/util/Caret.js +23 -0
- package/dist/util/Caret.js.map +1 -0
- package/dist/util/ColorConversion.d.ts +31 -0
- package/dist/util/ColorConversion.js +352 -0
- package/dist/util/ColorConversion.js.map +1 -0
- package/dist/util/FetchHelper.d.ts +3 -0
- package/dist/util/FetchHelper.js +19 -25
- package/dist/util/FetchHelper.js.map +1 -0
- package/dist/util/FocusableElements.d.ts +4 -0
- package/dist/util/FocusableElements.js +70 -56
- package/dist/util/FocusableElements.js.map +1 -0
- package/dist/util/HTMLSanitizer.d.ts +3 -0
- package/dist/util/HTMLSanitizer.js +6 -0
- package/dist/util/HTMLSanitizer.js.map +1 -0
- package/dist/util/InvisibleMessage.d.ts +10 -0
- package/dist/util/InvisibleMessage.js +56 -0
- package/dist/util/InvisibleMessage.js.map +1 -0
- package/dist/util/PopupUtils.d.ts +5 -0
- package/dist/util/PopupUtils.js +60 -0
- package/dist/util/PopupUtils.js.map +1 -0
- package/dist/util/SelectionAssistant.d.ts +12 -0
- package/dist/util/SelectionAssistant.js +79 -0
- package/dist/util/SelectionAssistant.js.map +1 -0
- package/dist/util/SlotsHelper.d.ts +9 -0
- package/dist/util/SlotsHelper.js +30 -0
- package/dist/util/SlotsHelper.js.map +1 -0
- package/dist/util/StringHelper.d.ts +5 -0
- package/dist/util/StringHelper.js +32 -21
- package/dist/util/StringHelper.js.map +1 -0
- package/dist/util/TabbableElements.d.ts +17 -0
- package/dist/util/TabbableElements.js +46 -39
- package/dist/util/TabbableElements.js.map +1 -0
- package/dist/util/arraysAreEqual.d.ts +2 -0
- package/dist/util/arraysAreEqual.js +13 -0
- package/dist/util/arraysAreEqual.js.map +1 -0
- package/dist/util/clamp.d.ts +9 -0
- package/dist/util/clamp.js +13 -0
- package/dist/util/clamp.js.map +1 -0
- package/dist/util/createLinkInHead.d.ts +7 -0
- package/dist/util/createLinkInHead.js +21 -0
- package/dist/util/createLinkInHead.js.map +1 -0
- package/dist/util/debounce.d.ts +2 -0
- package/dist/util/debounce.js +15 -0
- package/dist/util/debounce.js.map +1 -0
- package/dist/util/detectNavigatorLanguage.d.ts +2 -0
- package/dist/util/detectNavigatorLanguage.js +13 -11
- package/dist/util/detectNavigatorLanguage.js.map +1 -0
- package/dist/util/dragAndDrop/DragRegistry.d.ts +33 -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 +11 -0
- package/dist/util/dragAndDrop/findClosestPosition.js +102 -0
- package/dist/util/dragAndDrop/findClosestPosition.js.map +1 -0
- package/dist/util/dragAndDrop/handleDragOver.d.ts +16 -0
- package/dist/util/dragAndDrop/handleDragOver.js +42 -0
- package/dist/util/dragAndDrop/handleDragOver.js.map +1 -0
- package/dist/util/dragAndDrop/handleDrop.d.ts +5 -0
- package/dist/util/dragAndDrop/handleDrop.js +22 -0
- package/dist/util/dragAndDrop/handleDrop.js.map +1 -0
- package/dist/util/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.d.ts +8 -0
- package/dist/util/escapeRegex.js +11 -0
- package/dist/util/escapeRegex.js.map +1 -0
- package/dist/util/fixSafariActiveState.d.ts +2 -0
- package/dist/util/fixSafariActiveState.js +11 -0
- package/dist/util/fixSafariActiveState.js.map +1 -0
- package/dist/util/formatMessage.d.ts +2 -0
- package/dist/util/formatMessage.js +15 -19
- package/dist/util/formatMessage.js.map +1 -0
- package/dist/util/generateHighlightedMarkup.d.ts +9 -0
- package/dist/util/generateHighlightedMarkup.js +41 -0
- package/dist/util/generateHighlightedMarkup.js.map +1 -0
- package/dist/util/getActiveElement.d.ts +2 -0
- package/dist/util/getActiveElement.js +9 -0
- package/dist/util/getActiveElement.js.map +1 -0
- package/dist/util/getClassCopy.d.ts +438 -0
- package/dist/util/getClassCopy.js +10 -0
- package/dist/util/getClassCopy.js.map +1 -0
- package/dist/util/getDesigntimePropertyAsArray.d.ts +2 -0
- package/dist/util/getDesigntimePropertyAsArray.js +5 -3
- package/dist/util/getDesigntimePropertyAsArray.js.map +1 -0
- package/dist/util/getEffectiveContentDensity.d.ts +2 -0
- package/dist/util/getEffectiveContentDensity.js +4 -0
- package/dist/util/getEffectiveContentDensity.js.map +1 -0
- package/dist/util/getEffectiveScrollbarStyle.d.ts +2 -0
- package/dist/util/getEffectiveScrollbarStyle.js +34 -0
- package/dist/util/getEffectiveScrollbarStyle.js.map +1 -0
- package/dist/util/getFastNavigationGroups.d.ts +2 -0
- package/dist/util/getFastNavigationGroups.js +51 -0
- package/dist/util/getFastNavigationGroups.js.map +1 -0
- package/{src/util/getFileExtension.js → dist/util/getFileExtension.d.ts} +3 -12
- package/dist/util/getFileExtension.js +9 -11
- package/dist/util/getFileExtension.js.map +1 -0
- package/dist/util/getNormalizedTarget.d.ts +7 -0
- package/dist/util/getNormalizedTarget.js +14 -0
- package/dist/util/getNormalizedTarget.js.map +1 -0
- package/dist/util/getSingletonElementInstance.d.ts +11 -0
- package/dist/util/getSingletonElementInstance.js +19 -0
- package/dist/util/getSingletonElementInstance.js.map +1 -0
- package/dist/util/hash2str.d.ts +1 -0
- package/dist/util/hash2str.js +14 -0
- package/dist/util/hash2str.js.map +1 -0
- package/dist/util/isElementClickable.d.ts +2 -0
- package/dist/util/isElementClickable.js +16 -0
- package/dist/util/isElementClickable.js.map +1 -0
- package/dist/util/isElementHidden.d.ts +2 -0
- package/dist/util/isElementHidden.js +8 -0
- package/dist/util/isElementHidden.js.map +1 -0
- package/dist/util/isElementInView.d.ts +6 -0
- package/dist/util/isElementInView.js +12 -0
- package/dist/util/isElementInView.js.map +1 -0
- package/dist/util/isElementTabbable.d.ts +9 -0
- package/dist/util/isElementTabbable.js +30 -0
- package/dist/util/isElementTabbable.js.map +1 -0
- package/dist/util/isValidPropertyName.d.ts +8 -0
- package/dist/util/isValidPropertyName.js +20 -12
- package/dist/util/isValidPropertyName.js.map +1 -0
- package/dist/util/toLowercaseEnumValue.d.ts +3 -0
- package/dist/util/toLowercaseEnumValue.js +4 -0
- package/dist/util/toLowercaseEnumValue.js.map +1 -0
- package/dist/util/whenDOMReady.d.ts +2 -0
- package/dist/util/whenDOMReady.js +11 -10
- package/dist/util/whenDOMReady.js.map +1 -0
- package/dist/util/willShowContent.d.ts +2 -0
- package/dist/util/willShowContent.js +7 -0
- package/dist/util/willShowContent.js.map +1 -0
- package/dist/validateThemeRoot.d.ts +2 -0
- package/dist/validateThemeRoot.js +49 -0
- package/dist/validateThemeRoot.js.map +1 -0
- package/index.js +206 -2
- package/package-scripts.cjs +74 -0
- package/package.json +43 -13
- package/src/css/BusyIndicator.css +80 -0
- package/src/css/FontFace.css +96 -0
- package/src/css/OverrideFontFace.css +32 -0
- package/src/css/SystemCSSVars.css +9 -0
- package/src/thirdparty/preact/jsxRuntime.module.js +2 -0
- package/src/thirdparty/preact/preact.module.js +2 -0
- package/src/thirdparty/preact/version.txt +1 -0
- package/tsconfig.json +20 -0
- package/.eslintignore +0 -11
- package/bundle.es5.js +0 -28
- package/bundle.esm.js +0 -49
- package/config/.eslintrc.js +0 -3
- package/config/rollup.config.js +0 -1
- package/config/wdio.conf.js +0 -1
- package/dist/RenderScheduler.js +0 -165
- package/dist/SVGIconRegistry.js +0 -60
- package/dist/StaticArea.js +0 -41
- package/dist/StaticAreaItem.js +0 -105
- package/dist/animations/config.js +0 -5
- package/dist/boot.js +0 -32
- package/dist/compatibility/DOMObserver.js +0 -62
- package/dist/compatibility/patchNodeValue.js +0 -24
- package/dist/compatibility/whenPolyfillLoaded.js +0 -26
- package/dist/config/RTL.js +0 -31
- package/dist/delegate/CustomResize.js +0 -78
- package/dist/delegate/NativeResize.js +0 -44
- package/dist/features/browsersupport/Edge.js +0 -6
- package/dist/features/browsersupport/IE11.js +0 -41
- package/dist/features/browsersupport/IE11WithWebComponentsPolyfill.js +0 -5
- package/dist/renderer/ifDefined.js +0 -21
- package/dist/resources/bundle.es5.js +0 -212
- package/dist/resources/bundle.es5.js.map +0 -1
- package/dist/resources/bundle.esm.js +0 -129
- package/dist/resources/bundle.esm.js.map +0 -1
- package/dist/test-resources/assets/Themes.js +0 -13
- package/dist/test-resources/elements/Child.js +0 -35
- package/dist/test-resources/elements/Generic.js +0 -84
- package/dist/test-resources/elements/GenericExt.js +0 -26
- package/dist/test-resources/elements/NoShadowDOM.js +0 -13
- package/dist/test-resources/elements/Parent.js +0 -37
- package/dist/test-resources/elements/WithStaticArea.js +0 -76
- package/dist/test-resources/pages/AllTestElements.html +0 -42
- package/dist/test-resources/pages/Configuration.html +0 -20
- package/dist/test-resources/pages/ConfigurationScript.html +0 -36
- package/dist/test-resources/specs/ConfigurationChange.spec.js +0 -25
- package/dist/test-resources/specs/ConfigurationScript.spec.js +0 -61
- package/dist/test-resources/specs/ConfigurationURL.spec.js +0 -45
- package/dist/test-resources/specs/CustomTheme.spec.js +0 -25
- package/dist/test-resources/specs/StaticArea.spec.js +0 -34
- package/dist/test-resources/specs/Theming.spec.js +0 -31
- package/dist/test-resources/specs/UI5ElementInvalidation.js +0 -258
- package/dist/test-resources/specs/UI5ElementLifecycle.js +0 -93
- package/dist/test-resources/specs/UI5ElementListenForChildPropChanges.spec.js +0 -101
- package/dist/test-resources/specs/UI5ElementMetadataExt.js +0 -40
- package/dist/test-resources/specs/UI5ElementPropertyValidation.js +0 -12
- package/dist/test-resources/specs/UI5ElementPropsAndAttrs.spec.js +0 -65
- package/dist/test-resources/specs/UI5ElementShadowDOM.js +0 -22
- package/dist/test-resources/specs/UI5ElementSlots.js +0 -34
- package/dist/theming/CSSVarsPonyfill.js +0 -24
- package/dist/theming/adaptCSSForIE.js +0 -90
- package/dist/theming/createComponentStyleTag.js +0 -49
- package/dist/theming/createThemePropertiesStyleTag.js +0 -20
- package/dist/thirdparty/Array.from.js +0 -16
- package/dist/thirdparty/Array.prototype.fill.js +0 -44
- package/dist/thirdparty/Array.prototype.find.js +0 -46
- package/dist/thirdparty/Array.prototype.includes.js +0 -51
- package/dist/thirdparty/Element.prototype.closest.js +0 -11
- package/dist/thirdparty/Element.prototype.matches.js +0 -6
- package/dist/thirdparty/Map.prototype.keys.js +0 -9
- package/dist/thirdparty/Number.isInteger.js +0 -5
- package/dist/thirdparty/Number.isNaN.js +0 -1
- package/dist/thirdparty/Number.parseInt.js +0 -1
- package/dist/thirdparty/Object.assign.js +0 -31
- package/dist/thirdparty/Object.entries.js +0 -11
- package/dist/thirdparty/Symbol.js +0 -2
- package/dist/thirdparty/WeakSet.js +0 -27
- package/dist/thirdparty/es6-string-methods.js +0 -182
- package/dist/thirdparty/events-polyfills.js +0 -89
- package/dist/thirdparty/fetch.js +0 -1
- package/dist/thirdparty/template.js +0 -600
- package/dist/thirdparty/webcomponents-sd-ce-pf.js +0 -318
- package/dist/types/CSSSize.js +0 -9
- package/dist/types/DataType.js +0 -25
- package/dist/types/Integer.js +0 -9
- package/dist/types/PopupState.js +0 -37
- package/dist/util/createStyleInHead.js +0 -18
- package/dist/util/findNodeOwner.js +0 -35
- package/dist/util/isDescendantOf.js +0 -15
- package/dist/util/isNodeClickable.js +0 -19
- package/dist/util/isNodeHidden.js +0 -13
- package/dist/util/isNodeTabbable.js +0 -28
- package/dist/webcomponentsjs/LICENSE.md +0 -19
- package/dist/webcomponentsjs/README.md +0 -229
- package/dist/webcomponentsjs/bundles/webcomponents-ce.js +0 -63
- package/dist/webcomponentsjs/bundles/webcomponents-ce.js.map +0 -1
- package/dist/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js +0 -297
- package/dist/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js.map +0 -1
- package/dist/webcomponentsjs/bundles/webcomponents-sd-ce.js +0 -208
- package/dist/webcomponentsjs/bundles/webcomponents-sd-ce.js.map +0 -1
- package/dist/webcomponentsjs/bundles/webcomponents-sd.js +0 -166
- package/dist/webcomponentsjs/bundles/webcomponents-sd.js.map +0 -1
- package/dist/webcomponentsjs/custom-elements-es5-adapter.js +0 -15
- package/dist/webcomponentsjs/package.json +0 -46
- package/dist/webcomponentsjs/src/entrypoints/custom-elements-es5-adapter-index.js +0 -16
- package/dist/webcomponentsjs/src/entrypoints/webcomponents-bundle-index.js +0 -53
- package/dist/webcomponentsjs/src/entrypoints/webcomponents-ce-index.js +0 -17
- package/dist/webcomponentsjs/src/entrypoints/webcomponents-sd-ce-index.js +0 -19
- package/dist/webcomponentsjs/src/entrypoints/webcomponents-sd-ce-pf-index.js +0 -28
- package/dist/webcomponentsjs/src/entrypoints/webcomponents-sd-index.js +0 -18
- package/dist/webcomponentsjs/webcomponents-bundle.js +0 -298
- package/dist/webcomponentsjs/webcomponents-bundle.js.map +0 -1
- package/dist/webcomponentsjs/webcomponents-loader.js +0 -185
- package/lib/generate-asset-parameters/index.js +0 -22
- package/package-scripts.js +0 -47
- package/src/AssetRegistry.js +0 -9
- package/src/Device.js +0 -823
- package/src/EventProvider.js +0 -73
- package/src/FeaturesRegistry.js +0 -11
- package/src/FontFace.js +0 -73
- package/src/InitialConfiguration.js +0 -131
- package/src/Keys.js +0 -161
- package/src/RenderQueue.js +0 -42
- package/src/RenderScheduler.js +0 -165
- package/src/SVGIconRegistry.js +0 -60
- package/src/StaticArea.js +0 -41
- package/src/StaticAreaItem.js +0 -105
- package/src/Theming.js +0 -3
- package/src/UI5Element.js +0 -898
- package/src/UI5ElementMetadata.js +0 -173
- package/src/animations/AnimationQueue.js +0 -42
- package/src/animations/animate.js +0 -53
- package/src/animations/config.js +0 -5
- package/src/animations/scroll.js +0 -28
- package/src/animations/slideDown.js +0 -79
- package/src/animations/slideUp.js +0 -71
- package/src/asset-registries/Icons.js +0 -24
- package/src/asset-registries/LocaleData.js +0 -125
- package/src/asset-registries/Themes.js +0 -87
- package/src/asset-registries/i18n.js +0 -79
- package/src/boot.js +0 -32
- package/src/compatibility/DOMObserver.js +0 -62
- package/src/compatibility/patchNodeValue.js +0 -24
- package/src/compatibility/whenPolyfillLoaded.js +0 -26
- package/src/config/AnimationMode.js +0 -13
- package/src/config/CalendarType.js +0 -18
- package/src/config/FormatSettings.js +0 -13
- package/src/config/Language.js +0 -12
- package/src/config/NoConflict.js +0 -51
- package/src/config/RTL.js +0 -31
- package/src/config/Theme.js +0 -28
- package/src/delegate/CustomResize.js +0 -78
- package/src/delegate/ItemNavigation.js +0 -278
- package/src/delegate/NativeResize.js +0 -44
- package/src/delegate/ResizeHandler.js +0 -66
- package/src/delegate/ScrollEnablement.js +0 -126
- package/src/features/OpenUI5Support.js +0 -90
- package/src/features/browsersupport/Edge.js +0 -6
- package/src/features/browsersupport/IE11.js +0 -41
- package/src/features/browsersupport/IE11WithWebComponentsPolyfill.js +0 -5
- package/src/i18nBundle.js +0 -33
- package/src/locale/Locale.js +0 -91
- package/src/locale/getLocale.js +0 -31
- package/src/locale/nextFallbackLocale.js +0 -28
- package/src/locale/normalizeLocale.js +0 -54
- package/src/renderer/LitRenderer.js +0 -15
- package/src/renderer/ifDefined.js +0 -21
- package/src/theming/CSSVarsPonyfill.js +0 -24
- package/src/theming/CustomStyle.js +0 -19
- package/src/theming/adaptCSSForIE.js +0 -90
- package/src/theming/applyTheme.js +0 -81
- package/src/theming/createComponentStyleTag.js +0 -49
- package/src/theming/createThemePropertiesStyleTag.js +0 -20
- package/src/theming/getConstructableStyle.js +0 -25
- package/src/theming/getEffectiveStyle.js +0 -15
- package/src/theming/getThemeDesignerTheme.js +0 -67
- package/src/thirdparty/Array.from.js +0 -16
- package/src/thirdparty/Array.prototype.fill.js +0 -44
- package/src/thirdparty/Array.prototype.find.js +0 -46
- package/src/thirdparty/Array.prototype.includes.js +0 -51
- package/src/thirdparty/Element.prototype.closest.js +0 -11
- package/src/thirdparty/Element.prototype.matches.js +0 -6
- package/src/thirdparty/Map.prototype.keys.js +0 -9
- package/src/thirdparty/Number.isInteger.js +0 -5
- package/src/thirdparty/Number.isNaN.js +0 -1
- package/src/thirdparty/Number.parseInt.js +0 -1
- package/src/thirdparty/Object.assign.js +0 -31
- package/src/thirdparty/Object.entries.js +0 -11
- package/src/thirdparty/Symbol.js +0 -2
- package/src/thirdparty/WeakSet.js +0 -27
- package/src/thirdparty/_merge.js +0 -32
- package/src/thirdparty/es6-string-methods.js +0 -182
- package/src/thirdparty/events-polyfills.js +0 -89
- package/src/thirdparty/fetch.js +0 -1
- package/src/thirdparty/isPlainObject.js +0 -18
- package/src/thirdparty/merge.js +0 -10
- package/src/thirdparty/template.js +0 -600
- package/src/thirdparty/webcomponents-sd-ce-pf.js +0 -318
- package/src/types/AnimationMode.js +0 -7
- package/src/types/CSSSize.js +0 -9
- package/src/types/CalendarType.js +0 -22
- package/src/types/DataType.js +0 -25
- package/src/types/Integer.js +0 -9
- package/src/types/ItemNavigationBehavior.js +0 -21
- package/src/types/NavigationMode.js +0 -6
- package/src/types/PopupState.js +0 -37
- package/src/types/ValueState.js +0 -22
- package/src/util/FetchHelper.js +0 -31
- package/src/util/FocusableElements.js +0 -60
- package/src/util/StringHelper.js +0 -26
- package/src/util/TabbableElements.js +0 -43
- package/src/util/createStyleInHead.js +0 -18
- package/src/util/detectNavigatorLanguage.js +0 -13
- package/src/util/findNodeOwner.js +0 -35
- package/src/util/formatMessage.js +0 -23
- package/src/util/getDesigntimePropertyAsArray.js +0 -4
- package/src/util/isDescendantOf.js +0 -15
- package/src/util/isNodeClickable.js +0 -19
- package/src/util/isNodeHidden.js +0 -13
- package/src/util/isNodeTabbable.js +0 -28
- package/src/util/isValidPropertyName.js +0 -20
- package/src/util/whenDOMReady.js +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvisibleMessageMode.js","sourceRoot":"","sources":["../../src/types/InvisibleMessageMode.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,oBAAoB,GAAG;IAC5B;;;;OAIM;IACN,MAAM,EAAE,QAAQ;IAEhB;;;OAGM;IACN,SAAS,EAAE,WAAW;CACb,CAAC;AAIX,eAAe,oBAAoB,CAAC","sourcesContent":["/**\n * Enumeration for different mode behaviors of the InvisibleMessage.\n *\n * @public\n */\nconst InvisibleMessageMode = {\n\t/**\n * Indicates that updates to the region should be presented at the next graceful opportunity,\n * such as at the end of reading the current sentence, or when the user pauses typing.\n\t * @public\n */\n\tPolite: \"Polite\",\n\n\t/**\n * Indicates that updates to the region have the highest priority and should be presented to the user immediately.\n\t * @public\n */\n\tAssertive: \"Assertive\",\n} as const;\n\ntype InvisibleMessageMode = typeof InvisibleMessageMode[keyof typeof InvisibleMessageMode];\n\nexport default InvisibleMessageMode;\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Different behavior for ItemNavigation.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
declare enum ItemNavigationBehavior {
|
|
7
|
+
/**
|
|
8
|
+
* Static behavior: navigations stops at the first or last item.
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
Static = "Static",
|
|
12
|
+
/**
|
|
13
|
+
* Cycling behavior: navigating past the last item continues with the first and vice versa.
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
Cyclic = "Cyclic"
|
|
17
|
+
}
|
|
18
|
+
export default ItemNavigationBehavior;
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @private
|
|
3
2
|
* Different behavior for ItemNavigation.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
19
|
-
Paging: "Paging",
|
|
20
|
-
};
|
|
6
|
+
var ItemNavigationBehavior;
|
|
7
|
+
(function (ItemNavigationBehavior) {
|
|
8
|
+
/**
|
|
9
|
+
* Static behavior: navigations stops at the first or last item.
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
ItemNavigationBehavior["Static"] = "Static";
|
|
13
|
+
/**
|
|
14
|
+
* Cycling behavior: navigating past the last item continues with the first and vice versa.
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
ItemNavigationBehavior["Cyclic"] = "Cyclic";
|
|
18
|
+
})(ItemNavigationBehavior || (ItemNavigationBehavior = {}));
|
|
21
19
|
export default ItemNavigationBehavior;
|
|
20
|
+
//# sourceMappingURL=ItemNavigationBehavior.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ItemNavigationBehavior.js","sourceRoot":"","sources":["../../src/types/ItemNavigationBehavior.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,IAAK,sBAYJ;AAZD,WAAK,sBAAsB;IAC1B;;;OAGI;IACJ,2CAAiB,CAAA;IAEjB;;;OAGI;IACJ,2CAAiB,CAAA;AAClB,CAAC,EAZI,sBAAsB,KAAtB,sBAAsB,QAY1B;AAED,eAAe,sBAAsB,CAAC","sourcesContent":["/**\n * Different behavior for ItemNavigation.\n *\n * @public\n */\nenum ItemNavigationBehavior {\n\t/**\n\t * Static behavior: navigations stops at the first or last item.\n\t * @public\n \t */\n\tStatic = \"Static\",\n\n\t/**\n\t * Cycling behavior: navigating past the last item continues with the first and vice versa.\n\t * @public\n \t */\n\tCyclic = \"Cyclic\",\n}\n\nexport default ItemNavigationBehavior;\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Placements of a moved element relative to a target element.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
declare enum MovePlacement {
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
On = "On",
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
Before = "Before",
|
|
15
|
+
/**
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
After = "After"
|
|
19
|
+
}
|
|
20
|
+
export default MovePlacement;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Placements of a moved element relative to a target element.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
var MovePlacement;
|
|
7
|
+
(function (MovePlacement) {
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
MovePlacement["On"] = "On";
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
MovePlacement["Before"] = "Before";
|
|
16
|
+
/**
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
MovePlacement["After"] = "After";
|
|
20
|
+
})(MovePlacement || (MovePlacement = {}));
|
|
21
|
+
export default MovePlacement;
|
|
22
|
+
//# sourceMappingURL=MovePlacement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MovePlacement.js","sourceRoot":"","sources":["../../src/types/MovePlacement.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,IAAK,aAeJ;AAfD,WAAK,aAAa;IACjB;;OAEG;IACH,0BAAS,CAAA;IAET;;OAEG;IACH,kCAAiB,CAAA;IAEjB;;OAEG;IACH,gCAAe,CAAA;AAChB,CAAC,EAfI,aAAa,KAAb,aAAa,QAejB;AAED,eAAe,aAAa,CAAC","sourcesContent":["/**\n * Placements of a moved element relative to a target element.\n *\n * @public\n */\nenum MovePlacement {\n\t/**\n\t * @public\n\t */\n\tOn = \"On\",\n\n\t/**\n\t * @public\n\t */\n\tBefore = \"Before\",\n\n\t/**\n\t * @public\n\t */\n\tAfter = \"After\",\n}\n\nexport default MovePlacement;\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Different navigation modes for ItemNavigation.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
declare enum NavigationMode {
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
Auto = "Auto",
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
Vertical = "Vertical",
|
|
15
|
+
/**
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
Horizontal = "Horizontal",
|
|
19
|
+
/**
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
Paging = "Paging"
|
|
23
|
+
}
|
|
24
|
+
export default NavigationMode;
|
|
@@ -1,6 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Different navigation modes for ItemNavigation.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
var NavigationMode;
|
|
7
|
+
(function (NavigationMode) {
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
NavigationMode["Auto"] = "Auto";
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
NavigationMode["Vertical"] = "Vertical";
|
|
16
|
+
/**
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
NavigationMode["Horizontal"] = "Horizontal";
|
|
20
|
+
/**
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
NavigationMode["Paging"] = "Paging";
|
|
24
|
+
})(NavigationMode || (NavigationMode = {}));
|
|
6
25
|
export default NavigationMode;
|
|
26
|
+
//# sourceMappingURL=NavigationMode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavigationMode.js","sourceRoot":"","sources":["../../src/types/NavigationMode.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,IAAK,cAiBJ;AAjBD,WAAK,cAAc;IAClB;;OAEG;IACH,+BAAa,CAAA;IACb;;OAEG;IACH,uCAAqB,CAAA;IACrB;;OAEG;IACH,2CAAyB,CAAA;IACzB;;OAEG;IACH,mCAAiB,CAAA;AAClB,CAAC,EAjBI,cAAc,KAAd,cAAc,QAiBlB;AAED,eAAe,cAAc,CAAC","sourcesContent":["/**\n * Different navigation modes for ItemNavigation.\n *\n * @public\n */\nenum NavigationMode {\n\t/**\n\t * @public\n\t */\n\tAuto = \"Auto\",\n\t/**\n\t * @public\n\t */\n\tVertical = \"Vertical\",\n\t/**\n\t * @public\n\t */\n\tHorizontal = \"Horizontal\",\n\t/**\n\t * @public\n\t */\n\tPaging = \"Paging\",\n}\n\nexport default NavigationMode;\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determines the orientation of an operation.
|
|
3
|
+
*
|
|
4
|
+
* @private
|
|
5
|
+
*/
|
|
6
|
+
var Orientation;
|
|
7
|
+
(function (Orientation) {
|
|
8
|
+
/**
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
Orientation["Vertical"] = "Vertical";
|
|
12
|
+
/**
|
|
13
|
+
* @private
|
|
14
|
+
*/
|
|
15
|
+
Orientation["Horizontal"] = "Horizontal";
|
|
16
|
+
})(Orientation || (Orientation = {}));
|
|
17
|
+
export default Orientation;
|
|
18
|
+
//# sourceMappingURL=Orientation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Orientation.js","sourceRoot":"","sources":["../../src/types/Orientation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,IAAK,WAUJ;AAVD,WAAK,WAAW;IACf;;OAEG;IACH,oCAAqB,CAAA;IAErB;;OAEG;IACH,wCAAyB,CAAA;AAC1B,CAAC,EAVI,WAAW,KAAX,WAAW,QAUf;AAED,eAAe,WAAW,CAAC","sourcesContent":["/**\n * Determines the orientation of an operation.\n *\n * @private\n */\nenum Orientation {\n\t/**\n\t * @private\n\t */\n\tVertical = \"Vertical\",\n\n\t/**\n\t * @private\n\t */\n\tHorizontal = \"Horizontal\",\n}\n\nexport default Orientation;\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Different types of ValueStates.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
declare enum ValueState {
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
None = "None",
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
Positive = "Positive",
|
|
15
|
+
/**
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
Critical = "Critical",
|
|
19
|
+
/**
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
Negative = "Negative",
|
|
23
|
+
/**
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
Information = "Information"
|
|
27
|
+
}
|
|
28
|
+
export default ValueState;
|
package/dist/types/ValueState.js
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
import DataType from "./DataType.js";
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
|
-
* Different
|
|
2
|
+
* Different types of ValueStates.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
var ValueState;
|
|
7
|
+
(function (ValueState) {
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
ValueState["None"] = "None";
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
ValueState["Positive"] = "Positive";
|
|
16
|
+
/**
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
ValueState["Critical"] = "Critical";
|
|
20
|
+
/**
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
ValueState["Negative"] = "Negative";
|
|
24
|
+
/**
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
ValueState["Information"] = "Information";
|
|
28
|
+
})(ValueState || (ValueState = {}));
|
|
22
29
|
export default ValueState;
|
|
30
|
+
//# sourceMappingURL=ValueState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValueState.js","sourceRoot":"","sources":["../../src/types/ValueState.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,IAAK,UAyBJ;AAzBD,WAAK,UAAU;IACd;;OAEG;IACH,2BAAa,CAAA;IAEb;;OAEG;IACH,mCAAqB,CAAA;IAErB;;OAEG;IACH,mCAAqB,CAAA;IAErB;;OAEG;IACH,mCAAqB,CAAA;IAErB;;OAEG;IACH,yCAA2B,CAAA;AAC5B,CAAC,EAzBI,UAAU,KAAV,UAAU,QAyBd;AAED,eAAe,UAAU,CAAC","sourcesContent":["/**\n * Different types of ValueStates.\n *\n * @public\n */\nenum ValueState {\n\t/**\n\t * @public\n\t */\n\tNone = \"None\",\n\n\t/**\n\t * @public\n\t */\n\tPositive = \"Positive\",\n\n\t/**\n\t * @public\n\t */\n\tCritical = \"Critical\",\n\n\t/**\n\t * @public\n\t */\n\tNegative = \"Negative\",\n\n\t/**\n\t * @public\n\t */\n\tInformation = \"Information\",\n}\n\nexport default ValueState;\n"]}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { JSX } from "./jsx-runtime.d.ts";
|
|
2
|
+
export type LowercaseString<T> = T extends string ? Lowercase<T> : never;
|
|
3
|
+
export type PromiseResolve = (value: void | PromiseLike<void>) => void;
|
|
4
|
+
export type Timeout = ReturnType<typeof setTimeout>;
|
|
5
|
+
export type Interval = ReturnType<typeof setInterval>;
|
|
6
|
+
export type StyleData = string;
|
|
7
|
+
export type ComponentStylesData = Array<ComponentStylesData> | string;
|
|
8
|
+
export type ClassMapValue = Record<string, boolean>;
|
|
9
|
+
export type ClassMap = {
|
|
10
|
+
[x: string]: ClassMapValue | ClassMap;
|
|
11
|
+
};
|
|
12
|
+
export type PassiveEventListenerObject = EventListenerObject & {
|
|
13
|
+
passive: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type AriaRole = JSX.AriaRole;
|
|
16
|
+
export type AriaHasPopup = "dialog" | "grid" | "listbox" | "menu" | "tree";
|
|
17
|
+
export type AriaCurrent = "page" | "step" | "location" | "date" | "time" | "true" | "false" | boolean | undefined;
|
|
18
|
+
export type AriaAutoComplete = "list" | "none" | "inline" | "both" | undefined;
|
|
19
|
+
export type AriaLandmarkRole = "none" | "banner" | "main" | "region" | "navigation" | "search" | "complementary" | "form" | "contentinfo";
|
|
20
|
+
export type AccessibilityInfo = {
|
|
21
|
+
role?: AriaRole;
|
|
22
|
+
type?: LowercaseString<string>;
|
|
23
|
+
description?: string;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
readonly?: boolean;
|
|
26
|
+
required?: boolean;
|
|
27
|
+
children?: Array<HTMLElement>;
|
|
28
|
+
};
|
|
29
|
+
export type AccessibilityAttributes = {
|
|
30
|
+
ariaSetsize?: number;
|
|
31
|
+
ariaPosinset?: number;
|
|
32
|
+
ariaLabel?: string;
|
|
33
|
+
controls?: LowercaseString<string>;
|
|
34
|
+
expanded?: "true" | "false" | boolean;
|
|
35
|
+
hasPopup?: AriaHasPopup;
|
|
36
|
+
name?: string;
|
|
37
|
+
role?: AriaRole;
|
|
38
|
+
ariaKeyShortcuts?: string;
|
|
39
|
+
ariaCurrent?: AriaCurrent;
|
|
40
|
+
current?: AriaCurrent;
|
|
41
|
+
};
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { JSX } from \"./jsx-runtime.d.ts\";\n\n// General utils\nexport type LowercaseString<T> = T extends string ? Lowercase<T> : never;\n\n// Core Framework types\nexport type PromiseResolve = (value: void | PromiseLike<void>) => void;\nexport type Timeout = ReturnType<typeof setTimeout>;\nexport type Interval = ReturnType<typeof setInterval>;\n\nexport type StyleData = string;\n\nexport type ComponentStylesData = Array<ComponentStylesData> | string;\nexport type ClassMapValue = Record<string, boolean>\n\nexport type ClassMap = { [x: string] : ClassMapValue | ClassMap };\n\nexport type PassiveEventListenerObject = EventListenerObject & { passive: boolean };\n\n// Accessibility\nexport type AriaRole = JSX.AriaRole;\nexport type AriaHasPopup = \"dialog\" | \"grid\" | \"listbox\" | \"menu\" | \"tree\";\nexport type AriaCurrent = \"page\" | \"step\" | \"location\" | \"date\" | \"time\" | \"true\" | \"false\" | boolean | undefined;\nexport type AriaAutoComplete = \"list\" | \"none\" | \"inline\" | \"both\" | undefined;\nexport type AriaLandmarkRole = \"none\" | \"banner\" | \"main\" | \"region\" | \"navigation\" | \"search\" | \"complementary\" | \"form\" | \"contentinfo\"\n\nexport type AccessibilityInfo = {\n\t// The WAI-ARIA role of the component.\n\trole?: AriaRole,\n\n\t// A translated text that represents the component type. Used when several components share same role,\n\t// f.e. Select and ComboBox both have role=\"combobox\".\n\ttype?: LowercaseString<string>,\n\n\t// A translated text that represents relevant component description/state - value, placeholder, label, etc.\n\tdescription?: string,\n\n\t // The component disabled state.\n\tdisabled?: boolean,\n\n\t// The component readonly state.\n\treadonly?: boolean,\n\n\t// The component required state.\n\trequired?: boolean,\n\n\t// An array of elements, aggregated by the component\n\t// <b>Note:</b> Children should only be provided when it is helpful to understand the accessibility context.\n\tchildren?: Array<HTMLElement>,\n}\n\nexport type AccessibilityAttributes = {\n\tariaSetsize?: number,\n\tariaPosinset?: number,\n\tariaLabel?: string,\n\tcontrols?: LowercaseString<string>\n\texpanded?: \"true\" | \"false\" | boolean,\n\thasPopup?: AriaHasPopup,\n\tname?: string,\n\trole?: AriaRole,\n\tariaKeyShortcuts?: string,\n\tariaCurrent?: AriaCurrent,\n\tcurrent?: AriaCurrent,\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import getConstructableStyle from "./theming/getConstructableStyle.js";
|
|
2
|
+
/**
|
|
3
|
+
* Updates the shadow root of a UI5Element or its static area item
|
|
4
|
+
* @param element
|
|
5
|
+
*/
|
|
6
|
+
const updateShadowRoot = (element) => {
|
|
7
|
+
const ctor = element.constructor;
|
|
8
|
+
const shadowRoot = element.shadowRoot;
|
|
9
|
+
if (!shadowRoot) {
|
|
10
|
+
console.warn(`There is no shadow root to update`); // eslint-disable-line
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
shadowRoot.adoptedStyleSheets = getConstructableStyle(ctor);
|
|
14
|
+
ctor.renderer(element, shadowRoot);
|
|
15
|
+
};
|
|
16
|
+
export default updateShadowRoot;
|
|
17
|
+
//# sourceMappingURL=updateShadowRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateShadowRoot.js","sourceRoot":"","sources":["../src/updateShadowRoot.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AAGvE;;;GAGG;AACH,MAAM,gBAAgB,GAAG,CAAC,OAAmB,EAAE,EAAE;IAChD,MAAM,IAAI,GAAG,OAAO,CAAC,WAAgC,CAAC;IACtD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAEtC,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,OAAO,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC,CAAC,sBAAsB;QACzE,OAAO;IACR,CAAC;IAED,UAAU,CAAC,kBAAkB,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC5D,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import getConstructableStyle from \"./theming/getConstructableStyle.js\";\nimport type UI5Element from \"./UI5Element.js\";\n\n/**\n * Updates the shadow root of a UI5Element or its static area item\n * @param element\n */\nconst updateShadowRoot = (element: UI5Element) => {\n\tconst ctor = element.constructor as typeof UI5Element;\n\tconst shadowRoot = element.shadowRoot;\n\n\tif (!shadowRoot) {\n\t\tconsole.warn(`There is no shadow root to update`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\tshadowRoot.adoptedStyleSheets = getConstructableStyle(ctor);\n\tctor.renderer(element, shadowRoot);\n};\n\nexport default updateShadowRoot;\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type UI5Element from "../UI5Element.js";
|
|
2
|
+
type MutationCallback = () => void;
|
|
3
|
+
declare const getEffectiveAriaLabelText: (el: HTMLElement) => string | undefined;
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param {HTMLElement} el Defines the HTMLElement, for which you need to get all related texts
|
|
7
|
+
*/
|
|
8
|
+
declare const getAllAccessibleNameRefTexts: (el: HTMLElement) => string;
|
|
9
|
+
/**
|
|
10
|
+
* @param {HTMLElement} el Defines the HTMLElement, for which you need to get all related "label for" texts
|
|
11
|
+
*/
|
|
12
|
+
declare const getAssociatedLabelForTexts: (el: HTMLElement) => string | undefined;
|
|
13
|
+
declare const registerUI5Element: (el: UI5Element, callback: MutationCallback) => void;
|
|
14
|
+
declare const deregisterUI5Element: (el: UI5Element) => void;
|
|
15
|
+
declare const getEffectiveAriaDescriptionText: (el: HTMLElement) => string | undefined;
|
|
16
|
+
declare const getAllAccessibleDescriptionRefTexts: (el: HTMLElement) => string;
|
|
17
|
+
export { getEffectiveAriaLabelText, getAssociatedLabelForTexts, registerUI5Element, deregisterUI5Element, getAllAccessibleNameRefTexts, getEffectiveAriaDescriptionText, getAllAccessibleDescriptionRefTexts, };
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
const associatedElements = new WeakMap();
|
|
2
|
+
const registeredElements = new WeakMap();
|
|
3
|
+
const observerOptions = {
|
|
4
|
+
attributes: true,
|
|
5
|
+
childList: true,
|
|
6
|
+
characterData: true,
|
|
7
|
+
subtree: true,
|
|
8
|
+
};
|
|
9
|
+
const getEffectiveAriaLabelText = (el) => {
|
|
10
|
+
const accessibleEl = el;
|
|
11
|
+
if (!accessibleEl.accessibleNameRef) {
|
|
12
|
+
if (accessibleEl.accessibleName) {
|
|
13
|
+
return accessibleEl.accessibleName;
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
return getAllAccessibleNameRefTexts(el);
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param {HTMLElement} el Defines the HTMLElement, for which you need to get all related texts
|
|
22
|
+
*/
|
|
23
|
+
const getAllAccessibleNameRefTexts = (el) => {
|
|
24
|
+
const ids = el.accessibleNameRef?.split(" ") ?? [];
|
|
25
|
+
let result = "";
|
|
26
|
+
ids.forEach((elementId, index) => {
|
|
27
|
+
const element = _getReferencedElementById(el, elementId);
|
|
28
|
+
const text = `${element && element.textContent ? element.textContent : ""}`;
|
|
29
|
+
if (text) {
|
|
30
|
+
result += text;
|
|
31
|
+
if (index < ids.length - 1) {
|
|
32
|
+
result += " ";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
const _getAllAssociatedElementsFromDOM = (el) => {
|
|
39
|
+
const set = new Set();
|
|
40
|
+
// adding labels with attribute for matching the el.id
|
|
41
|
+
const labelsForAssociated = _getAssociatedLabels(el);
|
|
42
|
+
labelsForAssociated.forEach(itm => {
|
|
43
|
+
set.add(itm);
|
|
44
|
+
});
|
|
45
|
+
// adding other elements that id is the same as accessibleNameRef value
|
|
46
|
+
const ariaLabelledBy = el["accessibleNameRef"];
|
|
47
|
+
const ariaDescribedBy = el["accessibleDescriptionRef"];
|
|
48
|
+
const value = [ariaLabelledBy, ariaDescribedBy].filter(Boolean).join(" ");
|
|
49
|
+
const ids = value ? value.split(" ") : [];
|
|
50
|
+
ids.forEach(id => {
|
|
51
|
+
const refEl = _getReferencedElementById(el, id);
|
|
52
|
+
if (refEl) {
|
|
53
|
+
set.add(refEl);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return Array.from(set);
|
|
57
|
+
};
|
|
58
|
+
const _getAssociatedLabels = (el) => {
|
|
59
|
+
const labels = el.getRootNode().querySelectorAll(`[for="${el.id}"]`);
|
|
60
|
+
return Array.from(labels);
|
|
61
|
+
};
|
|
62
|
+
const _getReferencedElementById = (el, elementId) => {
|
|
63
|
+
return el.getRootNode().querySelector(`[id='${elementId}']`) || document.getElementById(elementId);
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* @param {HTMLElement} el Defines the HTMLElement, for which you need to get all related "label for" texts
|
|
67
|
+
*/
|
|
68
|
+
const getAssociatedLabelForTexts = (el) => {
|
|
69
|
+
const results = [];
|
|
70
|
+
const labels = _getAssociatedLabels(el);
|
|
71
|
+
labels.forEach((label) => {
|
|
72
|
+
const labelText = label.textContent;
|
|
73
|
+
labelText && results.push(labelText);
|
|
74
|
+
});
|
|
75
|
+
if (results.length) {
|
|
76
|
+
return results.join(" ");
|
|
77
|
+
}
|
|
78
|
+
return undefined;
|
|
79
|
+
};
|
|
80
|
+
const _createInvalidationCallback = (el) => {
|
|
81
|
+
const invalidationCallback = (changeInfo) => {
|
|
82
|
+
const isAccessibleNameRefChange = changeInfo && changeInfo.type === "property" && changeInfo.name === "accessibleNameRef";
|
|
83
|
+
const isAccessibleDescriptionRefChange = changeInfo && changeInfo.type === "property" && changeInfo.name === "accessibleDescriptionRef";
|
|
84
|
+
if (!isAccessibleNameRefChange && !isAccessibleDescriptionRefChange) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const registeredElement = registeredElements.get(el);
|
|
88
|
+
if (!registeredElement) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const oldAssociatedElements = registeredElement.observedElements;
|
|
92
|
+
const newAssociatedElements = _getAllAssociatedElementsFromDOM(el);
|
|
93
|
+
oldAssociatedElements.forEach(oldElement => {
|
|
94
|
+
if (!newAssociatedElements.includes(oldElement)) {
|
|
95
|
+
_removeObservedElementFromRegisteredElement(registeredElement, oldElement);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
newAssociatedElements.forEach(newElement => {
|
|
99
|
+
if (!oldAssociatedElements.includes(newElement)) {
|
|
100
|
+
_addObservedElementToRegisteredElement(registeredElement, newElement);
|
|
101
|
+
registeredElement.observedElements.push(newElement);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
registeredElement?.callback();
|
|
105
|
+
};
|
|
106
|
+
return invalidationCallback;
|
|
107
|
+
};
|
|
108
|
+
const registerUI5Element = (el, callback) => {
|
|
109
|
+
if (registeredElements.has(el)) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
const allAssociatedElements = _getAllAssociatedElementsFromDOM(el);
|
|
113
|
+
const invalidationCallback = _createInvalidationCallback(el);
|
|
114
|
+
const registeredElement = {
|
|
115
|
+
host: el,
|
|
116
|
+
observedElements: allAssociatedElements,
|
|
117
|
+
callback,
|
|
118
|
+
invalidationCallback,
|
|
119
|
+
};
|
|
120
|
+
registeredElements.set(el, registeredElement);
|
|
121
|
+
el.attachInvalidate(invalidationCallback);
|
|
122
|
+
allAssociatedElements.forEach((element) => {
|
|
123
|
+
_addObservedElementToRegisteredElement(registeredElement, element);
|
|
124
|
+
});
|
|
125
|
+
callback();
|
|
126
|
+
};
|
|
127
|
+
const _addObservedElementToRegisteredElement = (registeredElement, element) => {
|
|
128
|
+
let associatedElement = associatedElements.get(element);
|
|
129
|
+
if (!associatedElement) {
|
|
130
|
+
associatedElement = { observer: null, callbacks: [] };
|
|
131
|
+
const observer = new MutationObserver(() => {
|
|
132
|
+
const callbacks = associatedElement.callbacks;
|
|
133
|
+
callbacks.forEach(callback => {
|
|
134
|
+
callback();
|
|
135
|
+
});
|
|
136
|
+
const domEl = document.getElementById(element.id);
|
|
137
|
+
// if no longer should be observed from this registeredElement, remove it
|
|
138
|
+
if (!(registeredElement.host.id === element.getAttribute("for") || domEl)) {
|
|
139
|
+
_removeObservedElementFromRegisteredElement(registeredElement, element);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
associatedElement.observer = observer;
|
|
143
|
+
observer.observe(element, observerOptions);
|
|
144
|
+
associatedElements.set(element, associatedElement);
|
|
145
|
+
}
|
|
146
|
+
if (!associatedElement.callbacks.includes(registeredElement.callback)) {
|
|
147
|
+
associatedElement.callbacks.push(registeredElement.callback);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
const _removeObservedElementFromRegisteredElement = (registeredElement, element) => {
|
|
151
|
+
const associatedElement = associatedElements.get(element);
|
|
152
|
+
if (associatedElement) {
|
|
153
|
+
associatedElement.callbacks = associatedElement.callbacks.filter(itm => itm !== registeredElement.callback);
|
|
154
|
+
if (!associatedElement.callbacks.length) {
|
|
155
|
+
associatedElement.observer?.disconnect();
|
|
156
|
+
associatedElements.delete(element);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
registeredElement.observedElements = registeredElement.observedElements.filter(itm => itm !== element);
|
|
160
|
+
};
|
|
161
|
+
const deregisterUI5Element = (el) => {
|
|
162
|
+
const registeredElement = registeredElements.get(el);
|
|
163
|
+
if (!registeredElement) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const oldObservedElements = [...registeredElement.observedElements];
|
|
167
|
+
oldObservedElements.forEach(observedElement => {
|
|
168
|
+
_removeObservedElementFromRegisteredElement(registeredElement, observedElement);
|
|
169
|
+
});
|
|
170
|
+
el.detachInvalidate(registeredElement.invalidationCallback);
|
|
171
|
+
registeredElements.delete(el);
|
|
172
|
+
};
|
|
173
|
+
const getEffectiveAriaDescriptionText = (el) => {
|
|
174
|
+
const accessibleEl = el;
|
|
175
|
+
if (!accessibleEl.accessibleDescriptionRef) {
|
|
176
|
+
if (accessibleEl.accessibleDescription) {
|
|
177
|
+
return accessibleEl.accessibleDescription;
|
|
178
|
+
}
|
|
179
|
+
return undefined;
|
|
180
|
+
}
|
|
181
|
+
return getAllAccessibleDescriptionRefTexts(el);
|
|
182
|
+
};
|
|
183
|
+
const getAllAccessibleDescriptionRefTexts = (el) => {
|
|
184
|
+
const ids = el.accessibleDescriptionRef?.split(" ") ?? [];
|
|
185
|
+
let result = "";
|
|
186
|
+
ids.forEach((elementId, index) => {
|
|
187
|
+
const element = _getReferencedElementById(el, elementId);
|
|
188
|
+
const text = `${element && element.textContent ? element.textContent : ""}`;
|
|
189
|
+
if (text) {
|
|
190
|
+
result += text;
|
|
191
|
+
if (index < ids.length - 1) {
|
|
192
|
+
result += " ";
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
return result;
|
|
197
|
+
};
|
|
198
|
+
export { getEffectiveAriaLabelText, getAssociatedLabelForTexts, registerUI5Element, deregisterUI5Element, getAllAccessibleNameRefTexts, getEffectiveAriaDescriptionText, getAllAccessibleDescriptionRefTexts, };
|
|
199
|
+
//# sourceMappingURL=AccessibilityTextsHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessibilityTextsHelper.js","sourceRoot":"","sources":["../../src/util/AccessibilityTextsHelper.ts"],"names":[],"mappings":"AAgBA,MAAM,kBAAkB,GAAG,IAAI,OAAO,EAAkC,CAAC;AACzE,MAAM,kBAAkB,GAAG,IAAI,OAAO,EAAiC,CAAC;AASxE,MAAM,eAAe,GAAG;IACvB,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,IAAI;IACf,aAAa,EAAE,IAAI;IACnB,OAAO,EAAE,IAAI;CACb,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,EAAe,EAAE,EAAE;IACrD,MAAM,YAAY,GAAG,EAAuB,CAAC;IAE7C,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAE,CAAC;QACrC,IAAI,YAAY,CAAC,cAAc,EAAE,CAAC;YACjC,OAAO,YAAY,CAAC,cAAc,CAAC;QACpC,CAAC;QAED,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,OAAO,4BAA4B,CAAC,EAAE,CAAC,CAAC;AACzC,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,4BAA4B,GAAG,CAAC,EAAe,EAAE,EAAE;IACxD,MAA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QAChD,MAAM,OAAO,GAAG,yBAAyB,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QACzD,MAAM,IAAI,GAAG,GAAG,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC5E,IAAI,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,IAAI,CAAC;YACf,IAAI,KAAK,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC5B,MAAM,IAAI,GAAG,CAAC;YACf,CAAC;QACF,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AACf,CAAC,CAAC;AAEF,OAAO,EACN,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,EAC5B,+BAA+B,EAC/B,mCAAmC,GACnC,CAAC","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\nimport type { ChangeInfo } from \"../UI5Element.js\";\n\ntype InvalidateCallback = (changeInfo: ChangeInfo) => void;\ntype MutationCallback = () => void;\ntype AssociatedElement = {\n\tobserver: MutationObserver | null;\n\tcallbacks: Array<MutationCallback>;\n};\ntype RegisteredElement = {\n\thost: UI5Element;\n\tobservedElements: Array<HTMLElement>;\n\tcallback: MutationCallback;\n\tinvalidationCallback: InvalidateCallback;\n};\n\nconst associatedElements = new WeakMap<HTMLElement, AssociatedElement>();\nconst registeredElements = new WeakMap<UI5Element, RegisteredElement>();\n\ntype AccessibleElement = HTMLElement & {\n\taccessibleNameRef?: string;\n\taccessibleName?: string;\n\taccessibleDescriptionRef?: string;\n\taccessibleDescription?: string;\n};\n\nconst observerOptions = {\n\tattributes: true,\n\tchildList: true,\n\tcharacterData: true,\n\tsubtree: true,\n};\n\nconst getEffectiveAriaLabelText = (el: HTMLElement) => {\n\tconst accessibleEl = el as AccessibleElement;\n\n\tif (!accessibleEl.accessibleNameRef) {\n\t\tif (accessibleEl.accessibleName) {\n\t\t\treturn accessibleEl.accessibleName;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\treturn getAllAccessibleNameRefTexts(el);\n};\n\n/**\n *\n * @param {HTMLElement} el Defines the HTMLElement, for which you need to get all related texts\n */\nconst getAllAccessibleNameRefTexts = (el: HTMLElement) => {\n\tconst ids = (el as AccessibleElement).accessibleNameRef?.split(\" \") ?? [];\n\tlet result = \"\";\n\n\tids.forEach((elementId: string, index: number) => {\n\t\tconst element = _getReferencedElementById(el, elementId);\n\t\tconst text = `${element && element.textContent ? element.textContent : \"\"}`;\n\t\tif (text) {\n\t\t\tresult += text;\n\t\t\tif (index < ids.length - 1) {\n\t\t\t\tresult += \" \";\n\t\t\t}\n\t\t}\n\t});\n\n\treturn result;\n};\n\nconst _getAllAssociatedElementsFromDOM = (el: UI5Element): Array<HTMLElement> => {\n\tconst set = new Set<HTMLElement>();\n\t// adding labels with attribute for matching the el.id\n\tconst labelsForAssociated = _getAssociatedLabels(el);\n\tlabelsForAssociated.forEach(itm => {\n\t\tset.add(itm);\n\t});\n\t// adding other elements that id is the same as accessibleNameRef value\n\tconst ariaLabelledBy = el[\"accessibleNameRef\" as keyof typeof el] as string;\n\tconst ariaDescribedBy = el[\"accessibleDescriptionRef\" as keyof typeof el] as string;\n\n\tconst value = [ariaLabelledBy, ariaDescribedBy].filter(Boolean).join(\" \");\n\n\tconst ids = value ? value.split(\" \") : [];\n\tids.forEach(id => {\n\t\tconst refEl = _getReferencedElementById(el, id);\n\t\tif (refEl) {\n\t\t\tset.add(refEl);\n\t\t}\n\t});\n\treturn Array.from(set);\n};\n\nconst _getAssociatedLabels = (el: HTMLElement): Array<HTMLElement> => {\n\tconst labels = (el.getRootNode() as HTMLElement).querySelectorAll<HTMLElement>(`[for=\"${el.id}\"]`);\n\treturn Array.from(labels);\n};\n\nconst _getReferencedElementById = (el: HTMLElement, elementId: string): HTMLElement | null => {\n\treturn (el.getRootNode() as HTMLElement).querySelector<HTMLElement>(`[id='${elementId}']`) || document.getElementById(elementId);\n};\n\n/**\n * @param {HTMLElement} el Defines the HTMLElement, for which you need to get all related \"label for\" texts\n */\nconst getAssociatedLabelForTexts = (el: HTMLElement) => {\n\tconst results: Array<string> = [];\n\tconst labels = _getAssociatedLabels(el);\n\n\tlabels.forEach((label: HTMLElement) => {\n\t\tconst labelText = label.textContent;\n\t\tlabelText && results.push(labelText);\n\t});\n\n\tif (results.length) {\n\t\treturn results.join(\" \");\n\t}\n\n\treturn undefined;\n};\n\nconst _createInvalidationCallback = (el: UI5Element) => {\n\tconst invalidationCallback = (changeInfo: ChangeInfo) => {\n\t\tconst isAccessibleNameRefChange = changeInfo && changeInfo.type === \"property\" && changeInfo.name === \"accessibleNameRef\";\n\t\tconst isAccessibleDescriptionRefChange = changeInfo && changeInfo.type === \"property\" && changeInfo.name === \"accessibleDescriptionRef\";\n\t\tif (!isAccessibleNameRefChange && !isAccessibleDescriptionRefChange) {\n\t\t\treturn;\n\t\t}\n\t\tconst registeredElement = registeredElements.get(el);\n\t\tif (!registeredElement) {\n\t\t\treturn;\n\t\t}\n\t\tconst oldAssociatedElements = registeredElement.observedElements;\n\t\tconst newAssociatedElements = _getAllAssociatedElementsFromDOM(el);\n\t\toldAssociatedElements.forEach(oldElement => {\n\t\t\tif (!newAssociatedElements.includes(oldElement)) {\n\t\t\t\t_removeObservedElementFromRegisteredElement(registeredElement, oldElement);\n\t\t\t}\n\t\t});\n\t\tnewAssociatedElements.forEach(newElement => {\n\t\t\tif (!oldAssociatedElements.includes(newElement)) {\n\t\t\t\t_addObservedElementToRegisteredElement(registeredElement, newElement);\n\t\t\t\tregisteredElement.observedElements.push(newElement);\n\t\t\t}\n\t\t});\n\t\tregisteredElement?.callback();\n\t};\n\treturn invalidationCallback;\n};\n\nconst registerUI5Element = (el: UI5Element, callback: MutationCallback) => {\n\tif (registeredElements.has(el)) {\n\t\treturn;\n\t}\n\tconst allAssociatedElements = _getAllAssociatedElementsFromDOM(el);\n\tconst invalidationCallback = _createInvalidationCallback(el);\n\tconst registeredElement = {\n\t\thost: el,\n\t\tobservedElements: allAssociatedElements,\n\t\tcallback,\n\t\tinvalidationCallback,\n\t};\n\tregisteredElements.set(el, registeredElement);\n\tel.attachInvalidate(invalidationCallback);\n\n\tallAssociatedElements.forEach((element: HTMLElement) => {\n\t\t_addObservedElementToRegisteredElement(registeredElement, element);\n\t});\n\tcallback();\n};\n\nconst _addObservedElementToRegisteredElement = (registeredElement: RegisteredElement, element: HTMLElement) => {\n\tlet associatedElement = associatedElements.get(element);\n\tif (!associatedElement) {\n\t\tassociatedElement = { observer: null, callbacks: [] };\n\t\tconst observer = new MutationObserver(() => {\n\t\t\tconst callbacks = (associatedElement as AssociatedElement).callbacks;\n\t\t\tcallbacks.forEach(callback => {\n\t\t\t\tcallback();\n\t\t\t});\n\t\t\tconst domEl = document.getElementById(element.id);\n\t\t\t// if no longer should be observed from this registeredElement, remove it\n\t\t\tif (!(registeredElement.host.id === element.getAttribute(\"for\") || domEl)) {\n\t\t\t\t_removeObservedElementFromRegisteredElement(registeredElement, element);\n\t\t\t}\n\t\t});\n\t\tassociatedElement.observer = observer;\n\t\tobserver.observe(element, observerOptions);\n\t\tassociatedElements.set(element, associatedElement);\n\t}\n\tif (!associatedElement.callbacks.includes(registeredElement.callback)) {\n\t\tassociatedElement.callbacks.push(registeredElement.callback);\n\t}\n};\n\nconst _removeObservedElementFromRegisteredElement = (registeredElement: RegisteredElement, element: HTMLElement) => {\n\tconst associatedElement = associatedElements.get(element);\n\tif (associatedElement) {\n\t\tassociatedElement.callbacks = associatedElement.callbacks.filter(itm => itm !== registeredElement.callback);\n\t\tif (!associatedElement.callbacks.length) {\n\t\t\tassociatedElement.observer?.disconnect();\n\t\t\tassociatedElements.delete(element);\n\t\t}\n\t}\n\tregisteredElement.observedElements = registeredElement.observedElements.filter(itm => itm !== element);\n};\n\nconst deregisterUI5Element = (el: UI5Element) => {\n\tconst registeredElement = registeredElements.get(el);\n\tif (!registeredElement) {\n\t\treturn;\n\t}\n\tconst oldObservedElements = [...registeredElement.observedElements];\n\toldObservedElements.forEach(observedElement => {\n\t\t_removeObservedElementFromRegisteredElement(registeredElement, observedElement);\n\t});\n\tel.detachInvalidate(registeredElement.invalidationCallback);\n\tregisteredElements.delete(el);\n};\n\nconst getEffectiveAriaDescriptionText = (el: HTMLElement) => {\n\tconst accessibleEl = el as AccessibleElement;\n\n\tif (!accessibleEl.accessibleDescriptionRef) {\n\t\tif (accessibleEl.accessibleDescription) {\n\t\t\treturn accessibleEl.accessibleDescription;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\treturn getAllAccessibleDescriptionRefTexts(el);\n};\n\nconst getAllAccessibleDescriptionRefTexts = (el: HTMLElement) => {\n\tconst ids = (el as AccessibleElement).accessibleDescriptionRef?.split(\" \") ?? [];\n\tlet result = \"\";\n\n\tids.forEach((elementId: string, index: number) => {\n\t\tconst element = _getReferencedElementById(el, elementId);\n\t\tconst text = `${element && element.textContent ? element.textContent : \"\"}`;\n\t\tif (text) {\n\t\t\tresult += text;\n\t\t\tif (index < ids.length - 1) {\n\t\t\t\tresult += \" \";\n\t\t\t}\n\t\t}\n\t});\n\n\treturn result;\n};\n\nexport {\n\tgetEffectiveAriaLabelText,\n\tgetAssociatedLabelForTexts,\n\tregisterUI5Element,\n\tderegisterUI5Element,\n\tgetAllAccessibleNameRefTexts,\n\tgetEffectiveAriaDescriptionText,\n\tgetAllAccessibleDescriptionRefTexts,\n};\n"]}
|