@sapui5/sap.ndc 1.96.13 → 1.96.16
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 +1 -1
- package/src/sap/ndc/.library +26 -2
- package/src/sap/ndc/BarcodeScanner.js +1507 -313
- package/src/sap/ndc/BarcodeScannerButton.js +119 -100
- package/src/sap/ndc/BarcodeScannerButtonRenderer.js +1 -1
- package/src/sap/ndc/BarcodeScannerUIContainer.js +1 -1
- package/src/sap/ndc/library.js +2 -2
- package/src/sap/ndc/messagebundle.properties +19 -7
- package/src/sap/ndc/thirdparty/opencv/opencv_js.js +21 -0
- package/src/sap/ndc/thirdparty/opencv/opencv_js.wasm +0 -0
- package/src/sap/ndc/thirdparty/zxingcpp/zxing_reader.js +21 -0
- package/src/sap/ndc/thirdparty/zxingcpp/zxing_reader.wasm +0 -0
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Provides control sap.ndc.BarcodeScannerButton.
|
|
7
|
-
sap.ui.define([
|
|
8
|
-
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
'./BarcodeScanner',
|
|
9
|
+
'./BarcodeScannerButtonRenderer',
|
|
10
|
+
'./library',
|
|
11
|
+
'sap/m/Button',
|
|
12
|
+
'sap/ui/core/Control',
|
|
13
|
+
'sap/ui/model/resource/ResourceModel'
|
|
14
|
+
], function(BarcodeScanner, BarcodeScannerButtonRenderer, library, Button, Control, ResourceModel) {
|
|
9
15
|
"use strict";
|
|
10
16
|
|
|
11
17
|
|
|
@@ -17,8 +23,8 @@ sap.ui.define(["sap/ui/thirdparty/jquery", './BarcodeScanner', './library', 'sap
|
|
|
17
23
|
* @param {object} [mSettings] initial settings for the new control
|
|
18
24
|
*
|
|
19
25
|
* @class
|
|
20
|
-
* A button control (displaying a
|
|
21
|
-
* not available or camera capability is not granted, the button is either hidden or it provides a fallback by opening a dialog with an input field where the
|
|
26
|
+
* A button control (displaying a barcode icon) to start the barcode scanning process. If the native scanning feature is
|
|
27
|
+
* not available or camera capability is not granted, the button is either hidden or it provides a fallback by opening a dialog with an input field where the barcode can
|
|
22
28
|
* be entered manually.
|
|
23
29
|
* @extends sap.ui.core.Control
|
|
24
30
|
*
|
|
@@ -27,122 +33,135 @@ sap.ui.define(["sap/ui/thirdparty/jquery", './BarcodeScanner', './library', 'sap
|
|
|
27
33
|
* @constructor
|
|
28
34
|
* @public
|
|
29
35
|
* @alias sap.ndc.BarcodeScannerButton
|
|
30
|
-
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
|
|
31
36
|
*/
|
|
32
|
-
var BarcodeScannerButton = Control.extend("sap.ndc.BarcodeScannerButton", /** @lends sap.ndc.BarcodeScannerButton.prototype */ {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
events : {
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Event is fired when the scanning is finished or cancelled
|
|
82
|
-
*/
|
|
83
|
-
scanSuccess : {
|
|
84
|
-
parameters : {
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* The the text representation of the bar code data.
|
|
88
|
-
*/
|
|
89
|
-
text : {type : "string"},
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* The type of the bar code detected.
|
|
93
|
-
*/
|
|
94
|
-
format : {type : "string"},
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Indicates whether or not the user cancelled the scan.
|
|
98
|
-
*/
|
|
99
|
-
cancelled : {type : "boolean"}
|
|
100
|
-
}
|
|
37
|
+
var BarcodeScannerButton = Control.extend("sap.ndc.BarcodeScannerButton", /** @lends sap.ndc.BarcodeScannerButton.prototype */ {
|
|
38
|
+
metadata : {
|
|
39
|
+
|
|
40
|
+
library : "sap.ndc",
|
|
41
|
+
properties : {
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* If set to true, the button remains visible if the scanner is not available and triggers a dialog to enter barcode.
|
|
45
|
+
*/
|
|
46
|
+
provideFallback : {type : "boolean", defaultValue : true},
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The invisible barcode scanner button is not rendered regardless of the availability of the native scan feature.
|
|
50
|
+
*/
|
|
51
|
+
visible : {type : "boolean", defaultValue : true},
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Defines the width of the scanner button.
|
|
55
|
+
*/
|
|
56
|
+
width : {type: "sap.ui.core.CSSSize", defaultValue : null},
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Defines the barcode input dialog title. If unset, a predefined title will be used.
|
|
60
|
+
*/
|
|
61
|
+
dialogTitle : {type: "string", defaultValue: null},
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* If set to true, the front camera will be used to decode.
|
|
65
|
+
*/
|
|
66
|
+
preferFrontCamera : {type : "boolean", defaultValue : false},
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Defines the frame rate of the camera.
|
|
70
|
+
*/
|
|
71
|
+
frameRate : {type : "float"},
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Defines the zoom of the camera. This parameter is not supported on iOS.
|
|
75
|
+
*/
|
|
76
|
+
zoom : {type : "float"},
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* If set to true, the camera should be used for scanning in Zebra Enterprise Browser.
|
|
80
|
+
*/
|
|
81
|
+
keepCameraScan : {type : "boolean", defaultValue : false}
|
|
101
82
|
},
|
|
83
|
+
aggregations : {
|
|
102
84
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Internal aggregation to hold the inner Button.
|
|
87
|
+
*/
|
|
88
|
+
_btn : {type : "sap.m.Button", multiple : false, visibility : "hidden"}
|
|
89
|
+
},
|
|
90
|
+
events : {
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Event is fired when the scanning is finished or cancelled
|
|
94
|
+
*/
|
|
95
|
+
scanSuccess : {
|
|
96
|
+
parameters : {
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The the text representation of the barcode data.
|
|
100
|
+
*/
|
|
101
|
+
text : {type : "string"},
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The type of the barcode detected.
|
|
105
|
+
*/
|
|
106
|
+
format : {type : "string"},
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Indicates whether or not the user cancelled the scan.
|
|
110
|
+
*/
|
|
111
|
+
cancelled : {type : "boolean"}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Event is fired when the native scanning process is failed.
|
|
117
|
+
*/
|
|
118
|
+
scanFail : {},
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Event is fired when the text in the dialog's input field is changed.
|
|
122
|
+
*/
|
|
123
|
+
inputLiveUpdate : {
|
|
124
|
+
parameters : {
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The new value of the input field.
|
|
128
|
+
*/
|
|
129
|
+
newValue : {type : "string"}
|
|
130
|
+
}
|
|
118
131
|
}
|
|
119
132
|
}
|
|
120
|
-
}
|
|
121
|
-
|
|
133
|
+
},
|
|
134
|
+
renderer: BarcodeScannerButtonRenderer
|
|
135
|
+
});
|
|
122
136
|
|
|
137
|
+
var oResourceModel;
|
|
123
138
|
|
|
124
139
|
BarcodeScannerButton.prototype.init = function () {
|
|
125
|
-
|
|
140
|
+
oResourceModel = new ResourceModel({
|
|
141
|
+
bundleName: "sap.ndc.messagebundle"
|
|
142
|
+
});
|
|
126
143
|
|
|
127
|
-
this.setAggregation("_btn", new
|
|
144
|
+
this.setAggregation("_btn", new Button({
|
|
128
145
|
icon: "sap-icon://bar-code",
|
|
129
|
-
|
|
146
|
+
tooltip: oResourceModel.getProperty("BARCODE_SCANNER_BUTTON_TOOLTIP"),
|
|
147
|
+
press: this._onBtnPressed.bind(this),
|
|
130
148
|
width: "100%"
|
|
131
149
|
}));
|
|
132
150
|
|
|
133
|
-
oBarcodeStatus = BarcodeScanner.getStatusModel();
|
|
151
|
+
var oBarcodeStatus = BarcodeScanner.getStatusModel();
|
|
134
152
|
this.setModel(oBarcodeStatus, "status");
|
|
135
153
|
};
|
|
136
154
|
|
|
137
155
|
BarcodeScannerButton.prototype._onBtnPressed = function (oEvent) {
|
|
138
156
|
BarcodeScanner.scan(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
157
|
+
this._onScanSuccess.bind(this),
|
|
158
|
+
this._onScanFail.bind(this),
|
|
159
|
+
this._onInputLiveUpdate.bind(this),
|
|
142
160
|
this.getProperty("dialogTitle"),
|
|
143
161
|
this.getProperty("preferFrontCamera"),
|
|
144
162
|
this.getProperty("frameRate"),
|
|
145
|
-
this.getProperty("zoom")
|
|
163
|
+
this.getProperty("zoom"),
|
|
164
|
+
this.getProperty("keepCameraScan")
|
|
146
165
|
);
|
|
147
166
|
};
|
|
148
167
|
|
package/src/sap/ndc/library.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -32,7 +32,7 @@ sap.ui.define(['sap/m/library', 'sap/ui/core/library'],
|
|
|
32
32
|
],
|
|
33
33
|
elements: [],
|
|
34
34
|
noLibraryCSS: true,
|
|
35
|
-
version: "1.96.
|
|
35
|
+
version: "1.96.16"
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
return sap.ndc;
|
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
#This is the resource bundle for the sap.ndc library
|
|
2
2
|
#__ldi.translation.uuid=242cacb8-b0ca-42c0-980c-c7eeb3ce9a2b
|
|
3
3
|
|
|
4
|
-
#XTIT: title of the manual
|
|
5
|
-
BARCODE_DIALOG_TITLE=Enter
|
|
4
|
+
#XTIT: title of the manual barcode input
|
|
5
|
+
BARCODE_DIALOG_TITLE=Enter Barcode
|
|
6
6
|
|
|
7
|
-
#XBUT: OK button in the manual
|
|
7
|
+
#XBUT: OK button in the manual barcode input dialog
|
|
8
8
|
BARCODE_DIALOG_OK=OK
|
|
9
9
|
|
|
10
|
-
#XBUT: Cancel button in the manual
|
|
10
|
+
#XBUT: Cancel button in the manual barcode input dialog
|
|
11
11
|
BARCODE_DIALOG_CANCEL=Cancel
|
|
12
12
|
|
|
13
|
-
#XFLD: Placeholder of the
|
|
14
|
-
BARCODE_DIALOG_PLACEHOLDER=Enter
|
|
13
|
+
#XFLD: Placeholder of the barcode input field
|
|
14
|
+
BARCODE_DIALOG_PLACEHOLDER=Enter barcode
|
|
15
15
|
|
|
16
|
-
#YMSG: Message in the manual
|
|
16
|
+
#YMSG: Message in the manual barcode input dialog
|
|
17
17
|
BARCODE_DIALOG_MSG=Scanner is not available
|
|
18
18
|
|
|
19
19
|
#XMSG: error message for updating parameter of Camera
|
|
20
20
|
BARCODE_DIALOG_CAMERA_UPDATE_PARAMETER_ERROR_MSG=The {0} parameter is out of range.
|
|
21
|
+
|
|
22
|
+
#XTIT: title of the scan barcode dialog
|
|
23
|
+
BARCODE_DIALOG_SCANNING_TITLE=Scan Barcode
|
|
24
|
+
|
|
25
|
+
#XTOL: Barcode Scanner Button tooltip
|
|
26
|
+
BARCODE_SCANNER_BUTTON_TOOLTIP=Barcode Scanner Button
|
|
27
|
+
|
|
28
|
+
#XTIT: title of the scan bar busy dialog
|
|
29
|
+
BARCODE_DIALOG_BUSY_TITLE=Loading Libraries
|
|
30
|
+
|
|
31
|
+
#XTXT: text of loading zxing-cpp in the scan bar busy dialog
|
|
32
|
+
BARCODE_DIALOG_BUSY_TEXT_ZXINGCPP=Loading ZXing-cpp library and OpenCV library...
|