@ui5/webcomponents-base 0.0.0-9e104af01 → 0.0.0-a289c53b5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +5 -4
- package/.eslintrc.cjs +3 -0
- package/.npsrc.json +3 -0
- package/CHANGELOG.md +242 -0
- package/bundle.esm.js +5 -1
- package/config/wdio.conf.cjs +400 -0
- package/dist/AssetRegistry.js.map +1 -1
- package/dist/Boot.d.ts +4 -3
- package/dist/Boot.js +31 -4
- package/dist/Boot.js.map +1 -1
- package/dist/CSP.js.map +1 -1
- package/dist/CustomElementsRegistry.js.map +1 -1
- package/dist/CustomElementsScope.js.map +1 -1
- package/dist/CustomElementsScopeUtils.js.map +1 -1
- package/dist/DOMObserver.js.map +1 -1
- package/dist/Device.js +109 -34
- package/dist/Device.js.map +1 -1
- package/dist/EventProvider.js.map +1 -1
- package/dist/FeaturesRegistry.js.map +1 -1
- package/dist/FontFace.js.map +1 -1
- package/dist/InitialConfiguration.d.ts +6 -1
- package/dist/InitialConfiguration.js +11 -2
- package/dist/InitialConfiguration.js.map +1 -1
- package/dist/Keys.js.map +1 -1
- package/dist/ManagedStyles.js.map +1 -1
- package/dist/MarkedEvents.js.map +1 -1
- package/dist/MediaRange.js.map +1 -1
- package/dist/PropertiesFileFormat.js.map +1 -1
- package/dist/Render.js.map +1 -1
- package/dist/RenderQueue.js.map +1 -1
- package/dist/Runtimes.js.map +1 -1
- package/dist/StaticArea.d.ts +3 -0
- package/dist/StaticArea.js +4 -3
- package/dist/StaticArea.js.map +1 -1
- package/dist/StaticAreaItem.js.map +1 -1
- package/dist/SystemCSSVars.js.map +1 -1
- package/dist/Theming.js.map +1 -1
- package/dist/UI5Element.d.ts +20 -15
- package/dist/UI5Element.js +11 -23
- package/dist/UI5Element.js.map +1 -1
- package/dist/UI5ElementMetadata.js.map +1 -1
- package/dist/animations/AnimationQueue.js.map +1 -1
- package/dist/animations/animate.js.map +1 -1
- package/dist/animations/scroll.js.map +1 -1
- package/dist/animations/slideDown.js.map +1 -1
- package/dist/animations/slideUp.js.map +1 -1
- package/dist/api.json +1 -1
- package/dist/asset-registries/Icons.d.ts +18 -10
- package/dist/asset-registries/Icons.js +44 -23
- package/dist/asset-registries/Icons.js.map +1 -1
- package/dist/asset-registries/Illustrations.d.ts +1 -1
- package/dist/asset-registries/Illustrations.js.map +1 -1
- package/dist/asset-registries/LocaleData.js.map +1 -1
- package/dist/asset-registries/Themes.d.ts +1 -0
- package/dist/asset-registries/Themes.js +2 -0
- package/dist/asset-registries/Themes.js.map +1 -1
- package/dist/asset-registries/i18n.js +9 -3
- package/dist/asset-registries/i18n.js.map +1 -1
- package/dist/assets/Boot.34b7cea0.css +1 -0
- package/dist/assets/Boot.650535e2.js +9 -0
- package/dist/assets/bundle.esm.ceb1b6b8.js +50 -0
- package/dist/assets-meta/IconCollectionsAlias.d.ts +24 -10
- package/dist/assets-meta/IconCollectionsAlias.js +29 -9
- package/dist/assets-meta/IconCollectionsAlias.js.map +1 -1
- package/dist/config/AnimationMode.js.map +1 -1
- package/dist/config/CalendarType.js.map +1 -1
- package/dist/config/FormatSettings.d.ts +5 -1
- package/dist/config/FormatSettings.js +5 -1
- package/dist/config/FormatSettings.js.map +1 -1
- package/dist/config/Icons.d.ts +43 -18
- package/dist/config/Icons.js +81 -26
- package/dist/config/Icons.js.map +1 -1
- package/dist/config/Language.d.ts +10 -1
- package/dist/config/Language.js +13 -1
- package/dist/config/Language.js.map +1 -1
- package/dist/config/NoConflict.js +1 -0
- package/dist/config/NoConflict.js.map +1 -1
- package/dist/config/RTL.js +3 -0
- package/dist/config/RTL.js.map +1 -1
- package/dist/config/Theme.d.ts +15 -5
- package/dist/config/Theme.js +25 -6
- package/dist/config/Theme.js.map +1 -1
- package/dist/config/ThemeRoots.js.map +1 -1
- package/dist/config/Timezone.d.ts +17 -0
- package/dist/config/Timezone.js +30 -0
- package/dist/config/Timezone.js.map +1 -0
- package/dist/decorators/customElement.d.ts +17 -2
- package/dist/decorators/customElement.js +26 -5
- package/dist/decorators/customElement.js.map +1 -1
- package/dist/decorators/event.js +6 -6
- package/dist/decorators/event.js.map +1 -1
- package/dist/decorators/property.js +6 -6
- package/dist/decorators/property.js.map +1 -1
- package/dist/decorators/slot.js +9 -9
- package/dist/decorators/slot.js.map +1 -1
- package/dist/delegate/ItemNavigation.js.map +1 -1
- package/dist/delegate/ResizeHandler.d.ts +2 -1
- package/dist/delegate/ResizeHandler.js +7 -3
- package/dist/delegate/ResizeHandler.js.map +1 -1
- package/dist/delegate/ScrollEnablement.d.ts +4 -3
- package/dist/delegate/ScrollEnablement.js.map +1 -1
- package/dist/features/F6Navigation.d.ts +3 -0
- package/dist/features/F6Navigation.js +77 -38
- package/dist/features/F6Navigation.js.map +1 -1
- package/dist/features/LegacyDateFormats.d.ts +18 -0
- package/dist/features/LegacyDateFormats.js +20 -0
- package/dist/features/LegacyDateFormats.js.map +1 -0
- package/dist/features/OpenUI5Element.js.map +1 -1
- package/dist/features/OpenUI5Enablement.js.map +1 -1
- package/dist/features/OpenUI5Support.d.ts +3 -0
- package/dist/features/OpenUI5Support.js +2 -0
- package/dist/features/OpenUI5Support.js.map +1 -1
- package/dist/generated/AssetParameters.js +2 -0
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/css/BusyIndicator.css.d.ts +3 -0
- package/dist/generated/css/BusyIndicator.css.js +7 -5
- package/dist/generated/css/BusyIndicator.css.js.map +1 -0
- package/dist/generated/css/FontFace.css.d.ts +3 -0
- package/dist/generated/css/FontFace.css.js +7 -5
- package/dist/generated/css/FontFace.css.js.map +1 -0
- package/dist/generated/css/OverrideFontFace.css.d.ts +3 -0
- package/dist/generated/css/OverrideFontFace.css.js +7 -5
- package/dist/generated/css/OverrideFontFace.css.js.map +1 -0
- package/dist/generated/css/SystemCSSVars.css.d.ts +3 -0
- package/dist/generated/css/SystemCSSVars.css.js +7 -5
- package/dist/generated/css/SystemCSSVars.css.js.map +1 -0
- package/dist/getSharedResource.d.ts +1 -1
- package/dist/getSharedResource.js +10 -2
- package/dist/getSharedResource.js.map +1 -1
- package/{global.d.ts → dist/global.d.ts} +2 -6
- package/dist/i18nBundle.js.map +1 -1
- package/dist/locale/Locale.js.map +1 -1
- package/dist/locale/RTLAwareRegistry.js.map +1 -1
- package/dist/locale/applyDirection.js.map +1 -1
- package/dist/locale/directionChange.js.map +1 -1
- package/dist/locale/getEffectiveDir.js.map +1 -1
- package/dist/locale/getLocale.js.map +1 -1
- package/dist/locale/languageChange.js.map +1 -1
- package/dist/locale/nextFallbackLocale.js.map +1 -1
- package/dist/locale/normalizeLocale.js.map +1 -1
- package/dist/renderer/LitRenderer.d.ts +3 -3
- package/dist/renderer/LitRenderer.js.map +1 -1
- package/dist/renderer/executeTemplate.js.map +1 -1
- package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +1 -1
- package/dist/theming/CustomStyle.js +7 -5
- package/dist/theming/CustomStyle.js.map +1 -1
- package/dist/theming/ThemeLoaded.js.map +1 -1
- package/dist/theming/ThemeRegistered.d.ts +4 -0
- package/dist/theming/ThemeRegistered.js +11 -0
- package/dist/theming/ThemeRegistered.js.map +1 -0
- package/dist/theming/applyTheme.js.map +1 -1
- package/dist/theming/getConstructableStyle.js.map +1 -1
- package/dist/theming/getEffectiveLinksHrefs.js.map +1 -1
- package/dist/theming/getEffectiveStyle.js.map +1 -1
- package/dist/theming/getStylesString.d.ts +1 -1
- package/dist/theming/getStylesString.js.map +1 -1
- package/dist/theming/getThemeDesignerTheme.js.map +1 -1
- package/dist/theming/preloadLinks.js.map +1 -1
- package/dist/thirdparty/_merge.js.map +1 -1
- package/dist/thirdparty/isPlainObject.js.map +1 -1
- package/dist/thirdparty/merge.js.map +1 -1
- package/dist/types/AnimationMode.d.ts +1 -1
- package/dist/types/AnimationMode.js +1 -1
- package/dist/types/AnimationMode.js.map +1 -1
- package/dist/types/CSSColor.d.ts +0 -1
- package/dist/types/CSSColor.js +0 -1
- package/dist/types/CSSColor.js.map +1 -1
- package/dist/types/CalendarType.d.ts +1 -1
- package/dist/types/CalendarType.js +1 -1
- package/dist/types/CalendarType.js.map +1 -1
- package/dist/types/DOMReference.js.map +1 -1
- package/dist/types/DataType.js.map +1 -1
- package/dist/types/Float.d.ts +0 -1
- package/dist/types/Float.js +0 -1
- package/dist/types/Float.js.map +1 -1
- package/dist/types/Integer.d.ts +0 -1
- package/dist/types/Integer.js +0 -1
- package/dist/types/Integer.js.map +1 -1
- package/dist/types/InvisibleMessageMode.d.ts +1 -1
- package/dist/types/InvisibleMessageMode.js +1 -1
- package/dist/types/InvisibleMessageMode.js.map +1 -1
- package/dist/types/ItemNavigationBehavior.d.ts +1 -1
- package/dist/types/ItemNavigationBehavior.js +1 -1
- package/dist/types/ItemNavigationBehavior.js.map +1 -1
- package/dist/types/NavigationMode.d.ts +1 -1
- package/dist/types/NavigationMode.js +1 -1
- package/dist/types/NavigationMode.js.map +1 -1
- package/dist/types/ValueState.d.ts +1 -1
- package/dist/types/ValueState.js +1 -1
- package/dist/types/ValueState.js.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/updateShadowRoot.js +4 -0
- package/dist/updateShadowRoot.js.map +1 -1
- package/dist/util/AriaLabelHelper.d.ts +10 -1
- package/dist/util/AriaLabelHelper.js +135 -8
- package/dist/util/AriaLabelHelper.js.map +1 -1
- package/dist/util/Caret.js.map +1 -1
- package/dist/util/ColorConversion.js.map +1 -1
- package/dist/util/FetchHelper.js.map +1 -1
- package/dist/util/FocusableElements.js +12 -2
- package/dist/util/FocusableElements.js.map +1 -1
- package/dist/util/HTMLSanitizer.js.map +1 -1
- package/dist/util/InvisibleMessage.js.map +1 -1
- package/dist/util/PopupUtils.d.ts +1 -1
- package/dist/util/PopupUtils.js +6 -6
- package/dist/util/PopupUtils.js.map +1 -1
- package/dist/util/SlotsHelper.js.map +1 -1
- package/dist/util/StringHelper.js.map +1 -1
- package/dist/util/TabbableElements.js.map +1 -1
- package/dist/util/arraysAreEqual.js.map +1 -1
- package/dist/util/clamp.js.map +1 -1
- package/dist/util/createLinkInHead.js.map +1 -1
- package/dist/util/createStyleInHead.js.map +1 -1
- package/dist/util/debounce.js.map +1 -1
- package/dist/util/detectNavigatorLanguage.js.map +1 -1
- package/dist/util/escapeRegex.js.map +1 -1
- package/dist/util/formatMessage.js.map +1 -1
- package/dist/util/generateHighlightedMarkup.js.map +1 -1
- package/dist/util/getActiveElement.js.map +1 -1
- package/dist/util/getClassCopy.d.ts +8 -10
- package/dist/util/getClassCopy.js.map +1 -1
- package/dist/util/getDesigntimePropertyAsArray.js.map +1 -1
- package/dist/util/getEffectiveContentDensity.js.map +1 -1
- package/dist/util/getEffectiveScrollbarStyle.js.map +1 -1
- package/dist/util/getFastNavigationGroups.js.map +1 -1
- package/dist/util/getFileExtension.js.map +1 -1
- package/dist/util/getNormalizedTarget.js.map +1 -1
- package/dist/util/getSingletonElementInstance.js.map +1 -1
- package/dist/util/isElementClickable.js.map +1 -1
- package/dist/util/isElementHidden.js.map +1 -1
- package/dist/util/isElementInView.js.map +1 -1
- package/dist/util/isElementTabbable.js.map +1 -1
- package/dist/util/isValidPropertyName.js.map +1 -1
- package/dist/util/whenDOMReady.js.map +1 -1
- package/dist/util/willShowContent.js.map +1 -1
- package/dist/validateThemeRoot.js +14 -13
- package/dist/validateThemeRoot.js.map +1 -1
- package/index.js +227 -1
- package/lib/generate-asset-parameters/index.js +4 -2
- package/lib/generate-styles/index.js +13 -8
- package/lib/generate-version-info/index.js +1 -1
- package/{package-scripts.js → package-scripts.cjs} +11 -7
- package/package.json +5 -4
- package/tsconfig.json +2 -1
- package/config/wdio.conf.js +0 -1
- package/dist/assets/bundle.esm.0b4afb20.js +0 -56
- package/dist/decorators/fastNavigation.d.ts +0 -7
- package/dist/decorators/fastNavigation.js +0 -13
- package/dist/decorators/fastNavigation.js.map +0 -1
- package/dist/decorators/languageAware.d.ts +0 -7
- package/dist/decorators/languageAware.js +0 -13
- package/dist/decorators/languageAware.js.map +0 -1
- package/dist/decorators/themeAware.d.ts +0 -7
- package/dist/decorators/themeAware.js +0 -13
- package/dist/decorators/themeAware.js.map +0 -1
- package/src/AssetRegistry.ts +0 -11
- package/src/Boot.ts +0 -61
- package/src/CSP.ts +0 -66
- package/src/CustomElementsRegistry.ts +0 -98
- package/src/CustomElementsScope.ts +0 -33
- package/src/CustomElementsScopeUtils.ts +0 -115
- package/src/DOMObserver.ts +0 -28
- package/src/Device.ts +0 -124
- package/src/EventProvider.ts +0 -87
- package/src/FeaturesRegistry.ts +0 -14
- package/src/FontFace.ts +0 -31
- package/src/InitialConfiguration.ts +0 -207
- package/src/Keys.ts +0 -295
- package/src/ManagedStyles.ts +0 -92
- package/src/MarkedEvents.ts +0 -20
- package/src/MediaRange.ts +0 -110
- package/src/PropertiesFileFormat.ts +0 -95
- package/src/Render.ts +0 -180
- package/src/RenderQueue.ts +0 -71
- package/src/Runtimes.ts +0 -114
- package/src/StaticArea.ts +0 -3
- package/src/StaticAreaItem.ts +0 -113
- package/src/SystemCSSVars.ts +0 -10
- package/src/Theming.ts +0 -4
- package/src/UI5Element.ts +0 -1155
- package/src/UI5ElementMetadata.ts +0 -389
- package/src/animations/AnimationQueue.ts +0 -43
- package/src/animations/animate.ts +0 -64
- package/src/animations/scroll.ts +0 -21
- package/src/animations/slideDown.ts +0 -72
- package/src/animations/slideUp.ts +0 -67
- package/src/asset-registries/Icons.ts +0 -162
- package/src/asset-registries/Illustrations.ts +0 -75
- package/src/asset-registries/LocaleData.ts +0 -172
- package/src/asset-registries/Themes.ts +0 -67
- package/src/asset-registries/i18n.ts +0 -118
- package/src/assets-meta/IconCollectionsAlias.ts +0 -18
- package/src/config/AnimationMode.ts +0 -33
- package/src/config/CalendarType.ts +0 -23
- package/src/config/FormatSettings.ts +0 -21
- package/src/config/Icons.ts +0 -59
- package/src/config/Language.ts +0 -72
- package/src/config/NoConflict.ts +0 -67
- package/src/config/RTL.ts +0 -41
- package/src/config/Theme.ts +0 -64
- package/src/config/ThemeRoots.ts +0 -41
- package/src/decorators/customElement.ts +0 -17
- package/src/decorators/event.ts +0 -28
- package/src/decorators/fastNavigation.ts +0 -14
- package/src/decorators/languageAware.ts +0 -14
- package/src/decorators/property.ts +0 -30
- package/src/decorators/slot.ts +0 -49
- package/src/decorators/themeAware.ts +0 -14
- package/src/delegate/ItemNavigation.ts +0 -393
- package/src/delegate/ResizeHandler.ts +0 -95
- package/src/delegate/ScrollEnablement.ts +0 -221
- package/src/features/F6Navigation.ts +0 -141
- package/src/features/OpenUI5Element.ts +0 -11
- package/src/features/OpenUI5Enablement.ts +0 -117
- package/src/features/OpenUI5Support.ts +0 -148
- package/src/getSharedResource.ts +0 -30
- package/src/i18nBundle.ts +0 -108
- package/src/locale/Locale.ts +0 -101
- package/src/locale/RTLAwareRegistry.ts +0 -16
- package/src/locale/applyDirection.ts +0 -18
- package/src/locale/directionChange.ts +0 -34
- package/src/locale/getEffectiveDir.ts +0 -28
- package/src/locale/getLocale.ts +0 -46
- package/src/locale/languageChange.ts +0 -24
- package/src/locale/nextFallbackLocale.ts +0 -28
- package/src/locale/normalizeLocale.ts +0 -56
- package/src/renderer/LitRenderer.ts +0 -60
- package/src/renderer/executeTemplate.ts +0 -40
- package/src/theming/CustomStyle.ts +0 -62
- package/src/theming/ThemeLoaded.ts +0 -24
- package/src/theming/applyTheme.ts +0 -90
- package/src/theming/getConstructableStyle.ts +0 -31
- package/src/theming/getEffectiveLinksHrefs.ts +0 -26
- package/src/theming/getEffectiveStyle.ts +0 -41
- package/src/theming/getStylesString.ts +0 -15
- package/src/theming/getThemeDesignerTheme.ts +0 -101
- package/src/theming/preloadLinks.ts +0 -24
- package/src/thirdparty/_merge.ts +0 -32
- package/src/thirdparty/isPlainObject.ts +0 -18
- package/src/thirdparty/merge.ts +0 -5
- package/src/types/AnimationMode.ts +0 -33
- package/src/types/CSSColor.ts +0 -20
- package/src/types/CalendarType.ts +0 -38
- package/src/types/DOMReference.ts +0 -28
- package/src/types/DataType.ts +0 -51
- package/src/types/Float.ts +0 -25
- package/src/types/Integer.ts +0 -25
- package/src/types/InvisibleMessageMode.ts +0 -27
- package/src/types/ItemNavigationBehavior.ts +0 -26
- package/src/types/NavigationMode.ts +0 -33
- package/src/types/ValueState.ts +0 -47
- package/src/types.ts +0 -30
- package/src/updateShadowRoot.ts +0 -37
- package/src/util/AriaLabelHelper.ts +0 -63
- package/src/util/Caret.ts +0 -28
- package/src/util/ColorConversion.ts +0 -399
- package/src/util/FetchHelper.ts +0 -31
- package/src/util/FocusableElements.ts +0 -82
- package/src/util/HTMLSanitizer.ts +0 -9
- package/src/util/InvisibleMessage.ts +0 -69
- package/src/util/PopupUtils.ts +0 -114
- package/src/util/SlotsHelper.ts +0 -39
- package/src/util/StringHelper.ts +0 -26
- package/src/util/TabbableElements.ts +0 -70
- package/src/util/arraysAreEqual.ts +0 -15
- package/src/util/clamp.ts +0 -12
- package/src/util/createLinkInHead.ts +0 -25
- package/src/util/createStyleInHead.ts +0 -20
- package/src/util/debounce.ts +0 -18
- package/src/util/detectNavigatorLanguage.ts +0 -13
- package/src/util/escapeRegex.ts +0 -11
- package/src/util/formatMessage.ts +0 -24
- package/src/util/generateHighlightedMarkup.ts +0 -43
- package/src/util/getActiveElement.ts +0 -11
- package/src/util/getClassCopy.ts +0 -12
- package/src/util/getDesigntimePropertyAsArray.ts +0 -4
- package/src/util/getEffectiveContentDensity.ts +0 -5
- package/src/util/getEffectiveScrollbarStyle.ts +0 -5
- package/src/util/getFastNavigationGroups.ts +0 -63
- package/src/util/getFileExtension.ts +0 -21
- package/src/util/getNormalizedTarget.ts +0 -16
- package/src/util/getSingletonElementInstance.ts +0 -13
- package/src/util/isElementClickable.ts +0 -19
- package/src/util/isElementHidden.ts +0 -9
- package/src/util/isElementInView.ts +0 -15
- package/src/util/isElementTabbable.ts +0 -37
- package/src/util/isValidPropertyName.ts +0 -29
- package/src/util/whenDOMReady.ts +0 -13
- package/src/util/willShowContent.ts +0 -7
- package/src/validateThemeRoot.ts +0 -58
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
type ThemeDescriptor = {
|
|
2
|
-
themeName: string,
|
|
3
|
-
baseThemeName?: string,
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
type ThemeMetadata = {
|
|
7
|
-
Path: string,
|
|
8
|
-
Extends: Array<string>,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const warnings = new Set<string>();
|
|
12
|
-
|
|
13
|
-
const getThemeMetadata = () => {
|
|
14
|
-
// Check if the class was already applied, most commonly to the link/style tag with the CSS Variables
|
|
15
|
-
let el = document.querySelector(".sapThemeMetaData-Base-baseLib") || document.querySelector(".sapThemeMetaData-UI5-sap-ui-core");
|
|
16
|
-
if (el) {
|
|
17
|
-
return getComputedStyle(el).backgroundImage;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
el = document.createElement("span");
|
|
21
|
-
(el as HTMLSpanElement).style.display = "none";
|
|
22
|
-
|
|
23
|
-
// Try with sapThemeMetaData-Base-baseLib first
|
|
24
|
-
el.classList.add("sapThemeMetaData-Base-baseLib");
|
|
25
|
-
document.body.appendChild(el);
|
|
26
|
-
let metadata = getComputedStyle(el).backgroundImage;
|
|
27
|
-
|
|
28
|
-
// Try with sapThemeMetaData-UI5-sap-ui-core only if the previous selector was not found
|
|
29
|
-
if (metadata === "none") {
|
|
30
|
-
el.classList.add("sapThemeMetaData-UI5-sap-ui-core");
|
|
31
|
-
metadata = getComputedStyle(el).backgroundImage;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
document.body.removeChild(el);
|
|
35
|
-
|
|
36
|
-
return metadata;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const parseThemeMetadata = (metadataString: string) => {
|
|
40
|
-
const params = /\(["']?data:text\/plain;utf-8,(.*?)['"]?\)$/i.exec(metadataString);
|
|
41
|
-
if (params && params.length >= 2) {
|
|
42
|
-
let paramsString = params[1];
|
|
43
|
-
paramsString = paramsString.replace(/\\"/g, `"`);
|
|
44
|
-
if (paramsString.charAt(0) !== "{" && paramsString.charAt(paramsString.length - 1) !== "}") {
|
|
45
|
-
try {
|
|
46
|
-
paramsString = decodeURIComponent(paramsString);
|
|
47
|
-
} catch (ex) {
|
|
48
|
-
if (!warnings.has("decode")) {
|
|
49
|
-
console.warn("Malformed theme metadata string, unable to decodeURIComponent"); // eslint-disable-line
|
|
50
|
-
warnings.add("decode");
|
|
51
|
-
}
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
try {
|
|
56
|
-
return JSON.parse(paramsString) as ThemeMetadata;
|
|
57
|
-
} catch (ex) {
|
|
58
|
-
if (!warnings.has("parse")) {
|
|
59
|
-
console.warn("Malformed theme metadata string, unable to parse JSON"); // eslint-disable-line
|
|
60
|
-
warnings.add("parse");
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const processThemeMetadata = (metadata: ThemeMetadata): ThemeDescriptor | undefined => {
|
|
67
|
-
let themeName;
|
|
68
|
-
let baseThemeName;
|
|
69
|
-
|
|
70
|
-
try {
|
|
71
|
-
themeName = metadata.Path.match(/\.([^.]+)\.css_variables$/)![1];
|
|
72
|
-
baseThemeName = metadata.Extends[0];
|
|
73
|
-
} catch (ex) {
|
|
74
|
-
if (!warnings.has("object")) {
|
|
75
|
-
console.warn("Malformed theme metadata Object", metadata); // eslint-disable-line
|
|
76
|
-
warnings.add("object");
|
|
77
|
-
}
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return {
|
|
82
|
-
themeName,
|
|
83
|
-
baseThemeName,
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const getThemeDesignerTheme = (): ThemeDescriptor | undefined => {
|
|
88
|
-
const metadataString = getThemeMetadata();
|
|
89
|
-
if (!metadataString || metadataString === "none") {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const metadata = parseThemeMetadata(metadataString);
|
|
94
|
-
|
|
95
|
-
if (metadata) {
|
|
96
|
-
return processThemeMetadata(metadata);
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export default getThemeDesignerTheme;
|
|
101
|
-
export type { ThemeDescriptor };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import getEffectiveLinksHrefs from "./getEffectiveLinksHrefs.js";
|
|
2
|
-
import createLinkInHead from "../util/createLinkInHead.js";
|
|
3
|
-
import { shouldUseLinks, shouldPreloadLinks } from "../CSP.js";
|
|
4
|
-
import type UI5Element from "../UI5Element.js";
|
|
5
|
-
|
|
6
|
-
const preloaded = new Set<string>();
|
|
7
|
-
|
|
8
|
-
const preloadLinks = (ElementClass: typeof UI5Element) => {
|
|
9
|
-
if (!shouldUseLinks() || !shouldPreloadLinks()) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const linksHrefs = getEffectiveLinksHrefs(ElementClass, false) || [];
|
|
14
|
-
const staticAreaLinksHrefs = getEffectiveLinksHrefs(ElementClass, true) || [];
|
|
15
|
-
|
|
16
|
-
[...linksHrefs, ...staticAreaLinksHrefs].forEach(href => {
|
|
17
|
-
if (!preloaded.has(href)) {
|
|
18
|
-
createLinkInHead(href, { rel: "preload", as: "style" });
|
|
19
|
-
preloaded.add(href);
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export default preloadLinks;
|
package/src/thirdparty/_merge.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import isPlainObject from './isPlainObject.js';
|
|
2
|
-
var oToken = Object.create(null);
|
|
3
|
-
var fnMerge = function (arg1?: any, arg2?: any, arg3?: any, arg4?: any) {
|
|
4
|
-
var src, copyIsArray, copy, name, options, clone, target = arguments[2] || {}, i = 3, length = arguments.length, deep = arguments[0] || false, skipToken = arguments[1] ? undefined : oToken;
|
|
5
|
-
if (typeof target !== 'object' && typeof target !== 'function') {
|
|
6
|
-
target = {};
|
|
7
|
-
}
|
|
8
|
-
for (; i < length; i++) {
|
|
9
|
-
if ((options = arguments[i]) != null) {
|
|
10
|
-
for (name in options) {
|
|
11
|
-
src = target[name];
|
|
12
|
-
copy = options[name];
|
|
13
|
-
if (name === '__proto__' || target === copy) {
|
|
14
|
-
continue;
|
|
15
|
-
}
|
|
16
|
-
if (deep && copy && (isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) {
|
|
17
|
-
if (copyIsArray) {
|
|
18
|
-
copyIsArray = false;
|
|
19
|
-
clone = src && Array.isArray(src) ? src : [];
|
|
20
|
-
} else {
|
|
21
|
-
clone = src && isPlainObject(src) ? src : {};
|
|
22
|
-
}
|
|
23
|
-
target[name] = fnMerge(deep, arguments[1], clone, copy);
|
|
24
|
-
} else if (copy !== skipToken) {
|
|
25
|
-
target[name] = copy;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return target;
|
|
31
|
-
};
|
|
32
|
-
export default fnMerge;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
var class2type = {};
|
|
2
|
-
var hasOwn = class2type.hasOwnProperty;
|
|
3
|
-
var toString = class2type.toString;
|
|
4
|
-
var fnToString = hasOwn.toString;
|
|
5
|
-
var ObjectFunctionString = fnToString.call(Object);
|
|
6
|
-
var fnIsPlainObject = function (obj: object) {
|
|
7
|
-
var proto, Ctor;
|
|
8
|
-
if (!obj || toString.call(obj) !== "[object Object]") {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
proto = Object.getPrototypeOf(obj);
|
|
12
|
-
if (!proto) {
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
Ctor = hasOwn.call(proto, "constructor") && proto.constructor;
|
|
16
|
-
return typeof Ctor === "function" && fnToString.call(Ctor) === ObjectFunctionString;
|
|
17
|
-
};
|
|
18
|
-
export default fnIsPlainObject;
|
package/src/thirdparty/merge.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Different types of AnimationMode.
|
|
3
|
-
*
|
|
4
|
-
* @class
|
|
5
|
-
* @enum {string}
|
|
6
|
-
* @public
|
|
7
|
-
* @author SAP SE
|
|
8
|
-
* @alias sap.ui.webc.base.types.AnimationMode
|
|
9
|
-
*/
|
|
10
|
-
enum AnimationMode {
|
|
11
|
-
/**
|
|
12
|
-
* @public
|
|
13
|
-
* @type {Full}
|
|
14
|
-
*/
|
|
15
|
-
Full = "full",
|
|
16
|
-
/**
|
|
17
|
-
* @public
|
|
18
|
-
* @type {Basic}
|
|
19
|
-
*/
|
|
20
|
-
Basic = "basic",
|
|
21
|
-
/**
|
|
22
|
-
* @public
|
|
23
|
-
* @type {Minimal}
|
|
24
|
-
*/
|
|
25
|
-
Minimal = "minimal",
|
|
26
|
-
/**
|
|
27
|
-
* @public
|
|
28
|
-
* @type {None}
|
|
29
|
-
*/
|
|
30
|
-
None = "none",
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default AnimationMode;
|
package/src/types/CSSColor.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import DataType from "./DataType.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @class
|
|
5
|
-
* CSSColor data type.
|
|
6
|
-
*
|
|
7
|
-
* @extends sap.ui.webc.base.types.DataType
|
|
8
|
-
* @constructor
|
|
9
|
-
* @author SAP SE
|
|
10
|
-
* @alias sap.ui.webc.base.types.CSSColor
|
|
11
|
-
* @public
|
|
12
|
-
* @enum {string}
|
|
13
|
-
*/
|
|
14
|
-
class CSSColor extends DataType {
|
|
15
|
-
static override isValid(value: string) {
|
|
16
|
-
return /^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})|rgb\(\s*((1?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))|([0-9]?[0-9](\.[0-9]+)?|100(\.0+)?)%)\s*(,\s*((1?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))|([0-9]?[0-9](\.[0-9]+)?|100(\.0+)?)%)\s*){2}\)|rgba\((\s*((1?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))|([0-9]?[0-9](\.[0-9]+)?|100(\.0+)?)%)\s*,){3}\s*(0(\.[0-9]+)?|1(\.0+)?)\s*\)|hsl\(\s*([0-2]?[0-9]?[0-9]|3([0-5][0-9]|60))\s*(,\s*(([0-9]?[0-9](\.[0-9]+)?|100(\.0+)?)%)\s*){2}\)|hsla\(\s*([0-2]?[0-9]?[0-9]|3([0-5][0-9]|60))\s*,(\s*(([0-9]?[0-9](\.[0-9]+)?|100(\.0+)?)%)\s*,){2}\s*(0(\.[0-9]+)?|1(\.0+)?)\s*\)|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgrey|darkgreen|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|grey|green|greenyellow|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgrey|lightgreen|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silverskyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|transparent|inherit|)$/.test(value ); // eslint-disable-line
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default CSSColor;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Different calendar types.
|
|
3
|
-
*
|
|
4
|
-
* @class
|
|
5
|
-
* @enum {string}
|
|
6
|
-
* @public
|
|
7
|
-
* @author SAP SE
|
|
8
|
-
* @alias sap.ui.webc.base.types.CalendarType
|
|
9
|
-
*/
|
|
10
|
-
enum CalendarType {
|
|
11
|
-
/**
|
|
12
|
-
* @public
|
|
13
|
-
* @type {Gregorian}
|
|
14
|
-
*/
|
|
15
|
-
Gregorian = "Gregorian",
|
|
16
|
-
/**
|
|
17
|
-
* @public
|
|
18
|
-
* @type {Islamic}
|
|
19
|
-
*/
|
|
20
|
-
Islamic = "Islamic",
|
|
21
|
-
/**
|
|
22
|
-
* @public
|
|
23
|
-
* @type {Japanese}
|
|
24
|
-
*/
|
|
25
|
-
Japanese = "Japanese",
|
|
26
|
-
/**
|
|
27
|
-
* @public
|
|
28
|
-
* @type {Buddhist}
|
|
29
|
-
*/
|
|
30
|
-
Buddhist = "Buddhist",
|
|
31
|
-
/**
|
|
32
|
-
* @public
|
|
33
|
-
* @type {Persian}
|
|
34
|
-
*/
|
|
35
|
-
Persian = "Persian",
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export default CalendarType;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import DataType from "./DataType.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @class
|
|
5
|
-
* DOM Element reference or ID.
|
|
6
|
-
* <b>Note:</b> If an ID is passed, it is expected to be part of the same <code>document</code> element as the consuming component.
|
|
7
|
-
*
|
|
8
|
-
* @constructor
|
|
9
|
-
* @extends sap.ui.webc.base.types.DataType
|
|
10
|
-
* @author SAP SE
|
|
11
|
-
* @alias sap.ui.webc.base.types.DOMReference
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
class DOMReference extends DataType {
|
|
15
|
-
static override isValid(value: string | HTMLElement) {
|
|
16
|
-
return (typeof value === "string" || value instanceof HTMLElement);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
static override propertyToAttribute(propertyValue: string | HTMLElement) {
|
|
20
|
-
if (propertyValue instanceof HTMLElement) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return propertyValue;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default DOMReference;
|
package/src/types/DataType.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { PropertyValue } from "../UI5ElementMetadata.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Base class for all data types.
|
|
5
|
-
*
|
|
6
|
-
* @class
|
|
7
|
-
* @constructor
|
|
8
|
-
* @author SAP SE
|
|
9
|
-
* @alias sap.ui.webc.base.types.DataType
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
class DataType {
|
|
13
|
-
/**
|
|
14
|
-
* Checks if the value is valid for its data type.
|
|
15
|
-
* @public
|
|
16
|
-
* @abstract
|
|
17
|
-
* @returns {Boolean}
|
|
18
|
-
*/
|
|
19
|
-
// eslint-disable-next-line
|
|
20
|
-
static isValid(value: any): boolean {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
static attributeToProperty(attributeValue: string | null): PropertyValue {
|
|
25
|
-
return attributeValue;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
static propertyToAttribute(propertyValue: PropertyValue): string | null {
|
|
29
|
-
return propertyValue === null ? null : String(propertyValue);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
static valuesAreEqual(value1: any, value2: any) {
|
|
33
|
-
return value1 === value2;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
static generateTypeAccessors(types: Record<string, string>) {
|
|
37
|
-
Object.keys(types).forEach(type => {
|
|
38
|
-
Object.defineProperty(this, type, {
|
|
39
|
-
get() {
|
|
40
|
-
return types[type];
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
static get isDataTypeClass() {
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export default DataType;
|
package/src/types/Float.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { PropertyValue } from "../UI5ElementMetadata.js";
|
|
2
|
-
import DataType from "./DataType.js";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @class
|
|
6
|
-
* Float data type.
|
|
7
|
-
*
|
|
8
|
-
* @constructor
|
|
9
|
-
* @extends sap.ui.webc.base.types.DataType
|
|
10
|
-
* @author SAP SE
|
|
11
|
-
* @alias sap.ui.webc.base.types.Float
|
|
12
|
-
* @public
|
|
13
|
-
* @enum {number}
|
|
14
|
-
*/
|
|
15
|
-
class Float extends DataType {
|
|
16
|
-
static override isValid(value: any) {
|
|
17
|
-
return Number(value) === value;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static override attributeToProperty(attributeValue: string): PropertyValue {
|
|
21
|
-
return parseFloat(attributeValue);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default Float;
|
package/src/types/Integer.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { PropertyValue } from "../UI5ElementMetadata.js";
|
|
2
|
-
import DataType from "./DataType.js";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @class
|
|
6
|
-
* Integer data type.
|
|
7
|
-
*
|
|
8
|
-
* @constructor
|
|
9
|
-
* @extends sap.ui.webc.base.types.DataType
|
|
10
|
-
* @author SAP SE
|
|
11
|
-
* @alias sap.ui.webc.base.types.Integer
|
|
12
|
-
* @public
|
|
13
|
-
* @enum {number}
|
|
14
|
-
*/
|
|
15
|
-
class Integer extends DataType {
|
|
16
|
-
static override isValid(value: any) {
|
|
17
|
-
return Number.isInteger(value);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static override attributeToProperty(attributeValue: string): PropertyValue {
|
|
21
|
-
return parseInt(attributeValue);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default Integer;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enumeration for different mode behaviors of the InvisibleMessage.
|
|
3
|
-
*
|
|
4
|
-
* @class
|
|
5
|
-
* @enum {string}
|
|
6
|
-
* @public
|
|
7
|
-
* @author SAP SE
|
|
8
|
-
* @alias sap.ui.webc.base.types.InvisibleMessageMode
|
|
9
|
-
*/
|
|
10
|
-
enum InvisibleMessageMode {
|
|
11
|
-
/**
|
|
12
|
-
* Indicates that updates to the region should be presented at the next graceful opportunity,
|
|
13
|
-
* such as at the end of reading the current sentence, or when the user pauses typing.
|
|
14
|
-
* @public
|
|
15
|
-
* @type {Polite}
|
|
16
|
-
*/
|
|
17
|
-
Polite = "Polite",
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Indicates that updates to the region have the highest priority and should be presented to the user immediately.
|
|
21
|
-
* @public
|
|
22
|
-
* @type {Assertive}
|
|
23
|
-
*/
|
|
24
|
-
Assertive = "Assertive",
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default InvisibleMessageMode;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Different behavior for ItemNavigation.
|
|
3
|
-
*
|
|
4
|
-
* @class
|
|
5
|
-
* @enum {string}
|
|
6
|
-
* @public
|
|
7
|
-
* @author SAP SE
|
|
8
|
-
* @alias sap.ui.webc.base.types.ItemNavigationBehavior
|
|
9
|
-
*/
|
|
10
|
-
enum ItemNavigationBehavior {
|
|
11
|
-
/**
|
|
12
|
-
* Static behavior: navigations stops at the first or last item.
|
|
13
|
-
* @public
|
|
14
|
-
* @type {Static}
|
|
15
|
-
*/
|
|
16
|
-
Static = "Static",
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Cycling behavior: navigating past the last item continues with the first and vice versa.
|
|
20
|
-
* @public
|
|
21
|
-
* @type {Cyclic}
|
|
22
|
-
*/
|
|
23
|
-
Cyclic = "Cyclic",
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export default ItemNavigationBehavior;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Different navigation modes for ItemNavigation.
|
|
3
|
-
*
|
|
4
|
-
* @class
|
|
5
|
-
* @enum {string}
|
|
6
|
-
* @public
|
|
7
|
-
* @author SAP SE
|
|
8
|
-
* @alias sap.ui.webc.base.types.NavigationMode
|
|
9
|
-
*/
|
|
10
|
-
enum NavigationMode {
|
|
11
|
-
/**
|
|
12
|
-
* @public
|
|
13
|
-
* @type {Auto}
|
|
14
|
-
*/
|
|
15
|
-
Auto = "Auto",
|
|
16
|
-
/**
|
|
17
|
-
* @public
|
|
18
|
-
* @type {Vertical}
|
|
19
|
-
*/
|
|
20
|
-
Vertical = "Vertical",
|
|
21
|
-
/**
|
|
22
|
-
* @public
|
|
23
|
-
* @type {Horizontal}
|
|
24
|
-
*/
|
|
25
|
-
Horizontal = "Horizontal",
|
|
26
|
-
/**
|
|
27
|
-
* @public
|
|
28
|
-
* @type {Paging}
|
|
29
|
-
*/
|
|
30
|
-
Paging = "Paging",
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default NavigationMode;
|
package/src/types/ValueState.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Different types of ValueStates.
|
|
3
|
-
*
|
|
4
|
-
* @class
|
|
5
|
-
* @enum {string}
|
|
6
|
-
* @public
|
|
7
|
-
* @author SAP SE
|
|
8
|
-
* @alias sap.ui.webc.base.types.ValueState
|
|
9
|
-
*/
|
|
10
|
-
enum ValueState {
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @public
|
|
14
|
-
* @type {None}
|
|
15
|
-
*/
|
|
16
|
-
None = "None",
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @public
|
|
21
|
-
* @type {Success}
|
|
22
|
-
*/
|
|
23
|
-
Success = "Success",
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @public
|
|
28
|
-
* @type {Warning}
|
|
29
|
-
*/
|
|
30
|
-
Warning = "Warning",
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @public
|
|
35
|
-
* @type {Error}
|
|
36
|
-
*/
|
|
37
|
-
Error = "Error",
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
41
|
-
* @public
|
|
42
|
-
* @type {Information}
|
|
43
|
-
*/
|
|
44
|
-
Information = "Information",
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export default ValueState;
|
package/src/types.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
type PromiseResolve = (value: void | PromiseLike<void>) => void;
|
|
2
|
-
type Timeout = ReturnType<typeof setTimeout>;
|
|
3
|
-
type Interval = ReturnType<typeof setInterval>;
|
|
4
|
-
|
|
5
|
-
type StyleDataCSP = {
|
|
6
|
-
content: string,
|
|
7
|
-
packageName: string,
|
|
8
|
-
fileName: string,
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
type StyleData = StyleDataCSP | string;
|
|
12
|
-
|
|
13
|
-
type ComponentStylesData = Array<ComponentStylesData> | Array<StyleData> | StyleData;
|
|
14
|
-
|
|
15
|
-
type ClassMapValue = Record<string, boolean>
|
|
16
|
-
|
|
17
|
-
type ClassMap = { [x: string] : ClassMapValue | ClassMap };
|
|
18
|
-
|
|
19
|
-
type PassiveEventListenerObject = EventListenerObject & { passive: boolean };
|
|
20
|
-
|
|
21
|
-
export type {
|
|
22
|
-
PromiseResolve,
|
|
23
|
-
Timeout,
|
|
24
|
-
Interval,
|
|
25
|
-
StyleData,
|
|
26
|
-
StyleDataCSP,
|
|
27
|
-
ComponentStylesData,
|
|
28
|
-
ClassMap,
|
|
29
|
-
PassiveEventListenerObject,
|
|
30
|
-
};
|
package/src/updateShadowRoot.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import executeTemplate from "./renderer/executeTemplate.js";
|
|
2
|
-
import getConstructableStyle from "./theming/getConstructableStyle.js";
|
|
3
|
-
import getEffectiveStyle from "./theming/getEffectiveStyle.js";
|
|
4
|
-
import getEffectiveLinksHrefs from "./theming/getEffectiveLinksHrefs.js";
|
|
5
|
-
import { shouldUseLinks } from "./CSP.js";
|
|
6
|
-
import type UI5Element from "./UI5Element.js";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Updates the shadow root of a UI5Element or its static area item
|
|
10
|
-
* @param element
|
|
11
|
-
* @param forStaticArea
|
|
12
|
-
*/
|
|
13
|
-
const updateShadowRoot = (element: UI5Element, forStaticArea = false) => {
|
|
14
|
-
let styleStrOrHrefsArr;
|
|
15
|
-
const ctor = element.constructor as typeof UI5Element;
|
|
16
|
-
const propertyName = forStaticArea ? "staticAreaTemplate" : "template";
|
|
17
|
-
const template = ctor[propertyName];
|
|
18
|
-
const shadowRoot = forStaticArea ? element.staticAreaItem!.shadowRoot : element.shadowRoot;
|
|
19
|
-
const renderResult = executeTemplate(template!, element); // this is checked before calling updateShadowRoot
|
|
20
|
-
|
|
21
|
-
if (!shadowRoot) {
|
|
22
|
-
console.warn(`There is no shadow root to update`); // eslint-disable-line
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (shouldUseLinks()) {
|
|
27
|
-
styleStrOrHrefsArr = getEffectiveLinksHrefs(ctor, forStaticArea);
|
|
28
|
-
} else if (document.adoptedStyleSheets) { // Chrome
|
|
29
|
-
shadowRoot.adoptedStyleSheets = getConstructableStyle(ctor, forStaticArea);
|
|
30
|
-
} else { // FF, Safari
|
|
31
|
-
styleStrOrHrefsArr = getEffectiveStyle(ctor, forStaticArea);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
ctor.render(renderResult, shadowRoot, styleStrOrHrefsArr, forStaticArea, { host: element });
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export default updateShadowRoot;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
type AccessibleElement = HTMLElement & {
|
|
2
|
-
accessibleNameRef: string,
|
|
3
|
-
accessibleName: string,
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
const getEffectiveAriaLabelText = (el: HTMLElement) => {
|
|
7
|
-
const accessibleEl = el as AccessibleElement;
|
|
8
|
-
|
|
9
|
-
if (!accessibleEl.accessibleNameRef) {
|
|
10
|
-
if (accessibleEl.accessibleName) {
|
|
11
|
-
return accessibleEl.accessibleName;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return undefined;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return _getAriaLabelledByTexts(el);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
* @param {HTMLElement} el Defines the HTMLElement, for which you need to get all related texts
|
|
23
|
-
*/
|
|
24
|
-
const _getAriaLabelledByTexts = (el: HTMLElement) => {
|
|
25
|
-
const ids = (el as AccessibleElement).accessibleNameRef.split(" ");
|
|
26
|
-
const owner = el.getRootNode() as HTMLElement;
|
|
27
|
-
let result = "";
|
|
28
|
-
|
|
29
|
-
ids.forEach((elementId: string, index: number) => {
|
|
30
|
-
const element = owner.querySelector(`[id='${elementId}']`);
|
|
31
|
-
result += `${element && element.textContent ? element.textContent : ""}`;
|
|
32
|
-
|
|
33
|
-
if (index < ids.length - 1) {
|
|
34
|
-
result += " ";
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @param {HTMLElement} el Defines the HTMLElement, for which you need to get all related "label for" texts
|
|
43
|
-
*/
|
|
44
|
-
const getAssociatedLabelForTexts = (el: HTMLElement) => {
|
|
45
|
-
const results: Array<string> = [];
|
|
46
|
-
const labels = (el.getRootNode() as HTMLElement).querySelectorAll(`[ui5-label][for="${el.id}"],label[for="${el.id}"]`);
|
|
47
|
-
|
|
48
|
-
labels.forEach((label: Node) => {
|
|
49
|
-
const labelText = label.textContent;
|
|
50
|
-
labelText && results.push(labelText);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
if (results.length) {
|
|
54
|
-
return results.join(" ");
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return undefined;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export {
|
|
61
|
-
getEffectiveAriaLabelText,
|
|
62
|
-
getAssociatedLabelForTexts,
|
|
63
|
-
};
|