@ui5/webcomponents-base 2.0.0-rc.2 → 2.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +179 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/Boot.js +3 -4
- package/dist/Boot.js.map +1 -1
- package/dist/Keys.d.ts +2 -1
- package/dist/Keys.js +2 -1
- package/dist/Keys.js.map +1 -1
- package/dist/UI5Element.d.ts +9 -1
- package/dist/UI5Element.js +73 -12
- package/dist/UI5Element.js.map +1 -1
- package/dist/UI5ElementMetadata.d.ts +5 -0
- package/dist/UI5ElementMetadata.js +6 -0
- package/dist/UI5ElementMetadata.js.map +1 -1
- package/dist/asset-registries/Icons.js +1 -1
- package/dist/asset-registries/Icons.js.map +1 -1
- package/dist/asset-registries/util/getIconCollectionByTheme.d.ts +3 -3
- package/dist/asset-registries/util/getIconCollectionByTheme.js +3 -3
- package/dist/asset-registries/util/getIconCollectionByTheme.js.map +1 -1
- package/dist/config/AnimationMode.js +2 -1
- package/dist/config/AnimationMode.js.map +1 -1
- package/dist/config/Theme.d.ts +3 -2
- package/dist/config/Theme.js +7 -3
- package/dist/config/Theme.js.map +1 -1
- package/dist/custom-elements-internal.json +186 -21
- package/dist/custom-elements.json +81 -15
- package/dist/decorators/customElement.d.ts +1 -0
- package/dist/decorators/customElement.js +5 -2
- package/dist/decorators/customElement.js.map +1 -1
- package/dist/features/InputElementsFormSupport.d.ts +18 -0
- package/dist/features/InputElementsFormSupport.js +40 -0
- package/dist/features/InputElementsFormSupport.js.map +1 -0
- package/dist/features/OpenUI5Support.js +8 -2
- package/dist/features/OpenUI5Support.js.map +1 -1
- 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 +14 -0
- package/dist/features/patchPopup.js +50 -0
- package/dist/features/patchPopup.js.map +1 -0
- package/dist/generated/AssetParameters.js +1 -1
- package/dist/generated/AssetParameters.js.map +1 -1
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/prod/AssetRegistry.js +2 -0
- package/dist/prod/AssetRegistry.js.map +7 -0
- package/dist/prod/Boot.js +2 -0
- package/dist/prod/Boot.js.map +7 -0
- package/dist/prod/CustomElementsRegistry.js +10 -0
- package/dist/prod/CustomElementsRegistry.js.map +7 -0
- package/dist/prod/CustomElementsScope.js +2 -0
- package/dist/prod/CustomElementsScope.js.map +7 -0
- package/dist/prod/CustomElementsScopeUtils.js +2 -0
- package/dist/prod/CustomElementsScopeUtils.js.map +7 -0
- package/dist/prod/DOMObserver.js +2 -0
- package/dist/prod/DOMObserver.js.map +7 -0
- package/dist/prod/Device.js +2 -0
- package/dist/prod/Device.js.map +7 -0
- package/dist/prod/EventProvider.js +2 -0
- package/dist/prod/EventProvider.js.map +7 -0
- package/dist/prod/FeaturesRegistry.js +2 -0
- package/dist/prod/FeaturesRegistry.js.map +7 -0
- package/dist/prod/FontFace.js +2 -0
- package/dist/prod/FontFace.js.map +7 -0
- package/dist/prod/IgnoreCustomElements.js +2 -0
- package/dist/prod/IgnoreCustomElements.js.map +7 -0
- package/dist/prod/InitialConfiguration.js +2 -0
- package/dist/prod/InitialConfiguration.js.map +7 -0
- package/dist/prod/Keys.js +2 -0
- package/dist/prod/Keys.js.map +7 -0
- package/dist/prod/ManagedStyles.js +2 -0
- package/dist/prod/ManagedStyles.js.map +7 -0
- package/dist/prod/MarkedEvents.js +2 -0
- package/dist/prod/MarkedEvents.js.map +7 -0
- package/dist/prod/MediaRange.js +2 -0
- package/dist/prod/MediaRange.js.map +7 -0
- package/dist/prod/PropertiesFileFormat.js +3 -0
- package/dist/prod/PropertiesFileFormat.js.map +7 -0
- package/dist/prod/Render.js +2 -0
- package/dist/prod/Render.js.map +7 -0
- package/dist/prod/RenderQueue.js +2 -0
- package/dist/prod/RenderQueue.js.map +7 -0
- package/dist/prod/Runtimes.js +2 -0
- package/dist/prod/Runtimes.js.map +7 -0
- package/dist/prod/SystemCSSVars.js +2 -0
- package/dist/prod/SystemCSSVars.js.map +7 -0
- package/dist/prod/Theming.js +2 -0
- package/dist/prod/Theming.js.map +7 -0
- package/dist/prod/UI5Element.js +2 -0
- package/dist/prod/UI5Element.js.map +7 -0
- package/dist/prod/UI5ElementMetadata.js +2 -0
- package/dist/prod/UI5ElementMetadata.js.map +7 -0
- package/dist/prod/animations/AnimationQueue.js +2 -0
- package/dist/prod/animations/AnimationQueue.js.map +7 -0
- package/dist/prod/animations/animate.js +2 -0
- package/dist/prod/animations/animate.js.map +7 -0
- package/dist/prod/animations/scroll.js +2 -0
- package/dist/prod/animations/scroll.js.map +7 -0
- package/dist/prod/animations/slideDown.js +2 -0
- package/dist/prod/animations/slideDown.js.map +7 -0
- package/dist/prod/animations/slideUp.js +2 -0
- package/dist/prod/animations/slideUp.js.map +7 -0
- package/dist/prod/asset-registries/Icons.js +2 -0
- package/dist/prod/asset-registries/Icons.js.map +7 -0
- package/dist/prod/asset-registries/Illustrations.js +2 -0
- package/dist/prod/asset-registries/Illustrations.js.map +7 -0
- package/dist/prod/asset-registries/LocaleData.js +2 -0
- package/dist/prod/asset-registries/LocaleData.js.map +7 -0
- package/dist/prod/asset-registries/Themes.js +2 -0
- package/dist/prod/asset-registries/Themes.js.map +7 -0
- package/dist/prod/asset-registries/i18n.js +2 -0
- package/dist/prod/asset-registries/i18n.js.map +7 -0
- package/dist/prod/asset-registries/util/IconCollectionsAlias.js +2 -0
- package/dist/prod/asset-registries/util/IconCollectionsAlias.js.map +7 -0
- package/dist/prod/asset-registries/util/IconCollectionsByTheme.js +2 -0
- package/dist/prod/asset-registries/util/IconCollectionsByTheme.js.map +7 -0
- package/dist/prod/asset-registries/util/getIconCollectionByTheme.js +2 -0
- package/dist/prod/asset-registries/util/getIconCollectionByTheme.js.map +7 -0
- package/dist/prod/config/AnimationMode.js +2 -0
- package/dist/prod/config/AnimationMode.js.map +7 -0
- package/dist/prod/config/CalendarType.js +2 -0
- package/dist/prod/config/CalendarType.js.map +7 -0
- package/dist/prod/config/FormatSettings.js +2 -0
- package/dist/prod/config/FormatSettings.js.map +7 -0
- package/dist/prod/config/Icons.js +2 -0
- package/dist/prod/config/Icons.js.map +7 -0
- package/dist/prod/config/Language.js +2 -0
- package/dist/prod/config/Language.js.map +7 -0
- package/dist/prod/config/NoConflict.js +2 -0
- package/dist/prod/config/NoConflict.js.map +7 -0
- package/dist/prod/config/Theme.js +2 -0
- package/dist/prod/config/Theme.js.map +7 -0
- package/dist/prod/config/ThemeRoot.js +2 -0
- package/dist/prod/config/ThemeRoot.js.map +7 -0
- package/dist/prod/config/Timezone.js +2 -0
- package/dist/prod/config/Timezone.js.map +7 -0
- package/dist/prod/connectToComponent.js +2 -0
- package/dist/prod/connectToComponent.js.map +7 -0
- package/dist/prod/decorators/customElement.js +2 -0
- package/dist/prod/decorators/customElement.js.map +7 -0
- package/dist/prod/decorators/event.js +2 -0
- package/dist/prod/decorators/event.js.map +7 -0
- package/dist/prod/decorators/property.js +2 -0
- package/dist/prod/decorators/property.js.map +7 -0
- package/dist/prod/decorators/slot.js +2 -0
- package/dist/prod/decorators/slot.js.map +7 -0
- package/dist/prod/decorators.js +2 -0
- package/dist/prod/decorators.js.map +7 -0
- package/dist/prod/delegate/ItemNavigation.js +2 -0
- package/dist/prod/delegate/ItemNavigation.js.map +7 -0
- package/dist/prod/delegate/ResizeHandler.js +2 -0
- package/dist/prod/delegate/ResizeHandler.js.map +7 -0
- package/dist/prod/delegate/ScrollEnablement.js +2 -0
- package/dist/prod/delegate/ScrollEnablement.js.map +7 -0
- package/dist/prod/features/F6Navigation.js +2 -0
- package/dist/prod/features/F6Navigation.js.map +7 -0
- package/dist/prod/features/InputElementsFormSupport.js +2 -0
- package/dist/prod/features/InputElementsFormSupport.js.map +7 -0
- package/dist/prod/features/LegacyDateFormats.js +2 -0
- package/dist/prod/features/LegacyDateFormats.js.map +7 -0
- package/dist/prod/features/OpenUI5Element.js +2 -0
- package/dist/prod/features/OpenUI5Element.js.map +7 -0
- package/dist/prod/features/OpenUI5Enablement.js +21 -0
- package/dist/prod/features/OpenUI5Enablement.js.map +7 -0
- package/dist/prod/features/OpenUI5Support.js +2 -0
- package/dist/prod/features/OpenUI5Support.js.map +7 -0
- package/dist/prod/features/patchPatcher.js +2 -0
- package/dist/prod/features/patchPatcher.js.map +7 -0
- package/dist/prod/features/patchPopup.js +2 -0
- package/dist/prod/features/patchPopup.js.map +7 -0
- package/dist/prod/generated/AssetParameters.js +2 -0
- package/dist/prod/generated/AssetParameters.js.map +7 -0
- package/dist/prod/generated/VersionInfo.js +2 -0
- package/dist/prod/generated/VersionInfo.js.map +7 -0
- package/dist/prod/generated/css/BusyIndicator.css.js +2 -0
- package/dist/prod/generated/css/BusyIndicator.css.js.map +7 -0
- package/dist/prod/generated/css/FontFace.css.js +2 -0
- package/dist/prod/generated/css/FontFace.css.js.map +7 -0
- package/dist/prod/generated/css/OverrideFontFace.css.js +2 -0
- package/dist/prod/generated/css/OverrideFontFace.css.js.map +7 -0
- package/dist/prod/generated/css/SystemCSSVars.css.js +2 -0
- package/dist/prod/generated/css/SystemCSSVars.css.js.map +7 -0
- package/dist/prod/generated/templates/elements/WithComplexTemplateTemplate.lit.js +2 -0
- package/dist/prod/generated/templates/elements/WithComplexTemplateTemplate.lit.js.map +7 -0
- package/dist/prod/getSharedResource.js +2 -0
- package/dist/prod/getSharedResource.js.map +7 -0
- package/dist/prod/global.d.js +2 -0
- package/dist/prod/global.d.js.map +7 -0
- package/dist/prod/i18nBundle.js +2 -0
- package/dist/prod/i18nBundle.js.map +7 -0
- package/dist/prod/locale/Locale.js +2 -0
- package/dist/prod/locale/Locale.js.map +7 -0
- package/dist/prod/locale/RTLAwareRegistry.js +2 -0
- package/dist/prod/locale/RTLAwareRegistry.js.map +7 -0
- package/dist/prod/locale/applyDirection.js +2 -0
- package/dist/prod/locale/applyDirection.js.map +7 -0
- package/dist/prod/locale/directionChange.js +2 -0
- package/dist/prod/locale/directionChange.js.map +7 -0
- package/dist/prod/locale/getEffectiveDir.js +2 -0
- package/dist/prod/locale/getEffectiveDir.js.map +7 -0
- package/dist/prod/locale/getLocale.js +2 -0
- package/dist/prod/locale/getLocale.js.map +7 -0
- package/dist/prod/locale/languageChange.js +2 -0
- package/dist/prod/locale/languageChange.js.map +7 -0
- package/dist/prod/locale/nextFallbackLocale.js +2 -0
- package/dist/prod/locale/nextFallbackLocale.js.map +7 -0
- package/dist/prod/locale/normalizeLocale.js +2 -0
- package/dist/prod/locale/normalizeLocale.js.map +7 -0
- package/dist/prod/renderer/LitRenderer.js +2 -0
- package/dist/prod/renderer/LitRenderer.js.map +7 -0
- package/dist/prod/renderer/directives/style-map.js +6 -0
- package/dist/prod/renderer/directives/style-map.js.map +7 -0
- package/dist/prod/renderer/executeTemplate.js +2 -0
- package/dist/prod/renderer/executeTemplate.js.map +7 -0
- package/dist/prod/sap/base/Log.js +750 -0
- package/dist/prod/sap/base/assert.js +34 -0
- package/dist/prod/sap/base/config/MemoryConfigurationProvider.js +20 -0
- package/dist/prod/sap/base/security/URLListValidator.js +406 -0
- package/dist/prod/sap/base/security/encodeCSS.js +40 -0
- package/dist/prod/sap/base/security/encodeXML.js +53 -0
- package/dist/prod/sap/base/security/sanitizeHTML.js +38 -0
- package/dist/prod/sap/base/strings/toHex.js +33 -0
- package/dist/prod/sap/base/util/now.js +28 -0
- package/dist/prod/sap/base/util/uid.js +27 -0
- package/dist/prod/sap/ui/thirdparty/caja-html-sanitizer.js +3600 -0
- package/dist/prod/ssr-dom-shim.js +2 -0
- package/dist/prod/ssr-dom-shim.js.map +7 -0
- package/dist/prod/ssr-dom.js +2 -0
- package/dist/prod/ssr-dom.js.map +7 -0
- package/dist/prod/theming/CustomStyle.js +2 -0
- package/dist/prod/theming/CustomStyle.js.map +7 -0
- package/dist/prod/theming/ThemeLoaded.js +2 -0
- package/dist/prod/theming/ThemeLoaded.js.map +7 -0
- package/dist/prod/theming/ThemeRegistered.js +2 -0
- package/dist/prod/theming/ThemeRegistered.js.map +7 -0
- package/dist/prod/theming/applyTheme.js +2 -0
- package/dist/prod/theming/applyTheme.js.map +7 -0
- package/dist/prod/theming/getConstructableStyle.js +2 -0
- package/dist/prod/theming/getConstructableStyle.js.map +7 -0
- package/dist/prod/theming/getEffectiveStyle.js +2 -0
- package/dist/prod/theming/getEffectiveStyle.js.map +7 -0
- package/dist/prod/theming/getStylesString.js +2 -0
- package/dist/prod/theming/getStylesString.js.map +7 -0
- package/dist/prod/theming/getThemeDesignerTheme.js +2 -0
- package/dist/prod/theming/getThemeDesignerTheme.js.map +7 -0
- package/dist/prod/thirdparty/_merge.js +2 -0
- package/dist/prod/thirdparty/_merge.js.map +7 -0
- package/dist/prod/thirdparty/isPlainObject.js +2 -0
- package/dist/prod/thirdparty/isPlainObject.js.map +7 -0
- package/dist/prod/thirdparty/merge.js +2 -0
- package/dist/prod/thirdparty/merge.js.map +7 -0
- package/dist/prod/types/AnimationMode.js +2 -0
- package/dist/prod/types/AnimationMode.js.map +7 -0
- package/dist/prod/types/AriaHasPopup.js +2 -0
- package/dist/prod/types/AriaHasPopup.js.map +7 -0
- package/dist/prod/types/AriaLandmarkRole.js +2 -0
- package/dist/prod/types/AriaLandmarkRole.js.map +7 -0
- package/dist/prod/types/AriaRole.js +2 -0
- package/dist/prod/types/AriaRole.js.map +7 -0
- package/dist/prod/types/CSSColor.js +2 -0
- package/dist/prod/types/CSSColor.js.map +7 -0
- package/dist/prod/types/CSSSize.js +2 -0
- package/dist/prod/types/CSSSize.js.map +7 -0
- package/dist/prod/types/CalendarType.js +2 -0
- package/dist/prod/types/CalendarType.js.map +7 -0
- package/dist/prod/types/DOMReference.js +2 -0
- package/dist/prod/types/DOMReference.js.map +7 -0
- package/dist/prod/types/DataType.js +2 -0
- package/dist/prod/types/DataType.js.map +7 -0
- package/dist/prod/types/Float.js +2 -0
- package/dist/prod/types/Float.js.map +7 -0
- package/dist/prod/types/Integer.js +2 -0
- package/dist/prod/types/Integer.js.map +7 -0
- package/dist/prod/types/InvisibleMessageMode.js +2 -0
- package/dist/prod/types/InvisibleMessageMode.js.map +7 -0
- package/dist/prod/types/ItemNavigationBehavior.js +2 -0
- package/dist/prod/types/ItemNavigationBehavior.js.map +7 -0
- package/dist/prod/types/MovePlacement.js +2 -0
- package/dist/prod/types/MovePlacement.js.map +7 -0
- package/dist/prod/types/NavigationMode.js +2 -0
- package/dist/prod/types/NavigationMode.js.map +7 -0
- package/dist/prod/types/Orientation.js +2 -0
- package/dist/prod/types/Orientation.js.map +7 -0
- package/dist/prod/types/ValueState.js +2 -0
- package/dist/prod/types/ValueState.js.map +7 -0
- package/dist/prod/types.js +2 -0
- package/dist/prod/types.js.map +7 -0
- package/dist/prod/updateShadowRoot.js +2 -0
- package/dist/prod/updateShadowRoot.js.map +7 -0
- package/dist/prod/util/AriaLabelHelper.js +2 -0
- package/dist/prod/util/AriaLabelHelper.js.map +7 -0
- package/dist/prod/util/Caret.js +2 -0
- package/dist/prod/util/Caret.js.map +7 -0
- package/dist/prod/util/ColorConversion.js +2 -0
- package/dist/prod/util/ColorConversion.js.map +7 -0
- package/dist/prod/util/FetchHelper.js +2 -0
- package/dist/prod/util/FetchHelper.js.map +7 -0
- package/dist/prod/util/FocusableElements.js +2 -0
- package/dist/prod/util/FocusableElements.js.map +7 -0
- package/dist/prod/util/HTMLSanitizer.js +2 -0
- package/dist/prod/util/HTMLSanitizer.js.map +7 -0
- package/dist/prod/util/InvisibleMessage.js +2 -0
- package/dist/prod/util/InvisibleMessage.js.map +7 -0
- package/dist/prod/util/PopupUtils.js +2 -0
- package/dist/prod/util/PopupUtils.js.map +7 -0
- package/dist/prod/util/SlotsHelper.js +2 -0
- package/dist/prod/util/SlotsHelper.js.map +7 -0
- package/dist/prod/util/StringHelper.js +2 -0
- package/dist/prod/util/StringHelper.js.map +7 -0
- package/dist/prod/util/TabbableElements.js +2 -0
- package/dist/prod/util/TabbableElements.js.map +7 -0
- package/dist/prod/util/arraysAreEqual.js +2 -0
- package/dist/prod/util/arraysAreEqual.js.map +7 -0
- package/dist/prod/util/clamp.js +2 -0
- package/dist/prod/util/clamp.js.map +7 -0
- package/dist/prod/util/createLinkInHead.js +2 -0
- package/dist/prod/util/createLinkInHead.js.map +7 -0
- package/dist/prod/util/debounce.js +2 -0
- package/dist/prod/util/debounce.js.map +7 -0
- package/dist/prod/util/detectNavigatorLanguage.js +2 -0
- package/dist/prod/util/detectNavigatorLanguage.js.map +7 -0
- package/dist/prod/util/dragAndDrop/DragRegistry.js +2 -0
- package/dist/prod/util/dragAndDrop/DragRegistry.js.map +7 -0
- package/dist/prod/util/dragAndDrop/findClosestPosition.js +2 -0
- package/dist/prod/util/dragAndDrop/findClosestPosition.js.map +7 -0
- package/dist/prod/util/dragAndDrop/longDragOverHandler.js +2 -0
- package/dist/prod/util/dragAndDrop/longDragOverHandler.js.map +7 -0
- package/dist/prod/util/escapeRegex.js +2 -0
- package/dist/prod/util/escapeRegex.js.map +7 -0
- package/dist/prod/util/formatMessage.js +2 -0
- package/dist/prod/util/formatMessage.js.map +7 -0
- package/dist/prod/util/generateHighlightedMarkup.js +2 -0
- package/dist/prod/util/generateHighlightedMarkup.js.map +7 -0
- package/dist/prod/util/getActiveElement.js +2 -0
- package/dist/prod/util/getActiveElement.js.map +7 -0
- package/dist/prod/util/getClassCopy.js +2 -0
- package/dist/prod/util/getClassCopy.js.map +7 -0
- package/dist/prod/util/getDesigntimePropertyAsArray.js +2 -0
- package/dist/prod/util/getDesigntimePropertyAsArray.js.map +7 -0
- package/dist/prod/util/getEffectiveContentDensity.js +2 -0
- package/dist/prod/util/getEffectiveContentDensity.js.map +7 -0
- package/dist/prod/util/getEffectiveScrollbarStyle.js +2 -0
- package/dist/prod/util/getEffectiveScrollbarStyle.js.map +7 -0
- package/dist/prod/util/getFastNavigationGroups.js +2 -0
- package/dist/prod/util/getFastNavigationGroups.js.map +7 -0
- package/dist/prod/util/getFileExtension.js +2 -0
- package/dist/prod/util/getFileExtension.js.map +7 -0
- package/dist/prod/util/getNormalizedTarget.js +2 -0
- package/dist/prod/util/getNormalizedTarget.js.map +7 -0
- package/dist/prod/util/getParentElement.js +2 -0
- package/dist/prod/util/getParentElement.js.map +7 -0
- package/dist/prod/util/getSingletonElementInstance.js +2 -0
- package/dist/prod/util/getSingletonElementInstance.js.map +7 -0
- package/dist/prod/util/isElementClickable.js +2 -0
- package/dist/prod/util/isElementClickable.js.map +7 -0
- package/dist/prod/util/isElementContainingBlock.js +2 -0
- package/dist/prod/util/isElementContainingBlock.js.map +7 -0
- package/dist/prod/util/isElementHidden.js +2 -0
- package/dist/prod/util/isElementHidden.js.map +7 -0
- package/dist/prod/util/isElementInView.js +2 -0
- package/dist/prod/util/isElementInView.js.map +7 -0
- package/dist/prod/util/isElementTabbable.js +2 -0
- package/dist/prod/util/isElementTabbable.js.map +7 -0
- package/dist/prod/util/isValidPropertyName.js +2 -0
- package/dist/prod/util/isValidPropertyName.js.map +7 -0
- package/dist/prod/util/whenDOMReady.js +2 -0
- package/dist/prod/util/whenDOMReady.js.map +7 -0
- package/dist/prod/util/willShowContent.js +2 -0
- package/dist/prod/util/willShowContent.js.map +7 -0
- package/dist/prod/validateThemeRoot.js +2 -0
- package/dist/prod/validateThemeRoot.js.map +7 -0
- package/dist/renderer/executeTemplate.d.ts +8 -0
- package/dist/renderer/executeTemplate.js +1 -0
- package/dist/renderer/executeTemplate.js.map +1 -1
- package/dist/types/AriaHasPopup.d.ts +32 -0
- package/dist/types/AriaHasPopup.js +34 -0
- package/dist/types/AriaHasPopup.js.map +1 -0
- package/dist/types/AriaLandmarkRole.d.ts +79 -0
- package/dist/types/AriaLandmarkRole.js +81 -0
- package/dist/types/AriaLandmarkRole.js.map +1 -0
- package/dist/types/AriaRole.d.ts +27 -0
- package/dist/types/AriaRole.js +29 -0
- package/dist/types/AriaRole.js.map +1 -0
- package/dist/types/ValueState.d.ts +3 -3
- package/dist/types/ValueState.js +3 -3
- package/dist/types/ValueState.js.map +1 -1
- package/dist/types.d.ts +15 -2
- package/dist/types.js.map +1 -1
- package/dist/util/InvisibleMessage.js +2 -2
- package/dist/util/InvisibleMessage.js.map +1 -1
- package/dist/util/getClassCopy.d.ts +9 -1
- package/package-scripts.cjs +5 -0
- package/package.json +11 -5
- package/.eslintignore +0 -17
- package/.eslintrc.cjs +0 -3
- package/bundle.esm.js +0 -65
- package/dist/StaticArea.d.ts +0 -3
- package/dist/StaticArea.js +0 -7
- package/dist/StaticArea.js.map +0 -1
- package/lib/generate-asset-parameters/index.js +0 -27
- package/lib/generate-styles/index.js +0 -31
- package/lib/generate-version-info/index.js +0 -32
- package/used-modules.txt +0 -14
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/animations/slideDown.ts"],
|
|
4
|
+
"sourcesContent": ["import animate, { duration } from \"./animate.js\";\n\nconst slideDown = (element: HTMLElement) => {\n\tlet computedStyles: CSSStyleDeclaration,\n\t\tpaddingTop: number,\n\t\tpaddingBottom: number,\n\t\tmarginTop: number,\n\t\tmarginBottom: number,\n\t\theight: number;\n\tlet storedOverflow: string,\n\t\tstoredPaddingTop: string,\n\t\tstoredPaddingBottom: string,\n\t\tstoredMarginTop: string,\n\t\tstoredMarginBottom: string,\n\t\tstoredHeight: string;\n\n\tconst animation = animate({\n\t\tbeforeStart: () => {\n\t\t\t// Show the element to measure its properties\n\t\t\telement.style.display = \"block\";\n\n\t\t\t// Get Computed styles\n\t\t\tcomputedStyles = getComputedStyle(element);\n\t\t\tpaddingTop = parseFloat(computedStyles.paddingTop);\n\t\t\tpaddingBottom = parseFloat(computedStyles.paddingBottom);\n\t\t\tmarginTop = parseFloat(computedStyles.marginTop);\n\t\t\tmarginBottom = parseFloat(computedStyles.marginBottom);\n\t\t\theight = parseFloat(computedStyles.height);\n\n\t\t\t// Store inline styles\n\t\t\tstoredOverflow = element.style.overflow;\n\t\t\tstoredPaddingTop = element.style.paddingTop;\n\t\t\tstoredPaddingBottom = element.style.paddingBottom;\n\t\t\tstoredMarginTop = element.style.marginTop;\n\t\t\tstoredMarginBottom = element.style.marginBottom;\n\t\t\tstoredHeight = element.style.height;\n\n\t\t\telement.style.overflow = \"hidden\";\n\t\t\telement.style.paddingTop = \"0\";\n\t\t\telement.style.paddingBottom = \"0\";\n\t\t\telement.style.marginTop = \"0\";\n\t\t\telement.style.marginBottom = \"0\";\n\t\t\telement.style.height = \"0\";\n\t\t},\n\t\tduration,\n\t\telement,\n\t\tadvance: progress => {\n\t\t\t// WORKAROUND\n\t\t\telement.style.display = \"block\";\n\t\t\t// END OF WORKAROUND\n\n\t\t\telement.style.paddingTop = `${(paddingTop * progress)}px`;\n\t\t\telement.style.paddingBottom = `${(paddingBottom * progress)}px`;\n\t\t\telement.style.marginTop = `${(marginTop * progress)}px`;\n\t\t\telement.style.marginBottom = `${(marginBottom * progress)}px`;\n\t\t\telement.style.height = `${(height * progress)}px`;\n\t\t},\n\t});\n\n\tanimation.promise().then(() => {\n\t\telement.style.overflow = storedOverflow;\n\t\telement.style.paddingTop = storedPaddingTop;\n\t\telement.style.paddingBottom = storedPaddingBottom;\n\t\telement.style.marginTop = storedMarginTop;\n\t\telement.style.marginBottom = storedMarginBottom;\n\t\telement.style.height = storedHeight;\n\t});\n\n\treturn animation;\n};\n\nexport default slideDown;\n"],
|
|
5
|
+
"mappings": "aAAA,OAAOA,GAAW,YAAAC,MAAgB,eAElC,MAAMC,EAAaC,GAAyB,CAC3C,IAAIC,EACHC,EACAC,EACAC,EACAC,EACAC,EACGC,EACHC,EACAC,EACAC,EACAC,EACAC,EAED,MAAMC,EAAYhB,EAAQ,CACzB,YAAa,IAAM,CAElBG,EAAQ,MAAM,QAAU,QAGxBC,EAAiB,iBAAiBD,CAAO,EACzCE,EAAa,WAAWD,EAAe,UAAU,EACjDE,EAAgB,WAAWF,EAAe,aAAa,EACvDG,EAAY,WAAWH,EAAe,SAAS,EAC/CI,EAAe,WAAWJ,EAAe,YAAY,EACrDK,EAAS,WAAWL,EAAe,MAAM,EAGzCM,EAAiBP,EAAQ,MAAM,SAC/BQ,EAAmBR,EAAQ,MAAM,WACjCS,EAAsBT,EAAQ,MAAM,cACpCU,EAAkBV,EAAQ,MAAM,UAChCW,EAAqBX,EAAQ,MAAM,aACnCY,EAAeZ,EAAQ,MAAM,OAE7BA,EAAQ,MAAM,SAAW,SACzBA,EAAQ,MAAM,WAAa,IAC3BA,EAAQ,MAAM,cAAgB,IAC9BA,EAAQ,MAAM,UAAY,IAC1BA,EAAQ,MAAM,aAAe,IAC7BA,EAAQ,MAAM,OAAS,GACxB,EACA,SAAAF,EACA,QAAAE,EACA,QAASc,GAAY,CAEpBd,EAAQ,MAAM,QAAU,QAGxBA,EAAQ,MAAM,WAAa,GAAIE,EAAaY,CAAS,KACrDd,EAAQ,MAAM,cAAgB,GAAIG,EAAgBW,CAAS,KAC3Dd,EAAQ,MAAM,UAAY,GAAII,EAAYU,CAAS,KACnDd,EAAQ,MAAM,aAAe,GAAIK,EAAeS,CAAS,KACzDd,EAAQ,MAAM,OAAS,GAAIM,EAASQ,CAAS,IAC9C,CACD,CAAC,EAED,OAAAD,EAAU,QAAQ,EAAE,KAAK,IAAM,CAC9Bb,EAAQ,MAAM,SAAWO,EACzBP,EAAQ,MAAM,WAAaQ,EAC3BR,EAAQ,MAAM,cAAgBS,EAC9BT,EAAQ,MAAM,UAAYU,EAC1BV,EAAQ,MAAM,aAAeW,EAC7BX,EAAQ,MAAM,OAASY,CACxB,CAAC,EAEMC,CACR,EAEA,eAAed",
|
|
6
|
+
"names": ["animate", "duration", "slideDown", "element", "computedStyles", "paddingTop", "paddingBottom", "marginTop", "marginBottom", "height", "storedOverflow", "storedPaddingTop", "storedPaddingBottom", "storedMarginTop", "storedMarginBottom", "storedHeight", "animation", "progress"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import T,{duration as B}from"./animate.js";const u=o=>{let i,a,r,d,n,s,p,g,e,l,y,m;const h=T({beforeStart:()=>{const t=o;i=getComputedStyle(t),a=parseFloat(i.paddingTop),r=parseFloat(i.paddingBottom),d=parseFloat(i.marginTop),n=parseFloat(i.marginBottom),s=parseFloat(i.height),p=t.style.overflow,g=t.style.paddingTop,e=t.style.paddingBottom,l=t.style.marginTop,y=t.style.marginBottom,m=t.style.height,t.style.overflow="hidden"},duration:B,element:o,advance:t=>{o.style.paddingTop=`${a-a*t}px`,o.style.paddingBottom=`${r-r*t}px`,o.style.marginTop=`${d-d*t}px`,o.style.marginBottom=`${n-n*t}px`,o.style.height=`${s-s*t}px`}});return h.promise().then(t=>{t instanceof Error||(o.style.overflow=p,o.style.paddingTop=g,o.style.paddingBottom=e,o.style.marginTop=l,o.style.marginBottom=y,o.style.height=m,o.style.display="none")}),h};export default u;
|
|
2
|
+
//# sourceMappingURL=slideUp.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/animations/slideUp.ts"],
|
|
4
|
+
"sourcesContent": ["import animate, { duration } from \"./animate.js\";\n\nconst slideUp = (element: HTMLElement) => {\n\t// Get Computed styles\n\tlet computedStyles: CSSStyleDeclaration,\n\t\tpaddingTop: number,\n\t\tpaddingBottom: number,\n\t\tmarginTop: number,\n\t\tmarginBottom: number,\n\t\theight: number;\n\n\t// Store inline styles\n\tlet storedOverflow: string,\n\t\tstoredPaddingTop: string,\n\t\tstoredPaddingBottom: string,\n\t\tstoredMarginTop: string,\n\t\tstoredMarginBottom: string,\n\t\tstoredHeight: string;\n\n\tconst animation = animate({\n\t\tbeforeStart: () => {\n\t\t\t// Get Computed styles\n\t\t\tconst el = element;\n\t\t\tcomputedStyles = getComputedStyle(el);\n\t\t\tpaddingTop = parseFloat(computedStyles.paddingTop);\n\t\t\tpaddingBottom = parseFloat(computedStyles.paddingBottom);\n\t\t\tmarginTop = parseFloat(computedStyles.marginTop);\n\t\t\tmarginBottom = parseFloat(computedStyles.marginBottom);\n\t\t\theight = parseFloat(computedStyles.height);\n\n\t\t\t// Store inline styles\n\t\t\tstoredOverflow = el.style.overflow;\n\t\t\tstoredPaddingTop = el.style.paddingTop;\n\t\t\tstoredPaddingBottom = el.style.paddingBottom;\n\t\t\tstoredMarginTop = el.style.marginTop;\n\t\t\tstoredMarginBottom = el.style.marginBottom;\n\t\t\tstoredHeight = el.style.height;\n\n\t\t\tel.style.overflow = \"hidden\";\n\t\t},\n\t\tduration,\n\t\telement,\n\t\tadvance: progress => {\n\t\t\telement.style.paddingTop = `${paddingTop - (paddingTop * progress)}px`;\n\t\t\telement.style.paddingBottom = `${paddingBottom - (paddingBottom * progress)}px`;\n\t\t\telement.style.marginTop = `${marginTop - (marginTop * progress)}px`;\n\t\t\telement.style.marginBottom = `${marginBottom - (marginBottom * progress)}px`;\n\t\t\telement.style.height = `${height - (height * progress)}px`;\n\t\t},\n\t});\n\n\tanimation.promise().then(reason => {\n\t\tif (!(reason instanceof Error)) {\n\t\t\telement.style.overflow = storedOverflow;\n\t\t\telement.style.paddingTop = storedPaddingTop;\n\t\t\telement.style.paddingBottom = storedPaddingBottom;\n\t\t\telement.style.marginTop = storedMarginTop;\n\t\t\telement.style.marginBottom = storedMarginBottom;\n\t\t\telement.style.height = storedHeight;\n\t\t\telement.style.display = \"none\";\n\t\t}\n\t});\n\n\treturn animation;\n};\n\nexport default slideUp;\n"],
|
|
5
|
+
"mappings": "aAAA,OAAOA,GAAW,YAAAC,MAAgB,eAElC,MAAMC,EAAWC,GAAyB,CAEzC,IAAIC,EACHC,EACAC,EACAC,EACAC,EACAC,EAGGC,EACHC,EACAC,EACAC,EACAC,EACAC,EAED,MAAMC,EAAYhB,EAAQ,CACzB,YAAa,IAAM,CAElB,MAAMiB,EAAKd,EACXC,EAAiB,iBAAiBa,CAAE,EACpCZ,EAAa,WAAWD,EAAe,UAAU,EACjDE,EAAgB,WAAWF,EAAe,aAAa,EACvDG,EAAY,WAAWH,EAAe,SAAS,EAC/CI,EAAe,WAAWJ,EAAe,YAAY,EACrDK,EAAS,WAAWL,EAAe,MAAM,EAGzCM,EAAiBO,EAAG,MAAM,SAC1BN,EAAmBM,EAAG,MAAM,WAC5BL,EAAsBK,EAAG,MAAM,cAC/BJ,EAAkBI,EAAG,MAAM,UAC3BH,EAAqBG,EAAG,MAAM,aAC9BF,EAAeE,EAAG,MAAM,OAExBA,EAAG,MAAM,SAAW,QACrB,EACA,SAAAhB,EACA,QAAAE,EACA,QAASe,GAAY,CACpBf,EAAQ,MAAM,WAAa,GAAGE,EAAcA,EAAaa,CAAS,KAClEf,EAAQ,MAAM,cAAgB,GAAGG,EAAiBA,EAAgBY,CAAS,KAC3Ef,EAAQ,MAAM,UAAY,GAAGI,EAAaA,EAAYW,CAAS,KAC/Df,EAAQ,MAAM,aAAe,GAAGK,EAAgBA,EAAeU,CAAS,KACxEf,EAAQ,MAAM,OAAS,GAAGM,EAAUA,EAASS,CAAS,IACvD,CACD,CAAC,EAED,OAAAF,EAAU,QAAQ,EAAE,KAAKG,GAAU,CAC5BA,aAAkB,QACvBhB,EAAQ,MAAM,SAAWO,EACzBP,EAAQ,MAAM,WAAaQ,EAC3BR,EAAQ,MAAM,cAAgBS,EAC9BT,EAAQ,MAAM,UAAYU,EAC1BV,EAAQ,MAAM,aAAeW,EAC7BX,EAAQ,MAAM,OAASY,EACvBZ,EAAQ,MAAM,QAAU,OAE1B,CAAC,EAEMa,CACR,EAEA,eAAed",
|
|
6
|
+
"names": ["animate", "duration", "slideUp", "element", "computedStyles", "paddingTop", "paddingBottom", "marginTop", "marginBottom", "height", "storedOverflow", "storedPaddingTop", "storedPaddingBottom", "storedMarginTop", "storedMarginBottom", "storedHeight", "animation", "el", "progress", "reason"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import y from"../getSharedResource.js";import{getIconCollectionByAlias as d}from"./util/IconCollectionsAlias.js";import{registerIconCollectionForTheme as h}from"./util/IconCollectionsByTheme.js";import m from"./util/getIconCollectionByTheme.js";import{getI18nBundle as C}from"../i18nBundle.js";const w="legacy",c=new Map,s=y("SVGIcons.registry",new Map),i=y("SVGIcons.promises",new Map),l="ICON_NOT_FOUND",T=(e,t)=>{c.set(e,t)},N=async e=>{if(!i.has(e)){if(!c.has(e))throw new Error(`No loader registered for the ${e} icons collection. Probably you forgot to import the "AllIcons.js" module for the respective package.`);const t=c.get(e);i.set(e,t(e))}return i.get(e)},I=e=>{Object.keys(e.data).forEach(t=>{const o=e.data[t];f(t,{pathData:o.path||o.paths,ltr:o.ltr,accData:o.acc,collection:e.collection,packageName:e.packageName})})},f=(e,t)=>{const o=`${t.collection}/${e}`;s.set(o,{pathData:t.pathData,ltr:t.ltr,accData:t.accData,packageName:t.packageName,customTemplate:t.customTemplate,viewBox:t.viewBox,collection:t.collection})},D=e=>{e.startsWith("sap-icon://")&&(e=e.replace("sap-icon://",""));let t;return[e,t]=e.split("/").reverse(),e=e.replace("icon-",""),t&&(t=d(t)),{name:e,collection:t}},u=e=>{const{name:t,collection:o}=D(e);return g(o,t)},n=async e=>{const{name:t,collection:o}=D(e);let r=l;try{r=await N(m(o))}catch(a){console.error(a.message)}if(r===l)return r;const p=g(o,t);return p||(Array.isArray(r)?r.forEach(a=>{I(a),h(o,{[a.themeFamily||w]:a.collection})}):I(r),g(o,t))},g=(e,t)=>{const o=`${m(e)}/${t}`;return s.get(o)},A=async e=>{if(!e)return;let t=u(e);if(t||(t=await n(e)),t&&t!==l&&t.accData)return(await C(t.packageName)).getText(t.accData)},k=async()=>(await n("edit"),await n("tnt/arrow"),await n("business-suite/3d"),Array.from(s.keys()));export{T as registerIconLoader,n as getIconData,u as getIconDataSync,A as getIconAccessibleName,f as registerIcon,k as _getRegisteredNames};
|
|
2
|
+
//# sourceMappingURL=Icons.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/asset-registries/Icons.ts"],
|
|
4
|
+
"sourcesContent": ["import getSharedResource from \"../getSharedResource.js\";\nimport { getIconCollectionByAlias } from \"./util/IconCollectionsAlias.js\";\nimport { registerIconCollectionForTheme } from \"./util/IconCollectionsByTheme.js\";\nimport getEffectiveIconCollection from \"./util/getIconCollectionByTheme.js\";\nimport { getI18nBundle } from \"../i18nBundle.js\";\nimport type { I18nText } from \"../i18nBundle.js\";\nimport type { TemplateFunction } from \"../renderer/executeTemplate.js\";\n\nconst DEFAULT_THEME_FAMILY = \"legacy\"; // includes sap_fiori_*\n\ntype IconLoader = (collectionName: string) => Promise<CollectionData | Array<CollectionData>>;\n\ntype CollectionData = {\n\tcollection: string,\n\tpackageName: string,\n\tthemeFamily?: \"legacy\" | \"sap_horizon\",\n\tversion?: string,\n\tdata: Record<string, {\n\t\tpath?: string,\n\t\tpaths?: Array<string>,\n\t\tltr?: boolean,\n\t\tacc?: I18nText,\n\t}>,\n};\n\ntype IconData = {\n\tcollection: string,\n\tpackageName: string,\n\tpathData: string | Array<string>,\n\tltr?: boolean,\n\taccData?: I18nText,\n\tcustomTemplate?: TemplateFunction,\n\tviewBox?: string,\n};\n\nconst loaders = new Map<string, IconLoader>();\nconst registry = getSharedResource<Map<string, IconData>>(\"SVGIcons.registry\", new Map());\nconst iconCollectionPromises = getSharedResource<Map<string, Promise<CollectionData| Array<CollectionData>>>>(\"SVGIcons.promises\", new Map());\n\nconst ICON_NOT_FOUND = \"ICON_NOT_FOUND\";\n\nconst registerIconLoader = (collectionName: string, loader: IconLoader) => {\n\tloaders.set(collectionName, loader);\n};\n\nconst _loadIconCollectionOnce = async (collectionName: string) => {\n\tif (!iconCollectionPromises.has(collectionName)) {\n\t\tif (!loaders.has(collectionName)) {\n\t\t\tthrow new Error(`No loader registered for the ${collectionName} icons collection. Probably you forgot to import the \"AllIcons.js\" module for the respective package.`);\n\t\t}\n\n\t\tconst loadIcons = loaders.get(collectionName)!;\n\t\ticonCollectionPromises.set(collectionName, loadIcons(collectionName));\n\t}\n\n\treturn iconCollectionPromises.get(collectionName);\n};\n\nconst _fillRegistry = (bundleData: CollectionData) => {\n\tObject.keys(bundleData.data).forEach(iconName => {\n\t\tconst iconData = bundleData.data[iconName];\n\n\t\tregisterIcon(iconName, {\n\t\t\tpathData: (iconData.path || iconData.paths)!,\n\t\t\tltr: iconData.ltr,\n\t\t\taccData: iconData.acc,\n\t\t\tcollection: bundleData.collection,\n\t\t\tpackageName: bundleData.packageName,\n\t\t});\n\t});\n};\n\n// set\nconst registerIcon = (name: string, iconData: IconData) => { // eslint-disable-line\n\tconst key = `${iconData.collection}/${name}`;\n\n\tregistry.set(key, {\n\t\tpathData: iconData.pathData,\n\t\tltr: iconData.ltr,\n\t\taccData: iconData.accData,\n\t\tpackageName: iconData.packageName,\n\t\tcustomTemplate: iconData.customTemplate,\n\t\tviewBox: iconData.viewBox,\n\t\tcollection: iconData.collection,\n\t});\n};\n\n/**\n * Processes the full icon name and splits it into - \"name\", \"collection\".\n * - removes legacy protocol (\"sap-icon://\")\n * - resolves aliases (f.e \"SAP-icons-TNT/actor\" => \"tnt/actor\")\n *\n * @param { string } name\n * @return { object }\n */\nconst processName = (name: string) => {\n\t// silently support ui5-compatible URIs\n\tif (name.startsWith(\"sap-icon://\")) {\n\t\tname = name.replace(\"sap-icon://\", \"\");\n\t}\n\n\tlet collection: string;\n\t[name, collection] = name.split(\"/\").reverse();\n\n\tname = name.replace(\"icon-\", \"\");\n\tif (collection) {\n\t\tcollection = getIconCollectionByAlias(collection);\n\t}\n\treturn { name, collection };\n};\n\nconst getIconDataSync = (iconName: string) => {\n\tconst { name, collection } = processName(iconName);\n\treturn getRegisteredIconData(collection, name);\n};\n\nconst getIconData = async (iconName: string) => {\n\tconst { name, collection } = processName(iconName);\n\n\tlet iconData: string | CollectionData | Array<CollectionData> = ICON_NOT_FOUND;\n\ttry {\n\t\ticonData = (await _loadIconCollectionOnce(getEffectiveIconCollection(collection)))!;\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tconsole.error(e.message); /* eslint-disable-line */\n\t}\n\n\tif (iconData === ICON_NOT_FOUND) {\n\t\treturn iconData;\n\t}\n\n\tconst registeredIconData = getRegisteredIconData(collection, name);\n\n\tif (registeredIconData) {\n\t\treturn registeredIconData;\n\t}\n\n\t// not filled by another await. many getters will await on the same loader, but fill only once\n\tif (Array.isArray(iconData)) {\n\t\ticonData.forEach(data => {\n\t\t\t_fillRegistry(data);\n\t\t\tregisterIconCollectionForTheme(collection, { [data.themeFamily || DEFAULT_THEME_FAMILY]: data.collection });\n\t\t});\n\t} else {\n\t\t_fillRegistry(iconData as CollectionData);\n\t}\n\n\treturn getRegisteredIconData(collection, name);\n};\n\nconst getRegisteredIconData = (collection: string, name: string) => {\n\tconst registryKey = `${getEffectiveIconCollection(collection)}/${name}`;\n\treturn registry.get(registryKey);\n};\n\n/**\n * Returns the accessible name for the given icon,\n * or undefined if accessible name is not present.\n *\n * @param { string } name\n * @return { Promise }\n */\nconst getIconAccessibleName = async (name: string): Promise<string | undefined> => {\n\tif (!name) {\n\t\treturn;\n\t}\n\n\tlet iconData: typeof ICON_NOT_FOUND | IconData | undefined = getIconDataSync(name);\n\n\tif (!iconData) {\n\t\ticonData = await getIconData(name);\n\t}\n\n\tif (iconData && iconData !== ICON_NOT_FOUND && iconData.accData) {\n\t\tconst i18nBundle = await getI18nBundle(iconData.packageName);\n\t\treturn i18nBundle.getText(iconData.accData);\n\t}\n};\n\n// test page usage only\nconst _getRegisteredNames = async () => {\n\t// fetch one icon of each collection to trigger the bundle load\n\tawait getIconData(\"edit\");\n\tawait getIconData(\"tnt/arrow\");\n\tawait getIconData(\"business-suite/3d\");\n\treturn Array.from(registry.keys());\n};\n\nexport {\n\tregisterIconLoader,\n\tgetIconData,\n\tgetIconDataSync,\n\tgetIconAccessibleName,\n\tregisterIcon,\n\t_getRegisteredNames,\n};\n\nexport type {\n\tIconData,\n\tCollectionData,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAOA,MAAuB,0BAC9B,OAAS,4BAAAC,MAAgC,iCACzC,OAAS,kCAAAC,MAAsC,mCAC/C,OAAOC,MAAgC,qCACvC,OAAS,iBAAAC,MAAqB,mBAI9B,MAAMC,EAAuB,SA2BvBC,EAAU,IAAI,IACdC,EAAWP,EAAyC,oBAAqB,IAAI,GAAK,EAClFQ,EAAyBR,EAA+E,oBAAqB,IAAI,GAAK,EAEtIS,EAAiB,iBAEjBC,EAAqB,CAACC,EAAwBC,IAAuB,CAC1EN,EAAQ,IAAIK,EAAgBC,CAAM,CACnC,EAEMC,EAA0B,MAAOF,GAA2B,CACjE,GAAI,CAACH,EAAuB,IAAIG,CAAc,EAAG,CAChD,GAAI,CAACL,EAAQ,IAAIK,CAAc,EAC9B,MAAM,IAAI,MAAM,gCAAgCA,CAAc,uGAAuG,EAGtK,MAAMG,EAAYR,EAAQ,IAAIK,CAAc,EAC5CH,EAAuB,IAAIG,EAAgBG,EAAUH,CAAc,CAAC,CACrE,CAEA,OAAOH,EAAuB,IAAIG,CAAc,CACjD,EAEMI,EAAiBC,GAA+B,CACrD,OAAO,KAAKA,EAAW,IAAI,EAAE,QAAQC,GAAY,CAChD,MAAMC,EAAWF,EAAW,KAAKC,CAAQ,EAEzCE,EAAaF,EAAU,CACtB,SAAWC,EAAS,MAAQA,EAAS,MACrC,IAAKA,EAAS,IACd,QAASA,EAAS,IAClB,WAAYF,EAAW,WACvB,YAAaA,EAAW,WACzB,CAAC,CACF,CAAC,CACF,EAGMG,EAAe,CAACC,EAAcF,IAAuB,CAC1D,MAAMG,EAAM,GAAGH,EAAS,UAAU,IAAIE,CAAI,GAE1Cb,EAAS,IAAIc,EAAK,CACjB,SAAUH,EAAS,SACnB,IAAKA,EAAS,IACd,QAASA,EAAS,QAClB,YAAaA,EAAS,YACtB,eAAgBA,EAAS,eACzB,QAASA,EAAS,QAClB,WAAYA,EAAS,UACtB,CAAC,CACF,EAUMI,EAAeF,GAAiB,CAEjCA,EAAK,WAAW,aAAa,IAChCA,EAAOA,EAAK,QAAQ,cAAe,EAAE,GAGtC,IAAIG,EACJ,OAACH,EAAMG,CAAU,EAAIH,EAAK,MAAM,GAAG,EAAE,QAAQ,EAE7CA,EAAOA,EAAK,QAAQ,QAAS,EAAE,EAC3BG,IACHA,EAAatB,EAAyBsB,CAAU,GAE1C,CAAE,KAAAH,EAAM,WAAAG,CAAW,CAC3B,EAEMC,EAAmBP,GAAqB,CAC7C,KAAM,CAAE,KAAAG,EAAM,WAAAG,CAAW,EAAID,EAAYL,CAAQ,EACjD,OAAOQ,EAAsBF,EAAYH,CAAI,CAC9C,EAEMM,EAAc,MAAOT,GAAqB,CAC/C,KAAM,CAAE,KAAAG,EAAM,WAAAG,CAAW,EAAID,EAAYL,CAAQ,EAEjD,IAAIC,EAA4DT,EAChE,GAAI,CACHS,EAAY,MAAML,EAAwBV,EAA2BoB,CAAU,CAAC,CACjF,OAASI,EAAgB,CAExB,QAAQ,MADEA,EACM,OAAO,CACxB,CAEA,GAAIT,IAAaT,EAChB,OAAOS,EAGR,MAAMU,EAAqBH,EAAsBF,EAAYH,CAAI,EAEjE,OAAIQ,IAKA,MAAM,QAAQV,CAAQ,EACzBA,EAAS,QAAQW,GAAQ,CACxBd,EAAcc,CAAI,EAClB3B,EAA+BqB,EAAY,CAAE,CAACM,EAAK,aAAexB,CAAoB,EAAGwB,EAAK,UAAW,CAAC,CAC3G,CAAC,EAEDd,EAAcG,CAA0B,EAGlCO,EAAsBF,EAAYH,CAAI,EAC9C,EAEMK,EAAwB,CAACF,EAAoBH,IAAiB,CACnE,MAAMU,EAAc,GAAG3B,EAA2BoB,CAAU,CAAC,IAAIH,CAAI,GACrE,OAAOb,EAAS,IAAIuB,CAAW,CAChC,EASMC,EAAwB,MAAOX,GAA8C,CAClF,GAAI,CAACA,EACJ,OAGD,IAAIF,EAAyDM,EAAgBJ,CAAI,EAMjF,GAJKF,IACJA,EAAW,MAAMQ,EAAYN,CAAI,GAG9BF,GAAYA,IAAaT,GAAkBS,EAAS,QAEvD,OADmB,MAAMd,EAAcc,EAAS,WAAW,GACzC,QAAQA,EAAS,OAAO,CAE5C,EAGMc,EAAsB,UAE3B,MAAMN,EAAY,MAAM,EACxB,MAAMA,EAAY,WAAW,EAC7B,MAAMA,EAAY,mBAAmB,EAC9B,MAAM,KAAKnB,EAAS,KAAK,CAAC,GAGlC,OACCG,KAAA,mBACAgB,KAAA,YACAF,KAAA,gBACAO,KAAA,sBACAZ,KAAA,aACAa,KAAA",
|
|
6
|
+
"names": ["getSharedResource", "getIconCollectionByAlias", "registerIconCollectionForTheme", "getEffectiveIconCollection", "getI18nBundle", "DEFAULT_THEME_FAMILY", "loaders", "registry", "iconCollectionPromises", "ICON_NOT_FOUND", "registerIconLoader", "collectionName", "loader", "_loadIconCollectionOnce", "loadIcons", "_fillRegistry", "bundleData", "iconName", "iconData", "registerIcon", "name", "key", "processName", "collection", "getIconDataSync", "getRegisteredIconData", "getIconData", "error", "registeredIconData", "data", "registryKey", "getIconAccessibleName", "_getRegisteredNames"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import c from"../getSharedResource.js";import{getTheme as p}from"../config/Theme.js";const u=new Map([["sap_horizon","V5"],["sap_horizon_dark","V5"],["sap_horizon_hcb","V5/HC"],["sap_horizon_hcw","V5/HC"]]),e="V4",i=new Map,l=c("SVGIllustration.registry",new Map),a=c("SVGIllustration.promises",new Map),I=()=>{const s=p();return u.has(s)?u.get(s):e},g=s=>{let t=I();const[o,r]=s.split("/");let n=`${o}/${t}/${r}`;return!i.has(n)&&t!==e&&(t=e,n=`${o}/${t}/${r}`),{registryKey:n,collection:t}},h=(s,t)=>{const o=t.collection||e;l.set(`${t.set}/${o}/${s}`,{dialogSvg:t.dialogSvg,sceneSvg:t.sceneSvg,spotSvg:t.spotSvg,dotSvg:t.dotSvg,title:t.title,subtitle:t.subtitle})},y=(s,t)=>{i.set(s,t)},m=s=>{const{registryKey:t}=g(s);if(!a.has(t)){if(!i.has(t)){const r=s.startsWith("fiori/")?s.replace("fiori/",""):s;throw new Error(`No loader registered for the ${s} illustration. Probably you forgot to import the "@ui5/webcomponents-fiori/dist/illustrations/${r}.js" module. Or you can import the "@ui5/webcomponents-fiori/dist/illustrations/AllIllustrations.js" module that will make all illustrations available, but fetch only the ones used.`)}const o=i.get(t);a.set(t,o(t))}return a.get(t)},d=s=>{const{registryKey:t}=g(s);return l.get(t)},S=async s=>{const{registryKey:t}=g(s);return await m(s),l.get(t)};export{d as getIllustrationDataSync,h as registerIllustration,y as registerIllustrationLoader,S as getIllustrationData};
|
|
2
|
+
//# sourceMappingURL=Illustrations.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/asset-registries/Illustrations.ts"],
|
|
4
|
+
"sourcesContent": ["import getSharedResource from \"../getSharedResource.js\";\nimport type { I18nText } from \"../i18nBundle.js\";\nimport { getTheme } from \"../config/Theme.js\";\n\ntype IllustrationLoader = (illustrationName: string) => Promise<IllustrationData>;\n\ntype IllustrationProperties = {\n\tdialogSvg: string,\n\tsceneSvg: string,\n\tspotSvg: string,\n\tdotSvg: string,\n\ttitle: I18nText,\n\tsubtitle: I18nText,\n};\n\ntype IllustrationData = IllustrationProperties & {\n\tset: string,\n\tcollection: string,\n};\n\nconst IllustrationCollections = new Map([\n\t[\"sap_horizon\", \"V5\"],\n\t[\"sap_horizon_dark\", \"V5\"],\n\t[\"sap_horizon_hcb\", \"V5/HC\"],\n\t[\"sap_horizon_hcw\", \"V5/HC\"],\n]);\n\nconst FALLBACK_COLLECTION = \"V4\";\n\nconst loaders = new Map<string, IllustrationLoader>();\nconst registry = getSharedResource<Map<string, IllustrationProperties>>(\"SVGIllustration.registry\", new Map());\nconst illustrationPromises = getSharedResource<Map<string, Promise<IllustrationData>>>(\"SVGIllustration.promises\", new Map());\n\nconst getCollection = () => {\n\tconst theme = getTheme();\n\n\tif (IllustrationCollections.has(theme)) {\n\t\treturn IllustrationCollections.get(theme);\n\t}\n\n\treturn FALLBACK_COLLECTION;\n};\n\n/**\n * Processes the name of the illustration\n * The name is used to generate the registry key and the loader key\n * The registry key is used to store and get the illustration data from the registry\n * The loader key is used to store and get the illustration loader from the loaders map\n * The function generates the correct registry key and loader key based on whether an loader exists for the illustration\n * If there is no loader registered for the collection, it falls back to the default collection\n */\nconst processName = (name: string) => {\n\tlet collection = getCollection();\n\tconst [set, illustrationName] = name.split(\"/\");\n\tlet registryKey = `${set}/${collection}/${illustrationName}`;\n\n\tif (!loaders.has(registryKey) && collection !== FALLBACK_COLLECTION) {\n\t\tcollection = FALLBACK_COLLECTION;\n\t\tregistryKey = `${set}/${collection}/${illustrationName}`;\n\t}\n\n\treturn {\n\t\tregistryKey,\n\t\tcollection,\n\t};\n};\n\nconst registerIllustration = (name: string, data: IllustrationData) => {\n\tconst collection = data.collection || FALLBACK_COLLECTION;\n\tregistry.set(`${data.set}/${collection}/${name}`, {\n\t\tdialogSvg: data.dialogSvg,\n\t\tsceneSvg: data.sceneSvg,\n\t\tspotSvg: data.spotSvg,\n\t\tdotSvg: data.dotSvg,\n\t\ttitle: data.title,\n\t\tsubtitle: data.subtitle,\n\t});\n};\n\nconst registerIllustrationLoader = (illustrationName: string, loader: IllustrationLoader) => {\n\tloaders.set(illustrationName, loader);\n};\n\nconst _loadIllustrationOnce = (illustrationName: string) => {\n\tconst { registryKey } = processName(illustrationName);\n\tif (!illustrationPromises.has(registryKey)) {\n\t\tif (!loaders.has(registryKey)) {\n\t\t\tconst illustrationPath = illustrationName.startsWith(\"fiori/\") ? illustrationName.replace(\"fiori/\", \"\") : illustrationName;\n\t\t\tthrow new Error(`No loader registered for the ${illustrationName} illustration. Probably you forgot to import the \"@ui5/webcomponents-fiori/dist/illustrations/${illustrationPath}.js\" module. Or you can import the \"@ui5/webcomponents-fiori/dist/illustrations/AllIllustrations.js\" module that will make all illustrations available, but fetch only the ones used.`);\n\t\t}\n\n\t\tconst loadIllustrations = loaders.get(registryKey)!;\n\t\tillustrationPromises.set(registryKey, loadIllustrations(registryKey));\n\t}\n\treturn illustrationPromises.get(registryKey);\n};\n\nconst getIllustrationDataSync = (illustrationName: string) => {\n\tconst { registryKey } = processName(illustrationName);\n\treturn registry.get(registryKey);\n};\n\nconst getIllustrationData = async (illustrationName: string) => {\n\tconst { registryKey } = processName(illustrationName);\n\n\tawait _loadIllustrationOnce(illustrationName);\n\treturn registry.get(registryKey);\n};\n\nexport {\n\tgetIllustrationDataSync,\n\tregisterIllustration,\n\tregisterIllustrationLoader,\n\tgetIllustrationData,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAOA,MAAuB,0BAE9B,OAAS,YAAAC,MAAgB,qBAkBzB,MAAMC,EAA0B,IAAI,IAAI,CACvC,CAAC,cAAe,IAAI,EACpB,CAAC,mBAAoB,IAAI,EACzB,CAAC,kBAAmB,OAAO,EAC3B,CAAC,kBAAmB,OAAO,CAC5B,CAAC,EAEKC,EAAsB,KAEtBC,EAAU,IAAI,IACdC,EAAWL,EAAuD,2BAA4B,IAAI,GAAK,EACvGM,EAAuBN,EAA0D,2BAA4B,IAAI,GAAK,EAEtHO,EAAgB,IAAM,CAC3B,MAAMC,EAAQP,EAAS,EAEvB,OAAIC,EAAwB,IAAIM,CAAK,EAC7BN,EAAwB,IAAIM,CAAK,EAGlCL,CACR,EAUMM,EAAeC,GAAiB,CACrC,IAAIC,EAAaJ,EAAc,EAC/B,KAAM,CAACK,EAAKC,CAAgB,EAAIH,EAAK,MAAM,GAAG,EAC9C,IAAII,EAAc,GAAGF,CAAG,IAAID,CAAU,IAAIE,CAAgB,GAE1D,MAAI,CAACT,EAAQ,IAAIU,CAAW,GAAKH,IAAeR,IAC/CQ,EAAaR,EACbW,EAAc,GAAGF,CAAG,IAAID,CAAU,IAAIE,CAAgB,IAGhD,CACN,YAAAC,EACA,WAAAH,CACD,CACD,EAEMI,EAAuB,CAACL,EAAcM,IAA2B,CACtE,MAAML,EAAaK,EAAK,YAAcb,EACtCE,EAAS,IAAI,GAAGW,EAAK,GAAG,IAAIL,CAAU,IAAID,CAAI,GAAI,CACjD,UAAWM,EAAK,UAChB,SAAUA,EAAK,SACf,QAASA,EAAK,QACd,OAAQA,EAAK,OACb,MAAOA,EAAK,MACZ,SAAUA,EAAK,QAChB,CAAC,CACF,EAEMC,EAA6B,CAACJ,EAA0BK,IAA+B,CAC5Fd,EAAQ,IAAIS,EAAkBK,CAAM,CACrC,EAEMC,EAAyBN,GAA6B,CAC3D,KAAM,CAAE,YAAAC,CAAY,EAAIL,EAAYI,CAAgB,EACpD,GAAI,CAACP,EAAqB,IAAIQ,CAAW,EAAG,CAC3C,GAAI,CAACV,EAAQ,IAAIU,CAAW,EAAG,CAC9B,MAAMM,EAAmBP,EAAiB,WAAW,QAAQ,EAAIA,EAAiB,QAAQ,SAAU,EAAE,EAAIA,EAC1G,MAAM,IAAI,MAAM,gCAAgCA,CAAgB,iGAAiGO,CAAgB,uLAAuL,CACzW,CAEA,MAAMC,EAAoBjB,EAAQ,IAAIU,CAAW,EACjDR,EAAqB,IAAIQ,EAAaO,EAAkBP,CAAW,CAAC,CACrE,CACA,OAAOR,EAAqB,IAAIQ,CAAW,CAC5C,EAEMQ,EAA2BT,GAA6B,CAC7D,KAAM,CAAE,YAAAC,CAAY,EAAIL,EAAYI,CAAgB,EACpD,OAAOR,EAAS,IAAIS,CAAW,CAChC,EAEMS,EAAsB,MAAOV,GAA6B,CAC/D,KAAM,CAAE,YAAAC,CAAY,EAAIL,EAAYI,CAAgB,EAEpD,aAAMM,EAAsBN,CAAgB,EACrCR,EAAS,IAAIS,CAAW,CAChC,EAEA,OACCQ,KAAA,wBACAP,KAAA,qBACAE,KAAA,2BACAM,KAAA",
|
|
6
|
+
"names": ["getSharedResource", "getTheme", "IllustrationCollections", "FALLBACK_COLLECTION", "loaders", "registry", "illustrationPromises", "getCollection", "theme", "processName", "name", "collection", "set", "illustrationName", "registryKey", "registerIllustration", "data", "registerIllustrationLoader", "loader", "_loadIllustrationOnce", "illustrationPath", "loadIllustrations", "getIllustrationDataSync", "getIllustrationData"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import{attachLanguageChange as g}from"../locale/languageChange.js";import h from"../locale/getLocale.js";import{DEFAULT_LOCALE as a,SUPPORTED_LOCALES as L}from"../generated/AssetParameters.js";import{getFeature as w}from"../FeaturesRegistry.js";const f=new Map,s=new Map,i=new Map,D=new Set;let d=!1;const O={iw:"he",ji:"yi",in:"id"},l=t=>{d||(console.warn(`[LocaleData] Supported locale "${t}" not configured, import the "Assets.js" module from the webcomponents package you are using.`),d=!0)},R=(t,e,n)=>{t=t&&O[t]||t,t==="no"&&(t="nb"),t==="zh"&&!e&&(n==="Hans"?e="CN":n==="Hant"&&(e="TW")),(t==="sh"||t==="sr"&&n==="Latn")&&(t="sr",e="Latn");let r=`${t}_${e}`;return L.includes(r)?s.has(r)?r:(l(r),a):(r=t,L.includes(r)?s.has(r)?r:(l(r),a):a)},m=(t,e)=>{f.set(t,e)},S=t=>{s.has(t)||(t=a);const e=f.get(t);if(!e)throw new Error(`CLDR data for locale ${t} is not loaded!`);return e},_=t=>{if(!i.get(t)){const e=s.get(t);if(!e)throw new Error(`CLDR data for locale ${t} is not loaded!`);i.set(t,e(t))}return i.get(t)},u=async(t,e,n)=>{const r=R(t,e,n),p=w("OpenUI5Support");if(p){const o=p.getLocaleDataObject();if(o){m(r,o);return}}try{const o=await _(r);m(r,o)}catch(o){const c=o;D.has(c.message)||(D.add(c.message),console.error(c.message))}},C=(t,e)=>{s.set(t,e)};C("en",async()=>(await fetch("https://sdk.openui5.org/1.120.5/resources/sap/ui/core/cldr/en.json")).json()),g(()=>{const t=h();return u(t.getLanguage(),t.getRegion(),t.getScript())});export{C as registerLocaleDataLoader,u as fetchCldr,S as getLocaleData};
|
|
2
|
+
//# sourceMappingURL=LocaleData.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/asset-registries/LocaleData.ts"],
|
|
4
|
+
"sourcesContent": ["import { attachLanguageChange } from \"../locale/languageChange.js\";\nimport getLocale from \"../locale/getLocale.js\";\nimport { DEFAULT_LOCALE, SUPPORTED_LOCALES } from \"../generated/AssetParameters.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport type OpenUI5Support from \"../features/OpenUI5Support.js\";\n\ntype LocaleDataLoader = (locale: string) => Promise<CLDRData>;\ntype CLDRData = Record<string, object | boolean | string>;\n\nconst localeDataMap = new Map<string, CLDRData>();\nconst loaders = new Map<string, LocaleDataLoader>();\nconst cldrPromises = new Map<string, Promise<CLDRData>>();\nconst reportedErrors = new Set<string>();\nlet warningShown = false;\n\nconst M_ISO639_OLD_TO_NEW = {\n\t\"iw\": \"he\",\n\t\"ji\": \"yi\",\n\t\"in\": \"id\",\n};\n\nconst _showAssetsWarningOnce = (localeId: string) => {\n\tif (warningShown) {\n\t\treturn;\n\t}\n\n\tconsole.warn(`[LocaleData] Supported locale \"${localeId}\" not configured, import the \"Assets.js\" module from the webcomponents package you are using.`); /* eslint-disable-line */\n\n\twarningShown = true;\n};\n\nconst calcLocale = (language: string, region: string, script: string) => {\n\t// normalize language and handle special cases\n\tlanguage = (language && M_ISO639_OLD_TO_NEW[language as keyof typeof M_ISO639_OLD_TO_NEW]) || language;\n\t// Special case 1: in an SAP context, the inclusive language code \"no\" always means Norwegian Bokmal (\"nb\")\n\tif (language === \"no\") {\n\t\tlanguage = \"nb\";\n\t}\n\t// Special case 2: for Chinese, derive a default region from the script (this behavior is inherited from Java)\n\tif (language === \"zh\" && !region) {\n\t\tif (script === \"Hans\") {\n\t\t\tregion = \"CN\";\n\t\t} else if (script === \"Hant\") {\n\t\t\tregion = \"TW\";\n\t\t}\n\t}\n\n\t// Special case 3: for Serbian, there are cyrillic and latin scripts, \"sh\" and \"sr-latn\" map to \"latin\", \"sr\" maps to cyrillic.\n\tif (language === \"sh\" || (language === \"sr\" && script === \"Latn\")) {\n\t\tlanguage = \"sr\";\n\t\tregion = \"Latn\";\n\t}\n\n\t// try language + region\n\tlet localeId = `${language}_${region}`;\n\tif (SUPPORTED_LOCALES.includes(localeId)) {\n\t\tif (loaders.has(localeId)) {\n\t\t\t// supported and has loader\n\t\t\treturn localeId;\n\t\t}\n\n\t\t// supported, no loader - fallback to default and warn\n\t\t_showAssetsWarningOnce(localeId);\n\t\treturn DEFAULT_LOCALE;\n\t}\n\n\t// not supported, try language only\n\tlocaleId = language;\n\tif (SUPPORTED_LOCALES.includes(localeId)) {\n\t\tif (loaders.has(localeId)) {\n\t\t\t// supported and has loader\n\t\t\treturn localeId;\n\t\t}\n\n\t\t// supported, no loader - fallback to default and warn\n\t\t_showAssetsWarningOnce(localeId);\n\t\treturn DEFAULT_LOCALE;\n\t}\n\n\t// not supported - fallback to default locale\n\treturn DEFAULT_LOCALE;\n};\n\n// internal set data\nconst setLocaleData = (localeId: string, content: CLDRData) => {\n\tlocaleDataMap.set(localeId, content);\n};\n\n// external getSync\nconst getLocaleData = (localeId: string) => {\n\t// if there is no loader, the default fallback was fetched and a warning was given - use default locale instead\n\tif (!loaders.has(localeId)) {\n\t\tlocaleId = DEFAULT_LOCALE;\n\t}\n\n\tconst content = localeDataMap.get(localeId);\n\tif (!content) {\n\t\tthrow new Error(`CLDR data for locale ${localeId} is not loaded!`);\n\t}\n\n\treturn content;\n};\n\n// load bundle over the network once\nconst _loadCldrOnce = (localeId: string) => {\n\tif (!cldrPromises.get(localeId)) {\n\t\tconst loadCldr = loaders.get(localeId);\n\n\t\tif (!loadCldr) {\n\t\t\tthrow new Error(`CLDR data for locale ${localeId} is not loaded!`);\n\t\t}\n\n\t\tcldrPromises.set(localeId, loadCldr(localeId));\n\t}\n\n\treturn cldrPromises.get(localeId);\n};\n\n// external getAsync\nconst fetchCldr = async (language: string, region: string, script: string) => {\n\tconst localeId = calcLocale(language, region, script);\n\n\t// reuse OpenUI5 CLDR if present\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (openUI5Support) {\n\t\tconst cldrContent = openUI5Support.getLocaleDataObject();\n\t\tif (cldrContent) {\n\t\t\t// only if openui5 actually returned valid content\n\t\t\tsetLocaleData(localeId, cldrContent);\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// fetch it\n\ttry {\n\t\tconst cldrContent = await _loadCldrOnce(localeId);\n\t\tsetLocaleData(localeId, cldrContent as CLDRData);\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tif (!reportedErrors.has(e.message)) {\n\t\t\treportedErrors.add(e.message);\n\t\t\tconsole.error(e.message); /* eslint-disable-line */\n\t\t}\n\t}\n};\n\nconst registerLocaleDataLoader = (localeId: string, loader: LocaleDataLoader) => {\n\tloaders.set(localeId, loader);\n};\n\n// register default loader for \"en\" from ui5 CDN (dev workflow without assets)\nregisterLocaleDataLoader(\"en\", async () => {\n\tconst cldrContent = await fetch(`https://sdk.openui5.org/1.120.5/resources/sap/ui/core/cldr/en.json`);\n\treturn cldrContent.json() as Promise<CLDRData>;\n});\n\n// When the language changes dynamically (the user calls setLanguage),\n// re-fetch the required CDRD data.\nattachLanguageChange(() => {\n\tconst locale = getLocale();\n\treturn fetchCldr(locale.getLanguage(), locale.getRegion(), locale.getScript());\n});\n\nexport {\n\tregisterLocaleDataLoader,\n\tfetchCldr,\n\tgetLocaleData,\n};\n\nexport type {\n\tCLDRData,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,wBAAAA,MAA4B,8BACrC,OAAOC,MAAe,yBACtB,OAAS,kBAAAC,EAAgB,qBAAAC,MAAyB,kCAClD,OAAS,cAAAC,MAAkB,yBAM3B,MAAMC,EAAgB,IAAI,IACpBC,EAAU,IAAI,IACdC,EAAe,IAAI,IACnBC,EAAiB,IAAI,IAC3B,IAAIC,EAAe,GAEnB,MAAMC,EAAsB,CAC3B,GAAM,KACN,GAAM,KACN,GAAM,IACP,EAEMC,EAA0BC,GAAqB,CAChDH,IAIJ,QAAQ,KAAK,kCAAkCG,CAAQ,+FAA+F,EAEtJH,EAAe,GAChB,EAEMI,EAAa,CAACC,EAAkBC,EAAgBC,IAAmB,CAExEF,EAAYA,GAAYJ,EAAoBI,CAA4C,GAAMA,EAE1FA,IAAa,OAChBA,EAAW,MAGRA,IAAa,MAAQ,CAACC,IACrBC,IAAW,OACdD,EAAS,KACCC,IAAW,SACrBD,EAAS,QAKPD,IAAa,MAASA,IAAa,MAAQE,IAAW,UACzDF,EAAW,KACXC,EAAS,QAIV,IAAIH,EAAW,GAAGE,CAAQ,IAAIC,CAAM,GACpC,OAAIZ,EAAkB,SAASS,CAAQ,EAClCN,EAAQ,IAAIM,CAAQ,EAEhBA,GAIRD,EAAuBC,CAAQ,EACxBV,IAIRU,EAAWE,EACPX,EAAkB,SAASS,CAAQ,EAClCN,EAAQ,IAAIM,CAAQ,EAEhBA,GAIRD,EAAuBC,CAAQ,EACxBV,GAIDA,EACR,EAGMe,EAAgB,CAACL,EAAkBM,IAAsB,CAC9Db,EAAc,IAAIO,EAAUM,CAAO,CACpC,EAGMC,EAAiBP,GAAqB,CAEtCN,EAAQ,IAAIM,CAAQ,IACxBA,EAAWV,GAGZ,MAAMgB,EAAUb,EAAc,IAAIO,CAAQ,EAC1C,GAAI,CAACM,EACJ,MAAM,IAAI,MAAM,wBAAwBN,CAAQ,iBAAiB,EAGlE,OAAOM,CACR,EAGME,EAAiBR,GAAqB,CAC3C,GAAI,CAACL,EAAa,IAAIK,CAAQ,EAAG,CAChC,MAAMS,EAAWf,EAAQ,IAAIM,CAAQ,EAErC,GAAI,CAACS,EACJ,MAAM,IAAI,MAAM,wBAAwBT,CAAQ,iBAAiB,EAGlEL,EAAa,IAAIK,EAAUS,EAAST,CAAQ,CAAC,CAC9C,CAEA,OAAOL,EAAa,IAAIK,CAAQ,CACjC,EAGMU,EAAY,MAAOR,EAAkBC,EAAgBC,IAAmB,CAC7E,MAAMJ,EAAWC,EAAWC,EAAUC,EAAQC,CAAM,EAG9CO,EAAiBnB,EAAkC,gBAAgB,EACzE,GAAImB,EAAgB,CACnB,MAAMC,EAAcD,EAAe,oBAAoB,EACvD,GAAIC,EAAa,CAEhBP,EAAcL,EAAUY,CAAW,EACnC,MACD,CACD,CAGA,GAAI,CACH,MAAMA,EAAc,MAAMJ,EAAcR,CAAQ,EAChDK,EAAcL,EAAUY,CAAuB,CAChD,OAASC,EAAgB,CACxB,MAAMC,EAAID,EACLjB,EAAe,IAAIkB,EAAE,OAAO,IAChClB,EAAe,IAAIkB,EAAE,OAAO,EAC5B,QAAQ,MAAMA,EAAE,OAAO,EAEzB,CACD,EAEMC,EAA2B,CAACf,EAAkBgB,IAA6B,CAChFtB,EAAQ,IAAIM,EAAUgB,CAAM,CAC7B,EAGAD,EAAyB,KAAM,UACV,MAAM,MAAM,oEAAoE,GACjF,KAAK,CACxB,EAID3B,EAAqB,IAAM,CAC1B,MAAM6B,EAAS5B,EAAU,EACzB,OAAOqB,EAAUO,EAAO,YAAY,EAAGA,EAAO,UAAU,EAAGA,EAAO,UAAU,CAAC,CAC9E,CAAC,EAED,OACCF,KAAA,yBACAL,KAAA,UACAH,KAAA",
|
|
6
|
+
"names": ["attachLanguageChange", "getLocale", "DEFAULT_LOCALE", "SUPPORTED_LOCALES", "getFeature", "localeDataMap", "loaders", "cldrPromises", "reportedErrors", "warningShown", "M_ISO639_OLD_TO_NEW", "_showAssetsWarningOnce", "localeId", "calcLocale", "language", "region", "script", "setLocaleData", "content", "getLocaleData", "_loadCldrOnce", "loadCldr", "fetchCldr", "openUI5Support", "cldrContent", "error", "e", "registerLocaleDataLoader", "loader", "locale"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import{DEFAULT_THEME as l}from"../generated/AssetParameters.js";import{mergeStyles as T}from"../ManagedStyles.js";import{fireThemeRegistered as p}from"../theming/ThemeRegistered.js";const y=new Map,h=new Map,S=new Map,u=new Set,i=new Set,f=(e,t,r)=>{h.set(`${e}/${t}`,r),u.add(e),i.add(t),p(t)},m=(e,t,r)=>{S.set(`${e}/${t}`,r)},P=async(e,t,r)=>{const a=`${e}_${t}_${r||""}`,s=y.get(a);if(s!==void 0)return s;if(!i.has(t)){const c=[...i.values()].join(", ");return console.warn(`You have requested a non-registered theme ${t} - falling back to ${l}. Registered themes are: ${c}`),g(e,l)}const[o,d]=await Promise.all([g(e,t),r?g(e,r,!0):void 0]),n=T(o,d);return n&&y.set(a,n),n},g=async(e,t,r=!1)=>{const s=(r?S:h).get(`${e}/${t}`);if(!s){r||console.error(`Theme [${t}] not registered for package [${e}]`);return}let o;try{o=await s(t)}catch(n){console.error(e,n.message);return}return o._||o},$=()=>u,D=e=>i.has(e);export{f as registerThemePropertiesLoader,m as registerCustomThemePropertiesLoader,P as getThemeProperties,$ as getRegisteredPackages,D as isThemeRegistered};
|
|
2
|
+
//# sourceMappingURL=Themes.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/asset-registries/Themes.ts"],
|
|
4
|
+
"sourcesContent": ["import { DEFAULT_THEME } from \"../generated/AssetParameters.js\";\nimport type { StyleData, StyleDataCSP } from \"../ManagedStyles.js\";\nimport { mergeStyles } from \"../ManagedStyles.js\";\nimport { fireThemeRegistered } from \"../theming/ThemeRegistered.js\";\n\ntype ThemeData = {_: StyleDataCSP } | StyleDataCSP | string;\ntype ThemeLoader = (themeName: string) => Promise<ThemeData>;\n\nconst themeStyles = new Map<string, StyleData>();\nconst loaders = new Map<string, ThemeLoader>();\nconst customLoaders = new Map<string, ThemeLoader>();\nconst registeredPackages = new Set<string>();\nconst registeredThemes = new Set<string>();\n\nconst registerThemePropertiesLoader = (packageName: string, themeName: string, loader: ThemeLoader) => {\n\tloaders.set(`${packageName}/${themeName}`, loader);\n\tregisteredPackages.add(packageName);\n\tregisteredThemes.add(themeName);\n\tfireThemeRegistered(themeName);\n};\n\nconst registerCustomThemePropertiesLoader = (packageName: string, themeName: string, loader: ThemeLoader) => {\n\tcustomLoaders.set(`${packageName}/${themeName}`, loader);\n};\n\nconst getThemeProperties = async (packageName: string, themeName: string, externalThemeName?: string) => {\n\tconst cacheKey = `${packageName}_${themeName}_${externalThemeName || \"\"}`;\n\tconst cachedStyleData = themeStyles.get(cacheKey);\n\tif (cachedStyleData !== undefined) { // it's valid for style to be an empty string\n\t\treturn cachedStyleData;\n\t}\n\n\tif (!registeredThemes.has(themeName)) {\n\t\tconst regThemesStr = [...registeredThemes.values()].join(\", \");\n\t\tconsole.warn(`You have requested a non-registered theme ${themeName} - falling back to ${DEFAULT_THEME}. Registered themes are: ${regThemesStr}`); /* eslint-disable-line */\n\t\treturn _getThemeProperties(packageName, DEFAULT_THEME);\n\t}\n\n\tconst [style, customStyle] = await Promise.all([\n\t\t_getThemeProperties(packageName, themeName),\n\t\texternalThemeName ? _getThemeProperties(packageName, externalThemeName, true) : undefined,\n\t]);\n\n\tconst styleData = mergeStyles(style, customStyle);\n\tif (styleData) {\n\t\tthemeStyles.set(cacheKey, styleData);\n\t}\n\n\treturn styleData;\n};\n\nconst _getThemeProperties = async (packageName: string, themeName: string, forCustomTheme = false) => {\n\tconst loadersMap = forCustomTheme ? customLoaders : loaders;\n\tconst loader = loadersMap.get(`${packageName}/${themeName}`);\n\tif (!loader) {\n\t\t// no themes for package\n\t\tif (!forCustomTheme) {\n\t\t\tconsole.error(`Theme [${themeName}] not registered for package [${packageName}]`); /* eslint-disable-line */\n\t\t}\n\t\treturn;\n\t}\n\tlet data;\n\ttry {\n\t\tdata = await loader(themeName);\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tconsole.error(packageName, e.message); /* eslint-disable-line */\n\t\treturn;\n\t}\n\n\tconst themeProps = (data as {_: StyleDataCSP})._ || data; // Refactor: remove _ everywhere\n\treturn themeProps;\n};\n\nconst getRegisteredPackages = () => {\n\treturn registeredPackages;\n};\n\nconst isThemeRegistered = (theme: string) => {\n\treturn registeredThemes.has(theme);\n};\n\nexport {\n\tregisterThemePropertiesLoader,\n\tregisterCustomThemePropertiesLoader,\n\tgetThemeProperties,\n\tgetRegisteredPackages,\n\tisThemeRegistered,\n};\n\nexport type {\n\tThemeData,\n\tThemeLoader,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,iBAAAA,MAAqB,kCAE9B,OAAS,eAAAC,MAAmB,sBAC5B,OAAS,uBAAAC,MAA2B,gCAKpC,MAAMC,EAAc,IAAI,IAClBC,EAAU,IAAI,IACdC,EAAgB,IAAI,IACpBC,EAAqB,IAAI,IACzBC,EAAmB,IAAI,IAEvBC,EAAgC,CAACC,EAAqBC,EAAmBC,IAAwB,CACtGP,EAAQ,IAAI,GAAGK,CAAW,IAAIC,CAAS,GAAIC,CAAM,EACjDL,EAAmB,IAAIG,CAAW,EAClCF,EAAiB,IAAIG,CAAS,EAC9BR,EAAoBQ,CAAS,CAC9B,EAEME,EAAsC,CAACH,EAAqBC,EAAmBC,IAAwB,CAC5GN,EAAc,IAAI,GAAGI,CAAW,IAAIC,CAAS,GAAIC,CAAM,CACxD,EAEME,EAAqB,MAAOJ,EAAqBC,EAAmBI,IAA+B,CACxG,MAAMC,EAAW,GAAGN,CAAW,IAAIC,CAAS,IAAII,GAAqB,EAAE,GACjEE,EAAkBb,EAAY,IAAIY,CAAQ,EAChD,GAAIC,IAAoB,OACvB,OAAOA,EAGR,GAAI,CAACT,EAAiB,IAAIG,CAAS,EAAG,CACrC,MAAMO,EAAe,CAAC,GAAGV,EAAiB,OAAO,CAAC,EAAE,KAAK,IAAI,EAC7D,eAAQ,KAAK,6CAA6CG,CAAS,sBAAsBV,CAAa,4BAA4BiB,CAAY,EAAE,EACzIC,EAAoBT,EAAaT,CAAa,CACtD,CAEA,KAAM,CAACmB,EAAOC,CAAW,EAAI,MAAM,QAAQ,IAAI,CAC9CF,EAAoBT,EAAaC,CAAS,EAC1CI,EAAoBI,EAAoBT,EAAaK,EAAmB,EAAI,EAAI,MACjF,CAAC,EAEKO,EAAYpB,EAAYkB,EAAOC,CAAW,EAChD,OAAIC,GACHlB,EAAY,IAAIY,EAAUM,CAAS,EAG7BA,CACR,EAEMH,EAAsB,MAAOT,EAAqBC,EAAmBY,EAAiB,KAAU,CAErG,MAAMX,GADaW,EAAiBjB,EAAgBD,GAC1B,IAAI,GAAGK,CAAW,IAAIC,CAAS,EAAE,EAC3D,GAAI,CAACC,EAAQ,CAEPW,GACJ,QAAQ,MAAM,UAAUZ,CAAS,iCAAiCD,CAAW,GAAG,EAEjF,MACD,CACA,IAAIc,EACJ,GAAI,CACHA,EAAO,MAAMZ,EAAOD,CAAS,CAC9B,OAASc,EAAgB,CAExB,QAAQ,MAAMf,EADJe,EACmB,OAAO,EACpC,MACD,CAGA,OADoBD,EAA2B,GAAKA,CAErD,EAEME,EAAwB,IACtBnB,EAGFoB,EAAqBC,GACnBpB,EAAiB,IAAIoB,CAAK,EAGlC,OACCnB,KAAA,8BACAI,KAAA,oCACAC,KAAA,mBACAY,KAAA,sBACAC,KAAA",
|
|
6
|
+
"names": ["DEFAULT_THEME", "mergeStyles", "fireThemeRegistered", "themeStyles", "loaders", "customLoaders", "registeredPackages", "registeredThemes", "registerThemePropertiesLoader", "packageName", "themeName", "loader", "registerCustomThemePropertiesLoader", "getThemeProperties", "externalThemeName", "cacheKey", "cachedStyleData", "regThemesStr", "_getThemeProperties", "style", "customStyle", "styleData", "forCustomTheme", "data", "error", "getRegisteredPackages", "isThemeRegistered", "theme"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import i from"../locale/getLocale.js";import{attachLanguageChange as b}from"../locale/languageChange.js";import y from"../locale/normalizeLocale.js";import D from"../locale/nextFallbackLocale.js";import{DEFAULT_LANGUAGE as c}from"../generated/AssetParameters.js";import{getFetchDefaultLanguage as p}from"../config/Language.js";const d=new Set,m=new Set,g=new Map,l=new Map,u=new Map,$=(n,t,e)=>{const r=`${n}/${t}`;u.set(r,e)},f=(n,t)=>{g.set(n,t)},A=n=>g.get(n),h=(n,t)=>{const e=`${n}/${t}`;return u.has(e)},B=(n,t)=>{const e=`${n}/${t}`,r=u.get(e);return r&&!l.get(e)&&l.set(e,r(t)),l.get(e)},M=n=>{d.has(n)||(console.warn(`[${n}]: Message bundle assets are not configured. Falling back to English texts.`,` Add \`import "${n}/dist/Assets.js"\` in your bundle and make sure your build tool supports dynamic imports and JSON imports. See section "Assets" in the documentation for more information.`),d.add(n))},L=(n,t)=>t!==c&&!h(n,t),w=async n=>{const t=i().getLanguage(),e=i().getRegion(),r=i().getVariant();let s=t+(e?`-${e}`:"")+(r?`-${r}`:"");if(L(n,s))for(s=y(s);L(n,s);)s=D(s);const I=p();if(s===c&&!I){f(n,null);return}if(!h(n,s)){M(n);return}try{const o=await B(n,s);f(n,o)}catch(o){const a=o;m.has(a.message)||(m.add(a.message),console.error(a.message))}};b(n=>{const t=[...g.keys()];return Promise.all(t.map(w))});export{$ as registerI18nLoader,w as fetchI18nBundle,A as getI18nBundleData};
|
|
2
|
+
//# sourceMappingURL=i18n.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/asset-registries/i18n.ts"],
|
|
4
|
+
"sourcesContent": ["import getLocale from \"../locale/getLocale.js\";\nimport { attachLanguageChange } from \"../locale/languageChange.js\";\nimport normalizeLocale from \"../locale/normalizeLocale.js\";\nimport nextFallbackLocale from \"../locale/nextFallbackLocale.js\";\nimport { DEFAULT_LANGUAGE } from \"../generated/AssetParameters.js\";\nimport { getFetchDefaultLanguage } from \"../config/Language.js\";\n\ntype I18nLoader = (localeId: string) => Promise<I18nData>;\ntype I18nData = Record<string, string>;\n\n// contains package names for which the warning has been shown\nconst warningShown = new Set();\nconst reportedErrors = new Set();\n\nconst bundleData = new Map<string, I18nData | null>();\nconst bundlePromises = new Map<string, Promise<I18nData>>();\nconst loaders = new Map<string, I18nLoader>();\n\n/**\n * Registers i18n loader function for given package and locale.\n *\n * @public\n * @param {string} packageName for which package this loader can fetch data\n * @param {string} localeId locale that this loader can handle\n * @param {function} loader async function that will be passed a localeId and should return a JSON object\n */\nconst registerI18nLoader = (packageName: string, localeId: string, loader: I18nLoader) => {\n\t// register loader by key\n\tconst bundleKey = `${packageName}/${localeId}`;\n\tloaders.set(bundleKey, loader);\n};\n\nconst _setI18nBundleData = (packageName: string, data: I18nData | null) => {\n\tbundleData.set(packageName, data);\n};\n\nconst getI18nBundleData = (packageName: string) => {\n\treturn bundleData.get(packageName);\n};\n\nconst _hasLoader = (packageName: string, localeId: string) => {\n\tconst bundleKey = `${packageName}/${localeId}`;\n\treturn loaders.has(bundleKey);\n};\n\n// load bundle over the network once\nconst _loadMessageBundleOnce = (packageName: string, localeId: string) => {\n\tconst bundleKey = `${packageName}/${localeId}`;\n\tconst loadMessageBundle = loaders.get(bundleKey);\n\n\tif (loadMessageBundle && !bundlePromises.get(bundleKey)) {\n\t\tbundlePromises.set(bundleKey, loadMessageBundle(localeId));\n\t}\n\n\treturn bundlePromises.get(bundleKey)!; // Investigate if i18n loader exists and this won't return undefined.\n};\n\nconst _showAssetsWarningOnce = (packageName: string) => {\n\tif (!warningShown.has(packageName)) {\n\t\tconsole.warn(`[${packageName}]: Message bundle assets are not configured. Falling back to English texts.`, /* eslint-disable-line */\n\t\t\t` Add \\`import \"${packageName}/dist/Assets.js\"\\` in your bundle and make sure your build tool supports dynamic imports and JSON imports. See section \"Assets\" in the documentation for more information.`); /* eslint-disable-line */\n\t\twarningShown.add(packageName);\n\t}\n};\n\nconst useFallbackBundle = (packageName: string, localeId: string) => {\n\treturn localeId !== DEFAULT_LANGUAGE && !_hasLoader(packageName, localeId);\n};\n\n/**\n * This method preforms the asynchronous task of fetching the actual text resources. It will fetch\n * each text resource over the network once (even for multiple calls to the same method).\n * It should be fully finished before the i18nBundle class is created in the webcomponents.\n * This method uses the bundle URLs that are populated by the `registerI18nBundle` method.\n * To simplify the usage, the synchronization of both methods happens internally for the same `bundleId`\n * @param {packageName} packageName the NPM package name\n * @public\n */\nconst fetchI18nBundle = async (packageName: string) => {\n\tconst language = getLocale().getLanguage();\n\tconst region = getLocale().getRegion();\n\tconst variant = getLocale().getVariant();\n\tlet localeId = language + (region ? `-${region}` : ``) + (variant ? `-${variant}` : ``);\n\n\tif (useFallbackBundle(packageName, localeId)) {\n\t\tlocaleId = normalizeLocale(localeId);\n\n\t\twhile (useFallbackBundle(packageName, localeId)) {\n\t\t\tlocaleId = nextFallbackLocale(localeId);\n\t\t}\n\t}\n\n\t// use default language unless configured to always fetch it from the network\n\tconst fetchDefaultLanguage = getFetchDefaultLanguage();\n\tif (localeId === DEFAULT_LANGUAGE && !fetchDefaultLanguage) {\n\t\t_setI18nBundleData(packageName, null); // reset for the default language (if data was set for a previous language)\n\t\treturn;\n\t}\n\n\tif (!_hasLoader(packageName, localeId)) {\n\t\t_showAssetsWarningOnce(packageName);\n\t\treturn;\n\t}\n\n\ttry {\n\t\tconst data = await _loadMessageBundleOnce(packageName, localeId);\n\t\t_setI18nBundleData(packageName, data);\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tif (!reportedErrors.has(e.message)) {\n\t\t\treportedErrors.add(e.message);\n\t\t\tconsole.error(e.message); /* eslint-disable-line */\n\t\t}\n\t}\n};\n\n// When the language changes dynamically (the user calls setLanguage), re-fetch all previously fetched bundles\nattachLanguageChange((lang: string /* eslint-disable-line */) => {\n\tconst allPackages = [...bundleData.keys()];\n\treturn Promise.all(allPackages.map(fetchI18nBundle));\n});\n\nexport {\n\tregisterI18nLoader,\n\tfetchI18nBundle,\n\tgetI18nBundleData,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAOA,MAAe,yBACtB,OAAS,wBAAAC,MAA4B,8BACrC,OAAOC,MAAqB,+BAC5B,OAAOC,MAAwB,kCAC/B,OAAS,oBAAAC,MAAwB,kCACjC,OAAS,2BAAAC,MAA+B,wBAMxC,MAAMC,EAAe,IAAI,IACnBC,EAAiB,IAAI,IAErBC,EAAa,IAAI,IACjBC,EAAiB,IAAI,IACrBC,EAAU,IAAI,IAUdC,EAAqB,CAACC,EAAqBC,EAAkBC,IAAuB,CAEzF,MAAMC,EAAY,GAAGH,CAAW,IAAIC,CAAQ,GAC5CH,EAAQ,IAAIK,EAAWD,CAAM,CAC9B,EAEME,EAAqB,CAACJ,EAAqBK,IAA0B,CAC1ET,EAAW,IAAII,EAAaK,CAAI,CACjC,EAEMC,EAAqBN,GACnBJ,EAAW,IAAII,CAAW,EAG5BO,EAAa,CAACP,EAAqBC,IAAqB,CAC7D,MAAME,EAAY,GAAGH,CAAW,IAAIC,CAAQ,GAC5C,OAAOH,EAAQ,IAAIK,CAAS,CAC7B,EAGMK,EAAyB,CAACR,EAAqBC,IAAqB,CACzE,MAAME,EAAY,GAAGH,CAAW,IAAIC,CAAQ,GACtCQ,EAAoBX,EAAQ,IAAIK,CAAS,EAE/C,OAAIM,GAAqB,CAACZ,EAAe,IAAIM,CAAS,GACrDN,EAAe,IAAIM,EAAWM,EAAkBR,CAAQ,CAAC,EAGnDJ,EAAe,IAAIM,CAAS,CACpC,EAEMO,EAA0BV,GAAwB,CAClDN,EAAa,IAAIM,CAAW,IAChC,QAAQ,KAAK,IAAIA,CAAW,8EAC3B,kBAAkBA,CAAW,4KAA4K,EAC1MN,EAAa,IAAIM,CAAW,EAE9B,EAEMW,EAAoB,CAACX,EAAqBC,IACxCA,IAAaT,GAAoB,CAACe,EAAWP,EAAaC,CAAQ,EAYpEW,EAAkB,MAAOZ,GAAwB,CACtD,MAAMa,EAAWzB,EAAU,EAAE,YAAY,EACnC0B,EAAS1B,EAAU,EAAE,UAAU,EAC/B2B,EAAU3B,EAAU,EAAE,WAAW,EACvC,IAAIa,EAAWY,GAAYC,EAAS,IAAIA,CAAM,GAAK,KAAOC,EAAU,IAAIA,CAAO,GAAK,IAEpF,GAAIJ,EAAkBX,EAAaC,CAAQ,EAG1C,IAFAA,EAAWX,EAAgBW,CAAQ,EAE5BU,EAAkBX,EAAaC,CAAQ,GAC7CA,EAAWV,EAAmBU,CAAQ,EAKxC,MAAMe,EAAuBvB,EAAwB,EACrD,GAAIQ,IAAaT,GAAoB,CAACwB,EAAsB,CAC3DZ,EAAmBJ,EAAa,IAAI,EACpC,MACD,CAEA,GAAI,CAACO,EAAWP,EAAaC,CAAQ,EAAG,CACvCS,EAAuBV,CAAW,EAClC,MACD,CAEA,GAAI,CACH,MAAMK,EAAO,MAAMG,EAAuBR,EAAaC,CAAQ,EAC/DG,EAAmBJ,EAAaK,CAAI,CACrC,OAASY,EAAgB,CACxB,MAAMC,EAAID,EACLtB,EAAe,IAAIuB,EAAE,OAAO,IAChCvB,EAAe,IAAIuB,EAAE,OAAO,EAC5B,QAAQ,MAAMA,EAAE,OAAO,EAEzB,CACD,EAGA7B,EAAsB8B,GAA2C,CAChE,MAAMC,EAAc,CAAC,GAAGxB,EAAW,KAAK,CAAC,EACzC,OAAO,QAAQ,IAAIwB,EAAY,IAAIR,CAAe,CAAC,CACpD,CAAC,EAED,OACCb,KAAA,mBACAa,KAAA,gBACAN,KAAA",
|
|
6
|
+
"names": ["getLocale", "attachLanguageChange", "normalizeLocale", "nextFallbackLocale", "DEFAULT_LANGUAGE", "getFetchDefaultLanguage", "warningShown", "reportedErrors", "bundleData", "bundlePromises", "loaders", "registerI18nLoader", "packageName", "localeId", "loader", "bundleKey", "_setI18nBundleData", "data", "getI18nBundleData", "_hasLoader", "_loadMessageBundleOnce", "loadMessageBundle", "_showAssetsWarningOnce", "useFallbackBundle", "fetchI18nBundle", "language", "region", "variant", "fetchDefaultLanguage", "error", "e", "lang", "allPackages"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var t=(s=>(s["SAP-icons"]="SAP-icons-v4",s.horizon="SAP-icons-v5",s["SAP-icons-TNT"]="tnt",s.BusinessSuiteInAppSymbols="business-suite",s))(t||{});const n=e=>t[e]?t[e]:e;export default t;export{n as getIconCollectionByAlias};
|
|
2
|
+
//# sourceMappingURL=IconCollectionsAlias.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/asset-registries/util/IconCollectionsAlias.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Supported icon collection aliases.\n *\n * Users might specify a collection, using both the key and the value in the following key-value pairs,\n * e.g the following pairs are completely exchangeable:\n *\n * - \"SAP-icons/accept\" and \"SAP-icons-v4/accept\"\n * - \"horizon/accept\" and \"SAP-icons-v5/accept\"\n * - \"SAP-icons-TNT/actor\" and \"tnt/actor\"\n * - \"BusinessSuiteInAppSymbols/3d\" and \"business-suite/3d\"\n */\nenum IconCollectionsAlias {\n\t\"SAP-icons\" = \"SAP-icons-v4\",\n\t\"horizon\" = \"SAP-icons-v5\",\n\t\"SAP-icons-TNT\" = \"tnt\",\n\t\"BusinessSuiteInAppSymbols\" = \"business-suite\",\n}\n\n/**\n * Returns the collection name for a given alias:\n *\n * - \"SAP-icons-TNT\"resolves to \"tnt\"\n * - \"BusinessSuiteInAppSymbols\" resolves to \"business-suite\"\n * - \"horizon\" resolves to \"SAP-icons-v5\"\n *\n * @param { string } collectionName\n * @return { string } the normalized collection name\n */\nconst getIconCollectionByAlias = (collectionName: string) => {\n\tif (IconCollectionsAlias[collectionName as keyof typeof IconCollectionsAlias]) {\n\t\treturn IconCollectionsAlias[collectionName as keyof typeof IconCollectionsAlias];\n\t}\n\n\treturn collectionName;\n};\n\nexport default IconCollectionsAlias;\nexport {\n\tgetIconCollectionByAlias,\n};\n"],
|
|
5
|
+
"mappings": "aAWA,IAAKA,OACJA,EAAA,aAAc,eACdA,EAAA,QAAY,eACZA,EAAA,iBAAkB,MAClBA,EAAA,0BAA8B,iBAJ1BA,OAAA,IAiBL,MAAMC,EAA4BC,GAC7BF,EAAqBE,CAAmD,EACpEF,EAAqBE,CAAmD,EAGzEA,EAGR,eAAeF,EACf,OACCC,KAAA",
|
|
6
|
+
"names": ["IconCollectionsAlias", "getIconCollectionByAlias", "collectionName"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import{isLegacyThemeFamily as i}from"../../config/Theme.js";var t=(o=>(o.SAPIconsV4="SAP-icons-v4",o.SAPIconsV5="SAP-icons-v5",o.SAPIconsTNTV2="tnt-v2",o.SAPIconsTNTV3="tnt-v3",o.SAPBSIconsV1="business-suite-v1",o.SAPBSIconsV2="business-suite-v2",o))(t||{});const s=new Map;s.set("SAP-icons",{legacy:"SAP-icons-v4",sap_horizon:"SAP-icons-v5"}),s.set("tnt",{legacy:"tnt-v2",sap_horizon:"tnt-v3"}),s.set("business-suite",{legacy:"business-suite-v1",sap_horizon:"business-suite-v2"});const c=(n,e)=>{if(s.has(n)){s.set(n,{...e,...s.get(n)});return}s.set(n,e)},r=n=>{const e=i()?"legacy":"sap_horizon";return s.has(n)?s.get(n)[e]:n};export{c as registerIconCollectionForTheme,r as getIconCollectionForTheme,t as RegisteredIconCollection};
|
|
2
|
+
//# sourceMappingURL=IconCollectionsByTheme.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/asset-registries/util/IconCollectionsByTheme.ts"],
|
|
4
|
+
"sourcesContent": ["import { isLegacyThemeFamily } from \"../../config/Theme.js\";\n\nenum RegisteredIconCollection {\n\tSAPIconsV4 = \"SAP-icons-v4\",\n\tSAPIconsV5 = \"SAP-icons-v5\",\n\tSAPIconsTNTV2 = \"tnt-v2\",\n\tSAPIconsTNTV3 = \"tnt-v3\",\n\tSAPBSIconsV1 = \"business-suite-v1\",\n\tSAPBSIconsV2 = \"business-suite-v2\",\n}\n\ntype ThemeToCollectionMap = {[x: string]: string; };\n\nconst iconCollections = new Map<string, ThemeToCollectionMap>();\niconCollections.set(\"SAP-icons\", {\n\t\"legacy\": RegisteredIconCollection.SAPIconsV4,\n\t\"sap_horizon\": RegisteredIconCollection.SAPIconsV5,\n});\niconCollections.set(\"tnt\", {\n\t\"legacy\": RegisteredIconCollection.SAPIconsTNTV2,\n\t\"sap_horizon\": RegisteredIconCollection.SAPIconsTNTV3,\n});\niconCollections.set(\"business-suite\", {\n\t\"legacy\": RegisteredIconCollection.SAPBSIconsV1,\n\t\"sap_horizon\": RegisteredIconCollection.SAPBSIconsV2,\n});\n\n/**\n * Registers collection version per theme.\n * **For exmaple:** registerIconCollectionForTheme(\"my-custom-icons\", {\"sap_horizon\": \"my-custom-icons-v5\"})\n * @param { string } collectionName\n * @param { ThemeToCollectionMap } themeCollectionMap\n */\nconst registerIconCollectionForTheme = (collectionName: string, themeCollectionMap: ThemeToCollectionMap) => {\n\tif (iconCollections.has(collectionName)) {\n\t\ticonCollections.set(collectionName, { ...themeCollectionMap, ...iconCollections.get(collectionName) });\n\t\treturn;\n\t}\n\ticonCollections.set(collectionName, themeCollectionMap);\n};\n\nconst getIconCollectionForTheme = (collectionName: string) => {\n\tconst themeFamily = isLegacyThemeFamily() ? \"legacy\" : \"sap_horizon\";\n\treturn iconCollections.has(collectionName) ? iconCollections.get(collectionName)![themeFamily] : collectionName;\n};\n\nexport {\n\tregisterIconCollectionForTheme,\n\tgetIconCollectionForTheme,\n\tRegisteredIconCollection,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,uBAAAA,MAA2B,wBAEpC,IAAKC,OACJA,EAAA,WAAa,eACbA,EAAA,WAAa,eACbA,EAAA,cAAgB,SAChBA,EAAA,cAAgB,SAChBA,EAAA,aAAe,oBACfA,EAAA,aAAe,oBANXA,OAAA,IAWL,MAAMC,EAAkB,IAAI,IAC5BA,EAAgB,IAAI,YAAa,CAChC,OAAU,eACV,YAAe,cAChB,CAAC,EACDA,EAAgB,IAAI,MAAO,CAC1B,OAAU,SACV,YAAe,QAChB,CAAC,EACDA,EAAgB,IAAI,iBAAkB,CACrC,OAAU,oBACV,YAAe,mBAChB,CAAC,EAQD,MAAMC,EAAiC,CAACC,EAAwBC,IAA6C,CAC5G,GAAIH,EAAgB,IAAIE,CAAc,EAAG,CACxCF,EAAgB,IAAIE,EAAgB,CAAE,GAAGC,EAAoB,GAAGH,EAAgB,IAAIE,CAAc,CAAE,CAAC,EACrG,MACD,CACAF,EAAgB,IAAIE,EAAgBC,CAAkB,CACvD,EAEMC,EAA6BF,GAA2B,CAC7D,MAAMG,EAAcP,EAAoB,EAAI,SAAW,cACvD,OAAOE,EAAgB,IAAIE,CAAc,EAAIF,EAAgB,IAAIE,CAAc,EAAGG,CAAW,EAAIH,CAClG,EAEA,OACCD,KAAA,+BACAG,KAAA,0BACAL,KAAA",
|
|
6
|
+
"names": ["isLegacyThemeFamily", "RegisteredIconCollection", "iconCollections", "registerIconCollectionForTheme", "collectionName", "themeCollectionMap", "getIconCollectionForTheme", "themeFamily"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import{getTheme as n}from"../../config/Theme.js";import{getDefaultIconCollection as c}from"../../config/Icons.js";import{getIconCollectionByAlias as r}from"./IconCollectionsAlias.js";import{getIconCollectionForTheme as e}from"./IconCollectionsByTheme.js";const i=o=>{const t=c(n());return!o&&t?r(t):o?e(o):e("SAP-icons")};export default i;
|
|
2
|
+
//# sourceMappingURL=getIconCollectionByTheme.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/asset-registries/util/getIconCollectionByTheme.ts"],
|
|
4
|
+
"sourcesContent": ["import { getTheme } from \"../../config/Theme.js\";\nimport type { IconCollection } from \"../../config/Icons.js\";\nimport { getDefaultIconCollection } from \"../../config/Icons.js\";\nimport { getIconCollectionByAlias } from \"./IconCollectionsAlias.js\";\nimport { getIconCollectionForTheme } from \"./IconCollectionsByTheme.js\";\n\n/**\n * Returns the effective theme dependant icon collection:\n *\n * - \"no collection\" resolves to \"SAP-icons-v4\" in \"Quartz\" and to \"SAP-icons-v5\" in \"Horizon\"\n * - \"tnt\" (and its alias \"SAP-icons-TNT\") resolves to \"tnt-v2\" in \"Quartz\" and resolves to \"tnt-v3\" in \"Horizon\"\n * - \"business-suite\" (and its alias \"BusinessSuiteInAppSymbols\") resolves to \"business-suite-v1\" in \"Quartz\" and resolves to \"business-suite-v2\" in \"Horizon\"\n *\n * @param { IconCollection } collectionName\n * @returns { IconCollection } the effective collection name\n */\nconst getEffectiveIconCollection = (collectionName?: IconCollection): IconCollection => {\n\tconst defaultIconCollection = getDefaultIconCollection(getTheme());\n\n\t// no collection + default collection, configured via setDefaultIconCollection - return the configured icon collection.\n\tif (!collectionName && defaultIconCollection) {\n\t\treturn getIconCollectionByAlias(defaultIconCollection);\n\t}\n\n\t// no collection - return \"SAP-icons-v4\" or \"SAP-icons-v5\".\n\tif (!collectionName) {\n\t\treturn getIconCollectionForTheme(\"SAP-icons\");\n\t}\n\n\t// has collection - return \"SAP-icons-v4\", \"SAP-icons-v5\", \"tnt-v1\", \"tnt-v2\", \"business-suite-v1\", \"business-suite-v2\", or custom ones.\n\treturn getIconCollectionForTheme(collectionName);\n};\n\nexport default getEffectiveIconCollection;\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,YAAAA,MAAgB,wBAEzB,OAAS,4BAAAC,MAAgC,wBACzC,OAAS,4BAAAC,MAAgC,4BACzC,OAAS,6BAAAC,MAAiC,8BAY1C,MAAMC,EAA8BC,GAAoD,CACvF,MAAMC,EAAwBL,EAAyBD,EAAS,CAAC,EAGjE,MAAI,CAACK,GAAkBC,EACfJ,EAAyBI,CAAqB,EAIjDD,EAKEF,EAA0BE,CAAc,EAJvCF,EAA0B,WAAW,CAK9C,EAEA,eAAeC",
|
|
6
|
+
"names": ["getTheme", "getDefaultIconCollection", "getIconCollectionByAlias", "getIconCollectionForTheme", "getEffectiveIconCollection", "collectionName", "defaultIconCollection"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import{getAnimationMode as i}from"../InitialConfiguration.js";import t from"../types/AnimationMode.js";let o;const e=()=>(o===void 0&&(o=i()),o),d=n=>{Object.values(t).includes(n)&&(o=n)};export{e as getAnimationMode,d as setAnimationMode};
|
|
2
|
+
//# sourceMappingURL=AnimationMode.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/AnimationMode.ts"],
|
|
4
|
+
"sourcesContent": ["import { getAnimationMode as getConfiguredAnimationMode } from \"../InitialConfiguration.js\";\nimport AnimationMode from \"../types/AnimationMode.js\";\n\nlet curAnimationMode: `${AnimationMode}`;\n\n/**\n * Returns the animation mode - \"full\", \"basic\", \"minimal\" or \"none\".\n * @public\n * @returns { AnimationMode }\n */\nconst getAnimationMode = (): `${AnimationMode}` => {\n\tif (curAnimationMode === undefined) {\n\t\tcurAnimationMode = getConfiguredAnimationMode();\n\t}\n\n\treturn curAnimationMode;\n};\n\n/**\n * Sets the animation mode - \"full\", \"basic\", \"minimal\" or \"none\".\n * @public\n * @param { AnimationMode } animationMode\n */\nconst setAnimationMode = (animationMode: `${AnimationMode}`) => {\n\tconst options: string[] = Object.values(AnimationMode);\n\tif (options.includes(animationMode)) {\n\t\tcurAnimationMode = animationMode;\n\t}\n};\n\nexport {\n\tgetAnimationMode,\n\tsetAnimationMode,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,oBAAoBA,MAAkC,6BAC/D,OAAOC,MAAmB,4BAE1B,IAAIC,EAOJ,MAAMC,EAAmB,KACpBD,IAAqB,SACxBA,EAAmBF,EAA2B,GAGxCE,GAQFE,EAAoBC,GAAsC,CACrC,OAAO,OAAOJ,CAAa,EACzC,SAASI,CAAa,IACjCH,EAAmBG,EAErB,EAEA,OACCF,KAAA,iBACAC,KAAA",
|
|
6
|
+
"names": ["getConfiguredAnimationMode", "AnimationMode", "curAnimationMode", "getAnimationMode", "setAnimationMode", "animationMode"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import r from"../types/CalendarType.js";import{getCalendarType as a,getSecondaryCalendarType as d}from"../InitialConfiguration.js";let n,e;const t=()=>(n===void 0&&(n=a()),n&&n in r?n:r.Gregorian),y=()=>(e===void 0&&(e=d()),e&&e in r,e);export{t as getCalendarType,y as getSecondaryCalendarType};
|
|
2
|
+
//# sourceMappingURL=CalendarType.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/CalendarType.ts"],
|
|
4
|
+
"sourcesContent": ["import CalendarType from \"../types/CalendarType.js\";\nimport {\n\tgetCalendarType as getConfiguredCalendarType,\n\tgetSecondaryCalendarType as getConfiguredSecondaryCalendarType,\n} from \"../InitialConfiguration.js\";\n\nlet calendarType: CalendarType | undefined;\nlet secondaryCalendarType: CalendarType | undefined;\n\n/**\n * Returns the configured or default calendar type.\n * @public\n * @returns { CalendarType } the effective calendar type\n */\nconst getCalendarType = (): CalendarType => {\n\tif (calendarType === undefined) {\n\t\tcalendarType = getConfiguredCalendarType();\n\t}\n\n\tif (calendarType && calendarType in CalendarType) {\n\t\treturn calendarType;\n\t}\n\n\treturn CalendarType.Gregorian;\n};\n\n/**\n * Returns the configured secondary calendar type.\n * @public\n * @returns { CalendarType | undefined } the effective calendar type\n * @since 1.18.0\n */\nconst getSecondaryCalendarType = (): CalendarType | undefined => {\n\tif (secondaryCalendarType === undefined) {\n\t\tsecondaryCalendarType = getConfiguredSecondaryCalendarType();\n\t}\n\n\tif (secondaryCalendarType && secondaryCalendarType in CalendarType) {\n\t\treturn secondaryCalendarType;\n\t}\n\n\treturn secondaryCalendarType;\n};\n\nexport {\n\tgetCalendarType,\n\tgetSecondaryCalendarType,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAOA,MAAkB,2BACzB,OACC,mBAAmBC,EACnB,4BAA4BC,MACtB,6BAEP,IAAIC,EACAC,EAOJ,MAAMC,EAAkB,KACnBF,IAAiB,SACpBA,EAAeF,EAA0B,GAGtCE,GAAgBA,KAAgBH,EAC5BG,EAGDH,EAAa,WASfM,EAA2B,KAC5BF,IAA0B,SAC7BA,EAAwBF,EAAmC,GAGxDE,GAAyBA,KAAyBJ,EAC9CI,GAMT,OACCC,KAAA,gBACAC,KAAA",
|
|
6
|
+
"names": ["CalendarType", "getConfiguredCalendarType", "getConfiguredSecondaryCalendarType", "calendarType", "secondaryCalendarType", "getCalendarType", "getSecondaryCalendarType"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import e from"../features/LegacyDateFormats.js";import{getFormatSettings as a}from"../InitialConfiguration.js";import{getFeature as r}from"../FeaturesRegistry.js";let t;const o=()=>(t===void 0&&(t=a()),t.firstDayOfWeek),n=r("LegacyDateFormats"),g=n?e.getLegacyDateCalendarCustomizing:()=>[];export{o as getFirstDayOfWeek,g as getLegacyDateCalendarCustomizing};
|
|
2
|
+
//# sourceMappingURL=FormatSettings.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/FormatSettings.ts"],
|
|
4
|
+
"sourcesContent": ["import LegacyDateFormats from \"../features/LegacyDateFormats.js\";\nimport type { LegacyDateCalendarCustomizing } from \"../features/LegacyDateFormats.js\";\nimport { getFormatSettings } from \"../InitialConfiguration.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\n\ntype FormatSettings = {\n\tfirstDayOfWeek?: number,\n\tlegacyDateCalendarCustomizing?: LegacyDateCalendarCustomizing,\n};\n\nlet formatSettings: FormatSettings;\n\n/**\n * Returns the first day of the week from the configured format settings or based on the current locale.\n * @public\n * @returns {Number} 0 (Sunday) through 6 (Saturday)\n */\nconst getFirstDayOfWeek = (): number | undefined => {\n\tif (formatSettings === undefined) {\n\t\tformatSettings = getFormatSettings();\n\t}\n\n\treturn formatSettings.firstDayOfWeek;\n};\n\nconst legacyDateFormats = getFeature<typeof LegacyDateFormats>(\"LegacyDateFormats\");\n\nconst getLegacyDateCalendarCustomizing = legacyDateFormats ? LegacyDateFormats.getLegacyDateCalendarCustomizing : () => { return []; };\n\nexport {\n\tgetFirstDayOfWeek,\n\tgetLegacyDateCalendarCustomizing,\n};\n\nexport type { FormatSettings };\n"],
|
|
5
|
+
"mappings": "aAAA,OAAOA,MAAuB,mCAE9B,OAAS,qBAAAC,MAAyB,6BAClC,OAAS,cAAAC,MAAkB,yBAO3B,IAAIC,EAOJ,MAAMC,EAAoB,KACrBD,IAAmB,SACtBA,EAAiBF,EAAkB,GAG7BE,EAAe,gBAGjBE,EAAoBH,EAAqC,mBAAmB,EAE5EI,EAAmCD,EAAoBL,EAAkB,iCAAmC,IAAe,CAAC,EAElI,OACCI,KAAA,kBACAE,KAAA",
|
|
6
|
+
"names": ["LegacyDateFormats", "getFormatSettings", "getFeature", "formatSettings", "getFirstDayOfWeek", "legacyDateFormats", "getLegacyDateCalendarCustomizing"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/Icons.ts"],
|
|
4
|
+
"sourcesContent": ["const IconCollectionConfiguration = new Map<string, string>();\n\n// All supported icon collections + unknown custom ones\ntype IconCollection = string;\n\n/**\n * Sets the default icon collection for a given theme.\n *\n * SAP Icons is the default icon collection (that resolves to SAP-icons version 5.x in Horizon theme family and SAP-icons version 4.x in all other themes)\n * and to display icons from other collections, you have to specify the icon collection in addition to the icon name, for example: \"tnt/actor\", \"business-suite/1x2-grid-layout\", etc.\n * This method allows setting another (built-in or custom) icon collection as default per theme.\n *\n * **Usage**\n * **For example**, to make \"SAP-icons version 5.x\" the default icon collection in \"sap_fiori_3\":\n *\n * ```\n * setDefaultIconCollection(\"sap_fiori_3\", \"SAP-icons-v5\");\n *\n * <ui5-icon name=\"home\"></ui5-icon>\n * ```\n *\n * **For example**, to make a custom icon collection (with name \"my-custom-collection\") the default icon collection in \"sap_fiori_3\":\n *\n * ```\n * setDefaultIconCollection(\"sap_fiori_3\", \"my-custom-collection\");\n *\n * <ui5-icon name=\"custom-icon-name\"></ui5-icon>\n * ```\n *\n * @public\n * @param { string } theme\n * @param { string } collectionName\n */\nconst setDefaultIconCollection = (theme: string, collectionName: IconCollection) => {\n\tIconCollectionConfiguration.set(theme, collectionName);\n};\n\n/**\n * Returns the configured default icon collection for a given theme.\n *\n * @param { string } theme\n * @public\n * @returns { string | undefined }\n */\nconst getDefaultIconCollection = (theme: string): string | undefined => {\n\treturn IconCollectionConfiguration.get(theme);\n};\n\nexport {\n\tsetDefaultIconCollection,\n\tgetDefaultIconCollection,\n};\n\nexport type {\n\tIconCollection,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,MAAMA,EAA8B,IAAI,IAiClCC,EAA2B,CAACC,EAAeC,IAAmC,CACnFH,EAA4B,IAAIE,EAAOC,CAAc,CACtD,EASMC,EAA4BF,GAC1BF,EAA4B,IAAIE,CAAK,EAG7C,OACCD,KAAA,yBACAG,KAAA",
|
|
6
|
+
"names": ["IconCollectionConfiguration", "setDefaultIconCollection", "theme", "collectionName", "getDefaultIconCollection"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import{getLanguage as g,getFetchDefaultLanguage as r}from"../InitialConfiguration.js";import{fireLanguageChange as u}from"../locale/languageChange.js";import{reRenderAllUI5Elements as o}from"../Render.js";import{DEFAULT_LANGUAGE as i}from"../generated/AssetParameters.js";import{isBooted as f}from"../Boot.js";let t,n;const s=()=>(t===void 0&&(t=g()),t),L=async e=>{t!==e&&(t=e,f()&&(await u(e),await o({languageAware:!0})))},d=()=>i,a=e=>{n=e},l=()=>(n===void 0&&a(r()),n);export{s as getLanguage,L as setLanguage,d as getDefaultLanguage,a as setFetchDefaultLanguage,l as getFetchDefaultLanguage};
|
|
2
|
+
//# sourceMappingURL=Language.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/Language.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n\tgetLanguage as getConfiguredLanguage,\n\tgetFetchDefaultLanguage as getConfiguredFetchDefaultLanguage,\n} from \"../InitialConfiguration.js\";\nimport { fireLanguageChange } from \"../locale/languageChange.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport { DEFAULT_LANGUAGE } from \"../generated/AssetParameters.js\";\nimport { isBooted } from \"../Boot.js\";\n\nlet curLanguage: string | undefined;\nlet fetchDefaultLanguage: boolean;\n\n/**\n * Returns the currently configured language, or the browser language as a fallback.\n * @public\n * @returns {string}\n */\nconst getLanguage = (): string | undefined => {\n\tif (curLanguage === undefined) {\n\t\tcurLanguage = getConfiguredLanguage();\n\t}\n\treturn curLanguage;\n};\n\n/**\n * Changes the current language, re-fetches all message bundles, updates all language-aware components\n * and returns a promise that resolves when all rendering is done.\n *\n * @param {string} language\n * @public\n * @returns {Promise<void>}\n */\nconst setLanguage = async (language: string): Promise<void> => {\n\tif (curLanguage === language) {\n\t\treturn;\n\t}\n\n\tcurLanguage = language;\n\n\tif (isBooted()) {\n\t\tawait fireLanguageChange(language);\n\t\tawait reRenderAllUI5Elements({ languageAware: true });\n\t}\n};\n\n/**\n * Returns the default languague.\n *\n * Note: Default language might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultLanguage = (): string => {\n\treturn DEFAULT_LANGUAGE;\n};\n\n/**\n * Defines if the default language, that is inlined, should be\n * fetched over the network instead of using the inlined one.\n * **Note:** By default the language will not be fetched.\n *\n * @public\n * @param {boolean} fetchDefaultLang\n */\nconst setFetchDefaultLanguage = (fetchDefaultLang: boolean) => {\n\tfetchDefaultLanguage = fetchDefaultLang;\n};\n\n/**\n * Returns if the default language, that is inlined, should be fetched over the network.\n * @public\n * @returns {boolean}\n */\nconst getFetchDefaultLanguage = (): boolean => {\n\tif (fetchDefaultLanguage === undefined) {\n\t\tsetFetchDefaultLanguage(getConfiguredFetchDefaultLanguage());\n\t}\n\n\treturn fetchDefaultLanguage;\n};\n\nexport {\n\tgetLanguage,\n\tsetLanguage,\n\tgetDefaultLanguage,\n\tsetFetchDefaultLanguage,\n\tgetFetchDefaultLanguage,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OACC,eAAeA,EACf,2BAA2BC,MACrB,6BACP,OAAS,sBAAAC,MAA0B,8BACnC,OAAS,0BAAAC,MAA8B,eACvC,OAAS,oBAAAC,MAAwB,kCACjC,OAAS,YAAAC,MAAgB,aAEzB,IAAIC,EACAC,EAOJ,MAAMC,EAAc,KACfF,IAAgB,SACnBA,EAAcN,EAAsB,GAE9BM,GAWFG,EAAc,MAAOC,GAAoC,CAC1DJ,IAAgBI,IAIpBJ,EAAcI,EAEVL,EAAS,IACZ,MAAMH,EAAmBQ,CAAQ,EACjC,MAAMP,EAAuB,CAAE,cAAe,EAAK,CAAC,GAEtD,EAUMQ,EAAqB,IACnBP,EAWFQ,EAA2BC,GAA8B,CAC9DN,EAAuBM,CACxB,EAOMC,EAA0B,KAC3BP,IAAyB,QAC5BK,EAAwBX,EAAkC,CAAC,EAGrDM,GAGR,OACCC,KAAA,YACAC,KAAA,YACAE,KAAA,mBACAC,KAAA,wBACAE,KAAA",
|
|
6
|
+
"names": ["getConfiguredLanguage", "getConfiguredFetchDefaultLanguage", "fireLanguageChange", "reRenderAllUI5Elements", "DEFAULT_LANGUAGE", "isBooted", "curLanguage", "fetchDefaultLanguage", "getLanguage", "setLanguage", "language", "getDefaultLanguage", "setFetchDefaultLanguage", "fetchDefaultLang", "getFetchDefaultLanguage"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import{getNoConflict as i}from"../InitialConfiguration.js";const r=["value-changed","click"];let e;const c=t=>r.includes(t),s=t=>{const n=o();return!(typeof n!="boolean"&&n.events&&n.events.includes&&n.events.includes(t))},o=()=>(e===void 0&&(e=i()),e),l=t=>{e=t},a=t=>{const n=o();return c(t)?!1:n===!0?!0:!s(t)};export{o as getNoConflict,l as setNoConflict,a as skipOriginalEvent};
|
|
2
|
+
//# sourceMappingURL=NoConflict.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/NoConflict.ts"],
|
|
4
|
+
"sourcesContent": ["import { getNoConflict as getConfiguredNoConflict } from \"../InitialConfiguration.js\";\n\n// Fire these events even with noConflict: true\nconst excludeList = [\n\t\"value-changed\",\n\t\"click\",\n];\n\ntype NoConflictData = boolean | { events: Array<string>};\n\nlet noConflict: NoConflictData;\n\nconst shouldFireOriginalEvent = (eventName: string) => {\n\treturn excludeList.includes(eventName);\n};\n\nconst shouldNotFireOriginalEvent = (eventName: string) => {\n\tconst nc = getNoConflict();\n\t// return !(nc.events && nc.events.includes && nc.events.includes(eventName));\n\treturn !(typeof nc !== \"boolean\" && nc.events && nc.events.includes && nc.events.includes(eventName));\n};\n\n/**\n * Returns if the \"noConflict\" configuration is set.\n * @public\n * @returns { NoConflictData }\n */\nconst getNoConflict = (): NoConflictData => {\n\tif (noConflict === undefined) {\n\t\tnoConflict = getConfiguredNoConflict();\n\t}\n\n\treturn noConflict;\n};\n\n/**\n * Sets the \"noConflict\" mode.\n * - When \"false\" (default value), all custom events are fired with and without the \"ui5-\" prefix.\n * - When \"true\", all custom events are fired with the \"ui5-\" prefix only.\n * - When an object is supplied, just the specified events will be fired with the \"ui5-\" prefix.\n * @public\n * @param { NoConflictData } noConflictData\n */\nconst setNoConflict = (noConflictData: NoConflictData) => {\n\tnoConflict = noConflictData;\n};\n\nconst skipOriginalEvent = (eventName: string) => {\n\tconst nc = getNoConflict();\n\n\t// Always fire these events\n\tif (shouldFireOriginalEvent(eventName)) {\n\t\treturn false;\n\t}\n\n\t// Read from the configuration\n\tif (nc === true) {\n\t\treturn true;\n\t}\n\n\treturn !shouldNotFireOriginalEvent(eventName);\n};\n\nexport {\n\tgetNoConflict,\n\tsetNoConflict,\n\tskipOriginalEvent,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,iBAAiBA,MAA+B,6BAGzD,MAAMC,EAAc,CACnB,gBACA,OACD,EAIA,IAAIC,EAEJ,MAAMC,EAA2BC,GACzBH,EAAY,SAASG,CAAS,EAGhCC,EAA8BD,GAAsB,CACzD,MAAME,EAAKC,EAAc,EAEzB,MAAO,EAAE,OAAOD,GAAO,WAAaA,EAAG,QAAUA,EAAG,OAAO,UAAYA,EAAG,OAAO,SAASF,CAAS,EACpG,EAOMG,EAAgB,KACjBL,IAAe,SAClBA,EAAaF,EAAwB,GAG/BE,GAWFM,EAAiBC,GAAmC,CACzDP,EAAaO,CACd,EAEMC,EAAqBN,GAAsB,CAChD,MAAME,EAAKC,EAAc,EAGzB,OAAIJ,EAAwBC,CAAS,EAC7B,GAIJE,IAAO,GACH,GAGD,CAACD,EAA2BD,CAAS,CAC7C,EAEA,OACCG,KAAA,cACAC,KAAA,cACAE,KAAA",
|
|
6
|
+
"names": ["getConfiguredNoConflict", "excludeList", "noConflict", "shouldFireOriginalEvent", "eventName", "shouldNotFireOriginalEvent", "nc", "getNoConflict", "setNoConflict", "noConflictData", "skipOriginalEvent"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import{getTheme as s}from"../InitialConfiguration.js";import{reRenderAllUI5Elements as o}from"../Render.js";import m from"../theming/applyTheme.js";import a from"../theming/getThemeDesignerTheme.js";import{DEFAULT_THEME as T,SUPPORTED_THEMES as h}from"../generated/AssetParameters.js";import{boot as c,isBooted as g}from"../Boot.js";let t;const r=()=>(t===void 0&&(t=s()),t),u=async e=>{t!==e&&(t=e,g()&&(await m(t),await o({themeAware:!0})))},f=()=>T,p=e=>{const n=r();return n===e||n===`${e}_exp`},i=()=>{const e=r();return y(e)?!e.startsWith("sap_horizon"):!a()?.baseThemeName?.startsWith("sap_horizon")},l=async()=>(await c(),i()),y=e=>h.includes(e);export{r as getTheme,u as setTheme,p as isTheme,i as isLegacyThemeFamily,l as isLegacyThemeFamilyAsync,f as getDefaultTheme};
|
|
2
|
+
//# sourceMappingURL=Theme.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/Theme.ts"],
|
|
4
|
+
"sourcesContent": ["import { getTheme as getConfiguredTheme } from \"../InitialConfiguration.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport applyTheme from \"../theming/applyTheme.js\";\nimport getThemeDesignerTheme from \"../theming/getThemeDesignerTheme.js\";\nimport { DEFAULT_THEME, SUPPORTED_THEMES } from \"../generated/AssetParameters.js\";\nimport { boot, isBooted } from \"../Boot.js\";\n\nlet curTheme: string;\n\n/**\n * Returns the current theme.\n * @public\n * @returns {string} the current theme name\n */\nconst getTheme = (): string => {\n\tif (curTheme === undefined) {\n\t\tcurTheme = getConfiguredTheme();\n\t}\n\n\treturn curTheme;\n};\n\n/**\n * Applies a new theme after fetching its assets from the network.\n * @public\n * @param {string} theme the name of the new theme\n * @returns {Promise<void>} a promise that is resolved when the new theme assets have been fetched and applied to the DOM\n */\nconst setTheme = async (theme: string): Promise<void> => {\n\tif (curTheme === theme) {\n\t\treturn;\n\t}\n\n\tcurTheme = theme;\n\n\tif (isBooted()) {\n\t\t// Update CSS Custom Properties\n\t\tawait applyTheme(curTheme);\n\t\tawait reRenderAllUI5Elements({ themeAware: true });\n\t}\n};\n\n/**\n * Returns the default theme.\n *\n * Note: Default theme might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultTheme = (): string => {\n\treturn DEFAULT_THEME;\n};\n\n/**\n * Returns if the given theme name is the one currently applied.\n * @private\n * @param {string} theme\n * @returns {boolean}\n */\nconst isTheme = (theme: string) => {\n\tconst currentTheme = getTheme();\n\treturn currentTheme === theme || currentTheme === `${theme}_exp`;\n};\n\n/**\n * Returns if the currently set theme is part of legacy theme families (\"sap_fiori_3\").\n * **Note**: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.\n *\n * @private\n * @returns { boolean }\n */\nconst isLegacyThemeFamily = () => {\n\tconst currentTheme = getTheme();\n\n\tif (!isKnownTheme(currentTheme)) {\n\t\treturn !getThemeDesignerTheme()?.baseThemeName?.startsWith(\"sap_horizon\");\n\t}\n\n\treturn !currentTheme.startsWith(\"sap_horizon\");\n};\n\nconst isLegacyThemeFamilyAsync = async () => {\n\tawait boot();\n\treturn isLegacyThemeFamily();\n};\n\nconst isKnownTheme = (theme: string) => SUPPORTED_THEMES.includes(theme);\n\nexport {\n\tgetTheme,\n\tsetTheme,\n\tisTheme,\n\tisLegacyThemeFamily,\n\tisLegacyThemeFamilyAsync,\n\tgetDefaultTheme,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,YAAYA,MAA0B,6BAC/C,OAAS,0BAAAC,MAA8B,eACvC,OAAOC,MAAgB,2BACvB,OAAOC,MAA2B,sCAClC,OAAS,iBAAAC,EAAe,oBAAAC,MAAwB,kCAChD,OAAS,QAAAC,EAAM,YAAAC,MAAgB,aAE/B,IAAIC,EAOJ,MAAMC,EAAW,KACZD,IAAa,SAChBA,EAAWR,EAAmB,GAGxBQ,GASFE,EAAW,MAAOC,GAAiC,CACpDH,IAAaG,IAIjBH,EAAWG,EAEPJ,EAAS,IAEZ,MAAML,EAAWM,CAAQ,EACzB,MAAMP,EAAuB,CAAE,WAAY,EAAK,CAAC,GAEnD,EAUMW,EAAkB,IAChBR,EASFS,EAAWF,GAAkB,CAClC,MAAMG,EAAeL,EAAS,EAC9B,OAAOK,IAAiBH,GAASG,IAAiB,GAAGH,CAAK,MAC3D,EASMI,EAAsB,IAAM,CACjC,MAAMD,EAAeL,EAAS,EAE9B,OAAKO,EAAaF,CAAY,EAIvB,CAACA,EAAa,WAAW,aAAa,EAHrC,CAACX,EAAsB,GAAG,eAAe,WAAW,aAAa,CAI1E,EAEMc,EAA2B,UAChC,MAAMX,EAAK,EACJS,EAAoB,GAGtBC,EAAgBL,GAAkBN,EAAiB,SAASM,CAAK,EAEvE,OACCF,KAAA,SACAC,KAAA,SACAG,KAAA,QACAE,KAAA,oBACAE,KAAA,yBACAL,KAAA",
|
|
6
|
+
"names": ["getConfiguredTheme", "reRenderAllUI5Elements", "applyTheme", "getThemeDesignerTheme", "DEFAULT_THEME", "SUPPORTED_THEMES", "boot", "isBooted", "curTheme", "getTheme", "setTheme", "theme", "getDefaultTheme", "isTheme", "currentTheme", "isLegacyThemeFamily", "isKnownTheme", "isLegacyThemeFamilyAsync"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import r from"../util/createLinkInHead.js";import s from"../validateThemeRoot.js";import{getThemeRoot as m}from"../InitialConfiguration.js";import{getTheme as a}from"./Theme.js";let t;const n=()=>(t===void 0&&(t=m()),t),d=e=>{if(t!==e){if(t=e,!s(e)){console.warn(`The ${e} is not valid. Check the allowed origins as suggested in the "setThemeRoot" description.`);return}return i(a())}},c=e=>`${n()}Base/baseLib/${e}/css_variables.css`,i=async e=>{const o=document.querySelector(`[sap-ui-webcomponents-theme="${e}"]`);o&&document.head.removeChild(o),await r(c(e),{"sap-ui-webcomponents-theme":e})};export{n as getThemeRoot,d as setThemeRoot,i as attachCustomThemeStylesToHead};
|
|
2
|
+
//# sourceMappingURL=ThemeRoot.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/ThemeRoot.ts"],
|
|
4
|
+
"sourcesContent": ["import createLinkInHead from \"../util/createLinkInHead.js\";\nimport validateThemeRoot from \"../validateThemeRoot.js\";\nimport { getThemeRoot as getConfiguredThemeRoot } from \"../InitialConfiguration.js\";\nimport { getTheme } from \"./Theme.js\";\n\nlet currThemeRoot: string | undefined;\n\n/**\n * Returns the current theme root.\n *\n * @public\n * @since 1.14.0\n * @returns { string } the current theme root\n */\nconst getThemeRoot = (): string | undefined => {\n\tif (currThemeRoot === undefined) {\n\t\tcurrThemeRoot = getConfiguredThemeRoot();\n\t}\n\n\treturn currThemeRoot;\n};\n\n/**\n * Sets theme root for the current theme.\n * When set, the framework will validate the theme root and fetch the theme styles (CSS variables) from this location.\n *\n * **Note:** The feature is specific to custom themes, created with the `UI Theme Designer`.\n * The provided theme root is used only as a base to construct the actual location of the theme styles: `{themeRoot}/.../css_variables.css`.\n *\n * **Note:** Certain security restrictions will apply before fetching the theme assets.\n * Absolute URLs to a different origin than the current page will result in using the current page as an origin.\n * To allow specific origins, use <meta name=\"sap-allowedThemeOrigins\" content=\"https://my-example-host.com/\"> tag inside the <head> of the page.\n *\n * @public\n * @since 1.14.0\n * @param { string } themeRoot the new theme root\n * @returns { Promise<void> }\n */\nconst setThemeRoot = (themeRoot: string): Promise<void> | undefined => {\n\tif (currThemeRoot === themeRoot) {\n\t\treturn;\n\t}\n\n\tcurrThemeRoot = themeRoot;\n\n\tif (!validateThemeRoot(themeRoot)) {\n\t\tconsole.warn(`The ${themeRoot} is not valid. Check the allowed origins as suggested in the \"setThemeRoot\" description.`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\treturn attachCustomThemeStylesToHead(getTheme());\n};\n\nconst formatThemeLink = (theme: string) => {\n\treturn `${getThemeRoot()!}Base/baseLib/${theme}/css_variables.css`; // theme root is always set at this point.\n};\n\nconst attachCustomThemeStylesToHead = async (theme: string): Promise<void> => {\n\tconst link = document.querySelector(`[sap-ui-webcomponents-theme=\"${theme}\"]`);\n\n\tif (link) {\n\t\tdocument.head.removeChild(link);\n\t}\n\n\tawait createLinkInHead(formatThemeLink(theme), { \"sap-ui-webcomponents-theme\": theme });\n};\n\nexport {\n\tgetThemeRoot,\n\tsetThemeRoot,\n\tattachCustomThemeStylesToHead,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAOA,MAAsB,8BAC7B,OAAOC,MAAuB,0BAC9B,OAAS,gBAAgBC,MAA8B,6BACvD,OAAS,YAAAC,MAAgB,aAEzB,IAAIC,EASJ,MAAMC,EAAe,KAChBD,IAAkB,SACrBA,EAAgBF,EAAuB,GAGjCE,GAmBFE,EAAgBC,GAAiD,CACtE,GAAIH,IAAkBG,EAMtB,IAFAH,EAAgBG,EAEZ,CAACN,EAAkBM,CAAS,EAAG,CAClC,QAAQ,KAAK,OAAOA,CAAS,0FAA0F,EACvH,MACD,CAEA,OAAOC,EAA8BL,EAAS,CAAC,EAChD,EAEMM,EAAmBC,GACjB,GAAGL,EAAa,CAAE,gBAAgBK,CAAK,qBAGzCF,EAAgC,MAAOE,GAAiC,CAC7E,MAAMC,EAAO,SAAS,cAAc,gCAAgCD,CAAK,IAAI,EAEzEC,GACH,SAAS,KAAK,YAAYA,CAAI,EAG/B,MAAMX,EAAiBS,EAAgBC,CAAK,EAAG,CAAE,6BAA8BA,CAAM,CAAC,CACvF,EAEA,OACCL,KAAA,aACAC,KAAA,aACAE,KAAA",
|
|
6
|
+
"names": ["createLinkInHead", "validateThemeRoot", "getConfiguredThemeRoot", "getTheme", "currThemeRoot", "getThemeRoot", "setThemeRoot", "themeRoot", "attachCustomThemeStylesToHead", "formatThemeLink", "theme", "link"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/Timezone.ts"],
|
|
4
|
+
"sourcesContent": ["import { getTimezone as getConfiguredTimezone } from \"../InitialConfiguration.js\";\n\nlet currTimezone: string | undefined;\n\n/**\n * Returns the configured IANA timezone ID.\n *\n * @private\n * @returns {string}\n */\nconst getTimezone = (): string | undefined => {\n\tif (currTimezone === undefined) {\n\t\tcurrTimezone = getConfiguredTimezone();\n\t}\n\treturn currTimezone;\n};\n\n/**\n * Sets the IANA timezone ID.\n * **For example:** \"America/New_York\", \"Europe/London\", \"Australia/Sydney\", \"Asia/Bishkek\", etc.\n *>\n * @param {string} timezone\n * @private\n * @returns { Promise<void> }\n */\nconst setTimezone = (timezone: string) => {\n\tif (currTimezone === timezone) {\n\t\treturn;\n\t}\n\n\tcurrTimezone = timezone;\n};\n\nexport {\n\tgetTimezone,\n\tsetTimezone,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,eAAeA,MAA6B,6BAErD,IAAIC,EAQJ,MAAMC,EAAc,KACfD,IAAiB,SACpBA,EAAeD,EAAsB,GAE/BC,GAWFE,EAAeC,GAAqB,CACrCH,IAAiBG,IAIrBH,EAAeG,EAChB,EAEA,OACCF,KAAA,YACAC,KAAA",
|
|
6
|
+
"names": ["getConfiguredTimezone", "currTimezone", "getTimezone", "setTimezone", "timezone"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import{renderDeferred as m}from"./Render.js";const a=500,i=new Map,c=new Map,E=n=>{const r=n.host,l=n.propName,t=r[l];let o;if(t===void 0||t==="")o=void 0;else if(t instanceof HTMLElement)o=t;else{const d=r.getRootNode();o=d.getElementById&&d.getElementById(t)||void 0}const e=`${r._id}-${l}`,s=i.get(e);if(!o){if(s&&(n.onDisconnect&&n.onDisconnect(s),i.delete(e)),typeof t=="string"&&t&&!c.has(e)){const d=setInterval(()=>{const f=r.getRootNode();f.getElementById&&f.getElementById(t)&&(clearInterval(c.get(e)),c.delete(e),m(r))},a);c.set(e,d)}return}return c.has(e)&&(clearInterval(c.get(e)),c.delete(e)),s!==o&&(s&&n.onDisconnect&&n.onDisconnect(s),n.onConnect&&n.onConnect(o),i.set(e,o)),i.get(e)};export default E;
|
|
2
|
+
//# sourceMappingURL=connectToComponent.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/connectToComponent.ts"],
|
|
4
|
+
"sourcesContent": ["import type UI5Element from \"./UI5Element.js\";\nimport { renderDeferred } from \"./Render.js\";\nimport { Interval } from \"./types.js\";\n\nconst MISSING_ELEMENT_POLL_TIMEOUT = 500; // how often to poll for not-yet-in-DOM friend elements\nconst connections = new Map<string, HTMLElement>();\nconst intervals = new Map<string, Interval>();\n\ntype ConnectOptions = {\n\thost: UI5Element;\n\tpropName: string;\n\tonConnect?: (friend: HTMLElement) => void;\n\tonDisconnect?: (friend: HTMLElement) => void;\n}\n\nconst connectToComponent = (options: ConnectOptions): HTMLElement | undefined => {\n\tconst host = options.host;\n\tconst propName = options.propName;\n\tconst friend = host[propName as keyof typeof host] as HTMLElement | string | undefined;\n\n\tlet connectedTo: HTMLElement | undefined;\n\tif (friend === undefined || friend === \"\") {\n\t\tconnectedTo = undefined; // do not return early even if a \"menu\" property is not set - it may have been set before and cleanup must run\n\t} else if (friend instanceof HTMLElement) {\n\t\tconnectedTo = friend;\n\t} else {\n\t\tconst rootNode = host.getRootNode() as Document;\n\t\tconnectedTo = (rootNode.getElementById && rootNode.getElementById(friend)) || undefined;\n\t}\n\n\tconst key = `${host._id}-${propName}`;\n\tconst prevConnectedTo = connections.get(key);\n\n\t// Not connected - return undefined\n\tif (!connectedTo) {\n\t\tif (prevConnectedTo) { // but first disconnect, if needed\n\t\t\toptions.onDisconnect && options.onDisconnect(prevConnectedTo);\n\t\t\tconnections.delete(key);\n\t\t}\n\n\t\t// if friend element not in DOM yet, start polling\n\t\tif (typeof friend === \"string\" && friend && !intervals.has(key)) {\n\t\t\tconst interval = setInterval(() => {\n\t\t\t\tconst rootNode = host.getRootNode() as Document;\n\t\t\t\tconst found = (rootNode.getElementById && rootNode.getElementById(friend));\n\n\t\t\t\tif (found) {\n\t\t\t\t\tclearInterval(intervals.get(key));\n\t\t\t\t\tintervals.delete(key);\n\t\t\t\t\trenderDeferred(host);\n\t\t\t\t}\n\t\t\t}, MISSING_ELEMENT_POLL_TIMEOUT);\n\t\t\tintervals.set(key, interval);\n\t\t}\n\n\t\treturn;\n\t}\n\n\t// If connected, but still polling, stop polling\n\tif (intervals.has(key)) {\n\t\tclearInterval(intervals.get(key));\n\t\tintervals.delete(key);\n\t}\n\n\t// Connected - either for the first time, or to something else\n\tif (prevConnectedTo !== connectedTo) {\n\t\tif (prevConnectedTo) {\n\t\t\toptions.onDisconnect && options.onDisconnect(prevConnectedTo);\n\t\t}\n\t\toptions.onConnect && options.onConnect(connectedTo);\n\t\tconnections.set(key, connectedTo);\n\t}\n\n\treturn connections.get(key);\n};\n\nexport default connectToComponent;\n"],
|
|
5
|
+
"mappings": "aACA,OAAS,kBAAAA,MAAsB,cAG/B,MAAMC,EAA+B,IAC/BC,EAAc,IAAI,IAClBC,EAAY,IAAI,IAShBC,EAAsBC,GAAqD,CAChF,MAAMC,EAAOD,EAAQ,KACfE,EAAWF,EAAQ,SACnBG,EAASF,EAAKC,CAA6B,EAEjD,IAAIE,EACJ,GAAID,IAAW,QAAaA,IAAW,GACtCC,EAAc,eACJD,aAAkB,YAC5BC,EAAcD,MACR,CACN,MAAME,EAAWJ,EAAK,YAAY,EAClCG,EAAeC,EAAS,gBAAkBA,EAAS,eAAeF,CAAM,GAAM,MAC/E,CAEA,MAAMG,EAAM,GAAGL,EAAK,GAAG,IAAIC,CAAQ,GAC7BK,EAAkBV,EAAY,IAAIS,CAAG,EAG3C,GAAI,CAACF,EAAa,CAOjB,GANIG,IACHP,EAAQ,cAAgBA,EAAQ,aAAaO,CAAe,EAC5DV,EAAY,OAAOS,CAAG,GAInB,OAAOH,GAAW,UAAYA,GAAU,CAACL,EAAU,IAAIQ,CAAG,EAAG,CAChE,MAAME,EAAW,YAAY,IAAM,CAClC,MAAMH,EAAWJ,EAAK,YAAY,EACnBI,EAAS,gBAAkBA,EAAS,eAAeF,CAAM,IAGvE,cAAcL,EAAU,IAAIQ,CAAG,CAAC,EAChCR,EAAU,OAAOQ,CAAG,EACpBX,EAAeM,CAAI,EAErB,EAAGL,CAA4B,EAC/BE,EAAU,IAAIQ,EAAKE,CAAQ,CAC5B,CAEA,MACD,CAGA,OAAIV,EAAU,IAAIQ,CAAG,IACpB,cAAcR,EAAU,IAAIQ,CAAG,CAAC,EAChCR,EAAU,OAAOQ,CAAG,GAIjBC,IAAoBH,IACnBG,GACHP,EAAQ,cAAgBA,EAAQ,aAAaO,CAAe,EAE7DP,EAAQ,WAAaA,EAAQ,UAAUI,CAAW,EAClDP,EAAY,IAAIS,EAAKF,CAAW,GAG1BP,EAAY,IAAIS,CAAG,CAC3B,EAEA,eAAeP",
|
|
6
|
+
"names": ["renderDeferred", "MISSING_ELEMENT_POLL_TIMEOUT", "connections", "intervals", "connectToComponent", "options", "host", "propName", "friend", "connectedTo", "rootNode", "key", "prevConnectedTo", "interval"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const m=(a={})=>e=>{if(Object.prototype.hasOwnProperty.call(e,"metadata")||(e.metadata={}),typeof a=="string"){e.metadata.tag=a;return}const{tag:i,languageAware:o,themeAware:s,fastNavigation:r,formAssociated:n,shadowRootOptions:l}=a;e.metadata.tag=i,o&&(e.metadata.languageAware=o),s&&(e.metadata.themeAware=s),r&&(e.metadata.fastNavigation=r),n&&(e.metadata.formAssociated=n),l&&(e.metadata.shadowRootOptions=l),["renderer","template","styles","dependencies"].forEach(t=>{a[t]&&Object.defineProperty(e,t,{get:()=>a[t]})})};export default m;
|
|
2
|
+
//# sourceMappingURL=customElement.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/decorators/customElement.ts"],
|
|
4
|
+
"sourcesContent": ["import type UI5Element from \"../UI5Element.js\";\nimport type { Renderer } from \"../UI5Element.js\";\nimport type { TemplateFunction as Template } from \"../renderer/executeTemplate.js\";\nimport type { ComponentStylesData as Styles } from \"../types.js\";\n\n/**\n * Returns a custom element class decorator.\n *\n * @param { string | object } tagNameOrComponentSettings\n * @returns { ClassDecorator }\n */\nconst customElement = (tagNameOrComponentSettings: string | {\n\ttag?: string,\n\trenderer?: Renderer,\n\tstyles?: Styles,\n\ttemplate?: Template,\n\tdependencies?: Array<typeof UI5Element>,\n\tlanguageAware?: boolean,\n\tthemeAware?: boolean,\n\tfastNavigation?: boolean,\n\tformAssociated?: boolean,\n\tshadowRootOptions?: Partial<ShadowRootInit>,\n} = {}): ClassDecorator => {\n\treturn (target: any) => {\n\t\tif (!Object.prototype.hasOwnProperty.call(target, \"metadata\")) {\n\t\t\ttarget.metadata = {};\n\t\t}\n\n\t\tif (typeof tagNameOrComponentSettings === \"string\") {\n\t\t\ttarget.metadata.tag = tagNameOrComponentSettings;\n\t\t\treturn;\n\t\t}\n\n\t\tconst {\n\t\t\ttag,\n\t\t\tlanguageAware,\n\t\t\tthemeAware,\n\t\t\tfastNavigation,\n\t\t\tformAssociated,\n\t\t\tshadowRootOptions,\n\t\t } = tagNameOrComponentSettings;\n\n\t\ttarget.metadata.tag = tag;\n\t\tif (languageAware) {\n\t\t\ttarget.metadata.languageAware = languageAware;\n\t\t}\n\t\tif (themeAware) {\n\t\t\ttarget.metadata.themeAware = themeAware;\n\t\t}\n\t\tif (fastNavigation) {\n\t\t\ttarget.metadata.fastNavigation = fastNavigation;\n\t\t}\n\t\tif (formAssociated) {\n\t\t\ttarget.metadata.formAssociated = formAssociated;\n\t\t}\n\n\t\tif (shadowRootOptions) {\n\t\t\ttarget.metadata.shadowRootOptions = shadowRootOptions;\n\t\t}\n\n\t\t[\"renderer\", \"template\", \"styles\", \"dependencies\"].forEach((customElementEntity: string) => {\n\t\t\tconst customElementEntityValue = tagNameOrComponentSettings[customElementEntity as keyof typeof tag];\n\n\t\t\tcustomElementEntityValue && Object.defineProperty(target, customElementEntity, {\n\t\t\t\tget: () => tagNameOrComponentSettings[customElementEntity as keyof typeof tag],\n\t\t\t});\n\t\t});\n\t};\n};\n\nexport default customElement;\n"],
|
|
5
|
+
"mappings": "aAWA,MAAMA,EAAgB,CAACC,EAWnB,CAAC,IACIC,GAAgB,CAKvB,GAJK,OAAO,UAAU,eAAe,KAAKA,EAAQ,UAAU,IAC3DA,EAAO,SAAW,CAAC,GAGhB,OAAOD,GAA+B,SAAU,CACnDC,EAAO,SAAS,IAAMD,EACtB,MACD,CAEA,KAAM,CACL,IAAAE,EACA,cAAAC,EACA,WAAAC,EACA,eAAAC,EACA,eAAAC,EACA,kBAAAC,CACA,EAAIP,EAELC,EAAO,SAAS,IAAMC,EAClBC,IACHF,EAAO,SAAS,cAAgBE,GAE7BC,IACHH,EAAO,SAAS,WAAaG,GAE1BC,IACHJ,EAAO,SAAS,eAAiBI,GAE9BC,IACHL,EAAO,SAAS,eAAiBK,GAG9BC,IACHN,EAAO,SAAS,kBAAoBM,GAGrC,CAAC,WAAY,WAAY,SAAU,cAAc,EAAE,QAASC,GAAgC,CAC1DR,EAA2BQ,CAAuC,GAEvE,OAAO,eAAeP,EAAQO,EAAqB,CAC9E,IAAK,IAAMR,EAA2BQ,CAAuC,CAC9E,CAAC,CACF,CAAC,CACF,EAGD,eAAeT",
|
|
6
|
+
"names": ["customElement", "tagNameOrComponentSettings", "target", "tag", "languageAware", "themeAware", "fastNavigation", "formAssociated", "shadowRootOptions", "customElementEntity"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/decorators/event.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Returns an event class decorator.\n *\n * @param { string } name the event name\n * @param { EventData } data the event data\n * @returns { ClassDecorator }\n */\nconst event = <EventDetail>(name: string, data: { detail?: Record<keyof EventDetail, { type: any }> } = {}): ClassDecorator => {\n\treturn (target: any) => {\n\t\tif (!Object.prototype.hasOwnProperty.call(target, \"metadata\")) {\n\t\t\ttarget.metadata = {};\n\t\t}\n\n\t\tconst metadata = target.metadata;\n\t\tif (!metadata.events) {\n\t\t\tmetadata.events = {};\n\t\t}\n\n\t\tconst eventsMetadata = metadata.events;\n\t\tif (!eventsMetadata[name]) {\n\t\t\teventsMetadata[name] = data;\n\t\t}\n\t};\n};\n\nexport default event;\n"],
|
|
5
|
+
"mappings": "aAOA,MAAMA,EAAQ,CAAcC,EAAcC,EAA8D,CAAC,IAChGC,GAAgB,CAClB,OAAO,UAAU,eAAe,KAAKA,EAAQ,UAAU,IAC3DA,EAAO,SAAW,CAAC,GAGpB,MAAMC,EAAWD,EAAO,SACnBC,EAAS,SACbA,EAAS,OAAS,CAAC,GAGpB,MAAMC,EAAiBD,EAAS,OAC3BC,EAAeJ,CAAI,IACvBI,EAAeJ,CAAI,EAAIC,EAEzB,EAGD,eAAeF",
|
|
6
|
+
"names": ["event", "name", "data", "target", "metadata", "eventsMetadata"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const s=a=>(p,e)=>{const t=p.constructor;Object.prototype.hasOwnProperty.call(t,"metadata")||(t.metadata={});const r=t.metadata;r.properties||(r.properties={});const o=r.properties;o[e]||(o[e]=a||{type:String})};export default s;
|
|
2
|
+
//# sourceMappingURL=property.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/decorators/property.ts"],
|
|
4
|
+
"sourcesContent": ["import type UI5Element from \"../UI5Element.js\";\nimport { Property } from \"../UI5ElementMetadata.js\";\n\n/**\n * Returns a property decorator.\n *\n * @param { Property } propData\n * @returns { PropertyDecorator }\n */\nconst property = (propData?: Property): PropertyDecorator => {\n\treturn (target: any, propertyKey: string | symbol) => {\n\t\tconst ctor = target.constructor as typeof UI5Element;\n\n\t\tif (!Object.prototype.hasOwnProperty.call(ctor, \"metadata\")) {\n\t\t\tctor.metadata = {};\n\t\t}\n\n\t\tconst metadata = ctor.metadata;\n\t\tif (!metadata.properties) {\n\t\t\tmetadata.properties = {};\n\t\t}\n\n\t\tconst propsMetadata = metadata.properties;\n\t\tif (!propsMetadata[propertyKey as string]) {\n\t\t\tpropsMetadata[propertyKey as string] = propData || { type: String };\n\t\t}\n\t};\n};\n\nexport default property;\n"],
|
|
5
|
+
"mappings": "aASA,MAAMA,EAAYC,GACV,CAACC,EAAaC,IAAiC,CACrD,MAAMC,EAAOF,EAAO,YAEf,OAAO,UAAU,eAAe,KAAKE,EAAM,UAAU,IACzDA,EAAK,SAAW,CAAC,GAGlB,MAAMC,EAAWD,EAAK,SACjBC,EAAS,aACbA,EAAS,WAAa,CAAC,GAGxB,MAAMC,EAAgBD,EAAS,WAC1BC,EAAcH,CAAqB,IACvCG,EAAcH,CAAqB,EAAIF,GAAY,CAAE,KAAM,MAAO,EAEpE,EAGD,eAAeD",
|
|
6
|
+
"names": ["property", "propData", "target", "propertyKey", "ctor", "metadata", "propsMetadata"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const f=e=>(l,n)=>{const r=l.constructor;Object.prototype.hasOwnProperty.call(r,"metadata")||(r.metadata={});const o=r.metadata;o.slots||(o.slots={});const t=o.slots;if(e&&e.default&&t.default)throw new Error("Only one slot can be the default slot.");const a=e&&e.default?"default":n;e=e||{type:HTMLElement},e.type||(e.type=HTMLElement),t[a]||(t[a]=e),e.default&&(delete t.default.default,t.default.propertyName=n),r.metadata.managedSlots=!0};export default f;
|
|
2
|
+
//# sourceMappingURL=slot.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/decorators/slot.ts"],
|
|
4
|
+
"sourcesContent": ["import type UI5Element from \"../UI5Element.js\";\nimport { Slot } from \"../UI5ElementMetadata.js\";\n\n/**\n * Returns a slot decorator.\n *\n * @param { Slot } slotData\n * @returns { PropertyDecorator }\n */\nconst slot = (slotData?: Slot): PropertyDecorator => {\n\treturn (target: any, slotKey: string | symbol) => {\n\t\tconst ctor = target.constructor as typeof UI5Element;\n\n\t\tif (!Object.prototype.hasOwnProperty.call(ctor, \"metadata\")) {\n\t\t\tctor.metadata = {};\n\t\t}\n\n\t\tconst metadata = ctor.metadata;\n\t\tif (!metadata.slots) {\n\t\t\tmetadata.slots = {};\n\t\t}\n\n\t\tconst slotMetadata = metadata.slots;\n\n\t\tif (slotData && slotData.default && slotMetadata.default) {\n\t\t\tthrow new Error(\"Only one slot can be the default slot.\");\n\t\t}\n\n\t\tconst key = slotData && slotData.default ? \"default\" : slotKey as string;\n\t\tslotData = slotData || { type: HTMLElement };\n\n\t\tif (!slotData.type) {\n\t\t\tslotData.type = HTMLElement;\n\t\t}\n\n\t\tif (!slotMetadata[key]) {\n\t\t\tslotMetadata[key] = slotData;\n\t\t}\n\n\t\tif (slotData.default) {\n\t\t\tdelete slotMetadata.default.default;\n\t\t\tslotMetadata.default.propertyName = slotKey as string;\n\t\t}\n\n\t\tctor.metadata.managedSlots = true;\n\t};\n};\n\nexport default slot;\n"],
|
|
5
|
+
"mappings": "aASA,MAAMA,EAAQC,GACN,CAACC,EAAaC,IAA6B,CACjD,MAAMC,EAAOF,EAAO,YAEf,OAAO,UAAU,eAAe,KAAKE,EAAM,UAAU,IACzDA,EAAK,SAAW,CAAC,GAGlB,MAAMC,EAAWD,EAAK,SACjBC,EAAS,QACbA,EAAS,MAAQ,CAAC,GAGnB,MAAMC,EAAeD,EAAS,MAE9B,GAAIJ,GAAYA,EAAS,SAAWK,EAAa,QAChD,MAAM,IAAI,MAAM,wCAAwC,EAGzD,MAAMC,EAAMN,GAAYA,EAAS,QAAU,UAAYE,EACvDF,EAAWA,GAAY,CAAE,KAAM,WAAY,EAEtCA,EAAS,OACbA,EAAS,KAAO,aAGZK,EAAaC,CAAG,IACpBD,EAAaC,CAAG,EAAIN,GAGjBA,EAAS,UACZ,OAAOK,EAAa,QAAQ,QAC5BA,EAAa,QAAQ,aAAeH,GAGrCC,EAAK,SAAS,aAAe,EAC9B,EAGD,eAAeJ",
|
|
6
|
+
"names": ["slot", "slotData", "target", "slotKey", "ctor", "metadata", "slotMetadata", "key"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/decorators.ts"],
|
|
4
|
+
"sourcesContent": ["import customElement from \"./decorators/customElement.js\";\nimport event from \"./decorators/event.js\";\nimport property from \"./decorators/property.js\";\nimport slot from \"./decorators/slot.js\";\n\nexport {\n\tcustomElement,\n\tevent,\n\tproperty,\n\tslot,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAOA,MAAmB,gCAC1B,OAAOC,MAAW,wBAClB,OAAOC,MAAc,2BACrB,OAAOC,MAAU,uBAEjB,OACCH,KAAA,cACAC,KAAA,MACAC,KAAA,SACAC,KAAA",
|
|
6
|
+
"names": ["customElement", "event", "property", "slot"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import{isDown as _,isUp as d,isLeft as h,isRight as a,isHome as I,isEnd as c,isPageDown as m,isPageUp as l}from"../Keys.js";import u from"../util/getActiveElement.js";import n from"../types/NavigationMode.js";import r from"../types/ItemNavigationBehavior.js";import{instanceOfUI5Element as g}from"../UI5Element.js";class f{constructor(e,t){if(!e.isUI5Element)throw new Error("The root web component must be a UI5 Element instance");if(this.rootWebComponent=e,this.rootWebComponent.addEventListener("keydown",this._onkeydown.bind(this)),this._initBound=this._init.bind(this),this.rootWebComponent.attachComponentStateFinalized(this._initBound),typeof t.getItemsCallback!="function")throw new Error("getItemsCallback is required");this._getItems=t.getItemsCallback,this._currentIndex=t.currentIndex||0,this._rowSize=t.rowSize||1,this._behavior=t.behavior||r.Static,this._navigationMode=t.navigationMode||n.Auto,this._affectedPropertiesNames=t.affectedPropertiesNames||[],this._skipItemsSize=t.skipItemsSize||null}setCurrentItem(e){const t=this._getItems().indexOf(e);if(t===-1){console.warn("The provided item is not managed by ItemNavigation",e);return}this._currentIndex=t,this._applyTabIndex()}setRowSize(e){this._rowSize=e}_init(){this._getItems().forEach((e,t)=>{e.forcedTabIndex=t===this._currentIndex?"0":"-1"})}_onkeydown(e){if(!this._canNavigate())return;const t=this._navigationMode===n.Horizontal||this._navigationMode===n.Auto,i=this._navigationMode===n.Vertical||this._navigationMode===n.Auto,s=this.rootWebComponent.effectiveDir==="rtl";if(s&&h(e)&&t)this._handleRight();else if(s&&a(e)&&t)this._handleLeft();else if(h(e)&&t)this._handleLeft();else if(a(e)&&t)this._handleRight();else if(d(e)&&i)this._handleUp();else if(_(e)&&i)this._handleDown();else if(I(e))this._handleHome();else if(c(e))this._handleEnd();else if(l(e))this._handlePageUp();else if(m(e))this._handlePageDown();else return;e.preventDefault(),this._applyTabIndex(),this._focusCurrentItem()}_handleUp(){const e=this._getItems().length;if(this._currentIndex-this._rowSize>=0){this._currentIndex-=this._rowSize;return}if(this._behavior===r.Cyclic){const t=this._currentIndex%this._rowSize,i=t===0?this._rowSize-1:t-1,s=Math.ceil(e/this._rowSize);let o=i+(s-1)*this._rowSize;o>e-1&&(o-=this._rowSize),this._currentIndex=o}else this._currentIndex=0}_handleDown(){const e=this._getItems().length;if(this._currentIndex+this._rowSize<e){this._currentIndex+=this._rowSize;return}if(this._behavior===r.Cyclic){const i=(this._currentIndex%this._rowSize+1)%this._rowSize;this._currentIndex=i}else this._currentIndex=e-1}_handleLeft(){const e=this._getItems().length;if(this._currentIndex>0){this._currentIndex-=1;return}this._behavior===r.Cyclic&&(this._currentIndex=e-1)}_handleRight(){const e=this._getItems().length;if(this._currentIndex<e-1){this._currentIndex+=1;return}this._behavior===r.Cyclic&&(this._currentIndex=0)}_handleHome(){const e=this._rowSize>1?this._rowSize:this._getItems().length;this._currentIndex-=this._currentIndex%e}_handleEnd(){const e=this._rowSize>1?this._rowSize:this._getItems().length;this._currentIndex+=e-1-this._currentIndex%e}_handlePageUp(){this._rowSize>1||this._handlePageUpFlat()}_handlePageDown(){this._rowSize>1||this._handlePageDownFlat()}_handlePageUpFlat(){if(this._skipItemsSize===null){this._currentIndex-=this._currentIndex;return}this._currentIndex+1>this._skipItemsSize?this._currentIndex-=this._skipItemsSize:this._currentIndex-=this._currentIndex}_handlePageDownFlat(){if(this._skipItemsSize===null){this._currentIndex=this._getItems().length-1;return}this._getItems().length-this._currentIndex-1>this._skipItemsSize?this._currentIndex+=this._skipItemsSize:this._currentIndex=this._getItems().length-1}_applyTabIndex(){const e=this._getItems();for(let t=0;t<e.length;t++)e[t].forcedTabIndex=t===this._currentIndex?"0":"-1";this._affectedPropertiesNames.forEach(t=>{const i=this.rootWebComponent[t];this.rootWebComponent[t]=Array.isArray(i)?[...i]:{...i}})}_focusCurrentItem(){const e=this._getCurrentItem();e&&e.focus()}_canNavigate(){const e=this._getCurrentItem(),t=u();return e&&e===t}_getCurrentItem(){const e=this._getItems();if(!e.length)return;for(;this._currentIndex>=e.length;)this._currentIndex-=this._rowSize;this._currentIndex<0&&(this._currentIndex=0);const t=e[this._currentIndex];if(!t)return;if(g(t))return t.getFocusDomRef();const i=this.rootWebComponent.getDomRef();if(i&&t.id)return i.querySelector(`[id="${t.id}"]`)}}export default f;export{};
|
|
2
|
+
//# sourceMappingURL=ItemNavigation.js.map
|