@ui5/webcomponents-base 0.0.0-b132dd7b9 → 0.0.0-b3a4f8020
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/AGENTS.md +195 -0
- package/CHANGELOG.md +563 -0
- package/CLAUDE.md +1 -0
- package/LICENSE.txt +201 -0
- package/README.md +7 -7
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/Assets-fetch.d.ts +1 -0
- package/dist/Assets-fetch.js +3 -0
- package/dist/Assets-fetch.js.map +1 -0
- package/dist/Assets-node.d.ts +12 -0
- package/dist/Assets-node.js +14 -0
- package/dist/Assets-node.js.map +1 -0
- package/dist/Assets.d.ts +1 -0
- package/dist/Assets.js +3 -0
- package/dist/Assets.js.map +1 -0
- package/dist/Boot.d.ts +2 -1
- package/dist/Boot.js +44 -14
- package/dist/Boot.js.map +1 -1
- package/dist/CustomElementsRegistry.js +1 -1
- package/dist/CustomElementsRegistry.js.map +1 -1
- package/dist/CustomElementsScopeUtils.d.ts +10 -3
- package/dist/CustomElementsScopeUtils.js +13 -3
- package/dist/CustomElementsScopeUtils.js.map +1 -1
- package/dist/DragAndDrop.d.ts +2 -0
- package/dist/DragAndDrop.js +5 -0
- package/dist/DragAndDrop.js.map +1 -0
- package/dist/FontFace.css +36 -0
- package/dist/FontFace.js +0 -8
- package/dist/FontFace.js.map +1 -1
- package/dist/InitialConfiguration.js +7 -0
- package/dist/InitialConfiguration.js.map +1 -1
- package/dist/Keys.d.ts +4 -1
- package/dist/Keys.js +4 -1
- package/dist/Keys.js.map +1 -1
- package/dist/ManagedStyles.js +1 -1
- package/dist/ManagedStyles.js.map +1 -1
- package/dist/ScrollbarStyles.d.ts +2 -0
- package/dist/ScrollbarStyles.js +9 -0
- package/dist/ScrollbarStyles.js.map +1 -0
- package/dist/SystemCSSVars.js +2 -4
- package/dist/SystemCSSVars.js.map +1 -1
- package/dist/UI5Element.d.ts +35 -9
- package/dist/UI5Element.js +59 -27
- package/dist/UI5Element.js.map +1 -1
- package/dist/UI5ElementMetadata.d.ts +1 -1
- package/dist/UI5ElementMetadata.js.map +1 -1
- package/dist/asset-registries/Icons.d.ts +42 -8
- package/dist/asset-registries/Icons.js +51 -8
- package/dist/asset-registries/Icons.js.map +1 -1
- package/dist/asset-registries/Illustrations.d.ts +133 -8
- package/dist/asset-registries/Illustrations.js +82 -1
- package/dist/asset-registries/Illustrations.js.map +1 -1
- package/dist/asset-registries/LocaleData.js +2 -1
- package/dist/asset-registries/LocaleData.js.map +1 -1
- package/dist/asset-registries/Themes.d.ts +5 -2
- package/dist/asset-registries/Themes.js +3 -3
- package/dist/asset-registries/Themes.js.map +1 -1
- package/dist/config/Language.d.ts +2 -1
- package/dist/config/Language.js +12 -1
- package/dist/config/Language.js.map +1 -1
- package/dist/config/Theme.d.ts +13 -1
- package/dist/config/Theme.js +18 -1
- package/dist/config/Theme.js.map +1 -1
- package/dist/config/ThemeRoot.d.ts +3 -1
- package/dist/config/ThemeRoot.js +3 -1
- package/dist/config/ThemeRoot.js.map +1 -1
- package/dist/css/MultipleDragGhost.css +17 -0
- package/dist/css/OpenUI5PopupStyles.css +10 -0
- package/dist/css/ScrollbarStyles.css +3 -0
- package/dist/css/SystemCSSVars.css +28 -3
- package/dist/custom-elements-internal.json +1855 -1738
- package/dist/custom-elements.json +1462 -1345
- package/dist/decorators/slot-strict.d.ts +27 -0
- package/dist/decorators/slot-strict.js +54 -0
- package/dist/decorators/slot-strict.js.map +1 -0
- package/dist/decorators/slot.d.ts +18 -0
- package/dist/decorators/slot.js +18 -0
- package/dist/decorators/slot.js.map +1 -1
- package/dist/decorators.d.ts +2 -1
- package/dist/decorators.js +2 -1
- package/dist/decorators.js.map +1 -1
- package/dist/features/F6Navigation.d.ts +1 -0
- package/dist/features/F6Navigation.js +23 -14
- package/dist/features/F6Navigation.js.map +1 -1
- package/dist/features/InputElementsFormSupport.d.ts +1 -1
- package/dist/features/InputElementsFormSupport.js +6 -2
- package/dist/features/InputElementsFormSupport.js.map +1 -1
- package/dist/features/OpenUI5Support.d.ts +15 -4
- package/dist/features/OpenUI5Support.js +83 -42
- package/dist/features/OpenUI5Support.js.map +1 -1
- package/dist/features/insertOpenUI5PopupStyles.d.ts +2 -0
- package/dist/features/insertOpenUI5PopupStyles.js +9 -0
- package/dist/features/insertOpenUI5PopupStyles.js.map +1 -0
- package/dist/features/patchPatcher.d.ts +7 -6
- package/dist/features/patchPatcher.js +14 -4
- package/dist/features/patchPatcher.js.map +1 -1
- package/dist/features/patchPopup.d.ts +26 -8
- package/dist/features/patchPopup.js +118 -25
- package/dist/features/patchPopup.js.map +1 -1
- package/dist/generated/VersionInfo.js +6 -6
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/generated/assets/i18n/messagebundle_en.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -0
- package/dist/generated/css/FontFace.css.d.ts +1 -1
- package/dist/generated/css/FontFace.css.js +36 -1
- package/dist/generated/css/FontFace.css.js.map +1 -1
- package/dist/generated/css/MultipleDragGhost.css.d.ts +2 -0
- package/dist/generated/css/MultipleDragGhost.css.js +2 -0
- package/dist/generated/css/MultipleDragGhost.css.js.map +1 -0
- package/dist/generated/css/OpenUI5PopupStyles.css.d.ts +2 -0
- package/dist/generated/css/OpenUI5PopupStyles.css.js +2 -0
- package/dist/generated/css/OpenUI5PopupStyles.css.js.map +1 -0
- package/dist/generated/css/ScrollbarStyles.css.d.ts +2 -0
- package/dist/generated/css/ScrollbarStyles.css.js +2 -0
- package/dist/generated/css/ScrollbarStyles.css.js.map +1 -0
- package/dist/generated/css/SystemCSSVars.css.d.ts +1 -1
- package/dist/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/generated/i18n/i18n-defaults.d.ts +3 -0
- package/dist/generated/i18n/i18n-defaults.js +3 -0
- package/dist/generated/i18n/i18n-defaults.js.map +1 -0
- package/dist/generated/json-imports/i18n-fetch.d.ts +1 -0
- package/dist/generated/json-imports/i18n-fetch.js +2 -0
- package/dist/generated/json-imports/i18n-fetch.js.map +1 -0
- package/dist/generated/json-imports/i18n-node.d.ts +1 -0
- package/dist/generated/json-imports/i18n-node.js +2 -0
- package/dist/generated/json-imports/i18n-node.js.map +1 -0
- package/dist/generated/json-imports/i18n.d.ts +1 -0
- package/dist/generated/json-imports/i18n.js +2 -0
- package/dist/generated/json-imports/i18n.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/jsx-runtime.d.ts +1 -0
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/prod/Assets-fetch.js +2 -0
- package/dist/prod/Assets-fetch.js.map +7 -0
- package/dist/prod/Assets-node.js +2 -0
- package/dist/prod/Assets-node.js.map +7 -0
- package/dist/prod/Assets.js +2 -0
- package/dist/prod/Assets.js.map +7 -0
- package/dist/prod/Boot.js +1 -1
- package/dist/prod/Boot.js.map +3 -3
- package/dist/prod/CustomElementsRegistry.js +5 -5
- package/dist/prod/CustomElementsRegistry.js.map +2 -2
- package/dist/prod/CustomElementsScopeUtils.js +1 -1
- package/dist/prod/CustomElementsScopeUtils.js.map +3 -3
- package/dist/prod/DragAndDrop.js +2 -0
- package/dist/prod/DragAndDrop.js.map +7 -0
- package/dist/prod/FontFace.js +1 -1
- package/dist/prod/FontFace.js.map +3 -3
- package/dist/prod/InitialConfiguration.js +1 -1
- package/dist/prod/InitialConfiguration.js.map +2 -2
- package/dist/prod/Keys.js +1 -1
- package/dist/prod/Keys.js.map +3 -3
- package/dist/prod/ManagedStyles.js +1 -1
- package/dist/prod/ManagedStyles.js.map +2 -2
- package/dist/prod/ScrollbarStyles.js +2 -0
- package/dist/prod/ScrollbarStyles.js.map +7 -0
- package/dist/prod/SystemCSSVars.js +1 -1
- package/dist/prod/SystemCSSVars.js.map +3 -3
- package/dist/prod/UI5Element.js +1 -1
- package/dist/prod/UI5Element.js.map +3 -3
- package/dist/prod/UI5ElementMetadata.js +1 -1
- package/dist/prod/UI5ElementMetadata.js.map +1 -1
- package/dist/prod/asset-registries/Icons.js +1 -1
- package/dist/prod/asset-registries/Icons.js.map +3 -3
- package/dist/prod/asset-registries/Illustrations.js +1 -1
- package/dist/prod/asset-registries/Illustrations.js.map +3 -3
- package/dist/prod/asset-registries/LocaleData.js +1 -1
- package/dist/prod/asset-registries/LocaleData.js.map +2 -2
- package/dist/prod/asset-registries/Themes.js +1 -1
- package/dist/prod/asset-registries/Themes.js.map +3 -3
- package/dist/prod/config/Language.js +1 -1
- package/dist/prod/config/Language.js.map +3 -3
- package/dist/prod/config/Theme.js +1 -1
- package/dist/prod/config/Theme.js.map +3 -3
- package/dist/prod/config/ThemeRoot.js.map +2 -2
- package/dist/prod/decorators/slot-strict.js +2 -0
- package/dist/prod/decorators/slot-strict.js.map +7 -0
- package/dist/prod/decorators/slot.js.map +2 -2
- package/dist/prod/decorators.js +1 -1
- package/dist/prod/decorators.js.map +3 -3
- package/dist/prod/features/F6Navigation.js +1 -1
- package/dist/prod/features/F6Navigation.js.map +3 -3
- package/dist/prod/features/InputElementsFormSupport.js +1 -1
- package/dist/prod/features/InputElementsFormSupport.js.map +3 -3
- package/dist/prod/features/OpenUI5Support.js +1 -1
- package/dist/prod/features/OpenUI5Support.js.map +3 -3
- package/dist/prod/features/insertOpenUI5PopupStyles.js +2 -0
- package/dist/prod/features/insertOpenUI5PopupStyles.js.map +7 -0
- package/dist/prod/features/patchPatcher.js +1 -1
- package/dist/prod/features/patchPatcher.js.map +3 -3
- package/dist/prod/features/patchPopup.js +1 -1
- package/dist/prod/features/patchPopup.js.map +3 -3
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +2 -2
- package/dist/prod/generated/assets/i18n/messagebundle_en.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_en_US_sappsd.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_en_US_saprigi.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_en_US_saptrc.json +1 -0
- package/dist/prod/generated/css/FontFace.css.js +36 -1
- package/dist/prod/generated/css/FontFace.css.js.map +2 -2
- package/dist/prod/generated/css/MultipleDragGhost.css.js +2 -0
- package/dist/prod/generated/css/MultipleDragGhost.css.js.map +7 -0
- package/dist/prod/generated/css/OpenUI5PopupStyles.css.js +2 -0
- package/dist/prod/generated/css/OpenUI5PopupStyles.css.js.map +7 -0
- package/dist/prod/generated/css/ScrollbarStyles.css.js +2 -0
- package/dist/prod/generated/css/ScrollbarStyles.css.js.map +7 -0
- package/dist/prod/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/prod/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/prod/generated/i18n/i18n-defaults.js +2 -0
- package/dist/prod/generated/i18n/i18n-defaults.js.map +7 -0
- package/dist/prod/generated/json-imports/i18n-fetch.js +2 -0
- package/dist/prod/generated/json-imports/i18n-fetch.js.map +7 -0
- package/dist/prod/generated/json-imports/i18n-node.js +2 -0
- package/dist/prod/generated/json-imports/i18n-node.js.map +7 -0
- package/dist/prod/generated/json-imports/i18n.js +2 -0
- package/dist/prod/generated/json-imports/i18n.js.map +7 -0
- package/dist/prod/index.js +1 -1
- package/dist/prod/index.js.map +3 -3
- package/dist/prod/jsx-runtime.js.map +2 -2
- package/dist/prod/ssr-dom-shim.js +1 -1
- package/dist/prod/ssr-dom-shim.js.map +2 -2
- package/dist/prod/theming/applyTheme.js +1 -1
- package/dist/prod/theming/applyTheme.js.map +3 -3
- package/dist/prod/theming/componentStyles.js +3 -0
- package/dist/prod/theming/componentStyles.js.map +7 -0
- package/dist/prod/thirdparty/preact/preact.module.js +1 -1
- package/dist/prod/updateShadowRoot.js +1 -1
- package/dist/prod/updateShadowRoot.js.map +3 -3
- package/dist/prod/util/FocusableElements.js +1 -1
- package/dist/prod/util/FocusableElements.js.map +2 -2
- package/dist/prod/util/SelectionAssistant.js +1 -1
- package/dist/prod/util/SelectionAssistant.js.map +3 -3
- package/dist/prod/util/TabbableElements.js +1 -1
- package/dist/prod/util/TabbableElements.js.map +2 -2
- package/dist/prod/util/createInstanceChecker.js +2 -0
- package/dist/prod/util/createInstanceChecker.js.map +7 -0
- package/dist/prod/util/createMultiInstanceChecker.js +2 -0
- package/dist/prod/util/createMultiInstanceChecker.js.map +7 -0
- package/dist/prod/util/dragAndDrop/DragRegistry.js +1 -1
- package/dist/prod/util/dragAndDrop/DragRegistry.js.map +3 -3
- package/dist/prod/util/getParentElement.js +2 -0
- package/dist/prod/util/getParentElement.js.map +7 -0
- package/dist/prod/util/isElementHidden.js +1 -1
- package/dist/prod/util/isElementHidden.js.map +3 -3
- package/dist/prod/util/isEventMarked.js +2 -0
- package/dist/prod/util/isEventMarked.js.map +7 -0
- package/dist/prod/util/valueStateNavigation.js +2 -0
- package/dist/prod/util/valueStateNavigation.js.map +7 -0
- package/dist/prod/validateThemeRoot.js +1 -1
- package/dist/prod/validateThemeRoot.js.map +2 -2
- package/dist/ssr-dom-shim.js +2 -1
- package/dist/ssr-dom-shim.js.map +1 -1
- package/dist/theming/applyTheme.d.ts +2 -0
- package/dist/theming/applyTheme.js +20 -5
- package/dist/theming/applyTheme.js.map +1 -1
- package/dist/theming/componentStyles.d.ts +3 -0
- package/dist/theming/componentStyles.js +15 -0
- package/dist/theming/componentStyles.js.map +1 -0
- package/dist/thirdparty/preact/preact.module.js +1 -1
- package/dist/types.d.ts +11 -3
- package/dist/types.js.map +1 -1
- package/dist/updateShadowRoot.js +2 -1
- package/dist/updateShadowRoot.js.map +1 -1
- package/dist/util/FocusableElements.js +3 -3
- package/dist/util/FocusableElements.js.map +1 -1
- package/dist/util/SelectionAssistant.js +0 -8
- package/dist/util/SelectionAssistant.js.map +1 -1
- package/dist/util/TabbableElements.js +2 -2
- package/dist/util/TabbableElements.js.map +1 -1
- package/dist/util/createInstanceChecker.d.ts +2 -0
- package/dist/util/createInstanceChecker.js +8 -0
- package/dist/util/createInstanceChecker.js.map +1 -0
- package/dist/util/createMultiInstanceChecker.d.ts +2 -0
- package/dist/util/createMultiInstanceChecker.js +19 -0
- package/dist/util/createMultiInstanceChecker.js.map +1 -0
- package/dist/util/dragAndDrop/DragRegistry.d.ts +14 -8
- package/dist/util/dragAndDrop/DragRegistry.js +46 -50
- package/dist/util/dragAndDrop/DragRegistry.js.map +1 -1
- package/dist/util/getClassCopy.d.ts +4 -3
- package/dist/util/getParentElement.d.ts +2 -0
- package/dist/util/getParentElement.js +5 -0
- package/dist/util/getParentElement.js.map +1 -0
- package/dist/util/isElementHidden.js +2 -1
- package/dist/util/isElementHidden.js.map +1 -1
- package/dist/util/isEventMarked.d.ts +2 -0
- package/dist/util/isEventMarked.js +6 -0
- package/dist/util/isEventMarked.js.map +1 -0
- package/dist/util/valueStateNavigation.d.ts +8 -0
- package/dist/util/valueStateNavigation.js +40 -0
- package/dist/util/valueStateNavigation.js.map +1 -0
- package/dist/validateThemeRoot.js +6 -2
- package/dist/validateThemeRoot.js.map +1 -1
- package/package-scripts.cjs +64 -33
- package/package.json +27 -22
- package/src/css/MultipleDragGhost.css +17 -0
- package/src/css/OpenUI5PopupStyles.css +10 -0
- package/src/css/ScrollbarStyles.css +3 -0
- package/src/css/SystemCSSVars.css +28 -3
- package/src/i18n/messagebundle.properties +5 -0
- package/src/i18n/messagebundle_en.properties +2 -0
- package/src/i18n/messagebundle_en_US_sappsd.properties +2 -0
- package/src/i18n/messagebundle_en_US_saprigi.properties +2 -0
- package/src/i18n/messagebundle_en_US_saptrc.properties +2 -0
- package/src/thirdparty/preact/preact.module.js +1 -1
- package/cypress/specs/Accessor.cy.tsx +0 -79
- package/cypress/specs/Boot.cy.tsx +0 -19
- package/cypress/specs/ConfigurationChange.cy.tsx +0 -41
- package/cypress/specs/ConfigurationScript.cy.tsx +0 -133
- package/cypress/specs/ConfigurationURL.cy.tsx +0 -201
- package/cypress/specs/CustomMount.cy.tsx +0 -9
- package/cypress/specs/CustomTheme.cy.tsx +0 -36
- package/cypress/specs/EventProvider.cy.tsx +0 -59
- package/cypress/specs/Events.cy.tsx +0 -28
- package/cypress/specs/SystemDOMElements.cy.tsx +0 -8
- package/cypress/specs/Theming.cy.tsx +0 -74
- package/cypress/specs/UI5ElementInvalidation.cy.tsx +0 -252
- package/cypress/specs/UI5ElementLifecycle.cy.tsx +0 -82
- package/cypress/specs/UI5ElementListenForChildPropChanges.cy.tsx +0 -83
- package/cypress/specs/UI5ElementMetadataExt.cy.tsx +0 -42
- package/cypress/specs/UI5ElementPropertyValidation.cy.tsx +0 -16
- package/cypress/specs/UI5ElementPropsAndAttrs.cy.tsx +0 -113
- package/cypress/specs/UI5ElementShadowDOM.cy.tsx +0 -30
- package/cypress/specs/UI5ElementSlots.cy.tsx +0 -136
- package/cypress/specs/WithComplexTemplate.cy.tsx +0 -32
- package/cypress/specs/i18n_texts.cy.tsx +0 -129
- package/cypress/specs/util/FocusableElements.cy.tsx +0 -48
- package/cypress/support/commands.ts +0 -39
- package/cypress/support/component-index.html +0 -12
- package/cypress/support/component.ts +0 -17
- package/cypress/tsconfig.json +0 -21
- package/dist/css/FontFace.css +0 -96
- package/dist/css/OverrideFontFace.css +0 -32
- package/dist/generated/css/OverrideFontFace.css.d.ts +0 -2
- package/dist/generated/css/OverrideFontFace.css.js +0 -2
- package/dist/generated/css/OverrideFontFace.css.js.map +0 -1
- package/dist/prod/generated/css/OverrideFontFace.css.js +0 -2
- package/dist/prod/generated/css/OverrideFontFace.css.js.map +0 -7
- package/dist/prod/util/getEffectiveScrollbarStyle.js +0 -28
- package/dist/prod/util/getEffectiveScrollbarStyle.js.map +0 -7
- package/dist/util/getEffectiveScrollbarStyle.d.ts +0 -2
- package/dist/util/getEffectiveScrollbarStyle.js +0 -36
- package/dist/util/getEffectiveScrollbarStyle.js.map +0 -1
- package/src/css/FontFace.css +0 -96
- package/src/css/OverrideFontFace.css +0 -32
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/theming/applyTheme.ts"],
|
|
4
|
-
"sourcesContent": ["import { getThemeProperties, getRegisteredPackages, isThemeRegistered } from \"../asset-registries/Themes.js\";\nimport { removeStyle, createOrUpdateStyle } from \"../ManagedStyles.js\";\nimport getThemeDesignerTheme from \"./getThemeDesignerTheme.js\";\nimport { fireThemeLoaded } from \"./ThemeLoaded.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport { attachCustomThemeStylesToHead, getThemeRoot } from \"../config/ThemeRoot.js\";\nimport type OpenUI5Support from \"../features/OpenUI5Support.js\";\nimport { DEFAULT_THEME } from \"../generated/AssetParameters.js\";\nimport { getCurrentRuntimeIndex } from \"../Runtimes.js\";\n\
|
|
5
|
-
"mappings": "aAAA,OAAS,sBAAAA,EAAoB,yBAAAC,EAAuB,qBAAAC,MAAyB,gCAC7E,OAAS,eAAAC,EAAa,uBAAAC,MAA2B,sBACjD,OAAOC,MAA2B,6BAClC,OAAS,mBAAAC,MAAuB,mBAChC,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,iCAAAC,EAA+B,gBAAAC,MAAoB,
|
|
6
|
-
"names": ["getThemeProperties", "getRegisteredPackages", "isThemeRegistered", "removeStyle", "createOrUpdateStyle", "getThemeDesignerTheme", "fireThemeLoaded", "getFeature", "attachCustomThemeStylesToHead", "getThemeRoot", "DEFAULT_THEME", "getCurrentRuntimeIndex", "BASE_THEME_PACKAGE", "isThemeBaseRegistered", "loadThemeBase", "theme", "cssData", "deleteThemeBase", "loadComponentPackages", "externalThemeName", "packagesStylesPromises", "packageName", "detectExternalTheme", "extTheme", "openUI5Support", "applyTheme", "
|
|
4
|
+
"sourcesContent": ["import { getThemeProperties, getRegisteredPackages, isThemeRegistered } from \"../asset-registries/Themes.js\";\nimport { removeStyle, createOrUpdateStyle } from \"../ManagedStyles.js\";\nimport getThemeDesignerTheme from \"./getThemeDesignerTheme.js\";\nimport { fireThemeLoaded } from \"./ThemeLoaded.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport { attachCustomThemeStylesToHead, getThemeRoot } from \"../config/ThemeRoot.js\";\nimport { setBaseTheme } from \"../config/Theme.js\";\nimport type OpenUI5Support from \"../features/OpenUI5Support.js\";\nimport { DEFAULT_THEME } from \"../generated/AssetParameters.js\";\nimport { getCurrentRuntimeIndex } from \"../Runtimes.js\";\nimport { updateComponentStyles } from \"./componentStyles.js\";\n\n// eslint-disable-next-line\nexport let _lib = \"ui5\";\n// eslint-disable-next-line\nexport let _package = \"webcomponents-theming\";\n// eslint-disable-next-line\nconst BASE_THEME_PACKAGE = \"@\" + _lib + \"/\" + _package;\n\nconst isThemeBaseRegistered = () => {\n\tconst registeredPackages = getRegisteredPackages();\n\treturn registeredPackages.has(BASE_THEME_PACKAGE);\n};\n\nconst loadThemeBase = async (theme: string) => {\n\tif (!isThemeBaseRegistered()) {\n\t\treturn;\n\t}\n\n\tconst cssData = await getThemeProperties(BASE_THEME_PACKAGE, theme);\n\tif (cssData) {\n\t\tcreateOrUpdateStyle(cssData, \"data-ui5-theme-properties\", BASE_THEME_PACKAGE, theme);\n\t}\n};\n\nconst deleteThemeBase = () => {\n\tremoveStyle(\"data-ui5-theme-properties\", BASE_THEME_PACKAGE);\n};\n\nconst loadComponentPackages = async (theme: string, externalThemeName?: string) => {\n\tconst registeredPackages = getRegisteredPackages();\n\n\tconst packagesStylesPromises = [...registeredPackages.entries()].map(async ([packageName, { cssVariablesTarget }]) => {\n\t\tif (packageName === BASE_THEME_PACKAGE) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cssData = await getThemeProperties(packageName, theme, externalThemeName);\n\t\tif (cssData) {\n\t\t\tif (cssVariablesTarget === \"root\") {\n\t\t\t\tcreateOrUpdateStyle(cssData, `data-ui5-component-properties-${getCurrentRuntimeIndex()}`, packageName);\n\t\t\t} else if (cssVariablesTarget === \"host\") {\n\t\t\t\tupdateComponentStyles(packageName, cssData);\n\t\t\t}\n\t\t}\n\t});\n\n\treturn Promise.all(packagesStylesPromises);\n};\n\nconst detectExternalTheme = async (theme: string) => {\n\t// If theme designer theme is detected, use this\n\tconst extTheme = getThemeDesignerTheme();\n\tif (extTheme) {\n\t\treturn extTheme;\n\t}\n\n\t// If OpenUI5Support is enabled, try to find out if it loaded variables\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (openUI5Support && openUI5Support.isOpenUI5Detected()) {\n\t\tconst varsLoaded = openUI5Support.cssVariablesLoaded();\n\t\tif (varsLoaded) {\n\t\t\treturn {\n\t\t\t\tthemeName: openUI5Support.getConfigurationSettingsObject()?.theme, // just themeName\n\t\t\t\tbaseThemeName: \"\", // baseThemeName is only relevant for custom themes\n\t\t\t};\n\t\t}\n\t} else if (getThemeRoot()) {\n\t\tawait attachCustomThemeStylesToHead(theme);\n\n\t\treturn getThemeDesignerTheme();\n\t}\n};\n\nconst applyTheme = async (theme: string) => {\n\tconst extTheme = await detectExternalTheme(theme);\n\n\t// Only load theme_base properties if there is no externally loaded theme, or there is, but it is not being loaded\n\tif (!extTheme || theme !== extTheme.themeName) {\n\t\tawait loadThemeBase(theme);\n\t} else {\n\t\tdeleteThemeBase();\n\t}\n\n\t// Always load component packages properties. For non-registered themes, try with the base theme, if any\n\tconst externalThemeName = extTheme && extTheme.themeName === theme ? theme : undefined;\n\tconst baseThemeName = extTheme && extTheme.baseThemeName;\n\tconst effectiveThemeName = isThemeRegistered(theme) ? theme : (baseThemeName || DEFAULT_THEME);\n\n\tawait loadComponentPackages(effectiveThemeName, externalThemeName);\n\n\tsetBaseTheme(baseThemeName);\n\tfireThemeLoaded(theme);\n};\n\nexport default applyTheme;\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,sBAAAA,EAAoB,yBAAAC,EAAuB,qBAAAC,MAAyB,gCAC7E,OAAS,eAAAC,EAAa,uBAAAC,MAA2B,sBACjD,OAAOC,MAA2B,6BAClC,OAAS,mBAAAC,MAAuB,mBAChC,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,iCAAAC,EAA+B,gBAAAC,MAAoB,yBAC5D,OAAS,gBAAAC,MAAoB,qBAE7B,OAAS,iBAAAC,MAAqB,kCAC9B,OAAS,0BAAAC,MAA8B,iBACvC,OAAS,yBAAAC,MAA6B,uBAG/B,WAAI,KAAO,MAEP,SAAW,wBAEtB,MAAMC,EAAqB,IAAM,KAAO,IAAM,SAExCC,EAAwB,IACFd,EAAsB,EACvB,IAAIa,CAAkB,EAG3CE,EAAgB,MAAOC,GAAkB,CAC9C,GAAI,CAACF,EAAsB,EAC1B,OAGD,MAAMG,EAAU,MAAMlB,EAAmBc,EAAoBG,CAAK,EAC9DC,GACHd,EAAoBc,EAAS,4BAA6BJ,EAAoBG,CAAK,CAErF,EAEME,EAAkB,IAAM,CAC7BhB,EAAY,4BAA6BW,CAAkB,CAC5D,EAEMM,EAAwB,MAAOH,EAAeI,IAA+B,CAGlF,MAAMC,EAAyB,CAAC,GAFLrB,EAAsB,EAEK,QAAQ,CAAC,EAAE,IAAI,MAAO,CAACsB,EAAa,CAAE,mBAAAC,CAAmB,CAAC,IAAM,CACrH,GAAID,IAAgBT,EACnB,OAGD,MAAMI,EAAU,MAAMlB,EAAmBuB,EAAaN,EAAOI,CAAiB,EAC1EH,IACCM,IAAuB,OAC1BpB,EAAoBc,EAAS,iCAAiCN,EAAuB,CAAC,GAAIW,CAAW,EAC3FC,IAAuB,QACjCX,EAAsBU,EAAaL,CAAO,EAG7C,CAAC,EAED,OAAO,QAAQ,IAAII,CAAsB,CAC1C,EAEMG,EAAsB,MAAOR,GAAkB,CAEpD,MAAMS,EAAWrB,EAAsB,EACvC,GAAIqB,EACH,OAAOA,EAIR,MAAMC,EAAiBpB,EAAkC,gBAAgB,EACzE,GAAIoB,GAAkBA,EAAe,kBAAkB,GAEtD,GADmBA,EAAe,mBAAmB,EAEpD,MAAO,CACN,UAAWA,EAAe,+BAA+B,GAAG,MAC5D,cAAe,EAChB,UAESlB,EAAa,EACvB,aAAMD,EAA8BS,CAAK,EAElCZ,EAAsB,CAE/B,EAEMuB,EAAa,MAAOX,GAAkB,CAC3C,MAAMS,EAAW,MAAMD,EAAoBR,CAAK,EAG5C,CAACS,GAAYT,IAAUS,EAAS,UACnC,MAAMV,EAAcC,CAAK,EAEzBE,EAAgB,EAIjB,MAAME,EAAoBK,GAAYA,EAAS,YAAcT,EAAQA,EAAQ,OACvEY,EAAgBH,GAAYA,EAAS,cACrCI,EAAqB5B,EAAkBe,CAAK,EAAIA,EAASY,GAAiBlB,EAEhF,MAAMS,EAAsBU,EAAoBT,CAAiB,EAEjEX,EAAamB,CAAa,EAC1BvB,EAAgBW,CAAK,CACtB,EAEA,eAAeW",
|
|
6
|
+
"names": ["getThemeProperties", "getRegisteredPackages", "isThemeRegistered", "removeStyle", "createOrUpdateStyle", "getThemeDesignerTheme", "fireThemeLoaded", "getFeature", "attachCustomThemeStylesToHead", "getThemeRoot", "setBaseTheme", "DEFAULT_THEME", "getCurrentRuntimeIndex", "updateComponentStyles", "BASE_THEME_PACKAGE", "isThemeBaseRegistered", "loadThemeBase", "theme", "cssData", "deleteThemeBase", "loadComponentPackages", "externalThemeName", "packagesStylesPromises", "packageName", "cssVariablesTarget", "detectExternalTheme", "extTheme", "openUI5Support", "applyTheme", "baseThemeName", "effectiveThemeName"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/theming/componentStyles.ts"],
|
|
4
|
+
"sourcesContent": ["const packageMap = new Map<string, string>();\nlet componentsStyleSheet: CSSStyleSheet;\n\nconst getComponentStyles = () => {\n\tif (!componentsStyleSheet) {\n\t\tcomponentsStyleSheet = new CSSStyleSheet();\n\t}\n\n\treturn componentsStyleSheet;\n};\n\nconst updateComponentStyles = (packageName: string, content: string) => {\n\tpackageMap.set(packageName, content);\n\n\tconst combinedStyles = Array.from(packageMap.values()).join(\"\\n\");\n\tgetComponentStyles().replaceSync(combinedStyles);\n};\n\nexport {\n\tgetComponentStyles,\n\tupdateComponentStyles,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,MAAMA,EAAa,IAAI,IACvB,IAAIC,EAEJ,MAAMC,EAAqB,KACrBD,IACJA,EAAuB,IAAI,eAGrBA,GAGFE,EAAwB,CAACC,EAAqBC,IAAoB,CACvEL,EAAW,IAAII,EAAaC,CAAO,EAEnC,MAAMC,EAAiB,MAAM,KAAKN,EAAW,OAAO,CAAC,EAAE,KAAK;AAAA,CAAI,EAChEE,EAAmB,EAAE,YAAYI,CAAc,CAChD,EAEA,OACCJ,KAAA,mBACAC,KAAA",
|
|
6
|
+
"names": ["packageMap", "componentsStyleSheet", "getComponentStyles", "updateComponentStyles", "packageName", "content", "combinedStyles"]
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var n,l,t,u,i,o,r,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function w(n,l){for(var t in l)n[t]=l[t];return n}function _(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function g(l,t,u){var i,o,r,e={};for(r in t)"key"==r?i=t[r]:"ref"==r?o=t[r]:e[r]=t[r];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):u),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===e[r]&&(e[r]=l.defaultProps[r]);return m(l,e,i,o,null)}function m(n,u,i,o,r){var e={type:n,props:u,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++t:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(e),e}function b(){return{current:null}}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function C(n,l){if(null==l)return n.__?C(n.__,n.__i+1):null;for(var t;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e)return t.__e;return"function"==typeof n.type?C(n):null}function S(n){var l,t;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e){n.__e=n.__c.base=t.__e;break}return S(n)}}function M(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!P.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(P)}function P(){var n,t,u,o,r,f,c,s;for(i.sort(e);n=i.shift();)n.__d&&(t=i.length,o=void 0,f=(r=(u=n).__v).__e,c=[],s=[],u.__P&&((o=w({},r)).__v=r.__v+1,l.vnode&&l.vnode(o),F(u.__P,o,r,u.__n,u.__P.namespaceURI,32&r.__u?[f]:null,c,null==f?C(r):f,!!(32&r.__u),s),o.__v=r.__v,o.__.__k[o.__i]=o,z(c,o,s),o.__e!=f&&S(o)),i.length>t&&i.sort(e));P.__r=0}function $(n,l,t,u,i,o,r,e,f,c,s){var a,h,y,d,w,_,g=u&&u.__k||v,m=l.length;for(f=I(t,l,g,f),a=0;a<m;a++)null!=(y=t.__k[a])&&(h=-1===y.__i?p:g[y.__i]||p,y.__i=a,_=F(n,y,h,i,o,r,e,f,c,s),d=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&V(h.ref,null,y),s.push(y.ref,y.__c||d,y)),null==w&&null!=d&&(w=d),4&y.__u||h.__k===y.__k?f=H(y,f,n):"function"==typeof y.type&&void 0!==_?f=_:d&&(f=d.nextSibling),y.__u&=-7);return t.__e=w,f}function I(n,l,t,u){var i,o,r,e,f,c=l.length,s=t.length,a=s,h=0;for(n.__k=[],i=0;i<c;i++)null!=(o=l[i])&&"boolean"!=typeof o&&"function"!=typeof o?(e=i+h,(o=n.__k[i]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m(null,o,null,null,null):d(o)?m(k,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,r=null,-1!==(f=o.__i=O(o,t,e,a))&&(a--,(r=t[f])&&(r.__u|=2)),null==r||null===r.__v?(-1==f&&h--,"function"!=typeof o.type&&(o.__u|=4)):f!==e&&(f==e-1?h--:f==e+1?h++:(f>e?h--:h++,o.__u|=4))):o=n.__k[i]=null;if(a)for(i=0;i<s;i++)null!=(r=t[i])&&0==(2&r.__u)&&(r.__e==u&&(u=C(r)),q(r,r));return u}function H(n,l,t){var u,i;if("function"==typeof n.type){for(u=n.__k,i=0;u&&i<u.length;i++)u[i]&&(u[i].__=n,l=H(u[i],l,t));return l}n.__e!=l&&(l&&n.type&&!t.contains(l)&&(l=C(n)),t.insertBefore(n.__e,l||null),l=n.__e);do{l=l&&l.nextSibling}while(null!=l&&8===l.nodeType);return l}function L(n,l){return l=l||[],null==n||"boolean"==typeof n||(d(n)?n.some(function(n){L(n,l)}):l.push(n)),l}function O(n,l,t,u){var i=n.key,o=n.type,r=t-1,e=t+1,f=l[t];if(null===f||f&&i==f.key&&o===f.type&&0==(2&f.__u))return t;if(("function"!=typeof o||o===k||i)&&u>(null!=f&&0==(2&f.__u)?1:0))for(;r>=0||e<l.length;){if(r>=0){if((f=l[r])&&0==(2&f.__u)&&i==f.key&&o===f.type)return r;r--}if(e<l.length){if((f=l[e])&&0==(2&f.__u)&&i==f.key&&o===f.type)return e;e++}}return-1}function T(n,l,t){"-"===l[0]?n.setProperty(l,null==t?"":t):n[l]=null==t?"":"number"!=typeof t||y.test(l)?t:t+"px"}function j(n,l,t,u,i){var o,r;n:if("style"===l)if("string"==typeof t)n.style.cssText=t;else{if("string"==typeof u&&(n.style.cssText=u=""),u)for(l in u)t&&l in t||T(n.style,l,"");if(t)for(l in t)u&&t[l]===u[l]||T(n.style,l,t[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(f,"$1")),l=l.toLowerCase()in n||"onFocusOut"===l||"onFocusIn"===l?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=t,t?u?t.t=u.t:(t.t=c,n.addEventListener(l,o?a:s,o)):n.removeEventListener(l,o?a:s,o);else{if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{r=n.tagName&&n.tagName.includes("-"),t!==u&&(n[l]=null!=t||r?t:"");break n}catch(n){}"function"==typeof t||(null==t||!1===t&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==t?"":t))}}function A(n){return function(t){if(this.l){var u=this.l[t.type+n];if(null==t.u)t.u=c++;else if(t.u<u.t)return;return u(l.event?l.event(t):t)}}}function F(n,t,u,i,o,r,e,f,c,s){var a,h,p,v,y,g,m,b,C,S,M,P,I,H,L,O,T,j=t.type;if(void 0!==t.constructor)return null;128&u.__u&&(c=!!(32&u.__u),r=[f=t.__e=u.__e]),(a=l.__b)&&a(t);n:if("function"==typeof j)try{if(b=t.props,C="prototype"in j&&j.prototype.render,S=(a=j.contextType)&&i[a.__c],M=a?S?S.props.value:a.__:i,u.__c?m=(h=t.__c=u.__c).__=h.__E:(C?t.__c=h=new j(b,M):(t.__c=h=new x(b,M),h.constructor=j,h.render=B),S&&S.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),C&&null==h.__s&&(h.__s=h.state),C&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=w({},h.__s)),w(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=t,p)C&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),C&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(C&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||t.__v===u.__v)){for(t.__v!==u.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=u.__e,t.__k=u.__k,t.__k.some(function(n){n&&(n.__=t)}),P=0;P<h._sb.length;P++)h.__h.push(h._sb[P]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),C&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,g)})}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,I=l.__r,H=0,C){for(h.state=h.__s,h.__d=!1,I&&I(t),a=h.render(h.props,h.state,h.context),L=0;L<h._sb.length;L++)h.__h.push(h._sb[L]);h._sb=[]}else do{h.__d=!1,I&&I(t),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++H<25);h.state=h.__s,null!=h.getChildContext&&(i=w(w({},i),h.getChildContext())),C&&!p&&null!=h.getSnapshotBeforeUpdate&&(g=h.getSnapshotBeforeUpdate(v,y)),f=$(n,d(O=null!=a&&a.type===k&&null==a.key?a.props.children:a)?O:[O],t,u,i,o,r,e,f,c,s),h.base=t.__e,t.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null)}catch(n){if(t.__v=null,c||null!=r)if(n.then){for(t.__u|=c?160:128;f&&8===f.nodeType&&f.nextSibling;)f=f.nextSibling;r[r.indexOf(f)]=null,t.__e=f}else for(T=r.length;T--;)_(r[T]);else t.__e=u.__e,t.__k=u.__k;l.__e(n,t,u)}else null==r&&t.__v===u.__v?(t.__k=u.__k,t.__e=u.__e):f=t.__e=N(u.__e,t,u,i,o,r,e,c,s);return(a=l.diffed)&&a(t),128&t.__u?void 0:f}function z(n,t,u){for(var i=0;i<u.length;i++)V(u[i],u[++i],u[++i]);l.__c&&l.__c(t,n),n.some(function(t){try{n=t.__h,t.__h=[],n.some(function(n){n.call(t)})}catch(n){l.__e(n,t.__v)}})}function N(t,u,i,o,r,e,f,c,s){var a,h,v,y,w,g,m,b,k=i.props,x=u.props,S=u.type;if("svg"===S?r="http://www.w3.org/2000/svg":"math"===S?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((w=e[a])&&"setAttribute"in w==!!S&&(S?w.localName===S:3===w.nodeType)){t=w,e[a]=null;break}if(null==t){if(null===S)return document.createTextNode(x);t=document.createElementNS(r,S,x.is&&x),c&&(l.__m&&l.__m(u,e),c=!1),e=null}if(null===S)k===x||c&&t.data===x||(t.data=x);else{if(e=e&&n.call(t.childNodes),k=i.props||p,!c&&null!=e)for(k={},a=0;a<t.attributes.length;a++)k[(w=t.attributes[a]).name]=w.value;for(a in k)if(w=k[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=w;else if(!(a in x)){if("value"==a&&"defaultValue"in x||"checked"==a&&"defaultChecked"in x)continue;j(t,a,null,w,r)}for(a in x)w=x[a],"children"==a?y=w:"dangerouslySetInnerHTML"==a?h=w:"value"==a?g=w:"checked"==a?m=w:c&&"function"!=typeof w||k[a]===w||((a.startsWith("on")||"ref"===a&&"function"==typeof w)&&(b=o[Object.keys(o)[0]])&&(w=w.bind(b.props.value)),j(t,a,w,k[a],r));if(h)c||v&&(h.__html===v.__html||h.__html===t.innerHTML)||(t.innerHTML=h.__html),u.__k=[];else if(v&&(t.innerHTML=""),$(t,d(y)?y:[y],u,i,o,"foreignObject"===S?"http://www.w3.org/1999/xhtml":r,e,f,e?e[0]:i.__k&&C(i,0),c,s),null!=e)for(a=e.length;a--;)_(e[a]);c||(a="value","progress"===S&&null==g?t.removeAttribute("value"):void 0!==g&&(g!==t[a]||"progress"===S&&!g||"option"===S&&g!==k[a])&&j(t,a,g,k[a],r),a="checked",void 0!==m&&m!==t[a]&&j(t,a,m,k[a],r))}return t}function V(n,t,u){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==t||(n.__u=n(t))}else n.current=t}catch(n){l.__e(n,u)}}function q(n,t,u){var i,o;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||V(i,null,t)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,t)}i.base=i.__P=null}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&q(i[o],t,u||"function"!=typeof n.type);u||_(n.__e),n.__c=n.__=n.__e=void 0}function B(n,l,t){return this.constructor(n,t)}function D(t,u,i){var o,r,e,f;u===document&&(u=document.documentElement),l.__&&l.__(t,u),r=(o="function"==typeof i)?null:i&&i.__k||u.__k,e=[],f=[],F(u,t=(!o&&i||u).__k=g(k,null,[t]),r||p,p,u.namespaceURI,!o&&i?[i]:r?null:u.firstChild?n.call(u.childNodes):null,e,!o&&i?i:r?r.__e:u.firstChild,o,f),z(e,t,f)}function E(n,l){D(n,l,E)}function G(l,t,u){var i,o,r,e,f=w({},l.props);for(r in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),t)"key"==r?i=t[r]:"ref"==r?o=t[r]:f[r]=void 0===t[r]&&void 0!==e?e[r]:t[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):u),m(l.type,f,i||l.key,o||l.ref,null)}function J(n,l){var t={__c:l="__cC"+h++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var t,u;return this.getChildContext||(t=new Set,(u={})[l]=this,this.getChildContext=function(){return u},this.componentWillUnmount=function(){t=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&t.forEach(function(n){n.__e=!0,M(n)})},this.sub=function(n){t.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){t&&t.delete(n),l&&l.call(n)}}),n.children}};return t.Provider.__=t.Consumer.contextType=t}n=v.slice,l={__e:function(n,l,t,u){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,u||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},t=0,u=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var t;t=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof n&&(n=n(w({},t),this.props)),n&&w(t,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},x.prototype.render=k,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=A(!1),a=A(!0),h=0;export{x as Component,k as Fragment,G as cloneElement,J as createContext,g as createElement,b as createRef,g as h,E as hydrate,u as isValidElement,l as options,D as render,L as toChildArray};
|
|
1
|
+
var n,l,t,u,i,o,r,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function w(n,l){for(var t in l)n[t]=l[t];return n}function _(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function g(l,t,u){var i,o,r,e={};for(r in t)"key"==r?i=t[r]:"ref"==r?o=t[r]:e[r]=t[r];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):u),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===e[r]&&(e[r]=l.defaultProps[r]);return m(l,e,i,o,null)}function m(n,u,i,o,r){var e={type:n,props:u,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++t:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(e),e}function b(){return{current:null}}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function C(n,l){if(null==l)return n.__?C(n.__,n.__i+1):null;for(var t;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e)return t.__e;return"function"==typeof n.type?C(n):null}function S(n){var l,t;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(t=n.__k[l])&&null!=t.__e){n.__e=n.__c.base=t.__e;break}return S(n)}}function M(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!P.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(P)}function P(){var n,t,u,o,r,f,c,s;for(i.sort(e);n=i.shift();)n.__d&&(t=i.length,o=void 0,f=(r=(u=n).__v).__e,c=[],s=[],u.__P&&((o=w({},r)).__v=r.__v+1,l.vnode&&l.vnode(o),F(u.__P,o,r,u.__n,u.__P.namespaceURI,32&r.__u?[f]:null,c,null==f?C(r):f,!!(32&r.__u),s),o.__v=r.__v,o.__.__k[o.__i]=o,z(c,o,s),o.__e!=f&&S(o)),i.length>t&&i.sort(e));P.__r=0}function $(n,l,t,u,i,o,r,e,f,c,s){var a,h,y,d,w,_,g=u&&u.__k||v,m=l.length;for(f=I(t,l,g,f),a=0;a<m;a++)null!=(y=t.__k[a])&&(h=-1===y.__i?p:g[y.__i]||p,y.__i=a,_=F(n,y,h,i,o,r,e,f,c,s),d=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&V(h.ref,null,y),s.push(y.ref,y.__c||d,y)),null==w&&null!=d&&(w=d),4&y.__u||h.__k===y.__k?f=H(y,f,n):"function"==typeof y.type&&void 0!==_?f=_:d&&(f=d.nextSibling),y.__u&=-7);return t.__e=w,f}function I(n,l,t,u){var i,o,r,e,f,c=l.length,s=t.length,a=s,h=0;for(n.__k=[],i=0;i<c;i++)null!=(o=l[i])&&"boolean"!=typeof o&&"function"!=typeof o?(e=i+h,(o=n.__k[i]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m(null,o,null,null,null):d(o)?m(k,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,r=null,-1!==(f=o.__i=O(o,t,e,a))&&(a--,(r=t[f])&&(r.__u|=2)),null==r||null===r.__v?(-1==f&&h--,"function"!=typeof o.type&&(o.__u|=4)):f!==e&&(f==e-1?h--:f==e+1?h++:(f>e?h--:h++,o.__u|=4))):o=n.__k[i]=null;if(a)for(i=0;i<s;i++)null!=(r=t[i])&&0==(2&r.__u)&&(r.__e==u&&(u=C(r)),q(r,r));return u}function H(n,l,t){var u,i;if("function"==typeof n.type){for(u=n.__k,i=0;u&&i<u.length;i++)u[i]&&(u[i].__=n,l=H(u[i],l,t));return l}n.__e!=l&&(l&&n.type&&!t.contains(l)&&(l=C(n)),t.insertBefore(n.__e,l||null),l=n.__e);do{l=l&&l.nextSibling}while(null!=l&&8===l.nodeType);return l}function L(n,l){return l=l||[],null==n||"boolean"==typeof n||(d(n)?n.some(function(n){L(n,l)}):l.push(n)),l}function O(n,l,t,u){var i=n.key,o=n.type,r=t-1,e=t+1,f=l[t];if(null===f||f&&i==f.key&&o===f.type&&0==(2&f.__u))return t;if(("function"!=typeof o||o===k||i)&&u>(null!=f&&0==(2&f.__u)?1:0))for(;r>=0||e<l.length;){if(r>=0){if((f=l[r])&&0==(2&f.__u)&&i==f.key&&o===f.type)return r;r--}if(e<l.length){if((f=l[e])&&0==(2&f.__u)&&i==f.key&&o===f.type)return e;e++}}return-1}function T(n,l,t){"-"===l[0]?n.setProperty(l,null==t?"":t):n[l]=null==t?"":"number"!=typeof t||y.test(l)?t:t+"px"}function j(n,l,t,u,i){var o,r;n:if("style"===l)if("string"==typeof t)n.style.cssText=t;else{if("string"==typeof u&&(n.style.cssText=u=""),u)for(l in u)t&&l in t||T(n.style,l,"");if(t)for(l in t)u&&t[l]===u[l]||T(n.style,l,t[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(f,"$1")),l=l.toLowerCase()in n||"onFocusOut"===l||"onFocusIn"===l?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=t,t?u?t.t=u.t:(t.t=c,n.addEventListener(l,o?a:s,o)):n.removeEventListener(l,o?a:s,o);else{if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{r=n.tagName&&n.tagName.includes("-"),/*t!==u&&*/(n[l]=null!=t||r?t:"");break n}catch(n){}"function"==typeof t||(null==t||!1===t&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==t?"":t))}}function A(n){return function(t){if(this.l){var u=this.l[t.type+n];if(null==t.u)t.u=c++;else if(t.u<u.t)return;return u(l.event?l.event(t):t)}}}function F(n,t,u,i,o,r,e,f,c,s){var a,h,p,v,y,g,m,b,C,S,M,P,I,H,L,O,T,j=t.type;if(void 0!==t.constructor)return null;128&u.__u&&(c=!!(32&u.__u),r=[f=t.__e=u.__e]),(a=l.__b)&&a(t);n:if("function"==typeof j)try{if(b=t.props,C="prototype"in j&&j.prototype.render,S=(a=j.contextType)&&i[a.__c],M=a?S?S.props.value:a.__:i,u.__c?m=(h=t.__c=u.__c).__=h.__E:(C?t.__c=h=new j(b,M):(t.__c=h=new x(b,M),h.constructor=j,h.render=B),S&&S.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),C&&null==h.__s&&(h.__s=h.state),C&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=w({},h.__s)),w(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=t,p)C&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),C&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(C&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||t.__v===u.__v)){for(t.__v!==u.__v&&(h.props=b,h.state=h.__s,h.__d=!1),t.__e=u.__e,t.__k=u.__k,t.__k.some(function(n){n&&(n.__=t)}),P=0;P<h._sb.length;P++)h.__h.push(h._sb[P]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),C&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,g)})}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,I=l.__r,H=0,C){for(h.state=h.__s,h.__d=!1,I&&I(t),a=h.render(h.props,h.state,h.context),L=0;L<h._sb.length;L++)h.__h.push(h._sb[L]);h._sb=[]}else do{h.__d=!1,I&&I(t),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++H<25);h.state=h.__s,null!=h.getChildContext&&(i=w(w({},i),h.getChildContext())),C&&!p&&null!=h.getSnapshotBeforeUpdate&&(g=h.getSnapshotBeforeUpdate(v,y)),f=$(n,d(O=null!=a&&a.type===k&&null==a.key?a.props.children:a)?O:[O],t,u,i,o,r,e,f,c,s),h.base=t.__e,t.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null)}catch(n){if(t.__v=null,c||null!=r)if(n.then){for(t.__u|=c?160:128;f&&8===f.nodeType&&f.nextSibling;)f=f.nextSibling;r[r.indexOf(f)]=null,t.__e=f}else for(T=r.length;T--;)_(r[T]);else t.__e=u.__e,t.__k=u.__k;l.__e(n,t,u)}else null==r&&t.__v===u.__v?(t.__k=u.__k,t.__e=u.__e):f=t.__e=N(u.__e,t,u,i,o,r,e,c,s);return(a=l.diffed)&&a(t),128&t.__u?void 0:f}function z(n,t,u){for(var i=0;i<u.length;i++)V(u[i],u[++i],u[++i]);l.__c&&l.__c(t,n),n.some(function(t){try{n=t.__h,t.__h=[],n.some(function(n){n.call(t)})}catch(n){l.__e(n,t.__v)}})}function N(t,u,i,o,r,e,f,c,s){var a,h,v,y,w,g,m,b,k=i.props,x=u.props,S=u.type;if("svg"===S?r="http://www.w3.org/2000/svg":"math"===S?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((w=e[a])&&"setAttribute"in w==!!S&&(S?w.localName===S:3===w.nodeType)){t=w,e[a]=null;break}if(null==t){if(null===S)return document.createTextNode(x);t=document.createElementNS(r,S,x.is&&x),c&&(l.__m&&l.__m(u,e),c=!1),e=null}if(null===S)k===x||c&&t.data===x||(t.data=x);else{if(e=e&&n.call(t.childNodes),k=i.props||p,!c&&null!=e)for(k={},a=0;a<t.attributes.length;a++)k[(w=t.attributes[a]).name]=w.value;for(a in k)if(w=k[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=w;else if(!(a in x)){if("value"==a&&"defaultValue"in x||"checked"==a&&"defaultChecked"in x)continue;j(t,a,null,w,r)}for(a in x)w=x[a],"children"==a?y=w:"dangerouslySetInnerHTML"==a?h=w:"value"==a?g=w:"checked"==a?m=w:c&&"function"!=typeof w||k[a]===w||((a.startsWith("on")||"ref"===a&&"function"==typeof w)&&(b=o[Object.keys(o)[0]])&&(w=w.bind(b.props.value)),j(t,a,w,k[a],r));if(h)c||v&&(h.__html===v.__html||h.__html===t.innerHTML)||(t.innerHTML=h.__html),u.__k=[];else if(v&&(t.innerHTML=""),$(t,d(y)?y:[y],u,i,o,"foreignObject"===S?"http://www.w3.org/1999/xhtml":r,e,f,e?e[0]:i.__k&&C(i,0),c,s),null!=e)for(a=e.length;a--;)_(e[a]);c||(a="value","progress"===S&&null==g?t.removeAttribute("value"):void 0!==g&&(g!==t[a]||"progress"===S&&!g||"option"===S&&g!==k[a])&&j(t,a,g,k[a],r),a="checked",void 0!==m&&m!==t[a]&&j(t,a,m,k[a],r))}return t}function V(n,t,u){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==t||(n.__u=n(t))}else n.current=t}catch(n){l.__e(n,u)}}function q(n,t,u){var i,o;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||V(i,null,t)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,t)}i.base=i.__P=null}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&q(i[o],t,u||"function"!=typeof n.type);u||_(n.__e),n.__c=n.__=n.__e=void 0}function B(n,l,t){return this.constructor(n,t)}function D(t,u,i){var o,r,e,f;u===document&&(u=document.documentElement),l.__&&l.__(t,u),r=(o="function"==typeof i)?null:i&&i.__k||u.__k,e=[],f=[],F(u,t=(!o&&i||u).__k=g(k,null,[t]),r||p,p,u.namespaceURI,!o&&i?[i]:r?null:u.firstChild?n.call(u.childNodes):null,e,!o&&i?i:r?r.__e:u.firstChild,o,f),z(e,t,f)}function E(n,l){D(n,l,E)}function G(l,t,u){var i,o,r,e,f=w({},l.props);for(r in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),t)"key"==r?i=t[r]:"ref"==r?o=t[r]:f[r]=void 0===t[r]&&void 0!==e?e[r]:t[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):u),m(l.type,f,i||l.key,o||l.ref,null)}function J(n,l){var t={__c:l="__cC"+h++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var t,u;return this.getChildContext||(t=new Set,(u={})[l]=this,this.getChildContext=function(){return u},this.componentWillUnmount=function(){t=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&t.forEach(function(n){n.__e=!0,M(n)})},this.sub=function(n){t.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){t&&t.delete(n),l&&l.call(n)}}),n.children}};return t.Provider.__=t.Consumer.contextType=t}n=v.slice,l={__e:function(n,l,t,u){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,u||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},t=0,u=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var t;t=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof n&&(n=n(w({},t),this.props)),n&&w(t,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},x.prototype.render=k,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=A(!1),a=A(!0),h=0;export{x as Component,k as Fragment,G as cloneElement,J as createContext,g as createElement,b as createRef,g as h,E as hydrate,u as isValidElement,l as options,D as render,L as toChildArray};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import r from"./theming/getConstructableStyle.js";const s=o=>{const e=o.constructor,t=o.shadowRoot;if(!t){console.warn("There is no shadow root to update");return}t.adoptedStyleSheets=r(e),e.renderer(o,t)};export default s;
|
|
1
|
+
"use strict";import r from"./theming/getConstructableStyle.js";import{getComponentStyles as n}from"./theming/componentStyles.js";const s=o=>{const e=o.constructor,t=o.shadowRoot;if(!t){console.warn("There is no shadow root to update");return}t.adoptedStyleSheets=[n(),...r(e)],e.renderer(o,t)};export default s;
|
|
2
2
|
//# sourceMappingURL=updateShadowRoot.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/updateShadowRoot.ts"],
|
|
4
|
-
"sourcesContent": ["import getConstructableStyle from \"./theming/getConstructableStyle.js\";\nimport type UI5Element from \"./UI5Element.js\";\n\n/**\n * Updates the shadow root of a UI5Element or its static area item\n * @param element\n */\nconst updateShadowRoot = (element: UI5Element) => {\n\tconst ctor = element.constructor as typeof UI5Element;\n\tconst shadowRoot = element.shadowRoot;\n\n\tif (!shadowRoot) {\n\t\tconsole.warn(`There is no shadow root to update`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\tshadowRoot.adoptedStyleSheets = getConstructableStyle(ctor);\n\tctor.renderer(element, shadowRoot);\n};\n\nexport default updateShadowRoot;\n"],
|
|
5
|
-
"mappings": "aAAA,OAAOA,MAA2B,
|
|
6
|
-
"names": ["getConstructableStyle", "updateShadowRoot", "element", "ctor", "shadowRoot"]
|
|
4
|
+
"sourcesContent": ["import getConstructableStyle from \"./theming/getConstructableStyle.js\";\nimport { getComponentStyles } from \"./theming/componentStyles.js\";\nimport type UI5Element from \"./UI5Element.js\";\n\n/**\n * Updates the shadow root of a UI5Element or its static area item\n * @param element\n */\nconst updateShadowRoot = (element: UI5Element) => {\n\tconst ctor = element.constructor as typeof UI5Element;\n\tconst shadowRoot = element.shadowRoot;\n\n\tif (!shadowRoot) {\n\t\tconsole.warn(`There is no shadow root to update`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\tshadowRoot.adoptedStyleSheets = [getComponentStyles(), ...getConstructableStyle(ctor)];\n\tctor.renderer(element, shadowRoot);\n};\n\nexport default updateShadowRoot;\n"],
|
|
5
|
+
"mappings": "aAAA,OAAOA,MAA2B,qCAClC,OAAS,sBAAAC,MAA0B,+BAOnC,MAAMC,EAAoBC,GAAwB,CACjD,MAAMC,EAAOD,EAAQ,YACfE,EAAaF,EAAQ,WAE3B,GAAI,CAACE,EAAY,CAChB,QAAQ,KAAK,mCAAmC,EAChD,MACD,CAEAA,EAAW,mBAAqB,CAACJ,EAAmB,EAAG,GAAGD,EAAsBI,CAAI,CAAC,EACrFA,EAAK,SAASD,EAASE,CAAU,CAClC,EAEA,eAAeH",
|
|
6
|
+
"names": ["getConstructableStyle", "getComponentStyles", "updateShadowRoot", "element", "ctor", "shadowRoot"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import o from"./isElementHidden.js";import f from"./isElementClickable.js";import{instanceOfUI5Element as a}from"../UI5Element.js";import{isSafari as
|
|
1
|
+
"use strict";import o from"./isElementHidden.js";import f from"./isElementClickable.js";import{instanceOfUI5Element as a}from"../UI5Element.js";import{isSafari as E}from"../Device.js";const c=e=>e.hasAttribute("data-ui5-focus-trap"),d=e=>{const l=getComputedStyle(e);return e.scrollHeight>e.clientHeight&&["scroll","auto"].indexOf(l.overflowY)>=0||e.scrollWidth>e.clientWidth&&["scroll","auto"].indexOf(l.overflowX)>=0},b=async(e,l)=>!e||o(e)?null:u(e,!0,l),H=async(e,l)=>!e||o(e)?null:u(e,!1,l),T=e=>e.hasAttribute("data-ui5-focus-redirect")||!o(e),L=e=>{if(a(e)){const l=e.getAttribute("tabindex");if(l!==null&&parseInt(l)<0)return!0}return!1},u=async(e,l,r)=>{let t,s,n=-1;e.shadowRoot?t=l?e.shadowRoot.firstElementChild:e.shadowRoot.lastElementChild:e instanceof HTMLSlotElement&&e.assignedNodes()?(s=e.assignedElements(),n=l?0:s.length-1,t=s[n]):r?t=e:t=l?e.firstElementChild:e.lastElementChild;let i;for(;t;){const m=t;if(!o(m)&&!L(m)){if(a(t)&&(await t._waitForDomRef(),t=t.getDomRef()),!t||o(t))return null;if(t.nodeType===1&&T(t)&&!c(t)){if(f(t)||(i=await u(t,l),!E()&&!i&&d(t)))return t&&typeof t.focus=="function"?t:null;if(i)return i&&typeof i.focus=="function"?i:null}}t=l?m.nextElementSibling:m.previousElementSibling,s&&!s[n].contains(t)&&(n=l?n+1:n-1,t=s[n])}return null};export{b as getFirstFocusableElement,H as getLastFocusableElement};
|
|
2
2
|
//# sourceMappingURL=FocusableElements.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/util/FocusableElements.ts"],
|
|
4
|
-
"sourcesContent": ["import isElementHidden from \"./isElementHidden.js\";\nimport isElementClickable from \"./isElementClickable.js\";\nimport { instanceOfUI5Element } from \"../UI5Element.js\";\nimport { isSafari } from \"../Device.js\";\n\ntype FocusableElementPromise = Promise<HTMLElement | null>;\n\nconst isFocusTrap = (el: HTMLElement) => {\n\treturn el.hasAttribute(\"data-ui5-focus-trap\");\n};\n\nconst isScrollable = (el: HTMLElement) => {\n\tconst computedStyle = getComputedStyle(el);\n\n\treturn (el.scrollHeight > el.clientHeight && [\"scroll\", \"auto\"].indexOf(computedStyle.overflowY) >= 0)\n\t\t|| (el.scrollWidth > el.clientWidth && [\"scroll\", \"auto\"].indexOf(computedStyle.overflowX) >= 0);\n};\n\nconst getFirstFocusableElement = async (container: HTMLElement, startFromContainer?: boolean): FocusableElementPromise => {\n\tif (!container || isElementHidden(container)) {\n\t\treturn null;\n\t}\n\n\treturn findFocusableElement(container, true, startFromContainer);\n};\n\nconst getLastFocusableElement = async (container: HTMLElement, startFromContainer?: boolean): FocusableElementPromise => {\n\tif (!container || isElementHidden(container)) {\n\t\treturn null;\n\t}\n\n\treturn findFocusableElement(container, false, startFromContainer);\n};\n\nconst isElemFocusable = (el: HTMLElement) => {\n\treturn el.hasAttribute(\"data-ui5-focus-redirect\") || !isElementHidden(el);\n};\n\nconst isUI5ElementWithNegativeTabIndex = (el: HTMLElement) => {\n\tif (instanceOfUI5Element(el)) {\n\t\tconst tabIndex = el.getAttribute(\"tabindex\");\n\t\tif (tabIndex !== null && parseInt(tabIndex) < 0) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n};\n\nconst findFocusableElement = async (container: HTMLElement, forward: boolean, startFromContainer?: boolean): FocusableElementPromise => {\n\tlet child: HTMLElement | undefined;\n\tlet assignedElements;\n\tlet currentIndex = -1;\n\n\tif (container.shadowRoot) {\n\t\tchild = forward ? container.shadowRoot.
|
|
5
|
-
"mappings": "aAAA,OAAOA,MAAqB,uBAC5B,OAAOC,MAAwB,0BAC/B,OAAS,wBAAAC,MAA4B,mBACrC,OAAS,YAAAC,MAAgB,eAIzB,MAAMC,EAAeC,GACbA,EAAG,aAAa,qBAAqB,EAGvCC,EAAgBD,GAAoB,CACzC,MAAME,EAAgB,iBAAiBF,CAAE,EAEzC,OAAQA,EAAG,aAAeA,EAAG,cAAgB,CAAC,SAAU,MAAM,EAAE,QAAQE,EAAc,SAAS,GAAK,GAC/FF,EAAG,YAAcA,EAAG,aAAe,CAAC,SAAU,MAAM,EAAE,QAAQE,EAAc,SAAS,GAAK,CAChG,EAEMC,EAA2B,MAAOC,EAAwBC,IAC3D,CAACD,GAAaT,EAAgBS,CAAS,EACnC,KAGDE,EAAqBF,EAAW,GAAMC,CAAkB,EAG1DE,EAA0B,MAAOH,EAAwBC,IAC1D,CAACD,GAAaT,EAAgBS,CAAS,EACnC,KAGDE,EAAqBF,EAAW,GAAOC,CAAkB,EAG3DG,EAAmBR,GACjBA,EAAG,aAAa,yBAAyB,GAAK,CAACL,EAAgBK,CAAE,EAGnES,EAAoCT,GAAoB,CAC7D,GAAIH,EAAqBG,CAAE,EAAG,CAC7B,MAAMU,EAAWV,EAAG,aAAa,UAAU,EAC3C,GAAIU,IAAa,MAAQ,SAASA,CAAQ,EAAI,EAC7C,MAAO,EAET,CAEA,MAAO,EACR,EAEMJ,EAAuB,MAAOF,EAAwBO,EAAkBN,IAA0D,CACvI,IAAIO,EACAC,EACAC,EAAe,GAEfV,EAAU,WACbQ,EAAQD,EAAUP,EAAU,WAAW,
|
|
4
|
+
"sourcesContent": ["import isElementHidden from \"./isElementHidden.js\";\nimport isElementClickable from \"./isElementClickable.js\";\nimport { instanceOfUI5Element } from \"../UI5Element.js\";\nimport { isSafari } from \"../Device.js\";\n\ntype FocusableElementPromise = Promise<HTMLElement | null>;\n\nconst isFocusTrap = (el: HTMLElement) => {\n\treturn el.hasAttribute(\"data-ui5-focus-trap\");\n};\n\nconst isScrollable = (el: HTMLElement) => {\n\tconst computedStyle = getComputedStyle(el);\n\n\treturn (el.scrollHeight > el.clientHeight && [\"scroll\", \"auto\"].indexOf(computedStyle.overflowY) >= 0)\n\t\t|| (el.scrollWidth > el.clientWidth && [\"scroll\", \"auto\"].indexOf(computedStyle.overflowX) >= 0);\n};\n\nconst getFirstFocusableElement = async (container: HTMLElement, startFromContainer?: boolean): FocusableElementPromise => {\n\tif (!container || isElementHidden(container)) {\n\t\treturn null;\n\t}\n\n\treturn findFocusableElement(container, true, startFromContainer);\n};\n\nconst getLastFocusableElement = async (container: HTMLElement, startFromContainer?: boolean): FocusableElementPromise => {\n\tif (!container || isElementHidden(container)) {\n\t\treturn null;\n\t}\n\n\treturn findFocusableElement(container, false, startFromContainer);\n};\n\nconst isElemFocusable = (el: HTMLElement) => {\n\treturn el.hasAttribute(\"data-ui5-focus-redirect\") || !isElementHidden(el);\n};\n\nconst isUI5ElementWithNegativeTabIndex = (el: HTMLElement) => {\n\tif (instanceOfUI5Element(el)) {\n\t\tconst tabIndex = el.getAttribute(\"tabindex\");\n\t\tif (tabIndex !== null && parseInt(tabIndex) < 0) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n};\n\nconst findFocusableElement = async (container: HTMLElement, forward: boolean, startFromContainer?: boolean): FocusableElementPromise => {\n\tlet child: HTMLElement | undefined;\n\tlet assignedElements;\n\tlet currentIndex = -1;\n\n\tif (container.shadowRoot) {\n\t\tchild = forward ? container.shadowRoot.firstElementChild as HTMLElement : container.shadowRoot.lastElementChild as HTMLElement;\n\t} else if (container instanceof HTMLSlotElement && container.assignedNodes()) {\n\t\tassignedElements = container.assignedElements();\n\t\tcurrentIndex = forward ? 0 : assignedElements.length - 1;\n\t\tchild = assignedElements[currentIndex] as HTMLElement;\n\t} else if (startFromContainer) {\n\t\tchild = container;\n\t} else {\n\t\tchild = forward ? container.firstElementChild as HTMLElement : container.lastElementChild as HTMLElement;\n\t}\n\n\tlet focusableDescendant;\n\n\t/* eslint-disable no-await-in-loop */\n\n\twhile (child) {\n\t\tconst originalChild: HTMLElement | undefined = child;\n\n\t\tif (!isElementHidden(originalChild) && !isUI5ElementWithNegativeTabIndex(originalChild)) {\n\t\t\tif (instanceOfUI5Element(child)) {\n\t\t\t\t// getDomRef is used because some components mark their focusable ref in an inner\n\t\t\t\t// html but there might also be focusable targets outside of it\n\t\t\t\t// as an example - TreeItemBase\n\t\t\t\t// div - root of the component returned by getDomRef()\n\t\t\t\t// \tli.ui5-li-tree - returned by getFocusDomRef() and may not be focusable (ItemNavigation manages tabindex)\n\t\t\t\t// \tul.subtree - may still contain focusable targets (sub nodes of the tree item)\n\t\t\t\tawait child._waitForDomRef();\n\t\t\t\tchild = child.getDomRef();\n\t\t\t}\n\n\t\t\tif (!child || isElementHidden(child)) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif (child.nodeType === 1 && isElemFocusable(child) && !isFocusTrap(child)) {\n\t\t\t\tif (isElementClickable(child)) {\n\t\t\t\t\treturn (child && typeof child.focus === \"function\") ? child : null;\n\t\t\t\t}\n\n\t\t\t\tfocusableDescendant = await findFocusableElement(child, forward);\n\n\t\t\t\t// check if it is a keyboard focusable scroll container\n\t\t\t\tif (!isSafari() && !focusableDescendant && isScrollable(child)) {\n\t\t\t\t\treturn (child && typeof child.focus === \"function\") ? child : null;\n\t\t\t\t}\n\n\t\t\t\tif (focusableDescendant) {\n\t\t\t\t\treturn (focusableDescendant && typeof focusableDescendant.focus === \"function\") ? focusableDescendant : null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tchild = forward ? originalChild.nextElementSibling as HTMLElement : originalChild.previousElementSibling as HTMLElement;\n\n\t\t// If the child element is not part of the currently assigned element,\n\t\t// we have to check the next/previous element assigned to the slot or continue with the next/previous sibling of the slot,\n\t\t// otherwise, the nextSibling/previousSibling is the next element inside the light DOM\n\t\tif (assignedElements && !assignedElements[currentIndex].contains(child)) {\n\t\t\tcurrentIndex = forward ? currentIndex + 1 : currentIndex - 1;\n\n\t\t\tchild = assignedElements[currentIndex] as HTMLElement;\n\t\t}\n\t}\n\n\t/* eslint-enable no-await-in-loop */\n\n\treturn null;\n};\n\nexport {\n\tgetFirstFocusableElement,\n\tgetLastFocusableElement,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAOA,MAAqB,uBAC5B,OAAOC,MAAwB,0BAC/B,OAAS,wBAAAC,MAA4B,mBACrC,OAAS,YAAAC,MAAgB,eAIzB,MAAMC,EAAeC,GACbA,EAAG,aAAa,qBAAqB,EAGvCC,EAAgBD,GAAoB,CACzC,MAAME,EAAgB,iBAAiBF,CAAE,EAEzC,OAAQA,EAAG,aAAeA,EAAG,cAAgB,CAAC,SAAU,MAAM,EAAE,QAAQE,EAAc,SAAS,GAAK,GAC/FF,EAAG,YAAcA,EAAG,aAAe,CAAC,SAAU,MAAM,EAAE,QAAQE,EAAc,SAAS,GAAK,CAChG,EAEMC,EAA2B,MAAOC,EAAwBC,IAC3D,CAACD,GAAaT,EAAgBS,CAAS,EACnC,KAGDE,EAAqBF,EAAW,GAAMC,CAAkB,EAG1DE,EAA0B,MAAOH,EAAwBC,IAC1D,CAACD,GAAaT,EAAgBS,CAAS,EACnC,KAGDE,EAAqBF,EAAW,GAAOC,CAAkB,EAG3DG,EAAmBR,GACjBA,EAAG,aAAa,yBAAyB,GAAK,CAACL,EAAgBK,CAAE,EAGnES,EAAoCT,GAAoB,CAC7D,GAAIH,EAAqBG,CAAE,EAAG,CAC7B,MAAMU,EAAWV,EAAG,aAAa,UAAU,EAC3C,GAAIU,IAAa,MAAQ,SAASA,CAAQ,EAAI,EAC7C,MAAO,EAET,CAEA,MAAO,EACR,EAEMJ,EAAuB,MAAOF,EAAwBO,EAAkBN,IAA0D,CACvI,IAAIO,EACAC,EACAC,EAAe,GAEfV,EAAU,WACbQ,EAAQD,EAAUP,EAAU,WAAW,kBAAmCA,EAAU,WAAW,iBACrFA,aAAqB,iBAAmBA,EAAU,cAAc,GAC1ES,EAAmBT,EAAU,iBAAiB,EAC9CU,EAAeH,EAAU,EAAIE,EAAiB,OAAS,EACvDD,EAAQC,EAAiBC,CAAY,GAC3BT,EACVO,EAAQR,EAERQ,EAAQD,EAAUP,EAAU,kBAAmCA,EAAU,iBAG1E,IAAIW,EAIJ,KAAOH,GAAO,CACb,MAAMI,EAAyCJ,EAE/C,GAAI,CAACjB,EAAgBqB,CAAa,GAAK,CAACP,EAAiCO,CAAa,EAAG,CAYxF,GAXInB,EAAqBe,CAAK,IAO7B,MAAMA,EAAM,eAAe,EAC3BA,EAAQA,EAAM,UAAU,GAGrB,CAACA,GAASjB,EAAgBiB,CAAK,EAClC,OAAO,KAGR,GAAIA,EAAM,WAAa,GAAKJ,EAAgBI,CAAK,GAAK,CAACb,EAAYa,CAAK,EAAG,CAQ1E,GAPIhB,EAAmBgB,CAAK,IAI5BG,EAAsB,MAAMT,EAAqBM,EAAOD,CAAO,EAG3D,CAACb,EAAS,GAAK,CAACiB,GAAuBd,EAAaW,CAAK,GAC5D,OAAQA,GAAS,OAAOA,EAAM,OAAU,WAAcA,EAAQ,KAG/D,GAAIG,EACH,OAAQA,GAAuB,OAAOA,EAAoB,OAAU,WAAcA,EAAsB,IAE1G,CACD,CAEAH,EAAQD,EAAUK,EAAc,mBAAoCA,EAAc,uBAK9EH,GAAoB,CAACA,EAAiBC,CAAY,EAAE,SAASF,CAAK,IACrEE,EAAeH,EAAUG,EAAe,EAAIA,EAAe,EAE3DF,EAAQC,EAAiBC,CAAY,EAEvC,CAIA,OAAO,IACR,EAEA,OACCX,KAAA,yBACAI,KAAA",
|
|
6
6
|
"names": ["isElementHidden", "isElementClickable", "instanceOfUI5Element", "isSafari", "isFocusTrap", "el", "isScrollable", "computedStyle", "getFirstFocusableElement", "container", "startFromContainer", "findFocusableElement", "getLastFocusableElement", "isElemFocusable", "isUI5ElementWithNegativeTabIndex", "tabIndex", "forward", "child", "assignedElements", "currentIndex", "focusableDescendant", "originalChild"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const r=(t,e)=>{const o=getComputedStyle(t);for(let l=0;l<o.length;l++){const s=o[l];e.style.setProperty(s,o.getPropertyValue(s))}t.tagName==="INPUT"&&a(e),e.style.position="absolute",e.style.left=`${t.getBoundingClientRect().left}px`,e.style.top=`${t.getBoundingClientRect().top}px`,d(e),document.body.appendChild(e)},d=t=>{t.style.position="absolute",t.style.userSelect="none",t.style.pointerEvents="none",t.style.zIndex="-1",t.style.opacity="0"},a=t=>{t.style.whiteSpace="nowrap",t.style.overflowX="auto",t.style.overflowY="hidden"},y=()=>{const t=document.createElement("div");t.id="ui5-selection-mirror",t.contentEditable="true",document.body.appendChild(t)},u=(t,e)=>{e.scrollTop=t.scrollTop,e.scrollLeft=t.scrollLeft},p=(t,e)=>{const{selectionStart:o,selectionEnd:l}=t,s=t.value.slice(o,t.selectionEnd),c=document.createRange();c.setStart(e.firstChild,l-1),c.setEnd(e.firstChild,l),u(t,e);const n=c.getBoundingClientRect(),i={x:n.x,y:n.y,width:n.width,height:n.height,top:n.top,right:n.right,bottom:n.bottom,left:n.left};return document.body.removeChild(e),{...i,selectedText:s}},g=t=>{const e=t.shadowRoot.querySelector("textarea")||t.shadowRoot.querySelector("input");document.getElementById("ui5-selection-mirror")||y();const o=document.getElementById("ui5-selection-mirror");return o.textContent=e.value,e&&r(e,o),p(e,o)};export default g;
|
|
2
2
|
//# sourceMappingURL=SelectionAssistant.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/util/SelectionAssistant.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "aAAA,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["const copyAndApplyStyles = (element: HTMLElement, copiedElement: HTMLElement) => {\n\tconst computedStyles = getComputedStyle(element);\n\n\tfor (let i = 0; i < computedStyles.length; i++) {\n\t\tconst propertyName = computedStyles[i];\n\t\tcopiedElement.style.setProperty(propertyName, computedStyles.getPropertyValue(propertyName));\n\t}\n\n\telement.tagName === \"INPUT\" && setInputSpecificStyles(copiedElement);\n\n\tcopiedElement.style.position = \"absolute\";\n\tcopiedElement.style.left = `${element.getBoundingClientRect().left}px`;\n\tcopiedElement.style.top = `${element.getBoundingClientRect().top}px`;\n\n\tsetUnInteractableStyles(copiedElement);\n\n\tdocument.body.appendChild(copiedElement);\n};\n\nconst setUnInteractableStyles = (element: HTMLElement) => {\n\telement.style.position = \"absolute\";\n\telement.style.userSelect = \"none\";\n\telement.style.pointerEvents = \"none\";\n\telement.style.zIndex = \"-1\";\n\telement.style.opacity = \"0\";\n};\n\nconst setInputSpecificStyles = (element: HTMLElement) => {\n\telement.style.whiteSpace = \"nowrap\";\n\telement.style.overflowX = \"auto\";\n\telement.style.overflowY = \"hidden\";\n};\n\nconst createCopy = () => {\n\tconst copiedElement = document.createElement(\"div\");\n\n\tcopiedElement.id = \"ui5-selection-mirror\";\n\tcopiedElement.contentEditable = \"true\";\n\n\tdocument.body.appendChild(copiedElement);\n};\n\nconst applyScrollPosition = (element: HTMLElement, copiedElement: HTMLElement) => {\n\tcopiedElement.scrollTop = element.scrollTop;\n\tcopiedElement.scrollLeft = element.scrollLeft;\n};\n\nconst getSelectionCoordinates = (element: HTMLInputElement | HTMLTextAreaElement, mirror: HTMLDivElement) => {\n\tconst { selectionStart, selectionEnd } = element;\n\tconst selectedText = element.value.slice(\n\t\tselectionStart!,\n\t\telement.selectionEnd!,\n\t);\n\tconst range = document.createRange();\n\n\trange.setStart(mirror.firstChild!, selectionEnd! - 1);\n\trange.setEnd(mirror.firstChild!, selectionEnd!);\n\n\tapplyScrollPosition(element, mirror);\n\n\tconst rangeRect = range.getBoundingClientRect();\n\tconst rectObject = {\n\t\tx: rangeRect.x,\n\t\ty: rangeRect.y,\n\t\twidth: rangeRect.width,\n\t\theight: rangeRect.height,\n\t\ttop: rangeRect.top,\n\t\tright: rangeRect.right,\n\t\tbottom: rangeRect.bottom,\n\t\tleft: rangeRect.left,\n\t};\n\n\tdocument.body.removeChild(mirror);\n\n\treturn { ...rectObject, selectedText };\n};\n\nconst getElementSelection = (element: HTMLElement) => {\n\tconst innerElement = element.shadowRoot!.querySelector(\"textarea\")\n\t\t|| element.shadowRoot!.querySelector(\"input\");\n\n\tif (!document.getElementById(\"ui5-selection-mirror\")) {\n\t\tcreateCopy();\n\t}\n\n\tconst copiedElement = document.getElementById(\n\t\t\"ui5-selection-mirror\",\n\t)!;\n\n\tcopiedElement.textContent = innerElement!.value;\n\n\tif (innerElement) {\n\t\tcopyAndApplyStyles(innerElement, copiedElement);\n\t}\n\n\treturn getSelectionCoordinates(innerElement!, copiedElement as HTMLDivElement);\n};\n\nexport default getElementSelection;\n"],
|
|
5
|
+
"mappings": "aAAA,MAAMA,EAAqB,CAACC,EAAsBC,IAA+B,CAChF,MAAMC,EAAiB,iBAAiBF,CAAO,EAE/C,QAASG,EAAI,EAAGA,EAAID,EAAe,OAAQC,IAAK,CAC/C,MAAMC,EAAeF,EAAeC,CAAC,EACrCF,EAAc,MAAM,YAAYG,EAAcF,EAAe,iBAAiBE,CAAY,CAAC,CAC5F,CAEAJ,EAAQ,UAAY,SAAWK,EAAuBJ,CAAa,EAEnEA,EAAc,MAAM,SAAW,WAC/BA,EAAc,MAAM,KAAO,GAAGD,EAAQ,sBAAsB,EAAE,IAAI,KAClEC,EAAc,MAAM,IAAM,GAAGD,EAAQ,sBAAsB,EAAE,GAAG,KAEhEM,EAAwBL,CAAa,EAErC,SAAS,KAAK,YAAYA,CAAa,CACxC,EAEMK,EAA2BN,GAAyB,CACzDA,EAAQ,MAAM,SAAW,WACzBA,EAAQ,MAAM,WAAa,OAC3BA,EAAQ,MAAM,cAAgB,OAC9BA,EAAQ,MAAM,OAAS,KACvBA,EAAQ,MAAM,QAAU,GACzB,EAEMK,EAA0BL,GAAyB,CACxDA,EAAQ,MAAM,WAAa,SAC3BA,EAAQ,MAAM,UAAY,OAC1BA,EAAQ,MAAM,UAAY,QAC3B,EAEMO,EAAa,IAAM,CACxB,MAAMN,EAAgB,SAAS,cAAc,KAAK,EAElDA,EAAc,GAAK,uBACnBA,EAAc,gBAAkB,OAEhC,SAAS,KAAK,YAAYA,CAAa,CACxC,EAEMO,EAAsB,CAACR,EAAsBC,IAA+B,CACjFA,EAAc,UAAYD,EAAQ,UAClCC,EAAc,WAAaD,EAAQ,UACpC,EAEMS,EAA0B,CAACT,EAAiDU,IAA2B,CAC5G,KAAM,CAAE,eAAAC,EAAgB,aAAAC,CAAa,EAAIZ,EACnCa,EAAeb,EAAQ,MAAM,MAClCW,EACAX,EAAQ,YACT,EACMc,EAAQ,SAAS,YAAY,EAEnCA,EAAM,SAASJ,EAAO,WAAaE,EAAgB,CAAC,EACpDE,EAAM,OAAOJ,EAAO,WAAaE,CAAa,EAE9CJ,EAAoBR,EAASU,CAAM,EAEnC,MAAMK,EAAYD,EAAM,sBAAsB,EACxCE,EAAa,CAClB,EAAGD,EAAU,EACb,EAAGA,EAAU,EACb,MAAOA,EAAU,MACjB,OAAQA,EAAU,OAClB,IAAKA,EAAU,IACf,MAAOA,EAAU,MACjB,OAAQA,EAAU,OAClB,KAAMA,EAAU,IACjB,EAEA,gBAAS,KAAK,YAAYL,CAAM,EAEzB,CAAE,GAAGM,EAAY,aAAAH,CAAa,CACtC,EAEMI,EAAuBjB,GAAyB,CACrD,MAAMkB,EAAelB,EAAQ,WAAY,cAAc,UAAU,GAC7DA,EAAQ,WAAY,cAAc,OAAO,EAExC,SAAS,eAAe,sBAAsB,GAClDO,EAAW,EAGZ,MAAMN,EAAgB,SAAS,eAC9B,sBACD,EAEA,OAAAA,EAAc,YAAciB,EAAc,MAEtCA,GACHnB,EAAmBmB,EAAcjB,CAAa,EAGxCQ,EAAwBS,EAAejB,CAA+B,CAC9E,EAEA,eAAegB",
|
|
6
|
+
"names": ["copyAndApplyStyles", "element", "copiedElement", "computedStyles", "i", "propertyName", "setInputSpecificStyles", "setUnInteractableStyles", "createCopy", "applyScrollPosition", "getSelectionCoordinates", "mirror", "selectionStart", "selectionEnd", "selectedText", "range", "rangeRect", "rectObject", "getElementSelection", "innerElement"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import o from"./isElementTabbable.js";const b=
|
|
1
|
+
"use strict";import o from"./isElementTabbable.js";const b=e=>l(e.tagName==="SLOT"?[e]:[...e.children]),E=e=>{const n=l([...e.children]);return n.length?n[n.length-1]:null},l=(e,n)=>{const a=n||[];return e&&e.forEach(r=>{if(r.nodeType===Node.TEXT_NODE||r.nodeType===Node.COMMENT_NODE)return;const t=r;if(!t.hasAttribute("data-sap-no-tab-ref"))if(o(t)&&a.push(t),t.tagName==="SLOT")l(t.assignedElements(),a);else{const s=t.shadowRoot?t.shadowRoot.children:t.children;l([...s],a)}}),a};export{b as getTabbableElements,E as getLastTabbableElement};
|
|
2
2
|
//# sourceMappingURL=TabbableElements.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/util/TabbableElements.ts"],
|
|
4
|
-
"sourcesContent": ["import isElementTabbable from \"./isElementTabbable.js\";\n\n/**\n * Returns the tabbable elements within the provided HTMLElement.\n *\n * @public\n * @param { HTMLElement } el the component to operate on (component that slots or contains within its shadow root the items the user navigates among)\n * @returns { Array<HTMLElement> } the tabbable elements\n */\nconst getTabbableElements = (el: HTMLElement): Array<HTMLElement> => {\n\treturn getTabbables([...el.children]);\n};\n\n/**\n * Returns the last tabbable element within the provided HTMLElement.\n *\n * @public\n * @param { HTMLElement } el the component to operate on (component that slots or contains within its shadow root the items the user navigates among)\n * @returns { HTMLElement | null } the last tabbable element or \"null\" if not found\n */\nconst getLastTabbableElement = (el: HTMLElement): HTMLElement | null => {\n\tconst tabbables = getTabbables([...el.children]);\n\treturn tabbables.length ? tabbables[tabbables.length - 1] : null;\n};\n\nconst getTabbables = (nodes: Array<Node>, tabbables?: Array<HTMLElement>): Array<HTMLElement> => {\n\tconst tabbableElements = tabbables || [];\n\n\tif (!nodes) {\n\t\treturn tabbableElements;\n\t}\n\n\tnodes.forEach(currentNode => {\n\t\tif (currentNode.nodeType === Node.TEXT_NODE || currentNode.nodeType === Node.COMMENT_NODE) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentElement = currentNode as HTMLElement;\n\t\tif (currentElement.hasAttribute(\"data-sap-no-tab-ref\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isElementTabbable(currentElement)) {\n\t\t\ttabbableElements.push(currentElement);\n\t\t}\n\n\t\tif (currentElement.tagName === \"SLOT\") {\n\t\t\tgetTabbables((currentElement as HTMLSlotElement).
|
|
5
|
-
"mappings": "aAAA,OAAOA,MAAuB,yBAS9B,MAAMC,EAAuBC,GACrBC,
|
|
4
|
+
"sourcesContent": ["import isElementTabbable from \"./isElementTabbable.js\";\n\n/**\n * Returns the tabbable elements within the provided HTMLElement.\n *\n * @public\n * @param { HTMLElement } el the component to operate on (component that slots or contains within its shadow root the items the user navigates among)\n * @returns { Array<HTMLElement> } the tabbable elements\n */\nconst getTabbableElements = (el: HTMLElement): Array<HTMLElement> => {\n\treturn getTabbables(el.tagName === \"SLOT\" ? [el] : [...el.children]);\n};\n\n/**\n * Returns the last tabbable element within the provided HTMLElement.\n *\n * @public\n * @param { HTMLElement } el the component to operate on (component that slots or contains within its shadow root the items the user navigates among)\n * @returns { HTMLElement | null } the last tabbable element or \"null\" if not found\n */\nconst getLastTabbableElement = (el: HTMLElement): HTMLElement | null => {\n\tconst tabbables = getTabbables([...el.children]);\n\treturn tabbables.length ? tabbables[tabbables.length - 1] : null;\n};\n\nconst getTabbables = (nodes: Array<Node>, tabbables?: Array<HTMLElement>): Array<HTMLElement> => {\n\tconst tabbableElements = tabbables || [];\n\n\tif (!nodes) {\n\t\treturn tabbableElements;\n\t}\n\n\tnodes.forEach(currentNode => {\n\t\tif (currentNode.nodeType === Node.TEXT_NODE || currentNode.nodeType === Node.COMMENT_NODE) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentElement = currentNode as HTMLElement;\n\t\tif (currentElement.hasAttribute(\"data-sap-no-tab-ref\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isElementTabbable(currentElement)) {\n\t\t\ttabbableElements.push(currentElement);\n\t\t}\n\n\t\tif (currentElement.tagName === \"SLOT\") {\n\t\t\tgetTabbables((currentElement as HTMLSlotElement).assignedElements(), tabbableElements);\n\t\t} else {\n\t\t\tconst children = currentElement.shadowRoot ? currentElement.shadowRoot.children : currentElement.children;\n\t\t\tgetTabbables([...children], tabbableElements);\n\t\t}\n\t});\n\n\treturn tabbableElements;\n};\n\nexport {\n\tgetTabbableElements,\n\tgetLastTabbableElement,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAOA,MAAuB,yBAS9B,MAAMC,EAAuBC,GACrBC,EAAaD,EAAG,UAAY,OAAS,CAACA,CAAE,EAAI,CAAC,GAAGA,EAAG,QAAQ,CAAC,EAU9DE,EAA0BF,GAAwC,CACvE,MAAMG,EAAYF,EAAa,CAAC,GAAGD,EAAG,QAAQ,CAAC,EAC/C,OAAOG,EAAU,OAASA,EAAUA,EAAU,OAAS,CAAC,EAAI,IAC7D,EAEMF,EAAe,CAACG,EAAoBD,IAAuD,CAChG,MAAME,EAAmBF,GAAa,CAAC,EAEvC,OAAKC,GAILA,EAAM,QAAQE,GAAe,CAC5B,GAAIA,EAAY,WAAa,KAAK,WAAaA,EAAY,WAAa,KAAK,aAC5E,OAGD,MAAMC,EAAiBD,EACvB,GAAI,CAAAC,EAAe,aAAa,qBAAqB,EAQrD,GAJIT,EAAkBS,CAAc,GACnCF,EAAiB,KAAKE,CAAc,EAGjCA,EAAe,UAAY,OAC9BN,EAAcM,EAAmC,iBAAiB,EAAGF,CAAgB,MAC/E,CACN,MAAMG,EAAWD,EAAe,WAAaA,EAAe,WAAW,SAAWA,EAAe,SACjGN,EAAa,CAAC,GAAGO,CAAQ,EAAGH,CAAgB,CAC7C,CACD,CAAC,EAEMA,CACR,EAEA,OACCN,KAAA,oBACAG,KAAA",
|
|
6
6
|
"names": ["isElementTabbable", "getTabbableElements", "el", "getTabbables", "getLastTabbableElement", "tabbables", "nodes", "tabbableElements", "currentNode", "currentElement", "children"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/util/createInstanceChecker.ts"],
|
|
4
|
+
"sourcesContent": ["// createInstanceChecker<A>(\"isAItem\")\nfunction createChecker<T, P extends keyof T = keyof T>(prop: P) {\n\treturn (object: any): object is T => {\n\t\treturn object !== undefined && prop in object && object[prop] === true;\n\t};\n}\n\nexport default createChecker;\n"],
|
|
5
|
+
"mappings": "aACA,SAASA,EAA8CC,EAAS,CAC/D,OAAQC,GACAA,IAAW,QAAaD,KAAQC,GAAUA,EAAOD,CAAI,IAAM,EAEpE,CAEA,eAAeD",
|
|
6
|
+
"names": ["createChecker", "prop", "object"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/util/createMultiInstanceChecker.ts"],
|
|
4
|
+
"sourcesContent": ["// Allows filtering of multiple types at once\n// const isInstanceOfAOrB = createMultiInstanceChecker<A | B>([\"isAItem\", \"isBItem\"])\n// const filteredItems = items.filter(isInstanceOfAOrB)\n//\n// Alternatively, use \"createInstanceChecker\" and filter separately:\n// const isInstanceOfA = createInstanceChecker<A>(\"isAItem\");\n// const isInstanceOfB = createInstanceChecker<A>(\"isBItem\")\n// const filteredItems = [...items.filter(isInstanceOfA), ...items.filter(isInstanceOfB)];\nexport const createMultiInstanceChecker = <T>(props: string[] | string) => {\n\treturn (object: any): object is T => {\n\t\tif (!object) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst propsArray = Array.isArray(props) ? props : [props];\n\t\treturn propsArray.some(prop => prop in object && object[prop] === true);\n\t};\n};\n\nexport default createMultiInstanceChecker;\n"],
|
|
5
|
+
"mappings": "aAQO,aAAM,2BAAiCA,GACrCC,GACFA,GAIc,MAAM,QAAQD,CAAK,EAAIA,EAAQ,CAACA,CAAK,GACtC,KAAKE,GAAQA,KAAQD,GAAUA,EAAOC,CAAI,IAAM,EAAI,EAJ9D,GAQV,eAAe",
|
|
6
|
+
"names": ["props", "object", "prop"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";import m from"../../generated/css/MultipleDragGhost.css.js";import{getI18nBundle as i}from"../../i18nBundle.js";import{DRAG_DROP_MULTIPLE_TEXT as c}from"../../generated/i18n/i18n-defaults.js";const l=2;let a=null;const g=(e,t)=>{a=e,t?.dataTransfer?.setData("text/plain",e?e.id:"")},d=()=>{a=null},p=()=>a,u=async e=>{const t=document.createElement("div"),n=await i("@ui5/webcomponents-base"),r=t.attachShadow({mode:"open"}),o=new CSSStyleSheet;return o.replaceSync(m),r.adoptedStyleSheets=[o],r.textContent=n.getText(c,e),t},s=async(e,t)=>{if(e<l){console.warn(`Cannot start multiple drag with count ${e}. Minimum is ${l}.`);return}if(!t.dataTransfer)return;const n=await u(e);document.body.appendChild(n),t.dataTransfer.setDragImage(n,0,0),requestAnimationFrame(()=>{n.remove()})},D={setDraggedElement:g,clearDraggedElement:d,getDraggedElement:p,startMultipleDrag:s};export default D;export{s as startMultipleDrag};
|
|
2
2
|
//# sourceMappingURL=DragRegistry.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/util/dragAndDrop/DragRegistry.ts"],
|
|
4
|
-
"sourcesContent": ["import type
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["import type MovePlacement from \"../../types/MovePlacement.js\";\nimport MultipleDragGhostCss from \"../../generated/css/MultipleDragGhost.css.js\";\n\nimport { getI18nBundle } from \"../../i18nBundle.js\";\n\nimport {\n\tDRAG_DROP_MULTIPLE_TEXT,\n} from \"../../generated/i18n/i18n-defaults.js\";\n\nconst MIN_MULTI_DRAG_COUNT = 2;\n\nlet draggedElement: HTMLElement | null = null;\n\nconst setDraggedElement = (element: HTMLElement | null, e?: DragEvent) => {\n\tdraggedElement = element;\n\n\t// Store the dragged element's ID in the dataTransfer object to ensure\n\t// the drag operation is recognized across different browsers and contexts.\n\t// Without this, Safari browser in iOS may not recognize the drag operation.\n\te?.dataTransfer?.setData(\"text/plain\", element ? element.id : \"\");\n};\n\nconst clearDraggedElement = () => {\n\tdraggedElement = null;\n};\n\nconst getDraggedElement = () => {\n\treturn draggedElement;\n};\n\nconst createDefaultMultiDragElement = async (count: number): Promise<HTMLElement> => {\n\tconst dragElement = document.createElement(\"div\");\n\tconst i18nBundle = await getI18nBundle(\"@ui5/webcomponents-base\");\n\n\tconst dragElementShadow = dragElement.attachShadow({ mode: \"open\" });\n\n\tconst styles = new CSSStyleSheet();\n\tstyles.replaceSync(MultipleDragGhostCss);\n\n\tdragElementShadow.adoptedStyleSheets = [styles];\n\tdragElementShadow.textContent = i18nBundle.getText(DRAG_DROP_MULTIPLE_TEXT, count);\n\n\treturn dragElement;\n};\n\n/**\n * Starts a multiple drag operation by creating a drag ghost element.\n * The drag ghost will be displayed when dragging multiple items.\n *\n * @param {number} count - The number of items being dragged.\n * @param {DragEvent} e - The drag event that triggered the operation.\n * @public\n */\nconst startMultipleDrag = async (count: number, e: DragEvent) => {\n\tif (count < MIN_MULTI_DRAG_COUNT) {\n\t\tconsole.warn(`Cannot start multiple drag with count ${count}. Minimum is ${MIN_MULTI_DRAG_COUNT}.`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\tif (!e.dataTransfer) {\n\t\treturn;\n\t}\n\n\tconst customDragElement = await createDefaultMultiDragElement(count);\n\n\t// Add to document body temporarily\n\tdocument.body.appendChild(customDragElement);\n\n\te.dataTransfer.setDragImage(customDragElement, 0, 0);\n\n\t// Clean up the temporary element after the drag operation starts\n\trequestAnimationFrame(() => {\n\t\tcustomDragElement.remove();\n\t});\n};\n\ntype DragAndDropSettings = {\n\t/**\n\t * Allow cross-browser and file drag and drop.\n\t */\n\tcrossDnD?: boolean;\n\t/**\n\t * Pass the original event in the event parameters.\n\t */\n\toriginalEvent?: boolean;\n};\n\ntype MoveEventDetail = {\n\toriginalEvent: Event,\n\tsource: {\n\t\telement: HTMLElement,\n\t},\n\tdestination: {\n\t\telement: HTMLElement,\n\t\tplacement: `${MovePlacement}`,\n\t}\n};\n\nconst DragRegistry = {\n\tsetDraggedElement,\n\tclearDraggedElement,\n\tgetDraggedElement,\n\tstartMultipleDrag,\n};\n\nexport default DragRegistry;\nexport {\n\tstartMultipleDrag,\n};\n\nexport type {\n\tDragAndDropSettings,\n\tMoveEventDetail,\n};\n"],
|
|
5
|
+
"mappings": "aACA,OAAOA,MAA0B,+CAEjC,OAAS,iBAAAC,MAAqB,sBAE9B,OACC,2BAAAC,MACM,wCAEP,MAAMC,EAAuB,EAE7B,IAAIC,EAAqC,KAEzC,MAAMC,EAAoB,CAACC,EAA6BC,IAAkB,CACzEH,EAAiBE,EAKjBC,GAAG,cAAc,QAAQ,aAAcD,EAAUA,EAAQ,GAAK,EAAE,CACjE,EAEME,EAAsB,IAAM,CACjCJ,EAAiB,IAClB,EAEMK,EAAoB,IAClBL,EAGFM,EAAgC,MAAOC,GAAwC,CACpF,MAAMC,EAAc,SAAS,cAAc,KAAK,EAC1CC,EAAa,MAAMZ,EAAc,yBAAyB,EAE1Da,EAAoBF,EAAY,aAAa,CAAE,KAAM,MAAO,CAAC,EAE7DG,EAAS,IAAI,cACnB,OAAAA,EAAO,YAAYf,CAAoB,EAEvCc,EAAkB,mBAAqB,CAACC,CAAM,EAC9CD,EAAkB,YAAcD,EAAW,QAAQX,EAAyBS,CAAK,EAE1EC,CACR,EAUMI,EAAoB,MAAOL,EAAeJ,IAAiB,CAChE,GAAII,EAAQR,EAAsB,CACjC,QAAQ,KAAK,yCAAyCQ,CAAK,gBAAgBR,CAAoB,GAAG,EAClG,MACD,CAEA,GAAI,CAACI,EAAE,aACN,OAGD,MAAMU,EAAoB,MAAMP,EAA8BC,CAAK,EAGnE,SAAS,KAAK,YAAYM,CAAiB,EAE3CV,EAAE,aAAa,aAAaU,EAAmB,EAAG,CAAC,EAGnD,sBAAsB,IAAM,CAC3BA,EAAkB,OAAO,CAC1B,CAAC,CACF,EAwBMC,EAAe,CACpB,kBAAAb,EACA,oBAAAG,EACA,kBAAAC,EACA,kBAAAO,CACD,EAEA,eAAeE,EACf,OACCF,KAAA",
|
|
6
|
+
"names": ["MultipleDragGhostCss", "getI18nBundle", "DRAG_DROP_MULTIPLE_TEXT", "MIN_MULTI_DRAG_COUNT", "draggedElement", "setDraggedElement", "element", "e", "clearDraggedElement", "getDraggedElement", "createDefaultMultiDragElement", "count", "dragElement", "i18nBundle", "dragElementShadow", "styles", "startMultipleDrag", "customDragElement", "DragRegistry"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/util/getParentElement.ts"],
|
|
4
|
+
"sourcesContent": ["const getParentElement = (element: Element) : Element | null => {\n\treturn element.parentElement ? element.parentElement : (element.parentNode as ShadowRoot).host;\n};\n\nexport default getParentElement;\n"],
|
|
5
|
+
"mappings": "aAAA,MAAMA,EAAoBC,GAClBA,EAAQ,cAAgBA,EAAQ,cAAiBA,EAAQ,WAA0B,KAG3F,eAAeD",
|
|
6
|
+
"names": ["getParentElement", "element"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const t
|
|
1
|
+
"use strict";const i=t=>{if(t.nodeName==="SLOT")return!1;const e=window.getComputedStyle(t);return e.display!=="contents"&&t.offsetWidth<=0&&t.offsetHeight<=0||e.visibility==="hidden"};export default i;
|
|
2
2
|
//# sourceMappingURL=isElementHidden.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/util/isElementHidden.ts"],
|
|
4
|
-
"sourcesContent": ["const isElementHidden = (el: HTMLElement) => {\n\tif (el.nodeName === \"SLOT\") {\n\t\treturn false;\n\t}\n\n\treturn (el.offsetWidth <= 0 && el.offsetHeight <= 0) || (
|
|
5
|
-
"mappings": "aAAA,MAAMA,EAAmBC,
|
|
6
|
-
"names": ["isElementHidden", "el"]
|
|
4
|
+
"sourcesContent": ["const isElementHidden = (el: HTMLElement) => {\n\tif (el.nodeName === \"SLOT\") {\n\t\treturn false;\n\t}\n\n\tconst computedStyle = window.getComputedStyle(el);\n\n\treturn (computedStyle.display !== \"contents\" && (el.offsetWidth <= 0 && el.offsetHeight <= 0)) || (computedStyle.visibility === \"hidden\");\n};\n\nexport default isElementHidden;\n"],
|
|
5
|
+
"mappings": "aAAA,MAAMA,EAAmBC,GAAoB,CAC5C,GAAIA,EAAG,WAAa,OACnB,MAAO,GAGR,MAAMC,EAAgB,OAAO,iBAAiBD,CAAE,EAEhD,OAAQC,EAAc,UAAY,YAAeD,EAAG,aAAe,GAAKA,EAAG,cAAgB,GAAQC,EAAc,aAAe,QACjI,EAEA,eAAeF",
|
|
6
|
+
"names": ["isElementHidden", "el", "computedStyle"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/util/isEventMarked.ts"],
|
|
4
|
+
"sourcesContent": ["const defaultOpenUI5Key = \"handledByControl\";\n\nconst isEventMarked = (event: any, key: string = defaultOpenUI5Key) => {\n\treturn !!event[`_sapui_${key}`];\n};\n\nexport default isEventMarked;\n"],
|
|
5
|
+
"mappings": "aAAA,MAAMA,EAAoB,mBAEpBC,EAAgB,CAACC,EAAYC,EAAcH,IACzC,CAAC,CAACE,EAAM,UAAUC,CAAG,EAAE,EAG/B,eAAeF",
|
|
6
|
+
"names": ["defaultOpenUI5Key", "isEventMarked", "event", "key"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";import{isDown as i,isUp as p,isTabNext as n,isTabPrevious as r,isEscape as s}from"../Keys.js";const f=(t,a,e,o)=>{n(t)&&(e!==a.length-1?(t.stopImmediatePropagation(),t.preventDefault(),a[e+1].focus()):(o.closeValueState(),o.focusInput())),r(t)&&(t.preventDefault(),t.stopImmediatePropagation(),e>0?a[e-1].focus():o.focusInput()),p(t)&&(t.preventDefault(),t.stopImmediatePropagation(),o.isPopoverOpen()&&o.focusInput()),i(t)&&(t.preventDefault(),t.stopImmediatePropagation(),o.navigateToItem()),s(t)&&(t.preventDefault(),t.stopImmediatePropagation())};export{f as attachListeners};
|
|
2
|
+
//# sourceMappingURL=valueStateNavigation.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/util/valueStateNavigation.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n\tisDown,\n\tisUp,\n\tisTabNext,\n\tisTabPrevious,\n\tisEscape,\n} from \"../Keys.js\";\n\ninterface ControlHandlers {\n\tcloseValueState: () => void;\n\tfocusInput: () => void;\n\tnavigateToItem: () => void;\n\tisPopoverOpen: () => boolean;\n}\n\nconst attachListeners = (e: KeyboardEvent, links: Array<HTMLElement>, index: number, handlers: ControlHandlers) => {\n\tif (isTabNext(e)) {\n\t\tif (index !== links.length - 1) {\n\t\t\te.stopImmediatePropagation();\n\t\t\te.preventDefault();\n\t\t\tlinks[index + 1].focus();\n\t\t} else {\n\t\t\thandlers.closeValueState();\n\t\t\thandlers.focusInput();\n\t\t}\n\t}\n\n\tif (isTabPrevious(e)) {\n\t\te.preventDefault();\n\t\te.stopImmediatePropagation();\n\t\tif (index > 0) {\n\t\t\tlinks[index - 1].focus();\n\t\t} else {\n\t\t\thandlers.focusInput();\n\t\t}\n\t}\n\n\tif (isUp(e)) {\n\t\te.preventDefault();\n\t\te.stopImmediatePropagation();\n\t\thandlers.isPopoverOpen() && handlers.focusInput();\n\t}\n\n\tif (isDown(e)) {\n\t\te.preventDefault();\n\t\te.stopImmediatePropagation();\n\t\thandlers.navigateToItem();\n\t}\n\n\tif (isEscape(e)) {\n\t\te.preventDefault();\n\t\te.stopImmediatePropagation();\n\t}\n};\n\nexport { attachListeners, ControlHandlers };\n"],
|
|
5
|
+
"mappings": "aAAA,OACC,UAAAA,EACA,QAAAC,EACA,aAAAC,EACA,iBAAAC,EACA,YAAAC,MACM,aASP,MAAMC,EAAkB,CAACC,EAAkBC,EAA2BC,EAAeC,IAA8B,CAC9GP,EAAUI,CAAC,IACVE,IAAUD,EAAM,OAAS,GAC5BD,EAAE,yBAAyB,EAC3BA,EAAE,eAAe,EACjBC,EAAMC,EAAQ,CAAC,EAAE,MAAM,IAEvBC,EAAS,gBAAgB,EACzBA,EAAS,WAAW,IAIlBN,EAAcG,CAAC,IAClBA,EAAE,eAAe,EACjBA,EAAE,yBAAyB,EACvBE,EAAQ,EACXD,EAAMC,EAAQ,CAAC,EAAE,MAAM,EAEvBC,EAAS,WAAW,GAIlBR,EAAKK,CAAC,IACTA,EAAE,eAAe,EACjBA,EAAE,yBAAyB,EAC3BG,EAAS,cAAc,GAAKA,EAAS,WAAW,GAG7CT,EAAOM,CAAC,IACXA,EAAE,eAAe,EACjBA,EAAE,yBAAyB,EAC3BG,EAAS,eAAe,GAGrBL,EAASE,CAAC,IACbA,EAAE,eAAe,EACjBA,EAAE,yBAAyB,EAE7B,EAEA,OAASD,KAAA",
|
|
6
|
+
"names": ["isDown", "isUp", "isTabNext", "isTabPrevious", "isEscape", "attachListeners", "e", "links", "index", "handlers"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import{getLocationHref as i}from"./Location.js";const
|
|
1
|
+
"use strict";import{getLocationHref as i}from"./Location.js";const s=e=>{const t=document.querySelector(`META[name="${e}"]`);return t&&t.getAttribute("content")},o=e=>{const t=s("sap-allowed-theme-origins")??s("sap-allowedThemeOrigins");return t?t.split(",").some(n=>n==="*"||e===n.trim()):!1},a=(e,t)=>{const n=new URL(e).pathname;return new URL(n,t).toString()},g=e=>{let t;try{if(e.startsWith(".")||e.startsWith("/"))t=new URL(e,i()).toString();else{const n=new URL(e),r=n.origin;r&&o(r)?t=n.toString():t=a(n.toString(),i())}return t.endsWith("/")||(t=`${t}/`),`${t}UI5/`}catch{}};export default g;
|
|
2
2
|
//# sourceMappingURL=validateThemeRoot.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/validateThemeRoot.ts"],
|
|
4
|
-
"sourcesContent": ["import { getLocationHref } from \"./Location.js\";\n\nconst getMetaTagValue = (metaTagName: string) => {\n\tconst metaTag = document.querySelector(`META[name=\"${metaTagName}\"]`),\n\t\tmetaTagContent = metaTag && metaTag.getAttribute(\"content\");\n\n\treturn metaTagContent;\n};\n\nconst validateThemeOrigin = (origin: string) => {\n\tconst allowedOrigins = getMetaTagValue(\"sap-allowedThemeOrigins\")
|
|
5
|
-
"mappings": "aAAA,OAAS,mBAAAA,MAAuB,gBAEhC,MAAMC,EAAmBC,GAAwB,CAChD,MAAMC,EAAU,SAAS,cAAc,cAAcD,CAAW,IAAI,EAGpE,OAFkBC,GAAWA,EAAQ,aAAa,SAAS,CAG5D,EAEMC,EAAuBC,GAAmB,CAC/C,MAAMC,EAAiBL,EAAgB,yBAAyB,
|
|
4
|
+
"sourcesContent": ["import { getLocationHref } from \"./Location.js\";\n\nconst getMetaTagValue = (metaTagName: string) => {\n\tconst metaTag = document.querySelector(`META[name=\"${metaTagName}\"]`),\n\t\tmetaTagContent = metaTag && metaTag.getAttribute(\"content\");\n\n\treturn metaTagContent;\n};\n\nconst validateThemeOrigin = (origin: string) => {\n\tconst allowedOrigins = getMetaTagValue(\"sap-allowed-theme-origins\") ?? getMetaTagValue(\"sap-allowedThemeOrigins\"); // Prioritize the new meta tag name\n\n\t// If no allowed origins are specified, block.\n\tif (!allowedOrigins) {\n\t\treturn false;\n\t}\n\n\treturn allowedOrigins.split(\",\").some(allowedOrigin => {\n\t\treturn allowedOrigin === \"*\" || origin === allowedOrigin.trim();\n\t});\n};\n\nconst buildCorrectUrl = (oldUrl: string, newOrigin: string) => {\n\tconst oldUrlPath = new URL(oldUrl).pathname;\n\n\treturn new URL(oldUrlPath, newOrigin).toString();\n};\n\nconst validateThemeRoot = (themeRoot: string) => {\n\tlet resultUrl;\n\n\ttry {\n\t\tif (themeRoot.startsWith(\".\") || themeRoot.startsWith(\"/\")) {\n\t\t\t// Handle relative url\n\t\t\t// new URL(\"/newExmPath\", \"http://example.com/exmPath\") => http://example.com/newExmPath\n\t\t\t// new URL(\"./newExmPath\", \"http://example.com/exmPath\") => http://example.com/exmPath/newExmPath\n\t\t\t// new URL(\"../newExmPath\", \"http://example.com/exmPath\") => http://example.com/newExmPath\n\t\t\tresultUrl = new URL(themeRoot, getLocationHref()).toString();\n\t\t} else {\n\t\t\tconst themeRootURL = new URL(themeRoot);\n\t\t\tconst origin = themeRootURL.origin;\n\n\t\t\tif (origin && validateThemeOrigin(origin)) {\n\t\t\t\t// If origin is allowed, use it\n\t\t\t\tresultUrl = themeRootURL.toString();\n\t\t\t} else {\n\t\t\t\t// If origin is not allow and the URL is not relative, we have to replace the origin\n\t\t\t\t// with current location\n\t\t\t\tresultUrl = buildCorrectUrl(themeRootURL.toString(), getLocationHref());\n\t\t\t}\n\t\t}\n\n\t\tif (!resultUrl.endsWith(\"/\")) {\n\t\t\tresultUrl = `${resultUrl}/`;\n\t\t}\n\n\t\treturn `${resultUrl}UI5/`;\n\t} catch (e) {\n\t\t// Catch if URL is not correct\n\t}\n};\n\nexport default validateThemeRoot;\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,mBAAAA,MAAuB,gBAEhC,MAAMC,EAAmBC,GAAwB,CAChD,MAAMC,EAAU,SAAS,cAAc,cAAcD,CAAW,IAAI,EAGpE,OAFkBC,GAAWA,EAAQ,aAAa,SAAS,CAG5D,EAEMC,EAAuBC,GAAmB,CAC/C,MAAMC,EAAiBL,EAAgB,2BAA2B,GAAKA,EAAgB,yBAAyB,EAGhH,OAAKK,EAIEA,EAAe,MAAM,GAAG,EAAE,KAAKC,GAC9BA,IAAkB,KAAOF,IAAWE,EAAc,KAAK,CAC9D,EALO,EAMT,EAEMC,EAAkB,CAACC,EAAgBC,IAAsB,CAC9D,MAAMC,EAAa,IAAI,IAAIF,CAAM,EAAE,SAEnC,OAAO,IAAI,IAAIE,EAAYD,CAAS,EAAE,SAAS,CAChD,EAEME,EAAqBC,GAAsB,CAChD,IAAIC,EAEJ,GAAI,CACH,GAAID,EAAU,WAAW,GAAG,GAAKA,EAAU,WAAW,GAAG,EAKxDC,EAAY,IAAI,IAAID,EAAWb,EAAgB,CAAC,EAAE,SAAS,MACrD,CACN,MAAMe,EAAe,IAAI,IAAIF,CAAS,EAChCR,EAASU,EAAa,OAExBV,GAAUD,EAAoBC,CAAM,EAEvCS,EAAYC,EAAa,SAAS,EAIlCD,EAAYN,EAAgBO,EAAa,SAAS,EAAGf,EAAgB,CAAC,CAExE,CAEA,OAAKc,EAAU,SAAS,GAAG,IAC1BA,EAAY,GAAGA,CAAS,KAGlB,GAAGA,CAAS,MACpB,MAAY,CAEZ,CACD,EAEA,eAAeF",
|
|
6
6
|
"names": ["getLocationHref", "getMetaTagValue", "metaTagName", "metaTag", "validateThemeOrigin", "origin", "allowedOrigins", "allowedOrigin", "buildCorrectUrl", "oldUrl", "newOrigin", "oldUrlPath", "validateThemeRoot", "themeRoot", "resultUrl", "themeRootURL"]
|
|
7
7
|
}
|
package/dist/ssr-dom-shim.js
CHANGED
|
@@ -53,8 +53,9 @@ globalThis.ResizeObserver = class ResizeObserver {
|
|
|
53
53
|
// do nothing
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
// empty showPopover method
|
|
56
|
+
// empty showPopover & hidePopover method
|
|
57
57
|
globalThis.HTMLElement.prototype.showPopover = function () { };
|
|
58
|
+
globalThis.HTMLElement.prototype.hidePopover = function () { };
|
|
58
59
|
// ElementInternals
|
|
59
60
|
globalThis.HTMLElement.prototype.attachInternals = function () {
|
|
60
61
|
return new ElementInternals();
|
package/dist/ssr-dom-shim.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-dom-shim.js","sourceRoot":"","sources":["../src/ssr-dom-shim.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEhG,UAAU,CAAC,WAAW,KAAK,WAAW,CAAC;AACvC,UAAU,CAAC,OAAO,KAAK,OAAO,CAAC;AAC/B,UAAU,CAAC,cAAc,KAAK,cAAc,CAAC;AAE7C,MAAM,QAAQ;CAAG;AACjB,UAAU,CAAC,IAAI,KAAK,QAAiC,CAAC;AAEtD,MAAM,YAAY;CAAG;AACrB,UAAU,CAAC,QAAQ,KAAK,YAAyC,CAAC;AAElE,+BAA+B;AAE/B,8EAA8E;AAC9E,MAAM,kBAAkB,GAAG,IAAI,OAAO,EAAE,CAAC;AAEzC,IAAI,UAAU,CAAC,QAAQ,IAAI,CAAC,CAAC,oBAAoB,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;IACzE,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,EAAE,oBAAoB,EAAE;QAC9D,GAAG;YACD,OAAO,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5C,CAAC;QACD,GAAG,CAAC,MAAuB;YACzB,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACvC,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,IAAI,UAAU,CAAC,UAAU,IAAI,CAAC,CAAC,oBAAoB,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;IAC7E,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,EAAE,oBAAoB,EAAE;QAChE,GAAG;YACD,OAAO,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5C,CAAC;QACD,GAAG,CAAC,MAAuB;YACzB,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACvC,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,kDAAkD;AAClD,IAAI,UAAU,CAAC,aAAa,IAAI,CAAC,CAAC,aAAa,IAAI,aAAa,CAAC,SAAS,CAAC,EAAE,CAAC;IAC1E,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,SAAS,EAAE,aAAa,EAAE;QAC5D,KAAK,CAAC,OAAe;YACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,OAAO,OAAO,CAAC;QACjB,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAEH,wBAAwB;AACxB,UAAU,CAAC,cAAc,GAAG,MAAM,cAAc;IAC5C,OAAO;QACL,aAAa;IACf,CAAC;IACD,SAAS;QACP,aAAa;IACf,CAAC;IACD,UAAU;QACR,aAAa;IACf,CAAC;CACJ,CAAC;AAEF,
|
|
1
|
+
{"version":3,"file":"ssr-dom-shim.js","sourceRoot":"","sources":["../src/ssr-dom-shim.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEhG,UAAU,CAAC,WAAW,KAAK,WAAW,CAAC;AACvC,UAAU,CAAC,OAAO,KAAK,OAAO,CAAC;AAC/B,UAAU,CAAC,cAAc,KAAK,cAAc,CAAC;AAE7C,MAAM,QAAQ;CAAG;AACjB,UAAU,CAAC,IAAI,KAAK,QAAiC,CAAC;AAEtD,MAAM,YAAY;CAAG;AACrB,UAAU,CAAC,QAAQ,KAAK,YAAyC,CAAC;AAElE,+BAA+B;AAE/B,8EAA8E;AAC9E,MAAM,kBAAkB,GAAG,IAAI,OAAO,EAAE,CAAC;AAEzC,IAAI,UAAU,CAAC,QAAQ,IAAI,CAAC,CAAC,oBAAoB,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;IACzE,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,EAAE,oBAAoB,EAAE;QAC9D,GAAG;YACD,OAAO,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5C,CAAC;QACD,GAAG,CAAC,MAAuB;YACzB,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACvC,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,IAAI,UAAU,CAAC,UAAU,IAAI,CAAC,CAAC,oBAAoB,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;IAC7E,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,EAAE,oBAAoB,EAAE;QAChE,GAAG;YACD,OAAO,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5C,CAAC;QACD,GAAG,CAAC,MAAuB;YACzB,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACvC,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,kDAAkD;AAClD,IAAI,UAAU,CAAC,aAAa,IAAI,CAAC,CAAC,aAAa,IAAI,aAAa,CAAC,SAAS,CAAC,EAAE,CAAC;IAC1E,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,SAAS,EAAE,aAAa,EAAE;QAC5D,KAAK,CAAC,OAAe;YACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,OAAO,OAAO,CAAC;QACjB,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAEH,wBAAwB;AACxB,UAAU,CAAC,cAAc,GAAG,MAAM,cAAc;IAC5C,OAAO;QACL,aAAa;IACf,CAAC;IACD,SAAS;QACP,aAAa;IACf,CAAC;IACD,UAAU;QACR,aAAa;IACf,CAAC;CACJ,CAAC;AAEF,yCAAyC;AACzC,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,WAAW,GAAG,cAAa,CAAC,CAAC;AAC9D,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,WAAW,GAAG,cAAa,CAAC,CAAC;AAE9D,oBAAoB;AACpB,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,eAAe,GAAG;IAC/C,OAAO,IAAI,gBAAgB,EAAE,CAAC;AAClC,CAAC,CAAA","sourcesContent":["/* eslint-disable max-classes-per-file */\nimport { HTMLElement, Element, customElements, ElementInternals } from \"@lit-labs/ssr-dom-shim\";\n\nglobalThis.HTMLElement ??= HTMLElement;\nglobalThis.Element ??= Element;\nglobalThis.customElements ??= customElements;\n\nclass NodeShim {}\nglobalThis.Node ??= NodeShim as object as typeof Node;\n\nclass FileListShim {}\nglobalThis.FileList ??= FileListShim as object as typeof FileList;\n\n// ------- JS DOM shims -------\n\n// Polyfill `adoptedStyleSheets` globally for both `Document` and `ShadowRoot`\nconst adoptedSheetsStore = new WeakMap();\n\nif (globalThis.Document && !(\"adoptedStyleSheets\" in Document.prototype)) {\n Object.defineProperty(Document.prototype, \"adoptedStyleSheets\", {\n get() {\n return adoptedSheetsStore.get(this) || [];\n },\n set(sheets: CSSStyleSheet[]) {\n adoptedSheetsStore.set(this, sheets);\n },\n });\n}\n\nif (globalThis.ShadowRoot && !(\"adoptedStyleSheets\" in ShadowRoot.prototype)) {\n Object.defineProperty(ShadowRoot.prototype, \"adoptedStyleSheets\", {\n get() {\n return adoptedSheetsStore.get(this) || [];\n },\n set(sheets: CSSStyleSheet[]) {\n adoptedSheetsStore.set(this, sheets);\n },\n });\n}\n\n// Polyfill CSSStyleSheet to provide `replaceSync`\nif (globalThis.CSSStyleSheet && !(\"replaceSync\" in CSSStyleSheet.prototype)) {\n Object.defineProperty(CSSStyleSheet.prototype, \"replaceSync\", {\n value(cssText: string) {\n this.cssText = cssText;\n return cssText;\n },\n });\n }\n\n// Empty resize observer\nglobalThis.ResizeObserver = class ResizeObserver {\n observe() {\n // do nothing\n }\n unobserve() {\n // do nothing\n }\n disconnect() {\n // do nothing\n }\n};\n\n// empty showPopover & hidePopover method\nglobalThis.HTMLElement.prototype.showPopover = function () {};\nglobalThis.HTMLElement.prototype.hidePopover = function () {};\n\n// ElementInternals\nglobalThis.HTMLElement.prototype.attachInternals = function() {\n return new ElementInternals();\n}"]}
|
|
@@ -4,9 +4,16 @@ import getThemeDesignerTheme from "./getThemeDesignerTheme.js";
|
|
|
4
4
|
import { fireThemeLoaded } from "./ThemeLoaded.js";
|
|
5
5
|
import { getFeature } from "../FeaturesRegistry.js";
|
|
6
6
|
import { attachCustomThemeStylesToHead, getThemeRoot } from "../config/ThemeRoot.js";
|
|
7
|
+
import { setBaseTheme } from "../config/Theme.js";
|
|
7
8
|
import { DEFAULT_THEME } from "../generated/AssetParameters.js";
|
|
8
9
|
import { getCurrentRuntimeIndex } from "../Runtimes.js";
|
|
9
|
-
|
|
10
|
+
import { updateComponentStyles } from "./componentStyles.js";
|
|
11
|
+
// eslint-disable-next-line
|
|
12
|
+
export let _lib = "ui5";
|
|
13
|
+
// eslint-disable-next-line
|
|
14
|
+
export let _package = "webcomponents-theming";
|
|
15
|
+
// eslint-disable-next-line
|
|
16
|
+
const BASE_THEME_PACKAGE = "@" + _lib + "/" + _package;
|
|
10
17
|
const isThemeBaseRegistered = () => {
|
|
11
18
|
const registeredPackages = getRegisteredPackages();
|
|
12
19
|
return registeredPackages.has(BASE_THEME_PACKAGE);
|
|
@@ -25,13 +32,18 @@ const deleteThemeBase = () => {
|
|
|
25
32
|
};
|
|
26
33
|
const loadComponentPackages = async (theme, externalThemeName) => {
|
|
27
34
|
const registeredPackages = getRegisteredPackages();
|
|
28
|
-
const packagesStylesPromises = [...registeredPackages].map(async (packageName) => {
|
|
35
|
+
const packagesStylesPromises = [...registeredPackages.entries()].map(async ([packageName, { cssVariablesTarget }]) => {
|
|
29
36
|
if (packageName === BASE_THEME_PACKAGE) {
|
|
30
37
|
return;
|
|
31
38
|
}
|
|
32
39
|
const cssData = await getThemeProperties(packageName, theme, externalThemeName);
|
|
33
40
|
if (cssData) {
|
|
34
|
-
|
|
41
|
+
if (cssVariablesTarget === "root") {
|
|
42
|
+
createOrUpdateStyle(cssData, `data-ui5-component-properties-${getCurrentRuntimeIndex()}`, packageName);
|
|
43
|
+
}
|
|
44
|
+
else if (cssVariablesTarget === "host") {
|
|
45
|
+
updateComponentStyles(packageName, cssData);
|
|
46
|
+
}
|
|
35
47
|
}
|
|
36
48
|
});
|
|
37
49
|
return Promise.all(packagesStylesPromises);
|
|
@@ -68,8 +80,11 @@ const applyTheme = async (theme) => {
|
|
|
68
80
|
deleteThemeBase();
|
|
69
81
|
}
|
|
70
82
|
// Always load component packages properties. For non-registered themes, try with the base theme, if any
|
|
71
|
-
const
|
|
72
|
-
|
|
83
|
+
const externalThemeName = extTheme && extTheme.themeName === theme ? theme : undefined;
|
|
84
|
+
const baseThemeName = extTheme && extTheme.baseThemeName;
|
|
85
|
+
const effectiveThemeName = isThemeRegistered(theme) ? theme : (baseThemeName || DEFAULT_THEME);
|
|
86
|
+
await loadComponentPackages(effectiveThemeName, externalThemeName);
|
|
87
|
+
setBaseTheme(baseThemeName);
|
|
73
88
|
fireThemeLoaded(theme);
|
|
74
89
|
};
|
|
75
90
|
export default applyTheme;
|