UNPKG

react-native-scanbot-sdk

Version:

Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS

186 lines (182 loc) 6.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CroppingScreenConfiguration = exports.CroppingBottomBar = void 0; var _Common = require("../common/Common"); var _utils = require("../../utils"); /** Configuration of the bottom bar for the cropping screen. */ class CroppingBottomBar extends _utils.PartiallyConstructible { /** Configuration of the 'detect document' button, located in the bottom bar. */ detectButton = new _Common.BarButtonConfiguration({ title: new _Common.StyledText({ text: '?croppingDetectButtonTitle', color: '?sbColorOnPrimary' }), accessibilityDescription: '?accessibilityDescriptionCroppingDetectButton', background: new _Common.BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }), icon: new _Common.IconStyle({ color: '?sbColorOnPrimary' }) }); /** Configuration of the 'rotate page' button, located in the bottom bar. */ rotateButton = new _Common.BarButtonConfiguration({ title: new _Common.StyledText({ text: '?croppingRotateButtonTitle', color: '?sbColorOnPrimary' }), accessibilityDescription: '?accessibilityDescriptionCroppingRotateButton', background: new _Common.BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }), icon: new _Common.IconStyle({ color: '?sbColorOnPrimary' }) }); /** Configuration of the 'reset detection' button, located in the bottom bar. */ resetButton = new _Common.BarButtonConfiguration({ title: new _Common.StyledText({ text: '?croppingResetButtonTitle', color: '?sbColorOnPrimary' }), accessibilityDescription: '?accessibilityDescriptionCroppingResetButton', background: new _Common.BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }), icon: new _Common.IconStyle({ color: '?sbColorOnPrimary' }) }); /** @param source {@displayType `DeepPartial<CroppingBottomBar>`} */ constructor(source = {}) { super(); if (source.detectButton !== undefined) { this.detectButton = new _Common.BarButtonConfiguration(source.detectButton); } if (source.rotateButton !== undefined) { this.rotateButton = new _Common.BarButtonConfiguration(source.rotateButton); } if (source.resetButton !== undefined) { this.resetButton = new _Common.BarButtonConfiguration(source.resetButton); } } } /** Configuration of the screen for cropping the scanned pages. */ exports.CroppingBottomBar = CroppingBottomBar; class CroppingScreenConfiguration extends _utils.PartiallyConstructible { /** Configuration of the 'cancel' button, located in the top bar. */ topBarBackButton = new _Common.ButtonConfiguration({ visible: true, text: '?croppingTopBarCancelButtonTitle', accessibilityDescription: '?accessibilityDescriptionCroppingTopBarCancelButton', background: new _Common.BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }), foreground: new _Common.ForegroundStyle({ iconVisible: true, color: '?sbColorOnPrimary', useShadow: false }) }); /** Configuration of the title, located in the top bar. */ topBarTitle = new _Common.StyledText({ text: '?croppingScreenTitle', color: '?sbColorOnPrimary' }); /** Configuration of the 'confirm' button, located in the top bar. */ topBarConfirmButton = new _Common.ButtonConfiguration({ visible: true, text: '?croppingTopBarConfirmButtonTitle', accessibilityDescription: '?accessibilityDescriptionCroppingTopBarConfirmButton', background: new _Common.BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }), foreground: new _Common.ForegroundStyle({ iconVisible: true, color: '?sbColorOnPrimary', useShadow: false }) }); /** The background color of the cropping screen. Default is "?sbColorOutline" */ backgroundColor = '?sbColorOutline'; /** The color of the cropping handles. Default is "?sbColorSurface" */ croppingHandlerColor = '?sbColorSurface'; /** The color of the cropping polygon. Default is "?sbColorSurface" */ croppingPolygonColor = '?sbColorSurface'; /** The color of the magnetic lines on the cropping polygon. Default is "?sbColorSurface" */ croppingPolygonMagneticLineColor = '?sbColorSurface'; /** Configuration of the bottom bar for the cropping screen. */ bottomBar = new CroppingBottomBar({}); /** @param source {@displayType `DeepPartial<CroppingScreenConfiguration>`} */ constructor(source = {}) { super(); if (source.topBarBackButton !== undefined) { this.topBarBackButton = new _Common.ButtonConfiguration(source.topBarBackButton); } if (source.topBarTitle !== undefined) { this.topBarTitle = new _Common.StyledText(source.topBarTitle); } if (source.topBarConfirmButton !== undefined) { this.topBarConfirmButton = new _Common.ButtonConfiguration(source.topBarConfirmButton); } if (source.backgroundColor !== undefined) { this.backgroundColor = source.backgroundColor; } if (source.croppingHandlerColor !== undefined) { this.croppingHandlerColor = source.croppingHandlerColor; } if (source.croppingPolygonColor !== undefined) { this.croppingPolygonColor = source.croppingPolygonColor; } if (source.croppingPolygonMagneticLineColor !== undefined) { this.croppingPolygonMagneticLineColor = source.croppingPolygonMagneticLineColor; } if (source.bottomBar !== undefined) { this.bottomBar = new CroppingBottomBar(source.bottomBar); } } } exports.CroppingScreenConfiguration = CroppingScreenConfiguration; //# sourceMappingURL=CroppingScreenConfiguration.js.map