@sapui5/sap.ndc 1.126.1 → 1.127.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.ndc",
3
- "version": "1.126.1",
3
+ "version": "1.127.0",
4
4
  "description": "SAPUI5 Library sap.ndc",
5
5
  "homepage": "https://sap.github.io/ui5-tooling/pages/SAPUI5/",
6
6
  "author": "SAP SE (https://www.sap.com)",
@@ -5,7 +5,7 @@
5
5
  <vendor>SAP SE</vendor>
6
6
  <copyright>SAPUI5
7
7
  * (c) Copyright 2009-2024 SAP SE. All rights reserved.</copyright>
8
- <version>1.126.1</version>
8
+ <version>1.127.0</version>
9
9
 
10
10
  <documentation>SAPUI5 library with controls with native device capabilities.</documentation>
11
11
 
@@ -97,6 +97,7 @@ sap.ui.define([
97
97
  oBarcodeImageDOM,
98
98
  oBarcodeImageCanvasDOM,
99
99
  oBarcodeOverlayDOM,
100
+ oFocusedInstance,
100
101
  oScannerAPIStatus = {
101
102
  Initial: "Initial",
102
103
  Loading: "Loading",
@@ -1436,6 +1437,12 @@ sap.ui.define([
1436
1437
  oScanDialog.destroy();
1437
1438
  }
1438
1439
  oScanDialog = null;
1440
+
1441
+ //refocused related element
1442
+ if (typeof oFocusedInstance === 'object') {
1443
+ jQuery(oFocusedInstance).focus();
1444
+ jQuery(oFocusedInstance).on("blur", customBlurHandler);
1445
+ }
1439
1446
  }
1440
1447
  });
1441
1448
  oScanDialog.setEscapeHandler(function(promise) {
@@ -2598,6 +2605,14 @@ sap.ui.define([
2598
2605
  oModel.setProperty("/apis/BluetoothScanner/", oBluetoothScanner);
2599
2606
  }
2600
2607
 
2608
+ function customBlurHandler() {
2609
+ Log.debug("The custom Blur handler is called");
2610
+ if (typeof oFocusedInstance === "object") {
2611
+ oFocusedInstance.focus();
2612
+ jQuery(oFocusedInstance).off("blur", customBlurHandler);
2613
+ }
2614
+ }
2615
+
2601
2616
  /* =========================================================== */
2602
2617
  /* API methods */
2603
2618
  /* =========================================================== */
@@ -3039,6 +3054,28 @@ sap.ui.define([
3039
3054
  setScannerAPIUnAvailable("BluetoothScanner", true);
3040
3055
  };
3041
3056
 
3057
+ /**
3058
+ * Set the sId of the element to be focused, which will then be used to retrieve the instance of the focused SAP UI5 element.
3059
+ *
3060
+ * @param {string} [sId] Defines the sId for the focused element.
3061
+ * @returns {boolean} Return True if set success.
3062
+ *
3063
+ * @public
3064
+ * @static
3065
+ */
3066
+ BarcodeScanner.setFocusedInstanceId = function (sId) {
3067
+ var oState = false;
3068
+ oFocusedInstance = jQuery.sap.byId(sId);
3069
+ if (oFocusedInstance[0]) {
3070
+ oState = true;
3071
+ Log.debug("The sId has been successful set, and the instance of the focused SAP UI5 element is now available.");
3072
+ } else {
3073
+ oFocusedInstance = undefined;
3074
+ Log.warning("The sId is not available.");
3075
+ }
3076
+ return oState;
3077
+ };
3078
+
3042
3079
  init(); //must be called to enable control if no feature vector is available.
3043
3080
  return BarcodeScanner;
3044
3081
 
@@ -153,6 +153,8 @@ sap.ui.define([
153
153
  };
154
154
 
155
155
  BarcodeScannerButton.prototype._onBtnPressed = function (oEvent) {
156
+ var focusedElement = this.getAggregation("_btn");
157
+ BarcodeScanner.setFocusedInstanceId(focusedElement.sId);
156
158
  BarcodeScanner.scan(
157
159
  this._onScanSuccess.bind(this),
158
160
  this._onScanFail.bind(this),
@@ -32,7 +32,7 @@ sap.ui.define([
32
32
  ],
33
33
  elements: [],
34
34
  noLibraryCSS: true,
35
- version: "1.126.1"
35
+ version: "1.127.0"
36
36
  });
37
37
 
38
38
  return thisLib;