@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
package/dist/Render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Render.js","sourceRoot":"","sources":["../src/Render.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAM1D,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAc,CAAC;AACjD,MAAM,aAAa,GAAG,IAAI,aAAa,EAAoB,CAAC;AAE5D,MAAM,wBAAwB,GAAG,IAAI,WAAW,EAAE,CAAC,CAAC,uCAAuC;AAE3F,IAAI,iBAA4C,EAC/C,wBAAoD,CAAC;AAEtD,IAAI,qBAA0C,CAAC;AAE/C,IAAI,YAAkC,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,cAAc,GAAG,KAAK,EAAE,YAAwB,EAAE,EAAE;IACzD,4BAA4B;IAC5B,wBAAwB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAE3C,4BAA4B;IAC5B,MAAM,kBAAkB,EAAE,CAAC;AAC5B,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,CAAC,YAAwB,EAAE,EAAE;IACtD,aAAa,CAAC,SAAS,CAAC,uBAAuB,EAAE,YAAY,CAAC,CAAC;IAC/D,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACrC,YAAY,CAAC,OAAO,EAAE,CAAC;AACxB,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,YAAY,GAAG,CAAC,YAAwB,EAAE,EAAE;IACjD,wBAAwB,CAAC,MAAM,CAAC,YAAY,C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AG,KAAK,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,UAAU,CAAC,EAAE,CAAC;YAC3J,cAAc,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC;IACF,CAAC,CAAC,CAAC;IACH,MAAM,cAAc,EAAE,CAAC;AACxB,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,CAAC,QAAuC,EAAE,EAAE;IAC/E,aAAa,CAAC,WAAW,CAAC,uBAAuB,EAAE,QAAQ,CAAC,CAAC;AAC9D,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,CAAC,QAAuC,EAAE,EAAE;IAC/E,aAAa,CAAC,WAAW,CAAC,uBAAuB,EAAE,QAAQ,CAAC,CAAC;AAC9D,CAAC,CAAC;AAEF,OAAO,EACN,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,GAC3B,CAAC","sourcesContent":["import EventProvider from \"./EventProvider.js\";\nimport RenderQueue from \"./RenderQueue.js\";\nimport { getAllRegisteredTags } from \"./CustomElementsRegistry.js\";\nimport { isRtlAware } from \"./locale/RTLAwareRegistry.js\";\nimport type UI5Element from \"./UI5Element.js\";\nimport 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\tregisteredElements.add(webComponent);\n\twebComponent._render();\n};\n\n/**\n * Cancels the rendering of a component, if awaiting to be rendered, and removes it from the registry of rendered components\n *\n * @param webComponent\n */\nconst cancelRender = (webComponent: UI5Element) => {\n\tinvalidatedWebComponents.remove(webComponent);\n\tregisteredElements.delete(webComponent);\n};\n\n/**\n * Schedules a rendering task, if not scheduled already\n */\nconst scheduleRenderTask = async () => {\n\tif (!queuePromise) {\n\t\tqueuePromise = new Promise<void>(resolve => {\n\t\t\twindow.requestAnimationFrame(() => {\n\t\t\t\t// Render all components in the queue\n\n\t\t\t\t// console.log(`--------------------RENDER TASK START------------------------------`); // eslint-disable-line\n\t\t\t\tinvalidatedWebComponents.process(renderImmediately);\n\t\t\t\t// console.log(`--------------------RENDER TASK END------------------------------`); // eslint-disable-line\n\n\t\t\t\t// Resolve the promise so that callers of renderDeferred can continue\n\t\t\t\tqueuePromise = null;\n\t\t\t\tresolve();\n\n\t\t\t\t// Wait for Mutation observer before the render task is considered finished\n\t\t\t\tif (!mutationObserverTimer) {\n\t\t\t\t\tmutationObserverTimer = setTimeout(() => {\n\t\t\t\t\t\tmutationObserverTimer = undefined;\n\t\t\t\t\t\tif (invalidatedWebComponents.isEmpty()) {\n\t\t\t\t\t\t\t_resolveTaskPromise();\n\t\t\t\t\t\t}\n\t\t\t\t\t}, 200);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\tawait queuePromise;\n};\n\n/**\n * return a promise that will be resolved once all invalidated web components are rendered\n */\nconst whenDOMUpdated = () => {\n\tif (renderTaskPromise) {\n\t\treturn renderTaskPromise;\n\t}\n\n\trenderTaskPromise = new Promise<void>(resolve => {\n\t\trenderTaskPromiseResolve = resolve;\n\t\twindow.requestAnimationFrame(() => {\n\t\t\tif (invalidatedWebComponents.isEmpty()) {\n\t\t\t\trenderTaskPromise = undefined;\n\t\t\t\tresolve();\n\t\t\t}\n\t\t});\n\t});\n\n\treturn renderTaskPromise;\n};\n\nconst whenAllCustomElementsAreDefined = () => {\n\tconst definedPromises = getAllRegisteredTags().map(tag => customElements.whenDefined(tag));\n\treturn Promise.all(definedPromises);\n};\n\nconst renderFinished = async () => {\n\tawait whenAllCustomElementsAreDefined();\n\tawait whenDOMUpdated();\n};\n\nconst _resolveTaskPromise = () => {\n\tif (!invalidatedWebComponents.isEmpty()) {\n\t\t// More updates are pending. Resolve will be called again\n\t\treturn;\n\t}\n\n\tif (renderTaskPromiseResolve) {\n\t\trenderTaskPromiseResolve();\n\t\trenderTaskPromiseResolve = undefined;\n\t\trenderTaskPromise = undefined;\n\t}\n};\n\n/**\n * Re-renders all UI5 Elements on the page, with the option to specify filters to rerender only some components.\n *\n * Usage:\n * reRenderAllUI5Elements() -> re-renders all components\n * reRenderAllUI5Elements({tag: \"ui5-button\"}) -> re-renders only instances of ui5-button\n * reRenderAllUI5Elements({rtlAware: true}) -> re-renders only rtlAware components\n * reRenderAllUI5Elements({languageAware: true}) -> re-renders only languageAware components\n * reRenderAllUI5Elements({themeAware: true}) -> re-renders only themeAware components\n * reRenderAllUI5Elements({rtlAware: true, languageAware: true}) -> re-renders components that are rtlAware or languageAware\n * etc...\n *\n * @public\n * @param {object|undefined} filters - Object with keys that can be \"rtlAware\" or \"languageAware\"\n * @returns {Promise<void>}\n */\nconst reRenderAllUI5Elements = async (filters?: {tag?: string, rtlAware?: boolean, languageAware?: boolean, themeAware?: boolean}) => {\n\tregisteredElements.forEach((element: UI5Element) => {\n\t\tconst ctor = element.constructor as typeof UI5Element;\n\t\tconst tag = ctor.getMetadata().getTag();\n\t\tconst rtlAware = isRtlAware(ctor);\n\t\tconst languageAware = ctor.getMetadata().isLanguageAware();\n\t\tconst themeAware = ctor.getMetadata().isThemeAware();\n\t\tif (!filters || (filters.tag === tag) || (filters.rtlAware && rtlAware) || (filters.languageAware && languageAware) || (filters.themeAware && themeAware)) {\n\t\t\trenderDeferred(element);\n\t\t}\n\t});\n\tawait renderFinished();\n};\n\nconst attachBeforeComponentRender = (listener: BeforeComponentRenderCallback) => {\n\teventProvider.attachEvent(\"beforeComponentRender\", listener);\n};\n\nconst detachBeforeComponentRender = (listener: BeforeComponentRenderCallback) => {\n\teventProvider.detachEvent(\"beforeComponentRender\", listener);\n};\n\nexport {\n\trenderDeferred,\n\trenderImmediately,\n\tcancelRender,\n\trenderFinished,\n\treRenderAllUI5Elements,\n\tattachBeforeComponentRender,\n\tdetachBeforeComponentRender,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Render.js","sourceRoot":"","sources":["../src/Render.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAM1D,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAc,CAAC;AACjD,MAAM,aAAa,GAAG,IAAI,aAAa,EAAoB,CAAC;AAE5D,MAAM,wBAAwB,GAAG,IAAI,WAAW,EAAE,CAAC,CAAC,uCAAuC;AAE3F,IAAI,iBAA4C,EAC/C,wBAAoD,CAAC;AAEtD,IAAI,qBAA0C,CAAC;AAE/C,IAAI,YAAkC,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,cAAc,GAAG,KAAK,EAAE,YAAwB,EAAE,EAAE;IACzD,4BAA4B;IAC5B,wBAAwB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAE3C,4BAA4B;IAC5B,MAAM,kBAAkB,EAAE,CAAC;AAC5B,CAAC,CAAC;AAEF;;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AAsB,EACtB,2BAA2B,EAC3B,2BAA2B,GAC3B,CAAC","sourcesContent":["import EventProvider from \"./EventProvider.js\";\nimport RenderQueue from \"./RenderQueue.js\";\nimport { getAllRegisteredTags } from \"./CustomElementsRegistry.js\";\nimport { isRtlAware } from \"./locale/RTLAwareRegistry.js\";\nimport type UI5Element from \"./UI5Element.js\";\nimport 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"]}
|
package/dist/Runtimes.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
type RuntimeData = VersionInfo & {
|
|
2
2
|
alias: string;
|
|
3
3
|
description: string;
|
|
4
|
+
importMetaUrl: string;
|
|
4
5
|
};
|
|
5
6
|
/**
|
|
6
7
|
* Registers the current runtime in the shared runtimes resource registry
|
|
@@ -11,6 +12,10 @@ declare const registerCurrentRuntime: () => void;
|
|
|
11
12
|
* @returns {*}
|
|
12
13
|
*/
|
|
13
14
|
declare const getCurrentRuntimeIndex: () => number;
|
|
15
|
+
/**
|
|
16
|
+
* Compares two VersionInfo objects and returns 1 if the first is bigger, -1 if the second is bigger, and 0 if equal.
|
|
17
|
+
*/
|
|
18
|
+
declare const compareVersions: (v1: VersionInfo, v2: VersionInfo) => number;
|
|
14
19
|
/**
|
|
15
20
|
* 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
|
|
16
21
|
* @param index1 The index of the first runtime to compare
|
|
@@ -24,4 +29,4 @@ declare const compareRuntimes: (index1: number, index2: number) => number;
|
|
|
24
29
|
*/
|
|
25
30
|
declare const setRuntimeAlias: (alias: string) => void;
|
|
26
31
|
declare const getAllRuntimes: () => RuntimeData[];
|
|
27
|
-
export { getCurrentRuntimeIndex, registerCurrentRuntime, compareRuntimes, setRuntimeAlias, getAllRuntimes, };
|
|
32
|
+
export { getCurrentRuntimeIndex, registerCurrentRuntime, compareRuntimes, compareVersions, setRuntimeAlias, getAllRuntimes, };
|
package/dist/Runtimes.js
CHANGED
|
@@ -31,6 +31,7 @@ const registerCurrentRuntime = () => {
|
|
|
31
31
|
},
|
|
32
32
|
alias: currentRuntimeAlias,
|
|
33
33
|
description: `Runtime ${currentRuntimeIndex} - ver ${versionInfo.version}${currentRuntimeAlias ? ` (${currentRuntimeAlias})` : ""}`,
|
|
34
|
+
importMetaUrl: import.meta.url,
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
};
|
|
@@ -41,6 +42,28 @@ const registerCurrentRuntime = () => {
|
|
|
41
42
|
const getCurrentRuntimeIndex = () => {
|
|
42
43
|
return currentRuntimeIndex;
|
|
43
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* Compares two VersionInfo objects and returns 1 if the first is bigger, -1 if the second is bigger, and 0 if equal.
|
|
47
|
+
*/
|
|
48
|
+
const compareVersions = (v1, v2) => {
|
|
49
|
+
if (v1.isNext || v2.isNext) {
|
|
50
|
+
return v1.buildTime - v2.buildTime;
|
|
51
|
+
}
|
|
52
|
+
const majorDiff = v1.major - v2.major;
|
|
53
|
+
if (majorDiff) {
|
|
54
|
+
return majorDiff;
|
|
55
|
+
}
|
|
56
|
+
const minorDiff = v1.minor - v2.minor;
|
|
57
|
+
if (minorDiff) {
|
|
58
|
+
return minorDiff;
|
|
59
|
+
}
|
|
60
|
+
const patchDiff = v1.patch - v2.patch;
|
|
61
|
+
if (patchDiff) {
|
|
62
|
+
return patchDiff;
|
|
63
|
+
}
|
|
64
|
+
const collator = new Intl.Collator(undefined, { numeric: true, sensitivity: "base" });
|
|
65
|
+
return collator.compare(v1.suffix, v2.suffix);
|
|
66
|
+
};
|
|
44
67
|
/**
|
|
45
68
|
* 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
|
|
46
69
|
* @param index1 The index of the first runtime to compare
|
|
@@ -57,29 +80,7 @@ const compareRuntimes = (index1, index2) => {
|
|
|
57
80
|
if (!runtime1 || !runtime2) {
|
|
58
81
|
throw new Error("Invalid runtime index supplied");
|
|
59
82
|
}
|
|
60
|
-
|
|
61
|
-
if (runtime1.isNext || runtime2.isNext) {
|
|
62
|
-
return runtime1.buildTime - runtime2.buildTime;
|
|
63
|
-
}
|
|
64
|
-
// If major versions differ, bigger one wins
|
|
65
|
-
const majorDiff = runtime1.major - runtime2.major;
|
|
66
|
-
if (majorDiff) {
|
|
67
|
-
return majorDiff;
|
|
68
|
-
}
|
|
69
|
-
// If minor versions differ, bigger one wins
|
|
70
|
-
const minorDiff = runtime1.minor - runtime2.minor;
|
|
71
|
-
if (minorDiff) {
|
|
72
|
-
return minorDiff;
|
|
73
|
-
}
|
|
74
|
-
// If patch versions differ, bigger one wins
|
|
75
|
-
const patchDiff = runtime1.patch - runtime2.patch;
|
|
76
|
-
if (patchDiff) {
|
|
77
|
-
return patchDiff;
|
|
78
|
-
}
|
|
79
|
-
// Bigger suffix wins, f.e. rc10 > rc9
|
|
80
|
-
// Important: suffix is alphanumeric, must use natural compare
|
|
81
|
-
const collator = new Intl.Collator(undefined, { numeric: true, sensitivity: "base" });
|
|
82
|
-
const result = collator.compare(runtime1.suffix, runtime2.suffix);
|
|
83
|
+
const result = compareVersions(runtime1, runtime2);
|
|
83
84
|
compareCache.set(cacheIndex, result);
|
|
84
85
|
return result;
|
|
85
86
|
};
|
|
@@ -93,5 +94,5 @@ const setRuntimeAlias = (alias) => {
|
|
|
93
94
|
const getAllRuntimes = () => {
|
|
94
95
|
return Runtimes;
|
|
95
96
|
};
|
|
96
|
-
export { getCurrentRuntimeIndex, registerCurrentRuntime, compareRuntimes, setRuntimeAlias, getAllRuntimes, };
|
|
97
|
+
export { getCurrentRuntimeIndex, registerCurrentRuntime, compareRuntimes, compareVersions, setRuntimeAlias, getAllRuntimes, };
|
|
97
98
|
//# sourceMappingURL=Runtimes.js.map
|
package/dist/Runtimes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Runtimes.js","sourceRoot":"","sources":["../src/Runtimes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAC9G,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"Runtimes.js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IAElC,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,MAAM,GAAG,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAEnD,YAAY,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,MAAM,CAAC;AACf,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,EAAE;IACzC,mBAAmB,GAAG,KAAK,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,GAAG,EAAE;IAC3B,OAAO,QAAQ,CAAC;AACjB,CAAC,CAAC;AAEF,OAAO,EACN,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,eAAe,EACf,cAAc,GACd,CAAC","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"]}
|
package/dist/SystemCSSVars.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createOrUpdateStyle } from "./ManagedStyles.js";
|
|
2
2
|
import systemCSSVars from "./generated/css/SystemCSSVars.css.js";
|
|
3
3
|
const insertSystemCSSVars = () => {
|
|
4
|
-
|
|
5
|
-
createStyle(systemCSSVars, "data-ui5-system-css-vars");
|
|
6
|
-
}
|
|
4
|
+
createOrUpdateStyle(systemCSSVars, "data-ui5-system-css-vars");
|
|
7
5
|
};
|
|
8
6
|
export default insertSystemCSSVars;
|
|
9
7
|
//# sourceMappingURL=SystemCSSVars.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SystemCSSVars.js","sourceRoot":"","sources":["../src/SystemCSSVars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SystemCSSVars.js","sourceRoot":"","sources":["../src/SystemCSSVars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,aAAa,MAAM,sCAAsC,CAAC;AAEjE,MAAM,mBAAmB,GAAG,GAAG,EAAE;IAChC,mBAAmB,CAAC,aAAa,EAAE,0BAA0B,CAAC,CAAC;AAChE,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","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"]}
|
package/dist/UI5Element.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@ui5/webcomponents-base/dist/ssr-dom.js";
|
|
2
2
|
import type { JSX } from "./jsx-runtime.js";
|
|
3
3
|
import UI5ElementMetadata from "./UI5ElementMetadata.js";
|
|
4
|
-
import type { Slot, SlotValue, State, PropertyValue, Metadata } from "./UI5ElementMetadata.js";
|
|
4
|
+
import type { Slot as SlotMetadata, SlotValue, State, PropertyValue, Metadata } from "./UI5ElementMetadata.js";
|
|
5
5
|
import EventProvider from "./EventProvider.js";
|
|
6
6
|
import type { TemplateFunction } from "./renderer/executeTemplate.js";
|
|
7
7
|
import type { AccessibilityInfo, PromiseResolve, ComponentStylesData, ClassMap } from "./types.js";
|
|
@@ -38,6 +38,22 @@ type TargetedEventHandler<D, T> = {
|
|
|
38
38
|
type Convert<T, K extends UI5Element> = {
|
|
39
39
|
[Property in keyof T as `on${KebabToPascal<string & Property>}`]: IsAny<T[Property], any, TargetedEventHandler<T[Property], K>>;
|
|
40
40
|
};
|
|
41
|
+
declare const SlotMarker: unique symbol;
|
|
42
|
+
declare const DefaultSlotMarker: unique symbol;
|
|
43
|
+
export type Slot<T> = T[] & {
|
|
44
|
+
[SlotMarker]: true;
|
|
45
|
+
};
|
|
46
|
+
export type DefaultSlot<T> = T[] & {
|
|
47
|
+
[DefaultSlotMarker]: true;
|
|
48
|
+
};
|
|
49
|
+
export type IsSlot<T> = T extends {
|
|
50
|
+
[SlotMarker]: true;
|
|
51
|
+
} ? true : T extends {
|
|
52
|
+
[DefaultSlotMarker]: true;
|
|
53
|
+
} ? true : false;
|
|
54
|
+
export type IsDefaultSlot<T> = T extends {
|
|
55
|
+
[DefaultSlotMarker]: true;
|
|
56
|
+
} ? true : false;
|
|
41
57
|
/**
|
|
42
58
|
* @class
|
|
43
59
|
* Base class for all UI5 Web Components
|
|
@@ -84,9 +100,7 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
84
100
|
*/
|
|
85
101
|
_onShadowRootSlotChange(e: Event): void;
|
|
86
102
|
/**
|
|
87
|
-
* Returns a unique ID for this UI5 Element
|
|
88
|
-
*
|
|
89
|
-
* @deprecated - This property is not guaranteed in future releases
|
|
103
|
+
* Returns a unique ID for this UI5 Element.
|
|
90
104
|
* @protected
|
|
91
105
|
*/
|
|
92
106
|
get _id(): string;
|
|
@@ -96,6 +110,7 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
96
110
|
* @private
|
|
97
111
|
*/
|
|
98
112
|
connectedCallback(): Promise<void>;
|
|
113
|
+
get definePromise(): Promise<void>;
|
|
99
114
|
/**
|
|
100
115
|
* Do not call this method from derivatives of UI5Element, use "onExitDOM" only
|
|
101
116
|
* @private
|
|
@@ -142,7 +157,7 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
142
157
|
* Removes all children from the slot and detaches listeners, if any
|
|
143
158
|
* @private
|
|
144
159
|
*/
|
|
145
|
-
_clearSlot(slotName: string, slotData:
|
|
160
|
+
_clearSlot(slotName: string, slotData: SlotMetadata): void;
|
|
146
161
|
/**
|
|
147
162
|
* Attach a callback that will be executed whenever the component is invalidated
|
|
148
163
|
*
|
|
@@ -338,7 +353,18 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
338
353
|
get isUI5AbstractElement(): boolean;
|
|
339
354
|
get classes(): ClassMap;
|
|
340
355
|
/**
|
|
341
|
-
*
|
|
356
|
+
* Provides the accessibility information for the component.
|
|
357
|
+
*
|
|
358
|
+
* **Note:** The default implementation returns `undefined`, indicating that
|
|
359
|
+
* the component does not provide any accessibility metadata by default. In such cases,
|
|
360
|
+
* consumers of this API may apply their own fallback if needed.
|
|
361
|
+
*
|
|
362
|
+
* Subclasses overriding this getter must return an object of type `AccessibilityInfo`
|
|
363
|
+
* describing the component's accessible name, role, description, and other relevant properties.
|
|
364
|
+
*
|
|
365
|
+
* If the component is intentionally decorative and should be ignored by assistive
|
|
366
|
+
* technologies, return an empty object `{}`.
|
|
367
|
+
*
|
|
342
368
|
* @private
|
|
343
369
|
*/
|
|
344
370
|
get accessibilityInfo(): AccessibilityInfo | undefined;
|
|
@@ -397,7 +423,7 @@ declare abstract class UI5Element extends HTMLElement {
|
|
|
397
423
|
static fetchI18nBundles(): Promise<I18nBundle[]>;
|
|
398
424
|
static fetchCLDR(): Promise<void>;
|
|
399
425
|
static asyncFinished: boolean;
|
|
400
|
-
static
|
|
426
|
+
static _definePromise: Promise<void> | undefined;
|
|
401
427
|
static i18nBundleStorage: Record<string, I18nBundle>;
|
|
402
428
|
static get i18nBundles(): Record<string, I18nBundle>;
|
|
403
429
|
/**
|
package/dist/UI5Element.js
CHANGED
|
@@ -6,7 +6,7 @@ import UI5ElementMetadata from "./UI5ElementMetadata.js";
|
|
|
6
6
|
import EventProvider from "./EventProvider.js";
|
|
7
7
|
import updateShadowRoot from "./updateShadowRoot.js";
|
|
8
8
|
import { shouldIgnoreCustomElement } from "./IgnoreCustomElements.js";
|
|
9
|
-
import { renderDeferred, renderImmediately, cancelRender, } from "./Render.js";
|
|
9
|
+
import { renderDeferred, renderImmediately, cancelRender, unregisterElement, registerElement, } from "./Render.js";
|
|
10
10
|
import { registerTag, isTagRegistered, recordTagRegistrationFailure } from "./CustomElementsRegistry.js";
|
|
11
11
|
import { observeDOMNode, unobserveDOMNode } from "./DOMObserver.js";
|
|
12
12
|
import { skipOriginalEvent } from "./config/NoConflict.js";
|
|
@@ -23,6 +23,7 @@ import { getI18nBundle } from "./i18nBundle.js";
|
|
|
23
23
|
import { fetchCldr } from "./asset-registries/LocaleData.js";
|
|
24
24
|
import getLocale from "./locale/getLocale.js";
|
|
25
25
|
import { getLanguageChangePending } from "./config/Language.js";
|
|
26
|
+
import createInstanceChecker from "./util/createInstanceChecker.js";
|
|
26
27
|
const DEV_MODE = true;
|
|
27
28
|
let autoId = 0;
|
|
28
29
|
const elementTimeouts = new Map();
|
|
@@ -35,6 +36,14 @@ const defaultConverter = {
|
|
|
35
36
|
if (type === Number) {
|
|
36
37
|
return value === null ? undefined : parseFloat(value);
|
|
37
38
|
}
|
|
39
|
+
if (type === Object || type === Array) {
|
|
40
|
+
try {
|
|
41
|
+
return JSON.parse(value);
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
38
47
|
return value;
|
|
39
48
|
},
|
|
40
49
|
toAttribute(value, type) {
|
|
@@ -43,7 +52,7 @@ const defaultConverter = {
|
|
|
43
52
|
}
|
|
44
53
|
// don't set attributes for arrays and objects
|
|
45
54
|
if (type === Object || type === Array) {
|
|
46
|
-
return
|
|
55
|
+
return JSON.stringify(value);
|
|
47
56
|
}
|
|
48
57
|
// object, array, other
|
|
49
58
|
if (value === null || value === undefined) {
|
|
@@ -164,9 +173,7 @@ class UI5Element extends HTMLElement {
|
|
|
164
173
|
}
|
|
165
174
|
}
|
|
166
175
|
/**
|
|
167
|
-
* Returns a unique ID for this UI5 Element
|
|
168
|
-
*
|
|
169
|
-
* @deprecated - This property is not guaranteed in future releases
|
|
176
|
+
* Returns a unique ID for this UI5 Element.
|
|
170
177
|
* @protected
|
|
171
178
|
*/
|
|
172
179
|
get _id() {
|
|
@@ -195,6 +202,7 @@ class UI5Element extends HTMLElement {
|
|
|
195
202
|
}
|
|
196
203
|
}
|
|
197
204
|
const ctor = this.constructor;
|
|
205
|
+
registerElement(this);
|
|
198
206
|
this.setAttribute(ctor.getMetadata().getPureTag(), "");
|
|
199
207
|
if (ctor.getMetadata().supportsF6FastNavigation() && !this.hasAttribute("data-sap-ui-fastnavgroup")) {
|
|
200
208
|
this.setAttribute("data-sap-ui-fastnavgroup", "true");
|
|
@@ -207,7 +215,12 @@ class UI5Element extends HTMLElement {
|
|
|
207
215
|
await this._processChildren();
|
|
208
216
|
}
|
|
209
217
|
if (!ctor.asyncFinished) {
|
|
210
|
-
await ctor.
|
|
218
|
+
await ctor._definePromise;
|
|
219
|
+
}
|
|
220
|
+
// Skip rendering while a language change is in progress to avoid rendering with not fully loaded locale data.
|
|
221
|
+
// Once the locale data is loaded, the language-aware component will be re-rendered.
|
|
222
|
+
if (ctor.getMetadata().isLanguageAware() && getLanguageChangePending()) {
|
|
223
|
+
return;
|
|
211
224
|
}
|
|
212
225
|
if (!this._inDOM) { // Component removed from DOM while _processChildren was running
|
|
213
226
|
return;
|
|
@@ -216,6 +229,22 @@ class UI5Element extends HTMLElement {
|
|
|
216
229
|
this._domRefReadyPromise._deferredResolve();
|
|
217
230
|
this._fullyConnected = true;
|
|
218
231
|
this.onEnterDOM();
|
|
232
|
+
if (this.hasAttribute("autofocus")) {
|
|
233
|
+
// Honor the global `autofocus` HTML attribute. Done manually because
|
|
234
|
+
// Firefox/Safari close the autofocus window at end-of-parse, before
|
|
235
|
+
// async UI5 components have rendered their shadow DOM. Per HTML spec,
|
|
236
|
+
// only the first element with `autofocus` in document order wins.
|
|
237
|
+
requestAnimationFrame(() => {
|
|
238
|
+
this.focus();
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
get definePromise() {
|
|
243
|
+
const ctor = this.constructor;
|
|
244
|
+
if (!ctor.asyncFinished && ctor._definePromise) {
|
|
245
|
+
return ctor._definePromise;
|
|
246
|
+
}
|
|
247
|
+
return Promise.resolve();
|
|
219
248
|
}
|
|
220
249
|
/**
|
|
221
250
|
* Do not call this method from derivatives of UI5Element, use "onExitDOM" only
|
|
@@ -234,6 +263,7 @@ class UI5Element extends HTMLElement {
|
|
|
234
263
|
}
|
|
235
264
|
this._domRefReadyPromise._deferredResolve();
|
|
236
265
|
cancelRender(this);
|
|
266
|
+
unregisterElement(this);
|
|
237
267
|
}
|
|
238
268
|
/**
|
|
239
269
|
* Called every time before the component renders.
|
|
@@ -308,7 +338,7 @@ class UI5Element extends HTMLElement {
|
|
|
308
338
|
}
|
|
309
339
|
const autoIncrementMap = new Map();
|
|
310
340
|
const slottedChildrenMap = new Map();
|
|
311
|
-
|
|
341
|
+
domChildren.forEach((child, idx) => {
|
|
312
342
|
// Determine the type of the child (mainly by the slot attribute)
|
|
313
343
|
const slotName = getSlotName(child);
|
|
314
344
|
const slotData = slotsMap[slotName];
|
|
@@ -320,6 +350,28 @@ class UI5Element extends HTMLElement {
|
|
|
320
350
|
}
|
|
321
351
|
return;
|
|
322
352
|
}
|
|
353
|
+
const propertyName = slotData.propertyName || slotName;
|
|
354
|
+
if (slottedChildrenMap.has(propertyName)) {
|
|
355
|
+
slottedChildrenMap.get(propertyName).push({ child, idx });
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
slottedChildrenMap.set(propertyName, [{ child, idx }]);
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
// Distribute the child in the _state object, keeping the Light DOM order,
|
|
362
|
+
// not the order elements are defined.
|
|
363
|
+
slottedChildrenMap.forEach((children, propertyName) => {
|
|
364
|
+
this._state[propertyName] = children.sort((a, b) => a.idx - b.idx).map(_ => _.child);
|
|
365
|
+
this._state[kebabToCamelCase(propertyName)] = this._state[propertyName];
|
|
366
|
+
});
|
|
367
|
+
const allChildrenUpgraded = domChildren.map(async (child) => {
|
|
368
|
+
// Determine the type of the child (mainly by the slot attribute)
|
|
369
|
+
const slotName = getSlotName(child);
|
|
370
|
+
const slotData = slotsMap[slotName];
|
|
371
|
+
// Check if the slotName is supported
|
|
372
|
+
if (slotData === undefined) {
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
323
375
|
// For children that need individual slots, calculate them
|
|
324
376
|
if (slotData.individualSlots) {
|
|
325
377
|
const nextIndex = (autoIncrementMap.get(slotName) || 0) + 1;
|
|
@@ -354,21 +406,8 @@ class UI5Element extends HTMLElement {
|
|
|
354
406
|
if (child instanceof HTMLSlotElement) {
|
|
355
407
|
this._attachSlotChange(child, slotName, !!slotData.invalidateOnChildChange);
|
|
356
408
|
}
|
|
357
|
-
const propertyName = slotData.propertyName || slotName;
|
|
358
|
-
if (slottedChildrenMap.has(propertyName)) {
|
|
359
|
-
slottedChildrenMap.get(propertyName).push({ child, idx });
|
|
360
|
-
}
|
|
361
|
-
else {
|
|
362
|
-
slottedChildrenMap.set(propertyName, [{ child, idx }]);
|
|
363
|
-
}
|
|
364
409
|
});
|
|
365
410
|
await Promise.all(allChildrenUpgraded);
|
|
366
|
-
// Distribute the child in the _state object, keeping the Light DOM order,
|
|
367
|
-
// not the order elements are defined.
|
|
368
|
-
slottedChildrenMap.forEach((children, propertyName) => {
|
|
369
|
-
this._state[propertyName] = children.sort((a, b) => a.idx - b.idx).map(_ => _.child);
|
|
370
|
-
this._state[kebabToCamelCase(propertyName)] = this._state[propertyName];
|
|
371
|
-
});
|
|
372
411
|
// Compare the content of each slot with the cached values and invalidate for the ones that changed
|
|
373
412
|
let invalidated = false;
|
|
374
413
|
for (const [slotName, slotData] of Object.entries(slotsMap)) { // eslint-disable-line
|
|
@@ -885,7 +924,18 @@ class UI5Element extends HTMLElement {
|
|
|
885
924
|
return {};
|
|
886
925
|
}
|
|
887
926
|
/**
|
|
888
|
-
*
|
|
927
|
+
* Provides the accessibility information for the component.
|
|
928
|
+
*
|
|
929
|
+
* **Note:** The default implementation returns `undefined`, indicating that
|
|
930
|
+
* the component does not provide any accessibility metadata by default. In such cases,
|
|
931
|
+
* consumers of this API may apply their own fallback if needed.
|
|
932
|
+
*
|
|
933
|
+
* Subclasses overriding this getter must return an object of type `AccessibilityInfo`
|
|
934
|
+
* describing the component's accessible name, role, description, and other relevant properties.
|
|
935
|
+
*
|
|
936
|
+
* If the component is intentionally decorative and should be ignored by assistive
|
|
937
|
+
* technologies, return an empty object `{}`.
|
|
938
|
+
*
|
|
889
939
|
* @private
|
|
890
940
|
*/
|
|
891
941
|
get accessibilityInfo() {
|
|
@@ -1078,7 +1128,7 @@ class UI5Element extends HTMLElement {
|
|
|
1078
1128
|
});
|
|
1079
1129
|
this.asyncFinished = true;
|
|
1080
1130
|
};
|
|
1081
|
-
this.
|
|
1131
|
+
this._definePromise = defineSequence();
|
|
1082
1132
|
const tag = this.getMetadata().getTag();
|
|
1083
1133
|
const definedLocally = isTagRegistered(tag);
|
|
1084
1134
|
const definedGlobally = customElements.get(tag);
|
|
@@ -1130,9 +1180,7 @@ UI5Element.i18nBundleStorage = {};
|
|
|
1130
1180
|
/**
|
|
1131
1181
|
* Always use duck-typing to cover all runtimes on the page.
|
|
1132
1182
|
*/
|
|
1133
|
-
const instanceOfUI5Element = (
|
|
1134
|
-
return "isUI5Element" in object;
|
|
1135
|
-
};
|
|
1183
|
+
const instanceOfUI5Element = createInstanceChecker("isUI5Element");
|
|
1136
1184
|
export default UI5Element;
|
|
1137
1185
|
export { instanceOfUI5Element, };
|
|
1138
1186
|
//# sourceMappingURL=UI5Element.js.map
|