scandit-capacitor-datacapture-barcode 6.28.7 → 6.28.8
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/ScanditCapacitorDatacaptureBarcode.podspec +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/ScanditBarcodeNative.kt +13 -0
- package/android/src/main/java/com/scandit/capacitor/datacapture/barcode/find/BarcodeFindViewHandler.kt +2 -2
- package/dist/barcode.js +6 -0
- package/dist/barcode.js.map +1 -1
- package/dist/dts/definitions.d.ts +1 -0
- package/dist/dts/ts/BarcodeFindView.d.ts +1 -0
- package/dist/dts/ts/Capacitor/BarcodeFindViewProxy.d.ts +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/ios/Plugin/ScanditBarcodeCapture.swift +25 -1
- package/package.json +4 -4
|
@@ -176,6 +176,7 @@ export interface ScanditBarcodeFindNativeInterface {
|
|
|
176
176
|
}): Promise<void>;
|
|
177
177
|
showFindView(): Promise<void>;
|
|
178
178
|
hideFindView(): Promise<void>;
|
|
179
|
+
setFindViewPositionAndSize(data: any): Promise<void>;
|
|
179
180
|
setBarcodeTransformer(): Promise<void>;
|
|
180
181
|
submitBarcodeFindTransformerResult(data: {
|
|
181
182
|
transformedBarcode: string | null;
|
|
@@ -13,6 +13,7 @@ export declare class NativeBarcodeFindViewProxy extends BaseNativeProxy implemen
|
|
|
13
13
|
findNodeHandle(_view?: BarcodeFindView | undefined): number | null;
|
|
14
14
|
createView(_id: number | null, barcodeFindViewJson: string): Promise<void>;
|
|
15
15
|
updateView(barcodeFindViewJson: string): Promise<void>;
|
|
16
|
+
setPositionAndSize(top: number, left: number, width: number, height: number, shouldBeUnderWebView: boolean): Promise<void>;
|
|
16
17
|
subscribeBarcodeFindViewListener(): Promise<void>;
|
|
17
18
|
unsubscribeBarcodeFindViewListener(): Promise<void>;
|
|
18
19
|
private notifyListeners;
|
package/dist/index.js
CHANGED
|
@@ -1665,6 +1665,13 @@ class NativeBarcodeFindViewProxy extends BaseNativeProxy {
|
|
|
1665
1665
|
updateView(barcodeFindViewJson) {
|
|
1666
1666
|
return ScanditBarcodeFindPluginNative.updateFindView(JSON.parse(barcodeFindViewJson));
|
|
1667
1667
|
}
|
|
1668
|
+
setPositionAndSize(top, left, width, height, shouldBeUnderWebView) {
|
|
1669
|
+
return ScanditBarcodeFindPluginNative.setFindViewPositionAndSize({
|
|
1670
|
+
position: { x: left, y: top },
|
|
1671
|
+
size: { width: width, height: height },
|
|
1672
|
+
shouldBeUnderWebView: shouldBeUnderWebView
|
|
1673
|
+
});
|
|
1674
|
+
}
|
|
1668
1675
|
subscribeBarcodeFindViewListener() {
|
|
1669
1676
|
this.subscriptionBarcodeFindViewListener = window.Capacitor.Plugins[Capacitor.pluginName]
|
|
1670
1677
|
.addListener(BarcodeFindViewEvents.onFinishButtonTappedEventName, this.notifyListeners.bind(this));
|
|
@@ -1958,7 +1965,11 @@ class BarcodeFindView {
|
|
|
1958
1965
|
}
|
|
1959
1966
|
set htmlElementState(newState) {
|
|
1960
1967
|
const didChangeShown = this._htmlElementState.isShown !== newState.isShown;
|
|
1968
|
+
const didChangePositionOrSize = this._htmlElementState.didChangeComparedTo(newState);
|
|
1961
1969
|
this._htmlElementState = newState;
|
|
1970
|
+
if (didChangePositionOrSize) {
|
|
1971
|
+
this.updatePositionAndSize();
|
|
1972
|
+
}
|
|
1962
1973
|
if (didChangeShown) {
|
|
1963
1974
|
if (this._htmlElementState.isShown) {
|
|
1964
1975
|
this._show();
|
|
@@ -2139,6 +2150,12 @@ class BarcodeFindView {
|
|
|
2139
2150
|
_hide() {
|
|
2140
2151
|
return this.baseBarcodeFindView.hide();
|
|
2141
2152
|
}
|
|
2153
|
+
updatePositionAndSize() {
|
|
2154
|
+
if (!this.htmlElementState || !this.htmlElementState.isValid) {
|
|
2155
|
+
return;
|
|
2156
|
+
}
|
|
2157
|
+
this.baseBarcodeFindView.setPositionAndSize(this.htmlElementState.position.top, this.htmlElementState.position.left, this.htmlElementState.size.width, this.htmlElementState.size.height, this.htmlElementState.shouldBeUnderContent);
|
|
2158
|
+
}
|
|
2142
2159
|
toJSON() {
|
|
2143
2160
|
return this.baseBarcodeFindView.toJSON();
|
|
2144
2161
|
}
|