scandit-datacapture-frameworks-label 8.0.0 → 8.1.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/dist/dts/index.d.ts +2 -0
- package/dist/dts/labelcapture/LabelCapture.d.ts +6 -6
- package/dist/dts/labelcapture/LabelCaptureFeedback.d.ts +1 -1
- package/dist/dts/labelcapture/LabelDateResult.d.ts +1 -1
- package/dist/dts/labelcapture/LabelDefinition.d.ts +1 -1
- package/dist/dts/labelcapture/LabelField.d.ts +1 -1
- package/dist/dts/labelcapture/controller/LabelCaptureAdvancedOverlayController.d.ts +10 -14
- package/dist/dts/labelcapture/controller/LabelCaptureBasicOverlayController.d.ts +6 -10
- package/dist/dts/labelcapture/controller/LabelCaptureController.d.ts +6 -10
- package/dist/dts/labelcapture/controller/LabelCaptureValidationFlowOverlayController.d.ts +6 -10
- package/dist/dts/labelcapture/private/PrivateLabelField.d.ts +2 -2
- package/dist/dts/labelcapture/view/LabelCaptureValidationFlowOverlay.d.ts +1 -1
- package/dist/dts/proxy-registration.d.ts +2 -0
- package/dist/dts/proxy-types.d.ts +5 -0
- package/dist/index.js +240 -202
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FactoryMaker, Feedback, Brush, CameraSettings, nameForSerialization, DefaultSerializeable, ignoreFromSerialization, ignoreFromSerializationIfNull, Quadrilateral,
|
|
1
|
+
import { FactoryMaker, Feedback, Brush, CameraSettings, nameForSerialization, DefaultSerializeable, ignoreFromSerialization, ignoreFromSerializationIfNull, Quadrilateral, BaseController, Anchor, PointWithUnit, Rect, Point, Size, serializationDefault, NoViewfinder, registerProxies } from 'scandit-datacapture-frameworks-core';
|
|
2
2
|
import { Barcode, getBarcodeDefaults } from 'scandit-datacapture-frameworks-barcode';
|
|
3
3
|
|
|
4
4
|
function loadLabelCaptureDefaults(jsonDefaults) {
|
|
@@ -150,6 +150,9 @@ __decorate([
|
|
|
150
150
|
], BarcodeField.prototype, "_symbologySettings", void 0);
|
|
151
151
|
|
|
152
152
|
class LabelDateResult extends DefaultSerializeable {
|
|
153
|
+
static fromJSON(json) {
|
|
154
|
+
return new LabelDateResult(json.day, json.month, json.year, json.dayStr, json.monthStr, json.yearStr);
|
|
155
|
+
}
|
|
153
156
|
constructor(day, month, year, dayString, monthString, yearString) {
|
|
154
157
|
super();
|
|
155
158
|
this._day = day;
|
|
@@ -180,9 +183,6 @@ class LabelDateResult extends DefaultSerializeable {
|
|
|
180
183
|
var _a;
|
|
181
184
|
return (_a = this._yearString) !== null && _a !== void 0 ? _a : '';
|
|
182
185
|
}
|
|
183
|
-
static fromJSON(json) {
|
|
184
|
-
return new LabelDateResult(json.day, json.month, json.year, json.dayStr, json.monthStr, json.yearStr);
|
|
185
|
-
}
|
|
186
186
|
}
|
|
187
187
|
__decorate([
|
|
188
188
|
nameForSerialization('day')
|
|
@@ -204,6 +204,18 @@ __decorate([
|
|
|
204
204
|
], LabelDateResult.prototype, "_yearString", void 0);
|
|
205
205
|
|
|
206
206
|
class LabelField {
|
|
207
|
+
static fromJSON(json) {
|
|
208
|
+
const field = new LabelField();
|
|
209
|
+
field._name = json.name;
|
|
210
|
+
field._type = json.type;
|
|
211
|
+
field._predictedLocation = Quadrilateral.fromJSON(json.location);
|
|
212
|
+
field._state = json.state;
|
|
213
|
+
field._isRequired = json.isRequired;
|
|
214
|
+
field._barcode = json.barcode ? Barcode['fromJSON'](json.barcode) : null;
|
|
215
|
+
field._text = json.text;
|
|
216
|
+
field._dateResult = json.date ? LabelDateResult.fromJSON(json.date) : null;
|
|
217
|
+
return field;
|
|
218
|
+
}
|
|
207
219
|
get name() {
|
|
208
220
|
return this._name;
|
|
209
221
|
}
|
|
@@ -228,18 +240,6 @@ class LabelField {
|
|
|
228
240
|
asDate() {
|
|
229
241
|
return this._dateResult;
|
|
230
242
|
}
|
|
231
|
-
static fromJSON(json) {
|
|
232
|
-
const field = new LabelField();
|
|
233
|
-
field._name = json.name;
|
|
234
|
-
field._type = json.type;
|
|
235
|
-
field._predictedLocation = Quadrilateral.fromJSON(json.location);
|
|
236
|
-
field._state = json.state;
|
|
237
|
-
field._isRequired = json.isRequired;
|
|
238
|
-
field._barcode = json.barcode ? Barcode.fromJSON(json.barcode) : null;
|
|
239
|
-
field._text = json.text;
|
|
240
|
-
field._dateResult = json.date ? LabelDateResult.fromJSON(json.date) : null;
|
|
241
|
-
return field;
|
|
242
|
-
}
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
class CapturedLabel {
|
|
@@ -291,11 +291,12 @@ class CustomBarcode extends BarcodeField {
|
|
|
291
291
|
constructor(name, symbologies) {
|
|
292
292
|
super(name, symbologies);
|
|
293
293
|
this.location = null;
|
|
294
|
-
this._anchorRegexes =
|
|
294
|
+
this._anchorRegexes = null;
|
|
295
295
|
this._fieldType = 'customBarcode';
|
|
296
296
|
}
|
|
297
297
|
get anchorRegexes() {
|
|
298
|
-
|
|
298
|
+
var _a;
|
|
299
|
+
return (_a = this._anchorRegexes) !== null && _a !== void 0 ? _a : [];
|
|
299
300
|
}
|
|
300
301
|
set anchorRegexes(value) {
|
|
301
302
|
this._anchorRegexes = value;
|
|
@@ -321,11 +322,12 @@ class CustomText extends TextField {
|
|
|
321
322
|
constructor(name) {
|
|
322
323
|
super(name);
|
|
323
324
|
this.location = null;
|
|
324
|
-
this._anchorRegexes =
|
|
325
|
+
this._anchorRegexes = null;
|
|
325
326
|
this._fieldType = 'customText';
|
|
326
327
|
}
|
|
327
328
|
get anchorRegexes() {
|
|
328
|
-
|
|
329
|
+
var _a;
|
|
330
|
+
return (_a = this._anchorRegexes) !== null && _a !== void 0 ? _a : [];
|
|
329
331
|
}
|
|
330
332
|
set anchorRegexes(value) {
|
|
331
333
|
this._anchorRegexes = value;
|
|
@@ -345,7 +347,7 @@ class ExpiryDateText extends TextField {
|
|
|
345
347
|
constructor(name) {
|
|
346
348
|
super(name);
|
|
347
349
|
this._fieldType = 'expiryDateText';
|
|
348
|
-
this._anchorRegexes =
|
|
350
|
+
this._anchorRegexes = null;
|
|
349
351
|
this._labelDateFormat = null;
|
|
350
352
|
}
|
|
351
353
|
get labelDateFormat() {
|
|
@@ -355,7 +357,8 @@ class ExpiryDateText extends TextField {
|
|
|
355
357
|
this._labelDateFormat = value;
|
|
356
358
|
}
|
|
357
359
|
get anchorRegexes() {
|
|
358
|
-
|
|
360
|
+
var _a;
|
|
361
|
+
return (_a = this._anchorRegexes) !== null && _a !== void 0 ? _a : [];
|
|
359
362
|
}
|
|
360
363
|
set anchorRegexes(value) {
|
|
361
364
|
this._anchorRegexes = value;
|
|
@@ -447,19 +450,12 @@ var LabelCaptureListenerEvents;
|
|
|
447
450
|
(function (LabelCaptureListenerEvents) {
|
|
448
451
|
LabelCaptureListenerEvents["didUpdateSession"] = "LabelCaptureListener.didUpdateSession";
|
|
449
452
|
})(LabelCaptureListenerEvents || (LabelCaptureListenerEvents = {}));
|
|
450
|
-
class LabelCaptureController extends
|
|
453
|
+
class LabelCaptureController extends BaseController {
|
|
451
454
|
constructor(mode) {
|
|
452
455
|
super('LabelCaptureProxy');
|
|
453
456
|
this.mode = mode;
|
|
454
457
|
this.initialize().catch(error => console.error('Failed to initialize LabelCaptureController:', error));
|
|
455
458
|
}
|
|
456
|
-
initialize() {
|
|
457
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
458
|
-
if (this.mode.listeners.length > 0) {
|
|
459
|
-
yield this.subscribeLabelCaptureListener();
|
|
460
|
-
}
|
|
461
|
-
});
|
|
462
|
-
}
|
|
463
459
|
setModeEnabledState(isEnabled) {
|
|
464
460
|
return this._proxy.$setModeEnabledState({ modeId: this.modeId, isEnabled });
|
|
465
461
|
}
|
|
@@ -477,14 +473,6 @@ class LabelCaptureController extends BaseNewController {
|
|
|
477
473
|
this._proxy.eventEmitter.on(LabelCaptureListenerEvents.didUpdateSession, this._boundHandleDidUpdateSession);
|
|
478
474
|
});
|
|
479
475
|
}
|
|
480
|
-
handleDidUpdateSessionEvent(ev) {
|
|
481
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
482
|
-
const payload = JSON.parse(ev.data);
|
|
483
|
-
const session = LabelCaptureSession.fromJSON(JSON.parse(payload.session));
|
|
484
|
-
this.notifyListenersOfDidUpdateSession(session);
|
|
485
|
-
yield this._proxy.$finishDidUpdateSessionCallback({ modeId: this.modeId, isEnabled: this.mode.isEnabled });
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
476
|
unsubscribeLabelCaptureListener() {
|
|
489
477
|
return __awaiter(this, void 0, void 0, function* () {
|
|
490
478
|
yield this._proxy.$unregisterListenerForEvents({ modeId: this.modeId });
|
|
@@ -496,12 +484,27 @@ class LabelCaptureController extends BaseNewController {
|
|
|
496
484
|
});
|
|
497
485
|
}
|
|
498
486
|
updateFeedback(feedback) {
|
|
499
|
-
this._proxy.$updateLabelCaptureFeedback({ modeId: this.modeId, feedbackJson: JSON.stringify(feedback.toJSON()) });
|
|
487
|
+
return this._proxy.$updateLabelCaptureFeedback({ modeId: this.modeId, feedbackJson: JSON.stringify(feedback.toJSON()) });
|
|
500
488
|
}
|
|
501
489
|
dispose() {
|
|
502
|
-
this.unsubscribeLabelCaptureListener();
|
|
490
|
+
void this.unsubscribeLabelCaptureListener();
|
|
503
491
|
this._proxy.dispose();
|
|
504
492
|
}
|
|
493
|
+
initialize() {
|
|
494
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
495
|
+
if (this.mode.listeners.length > 0) {
|
|
496
|
+
yield this.subscribeLabelCaptureListener();
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
handleDidUpdateSessionEvent(ev) {
|
|
501
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
502
|
+
const payload = JSON.parse(ev.data);
|
|
503
|
+
const session = LabelCaptureSession.fromJSON(JSON.parse(payload.session));
|
|
504
|
+
this.notifyListenersOfDidUpdateSession(session);
|
|
505
|
+
yield this._proxy.$finishDidUpdateSessionCallback({ modeId: this.modeId, isEnabled: this.mode.isEnabled });
|
|
506
|
+
});
|
|
507
|
+
}
|
|
505
508
|
get modeId() {
|
|
506
509
|
return this.mode.modeId;
|
|
507
510
|
}
|
|
@@ -527,17 +530,19 @@ class LabelCaptureFeedback extends DefaultSerializeable {
|
|
|
527
530
|
}
|
|
528
531
|
set success(success) {
|
|
529
532
|
this._success = success;
|
|
530
|
-
this.updateFeedback();
|
|
531
|
-
}
|
|
532
|
-
updateFeedback() {
|
|
533
|
-
var _a;
|
|
534
|
-
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateFeedback(this);
|
|
533
|
+
void this.updateFeedback();
|
|
535
534
|
}
|
|
536
535
|
constructor() {
|
|
537
536
|
super();
|
|
538
537
|
this.controller = null;
|
|
539
538
|
this._success = LabelCaptureFeedback.labelCaptureDefaults.LabelCapture.Feedback.success;
|
|
540
539
|
}
|
|
540
|
+
updateFeedback() {
|
|
541
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
542
|
+
var _a;
|
|
543
|
+
return (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateFeedback(this);
|
|
544
|
+
});
|
|
545
|
+
}
|
|
541
546
|
}
|
|
542
547
|
__decorate([
|
|
543
548
|
nameForSerialization('success')
|
|
@@ -550,20 +555,20 @@ __decorate([
|
|
|
550
555
|
], LabelCaptureFeedback, "labelCaptureDefaults", null);
|
|
551
556
|
|
|
552
557
|
class LabelCapture extends DefaultSerializeable {
|
|
558
|
+
static createRecommendedCameraSettings() {
|
|
559
|
+
return new CameraSettings(getLabelCaptureDefaults().LabelCapture.RecommendedCameraSettings);
|
|
560
|
+
}
|
|
553
561
|
get isEnabled() {
|
|
554
562
|
return this._isEnabled;
|
|
555
563
|
}
|
|
556
564
|
set isEnabled(isEnabled) {
|
|
557
565
|
var _a;
|
|
558
566
|
this._isEnabled = isEnabled;
|
|
559
|
-
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.setModeEnabledState(isEnabled);
|
|
567
|
+
void ((_a = this.controller) === null || _a === void 0 ? void 0 : _a.setModeEnabledState(isEnabled));
|
|
560
568
|
}
|
|
561
569
|
get context() {
|
|
562
570
|
return this._context;
|
|
563
571
|
}
|
|
564
|
-
static createRecommendedCameraSettings() {
|
|
565
|
-
return new CameraSettings(getLabelCaptureDefaults().LabelCapture.RecommendedCameraSettings);
|
|
566
|
-
}
|
|
567
572
|
get _context() {
|
|
568
573
|
return this.privateContext;
|
|
569
574
|
}
|
|
@@ -581,6 +586,7 @@ class LabelCapture extends DefaultSerializeable {
|
|
|
581
586
|
}
|
|
582
587
|
constructor(settings) {
|
|
583
588
|
super();
|
|
589
|
+
this.listeners = [];
|
|
584
590
|
this.type = 'labelCapture';
|
|
585
591
|
this.modeId = Math.floor(Math.random() * 100000000);
|
|
586
592
|
this.parentId = null;
|
|
@@ -588,7 +594,6 @@ class LabelCapture extends DefaultSerializeable {
|
|
|
588
594
|
this._feedback = LabelCaptureFeedback.defaultFeedback;
|
|
589
595
|
this.hasListeners = false;
|
|
590
596
|
this.privateContext = null;
|
|
591
|
-
this.listeners = [];
|
|
592
597
|
this.controller = null;
|
|
593
598
|
this.settings = settings;
|
|
594
599
|
}
|
|
@@ -600,18 +605,26 @@ class LabelCapture extends DefaultSerializeable {
|
|
|
600
605
|
});
|
|
601
606
|
}
|
|
602
607
|
addListener(listener) {
|
|
608
|
+
var _a;
|
|
603
609
|
if (this.listeners.includes(listener)) {
|
|
604
610
|
return;
|
|
605
611
|
}
|
|
612
|
+
if (this.listeners.length === 0) {
|
|
613
|
+
void ((_a = this.controller) === null || _a === void 0 ? void 0 : _a.subscribeLabelCaptureListener());
|
|
614
|
+
this.hasListeners = true;
|
|
615
|
+
}
|
|
606
616
|
this.listeners.push(listener);
|
|
607
|
-
this.hasListeners = this.listeners.length > 0;
|
|
608
617
|
}
|
|
609
618
|
removeListener(listener) {
|
|
619
|
+
var _a;
|
|
610
620
|
if (!this.listeners.includes(listener)) {
|
|
611
621
|
return;
|
|
612
622
|
}
|
|
613
623
|
this.listeners.splice(this.listeners.indexOf(listener), 1);
|
|
614
|
-
|
|
624
|
+
if (this.listeners.length === 0) {
|
|
625
|
+
void ((_a = this.controller) === null || _a === void 0 ? void 0 : _a.unsubscribeLabelCaptureListener());
|
|
626
|
+
this.hasListeners = false;
|
|
627
|
+
}
|
|
615
628
|
}
|
|
616
629
|
get feedback() {
|
|
617
630
|
return this._feedback;
|
|
@@ -621,9 +634,12 @@ class LabelCapture extends DefaultSerializeable {
|
|
|
621
634
|
this._feedback.controller = null;
|
|
622
635
|
this._feedback = feedback;
|
|
623
636
|
this._feedback.controller = this.controller;
|
|
624
|
-
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateFeedback(feedback);
|
|
637
|
+
void ((_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateFeedback(feedback));
|
|
625
638
|
}
|
|
626
639
|
}
|
|
640
|
+
__decorate([
|
|
641
|
+
ignoreFromSerialization
|
|
642
|
+
], LabelCapture.prototype, "listeners", void 0);
|
|
627
643
|
__decorate([
|
|
628
644
|
nameForSerialization('parentId'),
|
|
629
645
|
ignoreFromSerializationIfNull
|
|
@@ -637,9 +653,6 @@ __decorate([
|
|
|
637
653
|
__decorate([
|
|
638
654
|
ignoreFromSerialization
|
|
639
655
|
], LabelCapture.prototype, "privateContext", void 0);
|
|
640
|
-
__decorate([
|
|
641
|
-
ignoreFromSerialization
|
|
642
|
-
], LabelCapture.prototype, "listeners", void 0);
|
|
643
656
|
__decorate([
|
|
644
657
|
ignoreFromSerialization
|
|
645
658
|
], LabelCapture.prototype, "controller", void 0);
|
|
@@ -676,12 +689,7 @@ class LabelCaptureAdvancedOverlayController extends BaseController {
|
|
|
676
689
|
return this.handleOffsetForCapturedLabelField(ev);
|
|
677
690
|
});
|
|
678
691
|
this.overlay = overlay;
|
|
679
|
-
this.initialize();
|
|
680
|
-
}
|
|
681
|
-
initialize() {
|
|
682
|
-
if (this.overlay.listener) {
|
|
683
|
-
this.subscribeListener();
|
|
684
|
-
}
|
|
692
|
+
void this.initialize();
|
|
685
693
|
}
|
|
686
694
|
setViewForCapturedLabel(label, view) {
|
|
687
695
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -711,6 +719,57 @@ class LabelCaptureAdvancedOverlayController extends BaseController {
|
|
|
711
719
|
const identifier = `${label.trackingID}§${field.name}`;
|
|
712
720
|
return this.setViewForCapturedLabelFieldPrivate(identifier, view);
|
|
713
721
|
}
|
|
722
|
+
setAnchorForCapturedLabelField(label, field, anchor) {
|
|
723
|
+
const identifier = `${label.trackingID}§${field.name}`;
|
|
724
|
+
return this.setAnchorForCapturedLabelFieldPrivate(identifier, anchor);
|
|
725
|
+
}
|
|
726
|
+
setOffsetForCapturedLabelField(label, field, offset) {
|
|
727
|
+
const identifier = `${label.trackingID}§${field.name}`;
|
|
728
|
+
return this.setOffsetForCapturedLabelFieldPrivate(identifier, offset);
|
|
729
|
+
}
|
|
730
|
+
clearCapturedLabelViews() {
|
|
731
|
+
return this._proxy.$clearCapturedLabelViews({ dataCaptureViewId: this.dataCaptureViewId });
|
|
732
|
+
}
|
|
733
|
+
subscribeListener() {
|
|
734
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
735
|
+
if (this.dataCaptureViewId !== -1) {
|
|
736
|
+
yield this._proxy.$registerListenerForAdvancedOverlayEvents({ dataCaptureViewId: this.dataCaptureViewId });
|
|
737
|
+
}
|
|
738
|
+
this._proxy.subscribeForEvents(Object.values(LabelCaptureAdvancedOverlayListenerEvents));
|
|
739
|
+
this._proxy.eventEmitter.on(LabelCaptureAdvancedOverlayListenerEvents.viewForLabel, this.handleViewForLabelWrapper);
|
|
740
|
+
this._proxy.eventEmitter.on(LabelCaptureAdvancedOverlayListenerEvents.anchorForLabel, this.handleAnchorForLabelWrapper);
|
|
741
|
+
this._proxy.eventEmitter.on(LabelCaptureAdvancedOverlayListenerEvents.offsetForLabel, this.handleOffsetForLabelWrapper);
|
|
742
|
+
this._proxy.eventEmitter.on(LabelCaptureAdvancedOverlayListenerEvents.viewForCapturedLabelField, this.handleViewForCapturedLabelFieldWrapper);
|
|
743
|
+
this._proxy.eventEmitter.on(LabelCaptureAdvancedOverlayListenerEvents.anchorForCapturedLabelField, this.handleAnchorForCapturedLabelFieldWrapper);
|
|
744
|
+
this._proxy.eventEmitter.on(LabelCaptureAdvancedOverlayListenerEvents.offsetForCapturedLabelField, this.handleOffsetForCapturedLabelFieldWrapper);
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
unsubscribeListener() {
|
|
748
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
749
|
+
yield this._proxy.$unregisterListenerForAdvancedOverlayEvents({ dataCaptureViewId: this.dataCaptureViewId });
|
|
750
|
+
this._proxy.unsubscribeFromEvents(Object.values(LabelCaptureAdvancedOverlayListenerEvents));
|
|
751
|
+
this._proxy.eventEmitter.off(LabelCaptureAdvancedOverlayListenerEvents.viewForLabel, this.handleViewForLabelWrapper);
|
|
752
|
+
this._proxy.eventEmitter.off(LabelCaptureAdvancedOverlayListenerEvents.anchorForLabel, this.handleAnchorForLabelWrapper);
|
|
753
|
+
this._proxy.eventEmitter.off(LabelCaptureAdvancedOverlayListenerEvents.offsetForLabel, this.handleOffsetForLabelWrapper);
|
|
754
|
+
this._proxy.eventEmitter.off(LabelCaptureAdvancedOverlayListenerEvents.viewForCapturedLabelField, this.handleViewForCapturedLabelFieldWrapper);
|
|
755
|
+
this._proxy.eventEmitter.off(LabelCaptureAdvancedOverlayListenerEvents.anchorForCapturedLabelField, this.handleAnchorForCapturedLabelFieldWrapper);
|
|
756
|
+
this._proxy.eventEmitter.off(LabelCaptureAdvancedOverlayListenerEvents.offsetForCapturedLabelField, this.handleOffsetForCapturedLabelFieldWrapper);
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
dispose() {
|
|
760
|
+
void this.unsubscribeListener();
|
|
761
|
+
this._proxy.dispose();
|
|
762
|
+
}
|
|
763
|
+
updateAdvancedOverlay(advancedOverlayJson) {
|
|
764
|
+
return this._proxy.$updateLabelCaptureAdvancedOverlay({ dataCaptureViewId: this.dataCaptureViewId, advancedOverlayJson });
|
|
765
|
+
}
|
|
766
|
+
initialize() {
|
|
767
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
768
|
+
if (this.overlay.listener) {
|
|
769
|
+
return this.subscribeListener();
|
|
770
|
+
}
|
|
771
|
+
});
|
|
772
|
+
}
|
|
714
773
|
setViewForCapturedLabelFieldPrivate(identifier, view) {
|
|
715
774
|
return __awaiter(this, void 0, void 0, function* () {
|
|
716
775
|
const awitedView = yield view;
|
|
@@ -721,10 +780,6 @@ class LabelCaptureAdvancedOverlayController extends BaseController {
|
|
|
721
780
|
});
|
|
722
781
|
});
|
|
723
782
|
}
|
|
724
|
-
setAnchorForCapturedLabelField(label, field, anchor) {
|
|
725
|
-
const identifier = `${label.trackingID}§${field.name}`;
|
|
726
|
-
return this.setAnchorForCapturedLabelFieldPrivate(identifier, anchor);
|
|
727
|
-
}
|
|
728
783
|
setAnchorForCapturedLabelFieldPrivate(identifier, anchor) {
|
|
729
784
|
return this._proxy.$setAnchorForCapturedLabelField({
|
|
730
785
|
anchor: anchor,
|
|
@@ -732,10 +787,6 @@ class LabelCaptureAdvancedOverlayController extends BaseController {
|
|
|
732
787
|
dataCaptureViewId: this.dataCaptureViewId
|
|
733
788
|
});
|
|
734
789
|
}
|
|
735
|
-
setOffsetForCapturedLabelField(label, field, offset) {
|
|
736
|
-
const identifier = `${label.trackingID}§${field.name}`;
|
|
737
|
-
return this.setOffsetForCapturedLabelFieldPrivate(identifier, offset);
|
|
738
|
-
}
|
|
739
790
|
setOffsetForCapturedLabelFieldPrivate(identifier, offset) {
|
|
740
791
|
return this._proxy.$setOffsetForCapturedLabelField({
|
|
741
792
|
offset: JSON.stringify(offset.toJSON()),
|
|
@@ -743,21 +794,6 @@ class LabelCaptureAdvancedOverlayController extends BaseController {
|
|
|
743
794
|
dataCaptureViewId: this.dataCaptureViewId
|
|
744
795
|
});
|
|
745
796
|
}
|
|
746
|
-
clearCapturedLabelViews() {
|
|
747
|
-
return this._proxy.$clearCapturedLabelViews({ dataCaptureViewId: this.dataCaptureViewId });
|
|
748
|
-
}
|
|
749
|
-
subscribeListener() {
|
|
750
|
-
if (this.dataCaptureViewId !== -1) {
|
|
751
|
-
this._proxy.$registerListenerForAdvancedOverlayEvents({ dataCaptureViewId: this.dataCaptureViewId });
|
|
752
|
-
}
|
|
753
|
-
this._proxy.subscribeForEvents(Object.values(LabelCaptureAdvancedOverlayListenerEvents));
|
|
754
|
-
this._proxy.eventEmitter.on(LabelCaptureAdvancedOverlayListenerEvents.viewForLabel, this.handleViewForLabelWrapper);
|
|
755
|
-
this._proxy.eventEmitter.on(LabelCaptureAdvancedOverlayListenerEvents.anchorForLabel, this.handleAnchorForLabelWrapper);
|
|
756
|
-
this._proxy.eventEmitter.on(LabelCaptureAdvancedOverlayListenerEvents.offsetForLabel, this.handleOffsetForLabelWrapper);
|
|
757
|
-
this._proxy.eventEmitter.on(LabelCaptureAdvancedOverlayListenerEvents.viewForCapturedLabelField, this.handleViewForCapturedLabelFieldWrapper);
|
|
758
|
-
this._proxy.eventEmitter.on(LabelCaptureAdvancedOverlayListenerEvents.anchorForCapturedLabelField, this.handleAnchorForCapturedLabelFieldWrapper);
|
|
759
|
-
this._proxy.eventEmitter.on(LabelCaptureAdvancedOverlayListenerEvents.offsetForCapturedLabelField, this.handleOffsetForCapturedLabelFieldWrapper);
|
|
760
|
-
}
|
|
761
797
|
handleViewForLabel(ev) {
|
|
762
798
|
return __awaiter(this, void 0, void 0, function* () {
|
|
763
799
|
const payload = JSON.parse(ev.data);
|
|
@@ -824,23 +860,6 @@ class LabelCaptureAdvancedOverlayController extends BaseController {
|
|
|
824
860
|
yield this.setOffsetForCapturedLabelFieldPrivate(payload.identifier, offset);
|
|
825
861
|
});
|
|
826
862
|
}
|
|
827
|
-
unsubscribeListener() {
|
|
828
|
-
this._proxy.$unregisterListenerForAdvancedOverlayEvents({ dataCaptureViewId: this.dataCaptureViewId });
|
|
829
|
-
this._proxy.unsubscribeFromEvents(Object.values(LabelCaptureAdvancedOverlayListenerEvents));
|
|
830
|
-
this._proxy.eventEmitter.off(LabelCaptureAdvancedOverlayListenerEvents.viewForLabel, this.handleViewForLabelWrapper);
|
|
831
|
-
this._proxy.eventEmitter.off(LabelCaptureAdvancedOverlayListenerEvents.anchorForLabel, this.handleAnchorForLabelWrapper);
|
|
832
|
-
this._proxy.eventEmitter.off(LabelCaptureAdvancedOverlayListenerEvents.offsetForLabel, this.handleOffsetForLabelWrapper);
|
|
833
|
-
this._proxy.eventEmitter.off(LabelCaptureAdvancedOverlayListenerEvents.viewForCapturedLabelField, this.handleViewForCapturedLabelFieldWrapper);
|
|
834
|
-
this._proxy.eventEmitter.off(LabelCaptureAdvancedOverlayListenerEvents.anchorForCapturedLabelField, this.handleAnchorForCapturedLabelFieldWrapper);
|
|
835
|
-
this._proxy.eventEmitter.off(LabelCaptureAdvancedOverlayListenerEvents.offsetForCapturedLabelField, this.handleOffsetForCapturedLabelFieldWrapper);
|
|
836
|
-
}
|
|
837
|
-
dispose() {
|
|
838
|
-
this.unsubscribeListener();
|
|
839
|
-
this._proxy.dispose();
|
|
840
|
-
}
|
|
841
|
-
updateAdvancedOverlay(advancedOverlayJson) {
|
|
842
|
-
return this._proxy.$updateLabelCaptureAdvancedOverlay({ dataCaptureViewId: this.dataCaptureViewId, advancedOverlayJson });
|
|
843
|
-
}
|
|
844
863
|
get dataCaptureViewId() {
|
|
845
864
|
var _a, _b;
|
|
846
865
|
return (_b = (_a = this.overlay.view) === null || _a === void 0 ? void 0 : _a.viewId) !== null && _b !== void 0 ? _b : -1;
|
|
@@ -868,7 +887,7 @@ class LabelCaptureAdvancedOverlay extends DefaultSerializeable {
|
|
|
868
887
|
set shouldShowScanAreaGuides(shouldShow) {
|
|
869
888
|
var _a;
|
|
870
889
|
this._shouldShowScanAreaGuides = shouldShow;
|
|
871
|
-
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateAdvancedOverlay(JSON.stringify(this.toJSON()));
|
|
890
|
+
void ((_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateAdvancedOverlay(JSON.stringify(this.toJSON())));
|
|
872
891
|
}
|
|
873
892
|
get listener() {
|
|
874
893
|
return this._listener;
|
|
@@ -878,10 +897,10 @@ class LabelCaptureAdvancedOverlay extends DefaultSerializeable {
|
|
|
878
897
|
this._listener = listener;
|
|
879
898
|
this.hasListener = listener != null;
|
|
880
899
|
if (this.hasListener) {
|
|
881
|
-
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.subscribeListener();
|
|
900
|
+
void ((_a = this.controller) === null || _a === void 0 ? void 0 : _a.subscribeListener());
|
|
882
901
|
}
|
|
883
902
|
else {
|
|
884
|
-
(_b = this.controller) === null || _b === void 0 ? void 0 : _b.unsubscribeListener();
|
|
903
|
+
void ((_b = this.controller) === null || _b === void 0 ? void 0 : _b.unsubscribeListener());
|
|
885
904
|
}
|
|
886
905
|
}
|
|
887
906
|
constructor(mode) {
|
|
@@ -1043,12 +1062,6 @@ class LabelDefinition extends DefaultSerializeable {
|
|
|
1043
1062
|
}
|
|
1044
1063
|
this._hiddenProperties = newValue;
|
|
1045
1064
|
}
|
|
1046
|
-
static fromJSON(json) {
|
|
1047
|
-
const definition = new LabelDefinition(json.name);
|
|
1048
|
-
definition._fields = json.fields;
|
|
1049
|
-
definition.hiddenProperties = json.hidden_properties;
|
|
1050
|
-
return definition;
|
|
1051
|
-
}
|
|
1052
1065
|
static createVinLabelDefinition(name) {
|
|
1053
1066
|
const definition = new LabelDefinition(name);
|
|
1054
1067
|
definition._type = 'vin';
|
|
@@ -1064,6 +1077,12 @@ class LabelDefinition extends DefaultSerializeable {
|
|
|
1064
1077
|
definition._type = 'sevenSegment';
|
|
1065
1078
|
return definition;
|
|
1066
1079
|
}
|
|
1080
|
+
static fromJSON(json) {
|
|
1081
|
+
const definition = new LabelDefinition(json.name);
|
|
1082
|
+
definition._fields = json.fields;
|
|
1083
|
+
definition.hiddenProperties = json.hidden_properties;
|
|
1084
|
+
return definition;
|
|
1085
|
+
}
|
|
1067
1086
|
constructor(name) {
|
|
1068
1087
|
super();
|
|
1069
1088
|
this._name = '';
|
|
@@ -1194,11 +1213,12 @@ class PackingDateText extends TextField {
|
|
|
1194
1213
|
constructor(name) {
|
|
1195
1214
|
super(name);
|
|
1196
1215
|
this._fieldType = 'packingDateText';
|
|
1197
|
-
this._anchorRegexes =
|
|
1216
|
+
this._anchorRegexes = null;
|
|
1198
1217
|
this._labelDateFormat = null;
|
|
1199
1218
|
}
|
|
1200
1219
|
get anchorRegexes() {
|
|
1201
|
-
|
|
1220
|
+
var _a;
|
|
1221
|
+
return (_a = this._anchorRegexes) !== null && _a !== void 0 ? _a : [];
|
|
1202
1222
|
}
|
|
1203
1223
|
get labelDateFormat() {
|
|
1204
1224
|
return this._labelDateFormat;
|
|
@@ -1275,10 +1295,11 @@ class TotalPriceText extends TextField {
|
|
|
1275
1295
|
constructor(name) {
|
|
1276
1296
|
super(name);
|
|
1277
1297
|
this._fieldType = 'totalPriceText';
|
|
1278
|
-
this._anchorRegexes =
|
|
1298
|
+
this._anchorRegexes = null;
|
|
1279
1299
|
}
|
|
1280
1300
|
get anchorRegexes() {
|
|
1281
|
-
|
|
1301
|
+
var _a;
|
|
1302
|
+
return (_a = this._anchorRegexes) !== null && _a !== void 0 ? _a : [];
|
|
1282
1303
|
}
|
|
1283
1304
|
set anchorRegexes(value) {
|
|
1284
1305
|
this._anchorRegexes = value;
|
|
@@ -1295,10 +1316,11 @@ class UnitPriceText extends TextField {
|
|
|
1295
1316
|
constructor(name) {
|
|
1296
1317
|
super(name);
|
|
1297
1318
|
this._fieldType = 'unitPriceText';
|
|
1298
|
-
this._anchorRegexes =
|
|
1319
|
+
this._anchorRegexes = null;
|
|
1299
1320
|
}
|
|
1300
1321
|
get anchorRegexes() {
|
|
1301
|
-
|
|
1322
|
+
var _a;
|
|
1323
|
+
return (_a = this._anchorRegexes) !== null && _a !== void 0 ? _a : [];
|
|
1302
1324
|
}
|
|
1303
1325
|
set anchorRegexes(value) {
|
|
1304
1326
|
this._anchorRegexes = value;
|
|
@@ -1315,10 +1337,11 @@ class WeightText extends TextField {
|
|
|
1315
1337
|
constructor(name) {
|
|
1316
1338
|
super(name);
|
|
1317
1339
|
this._fieldType = 'weightText';
|
|
1318
|
-
this._anchorRegexes =
|
|
1340
|
+
this._anchorRegexes = null;
|
|
1319
1341
|
}
|
|
1320
1342
|
get anchorRegexes() {
|
|
1321
|
-
|
|
1343
|
+
var _a;
|
|
1344
|
+
return (_a = this._anchorRegexes) !== null && _a !== void 0 ? _a : [];
|
|
1322
1345
|
}
|
|
1323
1346
|
set anchorRegexes(value) {
|
|
1324
1347
|
this._anchorRegexes = value;
|
|
@@ -1347,16 +1370,11 @@ class LabelCaptureBasicOverlayController extends BaseController {
|
|
|
1347
1370
|
this.handleBrushForLabelWrapper = (ev) => __awaiter(this, void 0, void 0, function* () {
|
|
1348
1371
|
return this.handleBrushForLabel(ev);
|
|
1349
1372
|
});
|
|
1350
|
-
this.handleDidTapLabelWrapper = (ev) =>
|
|
1351
|
-
|
|
1352
|
-
}
|
|
1373
|
+
this.handleDidTapLabelWrapper = (ev) => {
|
|
1374
|
+
this.handleDidTapLabel(ev);
|
|
1375
|
+
};
|
|
1353
1376
|
this.overlay = overlay;
|
|
1354
|
-
this.initialize();
|
|
1355
|
-
}
|
|
1356
|
-
initialize() {
|
|
1357
|
-
if (this.overlay.listener) {
|
|
1358
|
-
this.subscribeListener();
|
|
1359
|
-
}
|
|
1377
|
+
void this.initialize();
|
|
1360
1378
|
}
|
|
1361
1379
|
setBrushForFieldOfLabel(brush, field, label) {
|
|
1362
1380
|
return this._proxy.$setBrushForFieldOfLabel({
|
|
@@ -1384,6 +1402,29 @@ class LabelCaptureBasicOverlayController extends BaseController {
|
|
|
1384
1402
|
this._proxy.eventEmitter.on(LabelCaptureBasicOverlayListenerEvents.didTapLabel, this.handleDidTapLabelWrapper);
|
|
1385
1403
|
});
|
|
1386
1404
|
}
|
|
1405
|
+
unsubscribeListener() {
|
|
1406
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1407
|
+
yield this._proxy.$unregisterListenerForBasicOverlayEvents({ dataCaptureViewId: this.dataCaptureViewId });
|
|
1408
|
+
this._proxy.unsubscribeFromEvents(Object.values(LabelCaptureBasicOverlayListenerEvents));
|
|
1409
|
+
this._proxy.eventEmitter.off(LabelCaptureBasicOverlayListenerEvents.brushForFieldOfLabel, this.handleBrushForFieldOfLabelWrapper);
|
|
1410
|
+
this._proxy.eventEmitter.off(LabelCaptureBasicOverlayListenerEvents.brushForLabel, this.handleBrushForLabelWrapper);
|
|
1411
|
+
this._proxy.eventEmitter.off(LabelCaptureBasicOverlayListenerEvents.didTapLabel, this.handleDidTapLabelWrapper);
|
|
1412
|
+
});
|
|
1413
|
+
}
|
|
1414
|
+
updateBasicOverlay(basicOverlayJson) {
|
|
1415
|
+
return this._proxy.$updateLabelCaptureBasicOverlay({ dataCaptureViewId: this.dataCaptureViewId, basicOverlayJson });
|
|
1416
|
+
}
|
|
1417
|
+
dispose() {
|
|
1418
|
+
void this.unsubscribeListener();
|
|
1419
|
+
this._proxy.dispose();
|
|
1420
|
+
}
|
|
1421
|
+
initialize() {
|
|
1422
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1423
|
+
if (this.overlay.listener) {
|
|
1424
|
+
return this.subscribeListener();
|
|
1425
|
+
}
|
|
1426
|
+
});
|
|
1427
|
+
}
|
|
1387
1428
|
handleBrushForFieldOfLabel(ev) {
|
|
1388
1429
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1389
1430
|
const payload = JSON.parse(ev.data);
|
|
@@ -1408,29 +1449,11 @@ class LabelCaptureBasicOverlayController extends BaseController {
|
|
|
1408
1449
|
});
|
|
1409
1450
|
}
|
|
1410
1451
|
handleDidTapLabel(ev) {
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
}
|
|
1417
|
-
});
|
|
1418
|
-
}
|
|
1419
|
-
unsubscribeListener() {
|
|
1420
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1421
|
-
this._proxy.$unregisterListenerForBasicOverlayEvents({ dataCaptureViewId: this.dataCaptureViewId });
|
|
1422
|
-
this._proxy.unsubscribeFromEvents(Object.values(LabelCaptureBasicOverlayListenerEvents));
|
|
1423
|
-
this._proxy.eventEmitter.off(LabelCaptureBasicOverlayListenerEvents.brushForFieldOfLabel, this.handleBrushForFieldOfLabelWrapper);
|
|
1424
|
-
this._proxy.eventEmitter.off(LabelCaptureBasicOverlayListenerEvents.brushForLabel, this.handleBrushForLabelWrapper);
|
|
1425
|
-
this._proxy.eventEmitter.off(LabelCaptureBasicOverlayListenerEvents.didTapLabel, this.handleDidTapLabelWrapper);
|
|
1426
|
-
});
|
|
1427
|
-
}
|
|
1428
|
-
updateBasicOverlay(basicOverlayJson) {
|
|
1429
|
-
return this._proxy.$updateLabelCaptureBasicOverlay({ dataCaptureViewId: this.dataCaptureViewId, basicOverlayJson });
|
|
1430
|
-
}
|
|
1431
|
-
dispose() {
|
|
1432
|
-
this.unsubscribeListener();
|
|
1433
|
-
this._proxy.dispose();
|
|
1452
|
+
const payload = JSON.parse(ev.data);
|
|
1453
|
+
if (this.overlay.listener && this.overlay.listener.didTapLabel) {
|
|
1454
|
+
const label = CapturedLabel.fromJSON(JSON.parse(payload.label));
|
|
1455
|
+
this.overlay.listener.didTapLabel(this.overlay, label);
|
|
1456
|
+
}
|
|
1434
1457
|
}
|
|
1435
1458
|
get dataCaptureViewId() {
|
|
1436
1459
|
var _a, _b;
|
|
@@ -1471,7 +1494,7 @@ class LabelCaptureBasicOverlay extends DefaultSerializeable {
|
|
|
1471
1494
|
set predictedFieldBrush(newBrush) {
|
|
1472
1495
|
var _a;
|
|
1473
1496
|
this._predictedFieldBrush = newBrush;
|
|
1474
|
-
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBasicOverlay(JSON.stringify(this.toJSON()));
|
|
1497
|
+
void ((_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBasicOverlay(JSON.stringify(this.toJSON())));
|
|
1475
1498
|
}
|
|
1476
1499
|
get capturedFieldBrush() {
|
|
1477
1500
|
return this._capturedFieldBrush;
|
|
@@ -1479,7 +1502,7 @@ class LabelCaptureBasicOverlay extends DefaultSerializeable {
|
|
|
1479
1502
|
set capturedFieldBrush(newBrush) {
|
|
1480
1503
|
var _a;
|
|
1481
1504
|
this._capturedFieldBrush = newBrush;
|
|
1482
|
-
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBasicOverlay(JSON.stringify(this.toJSON()));
|
|
1505
|
+
void ((_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBasicOverlay(JSON.stringify(this.toJSON())));
|
|
1483
1506
|
}
|
|
1484
1507
|
get labelBrush() {
|
|
1485
1508
|
return this._labelBrush;
|
|
@@ -1487,7 +1510,7 @@ class LabelCaptureBasicOverlay extends DefaultSerializeable {
|
|
|
1487
1510
|
set labelBrush(newBrush) {
|
|
1488
1511
|
var _a;
|
|
1489
1512
|
this._labelBrush = newBrush;
|
|
1490
|
-
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBasicOverlay(JSON.stringify(this.toJSON()));
|
|
1513
|
+
void ((_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBasicOverlay(JSON.stringify(this.toJSON())));
|
|
1491
1514
|
}
|
|
1492
1515
|
get listener() {
|
|
1493
1516
|
return this._listener;
|
|
@@ -1497,10 +1520,10 @@ class LabelCaptureBasicOverlay extends DefaultSerializeable {
|
|
|
1497
1520
|
this._listener = listener;
|
|
1498
1521
|
this.hasListener = listener != null;
|
|
1499
1522
|
if (this.hasListener) {
|
|
1500
|
-
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.subscribeListener();
|
|
1523
|
+
void ((_a = this.controller) === null || _a === void 0 ? void 0 : _a.subscribeListener());
|
|
1501
1524
|
}
|
|
1502
1525
|
else {
|
|
1503
|
-
(_b = this.controller) === null || _b === void 0 ? void 0 : _b.unsubscribeListener();
|
|
1526
|
+
void ((_b = this.controller) === null || _b === void 0 ? void 0 : _b.unsubscribeListener());
|
|
1504
1527
|
}
|
|
1505
1528
|
}
|
|
1506
1529
|
get shouldShowScanAreaGuides() {
|
|
@@ -1509,7 +1532,7 @@ class LabelCaptureBasicOverlay extends DefaultSerializeable {
|
|
|
1509
1532
|
set shouldShowScanAreaGuides(shouldShow) {
|
|
1510
1533
|
var _a;
|
|
1511
1534
|
this._shouldShowScanAreaGuides = shouldShow;
|
|
1512
|
-
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBasicOverlay(JSON.stringify(this.toJSON()));
|
|
1535
|
+
void ((_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBasicOverlay(JSON.stringify(this.toJSON())));
|
|
1513
1536
|
}
|
|
1514
1537
|
get viewfinder() {
|
|
1515
1538
|
return this._viewfinder;
|
|
@@ -1517,7 +1540,7 @@ class LabelCaptureBasicOverlay extends DefaultSerializeable {
|
|
|
1517
1540
|
set viewfinder(newViewfinder) {
|
|
1518
1541
|
var _a;
|
|
1519
1542
|
this._viewfinder = newViewfinder;
|
|
1520
|
-
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBasicOverlay(JSON.stringify(this.toJSON()));
|
|
1543
|
+
void ((_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateBasicOverlay(JSON.stringify(this.toJSON())));
|
|
1521
1544
|
}
|
|
1522
1545
|
constructor(mode) {
|
|
1523
1546
|
super();
|
|
@@ -1581,16 +1604,11 @@ class LabelCaptureValidationFlowOverlayController extends BaseController {
|
|
|
1581
1604
|
super('LabelCaptureValidationFlowOverlayProxy');
|
|
1582
1605
|
this.isSubscribed = false;
|
|
1583
1606
|
// Arrow function wrapper to avoid .bind(this) and always use current class state
|
|
1584
|
-
this.handleDidCaptureLabelWithFieldsEventWrapper = (ev) =>
|
|
1585
|
-
|
|
1586
|
-
}
|
|
1607
|
+
this.handleDidCaptureLabelWithFieldsEventWrapper = (ev) => {
|
|
1608
|
+
this.handleDidCaptureLabelWithFieldsEvent(ev);
|
|
1609
|
+
};
|
|
1587
1610
|
this.overlay = overlay;
|
|
1588
|
-
this.initialize();
|
|
1589
|
-
}
|
|
1590
|
-
initialize() {
|
|
1591
|
-
if (this.overlay.listener) {
|
|
1592
|
-
this.subscribeLabelCaptureValidationFlowListener();
|
|
1593
|
-
}
|
|
1611
|
+
void this.initialize();
|
|
1594
1612
|
}
|
|
1595
1613
|
updateValidationFlowOverlay() {
|
|
1596
1614
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1598,30 +1616,43 @@ class LabelCaptureValidationFlowOverlayController extends BaseController {
|
|
|
1598
1616
|
});
|
|
1599
1617
|
}
|
|
1600
1618
|
subscribeLabelCaptureValidationFlowListener() {
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1619
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1620
|
+
if (this.isSubscribed) {
|
|
1621
|
+
return;
|
|
1622
|
+
}
|
|
1623
|
+
yield this._proxy.$registerListenerForValidationFlowEvents({ dataCaptureViewId: this.dataCaptureViewId });
|
|
1624
|
+
this._proxy.subscribeForEvents(Object.values(LabelCaptureValidationFlowListenerEvents));
|
|
1625
|
+
this._proxy.eventEmitter.on(LabelCaptureValidationFlowListenerEvents.didCaptureLabelWithFields, this.handleDidCaptureLabelWithFieldsEventWrapper);
|
|
1626
|
+
this.isSubscribed = true;
|
|
1627
|
+
});
|
|
1608
1628
|
}
|
|
1609
1629
|
unsubscribeLabelCaptureValidationFlowListener() {
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1630
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1631
|
+
if (!this.isSubscribed) {
|
|
1632
|
+
return;
|
|
1633
|
+
}
|
|
1634
|
+
yield this._proxy.$unregisterListenerForValidationFlowEvents({ dataCaptureViewId: this.dataCaptureViewId });
|
|
1635
|
+
this._proxy.eventEmitter.off(LabelCaptureValidationFlowListenerEvents.didCaptureLabelWithFields, this.handleDidCaptureLabelWithFieldsEventWrapper);
|
|
1636
|
+
this._proxy.unsubscribeFromEvents(Object.values(LabelCaptureValidationFlowListenerEvents));
|
|
1637
|
+
this.isSubscribed = false;
|
|
1638
|
+
});
|
|
1617
1639
|
}
|
|
1618
|
-
|
|
1640
|
+
dispose() {
|
|
1641
|
+
void this.unsubscribeLabelCaptureValidationFlowListener();
|
|
1642
|
+
this._proxy.dispose();
|
|
1643
|
+
}
|
|
1644
|
+
initialize() {
|
|
1619
1645
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1646
|
+
if (this.overlay.listener) {
|
|
1647
|
+
return this.subscribeLabelCaptureValidationFlowListener();
|
|
1648
|
+
}
|
|
1623
1649
|
});
|
|
1624
1650
|
}
|
|
1651
|
+
handleDidCaptureLabelWithFieldsEvent(ev) {
|
|
1652
|
+
const payload = JSON.parse(ev.data);
|
|
1653
|
+
const fields = payload.fields.map((field) => LabelField.fromJSON(JSON.parse(field)));
|
|
1654
|
+
this.notifyListenersOfDidCaptureLabelWithFields(fields);
|
|
1655
|
+
}
|
|
1625
1656
|
notifyListenersOfDidCaptureLabelWithFields(fields) {
|
|
1626
1657
|
var _a;
|
|
1627
1658
|
(_a = this.overlay.listener) === null || _a === void 0 ? void 0 : _a.didCaptureLabelWithFields(fields);
|
|
@@ -1630,10 +1661,6 @@ class LabelCaptureValidationFlowOverlayController extends BaseController {
|
|
|
1630
1661
|
var _a, _b;
|
|
1631
1662
|
return (_b = (_a = this.overlay.view) === null || _a === void 0 ? void 0 : _a.viewId) !== null && _b !== void 0 ? _b : -1;
|
|
1632
1663
|
}
|
|
1633
|
-
dispose() {
|
|
1634
|
-
this.unsubscribeLabelCaptureValidationFlowListener();
|
|
1635
|
-
this._proxy.dispose();
|
|
1636
|
-
}
|
|
1637
1664
|
}
|
|
1638
1665
|
|
|
1639
1666
|
class LabelCaptureValidationFlowOverlay extends DefaultSerializeable {
|
|
@@ -1651,6 +1678,16 @@ class LabelCaptureValidationFlowOverlay extends DefaultSerializeable {
|
|
|
1651
1678
|
this._view = newView;
|
|
1652
1679
|
(_b = this.controller) !== null && _b !== void 0 ? _b : (this.controller = new LabelCaptureValidationFlowOverlayController(this));
|
|
1653
1680
|
}
|
|
1681
|
+
constructor(mode) {
|
|
1682
|
+
super();
|
|
1683
|
+
this.type = 'validationFlow';
|
|
1684
|
+
this.settings = null;
|
|
1685
|
+
this.hasListener = false;
|
|
1686
|
+
this._listener = null;
|
|
1687
|
+
this.controller = null;
|
|
1688
|
+
this._view = null;
|
|
1689
|
+
this.modeId = mode.modeId;
|
|
1690
|
+
}
|
|
1654
1691
|
get listener() {
|
|
1655
1692
|
return this._listener;
|
|
1656
1693
|
}
|
|
@@ -1659,10 +1696,10 @@ class LabelCaptureValidationFlowOverlay extends DefaultSerializeable {
|
|
|
1659
1696
|
this.hasListener = listener != null;
|
|
1660
1697
|
this._listener = listener;
|
|
1661
1698
|
if (listener == null) {
|
|
1662
|
-
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.unsubscribeLabelCaptureValidationFlowListener();
|
|
1699
|
+
void ((_a = this.controller) === null || _a === void 0 ? void 0 : _a.unsubscribeLabelCaptureValidationFlowListener());
|
|
1663
1700
|
}
|
|
1664
1701
|
else if (this.listener == null) {
|
|
1665
|
-
(_b = this.controller) === null || _b === void 0 ? void 0 : _b.subscribeLabelCaptureValidationFlowListener();
|
|
1702
|
+
void ((_b = this.controller) === null || _b === void 0 ? void 0 : _b.subscribeLabelCaptureValidationFlowListener());
|
|
1666
1703
|
}
|
|
1667
1704
|
}
|
|
1668
1705
|
applySettings(settings) {
|
|
@@ -1670,16 +1707,6 @@ class LabelCaptureValidationFlowOverlay extends DefaultSerializeable {
|
|
|
1670
1707
|
this.settings = settings;
|
|
1671
1708
|
return (_b = (_a = this.controller) === null || _a === void 0 ? void 0 : _a.updateValidationFlowOverlay()) !== null && _b !== void 0 ? _b : Promise.resolve();
|
|
1672
1709
|
}
|
|
1673
|
-
constructor(mode) {
|
|
1674
|
-
super();
|
|
1675
|
-
this.type = 'validationFlow';
|
|
1676
|
-
this.settings = null;
|
|
1677
|
-
this.hasListener = false;
|
|
1678
|
-
this._listener = null;
|
|
1679
|
-
this.controller = null;
|
|
1680
|
-
this._view = null;
|
|
1681
|
-
this.modeId = mode.modeId;
|
|
1682
|
-
}
|
|
1683
1710
|
}
|
|
1684
1711
|
__decorate([
|
|
1685
1712
|
nameForSerialization('hasListener')
|
|
@@ -1764,5 +1791,16 @@ __decorate([
|
|
|
1764
1791
|
nameForSerialization('manualInputButtonText')
|
|
1765
1792
|
], LabelCaptureValidationFlowSettings.prototype, "_manualInputButtonText", void 0);
|
|
1766
1793
|
|
|
1767
|
-
|
|
1794
|
+
const LABEL_PROXY_TYPE_NAMES = [
|
|
1795
|
+
'LabelCaptureProxy',
|
|
1796
|
+
'LabelCaptureBasicOverlayProxy',
|
|
1797
|
+
'LabelCaptureAdvancedOverlayProxy',
|
|
1798
|
+
'LabelCaptureValidationFlowOverlayProxy',
|
|
1799
|
+
];
|
|
1800
|
+
|
|
1801
|
+
function registerLabelProxies(provider) {
|
|
1802
|
+
registerProxies(LABEL_PROXY_TYPE_NAMES, provider);
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
export { BarcodeField, CapturedLabel, CustomBarcode, CustomText, ExpiryDateText, ImeiOneBarcode, ImeiTwoBarcode, LABEL_PROXY_TYPE_NAMES, LabelCapture, LabelCaptureAdvancedOverlay, LabelCaptureAdvancedOverlayController, LabelCaptureAdvancedOverlayListenerEvents, LabelCaptureBasicOverlay, LabelCaptureBasicOverlayController, LabelCaptureBasicOverlayListenerEvents, LabelCaptureController, LabelCaptureFeedback, LabelCaptureListenerEvents, LabelCaptureSession, LabelCaptureSettings, LabelCaptureValidationFlowListenerEvents, LabelCaptureValidationFlowOverlay, LabelCaptureValidationFlowOverlayController, LabelCaptureValidationFlowSettings, LabelDateComponentFormat, LabelDateFormat, LabelDateResult, LabelDefinition, LabelField, LabelFieldDefinition, LabelFieldLocation, LabelFieldLocationType, LabelFieldState, LabelFieldType, PackingDateText, PartNumberBarcode, SerialNumberBarcode, TextField, TotalPriceText, UnitPriceText, WeightText, getLabelCaptureDefaults, loadLabelCaptureDefaults, registerLabelProxies };
|
|
1768
1806
|
//# sourceMappingURL=index.js.map
|