UNPKG

capacitor-plugin-scanbot-sdk

Version:

Scanbot Document and Barcode Scanner SDK for Capacitor

337 lines (332 loc) 16.5 kB
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten. /// Generated from rtu-ui-v2/schemas/document/ReviewScreenConfiguration.yaml import { BackgroundStyle, BarButtonConfiguration, ButtonConfiguration, ForegroundStyle, IconButton, IconStyle, PopupMenuItem, RoundButton, StyledText, } from '../../ui_v2/common/Common'; import { ScanbotAlertDialog } from '../../ui_v2/common/ScanbotAlertDialog'; import { UserGuidanceConfiguration } from '../../ui_v2/common/UserGuidanceConfiguration'; import { PartiallyConstructible } from '../../utils/utils'; /** Configuration of the bottom bar for the review screen. */ export class ReviewBottomBarConfiguration extends PartiallyConstructible { /** @param source {@displayType `DeepPartial<ReviewBottomBarConfiguration>`} */ constructor(source = {}) { super(); /** Configuration of the 'add' button, located in the bottom bar. */ this.addButton = new BarButtonConfiguration({ title: new StyledText({ text: '?reviewScreenAddButtonTitle', color: '?sbColorOnPrimary' }), accessibilityDescription: '?accessibilityDescriptionReviewAddButton', background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }), icon: new IconStyle({ color: '?sbColorOnPrimary' }), }); /** Configuration of the 'retake' button, located in the bottom bar. */ this.retakeButton = new BarButtonConfiguration({ title: new StyledText({ text: '?reviewScreenRetakeButtonTitle', color: '?sbColorOnPrimary' }), accessibilityDescription: '?accessibilityDescriptionReviewRetakeButton', background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }), icon: new IconStyle({ color: '?sbColorOnPrimary' }), }); /** Configuration of the 'crop' button, located in the bottom bar. */ this.cropButton = new BarButtonConfiguration({ title: new StyledText({ text: '?reviewScreenCropButtonTitle', color: '?sbColorOnPrimary' }), accessibilityDescription: '?accessibilityDescriptionReviewCropButton', background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }), icon: new IconStyle({ color: '?sbColorOnPrimary' }), }); /** Configuration of the 'rotate' button, located in the bottom bar. */ this.rotateButton = new BarButtonConfiguration({ title: new StyledText({ text: '?reviewScreenRotateButtonTitle', color: '?sbColorOnPrimary' }), accessibilityDescription: '?accessibilityDescriptionReviewRotateButton', background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }), icon: new IconStyle({ color: '?sbColorOnPrimary' }), }); /** Configuration of the 'delete' button, located in the bottom bar. */ this.deleteButton = new BarButtonConfiguration({ title: new StyledText({ text: '?reviewScreenDeleteButtonTitle', color: '?sbColorOnPrimary' }), accessibilityDescription: '?accessibilityDescriptionReviewDeleteButton', background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }), icon: new IconStyle({ color: '?sbColorOnPrimary' }), }); /** Configuration of the 'submit' button, located in the bottom bar. */ this.submitButton = new ButtonConfiguration({ text: '?reviewScreenSubmitButtonTitle', accessibilityDescription: '?accessibilityDescriptionReviewSubmitButton', background: new BackgroundStyle({ strokeColor: '?sbColorSurface', fillColor: '?sbColorSurface', strokeWidth: 0.0 }), foreground: new ForegroundStyle({ color: '?sbColorOnSurface' }), }); if (source.addButton !== undefined) { this.addButton = new BarButtonConfiguration(source.addButton); } if (source.retakeButton !== undefined) { this.retakeButton = new BarButtonConfiguration(source.retakeButton); } if (source.cropButton !== undefined) { this.cropButton = new BarButtonConfiguration(source.cropButton); } if (source.rotateButton !== undefined) { this.rotateButton = new BarButtonConfiguration(source.rotateButton); } if (source.deleteButton !== undefined) { this.deleteButton = new BarButtonConfiguration(source.deleteButton); } if (source.submitButton !== undefined) { this.submitButton = new ButtonConfiguration(source.submitButton); } } } /** Configuration of the 'more' popup menu for the review screen. */ export class ReviewMorePopupMenu extends PartiallyConstructible { /** @param source {@displayType `DeepPartial<ReviewMorePopupMenu>`} */ constructor(source = {}) { super(); /** The background color of the popup menu. Default is "?sbColorSurface" */ this.backgroundColor = '?sbColorSurface'; /** Configuration of the 'reorder pages' button. */ this.reorderPages = new PopupMenuItem({ title: new StyledText({ text: '?reviewScreenReorderPagesButtonTitle', color: '?sbColorOnSurface' }), accessibilityDescription: '?accessibilityDescriptionReviewReorderPagesButton', icon: new IconStyle({ color: '?sbColorOnSurface' }), }); /** Configuration of the 'delete all' button. */ this.deleteAll = new PopupMenuItem({ title: new StyledText({ text: '?reviewScreenDeleteAllButtonTitle', color: '?sbColorNegative' }), accessibilityDescription: '?accessibilityDescriptionReviewDeleteAllButton', icon: new IconStyle({ color: '?sbColorNegative' }), }); if (source.backgroundColor !== undefined) { this.backgroundColor = source.backgroundColor; } if (source.reorderPages !== undefined) { this.reorderPages = new PopupMenuItem(source.reorderPages); } if (source.deleteAll !== undefined) { this.deleteAll = new PopupMenuItem(source.deleteAll); } } } /** Configuration of the zoom overlay for the review screen. */ export class ZoomOverlay extends PartiallyConstructible { /** @param source {@displayType `DeepPartial<ZoomOverlay>`} */ constructor(source = {}) { super(); /** The background color of the zoom overlay. Default is "?sbColorModalOverlay" */ this.overlayColor = '?sbColorModalOverlay'; /** Configuration of the 'close' button for the zoom overlay. */ this.closeButton = new ButtonConfiguration({ text: '?zoomOverlayCancelButtonText', accessibilityDescription: '?accessibilityDescriptionZoomOverlayCancelButton', background: new BackgroundStyle({ fillColor: '#00000000', strokeWidth: 0.0 }), foreground: new ForegroundStyle({ color: '?sbColorOnPrimary' }), }); if (source.overlayColor !== undefined) { this.overlayColor = source.overlayColor; } if (source.closeButton !== undefined) { this.closeButton = new ButtonConfiguration(source.closeButton); } } } /** Configuration of the screen for reviewing the scanned pages. */ export class ReviewScreenConfiguration extends PartiallyConstructible { /** @param source {@displayType `DeepPartial<ReviewScreenConfiguration>`} */ constructor(source = {}) { super(); /** Determines whether the review screen should be shown or not. If 'false', the review screen will be skipped and the scanned document will be returned immediately. Default is true */ this.enabled = true; /** If set to true, the review screen, after adding a page, will automatically scroll to the last page. Otherwise the review screen will scroll to the first page. Default is false */ this.showLastPageWhenAdding = false; /** Configuration of the title, located in the top bar. */ this.topBarTitle = new StyledText({ text: '?reviewScreenTitle', color: '?sbColorOnPrimary' }); /** Configuration of the 'more' button, located in the top bar. */ this.topBarMoreButton = new IconButton({ color: '?sbColorOnPrimary', accessibilityDescription: '?accessibilityDescriptionReviewMoreButton', }); /** Configuration of the 'back' button, located in the top bar. */ this.topBarBackButton = new ButtonConfiguration({ visible: true, text: '?reviewTopBarBackButtonTitle', accessibilityDescription: '?accessibilityDescriptionReviewTopBarBackButton', background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 0.0 }), foreground: new ForegroundStyle({ iconVisible: true, color: '?sbColorOnPrimary', useShadow: false }), }); /** Configuration of the 'more' popup menu for the review screen. */ this.morePopup = new ReviewMorePopupMenu({}); /** Configuration of the 'zoom' button. */ this.zoomButton = new RoundButton({ accessibilityDescription: '?accessibilityDescriptionReviewZoomButton', backgroundColor: '?sbColorSurfaceHigh', foregroundColor: '?sbColorOnPrimary', }); /** Configuration of the zoom overlay for the review screen. */ this.zoomOverlay = new ZoomOverlay({}); /** The background color of the review screen. Default is "?sbColorOnSurfaceVariant" */ this.backgroundColor = '?sbColorOnSurfaceVariant'; /** Configuration of the bottom bar for the review screen. */ this.bottomBar = new ReviewBottomBarConfiguration({}); /** Configuration of the 'next page' button. */ this.switchNextPageButton = new IconButton({ color: '?sbColorOnPrimary', accessibilityDescription: '?accessibilityDescriptionReviewNextPageButton', }); /** Configuration of the 'previous page' button. */ this.switchPreviousPageButton = new IconButton({ color: '?sbColorOnPrimary', accessibilityDescription: '?accessibilityDescriptionReviewPreviousPageButton', }); /** Configuration of the page count label. */ this.pageCounter = new UserGuidanceConfiguration({ title: new StyledText({ text: '?reviewScreenPageCount', color: '?sbColorOnPrimary' }), background: new BackgroundStyle({ fillColor: '?sbColorSurfaceHigh', strokeWidth: 0.0 }), }); /** Configuration of the alert dialog displayed when trying to delete all the pages. */ this.deleteAllPagesAlertDialog = new ScanbotAlertDialog({ title: new StyledText({ text: '?reviewDeleteAllPagesAlertTitle', color: '?sbColorOnSurface' }), subtitle: new StyledText({ text: '?reviewDeleteAllPagesAlertSubtitle', color: '?sbColorOnSurfaceVariant' }), okButton: new ButtonConfiguration({ text: '?reviewDeleteAllPagesAlertDeleteButtonTitle', accessibilityDescription: '?accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton', background: new BackgroundStyle({ fillColor: '?sbColorPrimary', strokeWidth: 0.0 }), foreground: new ForegroundStyle({ color: '?sbColorOnPrimary' }), }), actionButton: new ButtonConfiguration({ visible: false }), cancelButton: new ButtonConfiguration({ text: '?reviewDeleteAllPagesAlertCancelButtonTitle', accessibilityDescription: '?accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton', background: new BackgroundStyle({ fillColor: '#00000000', strokeWidth: 0.0 }), foreground: new ForegroundStyle({ color: '?sbColorPrimary' }), }), }); /** Configuration of the alert dialog displayed when trying to delete a single page. */ this.deletePageAlertDialog = new ScanbotAlertDialog({ title: new StyledText({ text: '?reviewDeletePageAlertTitle', color: '?sbColorOnSurface' }), subtitle: new StyledText({ text: '?reviewDeletePageAlertSubTitle', color: '?sbColorOnSurfaceVariant' }), okButton: new ButtonConfiguration({ text: '?reviewDeletePageAlertConfirmButtonTitle', accessibilityDescription: '?accessibilityDescriptionReviewDeletePageAlertConfirmButton', background: new BackgroundStyle({ fillColor: '?sbColorPrimary', strokeWidth: 0.0 }), foreground: new ForegroundStyle({ color: '?sbColorOnPrimary' }), }), actionButton: new ButtonConfiguration({ text: '?reviewDeletePageAlertDeleteRetakeButtonTitle', accessibilityDescription: '?accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton', background: new BackgroundStyle({ fillColor: '#00000000', strokeWidth: 0.0 }), foreground: new ForegroundStyle({ color: '?sbColorPrimary' }), }), cancelButton: new ButtonConfiguration({ text: '?reviewDeletePageAlertCancelButtonTitle', accessibilityDescription: '?accessibilityDescriptionReviewDeletePageAlertCancelButton', background: new BackgroundStyle({ fillColor: '#00000000', strokeWidth: 0.0 }), foreground: new ForegroundStyle({ color: '?sbColorPrimary' }), }), }); if (source.enabled !== undefined) { this.enabled = source.enabled; } if (source.showLastPageWhenAdding !== undefined) { this.showLastPageWhenAdding = source.showLastPageWhenAdding; } if (source.topBarTitle !== undefined) { this.topBarTitle = new StyledText(source.topBarTitle); } if (source.topBarMoreButton !== undefined) { this.topBarMoreButton = new IconButton(source.topBarMoreButton); } if (source.topBarBackButton !== undefined) { this.topBarBackButton = new ButtonConfiguration(source.topBarBackButton); } if (source.morePopup !== undefined) { this.morePopup = new ReviewMorePopupMenu(source.morePopup); } if (source.zoomButton !== undefined) { this.zoomButton = new RoundButton(source.zoomButton); } if (source.zoomOverlay !== undefined) { this.zoomOverlay = new ZoomOverlay(source.zoomOverlay); } if (source.backgroundColor !== undefined) { this.backgroundColor = source.backgroundColor; } if (source.bottomBar !== undefined) { this.bottomBar = new ReviewBottomBarConfiguration(source.bottomBar); } if (source.switchNextPageButton !== undefined) { this.switchNextPageButton = new IconButton(source.switchNextPageButton); } if (source.switchPreviousPageButton !== undefined) { this.switchPreviousPageButton = new IconButton(source.switchPreviousPageButton); } if (source.pageCounter !== undefined) { this.pageCounter = new UserGuidanceConfiguration(source.pageCounter); } if (source.deleteAllPagesAlertDialog !== undefined) { this.deleteAllPagesAlertDialog = new ScanbotAlertDialog(source.deleteAllPagesAlertDialog); } if (source.deletePageAlertDialog !== undefined) { this.deletePageAlertDialog = new ScanbotAlertDialog(source.deletePageAlertDialog); } } } //# sourceMappingURL=ReviewScreenConfiguration.js.map