@ui5/webcomponents-base 0.0.0-4180fe799 → 0.0.0-4237771ff
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +7 -5
- package/.npsrc.json +3 -0
- package/CHANGELOG.md +1015 -0
- package/README.md +33 -6
- package/bundle.esm.js +20 -11
- package/config/wdio.conf.cjs +400 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/AssetRegistry.d.ts +5 -0
- package/dist/AssetRegistry.js +3 -8
- package/dist/AssetRegistry.js.map +1 -0
- package/dist/Boot.d.ts +9 -0
- package/dist/Boot.js +56 -28
- package/dist/Boot.js.map +1 -0
- package/{src/CSP.js → dist/CSP.d.ts} +8 -37
- package/dist/CSP.js +16 -24
- package/dist/CSP.js.map +1 -0
- package/dist/CustomElementsRegistry.d.ts +5 -0
- package/dist/CustomElementsRegistry.js +69 -30
- package/dist/CustomElementsRegistry.js.map +1 -0
- package/dist/CustomElementsScope.d.ts +7 -0
- package/dist/CustomElementsScope.js +11 -108
- 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 +12 -54
- package/dist/DOMObserver.js.map +1 -0
- package/dist/Device.d.ts +13 -0
- package/dist/Device.js +157 -89
- package/dist/Device.js.map +1 -0
- package/dist/EventProvider.d.ts +25 -0
- package/dist/EventProvider.js +67 -82
- package/dist/EventProvider.js.map +1 -0
- package/dist/FeaturesRegistry.d.ts +3 -0
- package/dist/FeaturesRegistry.js +5 -7
- package/dist/FeaturesRegistry.js.map +1 -0
- package/dist/FontFace.d.ts +2 -0
- package/dist/FontFace.js +14 -19
- package/dist/FontFace.js.map +1 -0
- package/dist/IgnoreCustomElements.d.ts +27 -0
- package/dist/IgnoreCustomElements.js +39 -0
- package/dist/IgnoreCustomElements.js.map +1 -0
- package/dist/InitialConfiguration.d.ts +28 -0
- package/dist/InitialConfiguration.js +126 -131
- package/dist/InitialConfiguration.js.map +1 -0
- package/dist/Keys.d.ts +61 -0
- package/dist/Keys.js +175 -242
- package/dist/Keys.js.map +1 -0
- package/dist/ManagedStyles.d.ts +9 -0
- package/dist/ManagedStyles.js +140 -70
- package/dist/ManagedStyles.js.map +1 -0
- package/dist/MarkedEvents.d.ts +9 -0
- package/dist/MarkedEvents.js +15 -0
- package/dist/MarkedEvents.js.map +1 -0
- package/dist/MediaRange.d.ts +37 -0
- package/dist/MediaRange.js +54 -65
- package/dist/MediaRange.js.map +1 -0
- package/dist/PropertiesFileFormat.d.ts +8 -0
- package/dist/PropertiesFileFormat.js +72 -82
- package/dist/PropertiesFileFormat.js.map +1 -0
- package/dist/Render.d.ts +47 -0
- package/dist/Render.js +81 -113
- package/dist/Render.js.map +1 -0
- package/dist/RenderQueue.d.ts +19 -0
- package/dist/RenderQueue.js +52 -62
- package/dist/RenderQueue.js.map +1 -0
- package/dist/Runtimes.d.ts +27 -0
- package/dist/Runtimes.js +86 -0
- package/dist/Runtimes.js.map +1 -0
- package/dist/StaticArea.d.ts +3 -0
- package/dist/StaticArea.js +5 -1
- package/dist/StaticArea.js.map +1 -0
- package/dist/StaticAreaItem.d.ts +37 -0
- package/dist/StaticAreaItem.js +88 -84
- package/dist/StaticAreaItem.js.map +1 -0
- package/dist/SystemCSSVars.d.ts +2 -0
- package/dist/SystemCSSVars.js +4 -5
- package/dist/SystemCSSVars.js.map +1 -0
- package/{src/Theming.js → dist/Theming.d.ts} +0 -1
- package/dist/Theming.js +1 -1
- package/dist/Theming.js.map +1 -0
- package/dist/UI5Element.d.ts +394 -0
- package/dist/UI5Element.js +946 -980
- package/dist/UI5Element.js.map +1 -0
- package/dist/UI5ElementMetadata.d.ts +151 -0
- package/dist/UI5ElementMetadata.js +278 -306
- 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/api.json +1 -0
- package/dist/asset-registries/Icons.d.ts +39 -0
- package/dist/asset-registries/Icons.js +120 -123
- package/dist/asset-registries/Icons.js.map +1 -0
- package/dist/asset-registries/Illustrations.d.ts +18 -0
- package/dist/asset-registries/Illustrations.js +79 -25
- package/dist/asset-registries/Illustrations.js.map +1 -0
- package/dist/asset-registries/LocaleData.d.ts +7 -0
- package/dist/asset-registries/LocaleData.js +104 -127
- package/dist/asset-registries/LocaleData.js.map +1 -0
- package/dist/asset-registries/Themes.d.ts +12 -0
- package/dist/asset-registries/Themes.js +57 -67
- package/dist/asset-registries/Themes.js.map +1 -0
- package/dist/asset-registries/i18n.d.ts +23 -0
- package/dist/asset-registries/i18n.js +62 -81
- 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 +21 -18
- package/dist/config/AnimationMode.js.map +1 -0
- package/dist/config/CalendarType.d.ts +15 -0
- package/dist/config/CalendarType.js +31 -14
- package/dist/config/CalendarType.js.map +1 -0
- package/dist/config/FormatSettings.d.ts +15 -0
- package/dist/config/FormatSettings.js +15 -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 +43 -43
- package/dist/config/Language.js.map +1 -0
- package/dist/config/NoConflict.d.ts +20 -0
- package/dist/config/NoConflict.js +41 -41
- package/dist/config/NoConflict.js.map +1 -0
- package/dist/config/RTL.d.ts +7 -0
- package/dist/config/RTL.js +26 -20
- package/dist/config/RTL.js.map +1 -0
- package/dist/config/Theme.d.ts +38 -0
- package/dist/config/Theme.js +57 -29
- package/dist/config/Theme.js.map +1 -0
- package/dist/config/ThemeRoot.d.ts +29 -0
- package/dist/config/ThemeRoot.js +59 -0
- package/dist/config/ThemeRoot.js.map +1 -0
- package/dist/config/Timezone.d.ts +17 -0
- package/dist/config/Timezone.js +30 -0
- package/dist/config/Timezone.js.map +1 -0
- package/dist/connectToComponent.d.ts +9 -0
- package/dist/connectToComponent.js +59 -0
- package/dist/connectToComponent.js.map +1 -0
- package/dist/css/BusyIndicator.css +80 -0
- package/dist/css/FontFace.css +67 -16
- package/dist/decorators/customElement.d.ts +23 -0
- package/dist/decorators/customElement.js +37 -0
- package/dist/decorators/customElement.js.map +1 -0
- package/dist/decorators/event.d.ts +10 -0
- package/dist/decorators/event.js +24 -0
- package/dist/decorators/event.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/slot.d.ts +9 -0
- package/dist/decorators/slot.js +37 -0
- package/dist/decorators/slot.js.map +1 -0
- package/dist/delegate/ItemNavigation.d.ts +114 -0
- package/dist/delegate/ItemNavigation.js +276 -312
- package/dist/delegate/ItemNavigation.js.map +1 -0
- package/dist/delegate/ResizeHandler.d.ts +25 -0
- package/dist/delegate/ResizeHandler.js +72 -91
- package/dist/delegate/ResizeHandler.js.map +1 -0
- package/dist/delegate/ScrollEnablement.d.ts +49 -0
- package/dist/delegate/ScrollEnablement.js +157 -180
- package/dist/delegate/ScrollEnablement.js.map +1 -0
- package/dist/features/F6Navigation.d.ts +19 -0
- package/dist/features/F6Navigation.js +151 -0
- package/dist/features/F6Navigation.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 +36 -0
- package/dist/features/OpenUI5Support.js +151 -121
- package/dist/features/OpenUI5Support.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 +3 -0
- package/dist/generated/css/BusyIndicator.css.js +7 -0
- package/dist/generated/css/BusyIndicator.css.js.map +1 -0
- package/dist/generated/css/FontFace.css.d.ts +3 -0
- package/dist/generated/css/FontFace.css.js +7 -5
- package/dist/generated/css/FontFace.css.js.map +1 -0
- package/dist/generated/css/OverrideFontFace.css.d.ts +3 -0
- package/dist/generated/css/OverrideFontFace.css.js +7 -5
- package/dist/generated/css/OverrideFontFace.css.js.map +1 -0
- package/dist/generated/css/SystemCSSVars.css.d.ts +3 -0
- package/dist/generated/css/SystemCSSVars.css.js +7 -5
- package/dist/generated/css/SystemCSSVars.css.js.map +1 -0
- package/dist/generated/templates/elements/WithComplexTemplateTemplate.lit.d.ts +4 -0
- package/dist/generated/templates/elements/WithComplexTemplateTemplate.lit.js +9 -0
- package/dist/generated/templates/elements/WithComplexTemplateTemplate.lit.js.map +1 -0
- package/dist/getSharedResource.d.ts +11 -0
- package/dist/getSharedResource.js +28 -18
- package/dist/getSharedResource.js.map +1 -0
- package/dist/global.d.ts +40 -0
- package/dist/i18nBundle.d.ts +43 -0
- package/dist/i18nBundle.js +57 -64
- package/dist/i18nBundle.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 +6 -11
- package/dist/locale/RTLAwareRegistry.js.map +1 -0
- package/dist/locale/applyDirection.d.ts +10 -0
- package/dist/locale/applyDirection.js +7 -7
- package/dist/locale/applyDirection.js.map +1 -0
- package/dist/locale/directionChange.d.ts +15 -0
- package/dist/locale/directionChange.js +7 -15
- package/dist/locale/directionChange.js.map +1 -0
- package/dist/locale/getEffectiveDir.d.ts +2 -0
- package/dist/locale/getEffectiveDir.js +20 -24
- package/dist/locale/getEffectiveDir.js.map +1 -0
- package/dist/locale/getLocale.d.ts +7 -0
- package/dist/locale/getLocale.js +26 -29
- package/dist/locale/getLocale.js.map +1 -0
- package/dist/locale/languageChange.d.ts +5 -0
- package/dist/locale/languageChange.js +8 -16
- 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/LitRenderer.d.ts +14 -0
- package/dist/renderer/LitRenderer.js +31 -24
- package/dist/renderer/LitRenderer.js.map +1 -0
- package/dist/renderer/executeTemplate.d.ts +13 -0
- package/dist/renderer/executeTemplate.js +20 -7
- package/dist/renderer/executeTemplate.js.map +1 -0
- package/dist/sap/base/Log.js +28 -29
- package/dist/sap/base/assert.js +5 -6
- package/dist/sap/base/security/URLListValidator.js +13 -2
- package/dist/sap/base/security/encodeCSS.js +14 -0
- package/dist/sap/base/security/encodeXML.js +23 -0
- package/dist/sap/base/strings/toHex.js +8 -0
- package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +112 -97
- package/dist/theming/CustomStyle.d.ts +6 -0
- package/dist/theming/CustomStyle.js +39 -31
- package/dist/theming/CustomStyle.js.map +1 -0
- package/dist/theming/ThemeLoaded.d.ts +5 -0
- package/dist/theming/ThemeLoaded.js +8 -16
- 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 +61 -60
- package/dist/theming/applyTheme.js.map +1 -0
- package/dist/theming/getConstructableStyle.d.ts +9 -0
- package/dist/theming/getConstructableStyle.js +12 -17
- package/dist/theming/getConstructableStyle.js.map +1 -0
- package/dist/theming/getEffectiveLinksHrefs.d.ts +3 -0
- package/dist/theming/getEffectiveLinksHrefs.js +13 -16
- package/dist/theming/getEffectiveLinksHrefs.js.map +1 -0
- package/dist/theming/getEffectiveStyle.d.ts +3 -0
- package/dist/theming/getEffectiveStyle.js +25 -23
- package/dist/theming/getEffectiveStyle.js.map +1 -0
- package/dist/theming/getStylesString.d.ts +3 -0
- package/dist/theming/getStylesString.js +9 -13
- package/dist/theming/getStylesString.js.map +1 -0
- package/dist/theming/getThemeDesignerTheme.d.ts +7 -0
- package/dist/theming/getThemeDesignerTheme.js +73 -61
- package/dist/theming/getThemeDesignerTheme.js.map +1 -0
- package/dist/theming/preloadLinks.d.ts +3 -0
- package/dist/theming/preloadLinks.js +13 -17
- package/dist/theming/preloadLinks.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/types/AnimationMode.d.ts +32 -0
- package/dist/types/AnimationMode.js +33 -6
- package/dist/types/AnimationMode.js.map +1 -0
- package/dist/types/CSSColor.d.ts +15 -0
- package/dist/types/CSSColor.js +14 -5
- package/dist/types/CSSColor.js.map +1 -0
- package/dist/types/CSSSize.d.ts +15 -0
- package/dist/types/CSSSize.js +14 -5
- package/dist/types/CSSSize.js.map +1 -0
- package/dist/types/CalendarType.d.ts +37 -0
- package/dist/types/CalendarType.js +35 -18
- package/dist/types/CalendarType.js.map +1 -0
- package/dist/types/DOMReference.d.ts +17 -0
- package/dist/types/DOMReference.js +25 -0
- package/dist/types/DOMReference.js.map +1 -0
- package/dist/types/DataType.d.ts +25 -0
- package/dist/types/DataType.js +33 -26
- package/dist/types/DataType.js.map +1 -0
- package/dist/types/Float.d.ts +17 -0
- package/dist/types/Float.js +17 -10
- package/dist/types/Float.js.map +1 -0
- package/dist/types/Integer.d.ts +17 -0
- package/dist/types/Integer.js +17 -9
- package/dist/types/Integer.js.map +1 -0
- package/dist/types/InvisibleMessageMode.d.ts +26 -0
- package/dist/types/InvisibleMessageMode.js +18 -22
- package/dist/types/InvisibleMessageMode.js.map +1 -0
- package/dist/types/ItemNavigationBehavior.d.ts +24 -0
- package/dist/types/ItemNavigationBehavior.js +22 -12
- package/dist/types/ItemNavigationBehavior.js.map +1 -0
- package/dist/types/NavigationMode.d.ts +32 -0
- package/dist/types/NavigationMode.js +33 -6
- package/dist/types/NavigationMode.js.map +1 -0
- package/dist/types/ValueState.d.ts +42 -0
- package/dist/types/ValueState.js +41 -19
- package/dist/types/ValueState.js.map +1 -0
- package/dist/types.d.ts +18 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/updateShadowRoot.d.ts +8 -0
- package/dist/updateShadowRoot.js +30 -18
- package/dist/updateShadowRoot.js.map +1 -0
- package/dist/util/AriaLabelHelper.d.ts +15 -0
- package/dist/util/AriaLabelHelper.js +166 -36
- package/dist/util/AriaLabelHelper.js.map +1 -0
- package/dist/util/Caret.d.ts +7 -0
- package/dist/util/Caret.js +16 -38
- package/dist/util/Caret.js.map +1 -0
- package/dist/util/ColorConversion.d.ts +30 -0
- package/dist/util/ColorConversion.js +320 -348
- 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 +67 -72
- package/dist/util/FocusableElements.js.map +1 -0
- package/{src/util/HTMLSanitizer.js → dist/util/HTMLSanitizer.d.ts} +1 -5
- package/dist/util/HTMLSanitizer.js +4 -5
- package/dist/util/HTMLSanitizer.js.map +1 -0
- package/dist/util/InvisibleMessage.d.ts +10 -0
- package/dist/util/InvisibleMessage.js +42 -44
- package/dist/util/InvisibleMessage.js.map +1 -0
- package/dist/util/PopupUtils.d.ts +7 -0
- package/dist/util/PopupUtils.js +58 -77
- package/dist/util/PopupUtils.js.map +1 -0
- package/dist/util/SlotsHelper.d.ts +9 -0
- package/dist/util/SlotsHelper.js +22 -35
- package/dist/util/SlotsHelper.js.map +1 -0
- package/dist/util/StringHelper.d.ts +3 -0
- package/dist/util/StringHelper.js +17 -20
- package/dist/util/StringHelper.js.map +1 -0
- package/dist/util/TabbableElements.d.ts +17 -0
- package/dist/util/TabbableElements.js +53 -43
- package/dist/util/TabbableElements.js.map +1 -0
- package/dist/util/arraysAreEqual.d.ts +2 -0
- package/dist/util/arraysAreEqual.js +10 -12
- package/dist/util/arraysAreEqual.js.map +1 -0
- package/{src/util/clamp.js → dist/util/clamp.d.ts} +1 -4
- package/dist/util/clamp.js +2 -2
- package/dist/util/clamp.js.map +1 -0
- package/dist/util/createLinkInHead.d.ts +7 -0
- package/dist/util/createLinkInHead.js +14 -12
- package/dist/util/createLinkInHead.js.map +1 -0
- package/dist/util/createStyleInHead.d.ts +8 -0
- package/dist/util/createStyleInHead.js +10 -10
- package/dist/util/createStyleInHead.js.map +1 -0
- package/dist/util/debounce.d.ts +2 -0
- package/dist/util/debounce.js +6 -8
- package/dist/util/debounce.js.map +1 -0
- package/dist/util/detectNavigatorLanguage.d.ts +2 -0
- package/dist/util/detectNavigatorLanguage.js +7 -10
- package/dist/util/detectNavigatorLanguage.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/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 +6 -8
- package/dist/util/getActiveElement.js.map +1 -0
- package/dist/util/getClassCopy.d.ts +416 -0
- package/dist/util/getClassCopy.js +7 -7
- package/dist/util/getClassCopy.js.map +1 -0
- package/dist/util/getDesigntimePropertyAsArray.d.ts +2 -0
- package/dist/util/getDesigntimePropertyAsArray.js +4 -3
- package/dist/util/getDesigntimePropertyAsArray.js.map +1 -0
- package/dist/util/getEffectiveContentDensity.d.ts +2 -0
- package/dist/util/getEffectiveContentDensity.js +2 -3
- package/dist/util/getEffectiveContentDensity.js.map +1 -0
- package/dist/util/getEffectiveScrollbarStyle.d.ts +2 -0
- package/dist/util/getEffectiveScrollbarStyle.js +4 -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/getParentElement.d.ts +2 -0
- package/dist/util/getParentElement.js +5 -0
- package/dist/util/getParentElement.js.map +1 -0
- package/dist/util/getSingletonElementInstance.d.ts +11 -0
- package/dist/util/getSingletonElementInstance.js +17 -11
- package/dist/util/getSingletonElementInstance.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/isElementContainingBlock.d.ts +2 -0
- package/dist/util/isElementContainingBlock.js +11 -0
- package/dist/util/isElementContainingBlock.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 +6 -9
- 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 +16 -17
- package/dist/util/isValidPropertyName.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 +48 -0
- package/dist/validateThemeRoot.js.map +1 -0
- package/index.js +227 -1
- package/lib/generate-asset-parameters/index.js +11 -5
- package/lib/generate-styles/index.js +26 -13
- package/lib/generate-version-info/index.js +32 -0
- package/package-scripts.cjs +70 -0
- package/package.json +12 -7
- package/src/css/BusyIndicator.css +80 -0
- package/src/css/FontFace.css +67 -16
- package/tsconfig.json +17 -0
- package/used-modules.txt +4 -1
- package/config/rollup.config.js +0 -1
- package/config/wdio.conf.js +0 -1
- package/dist/RenderScheduler.js +0 -44
- package/dist/animations/config.js +0 -5
- package/dist/assets-meta/IconCollectionsAlias.js +0 -18
- package/dist/isLegacyBrowser.js +0 -3
- package/dist/resources/bundle.esm.js +0 -37
- package/dist/resources/bundle.esm.js.map +0 -1
- package/dist/test-resources/assets/Themes.js +0 -17
- 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 -41
- package/dist/test-resources/elements/WithStaticArea.js +0 -77
- package/dist/test-resources/pages/AllTestElements.html +0 -42
- package/dist/test-resources/pages/Configuration.html +0 -18
- package/dist/test-resources/pages/ConfigurationScript.html +0 -34
- package/dist/test-resources/pages/assets/messagebundle_de.properties +0 -1
- package/dist/test-resources/pages/assets/messagebundle_en.properties +0 -1
- package/dist/test-resources/pages/assets/messagebundle_es.properties +0 -1
- package/dist/test-resources/pages/assets/messagebundle_fr.properties +0 -1
- package/dist/test-resources/pages/i18n.html +0 -33
- package/dist/test-resources/specs/ConfigurationChange.spec.js +0 -27
- package/dist/test-resources/specs/ConfigurationScript.spec.js +0 -63
- package/dist/test-resources/specs/ConfigurationURL.spec.js +0 -93
- package/dist/test-resources/specs/CustomTheme.spec.js +0 -27
- package/dist/test-resources/specs/EventProvider.spec.js +0 -63
- package/dist/test-resources/specs/StaticArea.spec.js +0 -78
- package/dist/test-resources/specs/Theming.spec.js +0 -33
- package/dist/test-resources/specs/UI5ElementInvalidation.js +0 -242
- package/dist/test-resources/specs/UI5ElementLifecycle.js +0 -98
- package/dist/test-resources/specs/UI5ElementListenForChildPropChanges.spec.js +0 -75
- package/dist/test-resources/specs/UI5ElementMetadataExt.js +0 -42
- package/dist/test-resources/specs/UI5ElementPropertyValidation.js +0 -14
- package/dist/test-resources/specs/UI5ElementPropsAndAttrs.spec.js +0 -67
- package/dist/test-resources/specs/UI5ElementShadowDOM.js +0 -24
- package/dist/test-resources/specs/UI5ElementSlots.js +0 -36
- package/dist/types/PopupState.js +0 -37
- package/dist/util/encodeCSS.js +0 -24
- 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 -9
- package/dist/util/isNodeTabbable.js +0 -28
- package/dist/util/setToArray.js +0 -10
- package/hash.txt +0 -1
- package/package-scripts.js +0 -65
- package/src/AssetRegistry.js +0 -11
- package/src/Boot.js +0 -43
- package/src/CustomElementsRegistry.js +0 -39
- package/src/CustomElementsScope.js +0 -108
- package/src/DOMObserver.js +0 -65
- package/src/Device.js +0 -107
- package/src/EventProvider.js +0 -85
- package/src/FeaturesRegistry.js +0 -11
- package/src/FontFace.js +0 -30
- package/src/InitialConfiguration.js +0 -166
- package/src/Keys.js +0 -248
- package/src/ManagedStyles.js +0 -83
- package/src/MediaRange.js +0 -109
- package/src/PropertiesFileFormat.js +0 -95
- package/src/Render.js +0 -175
- package/src/RenderQueue.js +0 -66
- package/src/RenderScheduler.js +0 -44
- package/src/StaticArea.js +0 -3
- package/src/StaticAreaItem.js +0 -98
- package/src/SystemCSSVars.js +0 -10
- package/src/UI5Element.js +0 -1018
- package/src/UI5ElementMetadata.js +0 -319
- 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 -139
- package/src/asset-registries/Illustrations.js +0 -30
- package/src/asset-registries/LocaleData.js +0 -159
- package/src/asset-registries/Themes.js +0 -78
- package/src/asset-registries/i18n.js +0 -121
- package/src/assets-meta/IconCollectionsAlias.js +0 -18
- package/src/config/AnimationMode.js +0 -23
- package/src/config/CalendarType.js +0 -18
- package/src/config/FormatSettings.js +0 -13
- package/src/config/Language.js +0 -68
- package/src/config/NoConflict.js +0 -51
- package/src/config/RTL.js +0 -31
- package/src/config/Theme.js +0 -42
- package/src/delegate/ItemNavigation.js +0 -351
- package/src/delegate/ResizeHandler.js +0 -106
- package/src/delegate/ScrollEnablement.js +0 -188
- package/src/features/OpenUI5Support.js +0 -125
- package/src/getSharedResource.js +0 -30
- package/src/i18nBundle.js +0 -86
- package/src/isLegacyBrowser.js +0 -3
- package/src/locale/Locale.js +0 -91
- package/src/locale/RTLAwareRegistry.js +0 -14
- package/src/locale/applyDirection.js +0 -17
- package/src/locale/directionChange.js +0 -32
- package/src/locale/getEffectiveDir.js +0 -28
- package/src/locale/getLocale.js +0 -41
- package/src/locale/languageChange.js +0 -22
- package/src/locale/nextFallbackLocale.js +0 -28
- package/src/locale/normalizeLocale.js +0 -54
- package/src/renderer/LitRenderer.js +0 -34
- package/src/renderer/executeTemplate.js +0 -17
- package/src/theming/CustomStyle.js +0 -40
- package/src/theming/ThemeLoaded.js +0 -22
- package/src/theming/applyTheme.js +0 -75
- package/src/theming/getConstructableStyle.js +0 -30
- package/src/theming/getEffectiveLinksHrefs.js +0 -20
- package/src/theming/getEffectiveStyle.js +0 -30
- package/src/theming/getStylesString.js +0 -15
- package/src/theming/getThemeDesignerTheme.js +0 -68
- package/src/theming/preloadLinks.js +0 -23
- package/src/thirdparty/_merge.js +0 -32
- package/src/thirdparty/isPlainObject.js +0 -18
- package/src/thirdparty/merge.js +0 -10
- package/src/types/AnimationMode.js +0 -7
- package/src/types/CSSColor.js +0 -9
- package/src/types/CSSSize.js +0 -9
- package/src/types/CalendarType.js +0 -22
- package/src/types/DataType.js +0 -37
- package/src/types/Float.js +0 -14
- package/src/types/Integer.js +0 -13
- package/src/types/InvisibleMessageMode.js +0 -30
- package/src/types/ItemNavigationBehavior.js +0 -16
- package/src/types/NavigationMode.js +0 -7
- package/src/types/PopupState.js +0 -37
- package/src/types/ValueState.js +0 -22
- package/src/updateShadowRoot.js +0 -30
- package/src/util/AriaLabelHelper.js +0 -41
- package/src/util/Caret.js +0 -45
- package/src/util/ColorConversion.js +0 -370
- package/src/util/FetchHelper.js +0 -31
- package/src/util/FocusableElements.js +0 -77
- package/src/util/InvisibleMessage.js +0 -58
- package/src/util/PopupUtils.js +0 -93
- package/src/util/SlotsHelper.js +0 -43
- package/src/util/StringHelper.js +0 -26
- package/src/util/TabbableElements.js +0 -47
- package/src/util/arraysAreEqual.js +0 -15
- package/src/util/createLinkInHead.js +0 -19
- package/src/util/createStyleInHead.js +0 -18
- package/src/util/debounce.js +0 -17
- package/src/util/detectNavigatorLanguage.js +0 -13
- package/src/util/encodeCSS.js +0 -24
- package/src/util/findNodeOwner.js +0 -35
- package/src/util/formatMessage.js +0 -23
- package/src/util/getActiveElement.js +0 -11
- package/src/util/getClassCopy.js +0 -10
- package/src/util/getDesigntimePropertyAsArray.js +0 -4
- package/src/util/getEffectiveContentDensity.js +0 -5
- package/src/util/getSingletonElementInstance.js +0 -13
- package/src/util/isDescendantOf.js +0 -15
- package/src/util/isElementInView.js +0 -15
- package/src/util/isNodeClickable.js +0 -19
- package/src/util/isNodeHidden.js +0 -9
- package/src/util/isNodeTabbable.js +0 -28
- package/src/util/isValidPropertyName.js +0 -29
- package/src/util/setToArray.js +0 -10
- package/src/util/whenDOMReady.js +0 -13
- /package/{config/.eslintrc.js → .eslintrc.cjs} +0 -0
|
@@ -1,95 +1,85 @@
|
|
|
1
|
-
const flatstr = typeof chrome === "object" || typeof v8 === "object" ? (s, iConcatOps) => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} : s => s;
|
|
7
|
-
|
|
1
|
+
const flatstr = typeof window.chrome === "object" || typeof window.v8 === "object" ? (s, iConcatOps) => {
|
|
2
|
+
if (iConcatOps > 2 && 40 * iConcatOps > s.length) {
|
|
3
|
+
Number(s);
|
|
4
|
+
}
|
|
5
|
+
return s;
|
|
6
|
+
} : (s) => s;
|
|
8
7
|
const rLines = /(?:\r\n|\r|\n|^)[ \t\f]*/;
|
|
9
8
|
const rEscapesOrSeparator = /(\\u[0-9a-fA-F]{0,4})|(\\.)|(\\$)|([ \t\f]*[ \t\f:=][ \t\f]*)/g;
|
|
10
9
|
const rEscapes = /(\\u[0-9a-fA-F]{0,4})|(\\.)|(\\$)/g;
|
|
11
10
|
const mEscapes = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
"\\f": "\f",
|
|
12
|
+
"\\n": "\n",
|
|
13
|
+
"\\r": "\r",
|
|
14
|
+
"\\t": "\t",
|
|
16
15
|
};
|
|
17
|
-
|
|
18
16
|
/**
|
|
19
17
|
* Parses a .properties format
|
|
20
18
|
* @param {string} sText the contents a of a .properties file
|
|
21
19
|
* @returns a object with key/value pairs parsed from the .properties file format
|
|
22
20
|
* @public
|
|
23
21
|
*/
|
|
24
|
-
const parseProperties = sText => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (sKey == null) {
|
|
86
|
-
sKey = sValue;
|
|
87
|
-
sValue = "";
|
|
88
|
-
}
|
|
89
|
-
properties[sKey] = flatstr(sValue, sValue ? iConcatOps : 0);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return properties;
|
|
22
|
+
const parseProperties = (sText) => {
|
|
23
|
+
const properties = {}, aLines = sText.split(rLines);
|
|
24
|
+
let sLine, rMatcher, sKey, sValue, i, m, iLastIndex, iConcatOps;
|
|
25
|
+
const append = (s) => {
|
|
26
|
+
if (sValue) {
|
|
27
|
+
sValue = `${sValue}${s}`;
|
|
28
|
+
iConcatOps++;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
sValue = s;
|
|
32
|
+
iConcatOps = 0;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
for (i = 0; i < aLines.length; i++) {
|
|
36
|
+
sLine = aLines[i];
|
|
37
|
+
const skipLine = sLine === "" || sLine.charAt(0) === "#" || sLine.charAt(0) === "!";
|
|
38
|
+
if (!skipLine) {
|
|
39
|
+
rMatcher = rEscapesOrSeparator;
|
|
40
|
+
iLastIndex = 0;
|
|
41
|
+
rMatcher.lastIndex = iLastIndex;
|
|
42
|
+
sKey = null;
|
|
43
|
+
sValue = "";
|
|
44
|
+
m = rMatcher.exec(sLine);
|
|
45
|
+
while (m !== null) {
|
|
46
|
+
if (iLastIndex < m.index) {
|
|
47
|
+
append(sLine.slice(iLastIndex, m.index));
|
|
48
|
+
}
|
|
49
|
+
iLastIndex = rMatcher.lastIndex;
|
|
50
|
+
if (m[1]) {
|
|
51
|
+
if (m[1].length !== 6) {
|
|
52
|
+
throw new Error(`Incomplete Unicode Escape '${m[1]}'`);
|
|
53
|
+
}
|
|
54
|
+
append(String.fromCharCode(parseInt(m[1].slice(2), 16)));
|
|
55
|
+
}
|
|
56
|
+
else if (m[2]) {
|
|
57
|
+
append(mEscapes[m[2]] || m[2].slice(1));
|
|
58
|
+
}
|
|
59
|
+
else if (m[3]) {
|
|
60
|
+
sLine = aLines[++i];
|
|
61
|
+
iLastIndex = 0;
|
|
62
|
+
rMatcher.lastIndex = iLastIndex;
|
|
63
|
+
}
|
|
64
|
+
else if (m[4]) {
|
|
65
|
+
sKey = sValue;
|
|
66
|
+
sValue = "";
|
|
67
|
+
rMatcher = rEscapes;
|
|
68
|
+
rMatcher.lastIndex = iLastIndex;
|
|
69
|
+
}
|
|
70
|
+
m = rMatcher.exec(sLine);
|
|
71
|
+
}
|
|
72
|
+
if (iLastIndex < sLine.length) {
|
|
73
|
+
append(sLine.slice(iLastIndex));
|
|
74
|
+
}
|
|
75
|
+
if (sKey == null) {
|
|
76
|
+
sKey = sValue;
|
|
77
|
+
sValue = "";
|
|
78
|
+
}
|
|
79
|
+
properties[sKey] = flatstr(sValue, sValue ? iConcatOps : 0);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return properties;
|
|
93
83
|
};
|
|
94
|
-
|
|
95
84
|
export default parseProperties;
|
|
85
|
+
//# sourceMappingURL=PropertiesFileFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertiesFileFormat.js","s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AAC,CAAC,CAAC,CAAC,CAAC;iBACjE;qBAAM,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;oBAChB,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;oBACpB,UAAU,GAAG,CAAC,CAAC;oBACf,QAAQ,CAAC,SAAS,GAAG,UAAU,CAAC;iBAChC;qBAAM,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;oBAChB,IAAI,GAAG,MAAM,CAAC;oBACd,MAAM,GAAG,EAAE,CAAC;oBACZ,QAAQ,GAAG,QAAQ,CAAC;oBACpB,QAAQ,CAAC,SAAS,GAAG,UAAU,CAAC;iBAChC;gBACD,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACzB;YACD,IAAI,UAAU,GAAG,KAAK,CAAC,MAAM,EAAE;gBAC9B,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;aAChC;YACD,IAAI,IAAI,IAAI,IAAI,EAAE;gBACjB,IAAI,GAAG,MAAM,CAAC;gBACd,MAAM,GAAG,EAAE,CAAC;aACZ;YACA,UAAkC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,UAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACtF;KACD;IACD,OAAO,UAAU,CAAC;AACnB,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["const flatstr = typeof window.chrome === \"object\" || typeof window.v8 === \"object\" ? (s: string, iConcatOps: number) => {\n\tif (iConcatOps > 2 && 40 * iConcatOps > s.length) {\n\t\tNumber(s);\n\t}\n\treturn s;\n} : (s: string) => s;\n\nconst rLines = /(?:\\r\\n|\\r|\\n|^)[ \\t\\f]*/;\nconst rEscapesOrSeparator = /(\\\\u[0-9a-fA-F]{0,4})|(\\\\.)|(\\\\$)|([ \\t\\f]*[ \\t\\f:=][ \\t\\f]*)/g;\nconst rEscapes = /(\\\\u[0-9a-fA-F]{0,4})|(\\\\.)|(\\\\$)/g;\nconst mEscapes = {\n\t\"\\\\f\": \"\\f\",\n\t\"\\\\n\": \"\\n\",\n\t\"\\\\r\": \"\\r\",\n\t\"\\\\t\": \"\\t\",\n};\n\n/**\n * Parses a .properties format\n * @param {string} sText the contents a of a .properties file\n * @returns a object with key/value pairs parsed from the .properties file format\n * @public\n */\nconst parseProperties = (sText: string) => {\n\tconst properties = {},\n\t\taLines = sText.split(rLines);\n\n\tlet sLine,\n\t\trMatcher,\n\t\tsKey,\n\t\tsValue: string,\n\t\ti,\n\t\tm,\n\t\tiLastIndex,\n\t\tiConcatOps: number;\n\n\tconst append = (s: string) => {\n\t\tif (sValue) {\n\t\t\tsValue = `${sValue}${s}`;\n\t\t\tiConcatOps++;\n\t\t} else {\n\t\t\tsValue = s;\n\t\t\tiConcatOps = 0;\n\t\t}\n\t};\n\n\tfor (i = 0; i < aLines.length; i++) {\n\t\tsLine = aLines[i];\n\t\tconst skipLine = sLine === \"\" || sLine.charAt(0) === \"#\" || sLine.charAt(0) === \"!\";\n\n\t\tif (!skipLine) {\n\t\t\trMatcher = rEscapesOrSeparator;\n\t\t\tiLastIndex = 0;\n\t\t\trMatcher.lastIndex = iLastIndex;\n\t\t\tsKey = null;\n\t\t\tsValue = \"\";\n\t\t\tm = rMatcher.exec(sLine);\n\t\t\twhile (m !== null) {\n\t\t\t\tif (iLastIndex < m.index) {\n\t\t\t\t\tappend(sLine.slice(iLastIndex, m.index));\n\t\t\t\t}\n\t\t\t\tiLastIndex = rMatcher.lastIndex;\n\t\t\t\tif (m[1]) {\n\t\t\t\t\tif (m[1].length !== 6) {\n\t\t\t\t\t\tthrow new Error(`Incomplete Unicode Escape '${m[1]}'`);\n\t\t\t\t\t}\n\t\t\t\t\tappend(String.fromCharCode(parseInt(m[1].slice(2), 16)));\n\t\t\t\t} else if (m[2]) {\n\t\t\t\t\tappend(mEscapes[m[2] as keyof typeof mEscapes] || m[2].slice(1));\n\t\t\t\t} else if (m[3]) {\n\t\t\t\t\tsLine = aLines[++i];\n\t\t\t\t\tiLastIndex = 0;\n\t\t\t\t\trMatcher.lastIndex = iLastIndex;\n\t\t\t\t} else if (m[4]) {\n\t\t\t\t\tsKey = sValue;\n\t\t\t\t\tsValue = \"\";\n\t\t\t\t\trMatcher = rEscapes;\n\t\t\t\t\trMatcher.lastIndex = iLastIndex;\n\t\t\t\t}\n\t\t\t\tm = rMatcher.exec(sLine);\n\t\t\t}\n\t\t\tif (iLastIndex < sLine.length) {\n\t\t\t\tappend(sLine.slice(iLastIndex));\n\t\t\t}\n\t\t\tif (sKey == null) {\n\t\t\t\tsKey = sValue;\n\t\t\t\tsValue = \"\";\n\t\t\t}\n\t\t\t(properties as Record<string, any>)[sKey] = flatstr(sValue, sValue ? iConcatOps! : 0);\n\t\t}\n\t}\n\treturn properties;\n};\n\nexport default parseProperties;\n"]}
|
package/dist/Render.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type UI5Element from "./UI5Element.js";
|
|
2
|
+
type BeforeComponentRenderCallback = (webComponent: UI5Element) => void;
|
|
3
|
+
/**
|
|
4
|
+
* Schedules a render task (if not already scheduled) to render the component
|
|
5
|
+
*
|
|
6
|
+
* @param webComponent
|
|
7
|
+
* @returns {Promise}
|
|
8
|
+
*/
|
|
9
|
+
declare const renderDeferred: (webComponent: UI5Element) => Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Renders a component synchronously and adds it to the registry of rendered components
|
|
12
|
+
*
|
|
13
|
+
* @param webComponent
|
|
14
|
+
*/
|
|
15
|
+
declare const renderImmediately: (webComponent: UI5Element) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Cancels the rendering of a component, if awaiting to be rendered, and removes it from the registry of rendered components
|
|
18
|
+
*
|
|
19
|
+
* @param webComponent
|
|
20
|
+
*/
|
|
21
|
+
declare const cancelRender: (webComponent: UI5Element) => void;
|
|
22
|
+
declare const renderFinished: () => Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Re-renders all UI5 Elements on the page, with the option to specify filters to rerender only some components.
|
|
25
|
+
*
|
|
26
|
+
* Usage:
|
|
27
|
+
* reRenderAllUI5Elements() -> re-renders all components
|
|
28
|
+
* reRenderAllUI5Elements({tag: "ui5-button"}) -> re-renders only instances of ui5-button
|
|
29
|
+
* reRenderAllUI5Elements({rtlAware: true}) -> re-renders only rtlAware components
|
|
30
|
+
* reRenderAllUI5Elements({languageAware: true}) -> re-renders only languageAware components
|
|
31
|
+
* reRenderAllUI5Elements({themeAware: true}) -> re-renders only themeAware components
|
|
32
|
+
* reRenderAllUI5Elements({rtlAware: true, languageAware: true}) -> re-renders components that are rtlAware or languageAware
|
|
33
|
+
* etc...
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
36
|
+
* @param {object|undefined} filters - Object with keys that can be "rtlAware" or "languageAware"
|
|
37
|
+
* @returns {Promise<void>}
|
|
38
|
+
*/
|
|
39
|
+
declare const reRenderAllUI5Elements: (filters?: {
|
|
40
|
+
tag?: string;
|
|
41
|
+
rtlAware?: boolean;
|
|
42
|
+
languageAware?: boolean;
|
|
43
|
+
themeAware?: boolean;
|
|
44
|
+
}) => Promise<void>;
|
|
45
|
+
declare const attachBeforeComponentRender: (listener: BeforeComponentRenderCallback) => void;
|
|
46
|
+
declare const detachBeforeComponentRender: (listener: BeforeComponentRenderCallback) => void;
|
|
47
|
+
export { renderDeferred, renderImmediately, cancelRender, renderFinished, reRenderAllUI5Elements, attachBeforeComponentRender, detachBeforeComponentRender, };
|
package/dist/Render.js
CHANGED
|
@@ -2,131 +2,108 @@ import EventProvider from "./EventProvider.js";
|
|
|
2
2
|
import RenderQueue from "./RenderQueue.js";
|
|
3
3
|
import { getAllRegisteredTags } from "./CustomElementsRegistry.js";
|
|
4
4
|
import { isRtlAware } from "./locale/RTLAwareRegistry.js";
|
|
5
|
-
|
|
6
5
|
const registeredElements = new Set();
|
|
7
6
|
const eventProvider = new EventProvider();
|
|
8
|
-
|
|
9
7
|
const invalidatedWebComponents = new RenderQueue(); // Queue for invalidated web components
|
|
10
|
-
|
|
11
|
-
let renderTaskPromise,
|
|
12
|
-
renderTaskPromiseResolve;
|
|
13
|
-
|
|
8
|
+
let renderTaskPromise, renderTaskPromiseResolve;
|
|
14
9
|
let mutationObserverTimer;
|
|
15
|
-
|
|
16
10
|
let queuePromise;
|
|
17
|
-
|
|
18
11
|
/**
|
|
19
12
|
* Schedules a render task (if not already scheduled) to render the component
|
|
20
13
|
*
|
|
21
14
|
* @param webComponent
|
|
22
15
|
* @returns {Promise}
|
|
23
16
|
*/
|
|
24
|
-
const renderDeferred = async webComponent => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
await scheduleRenderTask();
|
|
17
|
+
const renderDeferred = async (webComponent) => {
|
|
18
|
+
// Enqueue the web component
|
|
19
|
+
invalidatedWebComponents.add(webComponent);
|
|
20
|
+
// Schedule a rendering task
|
|
21
|
+
await scheduleRenderTask();
|
|
30
22
|
};
|
|
31
|
-
|
|
32
23
|
/**
|
|
33
24
|
* Renders a component synchronously and adds it to the registry of rendered components
|
|
34
25
|
*
|
|
35
26
|
* @param webComponent
|
|
36
27
|
*/
|
|
37
|
-
const renderImmediately = webComponent => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
const renderImmediately = (webComponent) => {
|
|
29
|
+
eventProvider.fireEvent("beforeComponentRender", webComponent);
|
|
30
|
+
registeredElements.add(webComponent);
|
|
31
|
+
webComponent._render();
|
|
41
32
|
};
|
|
42
|
-
|
|
43
33
|
/**
|
|
44
34
|
* Cancels the rendering of a component, if awaiting to be rendered, and removes it from the registry of rendered components
|
|
45
35
|
*
|
|
46
36
|
* @param webComponent
|
|
47
37
|
*/
|
|
48
|
-
const cancelRender = webComponent => {
|
|
49
|
-
|
|
50
|
-
|
|
38
|
+
const cancelRender = (webComponent) => {
|
|
39
|
+
invalidatedWebComponents.remove(webComponent);
|
|
40
|
+
registeredElements.delete(webComponent);
|
|
51
41
|
};
|
|
52
|
-
|
|
53
42
|
/**
|
|
54
43
|
* Schedules a rendering task, if not scheduled already
|
|
55
44
|
*/
|
|
56
45
|
const scheduleRenderTask = async () => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
await queuePromise;
|
|
46
|
+
if (!queuePromise) {
|
|
47
|
+
queuePromise = new Promise(resolve => {
|
|
48
|
+
window.requestAnimationFrame(() => {
|
|
49
|
+
// Render all components in the queue
|
|
50
|
+
// console.log(`--------------------RENDER TASK START------------------------------`); // eslint-disable-line
|
|
51
|
+
invalidatedWebComponents.process(renderImmediately);
|
|
52
|
+
// console.log(`--------------------RENDER TASK END------------------------------`); // eslint-disable-line
|
|
53
|
+
// Resolve the promise so that callers of renderDeferred can continue
|
|
54
|
+
queuePromise = null;
|
|
55
|
+
resolve();
|
|
56
|
+
// Wait for Mutation observer before the render task is considered finished
|
|
57
|
+
if (!mutationObserverTimer) {
|
|
58
|
+
mutationObserverTimer = setTimeout(() => {
|
|
59
|
+
mutationObserverTimer = undefined;
|
|
60
|
+
if (invalidatedWebComponents.isEmpty()) {
|
|
61
|
+
_resolveTaskPromise();
|
|
62
|
+
}
|
|
63
|
+
}, 200);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
await queuePromise;
|
|
84
69
|
};
|
|
85
|
-
|
|
86
70
|
/**
|
|
87
71
|
* return a promise that will be resolved once all invalidated web components are rendered
|
|
88
72
|
*/
|
|
89
73
|
const whenDOMUpdated = () => {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
return renderTaskPromise;
|
|
74
|
+
if (renderTaskPromise) {
|
|
75
|
+
return renderTaskPromise;
|
|
76
|
+
}
|
|
77
|
+
renderTaskPromise = new Promise(resolve => {
|
|
78
|
+
renderTaskPromiseResolve = resolve;
|
|
79
|
+
window.requestAnimationFrame(() => {
|
|
80
|
+
if (invalidatedWebComponents.isEmpty()) {
|
|
81
|
+
renderTaskPromise = undefined;
|
|
82
|
+
resolve();
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
return renderTaskPromise;
|
|
105
87
|
};
|
|
106
|
-
|
|
107
88
|
const whenAllCustomElementsAreDefined = () => {
|
|
108
|
-
|
|
109
|
-
|
|
89
|
+
const definedPromises = getAllRegisteredTags().map(tag => customElements.whenDefined(tag));
|
|
90
|
+
return Promise.all(definedPromises);
|
|
110
91
|
};
|
|
111
|
-
|
|
112
92
|
const renderFinished = async () => {
|
|
113
|
-
|
|
114
|
-
|
|
93
|
+
await whenAllCustomElementsAreDefined();
|
|
94
|
+
await whenDOMUpdated();
|
|
115
95
|
};
|
|
116
|
-
|
|
117
96
|
const _resolveTaskPromise = () => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
97
|
+
if (!invalidatedWebComponents.isEmpty()) {
|
|
98
|
+
// More updates are pending. Resolve will be called again
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (renderTaskPromiseResolve) {
|
|
102
|
+
renderTaskPromiseResolve();
|
|
103
|
+
renderTaskPromiseResolve = undefined;
|
|
104
|
+
renderTaskPromise = undefined;
|
|
105
|
+
}
|
|
128
106
|
};
|
|
129
|
-
|
|
130
107
|
/**
|
|
131
108
|
* Re-renders all UI5 Elements on the page, with the option to specify filters to rerender only some components.
|
|
132
109
|
*
|
|
@@ -140,36 +117,27 @@ const _resolveTaskPromise = () => {
|
|
|
140
117
|
* etc...
|
|
141
118
|
*
|
|
142
119
|
* @public
|
|
143
|
-
* @param {
|
|
120
|
+
* @param {object|undefined} filters - Object with keys that can be "rtlAware" or "languageAware"
|
|
144
121
|
* @returns {Promise<void>}
|
|
145
122
|
*/
|
|
146
|
-
const reRenderAllUI5Elements = async filters => {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
123
|
+
const reRenderAllUI5Elements = async (filters) => {
|
|
124
|
+
registeredElements.forEach((element) => {
|
|
125
|
+
const ctor = element.constructor;
|
|
126
|
+
const tag = ctor.getMetadata().getTag();
|
|
127
|
+
const rtlAware = isRtlAware(ctor);
|
|
128
|
+
const languageAware = ctor.getMetadata().isLanguageAware();
|
|
129
|
+
const themeAware = ctor.getMetadata().isThemeAware();
|
|
130
|
+
if (!filters || (filters.tag === tag) || (filters.rtlAware && rtlAware) || (filters.languageAware && languageAware) || (filters.themeAware && themeAware)) {
|
|
131
|
+
renderDeferred(element);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
await renderFinished();
|
|
157
135
|
};
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
eventProvider.attachEvent("beforeComponentRender", listener);
|
|
136
|
+
const attachBeforeComponentRender = (listener) => {
|
|
137
|
+
eventProvider.attachEvent("beforeComponentRender", listener);
|
|
161
138
|
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
eventProvider.detachEvent("beforeComponentRender", listener);
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
export {
|
|
168
|
-
renderDeferred,
|
|
169
|
-
renderImmediately,
|
|
170
|
-
cancelRender,
|
|
171
|
-
renderFinished,
|
|
172
|
-
reRenderAllUI5Elements,
|
|
173
|
-
attachBeforeComponentRender,
|
|
174
|
-
detachBeforeComponentRender,
|
|
139
|
+
const detachBeforeComponentRender = (listener) => {
|
|
140
|
+
eventProvider.detachEvent("beforeComponentRender", listener);
|
|
175
141
|
};
|
|
142
|
+
export { renderDeferred, renderImmediately, cancelRender, renderFinished, reRenderAllUI5Elements, attachBeforeComponentRender, detachBeforeComponentRender, };
|
|
143
|
+
//# sourceMappingURL=Render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Render.js","sourceRoot":"","sources":["../src/Render.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAM1D,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAc,CAAC;AACjD,MAAM,aAAa,GAAG,IAAI,aAAa,EAAoB,CAAC;AAE5D,MAAM,wBAAwB,GAAG,IAAI,WAAW,EAAE,CAAC,CAAC,uCAAuC;AAE3F,IAAI,iBAA4C,EAC/C,wBAAoD,CAAC;AAEtD,IAAI,qBAA0C,CAAC;AAE/C,IAAI,YAAkC,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,cAAc,GAAG,KAAK,EAAE,YAAwB,EAAE,EAAE;IACzD,4BAA4B;IAC5B,wBAAwB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAE3C,4BAA4B;IAC5B,MAAM,kBAAkB,EAAE,CAAC;AAC5B,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,CAAC,YAAwB,EAAE,EAAE;IACtD,aAAa,CAAC,SAAS,CAAC,uBAAuB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CAAC,eAAe,EAAE,CAAC;QAC3D,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,YAAY,EAAE,CAAC;QACrD,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,UAAU,CAAC,EAAE;YAC1J,cAAc,CAAC,OAAO,CAAC,CAAC;SACxB;IACF,CAAC,CAAC,CAAC;IACH,MAAM,cAAc,EAAE,CAAC;AACxB,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,CAAC,QAAuC,EAAE,EAAE;IAC/E,aAAa,CAAC,WAAW,CAAC,uBAAuB,EAAE,QAAQ,CAAC,CAAC;AAC9D,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,CAAC,QAAuC,EAAE,EAAE;IAC/E,aAAa,CAAC,WAAW,CAAC,uBAAuB,EAAE,QAAQ,CAAC,CAAC;AAC9D,CAAC,CAAC;AAEF,OAAO,EACN,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,GAC3B,CAAC","sourcesContent":["import EventProvider from \"./EventProvider.js\";\nimport RenderQueue from \"./RenderQueue.js\";\nimport { getAllRegisteredTags } from \"./CustomElementsRegistry.js\";\nimport { isRtlAware } from \"./locale/RTLAwareRegistry.js\";\nimport type UI5Element from \"./UI5Element.js\";\nimport { PromiseResolve, Timeout } from \"./types.js\";\n\ntype BeforeComponentRenderCallback = (webComponent: UI5Element) => void;\n\nconst registeredElements = new Set<UI5Element>();\nconst eventProvider = new EventProvider<UI5Element, void>();\n\nconst invalidatedWebComponents = new RenderQueue(); // Queue for invalidated web components\n\nlet renderTaskPromise: Promise<void> | undefined,\n\trenderTaskPromiseResolve: PromiseResolve | undefined;\n\nlet mutationObserverTimer: Timeout | undefined;\n\nlet queuePromise: Promise<void> | null;\n\n/**\n * Schedules a render task (if not already scheduled) to render the component\n *\n * @param webComponent\n * @returns {Promise}\n */\nconst renderDeferred = async (webComponent: UI5Element) => {\n\t// Enqueue the web component\n\tinvalidatedWebComponents.add(webComponent);\n\n\t// Schedule a rendering task\n\tawait scheduleRenderTask();\n};\n\n/**\n * Renders a component synchronously and adds it to the registry of rendered components\n *\n * @param webComponent\n */\nconst renderImmediately = (webComponent: UI5Element) => {\n\teventProvider.fireEvent(\"beforeComponentRender\", webComponent);\n\tregisteredElements.add(webComponent);\n\twebComponent._render();\n};\n\n/**\n * Cancels the rendering of a component, if awaiting to be rendered, and removes it from the registry of rendered components\n *\n * @param webComponent\n */\nconst cancelRender = (webComponent: UI5Element) => {\n\tinvalidatedWebComponents.remove(webComponent);\n\tregisteredElements.delete(webComponent);\n};\n\n/**\n * Schedules a rendering task, if not scheduled already\n */\nconst scheduleRenderTask = async () => {\n\tif (!queuePromise) {\n\t\tqueuePromise = new Promise<void>(resolve => {\n\t\t\twindow.requestAnimationFrame(() => {\n\t\t\t\t// Render all components in the queue\n\n\t\t\t\t// console.log(`--------------------RENDER TASK START------------------------------`); // eslint-disable-line\n\t\t\t\tinvalidatedWebComponents.process(renderImmediately);\n\t\t\t\t// console.log(`--------------------RENDER TASK END------------------------------`); // eslint-disable-line\n\n\t\t\t\t// Resolve the promise so that callers of renderDeferred can continue\n\t\t\t\tqueuePromise = null;\n\t\t\t\tresolve();\n\n\t\t\t\t// Wait for Mutation observer before the render task is considered finished\n\t\t\t\tif (!mutationObserverTimer) {\n\t\t\t\t\tmutationObserverTimer = setTimeout(() => {\n\t\t\t\t\t\tmutationObserverTimer = undefined;\n\t\t\t\t\t\tif (invalidatedWebComponents.isEmpty()) {\n\t\t\t\t\t\t\t_resolveTaskPromise();\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 200);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tawait queuePromise;\n};\n\n/**\n * return a promise that will be resolved once all invalidated web components are rendered\n */\nconst whenDOMUpdated = () => {\n\tif (renderTaskPromise) {\n\t\treturn renderTaskPromise;\n\t}\n\n\trenderTaskPromise = new Promise<void>(resolve => {\n\t\trenderTaskPromiseResolve = resolve;\n\t\twindow.requestAnimationFrame(() => {\n\t\t\tif (invalidatedWebComponents.isEmpty()) {\n\t\t\t\trenderTaskPromise = undefined;\n\t\t\t\tresolve();\n\t\t\t}\n\t\t});\n\t});\n\n\treturn renderTaskPromise;\n};\n\nconst whenAllCustomElementsAreDefined = () => {\n\tconst definedPromises = getAllRegisteredTags().map(tag => customElements.whenDefined(tag));\n\treturn Promise.all(definedPromises);\n};\n\nconst renderFinished = async () => {\n\tawait whenAllCustomElementsAreDefined();\n\tawait whenDOMUpdated();\n};\n\nconst _resolveTaskPromise = () => {\n\tif (!invalidatedWebComponents.isEmpty()) {\n\t\t// More updates are pending. Resolve will be called again\n\t\treturn;\n\t}\n\n\tif (renderTaskPromiseResolve) {\n\t\trenderTaskPromiseResolve();\n\t\trenderTaskPromiseResolve = undefined;\n\t\trenderTaskPromise = undefined;\n\t}\n};\n\n/**\n * Re-renders all UI5 Elements on the page, with the option to specify filters to rerender only some components.\n *\n * Usage:\n * reRenderAllUI5Elements() -> re-renders all components\n * reRenderAllUI5Elements({tag: \"ui5-button\"}) -> re-renders only instances of ui5-button\n * reRenderAllUI5Elements({rtlAware: true}) -> re-renders only rtlAware components\n * reRenderAllUI5Elements({languageAware: true}) -> re-renders only languageAware components\n * reRenderAllUI5Elements({themeAware: true}) -> re-renders only themeAware components\n * reRenderAllUI5Elements({rtlAware: true, languageAware: true}) -> re-renders components that are rtlAware or languageAware\n * etc...\n *\n * @public\n * @param {object|undefined} filters - Object with keys that can be \"rtlAware\" or \"languageAware\"\n * @returns {Promise<void>}\n */\nconst reRenderAllUI5Elements = async (filters?: {tag?: string, rtlAware?: boolean, languageAware?: boolean, themeAware?: boolean}) => {\n\tregisteredElements.forEach((element: UI5Element) => {\n\t\tconst ctor = element.constructor as typeof UI5Element;\n\t\tconst tag = ctor.getMetadata().getTag();\n\t\tconst rtlAware = isRtlAware(ctor);\n\t\tconst languageAware = ctor.getMetadata().isLanguageAware();\n\t\tconst themeAware = ctor.getMetadata().isThemeAware();\n\t\tif (!filters || (filters.tag === tag) || (filters.rtlAware && rtlAware) || (filters.languageAware && languageAware) || (filters.themeAware && themeAware)) {\n\t\t\trenderDeferred(element);\n\t\t}\n\t});\n\tawait renderFinished();\n};\n\nconst attachBeforeComponentRender = (listener: BeforeComponentRenderCallback) => {\n\teventProvider.attachEvent(\"beforeComponentRender\", listener);\n};\n\nconst detachBeforeComponentRender = (listener: BeforeComponentRenderCallback) => {\n\teventProvider.detachEvent(\"beforeComponentRender\", listener);\n};\n\nexport {\n\trenderDeferred,\n\trenderImmediately,\n\tcancelRender,\n\trenderFinished,\n\treRenderAllUI5Elements,\n\tattachBeforeComponentRender,\n\tdetachBeforeComponentRender,\n};\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type UI5Element from "./UI5Element.js";
|
|
2
|
+
declare class RenderQueue {
|
|
3
|
+
list: Array<UI5Element>;
|
|
4
|
+
lookup: Set<UI5Element>;
|
|
5
|
+
constructor();
|
|
6
|
+
add(webComponent: UI5Element): void;
|
|
7
|
+
remove(webComponent: UI5Element): void;
|
|
8
|
+
shift(): UI5Element | undefined;
|
|
9
|
+
isEmpty(): boolean;
|
|
10
|
+
isAdded(webComponent: UI5Element): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Processes the whole queue by executing the callback on each component,
|
|
13
|
+
* while also imposing restrictions on how many times a component may be processed.
|
|
14
|
+
*
|
|
15
|
+
* @param callback - function with one argument (the web component to be processed)
|
|
16
|
+
*/
|
|
17
|
+
process(callback: (el: UI5Element) => void): void;
|
|
18
|
+
}
|
|
19
|
+
export default RenderQueue;
|
package/dist/RenderQueue.js
CHANGED
|
@@ -1,66 +1,56 @@
|
|
|
1
1
|
const MAX_PROCESS_COUNT = 10;
|
|
2
|
-
|
|
3
2
|
class RenderQueue {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const timesProcessed = stats.get(webComponent) || 0;
|
|
56
|
-
if (timesProcessed > MAX_PROCESS_COUNT) {
|
|
57
|
-
throw new Error(`Web component processed too many times this task, max allowed is: ${MAX_PROCESS_COUNT}`);
|
|
58
|
-
}
|
|
59
|
-
callback(webComponent);
|
|
60
|
-
stats.set(webComponent, timesProcessed + 1);
|
|
61
|
-
webComponent = this.shift();
|
|
62
|
-
}
|
|
63
|
-
}
|
|
3
|
+
constructor() {
|
|
4
|
+
this.list = []; // Used to store the web components in order
|
|
5
|
+
this.lookup = new Set(); // Used for faster search
|
|
6
|
+
}
|
|
7
|
+
add(webComponent) {
|
|
8
|
+
if (this.lookup.has(webComponent)) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
this.list.push(webComponent);
|
|
12
|
+
this.lookup.add(webComponent);
|
|
13
|
+
}
|
|
14
|
+
remove(webComponent) {
|
|
15
|
+
if (!this.lookup.has(webComponent)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
this.list = this.list.filter(item => item !== webComponent);
|
|
19
|
+
this.lookup.delete(webComponent);
|
|
20
|
+
}
|
|
21
|
+
shift() {
|
|
22
|
+
const webComponent = this.list.shift();
|
|
23
|
+
if (webComponent) {
|
|
24
|
+
this.lookup.delete(webComponent);
|
|
25
|
+
return webComponent;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
isEmpty() {
|
|
29
|
+
return this.list.length === 0;
|
|
30
|
+
}
|
|
31
|
+
isAdded(webComponent) {
|
|
32
|
+
return this.lookup.has(webComponent);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Processes the whole queue by executing the callback on each component,
|
|
36
|
+
* while also imposing restrictions on how many times a component may be processed.
|
|
37
|
+
*
|
|
38
|
+
* @param callback - function with one argument (the web component to be processed)
|
|
39
|
+
*/
|
|
40
|
+
process(callback) {
|
|
41
|
+
let webComponent;
|
|
42
|
+
const stats = new Map();
|
|
43
|
+
webComponent = this.shift();
|
|
44
|
+
while (webComponent) {
|
|
45
|
+
const timesProcessed = stats.get(webComponent) || 0;
|
|
46
|
+
if (timesProcessed > MAX_PROCESS_COUNT) {
|
|
47
|
+
throw new Error(`Web component processed too many times this task, max allowed is: ${MAX_PROCESS_COUNT}`);
|
|
48
|
+
}
|
|
49
|
+
callback(webComponent);
|
|
50
|
+
stats.set(webComponent, timesProcessed + 1);
|
|
51
|
+
webComponent = this.shift();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
64
54
|
}
|
|
65
|
-
|
|
66
55
|
export default RenderQueue;
|
|
56
|
+
//# sourceMappingURL=RenderQueue.js.map
|