@ui5/webcomponents-base 0.0.0-47cc17a26 → 0.0.0-49bade48d
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 +362 -1
- package/CLAUDE.md +1 -0
- package/dist/.tsbuildinfobuild +1 -1
- package/dist/Boot.d.ts +2 -1
- package/dist/Boot.js +42 -14
- package/dist/Boot.js.map +1 -1
- package/dist/CustomElementsScopeUtils.d.ts +11 -4
- package/dist/CustomElementsScopeUtils.js +15 -5
- package/dist/CustomElementsScopeUtils.js.map +1 -1
- package/dist/FontFace.css +36 -0
- package/dist/InitialConfiguration.d.ts +2 -1
- package/dist/InitialConfiguration.js +10 -11
- package/dist/InitialConfiguration.js.map +1 -1
- package/dist/ManagedStyles.js +1 -1
- package/dist/ManagedStyles.js.map +1 -1
- package/dist/Render.d.ts +9 -1
- package/dist/Render.js +15 -3
- package/dist/Render.js.map +1 -1
- package/dist/Runtimes.d.ts +6 -1
- package/dist/Runtimes.js +25 -24
- package/dist/Runtimes.js.map +1 -1
- package/dist/SystemCSSVars.js +2 -4
- package/dist/SystemCSSVars.js.map +1 -1
- package/dist/UI5Element.d.ts +33 -7
- package/dist/UI5Element.js +73 -25
- package/dist/UI5Element.js.map +1 -1
- package/dist/UI5ElementMetadata.js +1 -1
- package/dist/UI5ElementMetadata.js.map +1 -1
- package/dist/asset-registries/Icons.d.ts +1 -0
- package/dist/asset-registries/Icons.js +1 -0
- package/dist/asset-registries/Icons.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/ConfigurationSync.d.ts +16 -0
- package/dist/config/ConfigurationSync.js +42 -0
- package/dist/config/ConfigurationSync.js.map +1 -0
- package/dist/config/Language.js +13 -1
- package/dist/config/Language.js.map +1 -1
- package/dist/config/Theme.d.ts +13 -1
- package/dist/config/Theme.js +27 -2
- package/dist/config/Theme.js.map +1 -1
- package/dist/config/ThemeRoot.js +12 -7
- package/dist/config/ThemeRoot.js.map +1 -1
- package/dist/config/UrlParams.d.ts +20 -0
- package/dist/config/UrlParams.js +30 -0
- package/dist/config/UrlParams.js.map +1 -0
- package/dist/createReactComponent.d.ts +26 -0
- package/dist/createReactComponent.js +51 -0
- package/dist/createReactComponent.js.map +1 -0
- package/dist/css/OpenUI5PopupStyles.css +5 -0
- package/dist/css/SystemCSSVars.css +28 -3
- package/dist/custom-elements-internal.json +402 -309
- package/dist/custom-elements.json +346 -253
- 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 +4 -0
- package/dist/features/F6Navigation.js.map +1 -1
- package/dist/features/InputElementsFormSupport.d.ts +1 -1
- package/dist/features/InputElementsFormSupport.js +26 -4
- package/dist/features/InputElementsFormSupport.js.map +1 -1
- package/dist/features/OpenUI5Support.d.ts +12 -6
- package/dist/features/OpenUI5Support.js +55 -24
- package/dist/features/OpenUI5Support.js.map +1 -1
- 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 +17 -12
- package/dist/features/patchPopup.js +99 -27
- package/dist/features/patchPopup.js.map +1 -1
- package/dist/generated/AssetParameters.js +1 -1
- package/dist/generated/AssetParameters.js.map +1 -1
- package/dist/generated/VersionInfo.js +3 -3
- package/dist/generated/VersionInfo.js.map +1 -1
- package/dist/generated/assets/i18n/messagebundle_ar.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_bg.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_ca.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_cnr.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_cs.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_cy.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_da.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_de.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_el.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_en_GB.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_es.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_es_MX.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_et.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_fi.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_fr.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_fr_CA.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_hi.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_hr.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_hu.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_id.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_it.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_iw.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_ja.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_kk.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_ko.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_lt.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_lv.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_mk.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_ms.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_nl.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_no.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_pl.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_pt.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_pt_PT.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_ro.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_ru.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_sh.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_sk.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_sl.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_sr.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_sv.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_th.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_tr.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_uk.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_vi.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_zh_CN.json +1 -0
- package/dist/generated/assets/i18n/messagebundle_zh_TW.json +1 -0
- package/dist/generated/css/FontFace.css.d.ts +1 -1
- package/dist/generated/css/FontFace.css.js +36 -36
- package/dist/generated/css/FontFace.css.js.map +1 -1
- package/dist/generated/css/OpenUI5PopupStyles.css.d.ts +1 -1
- package/dist/generated/css/OpenUI5PopupStyles.css.js +1 -1
- package/dist/generated/css/OpenUI5PopupStyles.css.js.map +1 -1
- 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/index.d.ts +3 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/prod/Boot.js +1 -1
- package/dist/prod/Boot.js.map +3 -3
- package/dist/prod/CustomElementsScopeUtils.js +1 -1
- package/dist/prod/CustomElementsScopeUtils.js.map +3 -3
- package/dist/prod/InitialConfiguration.js +1 -1
- package/dist/prod/InitialConfiguration.js.map +3 -3
- package/dist/prod/ManagedStyles.js +1 -1
- package/dist/prod/ManagedStyles.js.map +2 -2
- package/dist/prod/Render.js +1 -1
- package/dist/prod/Render.js.map +3 -3
- package/dist/prod/Runtimes.js +1 -1
- package/dist/prod/Runtimes.js.map +3 -3
- 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 +2 -2
- package/dist/prod/asset-registries/Icons.js +1 -1
- package/dist/prod/asset-registries/Icons.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/ConfigurationSync.js +2 -0
- package/dist/prod/config/ConfigurationSync.js.map +7 -0
- 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 +1 -1
- package/dist/prod/config/ThemeRoot.js.map +3 -3
- package/dist/prod/config/UrlParams.js +2 -0
- package/dist/prod/config/UrlParams.js.map +7 -0
- package/dist/prod/createReactComponent.js +2 -0
- package/dist/prod/createReactComponent.js.map +7 -0
- 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 +2 -2
- 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/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/AssetParameters.js +1 -1
- package/dist/prod/generated/AssetParameters.js.map +2 -2
- package/dist/prod/generated/VersionInfo.js +1 -1
- package/dist/prod/generated/VersionInfo.js.map +1 -1
- package/dist/prod/generated/assets/i18n/messagebundle_ar.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_bg.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_ca.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_cnr.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_cs.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_cy.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_da.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_de.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_el.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_en_GB.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_es.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_es_MX.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_et.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_fi.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_fr.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_fr_CA.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_hi.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_hr.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_hu.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_id.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_it.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_iw.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_ja.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_kk.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_ko.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_lt.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_lv.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_mk.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_ms.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_nl.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_no.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_pl.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_pt.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_pt_PT.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_ro.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_ru.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_sh.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_sk.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_sl.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_sr.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_sv.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_th.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_tr.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_uk.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_vi.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_zh_CN.json +1 -0
- package/dist/prod/generated/assets/i18n/messagebundle_zh_TW.json +1 -0
- package/dist/prod/generated/css/FontFace.css.js +36 -36
- package/dist/prod/generated/css/FontFace.css.js.map +1 -1
- package/dist/prod/generated/css/OpenUI5PopupStyles.css.js +1 -1
- package/dist/prod/generated/css/OpenUI5PopupStyles.css.js.map +1 -1
- package/dist/prod/generated/css/SystemCSSVars.css.js +1 -1
- package/dist/prod/generated/css/SystemCSSVars.css.js.map +1 -1
- package/dist/prod/index.js +1 -1
- package/dist/prod/index.js.map +3 -3
- package/dist/prod/sap/base/Log.js +15 -29
- package/dist/prod/sap/base/assert.js +1 -1
- package/dist/prod/sap/base/config/MemoryConfigurationProvider.js +1 -1
- package/dist/prod/sap/base/security/URLListValidator.js +9 -5
- package/dist/prod/sap/base/security/encodeCSS.js +1 -1
- package/dist/prod/sap/base/security/encodeXML.js +1 -1
- package/dist/prod/sap/base/security/sanitizeHTML.js +1 -1
- package/dist/prod/sap/base/strings/toHex.js +1 -1
- package/dist/prod/sap/base/util/now.js +7 -13
- package/dist/prod/sap/base/util/uid.js +1 -1
- package/dist/prod/sap/ui/thirdparty/caja-html-sanitizer.js +15 -3
- 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/SelectionAssistant.js.map +1 -1
- 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/generateHighlightedMarkupFirstMatch.js +2 -0
- package/dist/prod/util/generateHighlightedMarkupFirstMatch.js.map +7 -0
- package/dist/prod/validateThemeRoot.js +1 -1
- package/dist/prod/validateThemeRoot.js.map +3 -3
- package/dist/react18/createReactComponent.d.ts +38 -0
- package/dist/react18/createReactComponent.js +112 -0
- package/dist/react18/createReactComponent.js.map +1 -0
- package/dist/sap/base/Log.js +15 -29
- package/dist/sap/base/assert.js +1 -1
- package/dist/sap/base/config/MemoryConfigurationProvider.js +1 -1
- package/dist/sap/base/security/URLListValidator.js +9 -5
- package/dist/sap/base/security/encodeCSS.js +1 -1
- package/dist/sap/base/security/encodeXML.js +1 -1
- package/dist/sap/base/security/sanitizeHTML.js +1 -1
- package/dist/sap/base/strings/toHex.js +1 -1
- package/dist/sap/base/util/now.js +7 -13
- package/dist/sap/base/util/uid.js +1 -1
- package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +15 -3
- package/dist/theming/applyTheme.js +14 -4
- 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 +3 -0
- package/dist/types.js.map +1 -1
- package/dist/updateShadowRoot.js +2 -1
- package/dist/updateShadowRoot.js.map +1 -1
- package/dist/util/SelectionAssistant.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 +1 -1
- package/dist/util/dragAndDrop/DragRegistry.js +5 -1
- package/dist/util/dragAndDrop/DragRegistry.js.map +1 -1
- package/dist/util/generateHighlightedMarkupFirstMatch.d.ts +10 -0
- package/dist/util/generateHighlightedMarkupFirstMatch.js +36 -0
- package/dist/util/generateHighlightedMarkupFirstMatch.js.map +1 -0
- package/dist/util/getClassCopy.d.ts +2 -1
- package/dist/validateThemeRoot.js +18 -11
- package/dist/validateThemeRoot.js.map +1 -1
- package/dist/vscode.html-custom-data.json +1 -1
- package/package-scripts.cjs +6 -6
- package/package.json +17 -10
- package/src/css/OpenUI5PopupStyles.css +5 -0
- package/src/css/SystemCSSVars.css +28 -3
- package/src/i18n/messagebundle_ar.properties +2 -0
- package/src/i18n/messagebundle_bg.properties +2 -0
- package/src/i18n/messagebundle_ca.properties +2 -0
- package/src/i18n/messagebundle_cnr.properties +2 -0
- package/src/i18n/messagebundle_cs.properties +2 -0
- package/src/i18n/messagebundle_cy.properties +2 -0
- package/src/i18n/messagebundle_da.properties +2 -0
- package/src/i18n/messagebundle_de.properties +2 -0
- package/src/i18n/messagebundle_el.properties +2 -0
- package/src/i18n/messagebundle_en_GB.properties +2 -0
- package/src/i18n/messagebundle_es.properties +2 -0
- package/src/i18n/messagebundle_es_MX.properties +2 -0
- package/src/i18n/messagebundle_et.properties +2 -0
- package/src/i18n/messagebundle_fi.properties +2 -0
- package/src/i18n/messagebundle_fr.properties +2 -0
- package/src/i18n/messagebundle_fr_CA.properties +2 -0
- package/src/i18n/messagebundle_hi.properties +2 -0
- package/src/i18n/messagebundle_hr.properties +2 -0
- package/src/i18n/messagebundle_hu.properties +2 -0
- package/src/i18n/messagebundle_id.properties +2 -0
- package/src/i18n/messagebundle_it.properties +2 -0
- package/src/i18n/messagebundle_iw.properties +2 -0
- package/src/i18n/messagebundle_ja.properties +2 -0
- package/src/i18n/messagebundle_kk.properties +2 -0
- package/src/i18n/messagebundle_ko.properties +2 -0
- package/src/i18n/messagebundle_lt.properties +2 -0
- package/src/i18n/messagebundle_lv.properties +2 -0
- package/src/i18n/messagebundle_mk.properties +2 -0
- package/src/i18n/messagebundle_ms.properties +2 -0
- package/src/i18n/messagebundle_nl.properties +2 -0
- package/src/i18n/messagebundle_no.properties +2 -0
- package/src/i18n/messagebundle_pl.properties +2 -0
- package/src/i18n/messagebundle_pt.properties +2 -0
- package/src/i18n/messagebundle_pt_PT.properties +2 -0
- package/src/i18n/messagebundle_ro.properties +2 -0
- package/src/i18n/messagebundle_ru.properties +2 -0
- package/src/i18n/messagebundle_sh.properties +2 -0
- package/src/i18n/messagebundle_sk.properties +2 -0
- package/src/i18n/messagebundle_sl.properties +2 -0
- package/src/i18n/messagebundle_sr.properties +2 -0
- package/src/i18n/messagebundle_sv.properties +2 -0
- package/src/i18n/messagebundle_th.properties +2 -0
- package/src/i18n/messagebundle_tr.properties +2 -0
- package/src/i18n/messagebundle_uk.properties +2 -0
- package/src/i18n/messagebundle_vi.properties +2 -0
- package/src/i18n/messagebundle_zh_CN.properties +2 -0
- package/src/i18n/messagebundle_zh_TW.properties +2 -0
- package/src/react18/createReactComponent.tsx +140 -0
- package/src/thirdparty/preact/preact.module.js +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/CustomElementsScopeUtils.ts"],
|
|
4
|
-
"sourcesContent": ["import { hasRegisteredTags } from \"./CustomElementsRegistry.js\";\nimport VersionInfo from \"./generated/VersionInfo.js\";\n\nlet suf: string;\n\ntype Rules = {\n\tinclude: Array<RegExp>,\n\texclude: Array<RegExp>,\n};\n\nlet rulesObj: Rules = {\n\tinclude: [
|
|
5
|
-
"mappings": "aAAA,OAAS,qBAAAA,MAAyB,8BAClC,OAAOC,MAAiB,6BAExB,IAAIC,EAOAC,EAAkB,CACrB,QAAS,CAAC,
|
|
6
|
-
"names": ["hasRegisteredTags", "VersionInfo", "suf", "rulesObj", "tagsCache", "setCustomElementsScopingSuffix", "suffix", "getCustomElementsScopingSuffix", "setCustomElementsScopingRules", "rules", "rule", "getCustomElementsScopingRules", "shouldScopeCustomElement", "tag", "result", "getEffectiveScopingSuffixForTag", "getScopedVarName", "name", "versionStr", "expr"]
|
|
4
|
+
"sourcesContent": ["import { hasRegisteredTags } from \"./CustomElementsRegistry.js\";\nimport VersionInfo from \"./generated/VersionInfo.js\";\n\nlet suf: string;\n\ntype Rules = {\n\tinclude: Array<RegExp>,\n\texclude: Array<RegExp>,\n};\n\nlet rulesObj: Rules = {\n\tinclude: [/./],\n\texclude: [],\n};\n\nconst tagsCache = new Map<string, boolean>(); // true/false means the tag should/should not be cached, undefined means not known yet.\n\n/**\n * Sets the suffix to be used for custom elements scoping, f.e. pass \"demo\" to get tags such as \"ui5-button-demo\".\n *\n * **Note:** By default all tags registered by the current runtime will be scoped, unless you change this by calling \"setCustomElementsScopingRules\"\n * **Note:** Setting the scoping suffix must be done before importing any components.\n *\n * @public\n * @param suffix The scoping suffix\n */\nconst setCustomElementsScopingSuffix = (suffix: string) => {\n\tif (!suffix.match(/^[a-zA-Z0-9_-]+$/)) {\n\t\tthrow new Error(\"Only alphanumeric characters and dashes allowed for the scoping suffix\");\n\t}\n\n\tif (hasRegisteredTags()) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\"Setting the scoping suffix must be done before importing any components. For proper usage, read the scoping section: https://github.com/UI5/webcomponents/blob/main/docs/2-advanced/06-scoping.md.\");\n\t}\n\n\tsuf = suffix;\n};\n\n/**\n * Returns the currently set scoping suffix, or undefined if not set.\n *\n * @public\n * @returns {String|undefined}\n */\nconst getCustomElementsScopingSuffix = (): string | undefined => {\n\treturn suf;\n};\n\n/**\n * Sets the rules, governing which custom element tags to scope and which not, f.e.\n * setCustomElementsScopingRules({include: [/^ui5-/]}, exclude: [/^ui5-mylib-/, /^ui5-carousel$/]);\n * will scope all elements starting with \"ui5-\" but not the ones starting with \"ui5-mylib-\" and not \"ui5-carousel\".\n *\n * @public\n * @param rules Object with \"include\" and \"exclude\" properties, both arrays of regular expressions. Note that \"include\"\n * rules are applied first and \"exclude\" rules second.\n */\nconst setCustomElementsScopingRules = (rules: Rules) => {\n\tif (!rules || !rules.include) {\n\t\tthrow new Error(`\"rules\" must be an object with at least an \"include\" property`);\n\t}\n\n\tif (!Array.isArray(rules.include) || rules.include.some(rule => !(rule instanceof RegExp))) {\n\t\tthrow new Error(`\"rules.include\" must be an array of regular expressions`);\n\t}\n\n\tif (rules.exclude && (!Array.isArray(rules.exclude) || rules.exclude.some(rule => !(rule instanceof RegExp)))) {\n\t\tthrow new Error(`\"rules.exclude\" must be an array of regular expressions`);\n\t}\n\n\trules.exclude = rules.exclude || [];\n\trulesObj = rules;\n\ttagsCache.clear(); // reset the cache upon setting new rules\n};\n\n/**\n * Returns the rules, governing which custom element tags to scope and which not. By default, all elements\n * are scoped. The default rules are: {include: [/./]}.\n *\n * @public\n * @returns {Object}\n */\nconst getCustomElementsScopingRules = () => {\n\treturn rulesObj;\n};\n\n/**\n * Determines whether custom elements with the given tag should be scoped or not.\n * The tag is first matched against the \"include\" rules and then against the \"exclude\" rules and the\n * result is cached until new rules are set.\n *\n * @public\n * @param tag\n */\nconst shouldScopeCustomElement = (tag: string) => {\n\tif (!tagsCache.has(tag)) {\n\t\tconst result = rulesObj.include.some(rule => tag.match(rule)) && !rulesObj.exclude.some(rule => tag.match(rule));\n\t\ttagsCache.set(tag, result);\n\t}\n\n\treturn tagsCache.get(tag);\n};\n\n/**\n * Returns the currently set scoping suffix, if any and if the tag should be scoped, or undefined otherwise.\n *\n * @public\n * @param tag\n * @returns {String}\n */\nconst getEffectiveScopingSuffixForTag = (tag: string) => {\n\tif (shouldScopeCustomElement(tag)) {\n\t\treturn getCustomElementsScopingSuffix();\n\t}\n};\n\n/**\n * @public\n * Used for getting a scoped name for a CSS variable using the same transformation used in the build\n * @param name the name of the css variable as written in the code\n * @param withVersion whether to include the version in the scoped name\n * @returns a variable name with the current version inserted as available at runtime\n * @deprecated As of version 2.19.0 this method is no longer required. Variables can now be defined at the component level\n * and are automatically encapsulated within each component\u2019s Shadow DOM.\n * As a result, runtime scoping logic is no longer necessary.\n *\n * It is still needed for third-party packages that have not yet migrated to the\n * component-level variable approach.\n */\nconst getScopedVarName = (name: string, withVersion: boolean = false) => {\n\tif (!withVersion) {\n\t\treturn name;\n\t}\n\n\tconst versionStr = `v${VersionInfo.version.replaceAll(\".\", \"-\")}`;\n\tconst expr = /(--_?ui5)([^,:)\\s]+)/g;\n\treturn name.replaceAll(expr, `$1-${versionStr}$2`);\n};\n\nexport {\n\tsetCustomElementsScopingSuffix,\n\tgetCustomElementsScopingSuffix,\n\tsetCustomElementsScopingRules,\n\tgetCustomElementsScopingRules,\n\tshouldScopeCustomElement,\n\tgetEffectiveScopingSuffixForTag,\n\tgetScopedVarName,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,qBAAAA,MAAyB,8BAClC,OAAOC,MAAiB,6BAExB,IAAIC,EAOAC,EAAkB,CACrB,QAAS,CAAC,GAAG,EACb,QAAS,CAAC,CACX,EAEA,MAAMC,EAAY,IAAI,IAWhBC,EAAkCC,GAAmB,CAC1D,GAAI,CAACA,EAAO,MAAM,kBAAkB,EACnC,MAAM,IAAI,MAAM,wEAAwE,EAGrFN,EAAkB,GAErB,QAAQ,KAAK,oMAAoM,EAGlNE,EAAMI,CACP,EAQMC,EAAiC,IAC/BL,EAYFM,EAAiCC,GAAiB,CACvD,GAAI,CAACA,GAAS,CAACA,EAAM,QACpB,MAAM,IAAI,MAAM,+DAA+D,EAGhF,GAAI,CAAC,MAAM,QAAQA,EAAM,OAAO,GAAKA,EAAM,QAAQ,KAAKC,GAAQ,EAAEA,aAAgB,OAAO,EACxF,MAAM,IAAI,MAAM,yDAAyD,EAG1E,GAAID,EAAM,UAAY,CAAC,MAAM,QAAQA,EAAM,OAAO,GAAKA,EAAM,QAAQ,KAAKC,GAAQ,EAAEA,aAAgB,OAAO,GAC1G,MAAM,IAAI,MAAM,yDAAyD,EAG1ED,EAAM,QAAUA,EAAM,SAAW,CAAC,EAClCN,EAAWM,EACXL,EAAU,MAAM,CACjB,EASMO,EAAgC,IAC9BR,EAWFS,EAA4BC,GAAgB,CACjD,GAAI,CAACT,EAAU,IAAIS,CAAG,EAAG,CACxB,MAAMC,EAASX,EAAS,QAAQ,KAAKO,GAAQG,EAAI,MAAMH,CAAI,CAAC,GAAK,CAACP,EAAS,QAAQ,KAAKO,GAAQG,EAAI,MAAMH,CAAI,CAAC,EAC/GN,EAAU,IAAIS,EAAKC,CAAM,CAC1B,CAEA,OAAOV,EAAU,IAAIS,CAAG,CACzB,EASME,EAAmCF,GAAgB,CACxD,GAAID,EAAyBC,CAAG,EAC/B,OAAON,EAA+B,CAExC,EAeMS,EAAmB,CAACC,EAAcC,EAAuB,KAAU,CACxE,GAAI,CAACA,EACJ,OAAOD,EAGR,MAAME,EAAa,IAAIlB,EAAY,QAAQ,WAAW,IAAK,GAAG,CAAC,GACzDmB,EAAO,wBACb,OAAOH,EAAK,WAAWG,EAAM,MAAMD,CAAU,IAAI,CAClD,EAEA,OACCd,KAAA,+BACAE,KAAA,+BACAC,KAAA,8BACAG,KAAA,8BACAC,KAAA,yBACAG,KAAA,gCACAC,KAAA",
|
|
6
|
+
"names": ["hasRegisteredTags", "VersionInfo", "suf", "rulesObj", "tagsCache", "setCustomElementsScopingSuffix", "suffix", "getCustomElementsScopingSuffix", "setCustomElementsScopingRules", "rules", "rule", "getCustomElementsScopingRules", "shouldScopeCustomElement", "tag", "result", "getEffectiveScopingSuffixForTag", "getScopedVarName", "name", "withVersion", "versionStr", "expr"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import f from"./thirdparty/merge.js";import{getFeature as
|
|
1
|
+
"use strict";import f from"./thirdparty/merge.js";import{getFeature as p}from"./FeaturesRegistry.js";import{DEFAULT_THEME as c}from"./generated/AssetParameters.js";import m from"./types/AnimationMode.js";import{resetConfiguration as d}from"./config/ConfigurationReset.js";import{getLocationSearch as h}from"./Location.js";let g=!1,t={animationMode:m.Full,theme:c,themeRoot:void 0,rtl:void 0,language:void 0,timezone:void 0,calendarType:void 0,secondaryCalendarType:void 0,noConflict:!1,formatSettings:{},fetchDefaultLanguage:!1,defaultFontLoading:!0,enableDefaultTooltips:!0,ignoreUrlParams:!1};const y=()=>(o(),t.animationMode),C=()=>(o(),t.theme),T=()=>(o(),t.themeRoot),S=()=>(o(),t.language),U=()=>(o(),t.fetchDefaultLanguage),L=()=>(o(),t.noConflict),F=()=>(o(),t.defaultFontLoading),b=()=>(o(),t.enableDefaultTooltips),I=()=>(o(),t.ignoreUrlParams),D=()=>(o(),t.calendarType),O=()=>(o(),t.secondaryCalendarType),P=()=>(o(),t.timezone),R=()=>(o(),t.formatSettings),i=new Map;i.set("true",!0),i.set("false",!1);const M=()=>{const n=document.querySelector("[data-ui5-config]")||document.querySelector("[data-id='sap-ui-config']");let e;if(n){try{e=JSON.parse(n.innerHTML)}catch{console.warn("Incorrect data-sap-ui-config format. Please use JSON")}e&&(t=f(t,e))}},z=()=>{const n=new URLSearchParams(h());n.forEach((e,r)=>{const a=r.split("sap-").length;a===0||a===r.split("sap-ui-").length||l(r,e,"sap")}),n.forEach((e,r)=>{r.startsWith("sap-ui")&&l(r,e,"sap-ui")})},E=n=>n.split("@")[1],w=(n,e)=>n==="theme"&&e.includes("@")?e.split("@")[0]:e,l=(n,e,r)=>{const a=e.toLowerCase(),s=n.split(`${r}-`)[1];i.has(e)&&(e=i.get(a)),s==="theme"?(t.theme=w(s,e),e&&e.includes("@")&&(t.themeRoot=E(e))):t[s]=e},j=()=>{const n=p("OpenUI5Support");if(!n||!n.isOpenUI5Detected())return;const e=n.getConfigurationSettingsObject();t=f(t,e)},o=()=>{typeof document>"u"||g||(u(),g=!0)},u=n=>{n&&d(),M(),t.ignoreUrlParams||z(),j()};export{y as getAnimationMode,C as getTheme,T as getThemeRoot,S as getLanguage,U as getFetchDefaultLanguage,L as getNoConflict,D as getCalendarType,O as getSecondaryCalendarType,P as getTimezone,R as getFormatSettings,F as getDefaultFontLoading,u as resetConfiguration,b as getEnableDefaultTooltips,I as getIgnoreUrlParams};
|
|
2
2
|
//# sourceMappingURL=InitialConfiguration.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/InitialConfiguration.ts"],
|
|
4
|
-
"sourcesContent": ["import merge from \"./thirdparty/merge.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport { DEFAULT_THEME } from \"./generated/AssetParameters.js\";\nimport
|
|
5
|
-
"mappings": "aAAA,OAAOA,MAAW,wBAClB,OAAS,cAAAC,MAAkB,wBAC3B,OAAS,iBAAAC,MAAqB,
|
|
6
|
-
"names": ["merge", "getFeature", "DEFAULT_THEME", "
|
|
4
|
+
"sourcesContent": ["import merge from \"./thirdparty/merge.js\";\nimport { getFeature } from \"./FeaturesRegistry.js\";\nimport { DEFAULT_THEME } from \"./generated/AssetParameters.js\";\nimport type OpenUI5Support from \"./features/OpenUI5Support.js\";\nimport type { FormatSettings } from \"./config/FormatSettings.js\";\nimport AnimationMode from \"./types/AnimationMode.js\";\nimport type CalendarType from \"./types/CalendarType.js\";\nimport { resetConfiguration as resetConfigurationFn } from \"./config/ConfigurationReset.js\";\nimport { getLocationSearch } from \"./Location.js\";\n\nlet initialized = false;\n\ntype InitialConfig = {\n\t[key: string]: any,\n\tanimationMode: AnimationMode,\n\ttheme: string,\n\tthemeRoot: string | undefined,\n\tlanguage: string | undefined,\n\tcalendarType: CalendarType | undefined,\n\tsecondaryCalendarType: CalendarType | undefined,\n\ttimezone: string | undefined,\n\tnoConflict: boolean,\n\tformatSettings: FormatSettings,\n\tfetchDefaultLanguage: boolean,\n\tdefaultFontLoading: boolean,\n\tenableDefaultTooltips: boolean,\n\tignoreUrlParams: boolean,\n};\n\nlet initialConfig: InitialConfig = {\n\tanimationMode: AnimationMode.Full,\n\ttheme: DEFAULT_THEME,\n\tthemeRoot: undefined,\n\trtl: undefined,\n\tlanguage: undefined,\n\ttimezone: undefined,\n\tcalendarType: undefined,\n\tsecondaryCalendarType: undefined,\n\tnoConflict: false, // no URL\n\tformatSettings: {},\n\tfetchDefaultLanguage: false,\n\tdefaultFontLoading: true,\n\tenableDefaultTooltips: true,\n\tignoreUrlParams: false,\n};\n\n/* General settings */\nconst getAnimationMode = () => {\n\tinitConfiguration();\n\treturn initialConfig.animationMode;\n};\n\nconst getTheme = () => {\n\tinitConfiguration();\n\treturn initialConfig.theme;\n};\n\nconst getThemeRoot = () => {\n\tinitConfiguration();\n\treturn initialConfig.themeRoot;\n};\n\nconst getLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.language;\n};\n\n/**\n * Returns if the default language, that is inlined at build time,\n * should be fetched over the network instead.\n * @returns {Boolean}\n */\nconst getFetchDefaultLanguage = () => {\n\tinitConfiguration();\n\treturn initialConfig.fetchDefaultLanguage;\n};\n\nconst getNoConflict = () => {\n\tinitConfiguration();\n\treturn initialConfig.noConflict;\n};\n\nconst getDefaultFontLoading = () => {\n\tinitConfiguration();\n\treturn initialConfig.defaultFontLoading;\n};\n\nconst getEnableDefaultTooltips = () => {\n\tinitConfiguration();\n\treturn initialConfig.enableDefaultTooltips;\n};\n\nconst getIgnoreUrlParams = () => {\n\tinitConfiguration();\n\treturn initialConfig.ignoreUrlParams;\n};\n\n/**\n * Get the configured calendar type\n * @returns { String } the name of the configured calendar type\n */\nconst getCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.calendarType;\n};\n\nconst getSecondaryCalendarType = () => {\n\tinitConfiguration();\n\treturn initialConfig.secondaryCalendarType;\n};\n\n/**\n * Returns the configured IANA timezone ID.\n * @returns { String } the configured IANA timezone ID, e.g. \"America/New_York\"\n */\nconst getTimezone = () => {\n\tinitConfiguration();\n\treturn initialConfig.timezone;\n};\n\nconst getFormatSettings = () => {\n\tinitConfiguration();\n\treturn initialConfig.formatSettings;\n};\n\nconst booleanMapping = new Map();\nbooleanMapping.set(\"true\", true);\nbooleanMapping.set(\"false\", false);\n\nconst parseConfigurationScript = () => {\n\tconst configScript = document.querySelector(\"[data-ui5-config]\") || document.querySelector(\"[data-id='sap-ui-config']\"); // for backward compatibility\n\n\tlet configJSON;\n\n\tif (configScript) {\n\t\ttry {\n\t\t\tconfigJSON = JSON.parse(configScript.innerHTML);\n\t\t} catch (err) {\n\t\t\tconsole.warn(\"Incorrect data-sap-ui-config format. Please use JSON\"); /* eslint-disable-line */\n\t\t}\n\n\t\tif (configJSON) {\n\t\t\tinitialConfig = merge(initialConfig, configJSON);\n\t\t}\n\t}\n};\n\nconst parseURLParameters = () => {\n\tconst params = new URLSearchParams(getLocationSearch());\n\n\t// Process \"sap-*\" params first\n\tparams.forEach((value, key) => {\n\t\tconst parts = key.split(\"sap-\").length;\n\t\tif (parts === 0 || parts === key.split(\"sap-ui-\").length) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap\");\n\t});\n\n\t// Process \"sap-ui-*\" params\n\tparams.forEach((value, key) => {\n\t\tif (!key.startsWith(\"sap-ui\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tapplyURLParam(key, value, \"sap-ui\");\n\t});\n};\n\nconst normalizeThemeRootParamValue = (value: string) => {\n\tconst themeRoot = value.split(\"@\")[1];\n\n\treturn themeRoot;\n};\n\nconst normalizeThemeParamValue = (param: string, value: string) => {\n\tif (param === \"theme\" && value.includes(\"@\")) { // the theme parameter might have @<URL-TO-THEME> in the value - strip this\n\t\treturn value.split(\"@\")[0];\n\t}\n\n\treturn value;\n};\n\nconst applyURLParam = (key: string, value: string, paramType: string) => {\n\tconst lowerCaseValue = value.toLowerCase();\n\tconst param = key.split(`${paramType}-`)[1];\n\n\tif (booleanMapping.has(value)) {\n\t\tvalue = booleanMapping.get(lowerCaseValue);\n\t}\n\n\tif (param === \"theme\") {\n\t\tinitialConfig.theme = normalizeThemeParamValue(param, value);\n\n\t\tif (value && value.includes(\"@\")) {\n\t\t\tinitialConfig.themeRoot = normalizeThemeRootParamValue(value);\n\t\t}\n\t} else {\n\t\tinitialConfig[param] = value;\n\t}\n};\n\nconst applyOpenUI5Configuration = () => {\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (!openUI5Support || !openUI5Support.isOpenUI5Detected()) {\n\t\treturn;\n\t}\n\n\tconst OpenUI5Config = openUI5Support.getConfigurationSettingsObject();\n\tinitialConfig = merge(initialConfig, OpenUI5Config);\n};\n\nconst initConfiguration = () => {\n\tif (typeof document === \"undefined\" || initialized) {\n\t\treturn;\n\t}\n\n\tresetConfiguration();\n\n\tinitialized = true;\n};\n\n/**\n * Internaly exposed method to enable configurations in tests.\n * @private\n */\nconst resetConfiguration = (testEnv?: boolean) => {\n\tif (testEnv) {\n\t\tresetConfigurationFn();\n\t}\n\t// 1. Lowest priority - configuration script\n\tparseConfigurationScript();\n\n\t// 2. URL parameters overwrite configuration script parameters\n\tif (!initialConfig.ignoreUrlParams) {\n\t\tparseURLParameters();\n\t}\n\n\t// 3. If OpenUI5 is detected, it has the highest priority\n\tapplyOpenUI5Configuration();\n};\n\nexport {\n\tgetAnimationMode,\n\tgetTheme,\n\tgetThemeRoot,\n\tgetLanguage,\n\tgetFetchDefaultLanguage,\n\tgetNoConflict,\n\tgetCalendarType,\n\tgetSecondaryCalendarType,\n\tgetTimezone,\n\tgetFormatSettings,\n\tgetDefaultFontLoading,\n\tresetConfiguration,\n\tgetEnableDefaultTooltips,\n\tgetIgnoreUrlParams,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAOA,MAAW,wBAClB,OAAS,cAAAC,MAAkB,wBAC3B,OAAS,iBAAAC,MAAqB,iCAG9B,OAAOC,MAAmB,2BAE1B,OAAS,sBAAsBC,MAA4B,iCAC3D,OAAS,qBAAAC,MAAyB,gBAElC,IAAIC,EAAc,GAmBdC,EAA+B,CAClC,cAAeJ,EAAc,KAC7B,MAAOD,EACP,UAAW,OACX,IAAK,OACL,SAAU,OACV,SAAU,OACV,aAAc,OACd,sBAAuB,OACvB,WAAY,GACZ,eAAgB,CAAC,EACjB,qBAAsB,GACtB,mBAAoB,GACpB,sBAAuB,GACvB,gBAAiB,EAClB,EAGA,MAAMM,EAAmB,KACxBC,EAAkB,EACXF,EAAc,eAGhBG,EAAW,KAChBD,EAAkB,EACXF,EAAc,OAGhBI,EAAe,KACpBF,EAAkB,EACXF,EAAc,WAGhBK,EAAc,KACnBH,EAAkB,EACXF,EAAc,UAQhBM,EAA0B,KAC/BJ,EAAkB,EACXF,EAAc,sBAGhBO,EAAgB,KACrBL,EAAkB,EACXF,EAAc,YAGhBQ,EAAwB,KAC7BN,EAAkB,EACXF,EAAc,oBAGhBS,EAA2B,KAChCP,EAAkB,EACXF,EAAc,uBAGhBU,EAAqB,KAC1BR,EAAkB,EACXF,EAAc,iBAOhBW,EAAkB,KACvBT,EAAkB,EACXF,EAAc,cAGhBY,EAA2B,KAChCV,EAAkB,EACXF,EAAc,uBAOhBa,EAAc,KACnBX,EAAkB,EACXF,EAAc,UAGhBc,EAAoB,KACzBZ,EAAkB,EACXF,EAAc,gBAGhBe,EAAiB,IAAI,IAC3BA,EAAe,IAAI,OAAQ,EAAI,EAC/BA,EAAe,IAAI,QAAS,EAAK,EAEjC,MAAMC,EAA2B,IAAM,CACtC,MAAMC,EAAe,SAAS,cAAc,mBAAmB,GAAK,SAAS,cAAc,2BAA2B,EAEtH,IAAIC,EAEJ,GAAID,EAAc,CACjB,GAAI,CACHC,EAAa,KAAK,MAAMD,EAAa,SAAS,CAC/C,MAAc,CACb,QAAQ,KAAK,sDAAsD,CACpE,CAEIC,IACHlB,EAAgBP,EAAMO,EAAekB,CAAU,EAEjD,CACD,EAEMC,EAAqB,IAAM,CAChC,MAAMC,EAAS,IAAI,gBAAgBtB,EAAkB,CAAC,EAGtDsB,EAAO,QAAQ,CAACC,EAAOC,IAAQ,CAC9B,MAAMC,EAAQD,EAAI,MAAM,MAAM,EAAE,OAC5BC,IAAU,GAAKA,IAAUD,EAAI,MAAM,SAAS,EAAE,QAIlDE,EAAcF,EAAKD,EAAO,KAAK,CAChC,CAAC,EAGDD,EAAO,QAAQ,CAACC,EAAOC,IAAQ,CACzBA,EAAI,WAAW,QAAQ,GAI5BE,EAAcF,EAAKD,EAAO,QAAQ,CACnC,CAAC,CACF,EAEMI,EAAgCJ,GACnBA,EAAM,MAAM,GAAG,EAAE,CAAC,EAK/BK,EAA2B,CAACC,EAAeN,IAC5CM,IAAU,SAAWN,EAAM,SAAS,GAAG,EACnCA,EAAM,MAAM,GAAG,EAAE,CAAC,EAGnBA,EAGFG,EAAgB,CAACF,EAAaD,EAAeO,IAAsB,CACxE,MAAMC,EAAiBR,EAAM,YAAY,EACnCM,EAAQL,EAAI,MAAM,GAAGM,CAAS,GAAG,EAAE,CAAC,EAEtCb,EAAe,IAAIM,CAAK,IAC3BA,EAAQN,EAAe,IAAIc,CAAc,GAGtCF,IAAU,SACb3B,EAAc,MAAQ0B,EAAyBC,EAAON,CAAK,EAEvDA,GAASA,EAAM,SAAS,GAAG,IAC9BrB,EAAc,UAAYyB,EAA6BJ,CAAK,IAG7DrB,EAAc2B,CAAK,EAAIN,CAEzB,EAEMS,EAA4B,IAAM,CACvC,MAAMC,EAAiBrC,EAAkC,gBAAgB,EACzE,GAAI,CAACqC,GAAkB,CAACA,EAAe,kBAAkB,EACxD,OAGD,MAAMC,EAAgBD,EAAe,+BAA+B,EACpE/B,EAAgBP,EAAMO,EAAegC,CAAa,CACnD,EAEM9B,EAAoB,IAAM,CAC3B,OAAO,SAAa,KAAeH,IAIvCkC,EAAmB,EAEnBlC,EAAc,GACf,EAMMkC,EAAsBC,GAAsB,CAC7CA,GACHrC,EAAqB,EAGtBmB,EAAyB,EAGpBhB,EAAc,iBAClBmB,EAAmB,EAIpBW,EAA0B,CAC3B,EAEA,OACC7B,KAAA,iBACAE,KAAA,SACAC,KAAA,aACAC,KAAA,YACAC,KAAA,wBACAC,KAAA,cACAI,KAAA,gBACAC,KAAA,yBACAC,KAAA,YACAC,KAAA,kBACAN,KAAA,sBACAyB,KAAA,mBACAxB,KAAA,yBACAC,KAAA",
|
|
6
|
+
"names": ["merge", "getFeature", "DEFAULT_THEME", "AnimationMode", "resetConfigurationFn", "getLocationSearch", "initialized", "initialConfig", "getAnimationMode", "initConfiguration", "getTheme", "getThemeRoot", "getLanguage", "getFetchDefaultLanguage", "getNoConflict", "getDefaultFontLoading", "getEnableDefaultTooltips", "getIgnoreUrlParams", "getCalendarType", "getSecondaryCalendarType", "getTimezone", "getFormatSettings", "booleanMapping", "parseConfigurationScript", "configScript", "configJSON", "parseURLParameters", "params", "value", "key", "parts", "applyURLParam", "normalizeThemeRootParamValue", "normalizeThemeParamValue", "param", "paramType", "lowerCaseValue", "applyOpenUI5Configuration", "openUI5Support", "OpenUI5Config", "resetConfiguration", "testEnv"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import{getCurrentRuntimeIndex as u,compareRuntimes as a}from"./Runtimes.js";const g=typeof document>"u",i=(e,t)=>t?`${e}|${t}`:e,l=e=>e===void 0?!0:a(u(),parseInt(e))
|
|
1
|
+
"use strict";import{getCurrentRuntimeIndex as u,compareRuntimes as a}from"./Runtimes.js";const g=typeof document>"u",i=(e,t)=>t?`${e}|${t}`:e,l=e=>e===void 0?!0:a(u(),parseInt(e))>=1,c=(e,t,r="",s)=>{const d=u(),n=new CSSStyleSheet;n.replaceSync(e),n._ui5StyleId=i(t,r),s&&(n._ui5RuntimeIndex=d,n._ui5Theme=s),document.adoptedStyleSheets=[...document.adoptedStyleSheets,n]},y=(e,t,r="",s)=>{const d=u(),n=document.adoptedStyleSheets.find(o=>o._ui5StyleId===i(t,r));if(n)if(!s)n.replaceSync(e||"");else{const o=n._ui5RuntimeIndex;(n._ui5Theme!==s||l(o))&&(n.replaceSync(e||""),n._ui5RuntimeIndex=String(d),n._ui5Theme=s)}},S=(e,t="")=>g?!0:!!document.adoptedStyleSheets.find(r=>r._ui5StyleId===i(e,t)),f=(e,t="")=>{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(r=>r._ui5StyleId!==i(e,t))},R=(e,t,r="",s)=>{S(t,r)?y(e,t,r,s):c(e,t,r,s)},m=(e,t)=>e===void 0?t:t===void 0?e:`${e} ${t}`;export{c as createStyle,S as hasStyle,y as updateStyle,f as removeStyle,R as createOrUpdateStyle,m as mergeStyles};
|
|
2
2
|
//# sourceMappingURL=ManagedStyles.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ManagedStyles.ts"],
|
|
4
|
-
"sourcesContent": ["import { getCurrentRuntimeIndex, compareRuntimes } from \"./Runtimes.js\";\n\nconst isSSR = typeof document === \"undefined\";\n\nconst getStyleId = (name: string, value: string) => {\n\treturn value ? `${name}|${value}` : name;\n};\n\nconst shouldUpdate = (runtimeIndex: string | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(getCurrentRuntimeIndex(), parseInt(runtimeIndex))
|
|
5
|
-
"mappings": "aAAA,OAAS,0BAAAA,EAAwB,mBAAAC,MAAuB,gBAExD,MAAMC,EAAQ,OAAO,SAAa,IAE5BC,EAAa,CAACC,EAAcC,IAC1BA,EAAQ,GAAGD,CAAI,IAAIC,CAAK,GAAKD,EAG/BE,EAAgBC,GACjBA,IAAiB,OACb,GAEDN,EAAgBD,EAAuB,EAAG,SAASO,CAAY,CAAC,
|
|
4
|
+
"sourcesContent": ["import { getCurrentRuntimeIndex, compareRuntimes } from \"./Runtimes.js\";\n\nconst isSSR = typeof document === \"undefined\";\n\nconst getStyleId = (name: string, value: string) => {\n\treturn value ? `${name}|${value}` : name;\n};\n\nconst shouldUpdate = (runtimeIndex: string | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(getCurrentRuntimeIndex(), parseInt(runtimeIndex)) >= 1; // 1 or larger means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nconst createStyle = (content: string, name: string, value = \"\", theme?: string) => {\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tconst stylesheet = new CSSStyleSheet();\n\tstylesheet.replaceSync(content);\n\t(stylesheet as Record<string, any>)._ui5StyleId = getStyleId(name, value); // set an id so that we can find the style later\n\tif (theme) {\n\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = currentRuntimeIndex;\n\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t}\n\tdocument.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet];\n};\n\nconst updateStyle = (content: string, name: string, value = \"\", theme?: string) => {\n\tconst currentRuntimeIndex = getCurrentRuntimeIndex();\n\n\tconst stylesheet = document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n\tif (!stylesheet) {\n\t\treturn;\n\t}\n\n\tif (!theme) {\n\t\tstylesheet.replaceSync(content || \"\");\n\t} else {\n\t\tconst stylesheetRuntimeIndex: string | undefined = (stylesheet as Record<string, any>)._ui5RuntimeIndex;\n\t\tconst stylesheetTheme: string | undefined = (stylesheet as Record<string, any>)._ui5Theme;\n\t\tif (stylesheetTheme !== theme || shouldUpdate(stylesheetRuntimeIndex)) {\n\t\t\tstylesheet.replaceSync(content || \"\");\n\t\t\t(stylesheet as Record<string, any>)._ui5RuntimeIndex = String(currentRuntimeIndex);\n\t\t\t(stylesheet as Record<string, any>)._ui5Theme = theme;\n\t\t}\n\t}\n};\n\nconst hasStyle = (name: string, value = \"\"): boolean => {\n\tif (isSSR) {\n\t\treturn true;\n\t}\n\n\treturn !!document.adoptedStyleSheets.find(sh => (sh as Record<string, any>)._ui5StyleId === getStyleId(name, value));\n};\n\nconst removeStyle = (name: string, value = \"\") => {\n\tdocument.adoptedStyleSheets = document.adoptedStyleSheets.filter(sh => (sh as Record<string, any>)._ui5StyleId !== getStyleId(name, value));\n};\n\nconst createOrUpdateStyle = (content: string, name: string, value = \"\", theme?: string) => {\n\tif (hasStyle(name, value)) {\n\t\tupdateStyle(content, name, value, theme);\n\t} else {\n\t\tcreateStyle(content, name, value, theme);\n\t}\n};\n\nconst mergeStyles = (style1?: string, style2?: string) => {\n\tif (style1 === undefined) {\n\t\treturn style2;\n\t}\n\tif (style2 === undefined) {\n\t\treturn style1;\n\t}\n\treturn `${style1} ${style2}`;\n};\n\nexport {\n\tcreateStyle,\n\thasStyle,\n\tupdateStyle,\n\tremoveStyle,\n\tcreateOrUpdateStyle,\n\tmergeStyles,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,0BAAAA,EAAwB,mBAAAC,MAAuB,gBAExD,MAAMC,EAAQ,OAAO,SAAa,IAE5BC,EAAa,CAACC,EAAcC,IAC1BA,EAAQ,GAAGD,CAAI,IAAIC,CAAK,GAAKD,EAG/BE,EAAgBC,GACjBA,IAAiB,OACb,GAEDN,EAAgBD,EAAuB,EAAG,SAASO,CAAY,CAAC,GAAK,EAGvEC,EAAc,CAACC,EAAiBL,EAAcC,EAAQ,GAAIK,IAAmB,CAClF,MAAMC,EAAsBX,EAAuB,EAE7CY,EAAa,IAAI,cACvBA,EAAW,YAAYH,CAAO,EAC7BG,EAAmC,YAAcT,EAAWC,EAAMC,CAAK,EACpEK,IACFE,EAAmC,iBAAmBD,EACtDC,EAAmC,UAAYF,GAEjD,SAAS,mBAAqB,CAAC,GAAG,SAAS,mBAAoBE,CAAU,CAC1E,EAEMC,EAAc,CAACJ,EAAiBL,EAAcC,EAAQ,GAAIK,IAAmB,CAClF,MAAMC,EAAsBX,EAAuB,EAE7CY,EAAa,SAAS,mBAAmB,KAAKE,GAAOA,EAA2B,cAAgBX,EAAWC,EAAMC,CAAK,CAAC,EAC7H,GAAKO,EAIL,GAAI,CAACF,EACJE,EAAW,YAAYH,GAAW,EAAE,MAC9B,CACN,MAAMM,EAA8CH,EAAmC,kBAC1CA,EAAmC,YACxDF,GAASJ,EAAaS,CAAsB,KACnEH,EAAW,YAAYH,GAAW,EAAE,EACnCG,EAAmC,iBAAmB,OAAOD,CAAmB,EAChFC,EAAmC,UAAYF,EAElD,CACD,EAEMM,EAAW,CAACZ,EAAcC,EAAQ,KACnCH,EACI,GAGD,CAAC,CAAC,SAAS,mBAAmB,KAAKY,GAAOA,EAA2B,cAAgBX,EAAWC,EAAMC,CAAK,CAAC,EAG9GY,EAAc,CAACb,EAAcC,EAAQ,KAAO,CACjD,SAAS,mBAAqB,SAAS,mBAAmB,OAAOS,GAAOA,EAA2B,cAAgBX,EAAWC,EAAMC,CAAK,CAAC,CAC3I,EAEMa,EAAsB,CAACT,EAAiBL,EAAcC,EAAQ,GAAIK,IAAmB,CACtFM,EAASZ,EAAMC,CAAK,EACvBQ,EAAYJ,EAASL,EAAMC,EAAOK,CAAK,EAEvCF,EAAYC,EAASL,EAAMC,EAAOK,CAAK,CAEzC,EAEMS,EAAc,CAACC,EAAiBC,IACjCD,IAAW,OACPC,EAEJA,IAAW,OACPD,EAED,GAAGA,CAAM,IAAIC,CAAM,GAG3B,OACCb,KAAA,YACAQ,KAAA,SACAH,KAAA,YACAI,KAAA,YACAC,KAAA,oBACAC,KAAA",
|
|
6
6
|
"names": ["getCurrentRuntimeIndex", "compareRuntimes", "isSSR", "getStyleId", "name", "value", "shouldUpdate", "runtimeIndex", "createStyle", "content", "theme", "currentRuntimeIndex", "stylesheet", "updateStyle", "sh", "stylesheetRuntimeIndex", "hasStyle", "removeStyle", "createOrUpdateStyle", "mergeStyles", "style1", "style2"]
|
|
7
7
|
}
|
package/dist/prod/Render.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import
|
|
1
|
+
"use strict";import A from"./EventProvider.js";import R from"./RenderQueue.js";import{getAllRegisteredTags as h}from"./CustomElementsRegistry.js";import{isRtlAware as I}from"./locale/RTLAwareRegistry.js";const i=new Set,m=new A,n=new R;let t,a,d,s;const l=async e=>{n.add(e),await U()},c=e=>{i.add(e)},f=e=>{i.delete(e)},u=e=>{m.fireEvent("beforeComponentRender",e),c(e),e._render()},P=e=>{n.remove(e),f(e)},U=async()=>{s||(s=new Promise(e=>{window.requestAnimationFrame(()=>{n.process(u),s=null,e(),d||(d=setTimeout(()=>{d=void 0,n.isEmpty()&&T()},200))})})),await s},y=()=>t||(t=new Promise(e=>{a=e,window.requestAnimationFrame(()=>{n.isEmpty()&&(t=void 0,e())})}),t),C=()=>{const e=h().map(r=>customElements.whenDefined(r));return Promise.all(e)},w=async()=>{await C(),await y()},T=()=>{n.isEmpty()&&a&&(a(),a=void 0,t=void 0)},b=async e=>{i.forEach(r=>{const o=r.constructor,E=o.getMetadata().getTag(),p=I(o),g=o.getMetadata().isLanguageAware(),v=o.getMetadata().isThemeAware();(!e||e.tag===E||e.rtlAware&&p||e.languageAware&&g||e.themeAware&&v)&&l(r)}),await w()},k=e=>{m.attachEvent("beforeComponentRender",e)},B=e=>{m.detachEvent("beforeComponentRender",e)};export{l as renderDeferred,u as renderImmediately,P as cancelRender,c as registerElement,f as unregisterElement,w as renderFinished,b as reRenderAllUI5Elements,k as attachBeforeComponentRender,B as detachBeforeComponentRender};
|
|
2
2
|
//# sourceMappingURL=Render.js.map
|
package/dist/prod/Render.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Render.ts"],
|
|
4
|
-
"sourcesContent": ["import EventProvider from \"./EventProvider.js\";\nimport RenderQueue from \"./RenderQueue.js\";\nimport { getAllRegisteredTags } from \"./CustomElementsRegistry.js\";\nimport { isRtlAware } from \"./locale/RTLAwareRegistry.js\";\nimport type UI5Element from \"./UI5Element.js\";\nimport type { PromiseResolve, Timeout } from \"./types.js\";\n\ntype BeforeComponentRenderCallback = (webComponent: UI5Element) => void;\n\nconst registeredElements = new Set<UI5Element>();\nconst eventProvider = new EventProvider<UI5Element, void>();\n\nconst invalidatedWebComponents = new RenderQueue(); // Queue for invalidated web components\n\nlet renderTaskPromise: Promise<void> | undefined,\n\trenderTaskPromiseResolve: PromiseResolve | undefined;\n\nlet mutationObserverTimer: Timeout | undefined;\n\nlet queuePromise: Promise<void> | null;\n\n/**\n * Schedules a render task (if not already scheduled) to render the component\n *\n * @param webComponent\n * @returns {Promise}\n */\nconst renderDeferred = async (webComponent: UI5Element) => {\n\t// Enqueue the web component\n\tinvalidatedWebComponents.add(webComponent);\n\n\t// Schedule a rendering task\n\tawait scheduleRenderTask();\n};\n\n/**\n * Renders a component synchronously and adds it to the registry of rendered components\n *\n * @param webComponent\n */\nconst renderImmediately = (webComponent: UI5Element) => {\n\teventProvider.fireEvent(\"beforeComponentRender\", webComponent);\n\
|
|
5
|
-
"mappings": "aAAA,OAAOA,MAAmB,qBAC1B,OAAOC,MAAiB,mBACxB,OAAS,wBAAAC,MAA4B,8BACrC,OAAS,cAAAC,MAAkB,+BAM3B,MAAMC,EAAqB,IAAI,IACzBC,EAAgB,IAAIL,EAEpBM,EAA2B,IAAIL,EAErC,IAAIM,EACHC,EAEGC,EAEAC,EAQJ,MAAMC,EAAiB,MAAOC,GAA6B,CAE1DN,EAAyB,IAAIM,CAAY,EAGzC,MAAMC,EAAmB,CAC1B,
|
|
6
|
-
"names": ["EventProvider", "RenderQueue", "getAllRegisteredTags", "isRtlAware", "registeredElements", "eventProvider", "invalidatedWebComponents", "renderTaskPromise", "renderTaskPromiseResolve", "mutationObserverTimer", "queuePromise", "renderDeferred", "webComponent", "scheduleRenderTask", "renderImmediately", "cancelRender", "resolve", "_resolveTaskPromise", "whenDOMUpdated", "whenAllCustomElementsAreDefined", "definedPromises", "tag", "renderFinished", "reRenderAllUI5Elements", "filters", "element", "ctor", "rtlAware", "languageAware", "themeAware", "attachBeforeComponentRender", "listener", "detachBeforeComponentRender"]
|
|
4
|
+
"sourcesContent": ["import EventProvider from \"./EventProvider.js\";\nimport RenderQueue from \"./RenderQueue.js\";\nimport { getAllRegisteredTags } from \"./CustomElementsRegistry.js\";\nimport { isRtlAware } from \"./locale/RTLAwareRegistry.js\";\nimport type UI5Element from \"./UI5Element.js\";\nimport type { PromiseResolve, Timeout } from \"./types.js\";\n\ntype BeforeComponentRenderCallback = (webComponent: UI5Element) => void;\n\nconst registeredElements = new Set<UI5Element>();\nconst eventProvider = new EventProvider<UI5Element, void>();\n\nconst invalidatedWebComponents = new RenderQueue(); // Queue for invalidated web components\n\nlet renderTaskPromise: Promise<void> | undefined,\n\trenderTaskPromiseResolve: PromiseResolve | undefined;\n\nlet mutationObserverTimer: Timeout | undefined;\n\nlet queuePromise: Promise<void> | null;\n\n/**\n * Schedules a render task (if not already scheduled) to render the component\n *\n * @param webComponent\n * @returns {Promise}\n */\nconst renderDeferred = async (webComponent: UI5Element) => {\n\t// Enqueue the web component\n\tinvalidatedWebComponents.add(webComponent);\n\n\t// Schedule a rendering task\n\tawait scheduleRenderTask();\n};\n\n/**\n * Register all web components attached to the DOM\n */\nconst registerElement = (webComponent: UI5Element) => {\n\tregisteredElements.add(webComponent);\n};\n\n/**\n * Unregister all web components detached from the DOM\n */\nconst unregisterElement = (webComponent: UI5Element) => {\n\tregisteredElements.delete(webComponent);\n};\n\n/**\n * Renders a component synchronously and adds it to the registry of rendered components\n *\n * @param webComponent\n */\nconst renderImmediately = (webComponent: UI5Element) => {\n\teventProvider.fireEvent(\"beforeComponentRender\", webComponent);\n\tregisterElement(webComponent);\n\twebComponent._render();\n};\n\n/**\n * Cancels the rendering of a component, if awaiting to be rendered, and removes it from the registry of rendered components\n *\n * @param webComponent\n */\nconst cancelRender = (webComponent: UI5Element) => {\n\tinvalidatedWebComponents.remove(webComponent);\n\tunregisterElement(webComponent);\n};\n\n/**\n * Schedules a rendering task, if not scheduled already\n */\nconst scheduleRenderTask = async () => {\n\tif (!queuePromise) {\n\t\tqueuePromise = new Promise<void>(resolve => {\n\t\t\twindow.requestAnimationFrame(() => {\n\t\t\t\t// Render all components in the queue\n\n\t\t\t\t// console.log(`--------------------RENDER TASK START------------------------------`); // eslint-disable-line\n\t\t\t\tinvalidatedWebComponents.process(renderImmediately);\n\t\t\t\t// console.log(`--------------------RENDER TASK END------------------------------`); // eslint-disable-line\n\n\t\t\t\t// Resolve the promise so that callers of renderDeferred can continue\n\t\t\t\tqueuePromise = null;\n\t\t\t\tresolve();\n\n\t\t\t\t// Wait for Mutation observer before the render task is considered finished\n\t\t\t\tif (!mutationObserverTimer) {\n\t\t\t\t\tmutationObserverTimer = setTimeout(() => {\n\t\t\t\t\t\tmutationObserverTimer = undefined;\n\t\t\t\t\t\tif (invalidatedWebComponents.isEmpty()) {\n\t\t\t\t\t\t\t_resolveTaskPromise();\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 200);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tawait queuePromise;\n};\n\n/**\n * return a promise that will be resolved once all invalidated web components are rendered\n */\nconst whenDOMUpdated = () => {\n\tif (renderTaskPromise) {\n\t\treturn renderTaskPromise;\n\t}\n\n\trenderTaskPromise = new Promise<void>(resolve => {\n\t\trenderTaskPromiseResolve = resolve;\n\t\twindow.requestAnimationFrame(() => {\n\t\t\tif (invalidatedWebComponents.isEmpty()) {\n\t\t\t\trenderTaskPromise = undefined;\n\t\t\t\tresolve();\n\t\t\t}\n\t\t});\n\t});\n\n\treturn renderTaskPromise;\n};\n\nconst whenAllCustomElementsAreDefined = () => {\n\tconst definedPromises = getAllRegisteredTags().map(tag => customElements.whenDefined(tag));\n\treturn Promise.all(definedPromises);\n};\n\nconst renderFinished = async () => {\n\tawait whenAllCustomElementsAreDefined();\n\tawait whenDOMUpdated();\n};\n\nconst _resolveTaskPromise = () => {\n\tif (!invalidatedWebComponents.isEmpty()) {\n\t\t// More updates are pending. Resolve will be called again\n\t\treturn;\n\t}\n\n\tif (renderTaskPromiseResolve) {\n\t\trenderTaskPromiseResolve();\n\t\trenderTaskPromiseResolve = undefined;\n\t\trenderTaskPromise = undefined;\n\t}\n};\n\n/**\n * Re-renders all UI5 Elements on the page, with the option to specify filters to rerender only some components.\n *\n * Usage:\n * reRenderAllUI5Elements() -> re-renders all components\n * reRenderAllUI5Elements({tag: \"ui5-button\"}) -> re-renders only instances of ui5-button\n * reRenderAllUI5Elements({rtlAware: true}) -> re-renders only rtlAware components\n * reRenderAllUI5Elements({languageAware: true}) -> re-renders only languageAware components\n * reRenderAllUI5Elements({themeAware: true}) -> re-renders only themeAware components\n * reRenderAllUI5Elements({rtlAware: true, languageAware: true}) -> re-renders components that are rtlAware or languageAware\n * etc...\n *\n * @public\n * @param {object|undefined} filters - Object with keys that can be \"rtlAware\" or \"languageAware\"\n * @returns {Promise<void>}\n */\nconst reRenderAllUI5Elements = async (filters?: {tag?: string, rtlAware?: boolean, languageAware?: boolean, themeAware?: boolean}) => {\n\tregisteredElements.forEach((element: UI5Element) => {\n\t\tconst ctor = element.constructor as typeof UI5Element;\n\t\tconst tag = ctor.getMetadata().getTag();\n\t\tconst rtlAware = isRtlAware(ctor);\n\t\tconst languageAware = ctor.getMetadata().isLanguageAware();\n\t\tconst themeAware = ctor.getMetadata().isThemeAware();\n\t\tif (!filters || (filters.tag === tag) || (filters.rtlAware && rtlAware) || (filters.languageAware && languageAware) || (filters.themeAware && themeAware)) {\n\t\t\trenderDeferred(element);\n\t\t}\n\t});\n\tawait renderFinished();\n};\n\nconst attachBeforeComponentRender = (listener: BeforeComponentRenderCallback) => {\n\teventProvider.attachEvent(\"beforeComponentRender\", listener);\n};\n\nconst detachBeforeComponentRender = (listener: BeforeComponentRenderCallback) => {\n\teventProvider.detachEvent(\"beforeComponentRender\", listener);\n};\n\nexport {\n\trenderDeferred,\n\trenderImmediately,\n\tcancelRender,\n\tregisterElement,\n\tunregisterElement,\n\trenderFinished,\n\treRenderAllUI5Elements,\n\tattachBeforeComponentRender,\n\tdetachBeforeComponentRender,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAOA,MAAmB,qBAC1B,OAAOC,MAAiB,mBACxB,OAAS,wBAAAC,MAA4B,8BACrC,OAAS,cAAAC,MAAkB,+BAM3B,MAAMC,EAAqB,IAAI,IACzBC,EAAgB,IAAIL,EAEpBM,EAA2B,IAAIL,EAErC,IAAIM,EACHC,EAEGC,EAEAC,EAQJ,MAAMC,EAAiB,MAAOC,GAA6B,CAE1DN,EAAyB,IAAIM,CAAY,EAGzC,MAAMC,EAAmB,CAC1B,EAKMC,EAAmBF,GAA6B,CACrDR,EAAmB,IAAIQ,CAAY,CACpC,EAKMG,EAAqBH,GAA6B,CACvDR,EAAmB,OAAOQ,CAAY,CACvC,EAOMI,EAAqBJ,GAA6B,CACvDP,EAAc,UAAU,wBAAyBO,CAAY,EAC7DE,EAAgBF,CAAY,EAC5BA,EAAa,QAAQ,CACtB,EAOMK,EAAgBL,GAA6B,CAClDN,EAAyB,OAAOM,CAAY,EAC5CG,EAAkBH,CAAY,CAC/B,EAKMC,EAAqB,SAAY,CACjCH,IACJA,EAAe,IAAI,QAAcQ,GAAW,CAC3C,OAAO,sBAAsB,IAAM,CAIlCZ,EAAyB,QAAQU,CAAiB,EAIlDN,EAAe,KACfQ,EAAQ,EAGHT,IACJA,EAAwB,WAAW,IAAM,CACxCA,EAAwB,OACpBH,EAAyB,QAAQ,GACpCa,EAAoB,CAEtB,EAAG,GAAG,EAER,CAAC,CACF,CAAC,GAGF,MAAMT,CACP,EAKMU,EAAiB,IAClBb,IAIJA,EAAoB,IAAI,QAAcW,GAAW,CAChDV,EAA2BU,EAC3B,OAAO,sBAAsB,IAAM,CAC9BZ,EAAyB,QAAQ,IACpCC,EAAoB,OACpBW,EAAQ,EAEV,CAAC,CACF,CAAC,EAEMX,GAGFc,EAAkC,IAAM,CAC7C,MAAMC,EAAkBpB,EAAqB,EAAE,IAAIqB,GAAO,eAAe,YAAYA,CAAG,CAAC,EACzF,OAAO,QAAQ,IAAID,CAAe,CACnC,EAEME,EAAiB,SAAY,CAClC,MAAMH,EAAgC,EACtC,MAAMD,EAAe,CACtB,EAEMD,EAAsB,IAAM,CAC5Bb,EAAyB,QAAQ,GAKlCE,IACHA,EAAyB,EACzBA,EAA2B,OAC3BD,EAAoB,OAEtB,EAkBMkB,EAAyB,MAAOC,GAAgG,CACrItB,EAAmB,QAASuB,GAAwB,CACnD,MAAMC,EAAOD,EAAQ,YACfJ,EAAMK,EAAK,YAAY,EAAE,OAAO,EAChCC,EAAW1B,EAAWyB,CAAI,EAC1BE,EAAgBF,EAAK,YAAY,EAAE,gBAAgB,EACnDG,EAAaH,EAAK,YAAY,EAAE,aAAa,GAC/C,CAACF,GAAYA,EAAQ,MAAQH,GAASG,EAAQ,UAAYG,GAAcH,EAAQ,eAAiBI,GAAmBJ,EAAQ,YAAcK,IAC7IpB,EAAegB,CAAO,CAExB,CAAC,EACD,MAAMH,EAAe,CACtB,EAEMQ,EAA+BC,GAA4C,CAChF5B,EAAc,YAAY,wBAAyB4B,CAAQ,CAC5D,EAEMC,EAA+BD,GAA4C,CAChF5B,EAAc,YAAY,wBAAyB4B,CAAQ,CAC5D,EAEA,OACCtB,KAAA,eACAK,KAAA,kBACAC,KAAA,aACAH,KAAA,gBACAC,KAAA,kBACAS,KAAA,eACAC,KAAA,uBACAO,KAAA,4BACAE,KAAA",
|
|
6
|
+
"names": ["EventProvider", "RenderQueue", "getAllRegisteredTags", "isRtlAware", "registeredElements", "eventProvider", "invalidatedWebComponents", "renderTaskPromise", "renderTaskPromiseResolve", "mutationObserverTimer", "queuePromise", "renderDeferred", "webComponent", "scheduleRenderTask", "registerElement", "unregisterElement", "renderImmediately", "cancelRender", "resolve", "_resolveTaskPromise", "whenDOMUpdated", "whenAllCustomElementsAreDefined", "definedPromises", "tag", "renderFinished", "reRenderAllUI5Elements", "filters", "element", "ctor", "rtlAware", "languageAware", "themeAware", "attachBeforeComponentRender", "listener", "detachBeforeComponentRender"]
|
|
7
7
|
}
|
package/dist/prod/Runtimes.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import{getAllRegisteredTags as
|
|
1
|
+
"use strict";import{getAllRegisteredTags as f}from"./CustomElementsRegistry.js";import{getCustomElementsScopingRules as l,getCustomElementsScopingSuffix as p}from"./CustomElementsScopeUtils.js";import g from"./generated/VersionInfo.js";import R from"./getSharedResource.js";let s,u="";const c=new Map,o=R("Runtimes",[]),d=()=>{if(s===void 0){s=o.length;const e=g;o.push({...e,get scopingSuffix(){return p()},get registeredTags(){return f()},get scopingRules(){return l()},alias:u,description:`Runtime ${s} - ver ${e.version}${u?` (${u})`:""}`,importMetaUrl:import.meta.url})}},h=()=>s,a=(e,t)=>{if(e.isNext||t.isNext)return e.buildTime-t.buildTime;const r=e.major-t.major;if(r)return r;const n=e.minor-t.minor;if(n)return n;const i=e.patch-t.patch;return i||new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"}).compare(e.suffix,t.suffix)},I=(e,t)=>{const r=`${e},${t}`;if(c.has(r))return c.get(r);const n=o[e],i=o[t];if(!n||!i)throw new Error("Invalid runtime index supplied");const m=a(n,i);return c.set(r,m),m},x=e=>{u=e},b=()=>o;export{h as getCurrentRuntimeIndex,d as registerCurrentRuntime,I as compareRuntimes,a as compareVersions,x as setRuntimeAlias,b as getAllRuntimes};
|
|
2
2
|
//# sourceMappingURL=Runtimes.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Runtimes.ts"],
|
|
4
|
-
"sourcesContent": ["import { getAllRegisteredTags } from \"./CustomElementsRegistry.js\";\nimport { getCustomElementsScopingRules, getCustomElementsScopingSuffix } from \"./CustomElementsScopeUtils.js\";\nimport VersionInfo from \"./generated/VersionInfo.js\";\nimport getSharedResource from \"./getSharedResource.js\";\n\ntype RuntimeData = VersionInfo & {\n\talias: string,\n\tdescription: string,\n};\n\nlet currentRuntimeIndex: number;\nlet currentRuntimeAlias = \"\";\n\nconst compareCache = new Map<string, number>();\n\n/**\n * Central registry where all runtimes register themselves by pushing an object.\n * The index in the registry servers as an ID for the runtime.\n * @type {*}\n */\nconst Runtimes = getSharedResource<Array<RuntimeData>>(\"Runtimes\", []);\n\n/**\n * Registers the current runtime in the shared runtimes resource registry\n */\nconst registerCurrentRuntime = () => {\n\tif (currentRuntimeIndex === undefined) {\n\t\tcurrentRuntimeIndex = Runtimes.length;\n\t\tconst versionInfo = VersionInfo;\n\n\t\tRuntimes.push({\n\t\t\t...versionInfo,\n\t\t\tget scopingSuffix() {\n\t\t\t\treturn getCustomElementsScopingSuffix();\n\t\t\t},\n\t\t\tget registeredTags() {\n\t\t\t\treturn getAllRegisteredTags();\n\t\t\t},\n\t\t\tget scopingRules() {\n\t\t\t\treturn getCustomElementsScopingRules();\n\t\t\t},\n\t\t\talias: currentRuntimeAlias,\n\t\t\tdescription: `Runtime ${currentRuntimeIndex} - ver ${versionInfo.version}${currentRuntimeAlias ? ` (${currentRuntimeAlias})` : \"\"}`,\n\t\t});\n\t}\n};\n\n/**\n * Returns the index of the current runtime's object in the shared runtimes resource registry\n * @returns {*}\n */\nconst getCurrentRuntimeIndex = () => {\n\treturn currentRuntimeIndex;\n};\n\n/**\n * Compares two
|
|
5
|
-
"mappings": "aAAA,OAAS,wBAAAA,MAA4B,8BACrC,OAAS,iCAAAC,EAA+B,kCAAAC,MAAsC,gCAC9E,OAAOC,MAAiB,6BACxB,OAAOC,MAAuB,
|
|
6
|
-
"names": ["getAllRegisteredTags", "getCustomElementsScopingRules", "getCustomElementsScopingSuffix", "VersionInfo", "getSharedResource", "currentRuntimeIndex", "currentRuntimeAlias", "compareCache", "Runtimes", "registerCurrentRuntime", "versionInfo", "getCurrentRuntimeIndex", "
|
|
4
|
+
"sourcesContent": ["import { getAllRegisteredTags } from \"./CustomElementsRegistry.js\";\nimport { getCustomElementsScopingRules, getCustomElementsScopingSuffix } from \"./CustomElementsScopeUtils.js\";\nimport VersionInfo from \"./generated/VersionInfo.js\";\nimport getSharedResource from \"./getSharedResource.js\";\n\ntype RuntimeData = VersionInfo & {\n\talias: string,\n\tdescription: string,\n\timportMetaUrl: string,\n};\n\nlet currentRuntimeIndex: number;\nlet currentRuntimeAlias = \"\";\n\nconst compareCache = new Map<string, number>();\n\n/**\n * Central registry where all runtimes register themselves by pushing an object.\n * The index in the registry servers as an ID for the runtime.\n * @type {*}\n */\nconst Runtimes = getSharedResource<Array<RuntimeData>>(\"Runtimes\", []);\n\n/**\n * Registers the current runtime in the shared runtimes resource registry\n */\nconst registerCurrentRuntime = () => {\n\tif (currentRuntimeIndex === undefined) {\n\t\tcurrentRuntimeIndex = Runtimes.length;\n\t\tconst versionInfo = VersionInfo;\n\n\t\tRuntimes.push({\n\t\t\t...versionInfo,\n\t\t\tget scopingSuffix() {\n\t\t\t\treturn getCustomElementsScopingSuffix();\n\t\t\t},\n\t\t\tget registeredTags() {\n\t\t\t\treturn getAllRegisteredTags();\n\t\t\t},\n\t\t\tget scopingRules() {\n\t\t\t\treturn getCustomElementsScopingRules();\n\t\t\t},\n\t\t\talias: currentRuntimeAlias,\n\t\t\tdescription: `Runtime ${currentRuntimeIndex} - ver ${versionInfo.version}${currentRuntimeAlias ? ` (${currentRuntimeAlias})` : \"\"}`,\n\t\t\timportMetaUrl: import.meta.url,\n\t\t});\n\t}\n};\n\n/**\n * Returns the index of the current runtime's object in the shared runtimes resource registry\n * @returns {*}\n */\nconst getCurrentRuntimeIndex = () => {\n\treturn currentRuntimeIndex;\n};\n\n/**\n * Compares two VersionInfo objects and returns 1 if the first is bigger, -1 if the second is bigger, and 0 if equal.\n */\nconst compareVersions = (v1: VersionInfo, v2: VersionInfo): number => {\n\tif (v1.isNext || v2.isNext) {\n\t\treturn v1.buildTime - v2.buildTime;\n\t}\n\n\tconst majorDiff = v1.major - v2.major;\n\tif (majorDiff) {\n\t\treturn majorDiff;\n\t}\n\n\tconst minorDiff = v1.minor - v2.minor;\n\tif (minorDiff) {\n\t\treturn minorDiff;\n\t}\n\n\tconst patchDiff = v1.patch - v2.patch;\n\tif (patchDiff) {\n\t\treturn patchDiff;\n\t}\n\n\tconst collator = new Intl.Collator(undefined, { numeric: true, sensitivity: \"base\" });\n\treturn collator.compare(v1.suffix, v2.suffix);\n};\n\n/**\n * Compares two runtimes and returns 1 if the first is of a bigger version, -1 if the second is of a bigger version, and 0 if equal\n * @param index1 The index of the first runtime to compare\n * @param index2 The index of the second runtime to compare\n * @returns {number}\n */\nconst compareRuntimes = (index1: number, index2: number) => {\n\tconst cacheIndex = `${index1},${index2}`;\n\tif (compareCache.has(cacheIndex)) {\n\t\treturn compareCache.get(cacheIndex)!;\n\t}\n\n\tconst runtime1 = Runtimes[index1];\n\tconst runtime2 = Runtimes[index2];\n\n\tif (!runtime1 || !runtime2) {\n\t\tthrow new Error(\"Invalid runtime index supplied\");\n\t}\n\n\tconst result = compareVersions(runtime1, runtime2);\n\n\tcompareCache.set(cacheIndex, result);\n\treturn result;\n};\n\n/**\n * Set an alias for the the current app/library/microfrontend which will appear in debug messages and console warnings\n * @param alias\n */\nconst setRuntimeAlias = (alias: string) => {\n\tcurrentRuntimeAlias = alias;\n};\n\nconst getAllRuntimes = () => {\n\treturn Runtimes;\n};\n\nexport {\n\tgetCurrentRuntimeIndex,\n\tregisterCurrentRuntime,\n\tcompareRuntimes,\n\tcompareVersions,\n\tsetRuntimeAlias,\n\tgetAllRuntimes,\n};\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,wBAAAA,MAA4B,8BACrC,OAAS,iCAAAC,EAA+B,kCAAAC,MAAsC,gCAC9E,OAAOC,MAAiB,6BACxB,OAAOC,MAAuB,yBAQ9B,IAAIC,EACAC,EAAsB,GAE1B,MAAMC,EAAe,IAAI,IAOnBC,EAAWJ,EAAsC,WAAY,CAAC,CAAC,EAK/DK,EAAyB,IAAM,CACpC,GAAIJ,IAAwB,OAAW,CACtCA,EAAsBG,EAAS,OAC/B,MAAME,EAAcP,EAEpBK,EAAS,KAAK,CACb,GAAGE,EACH,IAAI,eAAgB,CACnB,OAAOR,EAA+B,CACvC,EACA,IAAI,gBAAiB,CACpB,OAAOF,EAAqB,CAC7B,EACA,IAAI,cAAe,CAClB,OAAOC,EAA8B,CACtC,EACA,MAAOK,EACP,YAAa,WAAWD,CAAmB,UAAUK,EAAY,OAAO,GAAGJ,EAAsB,KAAKA,CAAmB,IAAM,EAAE,GACjI,cAAe,YAAY,GAC5B,CAAC,CACF,CACD,EAMMK,EAAyB,IACvBN,EAMFO,EAAkB,CAACC,EAAiBC,IAA4B,CACrE,GAAID,EAAG,QAAUC,EAAG,OACnB,OAAOD,EAAG,UAAYC,EAAG,UAG1B,MAAMC,EAAYF,EAAG,MAAQC,EAAG,MAChC,GAAIC,EACH,OAAOA,EAGR,MAAMC,EAAYH,EAAG,MAAQC,EAAG,MAChC,GAAIE,EACH,OAAOA,EAGR,MAAMC,EAAYJ,EAAG,MAAQC,EAAG,MAChC,OAAIG,GAIa,IAAI,KAAK,SAAS,OAAW,CAAE,QAAS,GAAM,YAAa,MAAO,CAAC,EACpE,QAAQJ,EAAG,OAAQC,EAAG,MAAM,CAC7C,EAQMI,EAAkB,CAACC,EAAgBC,IAAmB,CAC3D,MAAMC,EAAa,GAAGF,CAAM,IAAIC,CAAM,GACtC,GAAIb,EAAa,IAAIc,CAAU,EAC9B,OAAOd,EAAa,IAAIc,CAAU,EAGnC,MAAMC,EAAWd,EAASW,CAAM,EAC1BI,EAAWf,EAASY,CAAM,EAEhC,GAAI,CAACE,GAAY,CAACC,EACjB,MAAM,IAAI,MAAM,gCAAgC,EAGjD,MAAMC,EAASZ,EAAgBU,EAAUC,CAAQ,EAEjD,OAAAhB,EAAa,IAAIc,EAAYG,CAAM,EAC5BA,CACR,EAMMC,EAAmBC,GAAkB,CAC1CpB,EAAsBoB,CACvB,EAEMC,EAAiB,IACfnB,EAGR,OACCG,KAAA,uBACAF,KAAA,uBACAS,KAAA,gBACAN,KAAA,gBACAa,KAAA,gBACAE,KAAA",
|
|
6
|
+
"names": ["getAllRegisteredTags", "getCustomElementsScopingRules", "getCustomElementsScopingSuffix", "VersionInfo", "getSharedResource", "currentRuntimeIndex", "currentRuntimeAlias", "compareCache", "Runtimes", "registerCurrentRuntime", "versionInfo", "getCurrentRuntimeIndex", "compareVersions", "v1", "v2", "majorDiff", "minorDiff", "patchDiff", "compareRuntimes", "index1", "index2", "cacheIndex", "runtime1", "runtime2", "result", "setRuntimeAlias", "alias", "getAllRuntimes"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import{
|
|
1
|
+
"use strict";import{createOrUpdateStyle as t}from"./ManagedStyles.js";import s from"./generated/css/SystemCSSVars.css.js";const r=()=>{t(s,"data-ui5-system-css-vars")};export default r;
|
|
2
2
|
//# sourceMappingURL=SystemCSSVars.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SystemCSSVars.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": "aAAA,OAAS,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["import { createOrUpdateStyle } from \"./ManagedStyles.js\";\nimport systemCSSVars from \"./generated/css/SystemCSSVars.css.js\";\n\nconst insertSystemCSSVars = () => {\n\tcreateOrUpdateStyle(systemCSSVars, \"data-ui5-system-css-vars\");\n};\n\nexport default insertSystemCSSVars;\n"],
|
|
5
|
+
"mappings": "aAAA,OAAS,uBAAAA,MAA2B,qBACpC,OAAOC,MAAmB,uCAE1B,MAAMC,EAAsB,IAAM,CACjCF,EAAoBC,EAAe,0BAA0B,CAC9D,EAEA,eAAeC",
|
|
6
|
+
"names": ["createOrUpdateStyle", "systemCSSVars", "insertSystemCSSVars"]
|
|
7
7
|
}
|
package/dist/prod/UI5Element.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import"@ui5/webcomponents-base/dist/ssr-dom.js";import F from"./thirdparty/merge.js";import{boot as N}from"./Boot.js";import k from"./UI5ElementMetadata.js";import S from"./EventProvider.js";import x from"./updateShadowRoot.js";import{shouldIgnoreCustomElement as V}from"./IgnoreCustomElements.js";import{renderDeferred as j,renderImmediately as H,cancelRender as $}from"./Render.js";import{registerTag as z,isTagRegistered as B,recordTagRegistrationFailure as K}from"./CustomElementsRegistry.js";import{observeDOMNode as q,unobserveDOMNode as W}from"./DOMObserver.js";import{skipOriginalEvent as X}from"./config/NoConflict.js";import Y from"./locale/getEffectiveDir.js";import{kebabToCamelCase as m,camelToKebabCase as J,kebabToPascalCase as w}from"./util/StringHelper.js";import P from"./util/isValidPropertyName.js";import{getSlotName as G,getSlottedNodesList as D}from"./util/SlotsHelper.js";import Q from"./util/arraysAreEqual.js";import{markAsRtlAware as Z}from"./locale/RTLAwareRegistry.js";import tt from"./renderer/executeTemplate.js";import{shouldScopeCustomElement as T}from"./CustomElementsScopeUtils.js";import{updateFormValue as et,setFormValue as A}from"./features/InputElementsFormSupport.js";import{getI18nBundle as nt}from"./i18nBundle.js";import{fetchCldr as st}from"./asset-registries/LocaleData.js";import M from"./locale/getLocale.js";import{getLanguageChangePending as ot}from"./config/Language.js";let it=0;const R=new Map,I=new Map,O={fromAttribute(c,f){return f===Boolean?c!==null:f===Number?c===null?void 0:parseFloat(c):c},toAttribute(c,f){return f===Boolean?c?"":null:f===Object||f===Array||c==null?null:String(c)}};function y(c){this._suppressInvalidation||this.constructor.getMetadata().isLanguageAware()&&ot()||(this.onInvalidation(c),this._changedState.push(c),j(this),this._invalidationEventProvider.fireEvent("invalidate",{...c,target:this}))}function at(c,f){do{const t=Object.getOwnPropertyDescriptor(c,f);if(t)return t;c=Object.getPrototypeOf(c)}while(c&&c!==HTMLElement.prototype)}class b extends HTMLElement{constructor(){super();this.__shouldHydrate=!1;this._rendered=!1;const t=this.constructor;this._changedState=[],this._suppressInvalidation=!0,this._inDOM=!1,this._fullyConnected=!1,this._childChangeListeners=new Map,this._slotChangeListeners=new Map,this._invalidationEventProvider=new S,this._componentStateFinalizedEventProvider=new S;let e;this._domRefReadyPromise=new Promise(n=>{e=n}),this._domRefReadyPromise._deferredResolve=e,this._doNotSyncAttributes=new Set,this._slotsAssignedNodes=new WeakMap,this._state={...t.getMetadata().getInitialState()},this.initializedProperties=new Map,this.constructor.getMetadata().getPropertiesList().forEach(n=>{if(this.hasOwnProperty(n)){const o=this[n];this.initializedProperties.set(n,o)}}),this._internals=this.attachInternals(),this._initShadowRoot()}_initShadowRoot(){const t=this.constructor;if(t._needsShadowDOM()){const e={mode:"open"};this.shadowRoot?this.__shouldHydrate=!0:this.attachShadow({...e,...t.getMetadata().getShadowRootOptions()}),t.getMetadata().slotsAreManaged()&&this.shadowRoot.addEventListener("slotchange",this._onShadowRootSlotChange.bind(this))}}_onShadowRootSlotChange(t){t.target?.getRootNode()===this.shadowRoot&&this._processChildren()}get _id(){return this.__id||(this.__id=`ui5wc_${++it}`),this.__id}render(){const t=this.constructor.template;return tt(t,this)}async connectedCallback(){const t=this.constructor;this.setAttribute(t.getMetadata().getPureTag(),""),t.getMetadata().supportsF6FastNavigation()&&!this.hasAttribute("data-sap-ui-fastnavgroup")&&this.setAttribute("data-sap-ui-fastnavgroup","true");const e=t.getMetadata().slotsAreManaged();this._inDOM=!0,e&&(this._startObservingDOMChildren(),await this._processChildren()),t.asyncFinished||await t.definePromise,this._inDOM&&(H(this),this._domRefReadyPromise._deferredResolve(),this._fullyConnected=!0,this.onEnterDOM())}disconnectedCallback(){const e=this.constructor.getMetadata().slotsAreManaged();this._inDOM=!1,e&&this._stopObservingDOMChildren(),this._fullyConnected&&(this.onExitDOM(),this._fullyConnected=!1),this._domRefReadyPromise._deferredResolve(),$(this)}onBeforeRendering(){}onAfterRendering(){}onEnterDOM(){}onExitDOM(){}_startObservingDOMChildren(){const e=this.constructor.getMetadata();if(!e.hasSlots())return;const n=e.canSlotText(),o={childList:!0,subtree:n,characterData:n};q(this,this._processChildren.bind(this),o)}_stopObservingDOMChildren(){W(this)}async _processChildren(){this.constructor.getMetadata().hasSlots()&&await this._updateSlots()}async _updateSlots(){const t=this.constructor,e=t.getMetadata().getSlots(),s=t.getMetadata().canSlotText(),n=Array.from(s?this.childNodes:this.children),o=new Map,a=new Map;for(const[l,u]of Object.entries(e)){const d=u.propertyName||l;a.set(d,l),o.set(d,[...this._state[d]]),this._clearSlot(l,u)}const r=new Map,i=new Map,h=n.map(async(l,u)=>{const d=G(l),g=e[d];if(g===void 0){if(d!=="default"){const p=Object.keys(e).join(", ");console.warn(`Unknown slotName: ${d}, ignoring`,l,`Valid values are: ${p}`)}return}if(g.individualSlots){const p=(r.get(d)||0)+1;r.set(d,p),l._individualSlot=`${d}-${p}`}if(l instanceof HTMLElement){const p=l.localName;if(p.includes("-")&&!V(p)){if(!customElements.get(p)){const L=customElements.whenDefined(p);let E=R.get(p);E||(E=new Promise(U=>setTimeout(U,1e3)),R.set(p,E)),await Promise.race([L,E])}customElements.upgrade(l)}}if(l=t.getMetadata().constructor.validateSlotValue(l,g),v(l)&&g.invalidateOnChildChange){const p=this._getChildChangeListener(d);l.attachInvalidate.call(l,p)}l instanceof HTMLSlotElement&&this._attachSlotChange(l,d,!!g.invalidateOnChildChange);const C=g.propertyName||d;i.has(C)?i.get(C).push({child:l,idx:u}):i.set(C,[{child:l,idx:u}])});await Promise.all(h),i.forEach((l,u)=>{this._state[u]=l.sort((d,g)=>d.idx-g.idx).map(d=>d.child),this._state[m(u)]=this._state[u]});let _=!1;for(const[l,u]of Object.entries(e)){const d=u.propertyName||l;Q(o.get(d),this._state[d])||(y.call(this,{type:"slot",name:a.get(d),reason:"children"}),_=!0,t.getMetadata().isFormAssociated()&&A(this))}_||y.call(this,{type:"slot",name:"default",reason:"textcontent"})}_clearSlot(t,e){const s=e.propertyName||t;this._state[s].forEach(o=>{if(v(o)){const a=this._getChildChangeListener(t);o.detachInvalidate.call(o,a)}o instanceof HTMLSlotElement&&this._detachSlotChange(o,t)}),this._state[s]=[],this._state[m(s)]=this._state[s]}attachInvalidate(t){this._invalidationEventProvider.attachEvent("invalidate",t)}detachInvalidate(t){this._invalidationEventProvider.detachEvent("invalidate",t)}_onChildChange(t,e){this.constructor.getMetadata().shouldInvalidateOnChildChange(t,e.type,e.name)&&y.call(this,{type:"slot",name:t,reason:"childchange",child:e.target})}attributeChangedCallback(t,e,s){let n;if(this._doNotSyncAttributes.has(t))return;const o=this.constructor.getMetadata().getProperties(),a=t.replace(/^ui5-/,""),r=m(a);if(o.hasOwnProperty(r)){const i=o[r];n=(i.converter??O).fromAttribute(s,i.type),this[r]=n}}formAssociatedCallback(){this.constructor.getMetadata().isFormAssociated()&&et(this)}static get formAssociated(){return this.getMetadata().isFormAssociated()}_updateAttribute(t,e){const s=this.constructor;if(!s.getMetadata().hasAttribute(t))return;const o=s.getMetadata().getProperties()[t],a=J(t),i=(o.converter||O).toAttribute(e,o.type);this._doNotSyncAttributes.add(a),i==null?this.removeAttribute(a):this.setAttribute(a,i),this._doNotSyncAttributes.delete(a)}_getChildChangeListener(t){return this._childChangeListeners.has(t)||this._childChangeListeners.set(t,this._onChildChange.bind(this,t)),this._childChangeListeners.get(t)}_getSlotChangeListener(t){return this._slotChangeListeners.has(t)||this._slotChangeListeners.set(t,this._onSlotChange.bind(this,t)),this._slotChangeListeners.get(t)}_attachSlotChange(t,e,s){const n=this._getSlotChangeListener(e);t.addEventListener("slotchange",o=>{if(n.call(t,o),s){const a=this._slotsAssignedNodes.get(t);a&&a.forEach(i=>{if(v(i)){const h=this._getChildChangeListener(e);i.detachInvalidate.call(i,h)}});const r=D([t]);this._slotsAssignedNodes.set(t,r),r.forEach(i=>{if(v(i)){const h=this._getChildChangeListener(e);i.attachInvalidate.call(i,h)}})}})}_detachSlotChange(t,e){t.removeEventListener("slotchange",this._getSlotChangeListener(e))}_onSlotChange(t){y.call(this,{type:"slot",name:t,reason:"slotchange"})}onInvalidation(t){}updateAttributes(){const e=this.constructor.getMetadata().getProperties();for(const[s,n]of Object.entries(e))this._updateAttribute(s,this[s])}_render(){const t=this.constructor,e=t.getMetadata().hasIndividualSlots();this.initializedProperties.size>0&&(Array.from(this.initializedProperties.entries()).forEach(([s,n])=>{delete this[s],this[s]=n}),this.initializedProperties.clear()),this._suppressInvalidation=!0;try{this.onBeforeRendering(),this._rendered||this.updateAttributes(),this._componentStateFinalizedEventProvider.fireEvent("componentStateFinalized")}finally{this._suppressInvalidation=!1}this._changedState=[],t._needsShadowDOM()&&x(this),this._rendered=!0,e&&this._assignIndividualSlotsToChildren(),this.onAfterRendering()}_assignIndividualSlotsToChildren(){Array.from(this.children).forEach(e=>{e._individualSlot&&e.setAttribute("slot",e._individualSlot)})}_waitForDomRef(){return this._domRefReadyPromise}getDomRef(){if(typeof this._getRealDomRef=="function")return this._getRealDomRef();if(!(!this.shadowRoot||this.shadowRoot.children.length===0))return this.shadowRoot.children[0]}getFocusDomRef(){const t=this.getDomRef();if(t)return t.querySelector("[data-sap-focus-ref]")||t}async getFocusDomRefAsync(){return await this._waitForDomRef(),this.getFocusDomRef()}async focus(t){await this._waitForDomRef();const e=this.getFocusDomRef();e===this||!this.isConnected?HTMLElement.prototype.focus.call(this,t):e&&typeof e.focus=="function"&&e.focus(t)}fireEvent(t,e,s=!1,n=!0){const o=this._fireEvent(t,e,s,n),a=w(t);return a!==t?o&&this._fireEvent(a,e,s,n):o}fireDecoratorEvent(t,e){const s=this.getEventData(t),n=s?s.cancelable:!1,o=s?s.bubbles:!1,a=this._fireEvent(t,e,n,o),r=w(t);return r!==t?a&&this._fireEvent(r,e,n,o):a}_fireEvent(t,e,s=!1,n=!0){const o=new CustomEvent(`ui5-${t}`,{detail:e,composed:!1,bubbles:n,cancelable:s}),a=this.dispatchEvent(o);if(X(t))return a;const r=new CustomEvent(t,{detail:e,composed:!1,bubbles:n,cancelable:s});return this.dispatchEvent(r)&&a}getEventData(t){return this.constructor.getMetadata().getEvents()[t]}getSlottedNodes(t){return D(this[t])}attachComponentStateFinalized(t){this._componentStateFinalizedEventProvider.attachEvent("componentStateFinalized",t)}detachComponentStateFinalized(t){this._componentStateFinalizedEventProvider.detachEvent("componentStateFinalized",t)}get effectiveDir(){return Z(this.constructor),Y(this)}get isUI5Element(){return!0}get isUI5AbstractElement(){return!this.constructor._needsShadowDOM()}get classes(){return{}}get accessibilityInfo(){}static get observedAttributes(){return this.getMetadata().getAttributesList()}static get tagsToScope(){const t=this.getMetadata().getPureTag(),e=this.getUniqueDependencies().map(s=>s.getMetadata().getPureTag()).filter(T);return T(t)&&e.push(t),e}static _needsShadowDOM(){return!!this.template||Object.prototype.hasOwnProperty.call(this.prototype,"render")}static _generateAccessors(){const t=this.prototype,e=this.getMetadata().slotsAreManaged(),s=this.getMetadata().getProperties();for(const[n,o]of Object.entries(s)){P(n)||console.warn(`"${n}" is not a valid property name. Use a name that does not collide with DOM APIs`);const a=at(t,n);let r;a?.set&&(r=a.set);let i;a?.get&&(i=a.get),Object.defineProperty(t,n,{get(){return i?i.call(this):this._state[n]},set(h){const _=this.constructor,l=i?i.call(this):this._state[n];if(l!==h){if(r?r.call(this,h):this._state[n]=h,y.call(this,{type:"property",name:n,newValue:h,oldValue:l}),this._rendered){const d=i?i.call(this):this._state[n];this._updateAttribute(n,d)}_.getMetadata().isFormAssociated()&&A(this)}}})}if(e){const n=this.getMetadata().getSlots();for(const[o,a]of Object.entries(n)){P(o)||console.warn(`"${o}" is not a valid property name. Use a name that does not collide with DOM APIs`);const r=a.propertyName||o,i={get(){return this._state[r]!==void 0?this._state[r]:[]},set(){throw new Error("Cannot set slot content directly, use the DOM APIs (appendChild, removeChild, etc...)")}};Object.defineProperty(t,r,i),r!==m(r)&&Object.defineProperty(t,m(r),i)}}}static{this.metadata={}}static{this.styles=""}static get dependencies(){return[]}static cacheUniqueDependencies(){const t=this.dependencies.filter((e,s,n)=>n.indexOf(e)===s);I.set(this,t)}static getUniqueDependencies(){return I.has(this)||this.cacheUniqueDependencies(),I.get(this)||[]}static async onDefine(){return Promise.resolve()}static fetchI18nBundles(){return Promise.all(Object.entries(this.getMetadata().getI18n()).map(t=>{const{bundleName:e}=t[1];return nt(e)}))}static fetchCLDR(){return this.getMetadata().needsCLDR()?st(M().getLanguage(),M().getRegion(),M().getScript()):Promise.resolve()}static{this.i18nBundleStorage={}}static get i18nBundles(){return this.i18nBundleStorage}static define(){const t=async()=>{await N();const o=await Promise.all([this.fetchI18nBundles(),this.fetchCLDR(),this.onDefine()]),[a]=o;Object.entries(this.getMetadata().getI18n()).forEach((r,i)=>{const h=r[1].bundleName;this.i18nBundleStorage[h]=a[i]}),this.asyncFinished=!0};this.definePromise=t();const e=this.getMetadata().getTag(),s=B(e),n=customElements.get(e);return n&&!s?K(e):n||(this._generateAccessors(),z(e),customElements.define(e,this)),this}static getMetadata(){if(this.hasOwnProperty("_metadata"))return this._metadata;const t=[this.metadata];let e=this;for(;e!==b;)e=Object.getPrototypeOf(e),t.unshift(e.metadata);const s=F({},...t);return this._metadata=new k(s),this._metadata}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}}const v=c=>"isUI5Element"in c;export default b;export{v as instanceOfUI5Element};
|
|
1
|
+
"use strict";import"@ui5/webcomponents-base/dist/ssr-dom.js";import N from"./thirdparty/merge.js";import{boot as x}from"./Boot.js";import V from"./UI5ElementMetadata.js";import b from"./EventProvider.js";import j from"./updateShadowRoot.js";import{shouldIgnoreCustomElement as H}from"./IgnoreCustomElements.js";import{renderDeferred as $,renderImmediately as z,cancelRender as B,unregisterElement as q,registerElement as K}from"./Render.js";import{registerTag as W,isTagRegistered as J,recordTagRegistrationFailure as X}from"./CustomElementsRegistry.js";import{observeDOMNode as Y,unobserveDOMNode as G}from"./DOMObserver.js";import{skipOriginalEvent as Q}from"./config/NoConflict.js";import Z from"./locale/getEffectiveDir.js";import{kebabToCamelCase as m,camelToKebabCase as tt,kebabToPascalCase as P}from"./util/StringHelper.js";import w from"./util/isValidPropertyName.js";import{getSlotName as T,getSlottedNodesList as D}from"./util/SlotsHelper.js";import et from"./util/arraysAreEqual.js";import{markAsRtlAware as nt}from"./locale/RTLAwareRegistry.js";import st from"./renderer/executeTemplate.js";import{shouldScopeCustomElement as A}from"./CustomElementsScopeUtils.js";import{updateFormValue as ot,setFormValue as R}from"./features/InputElementsFormSupport.js";import{getI18nBundle as at}from"./i18nBundle.js";import{fetchCldr as it}from"./asset-registries/LocaleData.js";import C from"./locale/getLocale.js";import{getLanguageChangePending as O}from"./config/Language.js";import rt from"./util/createInstanceChecker.js";let lt=0;const L=new Map,M=new Map,U={fromAttribute(c,f){if(f===Boolean)return c!==null;if(f===Number)return c===null?void 0:parseFloat(c);if(f===Object||f===Array)try{return JSON.parse(c)}catch{return c}return c},toAttribute(c,f){return f===Boolean?c?"":null:f===Object||f===Array?JSON.stringify(c):c==null?null:String(c)}};function g(c){this._suppressInvalidation||this.constructor.getMetadata().isLanguageAware()&&O()||(this.onInvalidation(c),this._changedState.push(c),$(this),this._invalidationEventProvider.fireEvent("invalidate",{...c,target:this}))}function dt(c,f){do{const t=Object.getOwnPropertyDescriptor(c,f);if(t)return t;c=Object.getPrototypeOf(c)}while(c&&c!==HTMLElement.prototype)}class S extends HTMLElement{constructor(){super();this.__shouldHydrate=!1;this._rendered=!1;const t=this.constructor;this._changedState=[],this._suppressInvalidation=!0,this._inDOM=!1,this._fullyConnected=!1,this._childChangeListeners=new Map,this._slotChangeListeners=new Map,this._invalidationEventProvider=new b,this._componentStateFinalizedEventProvider=new b;let e;this._domRefReadyPromise=new Promise(n=>{e=n}),this._domRefReadyPromise._deferredResolve=e,this._doNotSyncAttributes=new Set,this._slotsAssignedNodes=new WeakMap,this._state={...t.getMetadata().getInitialState()},this.initializedProperties=new Map,this.constructor.getMetadata().getPropertiesList().forEach(n=>{if(this.hasOwnProperty(n)){const o=this[n];this.initializedProperties.set(n,o)}}),this._internals=this.attachInternals(),this._initShadowRoot()}_initShadowRoot(){const t=this.constructor;if(t._needsShadowDOM()){const e={mode:"open"};this.shadowRoot?this.__shouldHydrate=!0:this.attachShadow({...e,...t.getMetadata().getShadowRootOptions()}),t.getMetadata().slotsAreManaged()&&this.shadowRoot.addEventListener("slotchange",this._onShadowRootSlotChange.bind(this))}}_onShadowRootSlotChange(t){t.target?.getRootNode()===this.shadowRoot&&this._processChildren()}get _id(){return this.__id||(this.__id=`ui5wc_${++lt}`),this.__id}render(){const t=this.constructor.template;return st(t,this)}async connectedCallback(){const t=this.constructor;K(this),this.setAttribute(t.getMetadata().getPureTag(),""),t.getMetadata().supportsF6FastNavigation()&&!this.hasAttribute("data-sap-ui-fastnavgroup")&&this.setAttribute("data-sap-ui-fastnavgroup","true");const e=t.getMetadata().slotsAreManaged();this._inDOM=!0,e&&(this._startObservingDOMChildren(),await this._processChildren()),t.asyncFinished||await t._definePromise,!(t.getMetadata().isLanguageAware()&&O())&&this._inDOM&&(z(this),this._domRefReadyPromise._deferredResolve(),this._fullyConnected=!0,this.onEnterDOM(),this.hasAttribute("autofocus")&&requestAnimationFrame(()=>{this.focus()}))}get definePromise(){const t=this.constructor;return!t.asyncFinished&&t._definePromise?t._definePromise:Promise.resolve()}disconnectedCallback(){const e=this.constructor.getMetadata().slotsAreManaged();this._inDOM=!1,e&&this._stopObservingDOMChildren(),this._fullyConnected&&(this.onExitDOM(),this._fullyConnected=!1),this._domRefReadyPromise._deferredResolve(),B(this),q(this)}onBeforeRendering(){}onAfterRendering(){}onEnterDOM(){}onExitDOM(){}_startObservingDOMChildren(){const e=this.constructor.getMetadata();if(!e.hasSlots())return;const n=e.canSlotText(),o={childList:!0,subtree:n,characterData:n};Y(this,this._processChildren.bind(this),o)}_stopObservingDOMChildren(){G(this)}async _processChildren(){this.constructor.getMetadata().hasSlots()&&await this._updateSlots()}async _updateSlots(){const t=this.constructor,e=t.getMetadata().getSlots(),s=t.getMetadata().canSlotText(),n=Array.from(s?this.childNodes:this.children),o=new Map,i=new Map;for(const[l,h]of Object.entries(e)){const d=h.propertyName||l;i.set(d,l),o.set(d,[...this._state[d]]),this._clearSlot(l,h)}const r=new Map,a=new Map;n.forEach((l,h)=>{const d=T(l),p=e[d];if(p===void 0){if(d!=="default"){const I=Object.keys(e).join(", ");console.warn(`Unknown slotName: ${d}, ignoring`,l,`Valid values are: ${I}`)}return}const _=p.propertyName||d;a.has(_)?a.get(_).push({child:l,idx:h}):a.set(_,[{child:l,idx:h}])}),a.forEach((l,h)=>{this._state[h]=l.sort((d,p)=>d.idx-p.idx).map(d=>d.child),this._state[m(h)]=this._state[h]});const u=n.map(async l=>{const h=T(l),d=e[h];if(d!==void 0){if(d.individualSlots){const p=(r.get(h)||0)+1;r.set(h,p),l._individualSlot=`${h}-${p}`}if(l instanceof HTMLElement){const p=l.localName;if(p.includes("-")&&!H(p)){if(!customElements.get(p)){const k=customElements.whenDefined(p);let E=L.get(p);E||(E=new Promise(F=>setTimeout(F,1e3)),L.set(p,E)),await Promise.race([k,E])}customElements.upgrade(l)}}if(l=t.getMetadata().constructor.validateSlotValue(l,d),y(l)&&d.invalidateOnChildChange){const p=this._getChildChangeListener(h);l.attachInvalidate.call(l,p)}l instanceof HTMLSlotElement&&this._attachSlotChange(l,h,!!d.invalidateOnChildChange)}});await Promise.all(u);let v=!1;for(const[l,h]of Object.entries(e)){const d=h.propertyName||l;et(o.get(d),this._state[d])||(g.call(this,{type:"slot",name:i.get(d),reason:"children"}),v=!0,t.getMetadata().isFormAssociated()&&R(this))}v||g.call(this,{type:"slot",name:"default",reason:"textcontent"})}_clearSlot(t,e){const s=e.propertyName||t;this._state[s].forEach(o=>{if(y(o)){const i=this._getChildChangeListener(t);o.detachInvalidate.call(o,i)}o instanceof HTMLSlotElement&&this._detachSlotChange(o,t)}),this._state[s]=[],this._state[m(s)]=this._state[s]}attachInvalidate(t){this._invalidationEventProvider.attachEvent("invalidate",t)}detachInvalidate(t){this._invalidationEventProvider.detachEvent("invalidate",t)}_onChildChange(t,e){this.constructor.getMetadata().shouldInvalidateOnChildChange(t,e.type,e.name)&&g.call(this,{type:"slot",name:t,reason:"childchange",child:e.target})}attributeChangedCallback(t,e,s){let n;if(this._doNotSyncAttributes.has(t))return;const o=this.constructor.getMetadata().getProperties(),i=t.replace(/^ui5-/,""),r=m(i);if(o.hasOwnProperty(r)){const a=o[r];n=(a.converter??U).fromAttribute(s,a.type),this[r]=n}}formAssociatedCallback(){this.constructor.getMetadata().isFormAssociated()&&ot(this)}static get formAssociated(){return this.getMetadata().isFormAssociated()}_updateAttribute(t,e){const s=this.constructor;if(!s.getMetadata().hasAttribute(t))return;const o=s.getMetadata().getProperties()[t],i=tt(t),a=(o.converter||U).toAttribute(e,o.type);this._doNotSyncAttributes.add(i),a==null?this.removeAttribute(i):this.setAttribute(i,a),this._doNotSyncAttributes.delete(i)}_getChildChangeListener(t){return this._childChangeListeners.has(t)||this._childChangeListeners.set(t,this._onChildChange.bind(this,t)),this._childChangeListeners.get(t)}_getSlotChangeListener(t){return this._slotChangeListeners.has(t)||this._slotChangeListeners.set(t,this._onSlotChange.bind(this,t)),this._slotChangeListeners.get(t)}_attachSlotChange(t,e,s){const n=this._getSlotChangeListener(e);t.addEventListener("slotchange",o=>{if(n.call(t,o),s){const i=this._slotsAssignedNodes.get(t);i&&i.forEach(a=>{if(y(a)){const u=this._getChildChangeListener(e);a.detachInvalidate.call(a,u)}});const r=D([t]);this._slotsAssignedNodes.set(t,r),r.forEach(a=>{if(y(a)){const u=this._getChildChangeListener(e);a.attachInvalidate.call(a,u)}})}})}_detachSlotChange(t,e){t.removeEventListener("slotchange",this._getSlotChangeListener(e))}_onSlotChange(t){g.call(this,{type:"slot",name:t,reason:"slotchange"})}onInvalidation(t){}updateAttributes(){const e=this.constructor.getMetadata().getProperties();for(const[s,n]of Object.entries(e))this._updateAttribute(s,this[s])}_render(){const t=this.constructor,e=t.getMetadata().hasIndividualSlots();this.initializedProperties.size>0&&(Array.from(this.initializedProperties.entries()).forEach(([s,n])=>{delete this[s],this[s]=n}),this.initializedProperties.clear()),this._suppressInvalidation=!0;try{this.onBeforeRendering(),this._rendered||this.updateAttributes(),this._componentStateFinalizedEventProvider.fireEvent("componentStateFinalized")}finally{this._suppressInvalidation=!1}this._changedState=[],t._needsShadowDOM()&&j(this),this._rendered=!0,e&&this._assignIndividualSlotsToChildren(),this.onAfterRendering()}_assignIndividualSlotsToChildren(){Array.from(this.children).forEach(e=>{e._individualSlot&&e.setAttribute("slot",e._individualSlot)})}_waitForDomRef(){return this._domRefReadyPromise}getDomRef(){if(typeof this._getRealDomRef=="function")return this._getRealDomRef();if(!(!this.shadowRoot||this.shadowRoot.children.length===0))return this.shadowRoot.children[0]}getFocusDomRef(){const t=this.getDomRef();if(t)return t.querySelector("[data-sap-focus-ref]")||t}async getFocusDomRefAsync(){return await this._waitForDomRef(),this.getFocusDomRef()}async focus(t){await this._waitForDomRef();const e=this.getFocusDomRef();e===this||!this.isConnected?HTMLElement.prototype.focus.call(this,t):e&&typeof e.focus=="function"&&e.focus(t)}fireEvent(t,e,s=!1,n=!0){const o=this._fireEvent(t,e,s,n),i=P(t);return i!==t?o&&this._fireEvent(i,e,s,n):o}fireDecoratorEvent(t,e){const s=this.getEventData(t),n=s?s.cancelable:!1,o=s?s.bubbles:!1,i=this._fireEvent(t,e,n,o),r=P(t);return r!==t?i&&this._fireEvent(r,e,n,o):i}_fireEvent(t,e,s=!1,n=!0){const o=new CustomEvent(`ui5-${t}`,{detail:e,composed:!1,bubbles:n,cancelable:s}),i=this.dispatchEvent(o);if(Q(t))return i;const r=new CustomEvent(t,{detail:e,composed:!1,bubbles:n,cancelable:s});return this.dispatchEvent(r)&&i}getEventData(t){return this.constructor.getMetadata().getEvents()[t]}getSlottedNodes(t){return D(this[t])}attachComponentStateFinalized(t){this._componentStateFinalizedEventProvider.attachEvent("componentStateFinalized",t)}detachComponentStateFinalized(t){this._componentStateFinalizedEventProvider.detachEvent("componentStateFinalized",t)}get effectiveDir(){return nt(this.constructor),Z(this)}get isUI5Element(){return!0}get isUI5AbstractElement(){return!this.constructor._needsShadowDOM()}get classes(){return{}}get accessibilityInfo(){}static get observedAttributes(){return this.getMetadata().getAttributesList()}static get tagsToScope(){const t=this.getMetadata().getPureTag(),e=this.getUniqueDependencies().map(s=>s.getMetadata().getPureTag()).filter(A);return A(t)&&e.push(t),e}static _needsShadowDOM(){return!!this.template||Object.prototype.hasOwnProperty.call(this.prototype,"render")}static _generateAccessors(){const t=this.prototype,e=this.getMetadata().slotsAreManaged(),s=this.getMetadata().getProperties();for(const[n,o]of Object.entries(s)){w(n)||console.warn(`"${n}" is not a valid property name. Use a name that does not collide with DOM APIs`);const i=dt(t,n);let r;i?.set&&(r=i.set);let a;i?.get&&(a=i.get),Object.defineProperty(t,n,{get(){return a?a.call(this):this._state[n]},set(u){const v=this.constructor,l=a?a.call(this):this._state[n];if(l!==u){if(r?r.call(this,u):this._state[n]=u,g.call(this,{type:"property",name:n,newValue:u,oldValue:l}),this._rendered){const d=a?a.call(this):this._state[n];this._updateAttribute(n,d)}v.getMetadata().isFormAssociated()&&R(this)}}})}if(e){const n=this.getMetadata().getSlots();for(const[o,i]of Object.entries(n)){w(o)||console.warn(`"${o}" is not a valid property name. Use a name that does not collide with DOM APIs`);const r=i.propertyName||o,a={get(){return this._state[r]!==void 0?this._state[r]:[]},set(){throw new Error("Cannot set slot content directly, use the DOM APIs (appendChild, removeChild, etc...)")}};Object.defineProperty(t,r,a),r!==m(r)&&Object.defineProperty(t,m(r),a)}}}static{this.metadata={}}static{this.styles=""}static get dependencies(){return[]}static cacheUniqueDependencies(){const t=this.dependencies.filter((e,s,n)=>n.indexOf(e)===s);M.set(this,t)}static getUniqueDependencies(){return M.has(this)||this.cacheUniqueDependencies(),M.get(this)||[]}static async onDefine(){return Promise.resolve()}static fetchI18nBundles(){return Promise.all(Object.entries(this.getMetadata().getI18n()).map(t=>{const{bundleName:e}=t[1];return at(e)}))}static fetchCLDR(){return this.getMetadata().needsCLDR()?it(C().getLanguage(),C().getRegion(),C().getScript()):Promise.resolve()}static{this.i18nBundleStorage={}}static get i18nBundles(){return this.i18nBundleStorage}static define(){const t=async()=>{await x();const o=await Promise.all([this.fetchI18nBundles(),this.fetchCLDR(),this.onDefine()]),[i]=o;Object.entries(this.getMetadata().getI18n()).forEach((r,a)=>{const u=r[1].bundleName;this.i18nBundleStorage[u]=i[a]}),this.asyncFinished=!0};this._definePromise=t();const e=this.getMetadata().getTag(),s=J(e),n=customElements.get(e);return n&&!s?X(e):n||(this._generateAccessors(),W(e),customElements.define(e,this)),this}static getMetadata(){if(this.hasOwnProperty("_metadata"))return this._metadata;const t=[this.metadata];let e=this;for(;e!==S;)e=Object.getPrototypeOf(e),t.unshift(e.metadata);const s=N({},...t);return this._metadata=new V(s),this._metadata}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}}const y=rt("isUI5Element");export default S;export{y as instanceOfUI5Element};
|
|
2
2
|
//# sourceMappingURL=UI5Element.js.map
|