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.
@@ -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;
@@ -59,5 +59,6 @@ export declare class BarcodeFindView {
59
59
  private elementDidChange;
60
60
  private _show;
61
61
  private _hide;
62
+ private updatePositionAndSize;
62
63
  private toJSON;
63
64
  }
@@ -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
  }