@sapui5/sap.ndc 1.141.2 → 1.143.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/README.md CHANGED
@@ -5,8 +5,8 @@ Runtime resources of the [SAPUI5](https://ui5.sap.com) Library **sap.ndc**.
5
5
 
6
6
  ## Usage
7
7
  Refrain from installing this package using npm, Yarn or similar package managers.
8
- It is meant to be consumed using the [UI5 Tooling](https://sap.github.io/ui5-tooling/).
9
- For details please refer to our documentation on [Consuming SAPUI5 Libraries](https://sap.github.io/ui5-tooling/pages/SAPUI5/).
8
+ It is meant to be consumed using the [UI5 CLI](https://ui5.github.io/cli/).
9
+ For details please refer to our documentation on [Consuming SAPUI5 Libraries](https://ui5.github.io/cli/pages/SAPUI5/).
10
10
 
11
11
  ## License
12
12
  This package is provided under the terms of the [SAP Developer License Agreement](https://tools.hana.ondemand.com/developer-license-3_2.txt).
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@sapui5/sap.ndc",
3
- "version": "1.141.2",
3
+ "version": "1.143.0",
4
4
  "description": "SAPUI5 Library sap.ndc",
5
- "homepage": "https://sap.github.io/ui5-tooling/pages/SAPUI5/",
5
+ "homepage": "https://ui5.github.io/cli/pages/SAPUI5/",
6
6
  "author": "SAP SE (https://www.sap.com)",
7
7
  "license": "SEE LICENSE IN LICENSE.txt",
8
8
  "keywords": [
@@ -5,7 +5,7 @@
5
5
  <vendor>SAP SE</vendor>
6
6
  <copyright>SAPUI5
7
7
  * (c) Copyright 2025 SAP SE. All rights reserved.</copyright>
8
- <version>1.141.2</version>
8
+ <version>1.143.0</version>
9
9
 
10
10
  <documentation>SAPUI5 library with controls with native device capabilities.</documentation>
11
11
 
@@ -133,7 +133,8 @@ sap.ui.define([
133
133
  onFnFail: null,
134
134
  onFnSuccess: null,
135
135
  callBackFromSetPhysicalScan: false,
136
- fnBluetoothScan: null
136
+ fnBluetoothScan: null,
137
+ customInput: null
137
138
  },
138
139
  devices: {
139
140
  mainCamera: undefined,
@@ -1219,8 +1220,13 @@ sap.ui.define([
1219
1220
  }
1220
1221
 
1221
1222
  var disableBarcodeInputDialog = oModel.getProperty("/scanDialog/disableBarcodeInputDialog");
1223
+ var oCustomInput = oModel.getProperty("/callBackHandler/customInput");
1224
+
1222
1225
  if (disableBarcodeInputDialog) {
1223
1226
  BarcodeScanner.closeScanDialog();
1227
+ } else if (oCustomInput) {
1228
+ BarcodeScanner.closeScanDialog();
1229
+ oCustomInput();
1224
1230
  } else {
1225
1231
  oScanDialog.setShowHeader(true);
1226
1232
  oScanDialog.destroyContent();
@@ -2664,11 +2670,12 @@ sap.ui.define([
2664
2670
  * @param {float} [zoom] Defines the zoom of the camera. This parameter is not supported on iOS.
2665
2671
  * @param {boolean} [keepCameraScan] Flag, which defines whether the camera should be used for scanning in Zebra Enterprise Browser.
2666
2672
  * @param {boolean} [disableBarcodeInputDialog] Flag, which defines whether the Barcode input dialog should be shown.
2673
+ * @param {function} [customInput] Function to be called when either the cancel button in the scan dialog is pressed, or no scanning library is available. If unset, the default input dialog will be used.
2667
2674
  *
2668
2675
  * @public
2669
2676
  * @static
2670
2677
  */
2671
- BarcodeScanner.scan = function (fnSuccess, fnFail, fnLiveUpdate, dialogTitle, preferFrontCamera, frameRate, zoom, keepCameraScan, disableBarcodeInputDialog) {
2678
+ BarcodeScanner.scan = function (fnSuccess, fnFail, fnLiveUpdate, dialogTitle, preferFrontCamera, frameRate, zoom, keepCameraScan, disableBarcodeInputDialog, customInput) {
2672
2679
  if (!oModel.getProperty("/bReady")) {
2673
2680
  Log.error("BarcodeScanner.scan: Barcode scanning is already in progress.");
2674
2681
  return;
@@ -2730,6 +2737,13 @@ sap.ui.define([
2730
2737
  }
2731
2738
  oModel.setProperty("/scanDialog/keepCameraScan", keepCameraScan);
2732
2739
  oModel.setProperty("/scanDialog/disableBarcodeInputDialog", disableBarcodeInputDialog);
2740
+
2741
+ if (typeof customInput === 'function') {
2742
+ oModel.setProperty("/callBackHandler/customInput", customInput);
2743
+ } else {
2744
+ oModel.setProperty("/callBackHandler/customInput", null);
2745
+ }
2746
+
2733
2747
  oModel.checkUpdate(true);
2734
2748
 
2735
2749
  if (checkZebraEBScanAvailable()) {
@@ -128,13 +128,19 @@ sap.ui.define([
128
128
  */
129
129
  newValue : {type : "string"}
130
130
  }
131
- }
131
+ },
132
+
133
+ /**
134
+ * Event is fired when either the cancel button in the scan dialog is pressed, or no scanning library is available. If unset, the default input dialog will be used.
135
+ */
136
+ customInput : {}
132
137
  }
133
138
  },
134
139
  renderer: BarcodeScannerButtonRenderer
135
140
  });
136
141
 
137
142
  var oResourceModel;
143
+ var fnCustomInput = null;
138
144
 
139
145
  BarcodeScannerButton.prototype.init = function () {
140
146
  oResourceModel = new ResourceModel({
@@ -155,6 +161,13 @@ sap.ui.define([
155
161
  BarcodeScannerButton.prototype._onBtnPressed = function (oEvent) {
156
162
  var focusedElement = this.getAggregation("_btn");
157
163
  BarcodeScanner.setFocusedInstanceId(focusedElement.sId);
164
+ Control.prototype.init.apply(this, arguments);
165
+ if (this.mEventRegistry.customInput) {
166
+ fnCustomInput = this._onCustomInput.bind(this);
167
+ } else {
168
+ fnCustomInput = null;
169
+ }
170
+
158
171
  BarcodeScanner.scan(
159
172
  this._onScanSuccess.bind(this),
160
173
  this._onScanFail.bind(this),
@@ -164,7 +177,8 @@ sap.ui.define([
164
177
  this.getProperty("frameRate"),
165
178
  this.getProperty("zoom"),
166
179
  this.getProperty("keepCameraScan"),
167
- this.getProperty("disableBarcodeInputDialog")
180
+ this.getProperty("disableBarcodeInputDialog"),
181
+ fnCustomInput
168
182
  );
169
183
  };
170
184
 
@@ -180,6 +194,10 @@ sap.ui.define([
180
194
  this.fireInputLiveUpdate(mArguments);
181
195
  };
182
196
 
197
+ BarcodeScannerButton.prototype._onCustomInput = function (mArguments) {
198
+ this.fireCustomInput(mArguments);
199
+ };
200
+
183
201
  BarcodeScannerButton.prototype.setProvideFallback = function (bFallback) {
184
202
  var bValue = this.getProvideFallback();
185
203
  var oBtn;
@@ -202,6 +220,9 @@ sap.ui.define([
202
220
 
203
221
  BarcodeScannerButton.prototype._setTooltip = function () {
204
222
  var sTooltip = this.getTooltip_AsString();
223
+ if (!sTooltip) {
224
+ sTooltip = oResourceModel.getProperty("BARCODE_SCANNER_BUTTON_TOOLTIP");
225
+ }
205
226
  this.getAggregation("_btn").setTooltip(sTooltip);
206
227
  };
207
228
 
@@ -33,7 +33,7 @@ sap.ui.define([
33
33
  ],
34
34
  elements: [],
35
35
  noLibraryCSS: true,
36
- version: "1.141.2"
36
+ version: "1.143.0"
37
37
  });
38
38
 
39
39
  return thisLib;