@ui5/webcomponents-base 2.3.0-rc.3 → 2.3.1-rc.0

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.
Files changed (162) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/.tsbuildinfobuild +1 -1
  3. package/dist/Boot.js +2 -0
  4. package/dist/Boot.js.map +1 -1
  5. package/dist/CustomElementsRegistry.js.map +1 -1
  6. package/dist/CustomElementsScopeUtils.js.map +1 -1
  7. package/dist/DOMObserver.js.map +1 -1
  8. package/dist/Device.js.map +1 -1
  9. package/dist/EventProvider.js.map +1 -1
  10. package/dist/FeaturesRegistry.d.ts +3 -0
  11. package/dist/FeaturesRegistry.js.map +1 -1
  12. package/dist/FontFace.js.map +1 -1
  13. package/dist/IgnoreCustomElements.js.map +1 -1
  14. package/dist/InitialConfiguration.js +1 -1
  15. package/dist/InitialConfiguration.js.map +1 -1
  16. package/dist/Keys.js.map +1 -1
  17. package/dist/Location.js.map +1 -1
  18. package/dist/ManagedStyles.js.map +1 -1
  19. package/dist/MediaRange.js.map +1 -1
  20. package/dist/PropertiesFileFormat.js.map +1 -1
  21. package/dist/Render.js.map +1 -1
  22. package/dist/RenderQueue.js.map +1 -1
  23. package/dist/Runtimes.js.map +1 -1
  24. package/dist/SystemCSSVars.js.map +1 -1
  25. package/dist/UI5Element.d.ts +6 -3
  26. package/dist/UI5Element.js +28 -4
  27. package/dist/UI5Element.js.map +1 -1
  28. package/dist/UI5ElementMetadata.d.ts +13 -0
  29. package/dist/UI5ElementMetadata.js +12 -0
  30. package/dist/UI5ElementMetadata.js.map +1 -1
  31. package/dist/animations/AnimationQueue.js.map +1 -1
  32. package/dist/animations/animate.js.map +1 -1
  33. package/dist/animations/slideUp.js.map +1 -1
  34. package/dist/asset-registries/Icons.js.map +1 -1
  35. package/dist/asset-registries/Illustrations.js.map +1 -1
  36. package/dist/asset-registries/LocaleData.js.map +1 -1
  37. package/dist/asset-registries/Themes.js.map +1 -1
  38. package/dist/asset-registries/i18n.js.map +1 -1
  39. package/dist/asset-registries/util/IconCollectionsAlias.js.map +1 -1
  40. package/dist/asset-registries/util/IconCollectionsByTheme.js.map +1 -1
  41. package/dist/asset-registries/util/getIconCollectionByTheme.js.map +1 -1
  42. package/dist/config/AnimationMode.js.map +1 -1
  43. package/dist/config/CalendarType.js.map +1 -1
  44. package/dist/config/Fonts.js.map +1 -1
  45. package/dist/config/FormatSettings.js.map +1 -1
  46. package/dist/config/Language.js.map +1 -1
  47. package/dist/config/NoConflict.js.map +1 -1
  48. package/dist/config/Theme.js.map +1 -1
  49. package/dist/config/ThemeRoot.js.map +1 -1
  50. package/dist/config/Timezone.js.map +1 -1
  51. package/dist/config/Tooltips.js.map +1 -1
  52. package/dist/connectToComponent.js.map +1 -1
  53. package/dist/converters/DOMReference.js.map +1 -1
  54. package/dist/custom-elements-internal.json +31 -1
  55. package/dist/custom-elements.json +31 -1
  56. package/dist/decorators/customElement.d.ts +1 -0
  57. package/dist/decorators/customElement.js +4 -1
  58. package/dist/decorators/customElement.js.map +1 -1
  59. package/dist/decorators/event.d.ts +1 -1
  60. package/dist/decorators/event.js.map +1 -1
  61. package/dist/decorators/i18n.d.ts +17 -0
  62. package/dist/decorators/i18n.js +26 -0
  63. package/dist/decorators/i18n.js.map +1 -0
  64. package/dist/decorators/property.js.map +1 -1
  65. package/dist/decorators/query.d.ts +1 -1
  66. package/dist/decorators/query.js.map +1 -1
  67. package/dist/decorators/queryAll.d.ts +1 -1
  68. package/dist/decorators/queryAll.js.map +1 -1
  69. package/dist/decorators/slot.js.map +1 -1
  70. package/dist/delegate/ItemNavigation.js.map +1 -1
  71. package/dist/delegate/ResizeHandler.js.map +1 -1
  72. package/dist/delegate/ScrollEnablement.js.map +1 -1
  73. package/dist/features/F6Navigation.js.map +1 -1
  74. package/dist/features/InputElementsFormSupport.js.map +1 -1
  75. package/dist/features/LegacyDateFormats.js.map +1 -1
  76. package/dist/features/OpenUI5Enablement.js.map +1 -1
  77. package/dist/features/OpenUI5Support.js.map +1 -1
  78. package/dist/features/patchPatcher.js.map +1 -1
  79. package/dist/features/patchPopup.d.ts +1 -1
  80. package/dist/features/patchPopup.js +2 -2
  81. package/dist/features/patchPopup.js.map +1 -1
  82. package/dist/generated/VersionInfo.js +4 -4
  83. package/dist/generated/VersionInfo.js.map +1 -1
  84. package/dist/getSharedResource.js.map +1 -1
  85. package/dist/i18nBundle.js.map +1 -1
  86. package/dist/locale/Locale.js.map +1 -1
  87. package/dist/locale/getEffectiveDir.js.map +1 -1
  88. package/dist/locale/getLocale.js.map +1 -1
  89. package/dist/locale/nextFallbackLocale.js.map +1 -1
  90. package/dist/locale/normalizeLocale.js.map +1 -1
  91. package/dist/prod/Boot.js +1 -1
  92. package/dist/prod/Boot.js.map +3 -3
  93. package/dist/prod/FeaturesRegistry.js.map +2 -2
  94. package/dist/prod/UI5Element.js +1 -1
  95. package/dist/prod/UI5Element.js.map +3 -3
  96. package/dist/prod/UI5ElementMetadata.js +1 -1
  97. package/dist/prod/UI5ElementMetadata.js.map +2 -2
  98. package/dist/prod/decorators/customElement.js +1 -1
  99. package/dist/prod/decorators/customElement.js.map +3 -3
  100. package/dist/prod/decorators/i18n.js +2 -0
  101. package/dist/prod/decorators/i18n.js.map +7 -0
  102. package/dist/prod/decorators/query.js.map +1 -1
  103. package/dist/prod/decorators/queryAll.js.map +1 -1
  104. package/dist/prod/features/patchPopup.js +1 -1
  105. package/dist/prod/features/patchPopup.js.map +2 -2
  106. package/dist/prod/generated/VersionInfo.js +1 -1
  107. package/dist/prod/generated/VersionInfo.js.map +1 -1
  108. package/dist/prod/util/fixSafariActiveState.js +2 -0
  109. package/dist/prod/util/fixSafariActiveState.js.map +7 -0
  110. package/dist/renderer/LitRenderer.js.map +1 -1
  111. package/dist/renderer/directives/style-map.js.map +1 -1
  112. package/dist/renderer/executeTemplate.js.map +1 -1
  113. package/dist/ssr-dom.d.ts +1 -0
  114. package/dist/ssr-dom.js +1 -1
  115. package/dist/theming/CustomStyle.js.map +1 -1
  116. package/dist/theming/applyTheme.js +1 -1
  117. package/dist/theming/applyTheme.js.map +1 -1
  118. package/dist/theming/getConstructableStyle.js.map +1 -1
  119. package/dist/theming/getEffectiveStyle.js.map +1 -1
  120. package/dist/theming/getStylesString.js.map +1 -1
  121. package/dist/theming/getThemeDesignerTheme.js.map +1 -1
  122. package/dist/thirdparty/_merge.js.map +1 -1
  123. package/dist/thirdparty/isPlainObject.js.map +1 -1
  124. package/dist/updateShadowRoot.js.map +1 -1
  125. package/dist/util/AriaLabelHelper.js.map +1 -1
  126. package/dist/util/Caret.js.map +1 -1
  127. package/dist/util/ColorConversion.js.map +1 -1
  128. package/dist/util/FetchHelper.js.map +1 -1
  129. package/dist/util/FocusableElements.js.map +1 -1
  130. package/dist/util/InvisibleMessage.js.map +1 -1
  131. package/dist/util/PopupUtils.js.map +1 -1
  132. package/dist/util/SelectionAssistant.js.map +1 -1
  133. package/dist/util/SlotsHelper.js.map +1 -1
  134. package/dist/util/StringHelper.js.map +1 -1
  135. package/dist/util/TabbableElements.js.map +1 -1
  136. package/dist/util/arraysAreEqual.js.map +1 -1
  137. package/dist/util/createLinkInHead.js.map +1 -1
  138. package/dist/util/detectNavigatorLanguage.js.map +1 -1
  139. package/dist/util/dragAndDrop/DragRegistry.js.map +1 -1
  140. package/dist/util/dragAndDrop/findClosestPosition.js.map +1 -1
  141. package/dist/util/dragAndDrop/longDragOverHandler.js.map +1 -1
  142. package/dist/util/fixSafariActiveState.d.ts +2 -0
  143. package/dist/util/fixSafariActiveState.js +11 -0
  144. package/dist/util/fixSafariActiveState.js.map +1 -0
  145. package/dist/util/formatMessage.js.map +1 -1
  146. package/dist/util/generateHighlightedMarkup.js.map +1 -1
  147. package/dist/util/getActiveElement.js.map +1 -1
  148. package/dist/util/getClassCopy.d.ts +72 -63
  149. package/dist/util/getEffectiveScrollbarStyle.js.map +1 -1
  150. package/dist/util/getFastNavigationGroups.js.map +1 -1
  151. package/dist/util/getFileExtension.js.map +1 -1
  152. package/dist/util/getNormalizedTarget.js.map +1 -1
  153. package/dist/util/getSingletonElementInstance.js.map +1 -1
  154. package/dist/util/isElementClickable.js.map +1 -1
  155. package/dist/util/isElementHidden.js.map +1 -1
  156. package/dist/util/isElementTabbable.js.map +1 -1
  157. package/dist/util/isValidPropertyName.js.map +1 -1
  158. package/dist/util/whenDOMReady.js.map +1 -1
  159. package/dist/validateThemeRoot.js.map +1 -1
  160. package/dist/vscode.html-custom-data.json +1 -1
  161. package/package-scripts.cjs +1 -1
  162. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"animate.js","sourceRoot":"","sources":["../../src/animations/animate.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,qBAAqB,CAAC;AASjD,MAAM,OAAO,GAAG,CAAC,OAAuB,EAAE,EAAE;IAC3C,IAAI,KAAK,GAAkB,IAAI,CAAC;IAChC,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,cAAsB,CAAC;IAC3B,IAAI,IAAgB,CAAC;IACrB,IAAI,gBAA6C,CAAC;IAElD,MAAM,OAAO,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrD,gBAAgB,GAAG,SAAS,CAAC,EAAE;YAC9B,KAAK,GAAG,KAAK,IAAI,SAAS,CAAC;YAE3B,MAAM,WAAW,GAAG,SAAS,GAAG,KAAK,CAAC;YACtC,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,GAAG,WAAW,CAAC;YAEjD,IAAI,WAAW,IAAI,OAAO,CAAC,QAAQ,EAAE;gBACpC,MAAM,cAAc,GAAG,CAAC,GAAG,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,oCAAoC;gBAC7F,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;gBAChC,IAAI,CAAC,OAAO,EAAE;oBACb,cAAc,GAAG,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;iBACzD;aACD;iBAAM;gBACN,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;gBACnB,OAAO,EAAE,CAAC;aACV;QACF,CAAC,CAAC;QAEF,IAAI,GAAG,GAAG,EAAE;YACX,OAAO,GAAG,IAAI,CAAC;YACf,oBAAoB,CAAC,cAAc,CAAC,CAAC;YACrC,MAAM,CAAC,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC;QACxC,CAAC,CAAC;IACH,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAa,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;IAEpC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE;QACzC,IAAI,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU,EAAE;YAC9C,OAAO,CAAC,WAAW,EAAE,CAAC;SACtB;QAED,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;QAExC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YAC5B,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO;QACN,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO;QACtB,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI;KAChB,CAAC;AACH,CAAC,CAAC;AACF,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,eAAe,OAAO,CAAC","sourcesContent":["import AnimationQueue from \"./AnimationQueue.js\";\n\ntype AnimateOptions = {\n\tbeforeStart?: () => void,\n\tduration: number,\n\telement: HTMLElement,\n\tadvance: (p: number) => void,\n};\n\nconst animate = (options: AnimateOptions) => {\n\tlet start: number | null = null;\n\tlet stopped = false;\n\tlet animationFrame: number;\n\tlet stop: () => void;\n\tlet advanceAnimation: (timestamp: number) => void;\n\n\tconst promise = new Promise<void>((resolve, reject) => {\n\t\tadvanceAnimation = timestamp => {\n\t\t\tstart = start || timestamp;\n\n\t\t\tconst timeElapsed = timestamp - start;\n\t\t\tconst remaining = options.duration - timeElapsed;\n\n\t\t\tif (timeElapsed <= options.duration) {\n\t\t\t\tconst currentAdvance = 1 - remaining / options.duration; // easing formula (currently linear)\n\t\t\t\toptions.advance(currentAdvance);\n\t\t\t\tif (!stopped) {\n\t\t\t\t\tanimationFrame = requestAnimationFrame(advanceAnimation);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toptions.advance(1);\n\t\t\t\tresolve();\n\t\t\t}\n\t\t};\n\n\t\tstop = () => {\n\t\t\tstopped = true;\n\t\t\tcancelAnimationFrame(animationFrame);\n\t\t\treject(new Error(\"animation stopped\"));\n\t\t};\n\t}).catch((reason: Error) => reason);\n\n\tAnimationQueue.push(options.element, () => {\n\t\tif (typeof options.beforeStart === \"function\") {\n\t\t\toptions.beforeStart();\n\t\t}\n\n\t\trequestAnimationFrame(advanceAnimation);\n\n\t\treturn new Promise(resolve => {\n\t\t\tpromise.then(() => resolve());\n\t\t});\n\t});\n\n\treturn {\n\t\tpromise: () => promise,\n\t\tstop: () => stop,\n\t};\n};\nconst duration = 400;\n\nexport { duration };\nexport type { AnimateOptions };\nexport default animate;\n"]}
