Socket
Socket
Sign inDemoInstall

@ui5/webcomponents-base

Package Overview
Dependencies
Maintainers
5
Versions
482
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ui5/webcomponents-base - npm Package Compare versions

Comparing version 1.14.6 to 1.14.7

dist/assets/Boot.25013294.js

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [1.14.7](https://github.com/SAP/ui5-webcomponents/compare/v1.14.6...v1.14.7) (2024-01-25)
### Bug Fixes
* **framework:** update openi5/core to 1.120.3 ([#8122](https://github.com/SAP/ui5-webcomponents/issues/8122)) ([727ef13](https://github.com/SAP/ui5-webcomponents/commit/727ef13ab0aed2dc93b9dc185e2341e55992ebc1))
## [1.14.6](https://github.com/SAP/ui5-webcomponents/compare/v1.14.5...v1.14.6) (2023-11-22)

@@ -8,0 +19,0 @@

2

dist/api.json

@@ -1,1 +0,1 @@

{"$schema-ref":"http://schemas.sap.com/sapui5/designtime/api.json/1.0","version":"1.62","symbols":[{"kind":"class","name":"I18nBundle","basename":"I18nBundle","resource":"i18nBundle.js","module":"i18nBundle","visibility":"public","constructor":{"visibility":"public"},"methods":[{"name":"getText","visibility":"public","returnValue":{"type":"string"},"parameters":[{"name":"textObj","type":"Object|String","optional":false,"description":"key/defaultText pair or just the key"},{"name":"params","type":"undefined","optional":false,"description":"Values for the placeholders"}],"description":"Returns a text in the currently loaded language"}]},{"kind":"class","name":"ItemNavigation","basename":"ItemNavigation","resource":"delegate/ItemNavigation.js","module":"delegate/ItemNavigation","visibility":"public","description":"The ItemNavigation class manages the calculations to determine the correct \"tabindex\" for a group of related items inside a root component. Important: ItemNavigation only does the calculations and does not change \"tabindex\" directly, this is a responsibility of the developer.\n\nThe keys that trigger ItemNavigation are: - Up/down - Left/right - Home/End\n\nUsage: 1) Use the \"getItemsCallback\" constructor property to pass a callback to ItemNavigation, which, whenever called, will return the list of items to navigate among.\n\nEach item passed to ItemNavigation via \"getItemsCallback\" must be: - A) either a UI5Element with a \"_tabIndex\" property - B) or an Object with \"id\" and \"_tabIndex\" properties which represents a part of the root component's shadow DOM. The \"id\" must be a valid ID within the shadow root of the component ItemNavigation operates on. This object must not be a DOM object because, as said, ItemNavigation will not set \"tabindex\" on it. It must be a representation of a DOM object only and the developer has the responsibility to update the \"tabindex\" in the component's DOM. - C) a combination of the above\n\nWhenever the user navigates with the keyboard, ItemNavigation will modify the \"_tabIndex\" properties of the items. It is the items' responsibilities to re-render themselves and apply the correct value of \"tabindex\" (i.e. to map the \"_tabIndex\" ItemNavigation set to them to the \"tabindex\" property). If the items of the ItemNavigation are UI5Elements themselves, this can happen naturally since they will be invalidated by their \"_tabIndex\" property. If the items are Objects with \"id\" and \"_tabIndex\" however, it is the developer's responsibility to apply these and the easiest way is to have the root component invalidated by ItemNavigation. To do so, set the \"affectedPropertiesNames\" constructor property to point to one or more of the root component's properties that need refreshing when \"_tabIndex\" is changed deeply.\n\n2) Call the \"setCurrentItem\" method of ItemNavigation whenever you want to change the current item. This is most commonly required if the user for example clicks on an item and thus selects it directly. Pass as the only argument to \"setCurrentItem\" the item that becomes current (must be one of the items, returned by \"getItemsCallback\").","constructor":{"visibility":"public","parameters":[{"name":"rootWebComponent","type":"undefined","optional":false,"description":"the component to operate on (component that slots or contains within its shadow root the items the user navigates among)"},{"name":"options","type":"ItemNavigationOptions","optional":false,"description":"Object with configuration options: - currentIndex: the index of the item that will be initially selected (from which navigation will begin) - navigationMode (Auto|Horizontal|Vertical): whether the items are displayed horizontally (Horizontal), vertically (Vertical) or as a matrix (Auto) meaning the user can navigate in both directions (up/down and left/right) - rowSize: tells how many items per row there are when the items are not rendered as a flat list but rather as a matrix. Relevant for navigationMode=Auto - skipItemsSize: tells how many items upon PAGE_UP and PAGE_DOWN should be skipped to applying the focus on the next item - behavior (Static|Cycling): tells what to do when trying to navigate beyond the first and last items Static means that nothing happens if the user tries to navigate beyond the first/last item. Cycling means that when the user navigates beyond the last item they go to the first and vice versa. - getItemsCallback: function that, when called, returns an array with all items the user can navigate among - affectedPropertiesNames: a list of metadata properties on the root component which, upon user navigation, will be reassigned by address thus causing the root component to invalidate"}]},"methods":[{"name":"setCurrentItem","visibility":"public","parameters":[{"name":"current","type":"undefined","optional":false,"description":"the new selected item"}],"description":"Call this method to set a new \"current\" (selected) item in the item navigation Note: the item passed to this function must be one of the items, returned by the getItemsCallback function"},{"name":"setRowSize","visibility":"public","parameters":[{"name":"newRowSize","type":"undefined","optional":false}],"description":"Call this method to dynamically change the row size"}]},{"kind":"namespace","name":"MediaRange.RANGESETS","basename":"RANGESETS","resource":"MediaRange.js","module":"MediaRange","export":"RANGESETS","static":true,"visibility":"public","description":"Enumeration containing the names and settings of predefined screen width media query range sets.","properties":[{"name":"RANGE_4STEPS","visibility":"public","static":true,"type":"undefined","description":"A 4-step range set (S-M-L-XL).\n\nThe ranges of this set are: <ul> <li><code>\"S\"</code>: For screens smaller than 600 pixels.</li> <li><code>\"M\"</code>: For screens greater than or equal to 600 pixels and smaller than 1024 pixels.</li> <li><code>\"L\"</code>: For screens greater than or equal to 1024 pixels and smaller than 1440 pixels.</li> <li><code>\"XL\"</code>: For screens greater than or equal to 1440 pixels.</li> </ul>"}],"slots":[]},{"kind":"class","name":"ResizeHandler","basename":"ResizeHandler","resource":"delegate/ResizeHandler.js","module":"delegate/ResizeHandler","visibility":"public","description":"Allows to register/deregister resize observers for a DOM element","constructor":{"visibility":"public"},"methods":[{"name":"deregister","visibility":"public","static":true,"parameters":[{"name":"element","type":"*","optional":false,"description":"UI5 Web Component or DOM Element to be unobserved"},{"name":"callback","type":"*","optional":false,"description":"Callback to be removed"}]},{"name":"register","visibility":"public","static":true,"parameters":[{"name":"element","type":"*","optional":false,"description":"UI5 Web Component or DOM Element to be observed"},{"name":"callback","type":"*","optional":false,"description":"Callback to be executed"}]}]},{"kind":"enum","name":"sap.ui.webc.base.types.AnimationMode","basename":"AnimationMode","resource":"types/AnimationMode.js","module":"types/AnimationMode","static":true,"visibility":"public","description":"Different types of AnimationMode.","properties":[{"name":"Basic","visibility":"public","type":"Basic"},{"name":"Full","visibility":"public","type":"Full"},{"name":"Minimal","visibility":"public","type":"Minimal"},{"name":"None","visibility":"public","type":"None"}],"slots":[]},{"kind":"enum","name":"sap.ui.webc.base.types.CalendarType","basename":"CalendarType","resource":"types/CalendarType.js","module":"types/CalendarType","static":true,"visibility":"public","description":"Different calendar types.","properties":[{"name":"Buddhist","visibility":"public","type":"Buddhist"},{"name":"Gregorian","visibility":"public","type":"Gregorian"},{"name":"Islamic","visibility":"public","type":"Islamic"},{"name":"Japanese","visibility":"public","type":"Japanese"},{"name":"Persian","visibility":"public","type":"Persian"}],"slots":[]},{"kind":"class","name":"sap.ui.webc.base.types.CSSColor","basename":"CSSColor","resource":"types/CSSColor.js","module":"types/CSSColor","static":true,"visibility":"public","extends":"sap.ui.webc.base.types.DataType","description":"CSSColor data type.","constructor":{"visibility":"public"}},{"kind":"class","name":"sap.ui.webc.base.types.DataType","basename":"DataType","resource":"types/DataType.js","module":"types/DataType","static":true,"visibility":"public","constructor":{"visibility":"public"},"methods":[{"name":"isValid","visibility":"public","static":true,"returnValue":{"type":"Boolean"},"description":"Checks if the value is valid for its data type."}]},{"kind":"class","name":"sap.ui.webc.base.types.DOMReference","basename":"DOMReference","resource":"types/DOMReference.js","module":"types/DOMReference","static":true,"visibility":"public","extends":"sap.ui.webc.base.types.DataType","description":"DOM Element reference or ID. <b>Note:</b> If an ID is passed, it is expected to be part of the same <code>document</code> element as the consuming component.","constructor":{"visibility":"public"}},{"kind":"class","name":"sap.ui.webc.base.types.Float","basename":"Float","resource":"types/Float.js","module":"types/Float","static":true,"visibility":"public","extends":"sap.ui.webc.base.types.DataType","description":"Float data type.","constructor":{"visibility":"public"}},{"kind":"class","name":"sap.ui.webc.base.types.Integer","basename":"Integer","resource":"types/Integer.js","module":"types/Integer","static":true,"visibility":"public","extends":"sap.ui.webc.base.types.DataType","description":"Integer data type.","constructor":{"visibility":"public"}},{"kind":"enum","name":"sap.ui.webc.base.types.InvisibleMessageMode","basename":"InvisibleMessageMode","resource":"types/InvisibleMessageMode.js","module":"types/InvisibleMessageMode","static":true,"visibility":"public","description":"Enumeration for different mode behaviors of the InvisibleMessage.","properties":[{"name":"Assertive","visibility":"public","type":"Assertive","description":"Indicates that updates to the region have the highest priority and should be presented to the user immediately."},{"name":"Polite","visibility":"public","type":"Polite","description":"Indicates that updates to the region should be presented at the next graceful opportunity, such as at the end of reading the current sentence, or when the user pauses typing."}],"slots":[]},{"kind":"enum","name":"sap.ui.webc.base.types.ItemNavigationBehavior","basename":"ItemNavigationBehavior","resource":"types/ItemNavigationBehavior.js","module":"types/ItemNavigationBehavior","static":true,"visibility":"public","description":"Different behavior for ItemNavigation.","properties":[{"name":"Cyclic","visibility":"public","type":"Cyclic","description":"Cycling behavior: navigating past the last item continues with the first and vice versa."},{"name":"Static","visibility":"public","type":"Static","description":"Static behavior: navigations stops at the first or last item."}],"slots":[]},{"kind":"enum","name":"sap.ui.webc.base.types.NavigationMode","basename":"NavigationMode","resource":"types/NavigationMode.js","module":"types/NavigationMode","static":true,"visibility":"public","description":"Different navigation modes for ItemNavigation.","properties":[{"name":"Auto","visibility":"public","type":"Auto"},{"name":"Horizontal","visibility":"public","type":"Horizontal"},{"name":"Paging","visibility":"public","type":"Paging"},{"name":"Vertical","visibility":"public","type":"Vertical"}],"slots":[]},{"kind":"enum","name":"sap.ui.webc.base.types.ValueState","basename":"ValueState","resource":"types/ValueState.js","module":"types/ValueState","static":true,"visibility":"public","description":"Different types of ValueStates.","properties":[{"name":"Error","visibility":"public","type":"Error"},{"name":"Information","visibility":"public","type":"Information"},{"name":"None","visibility":"public","type":"None"},{"name":"Success","visibility":"public","type":"Success"},{"name":"Warning","visibility":"public","type":"Warning"}],"slots":[]},{"kind":"class","name":"sap.ui.webc.base.UI5Element","basename":"UI5Element","resource":"UI5Element.js","module":"UI5Element","static":true,"visibility":"public","extends":"HTMLElement","constructor":{"visibility":"public"},"properties":[{"name":"_id","visibility":"protected","type":"undefined","description":"Returns a unique ID for this UI5 Element","deprecated":{"text":"- This property is not guaranteed in future releases"}},{"name":"dependencies","visibility":"protected","static":true,"type":"undefined","description":"Returns an array with the dependencies for this UI5 Web Component, which could be: - composed components (used in its shadow root or static area item) - slotted components that the component may need to communicate with"},{"name":"effectiveDir","visibility":"public","type":"undefined","description":"Determines whether the component should be rendered in RTL mode or not. Returns: \"rtl\", \"ltr\" or undefined"},{"name":"isUI5Element","visibility":"public","type":"undefined","description":"Used to duck-type UI5 elements without using instanceof"},{"name":"metadata","visibility":"protected","static":true,"type":"undefined","description":"Returns the metadata object for this UI5 Web Component Class"},{"name":"staticAreaStyles","visibility":"protected","static":true,"type":"undefined","description":"Returns the Static Area CSS for this UI5 Web Component Class"},{"name":"styles","visibility":"protected","static":true,"type":"undefined","description":"Returns the CSS for this UI5 Web Component Class"}],"slots":[],"methods":[{"name":"_render","visibility":"protected","description":"Do not call this method directly, only intended to be called by js"},{"name":"attachInvalidate","visibility":"public","parameters":[{"name":"callback","type":"InvalidationInfo","optional":false}],"description":"Attach a callback that will be executed whenever the component is invalidated"},{"name":"define","visibility":"public","static":true,"returnValue":{"type":"Promise.<UI5Element>"},"description":"Registers a UI5 Web Component in the browser window object"},{"name":"detachInvalidate","visibility":"public","parameters":[{"name":"callback","type":"InvalidationInfo","optional":false}],"description":"Detach the callback that is executed whenever the component is invalidated"},{"name":"fireEvent","visibility":"public","returnValue":{"type":"boolean","description":"false, if the event was cancelled (preventDefault called), true otherwise"},"parameters":[{"name":"name","type":"undefined","optional":false,"description":"name of the event"},{"name":"data","type":"undefined","optional":false,"description":"additional data for the event"},{"name":"cancelable","type":"undefined","optional":false,"defaultValue":false,"description":"true, if the user can call preventDefault on the event object"},{"name":"bubbles","type":"undefined","optional":false,"defaultValue":true,"description":"true, if the event bubbles"}]},{"name":"focus","visibility":"public","parameters":[{"name":"focusOptions","type":"FocusOptions","optional":false,"description":"additional options for the focus"}],"description":"Set the focus to the element, returned by \"getFocusDomRef()\" (marked by \"data-sap-focus-ref\")"},{"name":"getDomRef","visibility":"public","description":"Returns the DOM Element inside the Shadow Root that corresponds to the opening tag in the UI5 Web Component's template *Note:* For logical (abstract) elements (items, options, etc...), returns the part of the parent's DOM that represents this option Use this method instead of \"this.shadowRoot\" to read the Shadow DOM, if ever necessary"},{"name":"getFocusDomRef","visibility":"public","description":"Returns the DOM Element marked with \"data-sap-focus-ref\" inside the template. This is the element that will receive the focus by default."},{"name":"getFocusDomRefAsync","visibility":"public","description":"Waits for dom ref and then returns the DOM Element marked with \"data-sap-focus-ref\" inside the template. This is the element that will receive the focus by default."},{"name":"getMetadata","visibility":"public","static":true,"returnValue":{"type":"UI5ElementMetadata"},"description":"Returns an instance of UI5ElementMetadata.js representing this UI5 Web Component's full metadata (its and its parents') Note: not to be confused with the \"get metadata()\" method, which returns an object for this class's metadata only"},{"name":"getSlottedNodes","visibility":"public","description":"Returns the actual children, associated with a slot. Useful when there are transitive slots in nested component scenarios and you don't want to get a list of the slots, but rather of their content."},{"name":"getStaticAreaItemDomRef","visibility":"public"},{"name":"getUniqueDependencies","visibility":"public","static":true,"description":"Returns a list of the unique dependencies for this UI5 Web Component"},{"name":"onAfterRendering","visibility":"public","description":"Called every time after the component renders."},{"name":"onBeforeRendering","visibility":"public","description":"Called every time before the component renders."},{"name":"onDefine","visibility":"protected","static":true,"returnValue":{"type":"Promise.<void>"},"description":"Hook that will be called upon custom element definition"},{"name":"onEnterDOM","visibility":"public","description":"Called on connectedCallback - added to the DOM."},{"name":"onExitDOM","visibility":"public","description":"Called on disconnectedCallback - removed from the DOM."},{"name":"onInvalidation","visibility":"public","parameters":[{"name":"changeInfo","type":"undefined","optional":false,"description":"An object with information about the change that caused invalidation. The object can have the following properties: - type: (property|slot) tells what caused the invalidation 1) property: a property value was changed either directly or as a result of changing the corresponding attribute 2) slot: a slotted node(nodes) changed in one of several ways (see \"reason\")\n\n- name: the name of the property or slot that caused the invalidation\n\n- reason: (children|textcontent|childchange|slotchange) relevant only for type=\"slot\" only and tells exactly what changed in the slot 1) children: immediate children (HTML elements or text nodes) were added, removed or reordered in the slot 2) textcontent: text nodes in the slot changed value (or nested text nodes were added or changed value). Can only trigger for slots of \"type: Node\" 3) slotchange: a slot element, slotted inside that slot had its \"slotchange\" event listener called. This practically means that transitively slotted children changed. Can only trigger if the child of a slot is a slot element itself. 4) childchange: indicates that a UI5Element child in that slot was invalidated and in turn invalidated the component. Can only trigger for slots with \"invalidateOnChildChange\" metadata descriptor\n\n- newValue: the new value of the property (for type=\"property\" only)\n\n- oldValue: the old value of the property (for type=\"property\" only)\n\n- child the child that was changed (for type=\"slot\" and reason=\"childchange\" only)"}],"description":"A callback that is executed each time an already rendered component is invalidated (scheduled for re-rendering)"}]},{"kind":"class","name":"UI5ElementMetadata","basename":"UI5ElementMetadata","resource":"UI5ElementMetadata.js","module":"UI5ElementMetadata","export":"","visibility":"public","constructor":{"visibility":"public"},"methods":[{"name":"getAttributesList","visibility":"public","returnValue":{"type":"string[]"},"description":"Returns an array with the attributes of the UI5 Element (in kebab-case)"},{"name":"getEvents","visibility":"public","description":"Returns an object with key-value pairs of events and their metadata definitions"},{"name":"getProperties","visibility":"public","description":"Returns an object with key-value pairs of properties and their metadata definitions"},{"name":"getPropertiesList","visibility":"public","returnValue":{"type":"string[]"},"description":"Returns an array with the properties of the UI5 Element (in camelCase)"},{"name":"getPureTag","visibility":"public","description":"Returns the tag of the UI5 Element without the scope"},{"name":"getSlots","visibility":"public","description":"Returns an object with key-value pairs of slots and their metadata definitions"},{"name":"getTag","visibility":"public","description":"Returns the tag of the UI5 Element"},{"name":"hasAttribute","visibility":"public","returnValue":{"type":"boolean"},"parameters":[{"name":"propName","type":"undefined","optional":false}],"description":"Determines whether a property should have an attribute counterpart"},{"name":"hasIndividualSlots","visibility":"public","description":"Determines whether this UI5 Element supports any slots with \"individualSlots: true\""},{"name":"hasSlots","visibility":"public","description":"Determines whether this UI5 Element supports any slots"},{"name":"slotsAreManaged","visibility":"public","description":"Determines whether this UI5 Element needs to invalidate if children are added/removed/changed"},{"name":"supportsF6FastNavigation","visibility":"public","description":"Determines whether this control supports F6 fast navigation"},{"name":"validatePropertyValue","visibility":"public","static":true,"description":"Validates the property's value and returns it if correct or returns the default value if not. <b>Note:</b> Only intended for use by UI5Element.js"}]}]}
{"$schema-ref":"http://schemas.sap.com/sapui5/designtime/api.json/1.0","version":"1.62","symbols":[{"kind":"class","name":"I18nBundle","basename":"I18nBundle","resource":"i18nBundle.js","module":"i18nBundle","visibility":"public","constructor":{"visibility":"public"},"methods":[{"name":"getText","visibility":"public","returnValue":{"type":"string"},"parameters":[{"name":"textObj","type":"Object|String","optional":false,"description":"key/defaultText pair or just the key"},{"name":"params","type":"undefined","optional":false,"description":"Values for the placeholders"}],"description":"Returns a text in the currently loaded language"}]},{"kind":"class","name":"ItemNavigation","basename":"ItemNavigation","resource":"delegate/ItemNavigation.js","module":"delegate/ItemNavigation","visibility":"public","description":"The ItemNavigation class manages the calculations to determine the correct \"tabindex\" for a group of related items inside a root component. Important: ItemNavigation only does the calculations and does not change \"tabindex\" directly, this is a responsibility of the developer.\n\nThe keys that trigger ItemNavigation are: - Up/down - Left/right - Home/End\n\nUsage: 1) Use the \"getItemsCallback\" constructor property to pass a callback to ItemNavigation, which, whenever called, will return the list of items to navigate among.\n\nEach item passed to ItemNavigation via \"getItemsCallback\" must be: - A) either a UI5Element with a \"_tabIndex\" property - B) or an Object with \"id\" and \"_tabIndex\" properties which represents a part of the root component's shadow DOM. The \"id\" must be a valid ID within the shadow root of the component ItemNavigation operates on. This object must not be a DOM object because, as said, ItemNavigation will not set \"tabindex\" on it. It must be a representation of a DOM object only and the developer has the responsibility to update the \"tabindex\" in the component's DOM. - C) a combination of the above\n\nWhenever the user navigates with the keyboard, ItemNavigation will modify the \"_tabIndex\" properties of the items. It is the items' responsibilities to re-render themselves and apply the correct value of \"tabindex\" (i.e. to map the \"_tabIndex\" ItemNavigation set to them to the \"tabindex\" property). If the items of the ItemNavigation are UI5Elements themselves, this can happen naturally since they will be invalidated by their \"_tabIndex\" property. If the items are Objects with \"id\" and \"_tabIndex\" however, it is the developer's responsibility to apply these and the easiest way is to have the root component invalidated by ItemNavigation. To do so, set the \"affectedPropertiesNames\" constructor property to point to one or more of the root component's properties that need refreshing when \"_tabIndex\" is changed deeply.\n\n2) Call the \"setCurrentItem\" method of ItemNavigation whenever you want to change the current item. This is most commonly required if the user for example clicks on an item and thus selects it directly. Pass as the only argument to \"setCurrentItem\" the item that becomes current (must be one of the items, returned by \"getItemsCallback\").","constructor":{"visibility":"public","parameters":[{"name":"rootWebComponent","type":"undefined","optional":false,"description":"the component to operate on (component that slots or contains within its shadow root the items the user navigates among)"},{"name":"options","type":"ItemNavigationOptions","optional":false,"description":"Object with configuration options: - currentIndex: the index of the item that will be initially selected (from which navigation will begin) - navigationMode (Auto|Horizontal|Vertical): whether the items are displayed horizontally (Horizontal), vertically (Vertical) or as a matrix (Auto) meaning the user can navigate in both directions (up/down and left/right) - rowSize: tells how many items per row there are when the items are not rendered as a flat list but rather as a matrix. Relevant for navigationMode=Auto - skipItemsSize: tells how many items upon PAGE_UP and PAGE_DOWN should be skipped to applying the focus on the next item - behavior (Static|Cycling): tells what to do when trying to navigate beyond the first and last items Static means that nothing happens if the user tries to navigate beyond the first/last item. Cycling means that when the user navigates beyond the last item they go to the first and vice versa. - getItemsCallback: function that, when called, returns an array with all items the user can navigate among - affectedPropertiesNames: a list of metadata properties on the root component which, upon user navigation, will be reassigned by address thus causing the root component to invalidate"}]},"methods":[{"name":"setCurrentItem","visibility":"public","parameters":[{"name":"current","type":"undefined","optional":false,"description":"the new selected item"}],"description":"Call this method to set a new \"current\" (selected) item in the item navigation Note: the item passed to this function must be one of the items, returned by the getItemsCallback function"},{"name":"setRowSize","visibility":"public","parameters":[{"name":"newRowSize","type":"undefined","optional":false}],"description":"Call this method to dynamically change the row size"}]},{"kind":"namespace","name":"MediaRange.RANGESETS","basename":"RANGESETS","resource":"MediaRange.js","module":"MediaRange","export":"RANGESETS","static":true,"visibility":"public","description":"Enumeration containing the names and settings of predefined screen width media query range sets.","properties":[{"name":"RANGE_4STEPS","visibility":"public","static":true,"type":"undefined","description":"A 4-step range set (S-M-L-XL).\n\nThe ranges of this set are: <ul> <li><code>\"S\"</code>: For screens smaller than 600 pixels.</li> <li><code>\"M\"</code>: For screens greater than or equal to 600 pixels and smaller than 1024 pixels.</li> <li><code>\"L\"</code>: For screens greater than or equal to 1024 pixels and smaller than 1440 pixels.</li> <li><code>\"XL\"</code>: For screens greater than or equal to 1440 pixels.</li> </ul>"}],"slots":[]},{"kind":"namespace","name":"module:sap/base/Log","basename":"module:sap/base/Log","resource":"sap/base/Log.js","module":"sap/base/Log","export":"","visibility":"public","since":"1.58","description":"A Logging API for JavaScript.\n\nProvides methods to manage a client-side log and to create entries in it. Each of the logging methods {@link module:sap/base/Log.debug}, {@link module:sap/base/Log.info}, {@link module:sap/base/Log.warning}, {@link module:sap/base/Log.error} and {@link module:sap/base/Log.fatal} creates and records a log entry, containing a timestamp, a log level, a message with details and a component info. The log level will be one of {@link module:sap/base/Log.Level} and equals the name of the concrete logging method.\n\nBy using the {@link module:sap/base/Log.setLevel} method, consumers can determine the least important log level which should be recorded. Less important entries will be filtered out. (Note that higher numeric values represent less important levels). The initially set level depends on the mode that UI5 is running in. When the optimized sources are executed, the default level will be {@link module:sap/base/Log.Level.ERROR}. For normal (debug sources), the default level is {@link module:sap/base/Log.Level.DEBUG}.\n\nAll logging methods allow to specify a <b>component</b>. These components are simple strings and don't have a special meaning to the UI5 framework. However they can be used to semantically group log entries that belong to the same software component (or feature). There are two APIs that help to manage logging for such a component. With {@link module:sap/base/Log.getLogger}, one can retrieve a logger that automatically adds the given <code>sComponent</code> as component parameter to each log entry, if no other component is specified. Typically, JavaScript code will retrieve such a logger once during startup and reuse it for the rest of its lifecycle. Second, the {@link module:sap/base/Log.setLevel}(iLevel, sComponent) method allows to set the log level for a specific component only. This allows a more fine grained control about the created logging entries. {@link module:sap/base/Log.getLevel} allows to retrieve the currently effective log level for a given component.\n\n{@link module:sap/base/Log.getLogEntries} returns an array of the currently collected log entries.\n\nFurthermore, a listener can be registered to the log. It will be notified whenever a new entry is added to the log. The listener can be used for displaying log entries in a separate page area, or for sending it to some external target (server).","methods":[{"name":"addLogListener","visibility":"public","static":true,"parameters":[{"name":"oListener","type":"module:sap/base/Log.Listener","optional":false,"description":"The new listener object that should be informed"}],"description":"Allows to add a new listener that will be notified for new log entries.\n\nThe given object must provide method <code>onLogEntry</code> and can also be informed about <code>onDetachFromLog</code>, <code>onAttachToLog</code> and <code>onDiscardLogEntries</code>."},{"name":"debug","visibility":"public","static":true,"parameters":[{"name":"sMessage","type":"string","optional":false,"description":"Message text to display"},{"name":"vDetails","type":"string|Error","optional":true,"defaultValue":"''","description":"Optional details about the message, might be omitted. Can be an Error object which will be logged with the stack."},{"name":"sComponent","type":"string","optional":true,"defaultValue":"''","description":"Name of the component that produced the log entry"},{"name":"fnSupportInfo","type":"function","optional":true,"description":"Callback that returns an additional support object to be logged in support mode. This function is only called if support info mode is turned on with <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and memory consumption, the returned object should be a simple immutable JSON object with mostly static and stable content."}],"description":"Creates a new debug-level entry in the log with the given message, details and calling component."},{"name":"error","visibility":"public","static":true,"parameters":[{"name":"sMessage","type":"string","optional":false,"description":"Message text to display"},{"name":"vDetails","type":"string|Error","optional":true,"defaultValue":"''","description":"Optional details about the message, might be omitted. Can be an Error object which will be logged together with its stacktrace."},{"name":"sComponent","type":"string","optional":true,"defaultValue":"''","description":"Name of the component that produced the log entry"},{"name":"fnSupportInfo","type":"function","optional":true,"description":"Callback that returns an additional support object to be logged in support mode. This function is only called if support info mode is turned on with <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and memory consumption, the returned object should be a simple immutable JSON object with mostly static and stable content."}],"description":"Creates a new error-level entry in the log with the given message, details and calling component."},{"name":"fatal","visibility":"public","static":true,"parameters":[{"name":"sMessage","type":"string","optional":false,"description":"Message text to display"},{"name":"vDetails","type":"string|Error","optional":true,"defaultValue":"''","description":"Optional details about the message, might be omitted. Can be an Error object which will be logged together with its stacktrace."},{"name":"sComponent","type":"string","optional":true,"defaultValue":"''","description":"Name of the component that produced the log entry"},{"name":"fnSupportInfo","type":"function","optional":true,"description":"Callback that returns an additional support object to be logged in support mode. This function is only called if support info mode is turned on with <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and memory consumption, the returned object should be a simple immutable JSON object with mostly static and stable content."}],"description":"Creates a new fatal-level entry in the log with the given message, details and calling component."},{"name":"getLevel","visibility":"public","static":true,"returnValue":{"type":"module:sap/base/Log.Level","description":"The log level for the given component or the default log level"},"parameters":[{"name":"sComponent","type":"string","optional":true,"description":"Name of the component to retrieve the log level for"}],"description":"Returns the log level currently effective for the given component. If no component is given or when no level has been configured for a given component, the log level for the default component of this logger is returned."},{"name":"getLogEntries","visibility":"public","static":true,"returnValue":{"type":"module:sap/base/Log.Entry[]","description":"an array containing the recorded log entries"},"description":"Returns the logged entries recorded so far as an array.\n\nLog entries are plain JavaScript objects with the following properties <ul> <li>timestamp {number} point in time when the entry was created <li>level {module:sap/base/Log.Level} LogLevel level of the entry <li>message {string} message text of the entry </ul> The default amount of stored log entries is limited to 3000 entries."},{"name":"getLogEntriesLimit","visibility":"restricted","static":true,"returnValue":{"type":"int|Infinity","description":"The maximum amount of stored log entries or Infinity if no limit is set"},"description":"Returns the maximum amount of stored log entries."},{"name":"getLogger","visibility":"public","static":true,"returnValue":{"type":"module:sap/base/Log.Logger","description":"A logger with a specified component"},"parameters":[{"name":"sComponent","type":"string","optional":false,"description":"Name of the component which should be logged"},{"name":"iDefaultLogLevel","type":"module:sap/base/Log.Level","optional":true,"description":"The default log level"}],"description":"Returns a dedicated logger for a component.\n\nThe logger comes with the same API as the <code>sap/base/Log</code> module: <ul> <li><code>#fatal</code> - see: {@link module:sap/base/Log.fatal} <li><code>#error</code> - see: {@link module:sap/base/Log.error} <li><code>#warning</code> - see: {@link module:sap/base/Log.warning} <li><code>#info</code> - see: {@link module:sap/base/Log.info} <li><code>#debug</code> - see: {@link module:sap/base/Log.debug} <li><code>#trace</code> - see: {@link module:sap/base/Log.trace} <li><code>#setLevel</code> - see: {@link module:sap/base/Log.setLevel} <li><code>#getLevel</code> - see: {@link module:sap/base/Log.getLevel} <li><code>#isLoggable</code> - see: {@link module:sap/base/Log.isLoggable} </ul>"},{"name":"info","visibility":"public","static":true,"parameters":[{"name":"sMessage","type":"string","optional":false,"description":"Message text to display"},{"name":"vDetails","type":"string|Error","optional":true,"defaultValue":"''","description":"Optional details about the message, might be omitted. Can be an Error object which will be logged with the stack."},{"name":"sComponent","type":"string","optional":true,"defaultValue":"''","description":"Name of the component that produced the log entry"},{"name":"fnSupportInfo","type":"function","optional":true,"description":"Callback that returns an additional support object to be logged in support mode. This function is only called if support info mode is turned on with <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and memory consumption, the returned object should be a simple immutable JSON object with mostly static and stable content."}],"description":"Creates a new info-level entry in the log with the given message, details and calling component."},{"name":"isLoggable","visibility":"public","static":true,"returnValue":{"type":"boolean","description":"Whether logging is enabled or not"},"parameters":[{"name":"iLevel","type":"module:sap/base/Log.Level","optional":true,"defaultValue":"Level.DEBUG","description":"The log level in question"},{"name":"sComponent","type":"string","optional":true,"description":"Name of the component to check the log level for"}],"description":"Checks whether logging is enabled for the given log level, depending on the currently effective log level for the given component.\n\nIf no component is given, the default component of this logger will be taken into account."},{"name":"logSupportInfo","visibility":"restricted","static":true,"parameters":[{"name":"bEnabled","type":"boolean","optional":false,"description":"true if the support information should be logged"}],"description":"Enables or disables whether additional support information is logged in a trace. If enabled, logging methods like error, warning, info and debug are calling the additional optional callback parameter fnSupportInfo and store the returned object in the log entry property supportInfo."},{"name":"removeLogListener","visibility":"public","static":true,"parameters":[{"name":"oListener","type":"module:sap/base/Log.Listener","optional":false,"description":"The listener object that should be removed"}],"description":"Allows to remove a registered LogListener."},{"name":"setLevel","visibility":"public","static":true,"parameters":[{"name":"iLogLevel","type":"module:sap/base/Log.Level","optional":false,"description":"The new log level"},{"name":"sComponent","type":"string","optional":true,"description":"The log component to set the log level for"}],"description":"Defines the maximum <code>sap/base/Log.Level</code> of log entries that will be recorded. Log entries with a higher (less important) log level will be omitted from the log. When a component name is given, the log level will be configured for that component only, otherwise the log level for the default component of this logger is set. For the global logger, the global default level is set.\n\n<b>Note</b>: Setting a global default log level has no impact on already defined component log levels. They always override the global default log level."},{"name":"setLogEntriesLimit","visibility":"restricted","static":true,"parameters":[{"name":"iLimit","type":"int|Infinity","optional":false,"description":"The maximum amount of stored log entries or Infinity for unlimited entries"}],"description":"Sets the limit of stored log entries\n\nIf the new limit is lower than the current limit, the overlap of old log entries will be discarded. If the limit is reached the amount of stored messages will be reduced by 30 percent."},{"name":"trace","visibility":"public","static":true,"parameters":[{"name":"sMessage","type":"string","optional":false,"description":"Message text to display"},{"name":"vDetails","type":"string|Error","optional":true,"defaultValue":"''","description":"Optional details about the message, might be omitted. Can be an Error object which will be logged with the stack."},{"name":"sComponent","type":"string","optional":true,"defaultValue":"''","description":"Name of the component that produced the log entry"},{"name":"fnSupportInfo","type":"function","optional":true,"description":"Callback that returns an additional support object to be logged in support mode. This function is only called if support info mode is turned on with <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and memory consumption, the returned object should be a simple immutable JSON object with mostly static and stable content."}],"description":"Creates a new trace-level entry in the log with the given message, details and calling component."},{"name":"warning","visibility":"public","static":true,"parameters":[{"name":"sMessage","type":"string","optional":false,"description":"Message text to display"},{"name":"vDetails","type":"string|Error","optional":true,"defaultValue":"''","description":"Optional details about the message, might be omitted. Can be an Error object which will be logged together with its stacktrace."},{"name":"sComponent","type":"string","optional":true,"defaultValue":"''","description":"Name of the component that produced the log entry"},{"name":"fnSupportInfo","type":"function","optional":true,"description":"Callback that returns an additional support object to be logged in support mode. This function is only called if support info mode is turned on with <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and memory consumption, the returned object should be a simple immutable JSON object with mostly static and stable content."}],"description":"Creates a new warning-level entry in the log with the given message, details and calling component."}]},{"kind":"typedef","name":"module:sap/base/Log.Entry","basename":"Entry","resource":"sap/base/Log.js","module":"sap/base/Log","export":"Entry","static":true,"visibility":"public","properties":[{"name":"timestamp","type":"float","readonly":"undefined","visibility":"public","description":"The number of milliseconds since the epoch"},{"name":"time","type":"string","readonly":"undefined","visibility":"public","description":"Time string in format HH:mm:ss:mmmnnn"},{"name":"date","type":"string","readonly":"undefined","visibility":"public","description":"Date string in format yyyy-MM-dd"},{"name":"level","type":"module:sap/base/Log.Level","readonly":"undefined","visibility":"public","description":"The level of the log entry, see {@link module:sap/base/Log.Level}"},{"name":"message","type":"string","readonly":"undefined","visibility":"public","description":"The message of the log entry"},{"name":"details","type":"string","readonly":"undefined","visibility":"public","description":"The detailed information of the log entry"},{"name":"component","type":"string","readonly":"undefined","visibility":"public","description":"The component that creates the log entry"},{"name":"supportInfo","type":"function","readonly":"undefined","visibility":"public","description":"Callback that returns an additional support object to be logged in support mode."}]},{"kind":"enum","name":"module:sap/base/Log.Level","basename":"Level","resource":"sap/base/Log.js","module":"sap/base/Log","export":"Level","static":true,"visibility":"public","description":"Enumeration of the configurable log levels that a Logger should persist to the log.\n\nOnly if the current LogLevel is higher than the level {@link module:sap/base/Log.Level} of the currently added log entry, then this very entry is permanently added to the log. Otherwise it is ignored.","properties":[{"name":"ALL","visibility":"public","static":true,"type":"int","description":"Trace level to log everything."},{"name":"DEBUG","visibility":"public","static":true,"type":"int","description":"Debug level. Use this for logging information necessary for debugging"},{"name":"ERROR","visibility":"public","static":true,"type":"int","description":"Error level. Use this for logging of erroneous but still recoverable situations"},{"name":"FATAL","visibility":"public","static":true,"type":"int","description":"Fatal level. Use this for logging unrecoverable situations"},{"name":"INFO","visibility":"public","static":true,"type":"int","description":"Info level. Use this for logging information of purely informative nature"},{"name":"NONE","visibility":"public","static":true,"type":"int","description":"Do not log anything"},{"name":"TRACE","visibility":"public","static":true,"type":"int","description":"Trace level. Use this for tracing the program flow."},{"name":"WARNING","visibility":"public","static":true,"type":"int","description":"Warning level. Use this for logging unwanted but foreseen situations"}],"slots":[]},{"kind":"interface","name":"module:sap/base/Log.Listener","basename":"Listener","resource":"sap/base/Log.js","module":"sap/base/Log","export":"Listener","static":true,"visibility":"public","description":"Interface to be implemented by a log listener.\n\nTypically, a listener will at least implement the {@link #.onLogEntry} method, but in general, all methods are optional.","methods":[{"name":"onAttachToLog?","visibility":"public","static":true,"parameters":[{"name":"oLog","type":"module:sap/base/Log","optional":false,"description":"The Log instance where the listener is attached"}],"description":"The function that is called once the Listener is attached"},{"name":"onDetachFromLog?","visibility":"public","static":true,"parameters":[{"name":"oLog","type":"module:sap/base/Log","optional":false,"description":"The Log instance where the listener is detached"}],"description":"The function that is called once the Listener is detached"},{"name":"onDiscardLogEntries?","visibility":"public","static":true,"parameters":[{"name":"aDiscardedEntries","type":"module:sap/base/Log.Entry[]","optional":false,"description":"The discarded log entries"}],"description":"The function that is called once log entries are discarded due to the exceed of total log entry amount"},{"name":"onLogEntry?","visibility":"public","static":true,"parameters":[{"name":"oLogEntry","type":"module:sap/base/Log.Entry","optional":false,"description":"The newly created log entry"}],"description":"The function that is called when a new log entry is created"}]},{"kind":"interface","name":"module:sap/base/Log.Logger","basename":"Logger","resource":"sap/base/Log.js","module":"sap/base/Log","export":"Logger","static":true,"visibility":"public","description":"The logger comes with a subset of the API of the <code>sap/base/Log</code> module: <ul> <li><code>#fatal</code> - see: {@link module:sap/base/Log.fatal} <li><code>#error</code> - see: {@link module:sap/base/Log.error} <li><code>#warning</code> - see: {@link module:sap/base/Log.warning} <li><code>#info</code> - see: {@link module:sap/base/Log.info} <li><code>#debug</code> - see: {@link module:sap/base/Log.debug} <li><code>#trace</code> - see: {@link module:sap/base/Log.trace} <li><code>#setLevel</code> - see: {@link module:sap/base/Log.setLevel} <li><code>#getLevel</code> - see: {@link module:sap/base/Log.getLevel} <li><code>#isLoggable</code> - see: {@link module:sap/base/Log.isLoggable} </ul>","methods":[{"name":"debug","visibility":"public","parameters":[{"name":"sMessage","type":"string","optional":false,"description":"Message text to display"},{"name":"vDetails","type":"string|Error","optional":true,"defaultValue":"''","description":"Optional details about the message, might be omitted. Can be an Error object which will be logged with the stack."},{"name":"sComponent","type":"string","optional":true,"defaultValue":"''","description":"Name of the component that produced the log entry"},{"name":"fnSupportInfo","type":"function","optional":true,"description":"Callback that returns an additional support object to be logged in support mode. This function is only called if support info mode is turned on with <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and memory consumption, the returned object should be a simple immutable JSON object with mostly static and stable content."}],"description":"Creates a new debug-level entry in the log with the given message, details and calling component."},{"name":"error","visibility":"public","parameters":[{"name":"sMessage","type":"string","optional":false,"description":"Message text to display"},{"name":"vDetails","type":"string|Error","optional":true,"defaultValue":"''","description":"Optional details about the message, might be omitted. Can be an Error object which will be logged together with its stacktrace."},{"name":"sComponent","type":"string","optional":true,"defaultValue":"''","description":"Name of the component that produced the log entry"},{"name":"fnSupportInfo","type":"function","optional":true,"description":"Callback that returns an additional support object to be logged in support mode. This function is only called if support info mode is turned on with <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and memory consumption, the returned object should be a simple immutable JSON object with mostly static and stable content."}],"description":"Creates a new error-level entry in the log with the given message, details and calling component."},{"name":"fatal","visibility":"public","parameters":[{"name":"sMessage","type":"string","optional":false,"description":"Message text to display"},{"name":"vDetails","type":"string|Error","optional":true,"defaultValue":"''","description":"Optional details about the message, might be omitted. Can be an Error object which will be logged together with its stacktrace."},{"name":"sComponent","type":"string","optional":true,"defaultValue":"''","description":"Name of the component that produced the log entry"},{"name":"fnSupportInfo","type":"function","optional":true,"description":"Callback that returns an additional support object to be logged in support mode. This function is only called if support info mode is turned on with <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and memory consumption, the returned object should be a simple immutable JSON object with mostly static and stable content."}],"description":"Creates a new fatal-level entry in the log with the given message, details and calling component."},{"name":"getLevel","visibility":"public","returnValue":{"type":"module:sap/base/Log.Level","description":"The log level for the given component or the default log level"},"parameters":[{"name":"sComponent","type":"string","optional":true,"description":"Name of the component to retrieve the log level for"}],"description":"Returns the log level currently effective for the given component. If no component is given or when no level has been configured for a given component, the log level for the default component of this logger is returned."},{"name":"info","visibility":"public","parameters":[{"name":"sMessage","type":"string","optional":false,"description":"Message text to display"},{"name":"vDetails","type":"string|Error","optional":true,"defaultValue":"''","description":"Optional details about the message, might be omitted. Can be an Error object which will be logged with the stack."},{"name":"sComponent","type":"string","optional":true,"defaultValue":"''","description":"Name of the component that produced the log entry"},{"name":"fnSupportInfo","type":"function","optional":true,"description":"Callback that returns an additional support object to be logged in support mode. This function is only called if support info mode is turned on with <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and memory consumption, the returned object should be a simple immutable JSON object with mostly static and stable content."}],"description":"Creates a new info-level entry in the log with the given message, details and calling component."},{"name":"isLoggable","visibility":"public","returnValue":{"type":"boolean","description":"Whether logging is enabled or not"},"parameters":[{"name":"iLevel","type":"module:sap/base/Log.Level","optional":true,"defaultValue":"Level.DEBUG","description":"The log level in question"},{"name":"sComponent","type":"string","optional":true,"description":"Name of the component to check the log level for"}],"description":"Checks whether logging is enabled for the given log level, depending on the currently effective log level for the given component.\n\nIf no component is given, the default component of this logger will be taken into account."},{"name":"setLevel","visibility":"public","parameters":[{"name":"iLogLevel","type":"module:sap/base/Log.Level","optional":false,"description":"The new log level"},{"name":"sComponent","type":"string","optional":true,"description":"The log component to set the log level for"}],"description":"Defines the maximum <code>sap/base/Log.Level</code> of log entries that will be recorded. Log entries with a higher (less important) log level will be omitted from the log. When a component name is given, the log level will be configured for that component only, otherwise the log level for the default component of this logger is set. For the global logger, the global default level is set.\n\n<b>Note</b>: Setting a global default log level has no impact on already defined component log levels. They always override the global default log level."},{"name":"trace","visibility":"public","parameters":[{"name":"sMessage","type":"string","optional":false,"description":"Message text to display"},{"name":"vDetails","type":"string|Error","optional":true,"defaultValue":"''","description":"Optional details about the message, might be omitted. Can be an Error object which will be logged with the stack."},{"name":"sComponent","type":"string","optional":true,"defaultValue":"''","description":"Name of the component that produced the log entry"},{"name":"fnSupportInfo","type":"function","optional":true,"description":"Callback that returns an additional support object to be logged in support mode. This function is only called if support info mode is turned on with <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and memory consumption, the returned object should be a simple immutable JSON object with mostly static and stable content."}],"description":"Creates a new trace-level entry in the log with the given message, details and calling component."},{"name":"warning","visibility":"public","parameters":[{"name":"sMessage","type":"string","optional":false,"description":"Message text to display"},{"name":"vDetails","type":"string|Error","optional":true,"defaultValue":"''","description":"Optional details about the message, might be omitted. Can be an Error object which will be logged together with its stacktrace."},{"name":"sComponent","type":"string","optional":true,"defaultValue":"''","description":"Name of the component that produced the log entry"},{"name":"fnSupportInfo","type":"function","optional":true,"description":"Callback that returns an additional support object to be logged in support mode. This function is only called if support info mode is turned on with <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and memory consumption, the returned object should be a simple immutable JSON object with mostly static and stable content."}],"description":"Creates a new warning-level entry in the log with the given message, details and calling component."}]},{"kind":"function","name":"module:sap/base/security/encodeCSS","basename":"module:sap/base/security/encodeCSS","resource":"sap/base/security/encodeCSS.js","module":"sap/base/security/encodeCSS","export":"","visibility":"public","since":"1.58","description":"Encode the string for inclusion into CSS string literals or identifiers.","returnValue":{"type":"string","description":"The encoded string"},"parameters":[{"name":"sString","type":"string","optional":false,"description":"The string to be escaped"}]},{"kind":"function","name":"module:sap/base/security/encodeXML","basename":"module:sap/base/security/encodeXML","resource":"sap/base/security/encodeXML.js","module":"sap/base/security/encodeXML","export":"","visibility":"public","since":"1.58","description":"Encode the string for inclusion into XML content/attribute.","returnValue":{"type":"string","description":"The encoded string"},"parameters":[{"name":"sString","type":"string","optional":false,"description":"The string to be escaped"}]},{"kind":"namespace","name":"module:sap/base/security/URLListValidator","basename":"module:sap/base/security/URLListValidator","resource":"sap/base/security/URLListValidator.js","module":"sap/base/security/URLListValidator","export":"","visibility":"public","since":"1.85","description":"Registry to manage allowed URLs and validate against them.","methods":[{"name":"add","visibility":"public","static":true,"parameters":[{"name":"protocol","type":"string","optional":true,"description":"The protocol of the URL, can be falsy to allow all protocols for an entry e.g. \"\", \"http\", \"mailto\""},{"name":"host","type":"string","optional":true,"description":"The host of the URL, can be falsy to allow all hosts. A wildcard asterisk can be set at the beginning, e.g. \"examples.com\", \"*.example.com\""},{"name":"port","type":"string","optional":true,"description":"The port of the URL, can be falsy to allow all ports, e.g. \"\", \"8080\""},{"name":"path","type":"string","optional":true,"description":"the path of the URL, path of the url, can be falsy to allow all paths. A wildcard asterisk can be set at the end, e.g. \"/my-example*\", \"/my-news\""}],"description":"Adds an allowed entry.\n\nNote: Adding the first entry to the list of allowed entries will disallow all URLs but the ones matching the newly added entry.\n\n<b>Note</b>: It is strongly recommended to set a path only in combination with an origin (never set a path alone). There's almost no case where checking only the path of a URL would allow to ensure its validity."},{"name":"clear","visibility":"public","static":true,"description":"Clears the allowed entries for URL validation. This makes all URLs allowed."},{"name":"entries","visibility":"public","static":true,"returnValue":{"type":"module:sap/base/security/URLListValidator.Entry[]","description":"The allowed entries"},"description":"Gets the list of allowed entries."},{"name":"validate","visibility":"public","static":true,"returnValue":{"type":"boolean","description":"true if valid, false if not valid"},"parameters":[{"name":"sUrl","type":"string","optional":false,"description":"URL to be validated"}],"description":"Validates a URL. Check if it's not a script or other security issue.\n\n<b>Note</b>: It is strongly recommended to validate only absolute URLs. There's almost no case where checking only the path of a URL would allow to ensure its validity. For compatibility reasons, this API cannot automatically resolve URLs relative to <code>document.baseURI</code>, but callers should do so. In that case, and when the allow list is not empty, an entry for the origin of <code>document.baseURI</code> must be added to the allow list.\n\n<h3>Details</h3> Splits the given URL into components and checks for allowed characters according to RFC 3986:\n\n<pre>\nauthority = [ userinfo \"@\" ] host [ \":\" port ]\nuserinfo = *( unreserved / pct-encoded / sub-delims / \":\" )\nhost = IP-literal / IPv4address / reg-name\n\nIP-literal = \"[\" ( IPv6address / IPvFuture ) \"]\"\nIPvFuture = \"v\" 1*HEXDIG \".\" 1*( unreserved / sub-delims / \":\" )\nIPv6address = 6( h16 \":\" ) ls32\n / \"::\" 5( h16 \":\" ) ls32\n / [ h16 ] \"::\" 4( h16 \":\" ) ls32\n / [ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n / [ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n / [ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n / [ *4( h16 \":\" ) h16 ] \"::\" ls32\n / [ *5( h16 \":\" ) h16 ] \"::\" h16\n / [ *6( h16 \":\" ) h16 ] \"::\"\nls32 = ( h16 \":\" h16 ) / IPv4address\n ; least-significant 32 bits of address\nh16 = 1*4HEXDIG\n ; 16 bits of address represented in hexadecimal\n\nIPv4address = dec-octet \".\" dec-octet \".\" dec-octet \".\" dec-octet\ndec-octet = DIGIT ; 0-9\n / %x31-39 DIGIT ; 10-99\n / \"1\" 2DIGIT ; 100-199\n / \"2\" %x30-34 DIGIT ; 200-249\n / \"25\" %x30-35 ; 250-255\n\nreg-name = *( unreserved / pct-encoded / sub-delims )\n\npct-encoded = \"%\" HEXDIG HEXDIG\nreserved = gen-delims / sub-delims\ngen-delims = \":\" / \"/\" / \"?\" / \"#\" / \"[\" / \"]\" / \"@\"\nsub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n / \"*\" / \"+\" / \",\" / \";\" / \"=\"\nunreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\npchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n\npath = path-abempty ; begins with \"/\" or is empty\n / path-absolute ; begins with \"/\" but not \"//\"\n / path-noscheme ; begins with a non-colon segment\n / path-rootless ; begins with a segment\n / path-empty ; zero characters\n\npath-abempty = *( \"/\" segment )\npath-absolute = \"/\" [ segment-nz *( \"/\" segment ) ]\npath-noscheme = segment-nz-nc *( \"/\" segment )\npath-rootless = segment-nz *( \"/\" segment )\npath-empty = 0<pchar>\nsegment = *pchar\nsegment-nz = 1*pchar\nsegment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / \"@\" )\n ; non-zero-length segment without any colon \":\"\n\nquery = *( pchar / \"/\" / \"?\" )\n\nfragment = *( pchar / \"/\" / \"?\" )\n</pre>\n\nFor the hostname component, we are checking for valid DNS hostnames according to RFC 952 / RFC 1123:\n\n<pre>\nhname = name *(\".\" name)\nname = let-or-digit ( *( let-or-digit-or-hyphen ) let-or-digit )\n</pre>\n\nWhen the URI uses the protocol 'mailto:', the address part is additionally checked against the most commonly used parts of RFC 6068:\n\n<pre>\nmailtoURI = \"mailto:\" [ to ] [ hfields ]\nto = addr-spec *(\",\" addr-spec )\nhfields = \"?\" hfield *( \"&\" hfield )\nhfield = hfname \"=\" hfvalue\nhfname = *qchar\nhfvalue = *qchar\naddr-spec = local-part \"@\" domain\nlocal-part = dot-atom-text // not accepted: quoted-string\ndomain = dot-atom-text // not accepted: \"[\" *dtext-no-obs \"]\"\ndtext-no-obs = %d33-90 / ; Printable US-ASCII\n %d94-126 ; characters not including\n ; \"[\", \"]\", or \"\\\"\nqchar = unreserved / pct-encoded / some-delims\nsome-delims = \"!\" / \"$\" / \"'\" / \"(\" / \")\" / \"*\"\n / \"+\" / \",\" / \";\" / \":\" / \"@\"\n\nNote:\nA number of characters that can appear in &lt;addr-spec> MUST be\npercent-encoded. These are the characters that cannot appear in\na URI according to [STD66] as well as \"%\" (because it is used for\npercent-encoding) and all the characters in gen-delims except \"@\"\nand \":\" (i.e., \"/\", \"?\", \"#\", \"[\", and \"]\"). Of the characters\nin sub-delims, at least the following also have to be percent-\nencoded: \"&\", \";\", and \"=\". Care has to be taken both when\nencoding as well as when decoding to make sure these operations\nare applied only once.\n\n</pre>\n\nWhen a list of allowed entries has been configured using {@link #add}, any URL that passes the syntactic checks above, additionally will be tested against the content of this list."}]},{"kind":"typedef","name":"module:sap/base/security/URLListValidator.Entry","basename":"Entry","resource":"sap/base/security/URLListValidator.js","module":"sap/base/security/URLListValidator","export":"Entry","static":true,"visibility":"public","description":"Entry object of the URLListValidator.","properties":[{"name":"protocol","type":"string","readonly":"undefined","visibility":"public","description":"The protocol of the URL, can be falsy to allow all protocols for an entry e.g. \"\", \"http\", \"mailto\""},{"name":"host","type":"string","readonly":"undefined","visibility":"public","description":"The host of the URL, can be falsy to allow all hosts. A wildcard asterisk can be set at the beginning, e.g. \"examples.com\", \"*.example.com\""},{"name":"port","type":"string","readonly":"undefined","visibility":"public","description":"The port of the URL, can be falsy to allow all ports, e.g. \"\", \"8080\""},{"name":"path","type":"string","readonly":"undefined","visibility":"public","description":"the path of the URL, path of the url, can be falsy to allow all paths. A wildcard asterisk can be set at the end, e.g. \"/my-example*\", \"/my-news\""}]},{"kind":"function","name":"module:sap/base/util/uid","basename":"module:sap/base/util/uid","resource":"sap/base/util/uid.js","module":"sap/base/util/uid","export":"","visibility":"public","since":"1.58","description":"Creates and returns a pseudo-unique ID.\n\nNo means for detection of overlap with already present or future UIDs.","returnValue":{"type":"string","description":"A pseudo-unique id."}},{"kind":"class","name":"ResizeHandler","basename":"ResizeHandler","resource":"delegate/ResizeHandler.js","module":"delegate/ResizeHandler","visibility":"public","description":"Allows to register/deregister resize observers for a DOM element","constructor":{"visibility":"public"},"methods":[{"name":"deregister","visibility":"public","static":true,"parameters":[{"name":"element","type":"*","optional":false,"description":"UI5 Web Component or DOM Element to be unobserved"},{"name":"callback","type":"*","optional":false,"description":"Callback to be removed"}]},{"name":"register","visibility":"public","static":true,"parameters":[{"name":"element","type":"*","optional":false,"description":"UI5 Web Component or DOM Element to be observed"},{"name":"callback","type":"*","optional":false,"description":"Callback to be executed"}]}]},{"kind":"enum","name":"sap.ui.webc.base.types.AnimationMode","basename":"AnimationMode","resource":"types/AnimationMode.js","module":"types/AnimationMode","static":true,"visibility":"public","description":"Different types of AnimationMode.","properties":[{"name":"Basic","visibility":"public","type":"Basic"},{"name":"Full","visibility":"public","type":"Full"},{"name":"Minimal","visibility":"public","type":"Minimal"},{"name":"None","visibility":"public","type":"None"}],"slots":[]},{"kind":"enum","name":"sap.ui.webc.base.types.CalendarType","basename":"CalendarType","resource":"types/CalendarType.js","module":"types/CalendarType","static":true,"visibility":"public","description":"Different calendar types.","properties":[{"name":"Buddhist","visibility":"public","type":"Buddhist"},{"name":"Gregorian","visibility":"public","type":"Gregorian"},{"name":"Islamic","visibility":"public","type":"Islamic"},{"name":"Japanese","visibility":"public","type":"Japanese"},{"name":"Persian","visibility":"public","type":"Persian"}],"slots":[]},{"kind":"class","name":"sap.ui.webc.base.types.CSSColor","basename":"CSSColor","resource":"types/CSSColor.js","module":"types/CSSColor","static":true,"visibility":"public","extends":"sap.ui.webc.base.types.DataType","description":"CSSColor data type.","constructor":{"visibility":"public"}},{"kind":"class","name":"sap.ui.webc.base.types.DataType","basename":"DataType","resource":"types/DataType.js","module":"types/DataType","static":true,"visibility":"public","constructor":{"visibility":"public"},"methods":[{"name":"isValid","visibility":"public","static":true,"returnValue":{"type":"Boolean"},"description":"Checks if the value is valid for its data type."}]},{"kind":"class","name":"sap.ui.webc.base.types.DOMReference","basename":"DOMReference","resource":"types/DOMReference.js","module":"types/DOMReference","static":true,"visibility":"public","extends":"sap.ui.webc.base.types.DataType","description":"DOM Element reference or ID. <b>Note:</b> If an ID is passed, it is expected to be part of the same <code>document</code> element as the consuming component.","constructor":{"visibility":"public"}},{"kind":"class","name":"sap.ui.webc.base.types.Float","basename":"Float","resource":"types/Float.js","module":"types/Float","static":true,"visibility":"public","extends":"sap.ui.webc.base.types.DataType","description":"Float data type.","constructor":{"visibility":"public"}},{"kind":"class","name":"sap.ui.webc.base.types.Integer","basename":"Integer","resource":"types/Integer.js","module":"types/Integer","static":true,"visibility":"public","extends":"sap.ui.webc.base.types.DataType","description":"Integer data type.","constructor":{"visibility":"public"}},{"kind":"enum","name":"sap.ui.webc.base.types.InvisibleMessageMode","basename":"InvisibleMessageMode","resource":"types/InvisibleMessageMode.js","module":"types/InvisibleMessageMode","static":true,"visibility":"public","description":"Enumeration for different mode behaviors of the InvisibleMessage.","properties":[{"name":"Assertive","visibility":"public","type":"Assertive","description":"Indicates that updates to the region have the highest priority and should be presented to the user immediately."},{"name":"Polite","visibility":"public","type":"Polite","description":"Indicates that updates to the region should be presented at the next graceful opportunity, such as at the end of reading the current sentence, or when the user pauses typing."}],"slots":[]},{"kind":"enum","name":"sap.ui.webc.base.types.ItemNavigationBehavior","basename":"ItemNavigationBehavior","resource":"types/ItemNavigationBehavior.js","module":"types/ItemNavigationBehavior","static":true,"visibility":"public","description":"Different behavior for ItemNavigation.","properties":[{"name":"Cyclic","visibility":"public","type":"Cyclic","description":"Cycling behavior: navigating past the last item continues with the first and vice versa."},{"name":"Static","visibility":"public","type":"Static","description":"Static behavior: navigations stops at the first or last item."}],"slots":[]},{"kind":"enum","name":"sap.ui.webc.base.types.NavigationMode","basename":"NavigationMode","resource":"types/NavigationMode.js","module":"types/NavigationMode","static":true,"visibility":"public","description":"Different navigation modes for ItemNavigation.","properties":[{"name":"Auto","visibility":"public","type":"Auto"},{"name":"Horizontal","visibility":"public","type":"Horizontal"},{"name":"Paging","visibility":"public","type":"Paging"},{"name":"Vertical","visibility":"public","type":"Vertical"}],"slots":[]},{"kind":"enum","name":"sap.ui.webc.base.types.ValueState","basename":"ValueState","resource":"types/ValueState.js","module":"types/ValueState","static":true,"visibility":"public","description":"Different types of ValueStates.","properties":[{"name":"Error","visibility":"public","type":"Error"},{"name":"Information","visibility":"public","type":"Information"},{"name":"None","visibility":"public","type":"None"},{"name":"Success","visibility":"public","type":"Success"},{"name":"Warning","visibility":"public","type":"Warning"}],"slots":[]},{"kind":"class","name":"sap.ui.webc.base.UI5Element","basename":"UI5Element","resource":"UI5Element.js","module":"UI5Element","static":true,"visibility":"public","extends":"HTMLElement","constructor":{"visibility":"public"},"properties":[{"name":"_id","visibility":"protected","type":"undefined","description":"Returns a unique ID for this UI5 Element","deprecated":{"text":"- This property is not guaranteed in future releases"}},{"name":"dependencies","visibility":"protected","static":true,"type":"undefined","description":"Returns an array with the dependencies for this UI5 Web Component, which could be: - composed components (used in its shadow root or static area item) - slotted components that the component may need to communicate with"},{"name":"effectiveDir","visibility":"public","type":"undefined","description":"Determines whether the component should be rendered in RTL mode or not. Returns: \"rtl\", \"ltr\" or undefined"},{"name":"isUI5Element","visibility":"public","type":"undefined","description":"Used to duck-type UI5 elements without using instanceof"},{"name":"metadata","visibility":"protected","static":true,"type":"undefined","description":"Returns the metadata object for this UI5 Web Component Class"},{"name":"staticAreaStyles","visibility":"protected","static":true,"type":"undefined","description":"Returns the Static Area CSS for this UI5 Web Component Class"},{"name":"styles","visibility":"protected","static":true,"type":"undefined","description":"Returns the CSS for this UI5 Web Component Class"}],"slots":[],"methods":[{"name":"_render","visibility":"protected","description":"Do not call this method directly, only intended to be called by js"},{"name":"attachInvalidate","visibility":"public","parameters":[{"name":"callback","type":"InvalidationInfo","optional":false}],"description":"Attach a callback that will be executed whenever the component is invalidated"},{"name":"define","visibility":"public","static":true,"returnValue":{"type":"Promise.<UI5Element>"},"description":"Registers a UI5 Web Component in the browser window object"},{"name":"detachInvalidate","visibility":"public","parameters":[{"name":"callback","type":"InvalidationInfo","optional":false}],"description":"Detach the callback that is executed whenever the component is invalidated"},{"name":"fireEvent","visibility":"public","returnValue":{"type":"boolean","description":"false, if the event was cancelled (preventDefault called), true otherwise"},"parameters":[{"name":"name","type":"undefined","optional":false,"description":"name of the event"},{"name":"data","type":"undefined","optional":false,"description":"additional data for the event"},{"name":"cancelable","type":"undefined","optional":false,"defaultValue":false,"description":"true, if the user can call preventDefault on the event object"},{"name":"bubbles","type":"undefined","optional":false,"defaultValue":true,"description":"true, if the event bubbles"}]},{"name":"focus","visibility":"public","parameters":[{"name":"focusOptions","type":"FocusOptions","optional":false,"description":"additional options for the focus"}],"description":"Set the focus to the element, returned by \"getFocusDomRef()\" (marked by \"data-sap-focus-ref\")"},{"name":"getDomRef","visibility":"public","description":"Returns the DOM Element inside the Shadow Root that corresponds to the opening tag in the UI5 Web Component's template *Note:* For logical (abstract) elements (items, options, etc...), returns the part of the parent's DOM that represents this option Use this method instead of \"this.shadowRoot\" to read the Shadow DOM, if ever necessary"},{"name":"getFocusDomRef","visibility":"public","description":"Returns the DOM Element marked with \"data-sap-focus-ref\" inside the template. This is the element that will receive the focus by default."},{"name":"getFocusDomRefAsync","visibility":"public","description":"Waits for dom ref and then returns the DOM Element marked with \"data-sap-focus-ref\" inside the template. This is the element that will receive the focus by default."},{"name":"getMetadata","visibility":"public","static":true,"returnValue":{"type":"UI5ElementMetadata"},"description":"Returns an instance of UI5ElementMetadata.js representing this UI5 Web Component's full metadata (its and its parents') Note: not to be confused with the \"get metadata()\" method, which returns an object for this class's metadata only"},{"name":"getSlottedNodes","visibility":"public","description":"Returns the actual children, associated with a slot. Useful when there are transitive slots in nested component scenarios and you don't want to get a list of the slots, but rather of their content."},{"name":"getStaticAreaItemDomRef","visibility":"public"},{"name":"getUniqueDependencies","visibility":"public","static":true,"description":"Returns a list of the unique dependencies for this UI5 Web Component"},{"name":"onAfterRendering","visibility":"public","description":"Called every time after the component renders."},{"name":"onBeforeRendering","visibility":"public","description":"Called every time before the component renders."},{"name":"onDefine","visibility":"protected","static":true,"returnValue":{"type":"Promise.<void>"},"description":"Hook that will be called upon custom element definition"},{"name":"onEnterDOM","visibility":"public","description":"Called on connectedCallback - added to the DOM."},{"name":"onExitDOM","visibility":"public","description":"Called on disconnectedCallback - removed from the DOM."},{"name":"onInvalidation","visibility":"public","parameters":[{"name":"changeInfo","type":"undefined","optional":false,"description":"An object with information about the change that caused invalidation. The object can have the following properties: - type: (property|slot) tells what caused the invalidation 1) property: a property value was changed either directly or as a result of changing the corresponding attribute 2) slot: a slotted node(nodes) changed in one of several ways (see \"reason\")\n\n- name: the name of the property or slot that caused the invalidation\n\n- reason: (children|textcontent|childchange|slotchange) relevant only for type=\"slot\" only and tells exactly what changed in the slot 1) children: immediate children (HTML elements or text nodes) were added, removed or reordered in the slot 2) textcontent: text nodes in the slot changed value (or nested text nodes were added or changed value). Can only trigger for slots of \"type: Node\" 3) slotchange: a slot element, slotted inside that slot had its \"slotchange\" event listener called. This practically means that transitively slotted children changed. Can only trigger if the child of a slot is a slot element itself. 4) childchange: indicates that a UI5Element child in that slot was invalidated and in turn invalidated the component. Can only trigger for slots with \"invalidateOnChildChange\" metadata descriptor\n\n- newValue: the new value of the property (for type=\"property\" only)\n\n- oldValue: the old value of the property (for type=\"property\" only)\n\n- child the child that was changed (for type=\"slot\" and reason=\"childchange\" only)"}],"description":"A callback that is executed each time an already rendered component is invalidated (scheduled for re-rendering)"}]},{"kind":"class","name":"UI5ElementMetadata","basename":"UI5ElementMetadata","resource":"UI5ElementMetadata.js","module":"UI5ElementMetadata","export":"","visibility":"public","constructor":{"visibility":"public"},"methods":[{"name":"getAttributesList","visibility":"public","returnValue":{"type":"string[]"},"description":"Returns an array with the attributes of the UI5 Element (in kebab-case)"},{"name":"getEvents","visibility":"public","description":"Returns an object with key-value pairs of events and their metadata definitions"},{"name":"getProperties","visibility":"public","description":"Returns an object with key-value pairs of properties and their metadata definitions"},{"name":"getPropertiesList","visibility":"public","returnValue":{"type":"string[]"},"description":"Returns an array with the properties of the UI5 Element (in camelCase)"},{"name":"getPureTag","visibility":"public","description":"Returns the tag of the UI5 Element without the scope"},{"name":"getSlots","visibility":"public","description":"Returns an object with key-value pairs of slots and their metadata definitions"},{"name":"getTag","visibility":"public","description":"Returns the tag of the UI5 Element"},{"name":"hasAttribute","visibility":"public","returnValue":{"type":"boolean"},"parameters":[{"name":"propName","type":"undefined","optional":false}],"description":"Determines whether a property should have an attribute counterpart"},{"name":"hasIndividualSlots","visibility":"public","description":"Determines whether this UI5 Element supports any slots with \"individualSlots: true\""},{"name":"hasSlots","visibility":"public","description":"Determines whether this UI5 Element supports any slots"},{"name":"slotsAreManaged","visibility":"public","description":"Determines whether this UI5 Element needs to invalidate if children are added/removed/changed"},{"name":"supportsF6FastNavigation","visibility":"public","description":"Determines whether this control supports F6 fast navigation"},{"name":"validatePropertyValue","visibility":"public","static":true,"description":"Validates the property's value and returns it if correct or returns the default value if not. <b>Note:</b> Only intended for use by UI5Element.js"}]}]}
const VersionInfo = {
version: "1.14.6",
version: "1.14.7",
major: 1,
minor: 14,
patch: 6,
patch: 7,
suffix: "",
isNext: false,
buildTime: 1700669317,
buildTime: 1706171276,
};
export default VersionInfo;

@@ -0,7 +1,34 @@

// TODO-evo:assert on node throws an error if the assertion is violated
/**
* A simple assertion mechanism that logs a message when a given condition is not met.
*
* <b>Note:</b> Calls to this method might be removed when the JavaScript code
* is optimized during build. Therefore, callers should not rely on any side effects
* of this method.
*
* @function
* @since 1.58
* @alias module:sap/base/assert
* @param {boolean} bResult Result of the checked assertion
* @param {string|function():any} vMessage Message that will be logged when the result is <code>false</code>.
* In case this is a function, the return value of the function will be displayed. This can be used to execute
* complex code only if the assertion fails.
* @public
* @SecSink {1|SECRET} Could expose secret data in logs
*
*/ /*!
* OpenUI5
* (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
var fnAssert = function (bResult, vMessage) {
if (!bResult) {
var sMessage = typeof vMessage === "function" ? vMessage() : vMessage;
/*eslint-disable no-console */
console.assert(bResult, sMessage);
/*eslint-enable no-console */
}
};
export default fnAssert;
export default fnAssert;

@@ -1,240 +0,750 @@

import now from './util/now.js';
/*!
* OpenUI5
* (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
import BaseConfig from "./config.js";
import now from "./util/now.js";
/**
* A Logging API for JavaScript.
*
* Provides methods to manage a client-side log and to create entries in it. Each of the logging methods
* {@link module:sap/base/Log.debug}, {@link module:sap/base/Log.info}, {@link module:sap/base/Log.warning},
* {@link module:sap/base/Log.error} and {@link module:sap/base/Log.fatal} creates and records a log entry,
* containing a timestamp, a log level, a message with details and a component info.
* The log level will be one of {@link module:sap/base/Log.Level} and equals the name of the concrete logging method.
*
* By using the {@link module:sap/base/Log.setLevel} method, consumers can determine the least important
* log level which should be recorded. Less important entries will be filtered out. (Note that higher numeric
* values represent less important levels). The initially set level depends on the mode that UI5 is running in.
* When the optimized sources are executed, the default level will be {@link module:sap/base/Log.Level.ERROR}.
* For normal (debug sources), the default level is {@link module:sap/base/Log.Level.DEBUG}.
*
* All logging methods allow to specify a <b>component</b>. These components are simple strings and
* don't have a special meaning to the UI5 framework. However they can be used to semantically group
* log entries that belong to the same software component (or feature). There are two APIs that help
* to manage logging for such a component. With {@link module:sap/base/Log.getLogger},
* one can retrieve a logger that automatically adds the given <code>sComponent</code> as component
* parameter to each log entry, if no other component is specified. Typically, JavaScript code will
* retrieve such a logger once during startup and reuse it for the rest of its lifecycle.
* Second, the {@link module:sap/base/Log.setLevel}(iLevel, sComponent) method allows to set the log level
* for a specific component only. This allows a more fine grained control about the created logging entries.
* {@link module:sap/base/Log.getLevel} allows to retrieve the currently effective log level for a given
* component.
*
* {@link module:sap/base/Log.getLogEntries} returns an array of the currently collected log entries.
*
* Furthermore, a listener can be registered to the log. It will be notified whenever a new entry
* is added to the log. The listener can be used for displaying log entries in a separate page area,
* or for sending it to some external target (server).
*
* @public
* @since 1.58
* @namespace
* @alias module:sap/base/Log
*/
var Log = {};
/**
* Enumeration of the configurable log levels that a Logger should persist to the log.
*
* Only if the current LogLevel is higher than the level {@link module:sap/base/Log.Level} of the currently added log entry,
* then this very entry is permanently added to the log. Otherwise it is ignored.
* @enum {int}
* @public
*/
Log.Level = {
NONE: -1,
FATAL: 0,
ERROR: 1,
WARNING: 2,
INFO: 3,
DEBUG: 4,
TRACE: 5,
ALL: 5 + 1
/**
* Do not log anything
* @public
*/
NONE: -1,
/**
* Fatal level. Use this for logging unrecoverable situations
* @public
*/
FATAL: 0,
/**
* Error level. Use this for logging of erroneous but still recoverable situations
* @public
*/
ERROR: 1,
/**
* Warning level. Use this for logging unwanted but foreseen situations
* @public
*/
WARNING: 2,
/**
* Info level. Use this for logging information of purely informative nature
* @public
*/
INFO: 3,
/**
* Debug level. Use this for logging information necessary for debugging
* @public
*/
DEBUG: 4,
/**
* Trace level. Use this for tracing the program flow.
* @public
*/
TRACE: 5,
/**
* Trace level to log everything.
* @public
*/
ALL: 5 + 1
};
var aLog = [], mMaxLevel = { '': Log.Level.ERROR }, iLogEntriesLimit = 3000, oListener = null, bLogSupportInfo = false;
/**
* The array that holds the log entries that have been recorded so far
*/
var aLog = [],
/**
* Maximum log level to be recorded (per component).
*/
mMaxLevel = {
'': Log.Level.ERROR
},
/**
* Maximum amount of stored log entries
*/
iLogEntriesLimit = 3000,
/**
* Registered listener to be informed about new log entries.
*/
oListener = null,
/**
* Additional support information delivered by callback should be logged
*/
bLogSupportInfo = false;
function pad0(i, w) {
return ('000' + String(i)).slice(-w);
return ("000" + String(i)).slice(-w);
}
function level(sComponent) {
return !sComponent || isNaN(mMaxLevel[sComponent]) ? mMaxLevel[''] : mMaxLevel[sComponent];
return !sComponent || isNaN(mMaxLevel[sComponent]) ? mMaxLevel[''] : mMaxLevel[sComponent];
}
/**
* Discard 30 percent of log entries when the limit is reached
*/
function discardLogEntries() {
var iLogLength = aLog.length;
if (iLogLength) {
var iEntriesToKeep = Math.min(iLogLength, Math.floor(iLogEntriesLimit * 0.7));
if (oListener) {
oListener.onDiscardLogEntries(aLog.slice(0, iLogLength - iEntriesToKeep));
}
if (iEntriesToKeep) {
aLog = aLog.slice(-iEntriesToKeep, iLogLength);
} else {
aLog = [];
}
var iLogLength = aLog.length;
if (iLogLength) {
var iEntriesToKeep = Math.min(iLogLength, Math.floor(iLogEntriesLimit * 0.7));
if (oListener) {
// Notify listener that entries are being discarded
oListener.onDiscardLogEntries(aLog.slice(0, iLogLength - iEntriesToKeep));
}
if (iEntriesToKeep) {
aLog = aLog.slice(-iEntriesToKeep, iLogLength);
} else {
aLog = [];
}
}
}
/**
* Gets the log entry listener instance, if not present creates a new one
* @returns {Object} the singleton log entry listener
*/
function getLogEntryListenerInstance() {
if (!oListener) {
oListener = {
listeners: [],
onLogEntry: function (oLogEntry) {
for (var i = 0; i < oListener.listeners.length; i++) {
if (oListener.listeners[i].onLogEntry) {
oListener.listeners[i].onLogEntry(oLogEntry);
}
}
},
onDiscardLogEntries: function (aDiscardedLogEntries) {
for (var i = 0; i < oListener.listeners.length; i++) {
if (oListener.listeners[i].onDiscardLogEntries) {
oListener.listeners[i].onDiscardLogEntries(aDiscardedLogEntries);
}
}
},
attach: function (oLog, oLstnr) {
if (oLstnr) {
oListener.listeners.push(oLstnr);
if (oLstnr.onAttachToLog) {
oLstnr.onAttachToLog(oLog);
}
}
},
detach: function (oLog, oLstnr) {
for (var i = 0; i < oListener.listeners.length; i++) {
if (oListener.listeners[i] === oLstnr) {
if (oLstnr.onDetachFromLog) {
oLstnr.onDetachFromLog(oLog);
}
oListener.listeners.splice(i, 1);
return;
}
}
if (!oListener) {
oListener = {
listeners: [],
onLogEntry: function (oLogEntry) {
for (var i = 0; i < oListener.listeners.length; i++) {
if (oListener.listeners[i].onLogEntry) {
oListener.listeners[i].onLogEntry(oLogEntry);
}
}
},
onDiscardLogEntries: function (aDiscardedLogEntries) {
for (var i = 0; i < oListener.listeners.length; i++) {
if (oListener.listeners[i].onDiscardLogEntries) {
oListener.listeners[i].onDiscardLogEntries(aDiscardedLogEntries);
}
}
},
attach: function (oLog, oLstnr) {
if (oLstnr) {
oListener.listeners.push(oLstnr);
if (oLstnr.onAttachToLog) {
oLstnr.onAttachToLog(oLog);
}
}
},
detach: function (oLog, oLstnr) {
for (var i = 0; i < oListener.listeners.length; i++) {
if (oListener.listeners[i] === oLstnr) {
if (oLstnr.onDetachFromLog) {
oLstnr.onDetachFromLog(oLog);
}
};
}
return oListener;
oListener.listeners.splice(i, 1);
return;
}
}
}
};
}
return oListener;
}
/**
* Creates a new fatal-level entry in the log with the given message, details and calling component.
*
* @param {string} sMessage
* Message text to display
* @param {string|Error} [vDetails='']
* Optional details about the message, might be omitted. Can be an Error object which will be
* logged together with its stacktrace.
* @param {string} [sComponent='']
* Name of the component that produced the log entry
* @param {function} [fnSupportInfo]
* Callback that returns an additional support object to be logged in support mode.
* This function is only called if support info mode is turned on with
* <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and
* memory consumption, the returned object should be a simple immutable JSON object with mostly
* static and stable content.
* @public
* @SecSink {0 1 2|SECRET} Could expose secret data in logs
*/
Log.fatal = function (sMessage, vDetails, sComponent, fnSupportInfo) {
log(Log.Level.FATAL, sMessage, vDetails, sComponent, fnSupportInfo);
log(Log.Level.FATAL, sMessage, vDetails, sComponent, fnSupportInfo);
};
/**
* Creates a new error-level entry in the log with the given message, details and calling component.
*
* @param {string} sMessage
* Message text to display
* @param {string|Error} [vDetails='']
* Optional details about the message, might be omitted. Can be an Error object which will be
* logged together with its stacktrace.
* @param {string} [sComponent='']
* Name of the component that produced the log entry
* @param {function} [fnSupportInfo]
* Callback that returns an additional support object to be logged in support mode.
* This function is only called if support info mode is turned on with
* <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and
* memory consumption, the returned object should be a simple immutable JSON object with mostly
* static and stable content.
* @public
* @SecSink {0 1 2|SECRET} Could expose secret data in logs
*/
Log.error = function (sMessage, vDetails, sComponent, fnSupportInfo) {
log(Log.Level.ERROR, sMessage, vDetails, sComponent, fnSupportInfo);
log(Log.Level.ERROR, sMessage, vDetails, sComponent, fnSupportInfo);
};
/**
* Creates a new warning-level entry in the log with the given message, details and calling component.
*
* @param {string} sMessage
* Message text to display
* @param {string|Error} [vDetails='']
* Optional details about the message, might be omitted. Can be an Error object which will be
* logged together with its stacktrace.
* @param {string} [sComponent='']
* Name of the component that produced the log entry
* @param {function} [fnSupportInfo]
* Callback that returns an additional support object to be logged in support mode.
* This function is only called if support info mode is turned on with
* <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and
* memory consumption, the returned object should be a simple immutable JSON object with mostly
* static and stable content.
* @public
* @SecSink {0 1 2|SECRET} Could expose secret data in logs
*/
Log.warning = function (sMessage, vDetails, sComponent, fnSupportInfo) {
log(Log.Level.WARNING, sMessage, vDetails, sComponent, fnSupportInfo);
log(Log.Level.WARNING, sMessage, vDetails, sComponent, fnSupportInfo);
};
/**
* Creates a new info-level entry in the log with the given message, details and calling component.
*
* @param {string} sMessage
* Message text to display
* @param {string|Error} [vDetails='']
* Optional details about the message, might be omitted. Can be an Error object which will be
* logged with the stack.
* @param {string} [sComponent='']
* Name of the component that produced the log entry
* @param {function} [fnSupportInfo]
* Callback that returns an additional support object to be logged in support mode.
* This function is only called if support info mode is turned on with
* <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and
* memory consumption, the returned object should be a simple immutable JSON object with mostly
* static and stable content.
* @public
* @SecSink {0 1 2|SECRET} Could expose secret data in logs
*/
Log.info = function (sMessage, vDetails, sComponent, fnSupportInfo) {
log(Log.Level.INFO, sMessage, vDetails, sComponent, fnSupportInfo);
log(Log.Level.INFO, sMessage, vDetails, sComponent, fnSupportInfo);
};
/**
* Creates a new debug-level entry in the log with the given message, details and calling component.
*
* @param {string} sMessage
* Message text to display
* @param {string|Error} [vDetails='']
* Optional details about the message, might be omitted. Can be an Error object which will be
* logged with the stack.
* @param {string} [sComponent='']
* Name of the component that produced the log entry
* @param {function} [fnSupportInfo]
* Callback that returns an additional support object to be logged in support mode.
* This function is only called if support info mode is turned on with
* <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and
* memory consumption, the returned object should be a simple immutable JSON object with mostly
* static and stable content.
* @public
* @SecSink {0 1 2|SECRET} Could expose secret data in logs
*/
Log.debug = function (sMessage, vDetails, sComponent, fnSupportInfo) {
log(Log.Level.DEBUG, sMessage, vDetails, sComponent, fnSupportInfo);
log(Log.Level.DEBUG, sMessage, vDetails, sComponent, fnSupportInfo);
};
/**
* Creates a new trace-level entry in the log with the given message, details and calling component.
*
* @param {string} sMessage
* Message text to display
* @param {string|Error} [vDetails='']
* Optional details about the message, might be omitted. Can be an Error object which will be
* logged with the stack.
* @param {string} [sComponent='']
* Name of the component that produced the log entry
* @param {function} [fnSupportInfo]
* Callback that returns an additional support object to be logged in support mode.
* This function is only called if support info mode is turned on with
* <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and
* memory consumption, the returned object should be a simple immutable JSON object with mostly
* static and stable content.
* @public
* @SecSink {0 1 2|SECRET} Could expose secret data in logs
*/
Log.trace = function (sMessage, vDetails, sComponent, fnSupportInfo) {
log(Log.Level.TRACE, sMessage, vDetails, sComponent, fnSupportInfo);
log(Log.Level.TRACE, sMessage, vDetails, sComponent, fnSupportInfo);
};
/**
* Defines the maximum <code>sap/base/Log.Level</code> of log entries that will be recorded.
* Log entries with a higher (less important) log level will be omitted from the log.
* When a component name is given, the log level will be configured for that component
* only, otherwise the log level for the default component of this logger is set.
* For the global logger, the global default level is set.
*
* <b>Note</b>: Setting a global default log level has no impact on already defined
* component log levels. They always override the global default log level.
*
* @param {module:sap/base/Log.Level} iLogLevel The new log level
* @param {string} [sComponent] The log component to set the log level for
* @public
*/
Log.setLevel = function (iLogLevel, sComponent, _bDefault) {
sComponent = sComponent || '';
if (!_bDefault || mMaxLevel[sComponent] == null) {
mMaxLevel[sComponent] = iLogLevel;
var sLogLevel;
Object.keys(Log.Level).forEach(function (sLevel) {
if (Log.Level[sLevel] === iLogLevel) {
sLogLevel = sLevel;
}
});
log(Log.Level.INFO, 'Changing log level ' + (sComponent ? 'for \'' + sComponent + '\' ' : '') + 'to ' + sLogLevel, '', 'sap.base.log');
}
sComponent = sComponent || '';
if (!_bDefault || mMaxLevel[sComponent] == null) {
mMaxLevel[sComponent] = iLogLevel;
var sLogLevel;
Object.keys(Log.Level).forEach(function (sLevel) {
if (Log.Level[sLevel] === iLogLevel) {
sLogLevel = sLevel;
}
});
log(Log.Level.INFO, "Changing log level " + (sComponent ? "for '" + sComponent + "' " : "") + "to " + sLogLevel, "", "sap.base.log");
}
};
/**
* Returns the log level currently effective for the given component.
* If no component is given or when no level has been configured for a
* given component, the log level for the default component of this logger is returned.
*
* @param {string} [sComponent] Name of the component to retrieve the log level for
* @returns {module:sap/base/Log.Level} The log level for the given component or the default log level
* @public
*/
Log.getLevel = function (sComponent) {
return level(sComponent);
return level(sComponent);
};
/**
* Checks whether logging is enabled for the given log level,
* depending on the currently effective log level for the given component.
*
* If no component is given, the default component of this logger will be taken into account.
*
* @param {module:sap/base/Log.Level} [iLevel=Level.DEBUG] The log level in question
* @param {string} [sComponent] Name of the component to check the log level for
* @returns {boolean} Whether logging is enabled or not
* @public
*/
Log.isLoggable = function (iLevel, sComponent) {
return (iLevel == null ? Log.Level.DEBUG : iLevel) <= level(sComponent);
return (iLevel == null ? Log.Level.DEBUG : iLevel) <= level(sComponent);
};
/**
* Enables or disables whether additional support information is logged in a trace.
* If enabled, logging methods like error, warning, info and debug are calling the additional
* optional callback parameter fnSupportInfo and store the returned object in the log entry property supportInfo.
*
* @param {boolean} bEnabled true if the support information should be logged
* @private
* @ui5-restricted sap.ui.support
*/
Log.logSupportInfo = function (bEnabled) {
bLogSupportInfo = bEnabled;
bLogSupportInfo = bEnabled;
};
/**
* Creates a new log entry depending on its level and component.
*
* If the given level is higher than the max level for the given component
* (or higher than the global level, if no component is given),
* then no entry is created and <code>undefined</code> is returned.
*
* If an <code>Error</code> is passed via <code>vDetails</code> the stack
* of the <code>Error</code> will be logged as a separate parameter in
* the proper <code>console</code> function for the matching log level.
*
* @param {module:sap/base/Log.Level} iLevel
* One of the log levels FATAL, ERROR, WARNING, INFO, DEBUG, TRACE
* @param {string} sMessage
* The message to be logged
* @param {string|Error} [vDetails]
* The optional details for the message; could be an Error which will be logged with the
* stacktrace, to easily find the root cause of the Error
* @param {string} [sComponent]
* The log component under which the message should be logged
* @param {function} [fnSupportInfo] Callback that returns an additional support object to be
* logged in support mode. This function is only called if support info mode is turned on with
* <code>logSupportInfo(true)</code>. To avoid negative effects regarding execution times and
* memory consumption, the returned object should be a simple immutable JSON object with mostly
* static and stable content.
* @returns {module:sap/base/Log.Entry}
* The log entry as an object or <code>undefined</code> if no entry was created
* @private
*/
function log(iLevel, sMessage, vDetails, sComponent, fnSupportInfo) {
if (!fnSupportInfo && !sComponent && typeof vDetails === 'function') {
fnSupportInfo = vDetails;
vDetails = '';
if (!fnSupportInfo && !sComponent && typeof vDetails === "function") {
fnSupportInfo = vDetails;
vDetails = "";
}
if (!fnSupportInfo && typeof sComponent === "function") {
fnSupportInfo = sComponent;
sComponent = "";
}
if (iLevel <= level(sComponent)) {
var fNow = now(),
oNow = new Date(fNow),
iMicroSeconds = Math.floor((fNow - Math.floor(fNow)) * 1000),
oLogEntry = {
time: pad0(oNow.getHours(), 2) + ":" + pad0(oNow.getMinutes(), 2) + ":" + pad0(oNow.getSeconds(), 2) + "." + pad0(oNow.getMilliseconds(), 3) + pad0(iMicroSeconds, 3),
date: pad0(oNow.getFullYear(), 4) + "-" + pad0(oNow.getMonth() + 1, 2) + "-" + pad0(oNow.getDate(), 2),
timestamp: fNow,
level: iLevel,
message: String(sMessage || ""),
details: String(vDetails || ""),
component: String(sComponent || "")
};
if (bLogSupportInfo && typeof fnSupportInfo === "function") {
oLogEntry.supportInfo = fnSupportInfo();
}
if (!fnSupportInfo && typeof sComponent === 'function') {
fnSupportInfo = sComponent;
sComponent = '';
if (iLogEntriesLimit) {
if (aLog.length >= iLogEntriesLimit) {
// Cap the amount of stored log messages by 30 percent
discardLogEntries();
}
aLog.push(oLogEntry);
}
if (iLevel <= level(sComponent)) {
var fNow = now(), oNow = new Date(fNow), iMicroSeconds = Math.floor((fNow - Math.floor(fNow)) * 1000), oLogEntry = {
time: pad0(oNow.getHours(), 2) + ':' + pad0(oNow.getMinutes(), 2) + ':' + pad0(oNow.getSeconds(), 2) + '.' + pad0(oNow.getMilliseconds(), 3) + pad0(iMicroSeconds, 3),
date: pad0(oNow.getFullYear(), 4) + '-' + pad0(oNow.getMonth() + 1, 2) + '-' + pad0(oNow.getDate(), 2),
timestamp: fNow,
level: iLevel,
message: String(sMessage || ''),
details: String(vDetails || ''),
component: String(sComponent || '')
};
if (bLogSupportInfo && typeof fnSupportInfo === 'function') {
oLogEntry.supportInfo = fnSupportInfo();
}
if (iLogEntriesLimit) {
if (aLog.length >= iLogEntriesLimit) {
discardLogEntries();
}
aLog.push(oLogEntry);
}
if (oListener) {
oListener.onLogEntry(oLogEntry);
}
if (console) {
var isDetailsError = vDetails instanceof Error, logText = oLogEntry.date + ' ' + oLogEntry.time + ' ' + oLogEntry.message + ' - ' + oLogEntry.details + ' ' + oLogEntry.component;
switch (iLevel) {
case Log.Level.FATAL:
case Log.Level.ERROR:
isDetailsError ? console.error(logText, '\n', vDetails) : console.error(logText);
break;
case Log.Level.WARNING:
isDetailsError ? console.warn(logText, '\n', vDetails) : console.warn(logText);
break;
case Log.Level.INFO:
if (console.info) {
isDetailsError ? console.info(logText, '\n', vDetails) : console.info(logText);
} else {
isDetailsError ? console.log(logText, '\n', vDetails) : console.log(logText);
}
break;
case Log.Level.DEBUG:
isDetailsError ? console.debug(logText, '\n', vDetails) : console.debug(logText);
break;
case Log.Level.TRACE:
isDetailsError ? console.trace(logText, '\n', vDetails) : console.trace(logText);
break;
}
if (console.info && oLogEntry.supportInfo) {
console.info(oLogEntry.supportInfo);
}
}
return oLogEntry;
if (oListener) {
oListener.onLogEntry(oLogEntry);
}
/*
* Console Log, also tries to log to the console, if available.
*
* Unfortunately, the support for console is quite different between the UI5 browsers. The most important differences are:
* - in FF3.6 the console is not available, until FireBug is opened. It disappears again, when fire bug is closed.
* But when the settings for a web site are stored (convenience), the console remains open
* When the console is available, it supports all relevant methods
* - in FF9.0, the console is always available, but method assert is only available when firebug is open
* - in Webkit browsers, the console object is always available and has all required methods
* - Exception: in the iOS Simulator, console.info() does not exist
*/
/*eslint-disable no-console */
if (console) {
// in Firefox, console might not exist or it might even disappear
var isDetailsError = vDetails instanceof Error,
logText = oLogEntry.date + " " + oLogEntry.time + " " + oLogEntry.message + " - " + oLogEntry.details + " " + oLogEntry.component;
switch (iLevel) {
case Log.Level.FATAL:
case Log.Level.ERROR:
isDetailsError ? console.error(logText, "\n", vDetails) : console.error(logText);
break;
case Log.Level.WARNING:
isDetailsError ? console.warn(logText, "\n", vDetails) : console.warn(logText);
break;
case Log.Level.INFO:
if (console.info) {
// info not available in iOS simulator
isDetailsError ? console.info(logText, "\n", vDetails) : console.info(logText);
} else {
isDetailsError ? console.log(logText, "\n", vDetails) : console.log(logText);
}
break;
case Log.Level.DEBUG:
isDetailsError ? console.debug(logText, "\n", vDetails) : console.debug(logText);
break;
case Log.Level.TRACE:
isDetailsError ? console.trace(logText, "\n", vDetails) : console.trace(logText);
break;
}
if (console.info && oLogEntry.supportInfo) {
console.info(oLogEntry.supportInfo);
}
}
/*eslint-enable no-console */
return oLogEntry;
}
}
/**
* Returns the logged entries recorded so far as an array.
*
* Log entries are plain JavaScript objects with the following properties
* <ul>
* <li>timestamp {number} point in time when the entry was created
* <li>level {module:sap/base/Log.Level} LogLevel level of the entry
* <li>message {string} message text of the entry
* </ul>
* The default amount of stored log entries is limited to 3000 entries.
* @returns {Array<module:sap/base/Log.Entry>} an array containing the recorded log entries
* @public
* @static
*/
Log.getLogEntries = function () {
return aLog.slice();
return aLog.slice();
};
/**
* Returns the maximum amount of stored log entries.
*
* @returns {int|Infinity} The maximum amount of stored log entries or Infinity if no limit is set
* @private
* @ui5-restricted
*/
Log.getLogEntriesLimit = function () {
return iLogEntriesLimit;
return iLogEntriesLimit;
};
/**
* Sets the limit of stored log entries
*
* If the new limit is lower than the current limit, the overlap of old log entries will be discarded.
* If the limit is reached the amount of stored messages will be reduced by 30 percent.
*
* @param {int|Infinity} iLimit The maximum amount of stored log entries or Infinity for unlimited entries
* @private
* @ui5-restricted
*/
Log.setLogEntriesLimit = function (iLimit) {
if (iLimit < 0) {
throw new Error('The log entries limit needs to be greater than or equal to 0!');
}
iLogEntriesLimit = iLimit;
if (aLog.length >= iLogEntriesLimit) {
discardLogEntries();
}
if (iLimit < 0) {
throw new Error("The log entries limit needs to be greater than or equal to 0!");
}
iLogEntriesLimit = iLimit;
if (aLog.length >= iLogEntriesLimit) {
discardLogEntries();
}
};
/**
* @typedef {object} module:sap/base/Log.Entry
* @property {float} timestamp The number of milliseconds since the epoch
* @property {string} time Time string in format HH:mm:ss:mmmnnn
* @property {string} date Date string in format yyyy-MM-dd
* @property {module:sap/base/Log.Level} level The level of the log entry, see {@link module:sap/base/Log.Level}
* @property {string} message The message of the log entry
* @property {string} details The detailed information of the log entry
* @property {string} component The component that creates the log entry
* @property {function():any} [supportInfo] Callback that returns an additional support object to be
* logged in support mode.
* @public
*/
/**
* Interface to be implemented by a log listener.
*
* Typically, a listener will at least implement the {@link #.onLogEntry} method,
* but in general, all methods are optional.
*
* @interface
* @name module:sap/base/Log.Listener
* @public
*/
/**
* The function that is called when a new log entry is created
*
* @param {module:sap/base/Log.Entry} oLogEntry The newly created log entry
* @name module:sap/base/Log.Listener.onLogEntry?
* @function
* @public
*/
/**
* The function that is called once the Listener is attached
*
* @param {module:sap/base/Log} oLog The Log instance where the listener is attached
* @name module:sap/base/Log.Listener.onAttachToLog?
* @function
* @public
*/
/**
* The function that is called once the Listener is detached
*
* @param {module:sap/base/Log} oLog The Log instance where the listener is detached
* @name module:sap/base/Log.Listener.onDetachFromLog?
* @function
* @public
*/
/**
* The function that is called once log entries are discarded due to the exceed of total log entry amount
*
* @param {Array<module:sap/base/Log.Entry>} aDiscardedEntries The discarded log entries
* @name module:sap/base/Log.Listener.onDiscardLogEntries?
* @function
* @public
*/
/**
* Allows to add a new listener that will be notified for new log entries.
*
* The given object must provide method <code>onLogEntry</code> and can also be informed
* about <code>onDetachFromLog</code>, <code>onAttachToLog</code> and <code>onDiscardLogEntries</code>.
* @param {module:sap/base/Log.Listener} oListener The new listener object that should be informed
* @public
* @static
*/
Log.addLogListener = function (oListener) {
getLogEntryListenerInstance().attach(this, oListener);
getLogEntryListenerInstance().attach(this, oListener);
};
/**
* Allows to remove a registered LogListener.
* @param {module:sap/base/Log.Listener} oListener The listener object that should be removed
* @public
* @static
*/
Log.removeLogListener = function (oListener) {
getLogEntryListenerInstance().detach(this, oListener);
getLogEntryListenerInstance().detach(this, oListener);
};
/**
* The logger comes with a subset of the API of the <code>sap/base/Log</code> module:
* <ul>
* <li><code>#fatal</code> - see: {@link module:sap/base/Log.fatal}
* <li><code>#error</code> - see: {@link module:sap/base/Log.error}
* <li><code>#warning</code> - see: {@link module:sap/base/Log.warning}
* <li><code>#info</code> - see: {@link module:sap/base/Log.info}
* <li><code>#debug</code> - see: {@link module:sap/base/Log.debug}
* <li><code>#trace</code> - see: {@link module:sap/base/Log.trace}
* <li><code>#setLevel</code> - see: {@link module:sap/base/Log.setLevel}
* <li><code>#getLevel</code> - see: {@link module:sap/base/Log.getLevel}
* <li><code>#isLoggable</code> - see: {@link module:sap/base/Log.isLoggable}
* </ul>
* @interface
* @borrows module:sap/base/Log.fatal as #fatal
* @borrows module:sap/base/Log.error as #error
* @borrows module:sap/base/Log.warning as #warning
* @borrows module:sap/base/Log.info as #info
* @borrows module:sap/base/Log.debug as #debug
* @borrows module:sap/base/Log.trace as #trace
* @borrows module:sap/base/Log.setLevel as #setLevel
* @borrows module:sap/base/Log.getLevel as #getLevel
* @borrows module:sap/base/Log.isLoggable as #isLoggable
* @name module:sap/base/Log.Logger
* @public
*/
function Logger(sComponent) {
this.fatal = function (msg, detail, comp, support) {
Log.fatal(msg, detail, comp || sComponent, support);
return this;
};
this.error = function (msg, detail, comp, support) {
Log.error(msg, detail, comp || sComponent, support);
return this;
};
this.warning = function (msg, detail, comp, support) {
Log.warning(msg, detail, comp || sComponent, support);
return this;
};
this.info = function (msg, detail, comp, support) {
Log.info(msg, detail, comp || sComponent, support);
return this;
};
this.debug = function (msg, detail, comp, support) {
Log.debug(msg, detail, comp || sComponent, support);
return this;
};
this.trace = function (msg, detail, comp, support) {
Log.trace(msg, detail, comp || sComponent, support);
return this;
};
this.setLevel = function (level, comp) {
Log.setLevel(level, comp || sComponent);
return this;
};
this.getLevel = function (comp) {
return Log.getLevel(comp || sComponent);
};
this.isLoggable = function (level, comp) {
return Log.isLoggable(level, comp || sComponent);
};
this.fatal = function (msg, detail, comp, support) {
Log.fatal(msg, detail, comp || sComponent, support);
return this;
};
this.error = function (msg, detail, comp, support) {
Log.error(msg, detail, comp || sComponent, support);
return this;
};
this.warning = function (msg, detail, comp, support) {
Log.warning(msg, detail, comp || sComponent, support);
return this;
};
this.info = function (msg, detail, comp, support) {
Log.info(msg, detail, comp || sComponent, support);
return this;
};
this.debug = function (msg, detail, comp, support) {
Log.debug(msg, detail, comp || sComponent, support);
return this;
};
this.trace = function (msg, detail, comp, support) {
Log.trace(msg, detail, comp || sComponent, support);
return this;
};
this.setLevel = function (level, comp) {
Log.setLevel(level, comp || sComponent);
return this;
};
this.getLevel = function (comp) {
return Log.getLevel(comp || sComponent);
};
this.isLoggable = function (level, comp) {
return Log.isLoggable(level, comp || sComponent);
};
}
/**
* Returns a dedicated logger for a component.
*
* The logger comes with the same API as the <code>sap/base/Log</code> module:
* <ul>
* <li><code>#fatal</code> - see: {@link module:sap/base/Log.fatal}
* <li><code>#error</code> - see: {@link module:sap/base/Log.error}
* <li><code>#warning</code> - see: {@link module:sap/base/Log.warning}
* <li><code>#info</code> - see: {@link module:sap/base/Log.info}
* <li><code>#debug</code> - see: {@link module:sap/base/Log.debug}
* <li><code>#trace</code> - see: {@link module:sap/base/Log.trace}
* <li><code>#setLevel</code> - see: {@link module:sap/base/Log.setLevel}
* <li><code>#getLevel</code> - see: {@link module:sap/base/Log.getLevel}
* <li><code>#isLoggable</code> - see: {@link module:sap/base/Log.isLoggable}
* </ul>
*
* @param {string} sComponent Name of the component which should be logged
* @param {module:sap/base/Log.Level} [iDefaultLogLevel] The default log level
* @return {module:sap/base/Log.Logger} A logger with a specified component
* @public
* @static
*/
Log.getLogger = function (sComponent, iDefaultLogLevel) {
if (!isNaN(iDefaultLogLevel) && mMaxLevel[sComponent] == null) {
mMaxLevel[sComponent] = iDefaultLogLevel;
}
return new Logger(sComponent);
if (!isNaN(iDefaultLogLevel) && mMaxLevel[sComponent] == null) {
mMaxLevel[sComponent] = iDefaultLogLevel;
}
return new Logger(sComponent);
};
// set LogLevel
const sLogLevel = BaseConfig.get({
name: "sapUiLogLevel",
type: BaseConfig.Type.String,
defaultValue: undefined,
external: true
});
if (sLogLevel) {
Log.setLevel(Log.Level[sLogLevel.toUpperCase()] || parseInt(sLogLevel));
} else if (!globalThis["sap-ui-optimized"]) {
Log.setLevel(Log.Level.DEBUG);
}
export default Log;

@@ -1,14 +0,40 @@

import toHex from '../strings/toHex.js';
/*!
* OpenUI5
* (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
import toHex from "../strings/toHex.js";
/**
* RegExp and escape function for CSS escaping
*/
// eslint-disable-next-line no-control-regex -- special characters are really needed here!
var rCSS = /[\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xff\u2028\u2029][0-9A-Fa-f]?/g;
var fnCSS = function (sChar) {
var iChar = sChar.charCodeAt(0);
if (sChar.length === 1) {
return '\\' + toHex(iChar);
} else {
return '\\' + toHex(iChar) + ' ' + sChar.substr(1);
}
var iChar = sChar.charCodeAt(0);
if (sChar.length === 1) {
return "\\" + toHex(iChar);
} else {
return "\\" + toHex(iChar) + " " + sChar.substr(1);
}
};
/*
* Encoding according to the Secure Programming Guide
* <SAPWIKI>/wiki/display/NWCUIAMSIM/XSS+Secure+Programming+Guide
*/
/**
* Encode the string for inclusion into CSS string literals or identifiers.
*
* @function
* @since 1.58
* @alias module:sap/base/security/encodeCSS
* @param {string} sString The string to be escaped
* @returns {string} The encoded string
* @SecValidate {0|return|XSS} validates the given string for a CSS context
* @public
*/
var fnEncodeCSS = function (sString) {
return sString.replace(rCSS, fnCSS);
return sString.replace(rCSS, fnCSS);
};
export default fnEncodeCSS;

@@ -1,23 +0,53 @@

import toHex from '../strings/toHex.js';
var rHtml = /[\x00-\x2b\x2f\x3a-\x40\x5b-\x5e\x60\x7b-\xff\u2028\u2029]/g, rHtmlReplace = /[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/, mHtmlLookup = {
'<': '&lt;',
'>': '&gt;',
'&': '&amp;',
'"': '&quot;'
};
/*!
* OpenUI5
* (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
import toHex from "../strings/toHex.js";
/* eslint-disable no-control-regex -- special characters are really needed here! */
/**
* RegExp and escape function for HTML escaping
*/
var rHtml = /[\x00-\x2b\x2f\x3a-\x40\x5b-\x5e\x60\x7b-\xff\u2028\u2029]/g,
rHtmlReplace = /[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/,
mHtmlLookup = {
"<": "&lt;",
">": "&gt;",
"&": "&amp;",
"\"": "&quot;"
};
/* eslint-enable no-control-regex */
var fnHtml = function (sChar) {
var sEncoded = mHtmlLookup[sChar];
if (!sEncoded) {
if (rHtmlReplace.test(sChar)) {
sEncoded = '&#xfffd;';
} else {
sEncoded = '&#x' + toHex(sChar.charCodeAt(0)) + ';';
}
mHtmlLookup[sChar] = sEncoded;
var sEncoded = mHtmlLookup[sChar];
if (!sEncoded) {
if (rHtmlReplace.test(sChar)) {
sEncoded = "&#xfffd;";
} else {
sEncoded = "&#x" + toHex(sChar.charCodeAt(0)) + ";";
}
return sEncoded;
mHtmlLookup[sChar] = sEncoded;
}
return sEncoded;
};
/*
* Encoding according to the Secure Programming Guide
* <SAPWIKI>/wiki/display/NWCUIAMSIM/XSS+Secure+Programming+Guide
*/
/**
* Encode the string for inclusion into XML content/attribute.
*
* @function
* @since 1.58
* @alias module:sap/base/security/encodeXML
* @param {string} sString The string to be escaped
* @returns {string} The encoded string
* @SecValidate {0|return|XSS} validates the given string for XML contexts
* @public
*/
var fnEncodeXML = function (sString) {
return sString.replace(rHtml, fnHtml);
return sString.replace(rHtml, fnHtml);
};
export default fnEncodeXML;

@@ -1,16 +0,38 @@

import assert from '../assert.js';
import URLListValidator from './URLListValidator.js';
import '../../ui/thirdparty/caja-html-sanitizer.js';
/*!
* OpenUI5
* (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
/*
* IMPORTANT: This is a private module, its API must not be used and is subject to change.
* Code other than the OpenUI5 libraries must not introduce dependencies to this module.
*/
import assert from "../assert.js";
import URLListValidator from "./URLListValidator.js";
import "../../ui/thirdparty/caja-html-sanitizer.js";
/**
* Strips unsafe tags and attributes from HTML.
*
* @function
* @since 1.58
* @alias module:sap/base/security/sanitizeHTML
* @param {string} sHTML the HTML to be sanitized.
* @param {object} [mOptions={}] options for the sanitizer
* @return {string} sanitized HTML
* @private
*/
var fnSanitizeHTML = function (sHTML, mOptions) {
assert(window.html && window.html.sanitize, 'Sanitizer should have been loaded');
mOptions = mOptions || {
uriRewriter: function (sUrl) {
if (URLListValidator.validate(sUrl)) {
return sUrl;
}
}
};
var oTagPolicy = mOptions.tagPolicy || window.html.makeTagPolicy(mOptions.uriRewriter, mOptions.tokenPolicy);
return window.html.sanitizeWithPolicy(sHTML, oTagPolicy);
assert(window.html && window.html.sanitize, "Sanitizer should have been loaded");
mOptions = mOptions || {
uriRewriter: function (sUrl) {
// by default, we use the URLListValidator to check the URLs
if (URLListValidator.validate(sUrl)) {
return sUrl;
}
}
};
var oTagPolicy = mOptions.tagPolicy || window.html.makeTagPolicy(mOptions.uriRewriter, mOptions.tokenPolicy);
return window.html.sanitizeWithPolicy(sHTML, oTagPolicy);
};
export default fnSanitizeHTML;

@@ -0,1 +1,8 @@

// validation regexes
/*!
* OpenUI5
* (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
var rBasicUrl = /^(?:([^:\/?#]+):)?((?:[\/\\]{2,}((?:\[[^\]]+\]|[^\/?#:]+))(?::([0-9]+))?)?([^?#]*))(?:\?([^#]*))?(?:#(.*))?$/;

@@ -12,7 +19,40 @@ var rCheckPath = /^([a-z0-9-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*$/i;

var rSpecialSchemeURLs = /^((?:ftp|https?|wss?):)([\s\S]+)$/;
/* eslint-disable no-control-regex */
var rCheckWhitespaces = /[\u0009\u000A\u000D]/;
/**
* Registry to manage allowed URLs and validate against them.
*
* @namespace
* @since 1.85
* @alias module:sap/base/security/URLListValidator
* @public
*/
var oURLListValidator = {};
/**
* Creates a new URLListValidator.Entry object
*
* @param {string} [protocol] The protocol of the URL, can be falsy to allow all protocols for an entry e.g. "", "http", "mailto"
* @param {string} [host] The host of the URL, can be falsy to allow all hosts. A wildcard asterisk can be set at the beginning, e.g. "examples.com", "*.example.com"
* @param {string} [port] The port of the URL, can be falsy to allow all ports, e.g. "", "8080"
* @param {string} [path] the path of the URL, path of the url, can be falsy to allow all paths. A wildcard asterisk can be set at the end, e.g. "/my-example*", "/my-news"
* @returns {module:sap/base/security/URLListValidator.Entry|object}
* @private
*/
oURLListValidator._createEntry = function (protocol, host, port, path) {
return new URLListValidatorEntry(protocol, host, port, path);
};
/**
* Entry object of the URLListValidator.
*
* @public
* @typedef {object} module:sap/base/security/URLListValidator.Entry
* @property {string} [protocol] The protocol of the URL, can be falsy to allow all protocols for an entry e.g. "", "http", "mailto"
* @property {string} [host] The host of the URL, can be falsy to allow all hosts. A wildcard asterisk can be set at the beginning, e.g. "examples.com", "*.example.com"
* @property {string} [port] The port of the URL, can be falsy to allow all ports, e.g. "", "8080"
* @property {string} [path] the path of the URL, path of the url, can be falsy to allow all paths. A wildcard asterisk can be set at the end, e.g. "/my-example*", "/my-news"
*/
function URLListValidatorEntry(protocol, host, port, path) {

@@ -38,6 +78,35 @@ Object.defineProperties(this, {

}
/**
* The internally managed allowed entries.
* @private
*/
var aAllowedEntries = [];
/**
* Clears the allowed entries for URL validation.
* This makes all URLs allowed.
*
* @public
*/
oURLListValidator.clear = function () {
aAllowedEntries = [];
};
/**
* Adds an allowed entry.
*
* Note:
* Adding the first entry to the list of allowed entries will disallow all URLs but the ones matching the newly added entry.
*
* <b>Note</b>:
* It is strongly recommended to set a path only in combination with an origin (never set a path alone).
* There's almost no case where checking only the path of a URL would allow to ensure its validity.
*
* @param {string} [protocol] The protocol of the URL, can be falsy to allow all protocols for an entry e.g. "", "http", "mailto"
* @param {string} [host] The host of the URL, can be falsy to allow all hosts. A wildcard asterisk can be set at the beginning, e.g. "examples.com", "*.example.com"
* @param {string} [port] The port of the URL, can be falsy to allow all ports, e.g. "", "8080"
* @param {string} [path] the path of the URL, path of the url, can be falsy to allow all paths. A wildcard asterisk can be set at the end, e.g. "/my-example*", "/my-news"
* @public
*/
oURLListValidator.add = function (protocol, host, port, path) {

@@ -47,9 +116,150 @@ var oEntry = this._createEntry(protocol, host, port, path);

};
/**
* Deletes an entry from the allowed entries.
*
* Note:
* Deleting the last entry from the list of allowed entries will allow all URLs.
*
* @param {module:sap/base/security/URLListValidator.Entry} oEntry The entry to be deleted
* @private
*/
oURLListValidator._delete = function (oEntry) {
aAllowedEntries.splice(aAllowedEntries.indexOf(oEntry), 1);
};
/**
* Gets the list of allowed entries.
*
* @returns {module:sap/base/security/URLListValidator.Entry[]} The allowed entries
* @public
*/
oURLListValidator.entries = function () {
return aAllowedEntries.slice();
};
/**
* Validates a URL. Check if it's not a script or other security issue.
*
* <b>Note</b>:
* It is strongly recommended to validate only absolute URLs. There's almost no case
* where checking only the path of a URL would allow to ensure its validity.
* For compatibility reasons, this API cannot automatically resolve URLs relative to
* <code>document.baseURI</code>, but callers should do so. In that case, and when the
* allow list is not empty, an entry for the origin of <code>document.baseURI</code>
* must be added to the allow list.
*
* <h3>Details</h3>
* Splits the given URL into components and checks for allowed characters according to RFC 3986:
*
* <pre>
* authority = [ userinfo "@" ] host [ ":" port ]
* userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
* host = IP-literal / IPv4address / reg-name
*
* IP-literal = "[" ( IPv6address / IPvFuture ) "]"
* IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
* IPv6address = 6( h16 ":" ) ls32
* / "::" 5( h16 ":" ) ls32
* / [ h16 ] "::" 4( h16 ":" ) ls32
* / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
* / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
* / [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
* / [ *4( h16 ":" ) h16 ] "::" ls32
* / [ *5( h16 ":" ) h16 ] "::" h16
* / [ *6( h16 ":" ) h16 ] "::"
* ls32 = ( h16 ":" h16 ) / IPv4address
* ; least-significant 32 bits of address
* h16 = 1*4HEXDIG
* ; 16 bits of address represented in hexadecimal
*
* IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
* dec-octet = DIGIT ; 0-9
* / %x31-39 DIGIT ; 10-99
* / "1" 2DIGIT ; 100-199
* / "2" %x30-34 DIGIT ; 200-249
* / "25" %x30-35 ; 250-255
*
* reg-name = *( unreserved / pct-encoded / sub-delims )
*
* pct-encoded = "%" HEXDIG HEXDIG
* reserved = gen-delims / sub-delims
* gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
* sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
* / "*" / "+" / "," / ";" / "="
* unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
* pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
*
* path = path-abempty ; begins with "/" or is empty
* / path-absolute ; begins with "/" but not "//"
* / path-noscheme ; begins with a non-colon segment
* / path-rootless ; begins with a segment
* / path-empty ; zero characters
*
* path-abempty = *( "/" segment )
* path-absolute = "/" [ segment-nz *( "/" segment ) ]
* path-noscheme = segment-nz-nc *( "/" segment )
* path-rootless = segment-nz *( "/" segment )
* path-empty = 0<pchar>
* segment = *pchar
* segment-nz = 1*pchar
* segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )
* ; non-zero-length segment without any colon ":"
*
* query = *( pchar / "/" / "?" )
*
* fragment = *( pchar / "/" / "?" )
* </pre>
*
* For the hostname component, we are checking for valid DNS hostnames according to RFC 952 / RFC 1123:
*
* <pre>
* hname = name *("." name)
* name = let-or-digit ( *( let-or-digit-or-hyphen ) let-or-digit )
* </pre>
*
*
* When the URI uses the protocol 'mailto:', the address part is additionally checked
* against the most commonly used parts of RFC 6068:
*
* <pre>
* mailtoURI = "mailto:" [ to ] [ hfields ]
* to = addr-spec *("," addr-spec )
* hfields = "?" hfield *( "&" hfield )
* hfield = hfname "=" hfvalue
* hfname = *qchar
* hfvalue = *qchar
* addr-spec = local-part "@" domain
* local-part = dot-atom-text // not accepted: quoted-string
* domain = dot-atom-text // not accepted: "[" *dtext-no-obs "]"
* dtext-no-obs = %d33-90 / ; Printable US-ASCII
* %d94-126 ; characters not including
* ; "[", "]", or "\"
* qchar = unreserved / pct-encoded / some-delims
* some-delims = "!" / "$" / "'" / "(" / ")" / "*"
* / "+" / "," / ";" / ":" / "@"
*
* Note:
* A number of characters that can appear in &lt;addr-spec> MUST be
* percent-encoded. These are the characters that cannot appear in
* a URI according to [STD66] as well as "%" (because it is used for
* percent-encoding) and all the characters in gen-delims except "@"
* and ":" (i.e., "/", "?", "#", "[", and "]"). Of the characters
* in sub-delims, at least the following also have to be percent-
* encoded: "&", ";", and "=". Care has to be taken both when
* encoding as well as when decoding to make sure these operations
* are applied only once.
*
* </pre>
*
* When a list of allowed entries has been configured using {@link #add},
* any URL that passes the syntactic checks above, additionally will be tested against
* the content of this list.
*
* @param {string} sUrl URL to be validated
* @return {boolean} true if valid, false if not valid
* @public
*/
oURLListValidator.validate = function (sUrl) {
// Test for not allowed whitespaces
if (typeof sUrl === "string") {

@@ -60,4 +270,9 @@ if (rCheckWhitespaces.test(sUrl)) {

}
// for 'special' URLs without a given base URL, the whatwg spec allows any number of slashes.
// As the rBasicUrl regular expression cannot handle 'special' URLs, the URL is modified upfront,
// if it wouldn't be recognized by the regex.
// See https://url.spec.whatwg.org/#scheme-state (case 2.6.)
var result = rSpecialSchemeURLs.exec(sUrl);
if (result && !(/^[\/\\]{2}/).test(result[2])) {
if (result && !/^[\/\\]{2}/.test(result[2])) {
sUrl = result[1] + "//" + result[2];

@@ -69,7 +284,16 @@ }

}
var sProtocol = result[1], sBody = result[2], sHost = result[3], sPort = result[4], sPath = result[5], sQuery = result[6], sHash = result[7];
var sProtocol = result[1],
sBody = result[2],
sHost = result[3],
sPort = result[4],
sPath = result[5],
sQuery = result[6],
sHash = result[7];
// protocol
if (sProtocol) {
sProtocol = sProtocol.toUpperCase();
if (aAllowedEntries.length <= 0) {
if (!(/^(https?|ftp)/i).test(sProtocol)) {
// no allowed entries -> check for default protocols
if (!/^(https?|ftp)/i.test(sProtocol)) {
return false;

@@ -79,5 +303,8 @@ }

}
// Host -> validity check for IP address or hostname
if (sHost) {
if (rCheckIPv4.test(sHost)) {
if (!rCheckValidIPv4.test(sHost)) {
//invalid ipv4 address
return false;

@@ -87,5 +314,7 @@ }

if (!rCheckValidIPv6.test(sHost)) {
//invalid ipv6 address
return false;
}
} else if (!rCheckHostName.test(sHost)) {
// invalid host name
return false;

@@ -95,2 +324,4 @@ }

}
// Path -> split for "/" and check if forbidden characters exist
if (sPath) {

@@ -101,2 +332,3 @@ if (sProtocol === "MAILTO") {

if (!rCheckMail.test(aAddresses[i])) {
// forbidden character found
return false;

@@ -109,2 +341,3 @@ }

if (!rCheckPath.test(aComponents[i])) {
// forbidden character found
return false;

@@ -115,12 +348,20 @@ }

}
// query
if (sQuery) {
if (!rCheckQuery.test(sQuery)) {
// forbidden character found
return false;
}
}
// hash
if (sHash) {
if (!rCheckFragment.test(sHash)) {
// forbidden character found
return false;
}
}
//filter allowed entries
if (aAllowedEntries.length > 0) {

@@ -130,4 +371,6 @@ var bFound = false;

if (!sProtocol || !aAllowedEntries[i].protocol || sProtocol == aAllowedEntries[i].protocol) {
// protocol OK
var bOk = false;
if (sHost && aAllowedEntries[i].host && (/^\*/).test(aAllowedEntries[i].host)) {
if (sHost && aAllowedEntries[i].host && /^\*/.test(aAllowedEntries[i].host)) {
// check for wildcard search at begin
if (!aAllowedEntries[i]._hostRegexp) {

@@ -145,4 +388,7 @@ var sHostEscaped = aAllowedEntries[i].host.slice(1).replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");

if (bOk) {
// host OK
if (!sHost && !sPort || !aAllowedEntries[i].port || sPort == aAllowedEntries[i].port) {
if (aAllowedEntries[i].path && (/\*$/).test(aAllowedEntries[i].path)) {
// port OK
if (aAllowedEntries[i].path && /\*$/.test(aAllowedEntries[i].path)) {
// check for wildcard search at end
if (!aAllowedEntries[i]._pathRegexp) {

@@ -157,2 +403,3 @@ var sPathEscaped = aAllowedEntries[i].path.slice(0, -1).replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");

} else if (!aAllowedEntries[i].path || sPath == aAllowedEntries[i].path) {
// path OK
bFound = true;

@@ -173,2 +420,2 @@ }

};
export default oURLListValidator;
export default oURLListValidator;

@@ -0,8 +1,33 @@

/**
* Create hex string and pad to length with zeros.
* @example
* require(["sap/base/strings/toHex"], function(toHex){
* toHex(10, 2); // "0a"
* toHex(16, 2); // "10"
* });
*
* @function
* @since 1.58
* @private
* @alias module:sap/base/strings/toHex
* @param {int} iChar UTF-16 character code
* @param {int} [iLength=0] number of padded zeros
* @returns {string} padded hex representation of the given character code
*/ /*!
* OpenUI5
* (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
/*
* IMPORTANT: This is a private module, its API must not be used and is subject to change.
* Code other than the OpenUI5 libraries must not introduce dependencies to this module.
*/
var fnToHex = function (iChar, iLength) {
var sHex = iChar.toString(16);
if (iLength) {
sHex = sHex.padStart(iLength, "0");
sHex = sHex.padStart(iLength, '0');
}
return sHex;
};
export default fnToHex;
export default fnToHex;

@@ -1,2 +0,23 @@

var fnNow = !(typeof window != "undefined" && window.performance && performance.now && performance.timing) ? Date.now : (function () {
// @evo-todo window.performance does not exist on node.js, but there is a module performance-now. Maybe use it
/**
* Returns a high resolution timestamp in microseconds if supported by the environment, otherwise in milliseconds.
* The timestamp is based on 01/01/1970 00:00:00 (UNIX epoch) as float with microsecond precision or
* with millisecond precision, if high resolution timestamps are not available.
* The fractional part of the timestamp represents fractions of a millisecond.
* Converting to a <code>Date</code> is possible by using <code>require(["sap/base/util/now"], function(now){new Date(now());}</code>
*
* @function
* @since 1.58
* @public
* @alias module:sap/base/util/now
* @returns {float} timestamp in microseconds if supported by the environment otherwise in milliseconds
*/ /*!
* OpenUI5
* (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
/*global performance */
var fnNow = !(typeof window != "undefined" && window.performance && performance.now && performance.timing) ? Date.now : function () {
var iNavigationStart = performance.timing.navigationStart;

@@ -6,3 +27,3 @@ return function perfnow() {

};
})();
export default fnNow;
}();
export default fnNow;
{
"name": "@ui5/webcomponents-base",
"version": "1.14.6",
"version": "1.14.7",
"description": "UI5 Web Components: webcomponents.base",

@@ -38,5 +38,4 @@ "author": "SAP SE (https://www.sap.com)",

"devDependencies": {
"@buxlabs/amd-to-es6": "0.16.1",
"@openui5/sap.ui.core": "1.112.0",
"@ui5/webcomponents-tools": "1.14.6",
"@openui5/sap.ui.core": "1.120.3",
"@ui5/webcomponents-tools": "1.14.7",
"chromedriver": "113.0.0",

@@ -51,3 +50,3 @@ "clean-css": "^5.2.2",

},
"gitHead": "ee406c5b17d947bd5a10d8548622aabccfd4ea2a"
"gitHead": "8c67ea36fdfa3eb6780b98da607a0136afef67ef"
}
# Needed files from OpenUI5
# ./ui5loader-autoconfig.js
sap/base/util/now.js
sap/base/util/uid.js
sap/base/Log.js
# sap/base/config.js
sap/base/config/MemoryConfigurationProvider.js
sap/base/assert.js

@@ -6,0 +10,0 @@ sap/base/security/URLListValidator.js

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc