@sapui5/sap.ndc 1.100.0 → 1.102.1
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
package/src/sap/ndc/.library
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<vendor>SAP SE</vendor>
|
|
6
6
|
<copyright>SAPUI5
|
|
7
7
|
* (c) Copyright 2009-2022 SAP SE. All rights reserved.</copyright>
|
|
8
|
-
<version>1.
|
|
8
|
+
<version>1.102.1</version>
|
|
9
9
|
|
|
10
10
|
<documentation>SAPUI5 library with controls with native device capabilities.</documentation>
|
|
11
11
|
|
|
@@ -30,9 +30,21 @@
|
|
|
30
30
|
<exclude name="sap.ndc.thirdparty."/>
|
|
31
31
|
</jscoverage>
|
|
32
32
|
|
|
33
|
+
<!-- excludes for the default preload files -->
|
|
34
|
+
<packaging xmlns="http://www.sap.com/ui5/buildext/packaging" version="2.0" >
|
|
35
|
+
<all-in-one>
|
|
36
|
+
<!-- ===========================================================================
|
|
37
|
+
!! ATTENTION !!
|
|
38
|
+
The following excludes must be kept in sync with those configured for the
|
|
39
|
+
'preload-and-merge' plugin execution in the pom.xml.
|
|
40
|
+
=========================================================================== -->
|
|
41
|
+
<exclude name="sap/ndc/thirdparty/" />
|
|
42
|
+
</all-in-one>
|
|
43
|
+
</packaging>
|
|
44
|
+
|
|
33
45
|
<!-- Thirdparty references -->
|
|
34
46
|
<thirdparty xmlns="http://www.sap.com/ui5/buildext/thirdparty" >
|
|
35
|
-
<lib name="@zxing/library" displayName="ZXing" version="0.
|
|
47
|
+
<lib name="@zxing/library" displayName="ZXing" version="0.19.1" homepage="https://zxing-js.github.io/library/">
|
|
36
48
|
<license url="https://github.com/zxing-js/library/blob/master/LICENSE" type="MIT" />
|
|
37
49
|
<copyright>2018 ZXing for JS</copyright>
|
|
38
50
|
<pattern>sap/ndc/thirdparty/ZXing.js</pattern>
|
package/src/sap/ndc/library.js
CHANGED
|
@@ -15,14 +15,10 @@ sap.ui.define(['sap/m/library', 'sap/ui/core/library'],
|
|
|
15
15
|
* SAPUI5 library with controls with native device capabilities.
|
|
16
16
|
*
|
|
17
17
|
* @namespace
|
|
18
|
-
* @
|
|
18
|
+
* @alias sap.ndc
|
|
19
19
|
* @public
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
|
-
// library dependencies
|
|
23
|
-
|
|
24
|
-
// delegate further initialization of this library to the Core
|
|
25
|
-
sap.ui.getCore().initLibrary({
|
|
21
|
+
var thisLib = sap.ui.getCore().initLibrary({
|
|
26
22
|
name : "sap.ndc",
|
|
27
23
|
dependencies : ["sap.ui.core","sap.m"],
|
|
28
24
|
types: [],
|
|
@@ -32,9 +28,9 @@ sap.ui.define(['sap/m/library', 'sap/ui/core/library'],
|
|
|
32
28
|
],
|
|
33
29
|
elements: [],
|
|
34
30
|
noLibraryCSS: true,
|
|
35
|
-
version: "1.
|
|
31
|
+
version: "1.102.1"
|
|
36
32
|
});
|
|
37
33
|
|
|
38
|
-
return
|
|
34
|
+
return thisLib;
|
|
39
35
|
|
|
40
36
|
});
|
|
@@ -3484,6 +3484,10 @@
|
|
|
3484
3484
|
const binaryBitmap = this.createBinaryBitmap(element);
|
|
3485
3485
|
return this.decodeBitmap(binaryBitmap);
|
|
3486
3486
|
}
|
|
3487
|
+
_isHTMLVideoElement(mediaElement) {
|
|
3488
|
+
const potentialVideo = mediaElement;
|
|
3489
|
+
return potentialVideo.videoWidth !== 0;
|
|
3490
|
+
}
|
|
3487
3491
|
/**
|
|
3488
3492
|
* Creates a binaryBitmap based in some image source.
|
|
3489
3493
|
*
|
|
@@ -3491,7 +3495,12 @@
|
|
|
3491
3495
|
*/
|
|
3492
3496
|
createBinaryBitmap(mediaElement) {
|
|
3493
3497
|
const ctx = this.getCaptureCanvasContext(mediaElement);
|
|
3494
|
-
this.
|
|
3498
|
+
if (this._isHTMLVideoElement(mediaElement)) {
|
|
3499
|
+
this.drawFrameOnCanvas(mediaElement);
|
|
3500
|
+
}
|
|
3501
|
+
else {
|
|
3502
|
+
this.drawImageOnCanvas(mediaElement);
|
|
3503
|
+
}
|
|
3495
3504
|
const canvas = this.getCaptureCanvas(mediaElement);
|
|
3496
3505
|
const luminanceSource = new HTMLCanvasElementLuminanceSource(canvas);
|
|
3497
3506
|
const hybridBinarizer = new HybridBinarizer(luminanceSource);
|
|
@@ -3518,11 +3527,17 @@
|
|
|
3518
3527
|
}
|
|
3519
3528
|
return this.captureCanvas;
|
|
3520
3529
|
}
|
|
3530
|
+
/**
|
|
3531
|
+
* Overwriting this allows you to manipulate the next frame in anyway you want before decode.
|
|
3532
|
+
*/
|
|
3533
|
+
drawFrameOnCanvas(srcElement, dimensions = { sx: 0, sy: 0, sWidth: srcElement.videoWidth, sHeight: srcElement.videoHeight, dx: 0, dy: 0, dWidth: srcElement.videoWidth, dHeight: srcElement.videoHeight }, canvasElementContext = this.captureCanvasContext) {
|
|
3534
|
+
canvasElementContext.drawImage(srcElement, dimensions.sx, dimensions.sy, dimensions.sWidth, dimensions.sHeight, dimensions.dx, dimensions.dy, dimensions.dWidth, dimensions.dHeight);
|
|
3535
|
+
}
|
|
3521
3536
|
/**
|
|
3522
3537
|
* Ovewriting this allows you to manipulate the snapshot image in anyway you want before decode.
|
|
3523
3538
|
*/
|
|
3524
|
-
drawImageOnCanvas(
|
|
3525
|
-
canvasElementContext.drawImage(srcElement,
|
|
3539
|
+
drawImageOnCanvas(srcElement, dimensions = { sx: 0, sy: 0, sWidth: srcElement.naturalWidth, sHeight: srcElement.naturalHeight, dx: 0, dy: 0, dWidth: srcElement.naturalWidth, dHeight: srcElement.naturalHeight }, canvasElementContext = this.captureCanvasContext) {
|
|
3540
|
+
canvasElementContext.drawImage(srcElement, dimensions.sx, dimensions.sy, dimensions.sWidth, dimensions.sHeight, dimensions.dx, dimensions.dy, dimensions.dWidth, dimensions.dHeight);
|
|
3526
3541
|
}
|
|
3527
3542
|
/**
|
|
3528
3543
|
* Call the encapsulated readers decode
|
|
@@ -8826,7 +8841,7 @@
|
|
|
8826
8841
|
if (possibleFormats.indexOf(BarcodeFormat$1.EAN_13) > -1) {
|
|
8827
8842
|
readers.push(new EAN13Reader());
|
|
8828
8843
|
}
|
|
8829
|
-
|
|
8844
|
+
if (possibleFormats.indexOf(BarcodeFormat$1.UPC_A) > -1) {
|
|
8830
8845
|
readers.push(new UPCAReader());
|
|
8831
8846
|
}
|
|
8832
8847
|
if (possibleFormats.indexOf(BarcodeFormat$1.EAN_8) > -1) {
|
|
@@ -8838,12 +8853,7 @@
|
|
|
8838
8853
|
}
|
|
8839
8854
|
if (readers.length === 0) {
|
|
8840
8855
|
readers.push(new EAN13Reader());
|
|
8841
|
-
// UPC-A is covered by EAN-13
|
|
8842
|
-
// ##### BEGIN: MODIFIED BY SAP
|
|
8843
|
-
// Add UPCAReader() into readers array
|
|
8844
|
-
// see https://github.com/zxing-js/library/pull/304
|
|
8845
8856
|
readers.push(new UPCAReader());
|
|
8846
|
-
// ##### END: MODIFIED BY SAP
|
|
8847
8857
|
readers.push(new EAN8Reader());
|
|
8848
8858
|
readers.push(new UPCEReader());
|
|
8849
8859
|
}
|
|
@@ -8874,7 +8884,7 @@
|
|
|
8874
8884
|
if (ean13MayBeUPCA && canReturnUPCA) {
|
|
8875
8885
|
const rawBytes = result.getRawBytes();
|
|
8876
8886
|
// Transfer the metadata across
|
|
8877
|
-
const resultUPCA = new Result(result.getText().substring(1), rawBytes, rawBytes.length, result.getResultPoints(), BarcodeFormat$1.UPC_A);
|
|
8887
|
+
const resultUPCA = new Result(result.getText().substring(1), rawBytes, (rawBytes ? rawBytes.length : null), result.getResultPoints(), BarcodeFormat$1.UPC_A);
|
|
8878
8888
|
resultUPCA.putAllMetadata(result.getResultMetadata());
|
|
8879
8889
|
return resultUPCA;
|
|
8880
8890
|
}
|
|
@@ -10232,6 +10242,7 @@
|
|
|
10232
10242
|
// import java.util.List;
|
|
10233
10243
|
// import java.util.Map;
|
|
10234
10244
|
// import java.util.Collections;
|
|
10245
|
+
/** @experimental */
|
|
10235
10246
|
class RSSExpandedReader extends AbstractRSSReader {
|
|
10236
10247
|
constructor() {
|
|
10237
10248
|
super(...arguments);
|
|
@@ -10250,7 +10261,7 @@
|
|
|
10250
10261
|
}
|
|
10251
10262
|
catch (e) {
|
|
10252
10263
|
// OK
|
|
10253
|
-
console.log(e);
|
|
10264
|
+
// console.log(e);
|
|
10254
10265
|
}
|
|
10255
10266
|
this.pairs.length = 0;
|
|
10256
10267
|
this.startFromEven = true;
|
|
@@ -11362,6 +11373,7 @@
|
|
|
11362
11373
|
this.readers.push(new RSS14Reader());
|
|
11363
11374
|
}
|
|
11364
11375
|
if (possibleFormats.includes(BarcodeFormat$1.RSS_EXPANDED)) {
|
|
11376
|
+
console.warn('RSS Expanded reader IS NOT ready for production yet! use at your own risk.');
|
|
11365
11377
|
this.readers.push(new RSSExpandedReader());
|
|
11366
11378
|
}
|
|
11367
11379
|
}
|
|
@@ -11374,7 +11386,7 @@
|
|
|
11374
11386
|
this.readers.push(new Code128Reader());
|
|
11375
11387
|
this.readers.push(new ITFReader());
|
|
11376
11388
|
this.readers.push(new RSS14Reader());
|
|
11377
|
-
this.readers.push(new RSSExpandedReader());
|
|
11389
|
+
// this.readers.push(new RSSExpandedReader());
|
|
11378
11390
|
}
|
|
11379
11391
|
}
|
|
11380
11392
|
// @Override
|
|
@@ -18346,6 +18358,9 @@
|
|
|
18346
18358
|
return invalidRowCounts;
|
|
18347
18359
|
}
|
|
18348
18360
|
adjustRowNumbers(barcodeColumn, codewordsRow, codewords) {
|
|
18361
|
+
if (this.detectionResultColumns[barcodeColumn - 1] == null) {
|
|
18362
|
+
return;
|
|
18363
|
+
}
|
|
18349
18364
|
let codeword = codewords[codewordsRow];
|
|
18350
18365
|
let previousColumnCodewords = this.detectionResultColumns[barcodeColumn - 1].getCodewords();
|
|
18351
18366
|
let nextColumnCodewords = previousColumnCodewords;
|
|
@@ -24125,6 +24140,7 @@
|
|
|
24125
24140
|
}
|
|
24126
24141
|
}
|
|
24127
24142
|
|
|
24143
|
+
exports.AbstractExpandedDecoder = AbstractExpandedDecoder;
|
|
24128
24144
|
exports.ArgumentException = ArgumentException;
|
|
24129
24145
|
exports.ArithmeticException = ArithmeticException;
|
|
24130
24146
|
exports.AztecCode = AztecCode;
|
|
@@ -24223,6 +24239,7 @@
|
|
|
24223
24239
|
exports.ZXingStringBuilder = StringBuilder;
|
|
24224
24240
|
exports.ZXingStringEncoding = StringEncoding;
|
|
24225
24241
|
exports.ZXingSystem = System;
|
|
24242
|
+
exports.createAbstractExpandedDecoder = createDecoder;
|
|
24226
24243
|
|
|
24227
24244
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
24228
24245
|
|