1
+ {"version":3,"file":"animate.js","sourceRoot":"","sources":["../../src/animations/animate.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,qBAAqB,CAAC;AASjD,MAAM,OAAO,GAAG,CAAC,OAAuB,EAAE,EAAE;IAC3C,IAAI,KAAK,GAAkB,IAAI,CAAC;IAChC,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,cAAsB,CAAC;IAC3B,IAAI,IAAgB,CAAC;IACrB,IAAI,gBAA6C,CAAC;IAElD,MAAM,OAAO,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrD,gBAAgB,GAAG,SAAS,CAAC,EAAE;YAC9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O;QACN,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO;QACtB,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI;KAChB,CAAC;AACH,CAAC,CAAC;AACF,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,eAAe,OAAO,CAAC","sourcesContent":["import AnimationQueue from \"./AnimationQueue.js\";\n\ntype AnimateOptions = {\n\tbeforeStart?: () => void,\n\tduration: number,\n\telement: HTMLElement,\n\tadvance: (p: number) => void,\n};\n\nconst animate = (options: AnimateOptions) => {\n\tlet start: number | null = null;\n\tlet stopped = false;\n\tlet animationFrame: number;\n\tlet stop: () => void;\n\tlet advanceAnimation: (timestamp: number) => void;\n\n\tconst promise = new Promise<void>((resolve, reject) => {\n\t\tadvanceAnimation = timestamp => {\n\t\t\tstart = start || timestamp;\n\n\t\t\tconst timeElapsed = timestamp - start;\n\t\t\tconst remaining = options.duration - timeElapsed;\n\n\t\t\tif (timeElapsed <= options.duration) {\n\t\t\t\tconst currentAdvance = 1 - remaining / options.duration; // easing formula (currently linear)\n\t\t\t\toptions.advance(currentAdvance);\n\t\t\t\tif (!stopped) {\n\t\t\t\t\tanimationFrame = requestAnimationFrame(advanceAnimation);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toptions.advance(1);\n\t\t\t\tresolve();\n\t\t\t}\n\t\t};\n\n\t\tstop = () => {\n\t\t\tstopped = true;\n\t\t\tcancelAnimationFrame(animationFrame);\n\t\t\treject(new Error(\"animation stopped\"));\n\t\t};\n\t}).catch((reason: Error) => reason);\n\n\tAnimationQueue.push(options.element, () => {\n\t\tif (typeof options.beforeStart === \"function\") {\n\t\t\toptions.beforeStart();\n\t\t}\n\n\t\trequestAnimationFrame(advanceAnimation);\n\n\t\treturn new Promise(resolve => {\n\t\t\tpromise.then(() => resolve());\n\t\t});\n\t});\n\n\treturn {\n\t\tpromise: () => promise,\n\t\tstop: () => stop,\n\t};\n};\nconst duration = 400;\n\nexport { duration };\nexport type { AnimateOptions };\nexport default animate;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"slideUp.js","sourceRoot":"","sources":["../../src/animations/slideUp.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,GAAG,CAAC,OAAoB,EAAE,EAAE;IACxC,sBAAsB;IACtB,IAAI,cAAmC,EACtC,UAAkB,EAClB,aAAqB,EACrB,SAAiB,EACjB,YAAoB,EACpB,MAAc,CAAC;IAEhB,sBAAsB;IACtB,IAAI,cAAsB,EACzB,gBAAwB,EACxB,mBAA2B,EAC3B,eAAuB,EACvB,kBAA0B,EAC1B,YAAoB,CAAC;IAEtB,MAAM,SAAS,GAAG,OAAO,CAAC;QACzB,WAAW,EAAE,GAAG,EAAE;YACjB,sBAAsB;YACtB,MAAM,EAAE,GAAG,OAAO,CAAC;YACnB,cAAc,GAAG,gBAAgB,CAAC,EAAE,CAAC,CAAC;YACtC,UAAU,GAAG,UAAU,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;YACnD,aAAa,GAAG,UAAU,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;YACzD,SAAS,GAAG,UAAU,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;YACjD,YAAY,GAAG,UAAU,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;YACvD,MAAM,GAAG,UAAU,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YAE3C,sBAAsB;YACtB,cAAc,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC;YACnC,gBAAgB,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC;YACvC,mBAAmB,GAAG,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC;YAC7C,eAAe,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;YACrC,kBAAkB,GAAG,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC;YAC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AM,CAAC;SAC/B;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AAClB,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import animate, { duration } from \"./animate.js\";\n\nconst slideUp = (element: HTMLElement) => {\n\t// Get Computed styles\n\tlet computedStyles: CSSStyleDeclaration,\n\t\tpaddingTop: number,\n\t\tpaddingBottom: number,\n\t\tmarginTop: number,\n\t\tmarginBottom: number,\n\t\theight: number;\n\n\t// Store inline styles\n\tlet storedOverflow: string,\n\t\tstoredPaddingTop: string,\n\t\tstoredPaddingBottom: string,\n\t\tstoredMarginTop: string,\n\t\tstoredMarginBottom: string,\n\t\tstoredHeight: string;\n\n\tconst animation = animate({\n\t\tbeforeStart: () => {\n\t\t\t// Get Computed styles\n\t\t\tconst el = element;\n\t\t\tcomputedStyles = getComputedStyle(el);\n\t\t\tpaddingTop = parseFloat(computedStyles.paddingTop);\n\t\t\tpaddingBottom = parseFloat(computedStyles.paddingBottom);\n\t\t\tmarginTop = parseFloat(computedStyles.marginTop);\n\t\t\tmarginBottom = parseFloat(computedStyles.marginBottom);\n\t\t\theight = parseFloat(computedStyles.height);\n\n\t\t\t// Store inline styles\n\t\t\tstoredOverflow = el.style.overflow;\n\t\t\tstoredPaddingTop = el.style.paddingTop;\n\t\t\tstoredPaddingBottom = el.style.paddingBottom;\n\t\t\tstoredMarginTop = el.style.marginTop;\n\t\t\tstoredMarginBottom = el.style.marginBottom;\n\t\t\tstoredHeight = el.style.height;\n\n\t\t\tel.style.overflow = \"hidden\";\n\t\t},\n\t\tduration,\n\t\telement,\n\t\tadvance: progress => {\n\t\t\telement.style.paddingTop = `${paddingTop - (paddingTop * progress)}px`;\n\t\t\telement.style.paddingBottom = `${paddingBottom - (paddingBottom * progress)}px`;\n\t\t\telement.style.marginTop = `${marginTop - (marginTop * progress)}px`;\n\t\t\telement.style.marginBottom = `${marginBottom - (marginBottom * progress)}px`;\n\t\t\telement.style.height = `${height - (height * progress)}px`;\n\t\t},\n\t});\n\n\tanimation.promise().then(reason => {\n\t\tif (!(reason instanceof Error)) {\n\t\t\telement.style.overflow = storedOverflow;\n\t\t\telement.style.paddingTop = storedPaddingTop;\n\t\t\telement.style.paddingBottom = storedPaddingBottom;\n\t\t\telement.style.marginTop = storedMarginTop;\n\t\t\telement.style.marginBottom = storedMarginBottom;\n\t\t\telement.style.height = storedHeight;\n\t\t\telement.style.display = \"none\";\n\t\t}\n\t});\n\n\treturn animation;\n};\n\nexport default slideUp;\n"]}
1
+ {"version":3,"file":"slideUp.js","sourceRoot":"","sources":["../../src/animations/slideUp.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,OAAO,GAAG,CAAC,OAAoB,EAAE,EAAE;IACxC,sBAAsB;IACtB,IAAI,cAAmC,EACtC,UAAkB,EAClB,aAAqB,EACrB,SAAiB,EACjB,YAAoB,EACpB,MAAc,CAAC;IAEhB,sBAAsB;IACtB,IAAI,cAAsB,EACzB,gBAAwB,EACxB,mBAA2B,EAC3B,eAAuB,EACvB,kBAA0B,EAC1B,YAAoB,CAAC;IAEtB,MAAM,SAAS,GAAG,OAAO,CAAC;QACzB,WAAW,EAAE,GAAG,EAAE;YACjB,sBAAsB;YACtB,MAAM,EAAE,GAAG,OAAO,CAAC;YACnB,cAAc,GAAG,gBAAgB,CAAC,EAAE,CAAC,CAAC;YACtC,UAAU,GAAG,UAAU,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;YACnD,aAAa,GAAG,UAAU,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;YACzD,SAAS,GAAG,UAAU,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;YACjD,YAAY,GAAG,UAAU,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;YACvD,MAAM,GAAG,UAAU,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YAE3C,sBAAsB;YACtB,cAAc,GAAG,EAAE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C5C,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,mBAAmB,CAAC;YAClD,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,eAAe,CAAC;YAC1C,OAAO,CAAC,KAAK,CAAC,YAAY,GAAG,kBAAkB,CAAC;YAChD,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,YAAY,CAAC;YACpC,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;QAChC,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AAClB,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import animate, { duration } from \"./animate.js\";\n\nconst slideUp = (element: HTMLElement) => {\n\t// Get Computed styles\n\tlet computedStyles: CSSStyleDeclaration,\n\t\tpaddingTop: number,\n\t\tpaddingBottom: number,\n\t\tmarginTop: number,\n\t\tmarginBottom: number,\n\t\theight: number;\n\n\t// Store inline styles\n\tlet storedOverflow: string,\n\t\tstoredPaddingTop: string,\n\t\tstoredPaddingBottom: string,\n\t\tstoredMarginTop: string,\n\t\tstoredMarginBottom: string,\n\t\tstoredHeight: string;\n\n\tconst animation = animate({\n\t\tbeforeStart: () => {\n\t\t\t// Get Computed styles\n\t\t\tconst el = element;\n\t\t\tcomputedStyles = getComputedStyle(el);\n\t\t\tpaddingTop = parseFloat(computedStyles.paddingTop);\n\t\t\tpaddingBottom = parseFloat(computedStyles.paddingBottom);\n\t\t\tmarginTop = parseFloat(computedStyles.marginTop);\n\t\t\tmarginBottom = parseFloat(computedStyles.marginBottom);\n\t\t\theight = parseFloat(computedStyles.height);\n\n\t\t\t// Store inline styles\n\t\t\tstoredOverflow = el.style.overflow;\n\t\t\tstoredPaddingTop = el.style.paddingTop;\n\t\t\tstoredPaddingBottom = el.style.paddingBottom;\n\t\t\tstoredMarginTop = el.style.marginTop;\n\t\t\tstoredMarginBottom = el.style.marginBottom;\n\t\t\tstoredHeight = el.style.height;\n\n\t\t\tel.style.overflow = \"hidden\";\n\t\t},\n\t\tduration,\n\t\telement,\n\t\tadvance: progress => {\n\t\t\telement.style.paddingTop = `${paddingTop - (paddingTop * progress)}px`;\n\t\t\telement.style.paddingBottom = `${paddingBottom - (paddingBottom * progress)}px`;\n\t\t\telement.style.marginTop = `${marginTop - (marginTop * progress)}px`;\n\t\t\telement.style.marginBottom = `${marginBottom - (marginBottom * progress)}px`;\n\t\t\telement.style.height = `${height - (height * progress)}px`;\n\t\t},\n\t});\n\n\tanimation.promise().then(reason => {\n\t\tif (!(reason instanceof Error)) {\n\t\t\telement.style.overflow = storedOverflow;\n\t\t\telement.style.paddingTop = storedPaddingTop;\n\t\t\telement.style.paddingBottom = storedPaddingBottom;\n\t\t\telement.style.marginTop = storedMarginTop;\n\t\t\telement.style.marginBottom = storedMarginBottom;\n\t\t\telement.style.height = storedHeight;\n\t\t\telement.style.display = \"none\";\n\t\t}\n\t});\n\n\treturn animation;\n};\n\nexport default slideUp;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Icons.js","sourceRoot":"","sources":["../../src/asset-registries/Icons.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,0BAA0B,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,MAAM,oBAAoB,GAAG,QAAQ,CAAC,CAAC,uBAAuB;AA2B9D,MAAM,OAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;AAC9C,MAAM,QAAQ,GAAG,iBAAiB,CAAwB,mBAAmB,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AAC1F,MAAM,sBAAsB,GAAG,iBAAiB,CAA8D,mBAAmB,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AAE9I,MAAM,cAAc,GAAG,gBAA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;;;GAMG;AACH,MAAM,qBAAqB,GAAG,KAAK,EAAE,IAAwB,EAA+B,EAAE;IAC7F,IAAI,CAAC,IAAI,EAAE;QACV,OAAO;KACP;IAED,IAAI,QAAQ,GAAiD,eAAe,CAAC,IAAI,CAAC,CAAC;IAEnF,IAAI,CAAC,QAAQ,EAAE;QACd,QAAQ,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;KACnC;IAED,IAAI,QAAQ,IAAI,QAAQ,KAAK,cAAc,IAAI,QAAQ,CAAC,OAAO,EAAE;QAChE,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC7D,OAAO,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;KAC5C;AACF,CAAC,CAAC;AAEF,uBAAuB;AACvB,MAAM,mBAAmB,GAAG,KAAK,IAAI,EAAE;IACtC,+DAA+D;IAC/D,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,MAAM,WAAW,CAAC,WAAW,CAAC,CAAC;IAC/B,MAAM,WAAW,CAAC,mBAAmB,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,OAAO,EACN,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,mBAAmB,GACnB,CAAC","sourcesContent":["import getSharedResource from \"../getSharedResource.js\";\nimport { getIconCollectionByAlias } from \"./util/IconCollectionsAlias.js\";\nimport { registerIconCollectionForTheme } from \"./util/IconCollectionsByTheme.js\";\nimport getEffectiveIconCollection from \"./util/getIconCollectionByTheme.js\";\nimport { getI18nBundle } from \"../i18nBundle.js\";\nimport type { I18nText } from \"../i18nBundle.js\";\nimport type { TemplateFunction } from \"../renderer/executeTemplate.js\";\n\nconst DEFAULT_THEME_FAMILY = \"legacy\"; // includes sap_fiori_*\n\ntype IconLoader = (collectionName: string) => Promise<CollectionData | Array<CollectionData>>;\n\ntype CollectionData = {\n\tcollection: string,\n\tpackageName: string,\n\tthemeFamily?: \"legacy\" | \"sap_horizon\",\n\tversion?: string,\n\tdata: Record<string, {\n\t\tpath?: string,\n\t\tpaths?: Array<string>,\n\t\tltr?: boolean,\n\t\tacc?: I18nText,\n\t}>,\n};\n\ntype IconData = {\n\tcollection: string,\n\tpackageName: string,\n\tpathData: string | Array<string>,\n\tltr?: boolean,\n\taccData?: I18nText,\n\tcustomTemplate?: TemplateFunction,\n\tviewBox?: string,\n};\n\nconst loaders = new Map<string, IconLoader>();\nconst registry = getSharedResource<Map<string, IconData>>(\"SVGIcons.registry\", new Map());\nconst iconCollectionPromises = getSharedResource<Map<string, Promise<CollectionData| Array<CollectionData>>>>(\"SVGIcons.promises\", new Map());\n\nconst ICON_NOT_FOUND = \"ICON_NOT_FOUND\";\n\nconst registerIconLoader = (collectionName: string, loader: IconLoader) => {\n\tloaders.set(collectionName, loader);\n};\n\nconst _loadIconCollectionOnce = async (collectionName: string) => {\n\tif (!iconCollectionPromises.has(collectionName)) {\n\t\tif (!loaders.has(collectionName)) {\n\t\t\tthrow new Error(`No loader registered for the ${collectionName} icons collection. Probably you forgot to import the \"AllIcons.js\" module for the respective package.`);\n\t\t}\n\n\t\tconst loadIcons = loaders.get(collectionName)!;\n\t\ticonCollectionPromises.set(collectionName, loadIcons(collectionName));\n\t}\n\n\treturn iconCollectionPromises.get(collectionName);\n};\n\nconst _fillRegistry = (bundleData: CollectionData) => {\n\tObject.keys(bundleData.data).forEach(iconName => {\n\t\tconst iconData = bundleData.data[iconName];\n\n\t\tregisterIcon(iconName, {\n\t\t\tpathData: (iconData.path || iconData.paths)!,\n\t\t\tltr: iconData.ltr,\n\t\t\taccData: iconData.acc,\n\t\t\tcollection: bundleData.collection,\n\t\t\tpackageName: bundleData.packageName,\n\t\t});\n\t});\n};\n\n// set\nconst registerIcon = (name: string, iconData: IconData) => { // eslint-disable-line\n\tconst key = `${iconData.collection}/${name}`;\n\n\tregistry.set(key, {\n\t\tpathData: iconData.pathData,\n\t\tltr: iconData.ltr,\n\t\taccData: iconData.accData,\n\t\tpackageName: iconData.packageName,\n\t\tcustomTemplate: iconData.customTemplate,\n\t\tviewBox: iconData.viewBox,\n\t\tcollection: iconData.collection,\n\t});\n};\n\n/**\n * Processes the full icon name and splits it into - \"name\", \"collection\".\n * - removes legacy protocol (\"sap-icon://\")\n * - resolves aliases (f.e \"SAP-icons-TNT/actor\" => \"tnt/actor\")\n *\n * @param { string } name\n * @return { object }\n */\nconst processName = (name: string) => {\n\t// silently support ui5-compatible URIs\n\tif (name.startsWith(\"sap-icon://\")) {\n\t\tname = name.replace(\"sap-icon://\", \"\");\n\t}\n\n\tlet collection: string;\n\t[name, collection] = name.split(\"/\").reverse();\n\n\tname = name.replace(\"icon-\", \"\");\n\tif (collection) {\n\t\tcollection = getIconCollectionByAlias(collection);\n\t}\n\treturn { name, collection };\n};\n\nconst getIconDataSync = (iconName: string) => {\n\tconst { name, collection } = processName(iconName);\n\treturn getRegisteredIconData(collection, name);\n};\n\nconst getIconData = async (iconName: string) => {\n\tconst { name, collection } = processName(iconName);\n\n\tlet iconData: string | CollectionData | Array<CollectionData> = ICON_NOT_FOUND;\n\ttry {\n\t\ticonData = (await _loadIconCollectionOnce(getEffectiveIconCollection(collection)))!;\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tconsole.error(e.message); /* eslint-disable-line */\n\t}\n\n\tif (iconData === ICON_NOT_FOUND) {\n\t\treturn iconData;\n\t}\n\n\tconst registeredIconData = getRegisteredIconData(collection, name);\n\n\tif (registeredIconData) {\n\t\treturn registeredIconData;\n\t}\n\n\t// not filled by another await. many getters will await on the same loader, but fill only once\n\tif (Array.isArray(iconData)) {\n\t\ticonData.forEach(data => {\n\t\t\t_fillRegistry(data);\n\t\t\tregisterIconCollectionForTheme(collection, { [data.themeFamily || DEFAULT_THEME_FAMILY]: data.collection });\n\t\t});\n\t} else {\n\t\t_fillRegistry(iconData as CollectionData);\n\t}\n\n\treturn getRegisteredIconData(collection, name);\n};\n\nconst getRegisteredIconData = (collection: string, name: string) => {\n\tconst registryKey = `${getEffectiveIconCollection(collection)}/${name}`;\n\treturn registry.get(registryKey);\n};\n\n/**\n * Returns the accessible name for the given icon,\n * or undefined if accessible name is not present.\n *\n * @param { string } name\n * @return { Promise }\n */\nconst getIconAccessibleName = async (name: string | undefined): Promise<string | undefined> => {\n\tif (!name) {\n\t\treturn;\n\t}\n\n\tlet iconData: typeof ICON_NOT_FOUND | IconData | undefined = getIconDataSync(name);\n\n\tif (!iconData) {\n\t\ticonData = await getIconData(name);\n\t}\n\n\tif (iconData && iconData !== ICON_NOT_FOUND && iconData.accData) {\n\t\tconst i18nBundle = await getI18nBundle(iconData.packageName);\n\t\treturn i18nBundle.getText(iconData.accData);\n\t}\n};\n\n// test page usage only\nconst _getRegisteredNames = async () => {\n\t// fetch one icon of each collection to trigger the bundle load\n\tawait getIconData(\"edit\");\n\tawait getIconData(\"tnt/arrow\");\n\tawait getIconData(\"business-suite/3d\");\n\treturn Array.from(registry.keys());\n};\n\nexport {\n\tregisterIconLoader,\n\tgetIconData,\n\tgetIconDataSync,\n\tgetIconAccessibleName,\n\tregisterIcon,\n\t_getRegisteredNames,\n};\n\nexport type {\n\tIconData,\n\tCollectionData,\n};\n"]}
1
+ {"version":3,"file":"Icons.js","sourceRoot":"","sources":["../../src/asset-registries/Icons.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,0BAA0B,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAIjD,MAAM,oBAAoB,GAAG,QAAQ,CAAC,CAAC,uBAAuB;AA2B9D,MA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AClB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,mBAAmB,GACnB,CAAC","sourcesContent":["import getSharedResource from \"../getSharedResource.js\";\nimport { getIconCollectionByAlias } from \"./util/IconCollectionsAlias.js\";\nimport { registerIconCollectionForTheme } from \"./util/IconCollectionsByTheme.js\";\nimport getEffectiveIconCollection from \"./util/getIconCollectionByTheme.js\";\nimport { getI18nBundle } from \"../i18nBundle.js\";\nimport type { I18nText } from \"../i18nBundle.js\";\nimport type { TemplateFunction } from \"../renderer/executeTemplate.js\";\n\nconst DEFAULT_THEME_FAMILY = \"legacy\"; // includes sap_fiori_*\n\ntype IconLoader = (collectionName: string) => Promise<CollectionData | Array<CollectionData>>;\n\ntype CollectionData = {\n\tcollection: string,\n\tpackageName: string,\n\tthemeFamily?: \"legacy\" | \"sap_horizon\",\n\tversion?: string,\n\tdata: Record<string, {\n\t\tpath?: string,\n\t\tpaths?: Array<string>,\n\t\tltr?: boolean,\n\t\tacc?: I18nText,\n\t}>,\n};\n\ntype IconData = {\n\tcollection: string,\n\tpackageName: string,\n\tpathData: string | Array<string>,\n\tltr?: boolean,\n\taccData?: I18nText,\n\tcustomTemplate?: TemplateFunction,\n\tviewBox?: string,\n};\n\nconst loaders = new Map<string, IconLoader>();\nconst registry = getSharedResource<Map<string, IconData>>(\"SVGIcons.registry\", new Map());\nconst iconCollectionPromises = getSharedResource<Map<string, Promise<CollectionData| Array<CollectionData>>>>(\"SVGIcons.promises\", new Map());\n\nconst ICON_NOT_FOUND = \"ICON_NOT_FOUND\";\n\nconst registerIconLoader = (collectionName: string, loader: IconLoader) => {\n\tloaders.set(collectionName, loader);\n};\n\nconst _loadIconCollectionOnce = async (collectionName: string) => {\n\tif (!iconCollectionPromises.has(collectionName)) {\n\t\tif (!loaders.has(collectionName)) {\n\t\t\tthrow new Error(`No loader registered for the ${collectionName} icons collection. Probably you forgot to import the \"AllIcons.js\" module for the respective package.`);\n\t\t}\n\n\t\tconst loadIcons = loaders.get(collectionName)!;\n\t\ticonCollectionPromises.set(collectionName, loadIcons(collectionName));\n\t}\n\n\treturn iconCollectionPromises.get(collectionName);\n};\n\nconst _fillRegistry = (bundleData: CollectionData) => {\n\tObject.keys(bundleData.data).forEach(iconName => {\n\t\tconst iconData = bundleData.data[iconName];\n\n\t\tregisterIcon(iconName, {\n\t\t\tpathData: (iconData.path || iconData.paths)!,\n\t\t\tltr: iconData.ltr,\n\t\t\taccData: iconData.acc,\n\t\t\tcollection: bundleData.collection,\n\t\t\tpackageName: bundleData.packageName,\n\t\t});\n\t});\n};\n\n// set\nconst registerIcon = (name: string, iconData: IconData) => { // eslint-disable-line\n\tconst key = `${iconData.collection}/${name}`;\n\n\tregistry.set(key, {\n\t\tpathData: iconData.pathData,\n\t\tltr: iconData.ltr,\n\t\taccData: iconData.accData,\n\t\tpackageName: iconData.packageName,\n\t\tcustomTemplate: iconData.customTemplate,\n\t\tviewBox: iconData.viewBox,\n\t\tcollection: iconData.collection,\n\t});\n};\n\n/**\n * Processes the full icon name and splits it into - \"name\", \"collection\".\n * - removes legacy protocol (\"sap-icon://\")\n * - resolves aliases (f.e \"SAP-icons-TNT/actor\" => \"tnt/actor\")\n *\n * @param { string } name\n * @return { object }\n */\nconst processName = (name: string) => {\n\t// silently support ui5-compatible URIs\n\tif (name.startsWith(\"sap-icon://\")) {\n\t\tname = name.replace(\"sap-icon://\", \"\");\n\t}\n\n\tlet collection: string;\n\t[name, collection] = name.split(\"/\").reverse();\n\n\tname = name.replace(\"icon-\", \"\");\n\tif (collection) {\n\t\tcollection = getIconCollectionByAlias(collection);\n\t}\n\treturn { name, collection };\n};\n\nconst getIconDataSync = (iconName: string) => {\n\tconst { name, collection } = processName(iconName);\n\treturn getRegisteredIconData(collection, name);\n};\n\nconst getIconData = async (iconName: string) => {\n\tconst { name, collection } = processName(iconName);\n\n\tlet iconData: string | CollectionData | Array<CollectionData> = ICON_NOT_FOUND;\n\ttry {\n\t\ticonData = (await _loadIconCollectionOnce(getEffectiveIconCollection(collection)))!;\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tconsole.error(e.message); /* eslint-disable-line */\n\t}\n\n\tif (iconData === ICON_NOT_FOUND) {\n\t\treturn iconData;\n\t}\n\n\tconst registeredIconData = getRegisteredIconData(collection, name);\n\n\tif (registeredIconData) {\n\t\treturn registeredIconData;\n\t}\n\n\t// not filled by another await. many getters will await on the same loader, but fill only once\n\tif (Array.isArray(iconData)) {\n\t\ticonData.forEach(data => {\n\t\t\t_fillRegistry(data);\n\t\t\tregisterIconCollectionForTheme(collection, { [data.themeFamily || DEFAULT_THEME_FAMILY]: data.collection });\n\t\t});\n\t} else {\n\t\t_fillRegistry(iconData as CollectionData);\n\t}\n\n\treturn getRegisteredIconData(collection, name);\n};\n\nconst getRegisteredIconData = (collection: string, name: string) => {\n\tconst registryKey = `${getEffectiveIconCollection(collection)}/${name}`;\n\treturn registry.get(registryKey);\n};\n\n/**\n * Returns the accessible name for the given icon,\n * or undefined if accessible name is not present.\n *\n * @param { string } name\n * @return { Promise }\n */\nconst getIconAccessibleName = async (name: string | undefined): Promise<string | undefined> => {\n\tif (!name) {\n\t\treturn;\n\t}\n\n\tlet iconData: typeof ICON_NOT_FOUND | IconData | undefined = getIconDataSync(name);\n\n\tif (!iconData) {\n\t\ticonData = await getIconData(name);\n\t}\n\n\tif (iconData && iconData !== ICON_NOT_FOUND && iconData.accData) {\n\t\tconst i18nBundle = await getI18nBundle(iconData.packageName);\n\t\treturn i18nBundle.getText(iconData.accData);\n\t}\n};\n\n// test page usage only\nconst _getRegisteredNames = async () => {\n\t// fetch one icon of each collection to trigger the bundle load\n\tawait getIconData(\"edit\");\n\tawait getIconData(\"tnt/arrow\");\n\tawait getIconData(\"business-suite/3d\");\n\treturn Array.from(registry.keys());\n};\n\nexport {\n\tregisterIconLoader,\n\tgetIconData,\n\tgetIconDataSync,\n\tgetIconAccessibleName,\n\tregisterIcon,\n\t_getRegisteredNames,\n};\n\nexport type {\n\tIconData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E,EAAE,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC;YAC3H,MAAM,IAAI,KAAK,CAAC,gCAAgC,gBAAgB,iGAAiG,gBAAgB,uLAAuL,CAAC,CAAC;SAC1W;QAED,MAAM,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAE,CAAC;QACpD,oBAAoB,CAAC,GAAG,CAAC,WAAW,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC;KACtE;IACD,OAAO,oBAAoB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG,CAAC,gBAAwB,EAAE,EAAE;IAC5D,MAAM,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC;IACtD,OAAO,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAClC,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,KAAK,EAAE,gBAAwB,EAAE,EAAE;IAC9D,MAAM,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEtD,MAAM,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;IAC9C,OAAO,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAClC,CAAC,CAAC;AAEF,OAAO,EACN,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,GACnB,CAAC","sourcesContent":["import getSharedResource from \"../getSharedResource.js\";\nimport type { I18nText } from \"../i18nBundle.js\";\nimport { getTheme } from \"../config/Theme.js\";\n\ntype IllustrationLoader = (illustrationName: string) => Promise<IllustrationData>;\n\ntype IllustrationProperties = {\n\tdialogSvg: string,\n\tsceneSvg: string,\n\tspotSvg: string,\n\tdotSvg: string,\n\ttitle: I18nText,\n\tsubtitle: I18nText,\n};\n\ntype IllustrationData = IllustrationProperties & {\n\tset: string,\n\tcollection: string,\n};\n\nconst IllustrationCollections = new Map([\n\t[\"sap_horizon\", \"V5\"],\n\t[\"sap_horizon_dark\", \"V5\"],\n\t[\"sap_horizon_hcb\", \"V5/HC\"],\n\t[\"sap_horizon_hcw\", \"V5/HC\"],\n]);\n\nconst FALLBACK_COLLECTION = \"V4\";\n\nconst loaders = new Map<string, IllustrationLoader>();\nconst registry = getSharedResource<Map<string, IllustrationProperties>>(\"SVGIllustration.registry\", new Map());\nconst illustrationPromises = getSharedResource<Map<string, Promise<IllustrationData>>>(\"SVGIllustration.promises\", new Map());\n\nconst getCollection = () => {\n\tconst theme = getTheme();\n\n\tif (IllustrationCollections.has(theme)) {\n\t\treturn IllustrationCollections.get(theme);\n\t}\n\n\treturn FALLBACK_COLLECTION;\n};\n\n/**\n * Processes the name of the illustration\n * The name is used to generate the registry key and the loader key\n * The registry key is used to store and get the illustration data from the registry\n * The loader key is used to store and get the illustration loader from the loaders map\n * The function generates the correct registry key and loader key based on whether an loader exists for the illustration\n * If there is no loader registered for the collection, it falls back to the default collection\n */\nconst processName = (name: string) => {\n\tlet collection = getCollection();\n\tconst [set, illustrationName] = name.split(\"/\");\n\tlet registryKey = `${set}/${collection}/${illustrationName}`;\n\n\tif (!loaders.has(registryKey) && collection !== FALLBACK_COLLECTION) {\n\t\tcollection = FALLBACK_COLLECTION;\n\t\tregistryKey = `${set}/${collection}/${illustrationName}`;\n\t}\n\n\treturn {\n\t\tregistryKey,\n\t\tcollection,\n\t};\n};\n\nconst registerIllustration = (name: string, data: IllustrationData) => {\n\tconst collection = data.collection || FALLBACK_COLLECTION;\n\tregistry.set(`${data.set}/${collection}/${name}`, {\n\t\tdialogSvg: data.dialogSvg,\n\t\tsceneSvg: data.sceneSvg,\n\t\tspotSvg: data.spotSvg,\n\t\tdotSvg: data.dotSvg,\n\t\ttitle: data.title,\n\t\tsubtitle: data.subtitle,\n\t});\n};\n\nconst registerIllustrationLoader = (illustrationName: string, loader: IllustrationLoader) => {\n\tloaders.set(illustrationName, loader);\n};\n\nconst _loadIllustrationOnce = (illustrationName: string) => {\n\tconst { registryKey } = processName(illustrationName);\n\tif (!illustrationPromises.has(registryKey)) {\n\t\tif (!loaders.has(registryKey)) {\n\t\t\tconst illustrationPath = illustrationName.startsWith(\"fiori/\") ? illustrationName.replace(\"fiori/\", \"\") : illustrationName;\n\t\t\tthrow new Error(`No loader registered for the ${illustrationName} illustration. Probably you forgot to import the \"@ui5/webcomponents-fiori/dist/illustrations/${illustrationPath}.js\" module. Or you can import the \"@ui5/webcomponents-fiori/dist/illustrations/AllIllustrations.js\" module that will make all illustrations available, but fetch only the ones used.`);\n\t\t}\n\n\t\tconst loadIllustrations = loaders.get(registryKey)!;\n\t\tillustrationPromises.set(registryKey, loadIllustrations(registryKey));\n\t}\n\treturn illustrationPromises.get(registryKey);\n};\n\nconst getIllustrationDataSync = (illustrationName: string) => {\n\tconst { registryKey } = processName(illustrationName);\n\treturn registry.get(registryKey);\n};\n\nconst getIllustrationData = async (illustrationName: string) => {\n\tconst { registryKey } = processName(illustrationName);\n\n\tawait _loadIllustrationOnce(illustrationName);\n\treturn registry.get(registryKey);\n};\n\nexport {\n\tgetIllustrationDataSync,\n\tregisterIllustration,\n\tregisterIllustrationLoader,\n\tgetIllustrationData,\n};\n"]}
1
+ {"version":3,"file":"Illustrations.js","sourceRoot":"","sources":["../../src/asset-registries/Illustrations.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAkB9C,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC;IACvC,CAAC,aAAa,EAAE,IAAI,CAAC;IACrB,CAAC,kBAAkB,EAAE,IAAI,CAAC;IAC1B,CAAC,iBAAiB,EAAE,OAAO,CAAC;IAC5B,CAAC,iBAAiB,EAAE,OAAO,CAAC;CAC5B,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAEjC,MAAM,OAAO,GAAG,IAAI,GAAG,EAA8B,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AW,CAAC,gBAAgB,CAAC,CAAC;IACtD,OAAO,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAClC,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,KAAK,EAAE,gBAAwB,EAAE,EAAE;IAC9D,MAAM,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEtD,MAAM,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;IAC9C,OAAO,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAClC,CAAC,CAAC;AAEF,OAAO,EACN,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,GACnB,CAAC","sourcesContent":["import getSharedResource from \"../getSharedResource.js\";\nimport type { I18nText } from \"../i18nBundle.js\";\nimport { getTheme } from \"../config/Theme.js\";\n\ntype IllustrationLoader = (illustrationName: string) => Promise<IllustrationData>;\n\ntype IllustrationProperties = {\n\tdialogSvg: string,\n\tsceneSvg: string,\n\tspotSvg: string,\n\tdotSvg: string,\n\ttitle: I18nText,\n\tsubtitle: I18nText,\n};\n\ntype IllustrationData = IllustrationProperties & {\n\tset: string,\n\tcollection: string,\n};\n\nconst IllustrationCollections = new Map([\n\t[\"sap_horizon\", \"V5\"],\n\t[\"sap_horizon_dark\", \"V5\"],\n\t[\"sap_horizon_hcb\", \"V5/HC\"],\n\t[\"sap_horizon_hcw\", \"V5/HC\"],\n]);\n\nconst FALLBACK_COLLECTION = \"V4\";\n\nconst loaders = new Map<string, IllustrationLoader>();\nconst registry = getSharedResource<Map<string, IllustrationProperties>>(\"SVGIllustration.registry\", new Map());\nconst illustrationPromises = getSharedResource<Map<string, Promise<IllustrationData>>>(\"SVGIllustration.promises\", new Map());\n\nconst getCollection = () => {\n\tconst theme = getTheme();\n\n\tif (IllustrationCollections.has(theme)) {\n\t\treturn IllustrationCollections.get(theme);\n\t}\n\n\treturn FALLBACK_COLLECTION;\n};\n\n/**\n * Processes the name of the illustration\n * The name is used to generate the registry key and the loader key\n * The registry key is used to store and get the illustration data from the registry\n * The loader key is used to store and get the illustration loader from the loaders map\n * The function generates the correct registry key and loader key based on whether an loader exists for the illustration\n * If there is no loader registered for the collection, it falls back to the default collection\n */\nconst processName = (name: string) => {\n\tlet collection = getCollection();\n\tconst [set, illustrationName] = name.split(\"/\");\n\tlet registryKey = `${set}/${collection}/${illustrationName}`;\n\n\tif (!loaders.has(registryKey) && collection !== FALLBACK_COLLECTION) {\n\t\tcollection = FALLBACK_COLLECTION;\n\t\tregistryKey = `${set}/${collection}/${illustrationName}`;\n\t}\n\n\treturn {\n\t\tregistryKey,\n\t\tcollection,\n\t};\n};\n\nconst registerIllustration = (name: string, data: IllustrationData) => {\n\tconst collection = data.collection || FALLBACK_COLLECTION;\n\tregistry.set(`${data.set}/${collection}/${name}`, {\n\t\tdialogSvg: data.dialogSvg,\n\t\tsceneSvg: data.sceneSvg,\n\t\tspotSvg: data.spotSvg,\n\t\tdotSvg: data.dotSvg,\n\t\ttitle: data.title,\n\t\tsubtitle: data.subtitle,\n\t});\n};\n\nconst registerIllustrationLoader = (illustrationName: string, loader: IllustrationLoader) => {\n\tloaders.set(illustrationName, loader);\n};\n\nconst _loadIllustrationOnce = (illustrationName: string) => {\n\tconst { registryKey } = processName(illustrationName);\n\tif (!illustrationPromises.has(registryKey)) {\n\t\tif (!loaders.has(registryKey)) {\n\t\t\tconst illustrationPath = illustrationName.startsWith(\"fiori/\") ? illustrationName.replace(\"fiori/\", \"\") : illustrationName;\n\t\t\tthrow new Error(`No loader registered for the ${illustrationName} illustration. Probably you forgot to import the \"@ui5/webcomponents-fiori/dist/illustrations/${illustrationPath}.js\" module. Or you can import the \"@ui5/webcomponents-fiori/dist/illustrations/AllIllustrations.js\" module that will make all illustrations available, but fetch only the ones used.`);\n\t\t}\n\n\t\tconst loadIllustrations = loaders.get(registryKey)!;\n\t\tillustrationPromises.set(registryKey, loadIllustrations(registryKey));\n\t}\n\treturn illustrationPromises.get(registryKey);\n};\n\nconst getIllustrationDataSync = (illustrationName: string) => {\n\tconst { registryKey } = processName(illustrationName);\n\treturn registry.get(registryKey);\n};\n\nconst getIllustrationData = async (illustrationName: string) => {\n\tconst { registryKey } = processName(illustrationName);\n\n\tawait _loadIllustrationOnce(illustrationName);\n\treturn registry.get(registryKey);\n};\n\nexport {\n\tgetIllustrationDataSync,\n\tregisterIllustration,\n\tregisterIllustrationLoader,\n\tgetIllustrationData,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"LocaleData.js","sourceRoot":"","sources":["../../src/asset-registries/LocaleData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAMpD,MAAM,aAAa,GAAG,IAAI,GAAG,EAAoB,CAAC;AAClD,MAAM,OAAO,GAAG,IAAI,GAAG,EAA4B,CAAC;AACpD,MAAM,YAAY,GAAG,IAAI,GAAG,EAA6B,CAAC;AAC1D,MAAM,cAAc,GAAG,IAAI,GAAG,EAAU,CAAC;AACzC,IAAI,YAAY,GAAG,KAAK,CAAC;AAEzB,MAAM,mBAAmB,GAAG;IAC3B,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;CACV,CAAC;AAEF,MAAM,sBAAsB,GAAG,CAAC,QAAgB,EAAE,EAAE;IACnD,IAAI,YAAY,EAAE;QACjB,OAAO;KACP;IAED,OAAO,CAAC,IAAI,CAAC,kCAAkC,QAAQ,+FAA+F,CAAC,CAAC,CAAC,yBAAyB;IAElL,YAAY,GAAG,IAAI,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAE,MAAc,EAAE,MAAc,EAAE,EAAE;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EAAE,CAAC,CAAC;AAChF,CAAC,CAAC,CAAC;AAEH,OAAO,EACN,wBAAwB,EACxB,SAAS,EACT,aAAa,GACb,CAAC","sourcesContent":["import { attachLanguageChange } from \"../locale/languageChange.js\";\nimport getLocale from \"../locale/getLocale.js\";\nimport { DEFAULT_LOCALE, SUPPORTED_LOCALES } from \"../generated/AssetParameters.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport type OpenUI5Support from \"../features/OpenUI5Support.js\";\n\ntype LocaleDataLoader = (locale: string) => Promise<CLDRData>;\ntype CLDRData = Record<string, object | boolean | string>;\n\nconst localeDataMap = new Map<string, CLDRData>();\nconst loaders = new Map<string, LocaleDataLoader>();\nconst cldrPromises = new Map<string, Promise<CLDRData>>();\nconst reportedErrors = new Set<string>();\nlet warningShown = false;\n\nconst M_ISO639_OLD_TO_NEW = {\n\t\"iw\": \"he\",\n\t\"ji\": \"yi\",\n\t\"in\": \"id\",\n};\n\nconst _showAssetsWarningOnce = (localeId: string) => {\n\tif (warningShown) {\n\t\treturn;\n\t}\n\n\tconsole.warn(`[LocaleData] Supported locale \"${localeId}\" not configured, import the \"Assets.js\" module from the webcomponents package you are using.`); /* eslint-disable-line */\n\n\twarningShown = true;\n};\n\nconst calcLocale = (language: string, region: string, script: string) => {\n\t// normalize language and handle special cases\n\tlanguage = (language && M_ISO639_OLD_TO_NEW[language as keyof typeof M_ISO639_OLD_TO_NEW]) || language;\n\t// Special case 1: in an SAP context, the inclusive language code \"no\" always means Norwegian Bokmal (\"nb\")\n\tif (language === \"no\") {\n\t\tlanguage = \"nb\";\n\t}\n\t// Special case 2: for Chinese, derive a default region from the script (this behavior is inherited from Java)\n\tif (language === \"zh\" && !region) {\n\t\tif (script === \"Hans\") {\n\t\t\tregion = \"CN\";\n\t\t} else if (script === \"Hant\") {\n\t\t\tregion = \"TW\";\n\t\t}\n\t}\n\n\t// Special case 3: for Serbian, there are cyrillic and latin scripts, \"sh\" and \"sr-latn\" map to \"latin\", \"sr\" maps to cyrillic.\n\tif (language === \"sh\" || (language === \"sr\" && script === \"Latn\")) {\n\t\tlanguage = \"sr\";\n\t\tregion = \"Latn\";\n\t}\n\n\t// try language + region\n\tlet localeId = `${language}_${region}`;\n\tif (SUPPORTED_LOCALES.includes(localeId)) {\n\t\tif (loaders.has(localeId)) {\n\t\t\t// supported and has loader\n\t\t\treturn localeId;\n\t\t}\n\n\t\t// supported, no loader - fallback to default and warn\n\t\t_showAssetsWarningOnce(localeId);\n\t\treturn DEFAULT_LOCALE;\n\t}\n\n\t// not supported, try language only\n\tlocaleId = language;\n\tif (SUPPORTED_LOCALES.includes(localeId)) {\n\t\tif (loaders.has(localeId)) {\n\t\t\t// supported and has loader\n\t\t\treturn localeId;\n\t\t}\n\n\t\t// supported, no loader - fallback to default and warn\n\t\t_showAssetsWarningOnce(localeId);\n\t\treturn DEFAULT_LOCALE;\n\t}\n\n\t// not supported - fallback to default locale\n\treturn DEFAULT_LOCALE;\n};\n\n// internal set data\nconst setLocaleData = (localeId: string, content: CLDRData) => {\n\tlocaleDataMap.set(localeId, content);\n};\n\n// external getSync\nconst getLocaleData = (localeId: string) => {\n\t// if there is no loader, the default fallback was fetched and a warning was given - use default locale instead\n\tif (!loaders.has(localeId)) {\n\t\tlocaleId = DEFAULT_LOCALE;\n\t}\n\n\tconst content = localeDataMap.get(localeId);\n\tif (!content) {\n\t\tthrow new Error(`CLDR data for locale ${localeId} is not loaded!`);\n\t}\n\n\treturn content;\n};\n\n// load bundle over the network once\nconst _loadCldrOnce = (localeId: string) => {\n\tif (!cldrPromises.get(localeId)) {\n\t\tconst loadCldr = loaders.get(localeId);\n\n\t\tif (!loadCldr) {\n\t\t\tthrow new Error(`CLDR data for locale ${localeId} is not loaded!`);\n\t\t}\n\n\t\tcldrPromises.set(localeId, loadCldr(localeId));\n\t}\n\n\treturn cldrPromises.get(localeId);\n};\n\n// external getAsync\nconst fetchCldr = async (language: string, region: string, script: string) => {\n\tconst localeId = calcLocale(language, region, script);\n\n\t// reuse OpenUI5 CLDR if present\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (openUI5Support) {\n\t\tconst cldrContent = openUI5Support.getLocaleDataObject();\n\t\tif (cldrContent) {\n\t\t\t// only if openui5 actually returned valid content\n\t\t\tsetLocaleData(localeId, cldrContent);\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// fetch it\n\ttry {\n\t\tconst cldrContent = await _loadCldrOnce(localeId);\n\t\tsetLocaleData(localeId, cldrContent as CLDRData);\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tif (!reportedErrors.has(e.message)) {\n\t\t\treportedErrors.add(e.message);\n\t\t\tconsole.error(e.message); /* eslint-disable-line */\n\t\t}\n\t}\n};\n\nconst registerLocaleDataLoader = (localeId: string, loader: LocaleDataLoader) => {\n\tloaders.set(localeId, loader);\n};\n\n// register default loader for \"en\" from ui5 CDN (dev workflow without assets)\nregisterLocaleDataLoader(\"en\", async () => {\n\tconst cldrContent = await fetch(`https://sdk.openui5.org/1.120.17/resources/sap/ui/core/cldr/en.json`);\n\treturn cldrContent.json() as Promise<CLDRData>;\n});\n\n// When the language changes dynamically (the user calls setLanguage),\n// re-fetch the required CDRD data.\nattachLanguageChange(() => {\n\tconst locale = getLocale();\n\treturn fetchCldr(locale.getLanguage(), locale.getRegion(), locale.getScript());\n});\n\nexport {\n\tregisterLocaleDataLoader,\n\tfetchCldr,\n\tgetLocaleData,\n};\n\nexport type {\n\tCLDRData,\n};\n"]}
1
+ {"version":3,"file":"LocaleData.js","sourceRoot":"","sources":["../../src/asset-registries/LocaleData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAMpD,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AO,KAAc,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,KAAc,CAAC;QACzB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;YACpC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YAC9B,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB;QACpD,CAAC;IACF,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,wBAAwB,GAAG,CAAC,QAAgB,EAAE,MAAwB,EAAE,EAAE;IAC/E,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,8EAA8E;AAC9E,wBAAwB,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE;IACzC,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,qEAAqE,CAAC,CAAC;IACvG,OAAO,WAAW,CAAC,IAAI,EAAuB,CAAC;AAChD,CAAC,CAAC,CAAC;AAEH,sEAAsE;AACtE,mCAAmC;AACnC,oBAAoB,CAAC,GAAG,EAAE;IACzB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,OAAO,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;AAChF,CAAC,CAAC,CAAC;AAEH,OAAO,EACN,wBAAwB,EACxB,SAAS,EACT,aAAa,GACb,CAAC","sourcesContent":["import { attachLanguageChange } from \"../locale/languageChange.js\";\nimport getLocale from \"../locale/getLocale.js\";\nimport { DEFAULT_LOCALE, SUPPORTED_LOCALES } from \"../generated/AssetParameters.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport type OpenUI5Support from \"../features/OpenUI5Support.js\";\n\ntype LocaleDataLoader = (locale: string) => Promise<CLDRData>;\ntype CLDRData = Record<string, object | boolean | string>;\n\nconst localeDataMap = new Map<string, CLDRData>();\nconst loaders = new Map<string, LocaleDataLoader>();\nconst cldrPromises = new Map<string, Promise<CLDRData>>();\nconst reportedErrors = new Set<string>();\nlet warningShown = false;\n\nconst M_ISO639_OLD_TO_NEW = {\n\t\"iw\": \"he\",\n\t\"ji\": \"yi\",\n\t\"in\": \"id\",\n};\n\nconst _showAssetsWarningOnce = (localeId: string) => {\n\tif (warningShown) {\n\t\treturn;\n\t}\n\n\tconsole.warn(`[LocaleData] Supported locale \"${localeId}\" not configured, import the \"Assets.js\" module from the webcomponents package you are using.`); /* eslint-disable-line */\n\n\twarningShown = true;\n};\n\nconst calcLocale = (language: string, region: string, script: string) => {\n\t// normalize language and handle special cases\n\tlanguage = (language && M_ISO639_OLD_TO_NEW[language as keyof typeof M_ISO639_OLD_TO_NEW]) || language;\n\t// Special case 1: in an SAP context, the inclusive language code \"no\" always means Norwegian Bokmal (\"nb\")\n\tif (language === \"no\") {\n\t\tlanguage = \"nb\";\n\t}\n\t// Special case 2: for Chinese, derive a default region from the script (this behavior is inherited from Java)\n\tif (language === \"zh\" && !region) {\n\t\tif (script === \"Hans\") {\n\t\t\tregion = \"CN\";\n\t\t} else if (script === \"Hant\") {\n\t\t\tregion = \"TW\";\n\t\t}\n\t}\n\n\t// Special case 3: for Serbian, there are cyrillic and latin scripts, \"sh\" and \"sr-latn\" map to \"latin\", \"sr\" maps to cyrillic.\n\tif (language === \"sh\" || (language === \"sr\" && script === \"Latn\")) {\n\t\tlanguage = \"sr\";\n\t\tregion = \"Latn\";\n\t}\n\n\t// try language + region\n\tlet localeId = `${language}_${region}`;\n\tif (SUPPORTED_LOCALES.includes(localeId)) {\n\t\tif (loaders.has(localeId)) {\n\t\t\t// supported and has loader\n\t\t\treturn localeId;\n\t\t}\n\n\t\t// supported, no loader - fallback to default and warn\n\t\t_showAssetsWarningOnce(localeId);\n\t\treturn DEFAULT_LOCALE;\n\t}\n\n\t// not supported, try language only\n\tlocaleId = language;\n\tif (SUPPORTED_LOCALES.includes(localeId)) {\n\t\tif (loaders.has(localeId)) {\n\t\t\t// supported and has loader\n\t\t\treturn localeId;\n\t\t}\n\n\t\t// supported, no loader - fallback to default and warn\n\t\t_showAssetsWarningOnce(localeId);\n\t\treturn DEFAULT_LOCALE;\n\t}\n\n\t// not supported - fallback to default locale\n\treturn DEFAULT_LOCALE;\n};\n\n// internal set data\nconst setLocaleData = (localeId: string, content: CLDRData) => {\n\tlocaleDataMap.set(localeId, content);\n};\n\n// external getSync\nconst getLocaleData = (localeId: string) => {\n\t// if there is no loader, the default fallback was fetched and a warning was given - use default locale instead\n\tif (!loaders.has(localeId)) {\n\t\tlocaleId = DEFAULT_LOCALE;\n\t}\n\n\tconst content = localeDataMap.get(localeId);\n\tif (!content) {\n\t\tthrow new Error(`CLDR data for locale ${localeId} is not loaded!`);\n\t}\n\n\treturn content;\n};\n\n// load bundle over the network once\nconst _loadCldrOnce = (localeId: string) => {\n\tif (!cldrPromises.get(localeId)) {\n\t\tconst loadCldr = loaders.get(localeId);\n\n\t\tif (!loadCldr) {\n\t\t\tthrow new Error(`CLDR data for locale ${localeId} is not loaded!`);\n\t\t}\n\n\t\tcldrPromises.set(localeId, loadCldr(localeId));\n\t}\n\n\treturn cldrPromises.get(localeId);\n};\n\n// external getAsync\nconst fetchCldr = async (language: string, region: string, script: string) => {\n\tconst localeId = calcLocale(language, region, script);\n\n\t// reuse OpenUI5 CLDR if present\n\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\tif (openUI5Support) {\n\t\tconst cldrContent = openUI5Support.getLocaleDataObject();\n\t\tif (cldrContent) {\n\t\t\t// only if openui5 actually returned valid content\n\t\t\tsetLocaleData(localeId, cldrContent);\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// fetch it\n\ttry {\n\t\tconst cldrContent = await _loadCldrOnce(localeId);\n\t\tsetLocaleData(localeId, cldrContent as CLDRData);\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tif (!reportedErrors.has(e.message)) {\n\t\t\treportedErrors.add(e.message);\n\t\t\tconsole.error(e.message); /* eslint-disable-line */\n\t\t}\n\t}\n};\n\nconst registerLocaleDataLoader = (localeId: string, loader: LocaleDataLoader) => {\n\tloaders.set(localeId, loader);\n};\n\n// register default loader for \"en\" from ui5 CDN (dev workflow without assets)\nregisterLocaleDataLoader(\"en\", async () => {\n\tconst cldrContent = await fetch(`https://sdk.openui5.org/1.120.17/resources/sap/ui/core/cldr/en.json`);\n\treturn cldrContent.json() as Promise<CLDRData>;\n});\n\n// When the language changes dynamically (the user calls setLanguage),\n// re-fetch the required CDRD data.\nattachLanguageChange(() => {\n\tconst locale = getLocale();\n\treturn fetchCldr(locale.getLanguage(), locale.getRegion(), locale.getScript());\n});\n\nexport {\n\tregisterLocaleDataLoader,\n\tfetchCldr,\n\tgetLocaleData,\n};\n\nexport type {\n\tCLDRData,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Themes.js","sourceRoot":"","sources":["../../src/asset-registries/Themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAKpE,MAAM,WAAW,GAAG,IAAI,GAAG,EAAqB,CAAC;AACjD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;AAC/C,MAAM,aAAa,GAAG,IAAI,GAAG,EAAuB,CAAC;AACrD,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAU,CAAC;AAC7C,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;AAE3C,MAAM,6BAA6B,GAAG,CAAC,WAAmB,EAAE,SAAiB,EAAE,MAAmB,EAAE,EAAE;IACrG,OAAO,CAAC,GAAG,CAAC,GAAG,WAAW,IAAI,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC;IACnD,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AAC;AACpC,CAAC,CAAC;AAEF,OAAO,EACN,6BAA6B,EAC7B,mCAAmC,EACnC,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,GACjB,CAAC","sourcesContent":["import { DEFAULT_THEME } from \"../generated/AssetParameters.js\";\nimport type { StyleData, StyleDataCSP } from \"../ManagedStyles.js\";\nimport { mergeStyles } from \"../ManagedStyles.js\";\nimport { fireThemeRegistered } from \"../theming/ThemeRegistered.js\";\n\ntype ThemeData = {_: StyleDataCSP } | StyleDataCSP | string;\ntype ThemeLoader = (themeName: string) => Promise<ThemeData>;\n\nconst themeStyles = new Map<string, StyleData>();\nconst loaders = new Map<string, ThemeLoader>();\nconst customLoaders = new Map<string, ThemeLoader>();\nconst registeredPackages = new Set<string>();\nconst registeredThemes = new Set<string>();\n\nconst registerThemePropertiesLoader = (packageName: string, themeName: string, loader: ThemeLoader) => {\n\tloaders.set(`${packageName}/${themeName}`, loader);\n\tregisteredPackages.add(packageName);\n\tregisteredThemes.add(themeName);\n\tfireThemeRegistered(themeName);\n};\n\nconst registerCustomThemePropertiesLoader = (packageName: string, themeName: string, loader: ThemeLoader) => {\n\tcustomLoaders.set(`${packageName}/${themeName}`, loader);\n};\n\nconst getThemeProperties = async (packageName: string, themeName: string, externalThemeName?: string) => {\n\tconst cacheKey = `${packageName}_${themeName}_${externalThemeName || \"\"}`;\n\tconst cachedStyleData = themeStyles.get(cacheKey);\n\tif (cachedStyleData !== undefined) { // it's valid for style to be an empty string\n\t\treturn cachedStyleData;\n\t}\n\n\tif (!registeredThemes.has(themeName)) {\n\t\tconst regThemesStr = [...registeredThemes.values()].join(\", \");\n\t\tconsole.warn(`You have requested a non-registered theme ${themeName} - falling back to ${DEFAULT_THEME}. Registered themes are: ${regThemesStr}`); /* eslint-disable-line */\n\t\treturn _getThemeProperties(packageName, DEFAULT_THEME);\n\t}\n\n\tconst [style, customStyle] = await Promise.all([\n\t\t_getThemeProperties(packageName, themeName),\n\t\texternalThemeName ? _getThemeProperties(packageName, externalThemeName, true) : undefined,\n\t]);\n\n\tconst styleData = mergeStyles(style, customStyle);\n\tif (styleData) {\n\t\tthemeStyles.set(cacheKey, styleData);\n\t}\n\n\treturn styleData;\n};\n\nconst _getThemeProperties = async (packageName: string, themeName: string, forCustomTheme = false) => {\n\tconst loadersMap = forCustomTheme ? customLoaders : loaders;\n\tconst loader = loadersMap.get(`${packageName}/${themeName}`);\n\tif (!loader) {\n\t\t// no themes for package\n\t\tif (!forCustomTheme) {\n\t\t\tconsole.error(`Theme [${themeName}] not registered for package [${packageName}]`); /* eslint-disable-line */\n\t\t}\n\t\treturn;\n\t}\n\tlet data;\n\ttry {\n\t\tdata = await loader(themeName);\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tconsole.error(packageName, e.message); /* eslint-disable-line */\n\t\treturn;\n\t}\n\n\tconst themeProps = (data as {_: StyleDataCSP})._ || data; // Refactor: remove _ everywhere\n\treturn themeProps;\n};\n\nconst getRegisteredPackages = () => {\n\treturn registeredPackages;\n};\n\nconst isThemeRegistered = (theme: string) => {\n\treturn registeredThemes.has(theme);\n};\n\nexport {\n\tregisterThemePropertiesLoader,\n\tregisterCustomThemePropertiesLoader,\n\tgetThemeProperties,\n\tgetRegisteredPackages,\n\tisThemeRegistered,\n};\n\nexport type {\n\tThemeData,\n\tThemeLoader,\n};\n"]}
1
+ {"version":3,"file":"Themes.js","sourceRoot":"","sources":["../../src/asset-registries/Themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAKpE,MAAM,WAAW,GAAG,IAAI,GAAG,EAAqB,CAAC;AACjD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAuB,CAAC;AAC/C,MAAM,aAAa,GAAG,IAAI,GAAG,EAAuB,CAAC;AACrD,MAAM,kBA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C,yBAAyB;QAChE,OAAO;IACR,CAAC;IAED,MAAM,UAAU,GAAI,IAA0B,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,gCAAgC;IAC1F,OAAO,UAAU,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,GAAG,EAAE;IAClC,OAAO,kBAAkB,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAE,EAAE;IAC3C,OAAO,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,OAAO,EACN,6BAA6B,EAC7B,mCAAmC,EACnC,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,GACjB,CAAC","sourcesContent":["import { DEFAULT_THEME } from \"../generated/AssetParameters.js\";\nimport type { StyleData, StyleDataCSP } from \"../ManagedStyles.js\";\nimport { mergeStyles } from \"../ManagedStyles.js\";\nimport { fireThemeRegistered } from \"../theming/ThemeRegistered.js\";\n\ntype ThemeData = {_: StyleDataCSP } | StyleDataCSP | string;\ntype ThemeLoader = (themeName: string) => Promise<ThemeData>;\n\nconst themeStyles = new Map<string, StyleData>();\nconst loaders = new Map<string, ThemeLoader>();\nconst customLoaders = new Map<string, ThemeLoader>();\nconst registeredPackages = new Set<string>();\nconst registeredThemes = new Set<string>();\n\nconst registerThemePropertiesLoader = (packageName: string, themeName: string, loader: ThemeLoader) => {\n\tloaders.set(`${packageName}/${themeName}`, loader);\n\tregisteredPackages.add(packageName);\n\tregisteredThemes.add(themeName);\n\tfireThemeRegistered(themeName);\n};\n\nconst registerCustomThemePropertiesLoader = (packageName: string, themeName: string, loader: ThemeLoader) => {\n\tcustomLoaders.set(`${packageName}/${themeName}`, loader);\n};\n\nconst getThemeProperties = async (packageName: string, themeName: string, externalThemeName?: string) => {\n\tconst cacheKey = `${packageName}_${themeName}_${externalThemeName || \"\"}`;\n\tconst cachedStyleData = themeStyles.get(cacheKey);\n\tif (cachedStyleData !== undefined) { // it's valid for style to be an empty string\n\t\treturn cachedStyleData;\n\t}\n\n\tif (!registeredThemes.has(themeName)) {\n\t\tconst regThemesStr = [...registeredThemes.values()].join(\", \");\n\t\tconsole.warn(`You have requested a non-registered theme ${themeName} - falling back to ${DEFAULT_THEME}. Registered themes are: ${regThemesStr}`); /* eslint-disable-line */\n\t\treturn _getThemeProperties(packageName, DEFAULT_THEME);\n\t}\n\n\tconst [style, customStyle] = await Promise.all([\n\t\t_getThemeProperties(packageName, themeName),\n\t\texternalThemeName ? _getThemeProperties(packageName, externalThemeName, true) : undefined,\n\t]);\n\n\tconst styleData = mergeStyles(style, customStyle);\n\tif (styleData) {\n\t\tthemeStyles.set(cacheKey, styleData);\n\t}\n\n\treturn styleData;\n};\n\nconst _getThemeProperties = async (packageName: string, themeName: string, forCustomTheme = false) => {\n\tconst loadersMap = forCustomTheme ? customLoaders : loaders;\n\tconst loader = loadersMap.get(`${packageName}/${themeName}`);\n\tif (!loader) {\n\t\t// no themes for package\n\t\tif (!forCustomTheme) {\n\t\t\tconsole.error(`Theme [${themeName}] not registered for package [${packageName}]`); /* eslint-disable-line */\n\t\t}\n\t\treturn;\n\t}\n\tlet data;\n\ttry {\n\t\tdata = await loader(themeName);\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tconsole.error(packageName, e.message); /* eslint-disable-line */\n\t\treturn;\n\t}\n\n\tconst themeProps = (data as {_: StyleDataCSP})._ || data; // Refactor: remove _ everywhere\n\treturn themeProps;\n};\n\nconst getRegisteredPackages = () => {\n\treturn registeredPackages;\n};\n\nconst isThemeRegistered = (theme: string) => {\n\treturn registeredThemes.has(theme);\n};\n\nexport {\n\tregisterThemePropertiesLoader,\n\tregisterCustomThemePropertiesLoader,\n\tgetThemeProperties,\n\tgetRegisteredPackages,\n\tisThemeRegistered,\n};\n\nexport type {\n\tThemeData,\n\tThemeLoader,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src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AA8G;AAC9G,oBAAoB,CAAC,CAAC,IAAY,CAAC,yBAAyB,EAAE,EAAE;IAC/D,MAAM,WAAW,GAAG,CAAC,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3C,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC;AAEH,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,iBAAiB,GACjB,CAAC","sourcesContent":["import getLocale from \"../locale/getLocale.js\";\nimport { attachLanguageChange } from \"../locale/languageChange.js\";\nimport normalizeLocale from \"../locale/normalizeLocale.js\";\nimport nextFallbackLocale from \"../locale/nextFallbackLocale.js\";\nimport { DEFAULT_LANGUAGE } from \"../generated/AssetParameters.js\";\nimport { getFetchDefaultLanguage } from \"../config/Language.js\";\n\ntype I18nLoader = (localeId: string) => Promise<I18nData>;\ntype I18nData = Record<string, string>;\n\n// contains package names for which the warning has been shown\nconst warningShown = new Set();\nconst reportedErrors = new Set();\n\nconst bundleData = new Map<string, I18nData | null>();\nconst bundlePromises = new Map<string, Promise<I18nData>>();\nconst loaders = new Map<string, I18nLoader>();\n\n/**\n * Registers i18n loader function for given package and locale.\n *\n * @public\n * @param {string} packageName for which package this loader can fetch data\n * @param {string} localeId locale that this loader can handle\n * @param {function} loader async function that will be passed a localeId and should return a JSON object\n */\nconst registerI18nLoader = (packageName: string, localeId: string, loader: I18nLoader) => {\n\t// register loader by key\n\tconst bundleKey = `${packageName}/${localeId}`;\n\tloaders.set(bundleKey, loader);\n};\n\nconst _setI18nBundleData = (packageName: string, data: I18nData | null) => {\n\tbundleData.set(packageName, data);\n};\n\nconst getI18nBundleData = (packageName: string) => {\n\treturn bundleData.get(packageName);\n};\n\nconst _hasLoader = (packageName: string, localeId: string) => {\n\tconst bundleKey = `${packageName}/${localeId}`;\n\treturn loaders.has(bundleKey);\n};\n\n// load bundle over the network once\nconst _loadMessageBundleOnce = (packageName: string, localeId: string) => {\n\tconst bundleKey = `${packageName}/${localeId}`;\n\tconst loadMessageBundle = loaders.get(bundleKey);\n\n\tif (loadMessageBundle && !bundlePromises.get(bundleKey)) {\n\t\tbundlePromises.set(bundleKey, loadMessageBundle(localeId));\n\t}\n\n\treturn bundlePromises.get(bundleKey)!; // Investigate if i18n loader exists and this won't return undefined.\n};\n\nconst _showAssetsWarningOnce = (packageName: string) => {\n\tif (!warningShown.has(packageName)) {\n\t\tconsole.warn(`[${packageName}]: Message bundle assets are not configured. Falling back to English texts.`, /* eslint-disable-line */\n\t\t\t` Add \\`import \"${packageName}/dist/Assets.js\"\\` in your bundle and make sure your build tool supports dynamic imports and JSON imports. See section \"Assets\" in the documentation for more information.`); /* eslint-disable-line */\n\t\twarningShown.add(packageName);\n\t}\n};\n\nconst useFallbackBundle = (packageName: string, localeId: string) => {\n\treturn localeId !== DEFAULT_LANGUAGE && !_hasLoader(packageName, localeId);\n};\n\n/**\n * This method preforms the asynchronous task of fetching the actual text resources. It will fetch\n * each text resource over the network once (even for multiple calls to the same method).\n * It should be fully finished before the i18nBundle class is created in the webcomponents.\n * This method uses the bundle URLs that are populated by the `registerI18nBundle` method.\n * To simplify the usage, the synchronization of both methods happens internally for the same `bundleId`\n * @param {packageName} packageName the NPM package name\n * @public\n */\nconst fetchI18nBundle = async (packageName: string) => {\n\tconst language = getLocale().getLanguage();\n\tconst region = getLocale().getRegion();\n\tconst variant = getLocale().getVariant();\n\tlet localeId = language + (region ? `-${region}` : ``) + (variant ? `-${variant}` : ``);\n\n\tif (useFallbackBundle(packageName, localeId)) {\n\t\tlocaleId = normalizeLocale(localeId);\n\n\t\twhile (useFallbackBundle(packageName, localeId)) {\n\t\t\tlocaleId = nextFallbackLocale(localeId);\n\t\t}\n\t}\n\n\t// use default language unless configured to always fetch it from the network\n\tconst fetchDefaultLanguage = getFetchDefaultLanguage();\n\tif (localeId === DEFAULT_LANGUAGE && !fetchDefaultLanguage) {\n\t\t_setI18nBundleData(packageName, null); // reset for the default language (if data was set for a previous language)\n\t\treturn;\n\t}\n\n\tif (!_hasLoader(packageName, localeId)) {\n\t\t_showAssetsWarningOnce(packageName);\n\t\treturn;\n\t}\n\n\ttry {\n\t\tconst data = await _loadMessageBundleOnce(packageName, localeId);\n\t\t_setI18nBundleData(packageName, data);\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tif (!reportedErrors.has(e.message)) {\n\t\t\treportedErrors.add(e.message);\n\t\t\tconsole.error(e.message); /* eslint-disable-line */\n\t\t}\n\t}\n};\n\n// When the language changes dynamically (the user calls setLanguage), re-fetch all previously fetched bundles\nattachLanguageChange((lang: string /* eslint-disable-line */) => {\n\tconst allPackages = [...bundleData.keys()];\n\treturn Promise.all(allPackages.map(fetchI18nBundle));\n});\n\nexport {\n\tregisterI18nLoader,\n\tfetchI18nBundle,\n\tgetI18nBundleData,\n};\n"]}
1
+ {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/asset-registries/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,kBAAkB,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAKhE,8DAA8D;AAC9D,MAAM,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC;AAC/B,MAAM,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;AAEjC,MAAM,UAAU,GAAG,IAAI,GAAG,EAA2B,CAAC;AACtD,MAAM,cAAc,GAAG,IAAI,GAAG,EAA6B,CAAC;AAC5D,MAAM,OAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;AAE9C;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,CAAC,WAAmB,E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CAAC;QAC5D,kBAAkB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,2EAA2E;QAClH,OAAO;IACR,CAAC;IAED,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC;QACxC,sBAAsB,CAAC,WAAW,CAAC,CAAC;QACpC,OAAO;IACR,CAAC;IAED,IAAI,CAAC;QACJ,MAAM,IAAI,GAAG,MAAM,sBAAsB,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QACjE,kBAAkB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,KAAc,CAAC;QACzB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;YACpC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YAC9B,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAyB;QACpD,CAAC;IACF,CAAC;AACF,CAAC,CAAC;AAEF,8GAA8G;AAC9G,oBAAoB,CAAC,CAAC,IAAY,CAAC,yBAAyB,EAAE,EAAE;IAC/D,MAAM,WAAW,GAAG,CAAC,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3C,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC;AAEH,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,iBAAiB,GACjB,CAAC","sourcesContent":["import getLocale from \"../locale/getLocale.js\";\nimport { attachLanguageChange } from \"../locale/languageChange.js\";\nimport normalizeLocale from \"../locale/normalizeLocale.js\";\nimport nextFallbackLocale from \"../locale/nextFallbackLocale.js\";\nimport { DEFAULT_LANGUAGE } from \"../generated/AssetParameters.js\";\nimport { getFetchDefaultLanguage } from \"../config/Language.js\";\n\ntype I18nLoader = (localeId: string) => Promise<I18nData>;\ntype I18nData = Record<string, string>;\n\n// contains package names for which the warning has been shown\nconst warningShown = new Set();\nconst reportedErrors = new Set();\n\nconst bundleData = new Map<string, I18nData | null>();\nconst bundlePromises = new Map<string, Promise<I18nData>>();\nconst loaders = new Map<string, I18nLoader>();\n\n/**\n * Registers i18n loader function for given package and locale.\n *\n * @public\n * @param {string} packageName for which package this loader can fetch data\n * @param {string} localeId locale that this loader can handle\n * @param {function} loader async function that will be passed a localeId and should return a JSON object\n */\nconst registerI18nLoader = (packageName: string, localeId: string, loader: I18nLoader) => {\n\t// register loader by key\n\tconst bundleKey = `${packageName}/${localeId}`;\n\tloaders.set(bundleKey, loader);\n};\n\nconst _setI18nBundleData = (packageName: string, data: I18nData | null) => {\n\tbundleData.set(packageName, data);\n};\n\nconst getI18nBundleData = (packageName: string) => {\n\treturn bundleData.get(packageName);\n};\n\nconst _hasLoader = (packageName: string, localeId: string) => {\n\tconst bundleKey = `${packageName}/${localeId}`;\n\treturn loaders.has(bundleKey);\n};\n\n// load bundle over the network once\nconst _loadMessageBundleOnce = (packageName: string, localeId: string) => {\n\tconst bundleKey = `${packageName}/${localeId}`;\n\tconst loadMessageBundle = loaders.get(bundleKey);\n\n\tif (loadMessageBundle && !bundlePromises.get(bundleKey)) {\n\t\tbundlePromises.set(bundleKey, loadMessageBundle(localeId));\n\t}\n\n\treturn bundlePromises.get(bundleKey)!; // Investigate if i18n loader exists and this won't return undefined.\n};\n\nconst _showAssetsWarningOnce = (packageName: string) => {\n\tif (!warningShown.has(packageName)) {\n\t\tconsole.warn(`[${packageName}]: Message bundle assets are not configured. Falling back to English texts.`, /* eslint-disable-line */\n\t\t\t` Add \\`import \"${packageName}/dist/Assets.js\"\\` in your bundle and make sure your build tool supports dynamic imports and JSON imports. See section \"Assets\" in the documentation for more information.`); /* eslint-disable-line */\n\t\twarningShown.add(packageName);\n\t}\n};\n\nconst useFallbackBundle = (packageName: string, localeId: string) => {\n\treturn localeId !== DEFAULT_LANGUAGE && !_hasLoader(packageName, localeId);\n};\n\n/**\n * This method preforms the asynchronous task of fetching the actual text resources. It will fetch\n * each text resource over the network once (even for multiple calls to the same method).\n * It should be fully finished before the i18nBundle class is created in the webcomponents.\n * This method uses the bundle URLs that are populated by the `registerI18nBundle` method.\n * To simplify the usage, the synchronization of both methods happens internally for the same `bundleId`\n * @param {packageName} packageName the NPM package name\n * @public\n */\nconst fetchI18nBundle = async (packageName: string) => {\n\tconst language = getLocale().getLanguage();\n\tconst region = getLocale().getRegion();\n\tconst variant = getLocale().getVariant();\n\tlet localeId = language + (region ? `-${region}` : ``) + (variant ? `-${variant}` : ``);\n\n\tif (useFallbackBundle(packageName, localeId)) {\n\t\tlocaleId = normalizeLocale(localeId);\n\n\t\twhile (useFallbackBundle(packageName, localeId)) {\n\t\t\tlocaleId = nextFallbackLocale(localeId);\n\t\t}\n\t}\n\n\t// use default language unless configured to always fetch it from the network\n\tconst fetchDefaultLanguage = getFetchDefaultLanguage();\n\tif (localeId === DEFAULT_LANGUAGE && !fetchDefaultLanguage) {\n\t\t_setI18nBundleData(packageName, null); // reset for the default language (if data was set for a previous language)\n\t\treturn;\n\t}\n\n\tif (!_hasLoader(packageName, localeId)) {\n\t\t_showAssetsWarningOnce(packageName);\n\t\treturn;\n\t}\n\n\ttry {\n\t\tconst data = await _loadMessageBundleOnce(packageName, localeId);\n\t\t_setI18nBundleData(packageName, data);\n\t} catch (error: unknown) {\n\t\tconst e = error as Error;\n\t\tif (!reportedErrors.has(e.message)) {\n\t\t\treportedErrors.add(e.message);\n\t\t\tconsole.error(e.message); /* eslint-disable-line */\n\t\t}\n\t}\n};\n\n// When the language changes dynamically (the user calls setLanguage), re-fetch all previously fetched bundles\nattachLanguageChange((lang: string /* eslint-disable-line */) => {\n\tconst allPackages = [...bundleData.keys()];\n\treturn Promise.all(allPackages.map(fetchI18nBundle));\n});\n\nexport {\n\tregisterI18nLoader,\n\tfetchI18nBundle,\n\tgetI18nBundleData,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IconCollectionsAlias.js","sourceRoot":"","sources":["../../../src/asset-registries/util/IconCollectionsAlias.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,IAAK,oBAKJ;AALD,WAAK,oBAAoB;IACxB,kDAA4B,CAAA;IAC5B,gDAA0B,CAAA;IAC1B,6CAAuB,CAAA;IACvB,oEAA8C,CAAA;AAC/C,CAAC,EALI,oBAAoB,KAApB,oBAAoB,QAKxB;AAED;;;;;;;;;GASG;AACH,MAAM,wBAAwB,GAAG,CAAC,cAAsB,EAAE,EAAE;IAC3D,IAAI,oBAAoB,CAAC,cAAmD,CAAC,EAAE;QAC9E,OAAO,oBAAoB,CAAC,cAAmD,CAAC,CAAC;KACjF;IAED,OAAO,cAAc,CAAC;AACvB,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC;AACpC,OAAO,EACN,wBAAwB,GACxB,CAAC","sourcesContent":["/**\n * Supported icon collection aliases.\n *\n * Users might specify a collection, using both the key and the value in the following key-value pairs,\n * e.g the following pairs are completely exchangeable:\n *\n * - \"SAP-icons/accept\" and \"SAP-icons-v4/accept\"\n * - \"horizon/accept\" and \"SAP-icons-v5/accept\"\n * - \"SAP-icons-TNT/actor\" and \"tnt/actor\"\n * - \"BusinessSuiteInAppSymbols/3d\" and \"business-suite/3d\"\n */\nenum IconCollectionsAlias {\n\t\"SAP-icons\" = \"SAP-icons-v4\",\n\t\"horizon\" = \"SAP-icons-v5\",\n\t\"SAP-icons-TNT\" = \"tnt\",\n\t\"BusinessSuiteInAppSymbols\" = \"business-suite\",\n}\n\n/**\n * Returns the collection name for a given alias:\n *\n * - \"SAP-icons-TNT\"resolves to \"tnt\"\n * - \"BusinessSuiteInAppSymbols\" resolves to \"business-suite\"\n * - \"horizon\" resolves to \"SAP-icons-v5\"\n *\n * @param { string } collectionName\n * @return { string } the normalized collection name\n */\nconst getIconCollectionByAlias = (collectionName: string) => {\n\tif (IconCollectionsAlias[collectionName as keyof typeof IconCollectionsAlias]) {\n\t\treturn IconCollectionsAlias[collectionName as keyof typeof IconCollectionsAlias];\n\t}\n\n\treturn collectionName;\n};\n\nexport default IconCollectionsAlias;\nexport {\n\tgetIconCollectionByAlias,\n};\n"]}
1
+ {"version":3,"file":"IconCollectionsAlias.js","sourceRoot":"","sources":["../../../src/asset-registries/util/IconCollectionsAlias.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,IAAK,oBAKJ;AALD,WAAK,oBAAoB;IACxB,kDAA4B,CAAA;IAC5B,gDAA0B,CAAA;IAC1B,6CAAuB,CAAA;IACvB,oEAA8C,CAAA;AAC/C,CAAC,EALI,oBAAoB,KAApB,oBAAoB,QAKxB;AAED;;;;;;;;;GASG;AACH,MAAM,wBAAwB,GAAG,CAAC,cAAsB,EAAE,EAAE;IAC3D,IAAI,oBAAoB,CAAC,cAAmD,CAAC,EAAE,CAAC;QAC/E,OAAO,oBAAoB,CAAC,cAAmD,CAAC,CAAC;IAClF,CAAC;IAED,OAAO,cAAc,CAAC;AACvB,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC;AACpC,OAAO,EACN,wBAAwB,GACxB,CAAC","sourcesContent":["/**\n * Supported icon collection aliases.\n *\n * Users might specify a collection, using both the key and the value in the following key-value pairs,\n * e.g the following pairs are completely exchangeable:\n *\n * - \"SAP-icons/accept\" and \"SAP-icons-v4/accept\"\n * - \"horizon/accept\" and \"SAP-icons-v5/accept\"\n * - \"SAP-icons-TNT/actor\" and \"tnt/actor\"\n * - \"BusinessSuiteInAppSymbols/3d\" and \"business-suite/3d\"\n */\nenum IconCollectionsAlias {\n\t\"SAP-icons\" = \"SAP-icons-v4\",\n\t\"horizon\" = \"SAP-icons-v5\",\n\t\"SAP-icons-TNT\" = \"tnt\",\n\t\"BusinessSuiteInAppSymbols\" = \"business-suite\",\n}\n\n/**\n * Returns the collection name for a given alias:\n *\n * - \"SAP-icons-TNT\"resolves to \"tnt\"\n * - \"BusinessSuiteInAppSymbols\" resolves to \"business-suite\"\n * - \"horizon\" resolves to \"SAP-icons-v5\"\n *\n * @param { string } collectionName\n * @return { string } the normalized collection name\n */\nconst getIconCollectionByAlias = (collectionName: string) => {\n\tif (IconCollectionsAlias[collectionName as keyof typeof IconCollectionsAlias]) {\n\t\treturn IconCollectionsAlias[collectionName as keyof typeof IconCollectionsAlias];\n\t}\n\n\treturn collectionName;\n};\n\nexport default IconCollectionsAlias;\nexport {\n\tgetIconCollectionByAlias,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IconCollectionsByTheme.js","sourceRoot":"","sources":["../../../src/asset-registries/util/IconCollectionsByTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,IAAK,wBAOJ;AAPD,WAAK,wBAAwB;IAC5B,uDAA2B,CAAA;IAC3B,uDAA2B,CAAA;IAC3B,oDAAwB,CAAA;IACxB,oDAAwB,CAAA;IACxB,8DAAkC,CAAA;IAClC,8DAAkC,CAAA;AACnC,CAAC,EAPI,wBAAwB,KAAxB,wBAAwB,QAO5B;AAID,MAAM,eAAe,GAAG,IAAI,GAAG,EAAgC,CAAC;AAChE,eAAe,CAAC,GAAG,CAAC,WAAW,EAAE;IAChC,QAAQ,EAAE,wBAAwB,CAAC,UAAU;IAC7C,aAAa,EAAE,wBAAwB,CAAC,UAAU;CAClD,CAAC,CAAC;AACH,eAAe,CAAC,GAAG,CAAC,KAAK,EAAE;IAC1B,QAAQ,EAAE,wBAAwB,CAAC,aAAa;IAChD,aAAa,EAAE,wBAAwB,CAAC,aAAa;CACrD,CAAC,CAAC;AACH,eAAe,CAAC,GAAG,CAAC,gBAAgB,EAAE;IACrC,QAAQ,EAAE,wBAAwB,CAAC,YAAY;IAC/C,aAAa,EAAE,wBAAwB,CAAC,YAAY;CACpD,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,8BAA8B,GAAG,CAAC,cAAsB,EAAE,kBAAwC,EAAE,EAAE;IAC3G,IAAI,eAAe,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;QACxC,eAAe,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,GAAG,kBAAkB,EAAE,GAAG,eAAe,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;QACvG,OAAO;KACP;IACD,eAAe,CAAC,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;AACzD,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,cAAsB,EAAE,EAAE;IAC5D,MAAM,WAAW,GAAG,mBAAmB,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC;IACrE,OAAO,eAAe,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,cAAc,CAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC;AACjH,CAAC,CAAC;AAEF,OAAO,EACN,8BAA8B,EAC9B,yBAAyB,EACzB,wBAAwB,GACxB,CAAC","sourcesContent":["import { isLegacyThemeFamily } from \"../../config/Theme.js\";\n\nenum RegisteredIconCollection {\n\tSAPIconsV4 = \"SAP-icons-v4\",\n\tSAPIconsV5 = \"SAP-icons-v5\",\n\tSAPIconsTNTV2 = \"tnt-v2\",\n\tSAPIconsTNTV3 = \"tnt-v3\",\n\tSAPBSIconsV1 = \"business-suite-v1\",\n\tSAPBSIconsV2 = \"business-suite-v2\",\n}\n\ntype ThemeToCollectionMap = {[x: string]: string; };\n\nconst iconCollections = new Map<string, ThemeToCollectionMap>();\niconCollections.set(\"SAP-icons\", {\n\t\"legacy\": RegisteredIconCollection.SAPIconsV4,\n\t\"sap_horizon\": RegisteredIconCollection.SAPIconsV5,\n});\niconCollections.set(\"tnt\", {\n\t\"legacy\": RegisteredIconCollection.SAPIconsTNTV2,\n\t\"sap_horizon\": RegisteredIconCollection.SAPIconsTNTV3,\n});\niconCollections.set(\"business-suite\", {\n\t\"legacy\": RegisteredIconCollection.SAPBSIconsV1,\n\t\"sap_horizon\": RegisteredIconCollection.SAPBSIconsV2,\n});\n\n/**\n * Registers collection version per theme.\n * **For exmaple:** registerIconCollectionForTheme(\"my-custom-icons\", {\"sap_horizon\": \"my-custom-icons-v5\"})\n * @param { string } collectionName\n * @param { ThemeToCollectionMap } themeCollectionMap\n */\nconst registerIconCollectionForTheme = (collectionName: string, themeCollectionMap: ThemeToCollectionMap) => {\n\tif (iconCollections.has(collectionName)) {\n\t\ticonCollections.set(collectionName, { ...themeCollectionMap, ...iconCollections.get(collectionName) });\n\t\treturn;\n\t}\n\ticonCollections.set(collectionName, themeCollectionMap);\n};\n\nconst getIconCollectionForTheme = (collectionName: string) => {\n\tconst themeFamily = isLegacyThemeFamily() ? \"legacy\" : \"sap_horizon\";\n\treturn iconCollections.has(collectionName) ? iconCollections.get(collectionName)![themeFamily] : collectionName;\n};\n\nexport {\n\tregisterIconCollectionForTheme,\n\tgetIconCollectionForTheme,\n\tRegisteredIconCollection,\n};\n"]}
1
+ {"version":3,"file":"IconCollectionsByTheme.js","sourceRoot":"","sources":["../../../src/asset-registries/util/IconCollectionsByTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,IAAK,wBAOJ;AAPD,WAAK,wBAAwB;IAC5B,uDAA2B,CAAA;IAC3B,uDAA2B,CAAA;IAC3B,oDAAwB,CAAA;IACxB,oDAAwB,CAAA;IACxB,8DAAkC,CAAA;IAClC,8DAAkC,CAAA;AACnC,CAAC,EAPI,wBAAwB,KAAxB,wBAAwB,QAO5B;AAID,MAAM,eAAe,GAAG,IAAI,GAAG,EAAgC,CAAC;AAChE,eAAe,CAAC,GAAG,CAAC,WAAW,EAAE;IAChC,QAAQ,EAAE,wBAAwB,CAAC,UAAU;IAC7C,aAAa,EAAE,wBAAwB,CAAC,UAAU;CAClD,CA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t-v3\",\n\tSAPBSIconsV1 = \"business-suite-v1\",\n\tSAPBSIconsV2 = \"business-suite-v2\",\n}\n\ntype ThemeToCollectionMap = {[x: string]: string; };\n\nconst iconCollections = new Map<string, ThemeToCollectionMap>();\niconCollections.set(\"SAP-icons\", {\n\t\"legacy\": RegisteredIconCollection.SAPIconsV4,\n\t\"sap_horizon\": RegisteredIconCollection.SAPIconsV5,\n});\niconCollections.set(\"tnt\", {\n\t\"legacy\": RegisteredIconCollection.SAPIconsTNTV2,\n\t\"sap_horizon\": RegisteredIconCollection.SAPIconsTNTV3,\n});\niconCollections.set(\"business-suite\", {\n\t\"legacy\": RegisteredIconCollection.SAPBSIconsV1,\n\t\"sap_horizon\": RegisteredIconCollection.SAPBSIconsV2,\n});\n\n/**\n * Registers collection version per theme.\n * **For exmaple:** registerIconCollectionForTheme(\"my-custom-icons\", {\"sap_horizon\": \"my-custom-icons-v5\"})\n * @param { string } collectionName\n * @param { ThemeToCollectionMap } themeCollectionMap\n */\nconst registerIconCollectionForTheme = (collectionName: string, themeCollectionMap: ThemeToCollectionMap) => {\n\tif (iconCollections.has(collectionName)) {\n\t\ticonCollections.set(collectionName, { ...themeCollectionMap, ...iconCollections.get(collectionName) });\n\t\treturn;\n\t}\n\ticonCollections.set(collectionName, themeCollectionMap);\n};\n\nconst getIconCollectionForTheme = (collectionName: string) => {\n\tconst themeFamily = isLegacyThemeFamily() ? \"legacy\" : \"sap_horizon\";\n\treturn iconCollections.has(collectionName) ? iconCollections.get(collectionName)![themeFamily] : collectionName;\n};\n\nexport {\n\tregisterIconCollectionForTheme,\n\tgetIconCollectionForTheme,\n\tRegisteredIconCollection,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"getIconCollectionByTheme.js","sourceRoot":"","sources":["../../../src/asset-registries/util/getIconCollectionByTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE;;;;;;;;;GASG;AACH,MAAM,0BAA0B,GAAG,CAAC,cAA+B,EAAkB,EAAE;IACtF,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEnE,uHAAuH;IACvH,IAAI,CAAC,cAAc,IAAI,qBAAqB,EAAE;QAC7C,OAAO,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;KACvD;IAED,4DAA4D;IAC5D,IAAI,CAAC,cAAc,EAAE;QACpB,OAAO,yBAAyB,CAAC,WAAW,CAAC,CAAC;KAC9C;IAED,wIAAwI;IACxI,OAAO,yBAAyB,CAAC,cAAc,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,eAAe,0BAA0B,CAAC","sourcesContent":["import { getTheme } from \"../../config/Theme.js\";\nimport type { IconCollection } from \"../../config/Icons.js\";\nimport { getDefaultIconCollection } from \"../../config/Icons.js\";\nimport { getIconCollectionByAlias } from \"./IconCollectionsAlias.js\";\nimport { getIconCollectionForTheme } from \"./IconCollectionsByTheme.js\";\n\n/**\n * Returns the effective theme dependant icon collection:\n *\n * - \"no collection\" resolves to \"SAP-icons-v4\" in \"Quartz\" and to \"SAP-icons-v5\" in \"Horizon\"\n * - \"tnt\" (and its alias \"SAP-icons-TNT\") resolves to \"tnt-v2\" in \"Quartz\" and resolves to \"tnt-v3\" in \"Horizon\"\n * - \"business-suite\" (and its alias \"BusinessSuiteInAppSymbols\") resolves to \"business-suite-v1\" in \"Quartz\" and resolves to \"business-suite-v2\" in \"Horizon\"\n *\n * @param { IconCollection } collectionName\n * @returns { IconCollection } the effective collection name\n */\nconst getEffectiveIconCollection = (collectionName?: IconCollection): IconCollection => {\n\tconst defaultIconCollection = getDefaultIconCollection(getTheme());\n\n\t// no collection + default collection, configured via setDefaultIconCollection - return the configured icon collection.\n\tif (!collectionName && defaultIconCollection) {\n\t\treturn getIconCollectionByAlias(defaultIconCollection);\n\t}\n\n\t// no collection - return \"SAP-icons-v4\" or \"SAP-icons-v5\".\n\tif (!collectionName) {\n\t\treturn getIconCollectionForTheme(\"SAP-icons\");\n\t}\n\n\t// has collection - return \"SAP-icons-v4\", \"SAP-icons-v5\", \"tnt-v1\", \"tnt-v2\", \"business-suite-v1\", \"business-suite-v2\", or custom ones.\n\treturn getIconCollectionForTheme(collectionName);\n};\n\nexport default getEffectiveIconCollection;\n"]}
1
+ {"version":3,"file":"getIconCollectionByTheme.js","sourceRoot":"","sources":["../../../src/asset-registries/util/getIconCollectionByTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE;;;;;;;;;GASG;AACH,MAAM,0BAA0B,GAAG,CAAC,cAA+B,EAAkB,EAAE;IACtF,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEnE,uHAAuH;IACvH,IAAI,CAAC,cAAc,IAAI,qBAAqB,EAAE,CAAC;QAC9C,OAAO,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;IACxD,CAAC;IAED,4DAA4D;IAC5D,IAAI,CAAC,cAAc,EAAE,CAAC;QACrB,OAAO,yBAAyB,CAAC,WAAW,CAAC,CAAC;IAC/C,CAAC;IAED,wIAAwI;IACxI,OAAO,yBAAyB,CAAC,cAAc,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,eAAe,0BAA0B,CAAC","sourcesContent":["import { getTheme } from \"../../config/Theme.js\";\nimport type { IconCollection } from \"../../config/Icons.js\";\nimport { getDefaultIconCollection } from \"../../config/Icons.js\";\nimport { getIconCollectionByAlias } from \"./IconCollectionsAlias.js\";\nimport { getIconCollectionForTheme } from \"./IconCollectionsByTheme.js\";\n\n/**\n * Returns the effective theme dependant icon collection:\n *\n * - \"no collection\" resolves to \"SAP-icons-v4\" in \"Quartz\" and to \"SAP-icons-v5\" in \"Horizon\"\n * - \"tnt\" (and its alias \"SAP-icons-TNT\") resolves to \"tnt-v2\" in \"Quartz\" and resolves to \"tnt-v3\" in \"Horizon\"\n * - \"business-suite\" (and its alias \"BusinessSuiteInAppSymbols\") resolves to \"business-suite-v1\" in \"Quartz\" and resolves to \"business-suite-v2\" in \"Horizon\"\n *\n * @param { IconCollection } collectionName\n * @returns { IconCollection } the effective collection name\n */\nconst getEffectiveIconCollection = (collectionName?: IconCollection): IconCollection => {\n\tconst defaultIconCollection = getDefaultIconCollection(getTheme());\n\n\t// no collection + default collection, configured via setDefaultIconCollection - return the configured icon collection.\n\tif (!collectionName && defaultIconCollection) {\n\t\treturn getIconCollectionByAlias(defaultIconCollection);\n\t}\n\n\t// no collection - return \"SAP-icons-v4\" or \"SAP-icons-v5\".\n\tif (!collectionName) {\n\t\treturn getIconCollectionForTheme(\"SAP-icons\");\n\t}\n\n\t// has collection - return \"SAP-icons-v4\", \"SAP-icons-v5\", \"tnt-v1\", \"tnt-v2\", \"business-suite-v1\", \"business-suite-v2\", or custom ones.\n\treturn getIconCollectionForTheme(collectionName);\n};\n\nexport default getEffectiveIconCollection;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AnimationMode.js","sourceRoot":"","sources":["../../src/config/AnimationMode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,IAAI,gBAAgD,CAAC;AAErD,wBAAwB,CAAC,GAAG,EAAE;IAC7B,gBAAgB,GAAG,SAAS,CAAC;AAC9B,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,GAAuB,EAAE;IACjD,IAAI,gBAAgB,KAAK,SAAS,EAAE;QACnC,gBAAgB,GAAG,0BAA0B,EAAE,CAAC;KAChD;IAED,OAAO,gBAAgB,CAAC;AACzB,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,CAAC,aAAiC,EAAE,EAAE;IAC9D,MAAM,OAAO,GAAa,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IACvD,IAAI,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE;QACpC,gBAAgB,GAAG,aAAa,CAAC;KACjC;AACF,CAAC,CAAC;AAEF,OAAO,EACN,gBAAgB,EAChB,gBAAgB,GAChB,CAAC","sourcesContent":["import { getAnimationMode as getConfiguredAnimationMode } from \"../InitialConfiguration.js\";\nimport AnimationMode from \"../types/AnimationMode.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\nlet curAnimationMode: `${AnimationMode}` | undefined;\n\nattachConfigurationReset(() => {\n\tcurAnimationMode = undefined;\n});\n\n/**\n * Returns the animation mode - \"full\", \"basic\", \"minimal\" or \"none\".\n * @public\n * @returns { AnimationMode }\n */\nconst getAnimationMode = (): `${AnimationMode}` => {\n\tif (curAnimationMode === undefined) {\n\t\tcurAnimationMode = getConfiguredAnimationMode();\n\t}\n\n\treturn curAnimationMode;\n};\n\n/**\n * Sets the animation mode - \"full\", \"basic\", \"minimal\" or \"none\".\n * @public\n * @param { AnimationMode } animationMode\n */\nconst setAnimationMode = (animationMode: `${AnimationMode}`) => {\n\tconst options: string[] = Object.values(AnimationMode);\n\tif (options.includes(animationMode)) {\n\t\tcurAnimationMode = animationMode;\n\t}\n};\n\nexport {\n\tgetAnimationMode,\n\tsetAnimationMode,\n};\n"]}
1
+ {"version":3,"file":"AnimationMode.js","sourceRoot":"","sources":["../../src/config/AnimationMode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,aAAa,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,IAAI,gBAAgD,CAAC;AAErD,wBAAwB,CAAC,GAAG,EAAE;IAC7B,gBAAgB,GAAG,SAAS,CAAC;AAC9B,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,GAAuB,EAAE;IACjD,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACpC,gBAAgB,GAAG,0BAA0B,EAAE,CAAC;IACjD,CAAC;IAED,OAAO,gBAAgB,CAAC;AACzB,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,CAAC,aAAiC,EAAE,EAAE;IAC9D,MAAM,OAAO,GAAa,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IACvD,IAAI,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;QACrC,gBAAgB,GAAG,aAAa,CAAC;IAClC,CAAC;AACF,CAAC,CAAC;AAEF,OAAO,EACN,gBAAgB,EAChB,gBAAgB,GAChB,CAAC","sourcesContent":["import { getAnimationMode as getConfiguredAnimationMode } from \"../InitialConfiguration.js\";\nimport AnimationMode from \"../types/AnimationMode.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\nlet curAnimationMode: `${AnimationMode}` | undefined;\n\nattachConfigurationReset(() => {\n\tcurAnimationMode = undefined;\n});\n\n/**\n * Returns the animation mode - \"full\", \"basic\", \"minimal\" or \"none\".\n * @public\n * @returns { AnimationMode }\n */\nconst getAnimationMode = (): `${AnimationMode}` => {\n\tif (curAnimationMode === undefined) {\n\t\tcurAnimationMode = getConfiguredAnimationMode();\n\t}\n\n\treturn curAnimationMode;\n};\n\n/**\n * Sets the animation mode - \"full\", \"basic\", \"minimal\" or \"none\".\n * @public\n * @param { AnimationMode } animationMode\n */\nconst setAnimationMode = (animationMode: `${AnimationMode}`) => {\n\tconst options: string[] = Object.values(AnimationMode);\n\tif (options.includes(animationMode)) {\n\t\tcurAnimationMode = animationMode;\n\t}\n};\n\nexport {\n\tgetAnimationMode,\n\tsetAnimationMode,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarType.js","sourceRoot":"","sources":["../../src/config/CalendarType.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EACN,eAAe,IAAI,yBAAyB,EAC5C,wBAAwB,IAAI,kCAAkC,GAC9D,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,IAAI,YAAsC,CAAC;AAC3C,IAAI,qBAA+C,CAAC;AAEpD,wBAAwB,CAAC,GAAG,EAAE;IAC7B,YAAY,GAAG,SAAS,CAAC;IACzB,qBAAqB,GAAG,SAAS,CAAC;AACnC,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,eAAe,GAAG,GAAiB,EAAE;IAC1C,IAAI,YAAY,KAAK,SAAS,EAAE;QAC/B,YAAY,GAAG,yBAAyB,EAAE,CAAC;KAC3C;IAED,IAAI,YAAY,IAAI,YAAY,IAAI,YAAY,EAAE;QACjD,OAAO,YAAY,CAAC;KACpB;IAED,OAAO,YAAY,CAAC,SAAS,CAAC;AAC/B,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,wBAAwB,GAAG,GAA6B,EAAE;IAC/D,IAAI,qBAAqB,KAAK,SAAS,EAAE;QACxC,qBAAqB,GAAG,kCAAkC,EAAE,CAAC;KAC7D;IAED,IAAI,qBAAqB,IAAI,qBAAqB,IAAI,YAAY,EAAE;QACnE,OAAO,qBAAqB,CAAC;KAC7B;IAED,OAAO,qBAAqB,CAAC;AAC9B,CAAC,CAAC;AAEF,OAAO,EACN,eAAe,EACf,wBAAwB,GACxB,CAAC","sourcesContent":["import CalendarType from \"../types/CalendarType.js\";\nimport {\n\tgetCalendarType as getConfiguredCalendarType,\n\tgetSecondaryCalendarType as getConfiguredSecondaryCalendarType,\n} from \"../InitialConfiguration.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\nlet calendarType: CalendarType | undefined;\nlet secondaryCalendarType: CalendarType | undefined;\n\nattachConfigurationReset(() => {\n\tcalendarType = undefined;\n\tsecondaryCalendarType = undefined;\n});\n\n/**\n * Returns the configured or default calendar type.\n * @public\n * @returns { CalendarType } the effective calendar type\n */\nconst getCalendarType = (): CalendarType => {\n\tif (calendarType === undefined) {\n\t\tcalendarType = getConfiguredCalendarType();\n\t}\n\n\tif (calendarType && calendarType in CalendarType) {\n\t\treturn calendarType;\n\t}\n\n\treturn CalendarType.Gregorian;\n};\n\n/**\n * Returns the configured secondary calendar type.\n * @public\n * @returns { CalendarType | undefined } the effective calendar type\n * @since 1.18.0\n */\nconst getSecondaryCalendarType = (): CalendarType | undefined => {\n\tif (secondaryCalendarType === undefined) {\n\t\tsecondaryCalendarType = getConfiguredSecondaryCalendarType();\n\t}\n\n\tif (secondaryCalendarType && secondaryCalendarType in CalendarType) {\n\t\treturn secondaryCalendarType;\n\t}\n\n\treturn secondaryCalendarType;\n};\n\nexport {\n\tgetCalendarType,\n\tgetSecondaryCalendarType,\n};\n"]}
1
+ {"version":3,"file":"CalendarType.js","sourceRoot":"","sources":["../../src/config/CalendarType.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EACN,eAAe,IAAI,yBAAyB,EAC5C,wBAAwB,IAAI,kCAAkC,GAC9D,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,IAAI,YAAsC,CAAC;AAC3C,IAAI,qBAA+C,CAAC;AAEpD,wBAAwB,CAAC,GAAG,EAAE;IAC7B,YAAY,GAAG,SAAS,CAAC;IACzB,qBAAqB,GAAG,SAAS,CAAC;AACnC,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,eAAe,GAAG,GAAiB,EAAE;IAC1C,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAChC,YAAY,GAAG,yBAAyB,EAAE,CAAC;IAC5C,CAAC;IAED,IAAI,YAAY,IAAI,YAAY,IAAI,YAAY,EAAE,CAAC;QAClD,OAAO,YAAY,CAAC;IACrB,CAAC;IAED,OAAO,YAAY,CAAC,SAAS,CAAC;AAC/B,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,wBAAwB,GAAG,GAA6B,EAAE;IAC/D,IAAI,qBAAqB,KAAK,SAAS,EAAE,CAAC;QACzC,qBAAqB,GAAG,kCAAkC,EAAE,CAAC;IAC9D,CAAC;IAED,IAAI,qBAAqB,IAAI,qBAAqB,IAAI,YAAY,EAAE,CAAC;QACpE,OAAO,qBAAqB,CAAC;IAC9B,CAAC;IAED,OAAO,qBAAqB,CAAC;AAC9B,CAAC,CAAC;AAEF,OAAO,EACN,eAAe,EACf,wBAAwB,GACxB,CAAC","sourcesContent":["import CalendarType from \"../types/CalendarType.js\";\nimport {\n\tgetCalendarType as getConfiguredCalendarType,\n\tgetSecondaryCalendarType as getConfiguredSecondaryCalendarType,\n} from \"../InitialConfiguration.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\nlet calendarType: CalendarType | undefined;\nlet secondaryCalendarType: CalendarType | undefined;\n\nattachConfigurationReset(() => {\n\tcalendarType = undefined;\n\tsecondaryCalendarType = undefined;\n});\n\n/**\n * Returns the configured or default calendar type.\n * @public\n * @returns { CalendarType } the effective calendar type\n */\nconst getCalendarType = (): CalendarType => {\n\tif (calendarType === undefined) {\n\t\tcalendarType = getConfiguredCalendarType();\n\t}\n\n\tif (calendarType && calendarType in CalendarType) {\n\t\treturn calendarType;\n\t}\n\n\treturn CalendarType.Gregorian;\n};\n\n/**\n * Returns the configured secondary calendar type.\n * @public\n * @returns { CalendarType | undefined } the effective calendar type\n * @since 1.18.0\n */\nconst getSecondaryCalendarType = (): CalendarType | undefined => {\n\tif (secondaryCalendarType === undefined) {\n\t\tsecondaryCalendarType = getConfiguredSecondaryCalendarType();\n\t}\n\n\tif (secondaryCalendarType && secondaryCalendarType in CalendarType) {\n\t\treturn secondaryCalendarType;\n\t}\n\n\treturn secondaryCalendarType;\n};\n\nexport {\n\tgetCalendarType,\n\tgetSecondaryCalendarType,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Fonts.js","sourceRoot":"","sources":["../../src/config/Fonts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,IAAI,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AACtG,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,IAAI,kBAAuC,CAAC;AAE5C,wBAAwB,CAAC,GAAG,EAAE;IAC7B,kBAAkB,GAAG,SAAS,CAAC;AAChC,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,qBAAqB,GAAG,GAAY,EAAE;IAC3C,IAAI,kBAAkB,KAAK,SAAS,EAAE;QACrC,kBAAkB,GAAG,+BAA+B,EAAE,CAAC;KACvD;IAED,OAAO,kBAAkB,CAAC;AAC3B,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,qBAAqB,GAAG,CAAC,sBAA+B,EAAE,EAAE;IACjE,kBAAkB,GAAG,sBAAsB,CAAC;AAC7C,CAAC,CAAC;AAEF,OAAO,EACN,qBAAqB,EACrB,qBAAqB,GACrB,CAAC","sourcesContent":["import { getDefaultFontLoading as getConfiguredDefaultFontLoading } from \"../InitialConfiguration.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\nlet defaultFontLoading: boolean | undefined;\n\nattachConfigurationReset(() => {\n\tdefaultFontLoading = undefined;\n});\n\n/**\n * Returns if the \"defaultFontLoading\" configuration is set.\n * @public\n * @returns { boolean }\n */\nconst getDefaultFontLoading = (): boolean => {\n\tif (defaultFontLoading === undefined) {\n\t\tdefaultFontLoading = getConfiguredDefaultFontLoading();\n\t}\n\n\treturn defaultFontLoading;\n};\n\n/**\n * Defines the \"defaultFontLoading\" setting.\n *\n * - When set to \"true\" (default), all used font faces are fetched over the network.\n * - When set to \"false\", default font faces are not fetched automatically and must be managed separately.\n * @public\n * @param { boolean } defaultFontLoadingData\n */\nconst setDefaultFontLoading = (defaultFontLoadingData: boolean) => {\n\tdefaultFontLoading = defaultFontLoadingData;\n};\n\nexport {\n\tgetDefaultFontLoading,\n\tsetDefaultFontLoading,\n};\n"]}
1
+ {"version":3,"file":"Fonts.js","sourceRoot":"","sources":["../../src/config/Fonts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,IAAI,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AACtG,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,IAAI,kBAAuC,CAAC;AAE5C,wBAAwB,CAAC,GAAG,EAAE;IAC7B,kBAAkB,GAAG,SAAS,CAAC;AAChC,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,qBAAqB,GAAG,GAAY,EAAE;IAC3C,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACtC,kBAAkB,GAAG,+BAA+B,EAAE,CAAC;IACxD,CAAC;IAED,OAAO,kBAAkB,CAAC;AAC3B,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,qBAAqB,GAAG,CAAC,sBAA+B,EAAE,EAAE;IACjE,kBAAkB,GAAG,sBAAsB,CAAC;AAC7C,CAAC,CAAC;AAEF,OAAO,EACN,qBAAqB,EACrB,qBAAqB,GACrB,CAAC","sourcesContent":["import { getDefaultFontLoading as getConfiguredDefaultFontLoading } from \"../InitialConfiguration.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\nlet defaultFontLoading: boolean | undefined;\n\nattachConfigurationReset(() => {\n\tdefaultFontLoading = undefined;\n});\n\n/**\n * Returns if the \"defaultFontLoading\" configuration is set.\n * @public\n * @returns { boolean }\n */\nconst getDefaultFontLoading = (): boolean => {\n\tif (defaultFontLoading === undefined) {\n\t\tdefaultFontLoading = getConfiguredDefaultFontLoading();\n\t}\n\n\treturn defaultFontLoading;\n};\n\n/**\n * Defines the \"defaultFontLoading\" setting.\n *\n * - When set to \"true\" (default), all used font faces are fetched over the network.\n * - When set to \"false\", default font faces are not fetched automatically and must be managed separately.\n * @public\n * @param { boolean } defaultFontLoadingData\n */\nconst setDefaultFontLoading = (defaultFontLoadingData: boolean) => {\n\tdefaultFontLoading = defaultFontLoadingData;\n};\n\nexport {\n\tgetDefaultFontLoading,\n\tsetDefaultFontLoading,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FormatSettings.js","sourceRoot":"","sources":["../../src/config/FormatSettings.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAOnE,IAAI,cAA0C,CAAC;AAE/C,wBAAwB,CAAC,GAAG,EAAE;IAC7B,cAAc,GAAG,SAAS,CAAC;AAC5B,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,GAAuB,EAAE;IAClD,IAAI,cAAc,KAAK,SAAS,EAAE;QACjC,cAAc,GAAG,iBAAiB,EAAE,CAAC;KACrC;IAED,OAAO,cAAc,CAAC,cAAc,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,UAAU,CAA2B,mBAAmB,CAAC,CAAC;AAEpF,MAAM,gCAAgC,GAAG,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,gCAAgC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;AAEvI,OAAO,EACN,iBAAiB,EACjB,gCAAgC,GAChC,CAAC","sourcesContent":["import LegacyDateFormats from \"../features/LegacyDateFormats.js\";\nimport type { LegacyDateCalendarCustomizing } from \"../features/LegacyDateFormats.js\";\nimport { getFormatSettings } from \"../InitialConfiguration.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\ntype FormatSettings = {\n\tfirstDayOfWeek?: number,\n\tlegacyDateCalendarCustomizing?: LegacyDateCalendarCustomizing,\n};\n\nlet formatSettings: FormatSettings | undefined;\n\nattachConfigurationReset(() => {\n\tformatSettings = undefined;\n});\n\n/**\n * Returns the first day of the week from the configured format settings or based on the current locale.\n * @public\n * @returns {Number} 0 (Sunday) through 6 (Saturday)\n */\nconst getFirstDayOfWeek = (): number | undefined => {\n\tif (formatSettings === undefined) {\n\t\tformatSettings = getFormatSettings();\n\t}\n\n\treturn formatSettings.firstDayOfWeek;\n};\n\nconst legacyDateFormats = getFeature<typeof LegacyDateFormats>(\"LegacyDateFormats\");\n\nconst getLegacyDateCalendarCustomizing = legacyDateFormats ? LegacyDateFormats.getLegacyDateCalendarCustomizing : () => { return []; };\n\nexport {\n\tgetFirstDayOfWeek,\n\tgetLegacyDateCalendarCustomizing,\n};\n\nexport type { FormatSettings };\n"]}
1
+ {"version":3,"file":"FormatSettings.js","sourceRoot":"","sources":["../../src/config/FormatSettings.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAOnE,IAAI,cAA0C,CAAC;AAE/C,wBAAwB,CAAC,GAAG,EAAE;IAC7B,cAAc,GAAG,SAAS,CAAC;AAC5B,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,GAAuB,EAAE;IAClD,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QAClC,cAAc,GAAG,iBAAiB,EAAE,CAAC;IACtC,CAAC;IAED,OAAO,cAAc,CAAC,cAAc,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,UAAU,CAA2B,mBAAmB,CAAC,CAAC;AAEpF,MAAM,gCAAgC,GAAG,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,gCAAgC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;AAEvI,OAAO,EACN,iBAAiB,EACjB,gCAAgC,GAChC,CAAC","sourcesContent":["import LegacyDateFormats from \"../features/LegacyDateFormats.js\";\nimport type { LegacyDateCalendarCustomizing } from \"../features/LegacyDateFormats.js\";\nimport { getFormatSettings } from \"../InitialConfiguration.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\ntype FormatSettings = {\n\tfirstDayOfWeek?: number,\n\tlegacyDateCalendarCustomizing?: LegacyDateCalendarCustomizing,\n};\n\nlet formatSettings: FormatSettings | undefined;\n\nattachConfigurationReset(() => {\n\tformatSettings = undefined;\n});\n\n/**\n * Returns the first day of the week from the configured format settings or based on the current locale.\n * @public\n * @returns {Number} 0 (Sunday) through 6 (Saturday)\n */\nconst getFirstDayOfWeek = (): number | undefined => {\n\tif (formatSettings === undefined) {\n\t\tformatSettings = getFormatSettings();\n\t}\n\n\treturn formatSettings.firstDayOfWeek;\n};\n\nconst legacyDateFormats = getFeature<typeof LegacyDateFormats>(\"LegacyDateFormats\");\n\nconst getLegacyDateCalendarCustomizing = legacyDateFormats ? LegacyDateFormats.getLegacyDateCalendarCustomizing : () => { return []; };\n\nexport {\n\tgetFirstDayOfWeek,\n\tgetLegacyDateCalendarCustomizing,\n};\n\nexport type { FormatSettings };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Language.js","sourceRoot":"","sources":["../../src/config/Language.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,IAAI,qBAAqB,EACpC,uBAAuB,IAAI,iCAAiC,GAC5D,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,IAAI,WAA+B,CAAC;AACpC,IAAI,oBAAyC,CAAC;AAE9C,wBAAwB,CAAC,GAAG,EAAE;IAC7B,WAAW,GAAG,SAAS,CAAC;IACxB,oBAAoB,GAAG,SAAS,CAAC;AAClC,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,WAAW,GAAG,GAAuB,EAAE;IAC5C,IAAI,WAAW,KAAK,SAAS,EAAE;QAC9B,WAAW,GAAG,qBAAqB,EAAE,CAAC;KACtC;IACD,OAAO,WAAW,CAAC;AACpB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,GAAG,KAAK,EAAE,QAAgB,EAAiB,EAAE;IAC7D,IAAI,WAAW,KAAK,QAAQ,EAAE;QAC7B,OAAO;KACP;IAED,WAAW,GAAG,QAAQ,CAAC;IAEvB,IAAI,QAAQ,EAAE,EAAE;QACf,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QACnC,MAAM,sBAAsB,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;KACtD;AACF,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,GAAW,EAAE;IACvC,OAAO,gBAAgB,CAAC;AACzB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,uBAAuB,GAAG,CAAC,gBAAyB,EAAE,EAAE;IAC7D,oBAAoB,GAAG,gBAAgB,CAAC;AACzC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,GAAY,EAAE;IAC7C,IAAI,oBAAoB,KAAK,SAAS,EAAE;QACvC,oBAAoB,GAAG,iCAAiC,EAAE,CAAC;KAC3D;IAED,OAAO,oBAAoB,CAAC;AAC7B,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,GACvB,CAAC","sourcesContent":["import {\n\tgetLanguage as getConfiguredLanguage,\n\tgetFetchDefaultLanguage as getConfiguredFetchDefaultLanguage,\n} from \"../InitialConfiguration.js\";\nimport { fireLanguageChange } from \"../locale/languageChange.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport { DEFAULT_LANGUAGE } from \"../generated/AssetParameters.js\";\nimport { isBooted } from \"../Boot.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\nlet curLanguage: string | undefined;\nlet fetchDefaultLanguage: boolean | undefined;\n\nattachConfigurationReset(() => {\n\tcurLanguage = undefined;\n\tfetchDefaultLanguage = undefined;\n});\n\n/**\n * Returns the currently configured language, or the browser language as a fallback.\n * @public\n * @returns {string}\n */\nconst getLanguage = (): string | undefined => {\n\tif (curLanguage === undefined) {\n\t\tcurLanguage = getConfiguredLanguage();\n\t}\n\treturn curLanguage;\n};\n\n/**\n * Changes the current language, re-fetches all message bundles, updates all language-aware components\n * and returns a promise that resolves when all rendering is done.\n *\n * @param {string} language\n * @public\n * @returns {Promise<void>}\n */\nconst setLanguage = async (language: string): Promise<void> => {\n\tif (curLanguage === language) {\n\t\treturn;\n\t}\n\n\tcurLanguage = language;\n\n\tif (isBooted()) {\n\t\tawait fireLanguageChange(language);\n\t\tawait reRenderAllUI5Elements({ languageAware: true });\n\t}\n};\n\n/**\n * Returns the default languague.\n *\n * Note: Default language might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultLanguage = (): string => {\n\treturn DEFAULT_LANGUAGE;\n};\n\n/**\n * Defines if the default language, that is inlined, should be\n * fetched over the network instead of using the inlined one.\n * **Note:** By default the language will not be fetched.\n *\n * @public\n * @param {boolean} fetchDefaultLang\n */\nconst setFetchDefaultLanguage = (fetchDefaultLang: boolean) => {\n\tfetchDefaultLanguage = fetchDefaultLang;\n};\n\n/**\n * Returns if the default language, that is inlined, should be fetched over the network.\n * @public\n * @returns {boolean}\n */\nconst getFetchDefaultLanguage = (): boolean => {\n\tif (fetchDefaultLanguage === undefined) {\n\t\tfetchDefaultLanguage = getConfiguredFetchDefaultLanguage();\n\t}\n\n\treturn fetchDefaultLanguage;\n};\n\nexport {\n\tgetLanguage,\n\tsetLanguage,\n\tgetDefaultLanguage,\n\tsetFetchDefaultLanguage,\n\tgetFetchDefaultLanguage,\n};\n"]}
1
+ {"version":3,"file":"Language.js","sourceRoot":"","sources":["../../src/config/Language.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,IAAI,qBAAqB,EACpC,uBAAuB,IAAI,iCAAiC,GAC5D,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,IAAI,WAA+B,CAAC;AACpC,IAAI,oBAAyC,CAAC;AAE9C,wBAAwB,CAAC,GAAG,EAAE;IAC7B,WAAW,GAAG,SAAS,CAAC;IACxB,oBAAoB,GAAG,SAAS,CAAC;AAClC,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,WAAW,GAAG,GAAuB,EAAE;IAC5C,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC/B,WAAW,GAAG,qBAAqB,EAAE,CAAC;IACvC,CAAC;IACD,OAAO,WAAW,CAAC;AACpB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,GAAG,KAAK,EAAE,QAAgB,EAAiB,EAAE;IAC7D,IAAI,WAAW,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO;IACR,CAAC;IAED,WAAW,GAAG,QAAQ,CAAC;IAEvB,IAAI,QAAQ,EAAE,EAAE,CAAC;QAChB,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QACnC,MAAM,sBAAsB,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;AACF,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,GAAW,EAAE;IACvC,OAAO,gBAAgB,CAAC;AACzB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,uBAAuB,GAAG,CAAC,gBAAyB,EAAE,EAAE;IAC7D,oBAAoB,GAAG,gBAAgB,CAAC;AACzC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,GAAY,EAAE;IAC7C,IAAI,oBAAoB,KAAK,SAAS,EAAE,CAAC;QACxC,oBAAoB,GAAG,iCAAiC,EAAE,CAAC;IAC5D,CAAC;IAED,OAAO,oBAAoB,CAAC;AAC7B,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,GACvB,CAAC","sourcesContent":["import {\n\tgetLanguage as getConfiguredLanguage,\n\tgetFetchDefaultLanguage as getConfiguredFetchDefaultLanguage,\n} from \"../InitialConfiguration.js\";\nimport { fireLanguageChange } from \"../locale/languageChange.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport { DEFAULT_LANGUAGE } from \"../generated/AssetParameters.js\";\nimport { isBooted } from \"../Boot.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\nlet curLanguage: string | undefined;\nlet fetchDefaultLanguage: boolean | undefined;\n\nattachConfigurationReset(() => {\n\tcurLanguage = undefined;\n\tfetchDefaultLanguage = undefined;\n});\n\n/**\n * Returns the currently configured language, or the browser language as a fallback.\n * @public\n * @returns {string}\n */\nconst getLanguage = (): string | undefined => {\n\tif (curLanguage === undefined) {\n\t\tcurLanguage = getConfiguredLanguage();\n\t}\n\treturn curLanguage;\n};\n\n/**\n * Changes the current language, re-fetches all message bundles, updates all language-aware components\n * and returns a promise that resolves when all rendering is done.\n *\n * @param {string} language\n * @public\n * @returns {Promise<void>}\n */\nconst setLanguage = async (language: string): Promise<void> => {\n\tif (curLanguage === language) {\n\t\treturn;\n\t}\n\n\tcurLanguage = language;\n\n\tif (isBooted()) {\n\t\tawait fireLanguageChange(language);\n\t\tawait reRenderAllUI5Elements({ languageAware: true });\n\t}\n};\n\n/**\n * Returns the default languague.\n *\n * Note: Default language might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultLanguage = (): string => {\n\treturn DEFAULT_LANGUAGE;\n};\n\n/**\n * Defines if the default language, that is inlined, should be\n * fetched over the network instead of using the inlined one.\n * **Note:** By default the language will not be fetched.\n *\n * @public\n * @param {boolean} fetchDefaultLang\n */\nconst setFetchDefaultLanguage = (fetchDefaultLang: boolean) => {\n\tfetchDefaultLanguage = fetchDefaultLang;\n};\n\n/**\n * Returns if the default language, that is inlined, should be fetched over the network.\n * @public\n * @returns {boolean}\n */\nconst getFetchDefaultLanguage = (): boolean => {\n\tif (fetchDefaultLanguage === undefined) {\n\t\tfetchDefaultLanguage = getConfiguredFetchDefaultLanguage();\n\t}\n\n\treturn fetchDefaultLanguage;\n};\n\nexport {\n\tgetLanguage,\n\tsetLanguage,\n\tgetDefaultLanguage,\n\tsetFetchDefaultLanguage,\n\tgetFetchDefaultLangu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,2BAA2B;IAC3B,IAAI,uBAAuB,CAAC,SAAS,CAAC,EAAE;QACvC,OAAO,KAAK,CAAC;KACb;IAED,8BAA8B;IAC9B,IAAI,EAAE,KAAK,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACZ;IAED,OAAO,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,OAAO,EACN,aAAa,EACb,aAAa,EACb,iBAAiB,GACjB,CAAC","sourcesContent":["import { getNoConflict as getConfiguredNoConflict } from \"../InitialConfiguration.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\n// Fire these events even with noConflict: true\nconst excludeList = [\n\t\"value-changed\",\n\t\"click\",\n];\n\ntype NoConflictData = boolean | { events: Array<string>};\n\nlet noConflict: NoConflictData | undefined;\n\nattachConfigurationReset(() => {\n\tnoConflict = undefined;\n});\n\nconst shouldFireOriginalEvent = (eventName: string) => {\n\treturn excludeList.includes(eventName);\n};\n\nconst shouldNotFireOriginalEvent = (eventName: string) => {\n\tconst nc = getNoConflict();\n\t// return !(nc.events && nc.events.includes && nc.events.includes(eventName));\n\treturn !(typeof nc !== \"boolean\" && nc.events && nc.events.includes && nc.events.includes(eventName));\n};\n\n/**\n * Returns if the \"noConflict\" configuration is set.\n * @public\n * @returns { NoConflictData }\n */\nconst getNoConflict = (): NoConflictData => {\n\tif (noConflict === undefined) {\n\t\tnoConflict = getConfiguredNoConflict();\n\t}\n\n\treturn noConflict;\n};\n\n/**\n * Sets the \"noConflict\" mode.\n * - When \"false\" (default value), all custom events are fired with and without the \"ui5-\" prefix.\n * - When \"true\", all custom events are fired with the \"ui5-\" prefix only.\n * - When an object is supplied, just the specified events will be fired with the \"ui5-\" prefix.\n * @public\n * @param { NoConflictData } noConflictData\n */\nconst setNoConflict = (noConflictData: NoConflictData) => {\n\tnoConflict = noConflictData;\n};\n\nconst skipOriginalEvent = (eventName: string) => {\n\tconst nc = getNoConflict();\n\n\t// Always fire these events\n\tif (shouldFireOriginalEvent(eventName)) {\n\t\treturn false;\n\t}\n\n\t// Read from the configuration\n\tif (nc === true) {\n\t\treturn true;\n\t}\n\n\treturn !shouldNotFireOriginalEvent(eventName);\n};\n\nexport {\n\tgetNoConflict,\n\tsetNoConflict,\n\tskipOriginalEvent,\n};\n"]}
1
+ {"version":3,"file":"NoConflict.js","sourceRoot":"","sources":["../../src/config/NoConflict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,+CAA+C;AAC/C,MAAM,WAAW,GAAG;IACnB,eAAe;IACf,OAAO;CACP,CAAC;AAIF,IAAI,UAAsC,CAAC;AAE3C,wBAAwB,CAAC,GAAG,EAAE;IAC7B,UAAU,GAAG,SAAS,CAAC;AACxB,CAAC,CAAC,CAAC;AAEH,MAAM,uBAAuB,GAAG,CAAC,SAAiB,EAAE,EAAE;IACrD,OAAO,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG,CAAC,SAAiB,EAAE,EAAE;IACxD,MAAM,EAAE,GAAG,aAAa,EAAE,CAAC;IAC3B,8EAA8E;IAC9E,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,SAAS,IAAI,EAAE,CAAC,MAAM,IAAI,EAAE,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;AACvG,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,aAAa,GAAG,GAAmB,EAAE;IAC1C,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC9B,UAAU,GAAG,uBAAuB,EAAE,CAAC;IACxC,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,aAAa,GAAG,CAAC,cAA8B,EAAE,EAAE;IACxD,UAAU,GAAG,cAAc,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,SAAiB,EAAE,EAAE;IAC/C,MAAM,EAAE,GAAG,aAAa,EAAE,CAAC;IAE3B,2BAA2B;IAC3B,IAAI,uBAAuB,CAAC,SAAS,CAAC,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC;IACd,CAAC;IAED,8BAA8B;IAC9B,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,OAAO,EACN,aAAa,EACb,aAAa,EACb,iBAAiB,GACjB,CAAC","sourcesContent":["import { getNoConflict as getConfiguredNoConflict } from \"../InitialConfiguration.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\n// Fire these events even with noConflict: true\nconst excludeList = [\n\t\"value-changed\",\n\t\"click\",\n];\n\ntype NoConflictData = boolean | { events: Array<string>};\n\nlet noConflict: NoConflictData | undefined;\n\nattachConfigurationReset(() => {\n\tnoConflict = undefined;\n});\n\nconst shouldFireOriginalEvent = (eventName: string) => {\n\treturn excludeList.includes(eventName);\n};\n\nconst shouldNotFireOriginalEvent = (eventName: string) => {\n\tconst nc = getNoConflict();\n\t// return !(nc.events && nc.events.includes && nc.events.includes(eventName));\n\treturn !(typeof nc !== \"boolean\" && nc.events && nc.events.includes && nc.events.includes(eventName));\n};\n\n/**\n * Returns if the \"noConflict\" configuration is set.\n * @public\n * @returns { NoConflictData }\n */\nconst getNoConflict = (): NoConflictData => {\n\tif (noConflict === undefined) {\n\t\tnoConflict = getConfiguredNoConflict();\n\t}\n\n\treturn noConflict;\n};\n\n/**\n * Sets the \"noConflict\" mode.\n * - When \"false\" (default value), all custom events are fired with and without the \"ui5-\" prefix.\n * - When \"true\", all custom events are fired with the \"ui5-\" prefix only.\n * - When an object is supplied, just the specified events will be fired with the \"ui5-\" prefix.\n * @public\n * @param { NoConflictData } noConflictData\n */\nconst setNoConflict = (noConflictData: NoConflictData) => {\n\tnoConflict = noConflictData;\n};\n\nconst skipOriginalEvent = (eventName: string) => {\n\tconst nc = getNoConflict();\n\n\t// Always fire these events\n\tif (shouldFireOriginalEvent(eventName)) {\n\t\treturn false;\n\t}\n\n\t// Read from the configuration\n\tif (nc === true) {\n\t\treturn true;\n\t}\n\n\treturn !shouldNotFireOriginalEvent(eventName);\n};\n\nexport {\n\tgetNoConflict,\n\tsetNoConflict,\n\tskipOriginalEvent,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.js","sourceRoot":"","sources":["../../src/config/Theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,qBAAqB,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,IAAI,QAA4B,CAAC;AAEjC,wBAAwB,CAAC,GAAG,EAAE;IAC7B,QAAQ,GAAG,SAAS,CAAC;AACtB,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,QAAQ,GAAG,GAAW,EAAE;IAC7B,IAAI,QAAQ,KAAK,SAAS,EAAE;QAC3B,QAAQ,GAAG,kBAAkB,EAAE,CAAC;KAChC;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,KAAK,EAAE,KAAa,EAAiB,EAAE;IACvD,IAA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ration.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport applyTheme from \"../theming/applyTheme.js\";\nimport getThemeDesignerTheme from \"../theming/getThemeDesignerTheme.js\";\nimport { DEFAULT_THEME, SUPPORTED_THEMES } from \"../generated/AssetParameters.js\";\nimport { boot, isBooted } from \"../Boot.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\nlet curTheme: string | undefined;\n\nattachConfigurationReset(() => {\n\tcurTheme = undefined;\n});\n\n/**\n * Returns the current theme.\n * @public\n * @returns {string} the current theme name\n */\nconst getTheme = (): string => {\n\tif (curTheme === undefined) {\n\t\tcurTheme = getConfiguredTheme();\n\t}\n\n\treturn curTheme;\n};\n\n/**\n * Applies a new theme after fetching its assets from the network.\n * @public\n * @param {string} theme the name of the new theme\n * @returns {Promise<void>} a promise that is resolved when the new theme assets have been fetched and applied to the DOM\n */\nconst setTheme = async (theme: string): Promise<void> => {\n\tif (curTheme === theme) {\n\t\treturn;\n\t}\n\n\tcurTheme = theme;\n\n\tif (isBooted()) {\n\t\t// Update CSS Custom Properties\n\t\tawait applyTheme(curTheme);\n\t\tawait reRenderAllUI5Elements({ themeAware: true });\n\t}\n};\n\n/**\n * Returns the default theme.\n *\n * Note: Default theme might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultTheme = (): string => {\n\treturn DEFAULT_THEME;\n};\n\n/**\n * Returns if the given theme name is the one currently applied.\n * @private\n * @param {string} theme\n * @returns {boolean}\n */\nconst isTheme = (theme: string) => {\n\tconst currentTheme = getTheme();\n\treturn currentTheme === theme || currentTheme === `${theme}_exp`;\n};\n\n/**\n * Returns if the currently set theme is part of legacy theme families (\"sap_fiori_3\").\n * **Note**: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.\n *\n * @private\n * @returns { boolean }\n */\nconst isLegacyThemeFamily = () => {\n\tconst currentTheme = getTheme();\n\n\tif (!isKnownTheme(currentTheme)) {\n\t\treturn !getThemeDesignerTheme()?.baseThemeName?.startsWith(\"sap_horizon\");\n\t}\n\n\treturn !currentTheme.startsWith(\"sap_horizon\");\n};\n\nconst isLegacyThemeFamilyAsync = async () => {\n\tawait boot();\n\treturn isLegacyThemeFamily();\n};\n\nconst isKnownTheme = (theme: string) => SUPPORTED_THEMES.includes(theme);\n\nexport {\n\tgetTheme,\n\tsetTheme,\n\tisTheme,\n\tisLegacyThemeFamily,\n\tisLegacyThemeFamilyAsync,\n\tgetDefaultTheme,\n};\n"]}
1
+ {"version":3,"file":"Theme.js","sourceRoot":"","sources":["../../src/config/Theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,qBAAqB,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,IAAI,QAA4B,CAAC;AAEjC,wBAAwB,CAAC,GAAG,EAAE;IAC7B,QAAQ,GAAG,SAAS,CAAC;AACtB,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,QAAQ,GAAG,GAAW,EAAE;IAC7B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC5B,QAAQ,GAAG,kBAAkB,EAAE,CAAC;IACjC,CAAC;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,QAAQ,GAAG,KAAK,EAAE,KAAa,EAAiB,EAAE;IACvD,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC;QACxB,OAAO;IACR,CAAC;IAED,QAAQ,GAAG,KAAK,CAAC;IAEjB,IAAI,QAAQ,EAAE,EAAE,CAAC;QAChB,+BAA+B;QAC/B,MAAM,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC3B,MAAM,sBAAsB,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IACpD,CAAC;AACF,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,eAAe,GAAG,GAAW,EAAE;IACpC,OAAO,aAAa,CAAC;AACtB,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAE;IACjC,MAAM,YAAY,GAAG,QAAQ,EAAE,CAAC;IAChC,OAAO,YAAY,KAAK,KAAK,IAAI,YAAY,KAAK,GAAG,KAAK,MAAM,CAAC;AAClE,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,mBAAmB,GAAG,GAAG,EAAE;IAChC,MAAM,YAAY,GAAG,QAAQ,EAAE,CAAC;IAEhC,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,CAAC;QACjC,OAAO,CAAC,qBAAqB,EAAE,EAAE,aAAa,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAChD,CAAC,CAAC;AAEF,MAAM,wBAAwB,GAAG,KAAK,IAAI,EAAE;IAC3C,MAAM,IAAI,EAAE,CAAC;IACb,OAAO,mBAAmB,EAAE,CAAC;AAC9B,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAEzE,OAAO,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,mBAAmB,EACnB,wBAAwB,EACxB,eAAe,GACf,CAAC","sourcesContent":["import { getTheme as getConfiguredTheme } from \"../InitialConfiguration.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport applyTheme from \"../theming/applyTheme.js\";\nimport getThemeDesignerTheme from \"../theming/getThemeDesignerTheme.js\";\nimport { DEFAULT_THEME, SUPPORTED_THEMES } from \"../generated/AssetParameters.js\";\nimport { boot, isBooted } from \"../Boot.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\nlet curTheme: string | undefined;\n\nattachConfigurationReset(() => {\n\tcurTheme = undefined;\n});\n\n/**\n * Returns the current theme.\n * @public\n * @returns {string} the current theme name\n */\nconst getTheme = (): string => {\n\tif (curTheme === undefined) {\n\t\tcurTheme = getConfiguredTheme();\n\t}\n\n\treturn curTheme;\n};\n\n/**\n * Applies a new theme after fetching its assets from the network.\n * @public\n * @param {string} theme the name of the new theme\n * @returns {Promise<void>} a promise that is resolved when the new theme assets have been fetched and applied to the DOM\n */\nconst setTheme = async (theme: string): Promise<void> => {\n\tif (curTheme === theme) {\n\t\treturn;\n\t}\n\n\tcurTheme = theme;\n\n\tif (isBooted()) {\n\t\t// Update CSS Custom Properties\n\t\tawait applyTheme(curTheme);\n\t\tawait reRenderAllUI5Elements({ themeAware: true });\n\t}\n};\n\n/**\n * Returns the default theme.\n *\n * Note: Default theme might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultTheme = (): string => {\n\treturn DEFAULT_THEME;\n};\n\n/**\n * Returns if the given theme name is the one currently applied.\n * @private\n * @param {string} theme\n * @returns {boolean}\n */\nconst isTheme = (theme: string) => {\n\tconst currentTheme = getTheme();\n\treturn currentTheme === theme || currentTheme === `${theme}_exp`;\n};\n\n/**\n * Returns if the currently set theme is part of legacy theme families (\"sap_fiori_3\").\n * **Note**: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.\n *\n * @private\n * @returns { boolean }\n */\nconst isLegacyThemeFamily = () => {\n\tconst currentTheme = getTheme();\n\n\tif (!isKnownTheme(currentTheme)) {\n\t\treturn !getThemeDesignerTheme()?.baseThemeName?.startsWith(\"sap_horizon\");\n\t}\n\n\treturn !currentTheme.startsWith(\"sap_horizon\");\n};\n\nconst isLegacyThemeFamilyAsync = async () => {\n\tawait boot();\n\treturn isLegacyThemeFamily();\n};\n\nconst isKnownTheme = (theme: string) => SUPPORTED_THEMES.includes(theme);\n\nexport {\n\tgetTheme,\n\tsetTheme,\n\tisTheme,\n\tisLegacyThemeFamily,\n\tisLegacyThemeFamilyAsync,\n\tgetDefaultTheme,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeRoot.js","sourceRoot":"","sources":["../../src/config/ThemeRoot.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAC3D,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,IAAI,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,IAAI,aAAiC,CAAC;AAEtC,wBAAwB,CAAC,GAAG,EAAE;IAC7B,aAAa,GAAG,SAAS,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,YAAY,GAAG,GAAuB,EAAE;IAC7C,IAAI,aAAa,KAAK,SAAS,EAAE;QAChC,aAAa,GAAG,sBAAsB,EAAE,CAAC;KACzC;IAED,OAAO,aAAa,CAAC;AACtB,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,YAAY,GAAG,CAAC,SAAiB,EAA6B,EAAE;IACrE,IAAI,aAAa,KAAK,SAAS,EAAE;QAChC,OAAO;KACP;IAED,aAAa,GAAG,SAAS,CAAC;IAE1B,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE;QAClC,OAAO,CAAC,IAAI,CAAC,OAAO,SAAS,0FAA0F,CAAC,CAAC,CAAC,sBAAsB;QAChJ,OAAO;KACP;IAED,OAAO,6BAA6B,CAAC,QAAQ,EAAE,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,EAAE;IACzC,OAAO,GAAG,YAAY,EAAG,gBAAgB,KAAK,oBAAoB,CAAC,CAAC,0CAA0C;AAC/G,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,KAAK,EAAE,KAAa,EAAiB,EAAE;IAC5E,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,gCAAgC,KAAK,IAAI,CAAC,CAAC;IAE/E,IAAI,IAAI,EAAE;QACT,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;KAChC;IAED,MAAM,gBAAgB,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,EAAE,4BAA4B,EAAE,KAAK,EAAE,CAAC,CAAC;AACzF,CAAC,CAAC;AAEF,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,6BAA6B,GAC7B,CAAC","sourcesContent":["import createLinkInHead from \"../util/createLinkInHead.js\";\nimport validateThemeRoot from \"../validateThemeRoot.js\";\nimport { getThemeRoot as getConfiguredThemeRoot } from \"../InitialConfiguration.js\";\nimport { getTheme } from \"./Theme.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\nlet currThemeRoot: string | undefined;\n\nattachConfigurationReset(() => {\n\tcurrThemeRoot = undefined;\n});\n\n/**\n * Returns the current theme root.\n *\n * @public\n * @since 1.14.0\n * @returns { string } the current theme root\n */\nconst getThemeRoot = (): string | undefined => {\n\tif (currThemeRoot === undefined) {\n\t\tcurrThemeRoot = getConfiguredThemeRoot();\n\t}\n\n\treturn currThemeRoot;\n};\n\n/**\n * Sets theme root for the current theme.\n * When set, the framework will validate the theme root and fetch the theme styles (CSS variables) from this location.\n *\n * **Note:** The feature is specific to custom themes, created with the `UI Theme Designer`.\n * The provided theme root is used only as a base to construct the actual location of the theme styles: `{themeRoot}/.../css_variables.css`.\n *\n * **Note:** Certain security restrictions will apply before fetching the theme assets.\n * Absolute URLs to a different origin than the current page will result in using the current page as an origin.\n * To allow specific origins, use &lt;meta name=\"sap-allowedThemeOrigins\" content=\"https://my-example-host.com/\"&gt; tag inside the &lt;head&gt; of the page.\n *\n * @public\n * @since 1.14.0\n * @param { string } themeRoot the new theme root\n * @returns { Promise<void> }\n */\nconst setThemeRoot = (themeRoot: string): Promise<void> | undefined => {\n\tif (currThemeRoot === themeRoot) {\n\t\treturn;\n\t}\n\n\tcurrThemeRoot = themeRoot;\n\n\tif (!validateThemeRoot(themeRoot)) {\n\t\tconsole.warn(`The ${themeRoot} is not valid. Check the allowed origins as suggested in the \"setThemeRoot\" description.`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\treturn attachCustomThemeStylesToHead(getTheme());\n};\n\nconst formatThemeLink = (theme: string) => {\n\treturn `${getThemeRoot()!}Base/baseLib/${theme}/css_variables.css`; // theme root is always set at this point.\n};\n\nconst attachCustomThemeStylesToHead = async (theme: string): Promise<void> => {\n\tconst link = document.querySelector(`[sap-ui-webcomponents-theme=\"${theme}\"]`);\n\n\tif (link) {\n\t\tdocument.head.removeChild(link);\n\t}\n\n\tawait createLinkInHead(formatThemeLink(theme), { \"sap-ui-webcomponents-theme\": theme });\n};\n\nexport {\n\tgetThemeRoot,\n\tsetThemeRoot,\n\tattachCustomThemeStylesToHead,\n};\n"]}
1
+ {"version":3,"file":"ThemeRoot.js","sourceRoot":"","sources":["../../src/config/ThemeRoot.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAC3D,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,IAAI,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,IAAI,aAAiC,CAAC;AAEtC,wBAAwB,CAAC,GAAG,EAAE;IAC7B,aAAa,GAAG,SAAS,CAAC;AAC3B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../validateThemeRoot.js\";\nimport { getThemeRoot as getConfiguredThemeRoot } from \"../InitialConfiguration.js\";\nimport { getTheme } from \"./Theme.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\nlet currThemeRoot: string | undefined;\n\nattachConfigurationReset(() => {\n\tcurrThemeRoot = undefined;\n});\n\n/**\n * Returns the current theme root.\n *\n * @public\n * @since 1.14.0\n * @returns { string } the current theme root\n */\nconst getThemeRoot = (): string | undefined => {\n\tif (currThemeRoot === undefined) {\n\t\tcurrThemeRoot = getConfiguredThemeRoot();\n\t}\n\n\treturn currThemeRoot;\n};\n\n/**\n * Sets theme root for the current theme.\n * When set, the framework will validate the theme root and fetch the theme styles (CSS variables) from this location.\n *\n * **Note:** The feature is specific to custom themes, created with the `UI Theme Designer`.\n * The provided theme root is used only as a base to construct the actual location of the theme styles: `{themeRoot}/.../css_variables.css`.\n *\n * **Note:** Certain security restrictions will apply before fetching the theme assets.\n * Absolute URLs to a different origin than the current page will result in using the current page as an origin.\n * To allow specific origins, use &lt;meta name=\"sap-allowedThemeOrigins\" content=\"https://my-example-host.com/\"&gt; tag inside the &lt;head&gt; of the page.\n *\n * @public\n * @since 1.14.0\n * @param { string } themeRoot the new theme root\n * @returns { Promise<void> }\n */\nconst setThemeRoot = (themeRoot: string): Promise<void> | undefined => {\n\tif (currThemeRoot === themeRoot) {\n\t\treturn;\n\t}\n\n\tcurrThemeRoot = themeRoot;\n\n\tif (!validateThemeRoot(themeRoot)) {\n\t\tconsole.warn(`The ${themeRoot} is not valid. Check the allowed origins as suggested in the \"setThemeRoot\" description.`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\treturn attachCustomThemeStylesToHead(getTheme());\n};\n\nconst formatThemeLink = (theme: string) => {\n\treturn `${getThemeRoot()!}Base/baseLib/${theme}/css_variables.css`; // theme root is always set at this point.\n};\n\nconst attachCustomThemeStylesToHead = async (theme: string): Promise<void> => {\n\tconst link = document.querySelector(`[sap-ui-webcomponents-theme=\"${theme}\"]`);\n\n\tif (link) {\n\t\tdocument.head.removeChild(link);\n\t}\n\n\tawait createLinkInHead(formatThemeLink(theme), { \"sap-ui-webcomponents-theme\": theme });\n};\n\nexport {\n\tgetThemeRoot,\n\tsetThemeRoot,\n\tattachCustomThemeStylesToHead,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Timezone.js","sourceRoot":"","sources":["../../src/config/Timezone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,IAAI,YAAgC,CAAC;AAErC,wBAAwB,CAAC,GAAG,EAAE;IAC7B,YAAY,GAAG,SAAS,CAAC;AAC1B,CAAC,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,WAAW,GAAG,GAAuB,EAAE;IAC5C,IAAI,YAAY,KAAK,SAAS,EAAE;QAC/B,YAAY,GAAG,qBAAqB,EAAE,CAAC;KACvC;IACD,OAAO,YAAY,CAAC;AACrB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAE,EAAE;IACxC,IAAI,YAAY,KAAK,QAAQ,EAAE;QAC9B,OAAO;KACP;IAED,YAAY,GAAG,QAAQ,CAAC;AACzB,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,WAAW,GACX,CAAC","sourcesContent":["import { getTimezone as getConfiguredTimezone } from \"../InitialConfiguration.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\nlet currTimezone: string | undefined;\n\nattachConfigurationReset(() => {\n\tcurrTimezone = undefined;\n});\n\n/**\n * Returns the configured IANA timezone ID.\n *\n * @private\n * @returns {string}\n */\nconst getTimezone = (): string | undefined => {\n\tif (currTimezone === undefined) {\n\t\tcurrTimezone = getConfiguredTimezone();\n\t}\n\treturn currTimezone;\n};\n\n/**\n * Sets the IANA timezone ID.\n * **For example:** \"America/New_York\", \"Europe/London\", \"Australia/Sydney\", \"Asia/Bishkek\", etc.\n *>\n * @param {string} timezone\n * @private\n * @returns { Promise<void> }\n */\nconst setTimezone = (timezone: string) => {\n\tif (currTimezone === timezone) {\n\t\treturn;\n\t}\n\n\tcurrTimezone = timezone;\n};\n\nexport {\n\tgetTimezone,\n\tsetTimezone,\n};\n"]}
1
+ {"version":3,"file":"Timezone.js","sourceRoot":"","sources":["../../src/config/Timezone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,IAAI,YAAgC,CAAC;AAErC,wBAAwB,CAAC,GAAG,EAAE;IAC7B,YAAY,GAAG,SAAS,CAAC;AAC1B,CAAC,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,WAAW,GAAG,GAAuB,EAAE;IAC5C,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAChC,YAAY,GAAG,qBAAqB,EAAE,CAAC;IACxC,CAAC;IACD,OAAO,YAAY,CAAC;AACrB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAE,EAAE;IACxC,IAAI,YAAY,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO;IACR,CAAC;IAED,YAAY,GAAG,QAAQ,CAAC;AACzB,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,WAAW,GACX,CAAC","sourcesContent":["import { getTimezone as getConfiguredTimezone } from \"../InitialConfiguration.js\";\nimport { attachConfigurationReset } from \"./ConfigurationReset.js\";\n\nlet currTimezone: string | undefined;\n\nattachConfigurationReset(() => {\n\tcurrTimezone = undefined;\n});\n\n/**\n * Returns the configured IANA timezone ID.\n *\n * @private\n * @returns {string}\n */\nconst getTimezone = (): string | undefined => {\n\tif (currTimezone === undefined) {\n\t\tcurrTimezone = getConfiguredTimezone();\n\t}\n\treturn currTimezone;\n};\n\n/**\n * Sets the IANA timezone ID.\n * **For example:** \"America/New_York\", \"Europe/London\", \"Australia/Sydney\", \"Asia/Bishkek\", etc.\n *>\n * @param {string} timezone\n * @private\n * @returns { Promise<void> }\n */\nconst setTimezone = (timezone: string) => {\n\tif (currTimezone === timezone) {\n\t\treturn;\n\t}\n\n\tcurrTimezone = timezone;\n};\n\nexport {\n\tgetTimezone,\n\tsetTimezone,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltips.js","sourceRoot":"","sources":["../../src/config/Tooltips.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,IAAI,kCAAkC,EAAE,MAAM,4BAA4B,CAAC;AAE5G,IAAI,sBAA+B,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,wBAAwB,GAAG,GAAY,EAAE;IAC9C,IAAI,sBAAsB,KAAK,SAAS,EAAE;QACzC,sBAAsB,GAAG,kCAAkC,EAAE,CAAC;KAC9D;IAED,OAAO,sBAAsB,CAAC;AAC/B,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,wBAAwB,GAAG,CAAC,qBAA8B,EAAE,EAAE;IACnE,sBAAsB,GAAG,qBAAqB,CAAC;AAChD,CAAC,CAAC;AAEF,OAAO,EACN,wBAAwB,EACxB,wBAAwB,GACxB,CAAC","sourcesContent":["import { getEnableDefaultTooltips as getConfiguredEnableDefaultTooltips } from \"../InitialConfiguration.js\";\n\nlet _enableDefaultTooltips: boolean;\n\n/**\n * Returns if the \"enableDefaultTooltips\" configuration is set.\n * @public\n * @since 2.1.0\n * @returns { boolean }\n */\nconst getEnableDefaultTooltips = (): boolean => {\n\tif (_enableDefaultTooltips === undefined) {\n\t\t_enableDefaultTooltips = getConfiguredEnableDefaultTooltips();\n\t}\n\n\treturn _enableDefaultTooltips;\n};\n\n/**\n * Defines the \"enableDefaultTooltips\" setting.\n *\n * - When set to \"true\" (default), the components will display default tooltips.\n * - When set to \"false\", the components will NOT display default tooltips.\n *\n * @public\n * @since 2.1.0\n * @param { boolean } enableDefaultTooltips\n */\nconst setEnableDefaultTooltips = (enableDefaultTooltips: boolean) => {\n\t_enableDefaultTooltips = enableDefaultTooltips;\n};\n\nexport {\n\tgetEnableDefaultTooltips,\n\tsetEnableDefaultTooltips,\n};\n"]}
1
+ {"version":3,"file":"Tooltips.js","sourceRoot":"","sources":["../../src/config/Tooltips.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,IAAI,kCAAkC,EAAE,MAAM,4BAA4B,CAAC;AAE5G,IAAI,sBAA+B,CAAC;AAEpC;;;;;GAKG;AACH,MAAM,wBAAwB,GAAG,GAAY,EAAE;IAC9C,IAAI,sBAAsB,KAAK,SAAS,EAAE,CAAC;QAC1C,sBAAsB,GAAG,kCAAkC,EAAE,CAAC;IAC/D,CAAC;IAED,OAAO,sBAAsB,CAAC;AAC/B,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,wBAAwB,GAAG,CAAC,qBAA8B,EAAE,EAAE;IACnE,sBAAsB,GAAG,qBAAqB,CAAC;AAChD,CAAC,CAAC;AAEF,OAAO,EACN,wBAAwB,EACxB,wBAAwB,GACxB,CAAC","sourcesContent":["import { getEnableDefaultTooltips as getConfiguredEnableDefaultTooltips } from \"../InitialConfiguration.js\";\n\nlet _enableDefaultTooltips: boolean;\n\n/**\n * Returns if the \"enableDefaultTooltips\" configuration is set.\n * @public\n * @since 2.1.0\n * @returns { boolean }\n */\nconst getEnableDefaultTooltips = (): boolean => {\n\tif (_enableDefaultTooltips === undefined) {\n\t\t_enableDefaultTooltips = getConfiguredEnableDefaultTooltips();\n\t}\n\n\treturn _enableDefaultTooltips;\n};\n\n/**\n * Defines the \"enableDefaultTooltips\" setting.\n *\n * - When set to \"true\" (default), the components will display default tooltips.\n * - When set to \"false\", the components will NOT display default tooltips.\n *\n * @public\n * @since 2.1.0\n * @param { boolean } enableDefaultTooltips\n */\nconst setEnableDefaultTooltips = (enableDefaultTooltips: boolean) => {\n\t_enableDefaultTooltips = enableDefaultTooltips;\n};\n\nexport {\n\tgetEnableDefaultTooltips,\n\tsetEnableDefaultTooltips,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"connectToComponent.js","sourceRoot":"","sources":["../src/connectToComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,MAAM,4BAA4B,GAAG,GAAG,CAAC,CAAC,uDAAuD;AACjG,MAAM,WAAW,GAAG,IAAI,GAAG,EAAuB,CAAC;AACnD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAoB,CAAC;AAS9C,MAAM,kBAAkB,GAAG,CAAC,OAAuB,EAA2B,EAAE;IAC/E,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1B,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAClC,MAAM,MAAM,GAAG,IAAI,CAAC,QAA6B,CAAqC,CAAC;IAEvF,IAAI,WAAoC,CAAC;IACzC,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,EAAE,EAAE;QAC1C,WAAW,GAAG,SAAS,CAAC,CAAC,8GAA8G;KACvI;SAAM,IAAI,MAAM,YAAY,WAAW,EAAE;QACzC,WAAW,GAAG,MAAM,CAAC;KACrB;SAAM;QACN,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAc,CAAC;QAChD,WAAW,GAAG,CAAC,QAAQ,CAAC,cAAc,IAAI,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,IAAI,SAAS,CAAC;KACxF;IAED,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,QAAQ,EAAE,CAAC;IACtC,MAAM,eAAe,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAE7C,mCAAmC;IACnC,IAAI,CAAC,WAAW,EAAE;QACjB,IAAI,eAAe,EAAE,EAAE,kCAAkC;YACxD,O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ClC;IAED,OAAO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import type UI5Element from \"./UI5Element.js\";\nimport { renderDeferred } from \"./Render.js\";\nimport type { Interval } from \"./types.js\";\n\nconst MISSING_ELEMENT_POLL_TIMEOUT = 500; // how often to poll for not-yet-in-DOM friend elements\nconst connections = new Map<string, HTMLElement>();\nconst intervals = new Map<string, Interval>();\n\ntype ConnectOptions = {\n\thost: UI5Element;\n\tpropName: string;\n\tonConnect?: (friend: HTMLElement) => void;\n\tonDisconnect?: (friend: HTMLElement) => void;\n}\n\nconst connectToComponent = (options: ConnectOptions): HTMLElement | undefined => {\n\tconst host = options.host;\n\tconst propName = options.propName;\n\tconst friend = host[propName as keyof typeof host] as HTMLElement | string | undefined;\n\n\tlet connectedTo: HTMLElement | undefined;\n\tif (friend === undefined || friend === \"\") {\n\t\tconnectedTo = undefined; // do not return early even if a \"menu\" property is not set - it may have been set before and cleanup must run\n\t} else if (friend instanceof HTMLElement) {\n\t\tconnectedTo = friend;\n\t} else {\n\t\tconst rootNode = host.getRootNode() as Document;\n\t\tconnectedTo = (rootNode.getElementById && rootNode.getElementById(friend)) || undefined;\n\t}\n\n\tconst key = `${host._id}-${propName}`;\n\tconst prevConnectedTo = connections.get(key);\n\n\t// Not connected - return undefined\n\tif (!connectedTo) {\n\t\tif (prevConnectedTo) { // but first disconnect, if needed\n\t\t\toptions.onDisconnect && options.onDisconnect(prevConnectedTo);\n\t\t\tconnections.delete(key);\n\t\t}\n\n\t\t// if friend element not in DOM yet, start polling\n\t\tif (typeof friend === \"string\" && friend && !intervals.has(key)) {\n\t\t\tconst interval = setInterval(() => {\n\t\t\t\tconst rootNode = host.getRootNode() as Document;\n\t\t\t\tconst found = (rootNode.getElementById && rootNode.getElementById(friend));\n\n\t\t\t\tif (found) {\n\t\t\t\t\tclearInterval(intervals.get(key));\n\t\t\t\t\tintervals.delete(key);\n\t\t\t\t\trenderDeferred(host);\n\t\t\t\t}\n\t\t\t}, MISSING_ELEMENT_POLL_TIMEOUT);\n\t\t\tintervals.set(key, interval);\n\t\t}\n\n\t\treturn;\n\t}\n\n\t// If connected, but still polling, stop polling\n\tif (intervals.has(key)) {\n\t\tclearInterval(intervals.get(key));\n\t\tintervals.delete(key);\n\t}\n\n\t// Connected - either for the first time, or to something else\n\tif (prevConnectedTo !== connectedTo) {\n\t\tif (prevConnectedTo) {\n\t\t\toptions.onDisconnect && options.onDisconnect(prevConnectedTo);\n\t\t}\n\t\toptions.onConnect && options.onConnect(connectedTo);\n\t\tconnections.set(key, connectedTo);\n\t}\n\n\treturn connections.get(key);\n};\n\nexport default connectToComponent;\n"]}
1
+ {"version":3,"file":"connectToComponent.js","sourceRoot":"","sources":["../src/connectToComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,MAAM,4BAA4B,GAAG,GAAG,CAAC,CAAC,uDAAuD;AACjG,MAAM,WAAW,GAAG,IAAI,GAAG,EAAuB,CAAC;AACnD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAoB,CAAC;AAS9C,MAAM,kBAAkB,GAAG,CAAC,OAAuB,EAA2B,EAAE;IAC/E,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1B,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAClC,MAAM,MAAM,GAAG,IAAI,CAAC,QAA6B,CAAqC,CAAC;IAEvF,IAAI,WAAoC,CAAC;IACzC,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,EAAE,EAAE,CAAC;QAC3C,WAAW,GAAG,SAAS,CAAC,CAAC,8GAA8G;IACxI,CAAC;SAAM,IAAI,MAAM,YAAY,WAAW,EAAE,CAAC;QAC1C,WAAW,GAAG,MAAM,CAAC;IACtB,CAAC;SAAM,CAAC;QACP,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EA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E,CAAC;QACxB,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAClC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IAED,8DAA8D;IAC9D,IAAI,eAAe,KAAK,WAAW,EAAE,CAAC;QACrC,IAAI,eAAe,EAAE,CAAC;YACrB,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACpD,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import type UI5Element from \"./UI5Element.js\";\nimport { renderDeferred } from \"./Render.js\";\nimport type { Interval } from \"./types.js\";\n\nconst MISSING_ELEMENT_POLL_TIMEOUT = 500; // how often to poll for not-yet-in-DOM friend elements\nconst connections = new Map<string, HTMLElement>();\nconst intervals = new Map<string, Interval>();\n\ntype ConnectOptions = {\n\thost: UI5Element;\n\tpropName: string;\n\tonConnect?: (friend: HTMLElement) => void;\n\tonDisconnect?: (friend: HTMLElement) => void;\n}\n\nconst connectToComponent = (options: ConnectOptions): HTMLElement | undefined => {\n\tconst host = options.host;\n\tconst propName = options.propName;\n\tconst friend = host[propName as keyof typeof host] as HTMLElement | string | undefined;\n\n\tlet connectedTo: HTMLElement | undefined;\n\tif (friend === undefined || friend === \"\") {\n\t\tconnectedTo = undefined; // do not return early even if a \"menu\" property is not set - it may have been set before and cleanup must run\n\t} else if (friend instanceof HTMLElement) {\n\t\tconnectedTo = friend;\n\t} else {\n\t\tconst rootNode = host.getRootNode() as Document;\n\t\tconnectedTo = (rootNode.getElementById && rootNode.getElementById(friend)) || undefined;\n\t}\n\n\tconst key = `${host._id}-${propName}`;\n\tconst prevConnectedTo = connections.get(key);\n\n\t// Not connected - return undefined\n\tif (!connectedTo) {\n\t\tif (prevConnectedTo) { // but first disconnect, if needed\n\t\t\toptions.onDisconnect && options.onDisconnect(prevConnectedTo);\n\t\t\tconnections.delete(key);\n\t\t}\n\n\t\t// if friend element not in DOM yet, start polling\n\t\tif (typeof friend === \"string\" && friend && !intervals.has(key)) {\n\t\t\tconst interval = setInterval(() => {\n\t\t\t\tconst rootNode = host.getRootNode() as Document;\n\t\t\t\tconst found = (rootNode.getElementById && rootNode.getElementById(friend));\n\n\t\t\t\tif (found) {\n\t\t\t\t\tclearInterval(intervals.get(key));\n\t\t\t\t\tintervals.delete(key);\n\t\t\t\t\trenderDeferred(host);\n\t\t\t\t}\n\t\t\t}, MISSING_ELEMENT_POLL_TIMEOUT);\n\t\t\tintervals.set(key, interval);\n\t\t}\n\n\t\treturn;\n\t}\n\n\t// If connected, but still polling, stop polling\n\tif (intervals.has(key)) {\n\t\tclearInterval(intervals.get(key));\n\t\tintervals.delete(key);\n\t}\n\n\t// Connected - either for the first time, or to something else\n\tif (prevConnectedTo !== connectedTo) {\n\t\tif (prevConnectedTo) {\n\t\t\toptions.onDisconnect && options.onDisconnect(prevConnectedTo);\n\t\t}\n\t\toptions.onConnect && options.onConnect(connectedTo);\n\t\tconnections.set(key, connectedTo);\n\t}\n\n\treturn connections.get(key);\n};\n\nexport default connectToComponent;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DOMReference.js","sourceRoot":"","sources":["../../src/converters/DOMReference.ts"],"names":[],"mappings":"AAAA,MAAM,qBAAqB,GAAG;IAC7B,WAAW,CAAC,aAAmC;QAC9C,IAAI,aAAa,YAAY,WAAW,EAAE;YACzC,OAAO,IAAI,CAAC;SACZ;QAED,OAAO,aAAa,CAAC;IACtB,CAAC;IACD,aAAa,CAAC,KAAoB;QACjC,OAAO,KAAK,CAAC;IACd,CAAC;CACD,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["const DOMReferenceConverter = {\n\ttoAttribute(propertyValue: string | HTMLElement) {\n\t\tif (propertyValue instanceof HTMLElement) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn propertyValue;\n\t},\n\tfromAttribute(value: string | null) {\n\t\treturn value;\n\t},\n};\n\nexport default DOMReferenceConverter;\n"]}
1
+ {"version":3,"file":"DOMReference.js","sourceRoot":"","sources":["../../src/converters/DOMReference.ts"],"names":[],"mappings":"AAAA,MAAM,qBAAqB,GAAG;IAC7B,WAAW,CAAC,aAAmC;QAC9C,IAAI,aAAa,YAAY,WAAW,EAAE,CAAC;YAC1C,OAAO,IAAI,CAAC;QACb,CAAC;QAED,OAAO,aAAa,CAAC;IACtB,CAAC;IACD,aAAa,CAAC,KAAoB;QACjC,OAAO,KAAK,CAAC;IACd,CAAC;CACD,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["const DOMReferenceConverter = {\n\ttoAttribute(propertyValue: string | HTMLElement) {\n\t\tif (propertyValue instanceof HTMLElement) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn propertyValue;\n\t},\n\tfromAttribute(value: string | null) {\n\t\treturn value;\n\t},\n};\n\nexport default DOMReferenceConverter;\n"]}