react-native-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS
468 lines (455 loc) • 15.8 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ZoomOverlay = exports.ReviewScreenConfiguration = exports.ReviewMorePopupMenu = exports.ReviewBottomBarConfiguration = void 0;
var _Common = require("../../ui_v2/common/Common");
var _ScanbotAlertDialog = require("../../ui_v2/common/ScanbotAlertDialog");
var _UserGuidanceConfiguration = require("../../ui_v2/common/UserGuidanceConfiguration");
var _utils = require("../../utils/utils");
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from rtu-ui-v2/schemas/document/ReviewScreenConfiguration.yaml
/**
Configuration of the bottom bar for the review screen.
*/
class ReviewBottomBarConfiguration extends _utils.PartiallyConstructible {
/**
Configuration of the 'add' button, located in the bottom bar.
*/
addButton = new _Common.BarButtonConfiguration({
title: new _Common.StyledText({
text: '?reviewScreenAddButtonTitle',
color: '?sbColorOnPrimary'
}),
accessibilityDescription: '?accessibilityDescriptionReviewAddButton',
background: new _Common.BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0
}),
icon: new _Common.IconStyle({
color: '?sbColorOnPrimary'
})
});
/**
Configuration of the 'retake' button, located in the bottom bar.
*/
retakeButton = new _Common.BarButtonConfiguration({
title: new _Common.StyledText({
text: '?reviewScreenRetakeButtonTitle',
color: '?sbColorOnPrimary'
}),
accessibilityDescription: '?accessibilityDescriptionReviewRetakeButton',
background: new _Common.BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0
}),
icon: new _Common.IconStyle({
color: '?sbColorOnPrimary'
})
});
/**
Configuration of the 'crop' button, located in the bottom bar.
*/
cropButton = new _Common.BarButtonConfiguration({
title: new _Common.StyledText({
text: '?reviewScreenCropButtonTitle',
color: '?sbColorOnPrimary'
}),
accessibilityDescription: '?accessibilityDescriptionReviewCropButton',
background: new _Common.BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0
}),
icon: new _Common.IconStyle({
color: '?sbColorOnPrimary'
})
});
/**
Configuration of the 'rotate' button, located in the bottom bar.
*/
rotateButton = new _Common.BarButtonConfiguration({
title: new _Common.StyledText({
text: '?reviewScreenRotateButtonTitle',
color: '?sbColorOnPrimary'
}),
accessibilityDescription: '?accessibilityDescriptionReviewRotateButton',
background: new _Common.BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0
}),
icon: new _Common.IconStyle({
color: '?sbColorOnPrimary'
})
});
/**
Configuration of the 'delete' button, located in the bottom bar.
*/
deleteButton = new _Common.BarButtonConfiguration({
title: new _Common.StyledText({
text: '?reviewScreenDeleteButtonTitle',
color: '?sbColorOnPrimary'
}),
accessibilityDescription: '?accessibilityDescriptionReviewDeleteButton',
background: new _Common.BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0
}),
icon: new _Common.IconStyle({
color: '?sbColorOnPrimary'
})
});
/**
Configuration of the 'submit' button, located in the bottom bar.
*/
submitButton = new _Common.ButtonConfiguration({
text: '?reviewScreenSubmitButtonTitle',
accessibilityDescription: '?accessibilityDescriptionReviewSubmitButton',
background: new _Common.BackgroundStyle({
strokeColor: '?sbColorSurface',
fillColor: '?sbColorSurface',
strokeWidth: 0.0
}),
foreground: new _Common.ForegroundStyle({
color: '?sbColorOnSurface'
})
});
/** @param source {@displayType `DeepPartial<ReviewBottomBarConfiguration>`} */
constructor(source = {}) {
super();
if (source.addButton !== undefined) {
this.addButton = new _Common.BarButtonConfiguration(source.addButton);
}
if (source.retakeButton !== undefined) {
this.retakeButton = new _Common.BarButtonConfiguration(source.retakeButton);
}
if (source.cropButton !== undefined) {
this.cropButton = new _Common.BarButtonConfiguration(source.cropButton);
}
if (source.rotateButton !== undefined) {
this.rotateButton = new _Common.BarButtonConfiguration(source.rotateButton);
}
if (source.deleteButton !== undefined) {
this.deleteButton = new _Common.BarButtonConfiguration(source.deleteButton);
}
if (source.submitButton !== undefined) {
this.submitButton = new _Common.ButtonConfiguration(source.submitButton);
}
}
}
/**
Configuration of the 'more' popup menu for the review screen.
*/
exports.ReviewBottomBarConfiguration = ReviewBottomBarConfiguration;
class ReviewMorePopupMenu extends _utils.PartiallyConstructible {
/**
The background color of the popup menu.
Default is "?sbColorSurface"
*/
backgroundColor = '?sbColorSurface';
/**
Configuration of the 'reorder pages' button.
*/
reorderPages = new _Common.PopupMenuItem({
title: new _Common.StyledText({
text: '?reviewScreenReorderPagesButtonTitle',
color: '?sbColorOnSurface'
}),
accessibilityDescription: '?accessibilityDescriptionReviewReorderPagesButton',
icon: new _Common.IconStyle({
color: '?sbColorOnSurface'
})
});
/**
Configuration of the 'delete all' button.
*/
deleteAll = new _Common.PopupMenuItem({
title: new _Common.StyledText({
text: '?reviewScreenDeleteAllButtonTitle',
color: '?sbColorNegative'
}),
accessibilityDescription: '?accessibilityDescriptionReviewDeleteAllButton',
icon: new _Common.IconStyle({
color: '?sbColorNegative'
})
});
/** @param source {@displayType `DeepPartial<ReviewMorePopupMenu>`} */
constructor(source = {}) {
super();
if (source.backgroundColor !== undefined) {
this.backgroundColor = source.backgroundColor;
}
if (source.reorderPages !== undefined) {
this.reorderPages = new _Common.PopupMenuItem(source.reorderPages);
}
if (source.deleteAll !== undefined) {
this.deleteAll = new _Common.PopupMenuItem(source.deleteAll);
}
}
}
/**
Configuration of the zoom overlay for the review screen.
*/
exports.ReviewMorePopupMenu = ReviewMorePopupMenu;
class ZoomOverlay extends _utils.PartiallyConstructible {
/**
The background color of the zoom overlay.
Default is "?sbColorModalOverlay"
*/
overlayColor = '?sbColorModalOverlay';
/**
Configuration of the 'close' button for the zoom overlay.
*/
closeButton = new _Common.ButtonConfiguration({
text: '?zoomOverlayCancelButtonText',
accessibilityDescription: '?accessibilityDescriptionZoomOverlayCancelButton',
background: new _Common.BackgroundStyle({
fillColor: '#00000000',
strokeWidth: 0.0
}),
foreground: new _Common.ForegroundStyle({
color: '?sbColorOnPrimary'
})
});
/** @param source {@displayType `DeepPartial<ZoomOverlay>`} */
constructor(source = {}) {
super();
if (source.overlayColor !== undefined) {
this.overlayColor = source.overlayColor;
}
if (source.closeButton !== undefined) {
this.closeButton = new _Common.ButtonConfiguration(source.closeButton);
}
}
}
/**
Configuration of the screen for reviewing the scanned pages.
*/
exports.ZoomOverlay = ZoomOverlay;
class ReviewScreenConfiguration extends _utils.PartiallyConstructible {
/**
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
*/
enabled = true;
/**
Configuration of the title, located in the top bar.
*/
topBarTitle = new _Common.StyledText({
text: '?reviewScreenTitle',
color: '?sbColorOnPrimary'
});
/**
Configuration of the 'more' button, located in the top bar.
*/
topBarMoreButton = new _Common.IconButton({
color: '?sbColorOnPrimary',
accessibilityDescription: '?accessibilityDescriptionReviewMoreButton'
});
/**
Configuration of the 'back' button, located in the top bar.
*/
topBarBackButton = new _Common.ButtonConfiguration({
visible: true,
text: '?reviewTopBarBackButtonTitle',
accessibilityDescription: '?accessibilityDescriptionReviewTopBarBackButton',
background: new _Common.BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0
}),
foreground: new _Common.ForegroundStyle({
iconVisible: true,
color: '?sbColorOnPrimary',
useShadow: false
})
});
/**
Configuration of the 'more' popup menu for the review screen.
*/
morePopup = new ReviewMorePopupMenu({});
/**
Configuration of the 'zoom' button.
*/
zoomButton = new _Common.RoundButton({
accessibilityDescription: '?accessibilityDescriptionReviewZoomButton',
backgroundColor: '?sbColorSurfaceHigh',
foregroundColor: '?sbColorOnPrimary'
});
/**
Configuration of the zoom overlay for the review screen.
*/
zoomOverlay = new ZoomOverlay({});
/**
The background color of the review screen.
Default is "?sbColorOnSurfaceVariant"
*/
backgroundColor = '?sbColorOnSurfaceVariant';
/**
Configuration of the bottom bar for the review screen.
*/
bottomBar = new ReviewBottomBarConfiguration({});
/**
Configuration of the 'next page' button.
*/
switchNextPageButton = new _Common.IconButton({
color: '?sbColorOnPrimary',
accessibilityDescription: '?accessibilityDescriptionReviewNextPageButton'
});
/**
Configuration of the 'previous page' button.
*/
switchPreviousPageButton = new _Common.IconButton({
color: '?sbColorOnPrimary',
accessibilityDescription: '?accessibilityDescriptionReviewPreviousPageButton'
});
/**
Configuration of the page count label.
*/
pageCounter = new _UserGuidanceConfiguration.UserGuidanceConfiguration({
title: new _Common.StyledText({
text: '?reviewScreenPageCount',
color: '?sbColorOnPrimary'
}),
background: new _Common.BackgroundStyle({
fillColor: '?sbColorSurfaceHigh',
strokeWidth: 0.0
})
});
/**
Configuration of the alert dialog displayed when trying to delete all the pages.
*/
deleteAllPagesAlertDialog = new _ScanbotAlertDialog.ScanbotAlertDialog({
title: new _Common.StyledText({
text: '?reviewDeleteAllPagesAlertTitle',
color: '?sbColorOnSurface'
}),
subtitle: new _Common.StyledText({
text: '?reviewDeleteAllPagesAlertSubtitle',
color: '?sbColorOnSurfaceVariant'
}),
okButton: new _Common.ButtonConfiguration({
text: '?reviewDeleteAllPagesAlertDeleteButtonTitle',
accessibilityDescription: '?accessibilityDescriptionReviewDeleteAllPagesAlertDeleteButton',
background: new _Common.BackgroundStyle({
fillColor: '?sbColorPrimary',
strokeWidth: 0.0
}),
foreground: new _Common.ForegroundStyle({
color: '?sbColorOnPrimary'
})
}),
actionButton: new _Common.ButtonConfiguration({
visible: false
}),
cancelButton: new _Common.ButtonConfiguration({
text: '?reviewDeleteAllPagesAlertCancelButtonTitle',
accessibilityDescription: '?accessibilityDescriptionReviewDeleteAllPagesAlertCancelButton',
background: new _Common.BackgroundStyle({
fillColor: '#00000000',
strokeWidth: 0.0
}),
foreground: new _Common.ForegroundStyle({
color: '?sbColorPrimary'
})
})
});
/**
Configuration of the alert dialog displayed when trying to delete a single page.
*/
deletePageAlertDialog = new _ScanbotAlertDialog.ScanbotAlertDialog({
title: new _Common.StyledText({
text: '?reviewDeletePageAlertTitle',
color: '?sbColorOnSurface'
}),
subtitle: new _Common.StyledText({
text: '?reviewDeletePageAlertSubTitle',
color: '?sbColorOnSurfaceVariant'
}),
okButton: new _Common.ButtonConfiguration({
text: '?reviewDeletePageAlertConfirmButtonTitle',
accessibilityDescription: '?accessibilityDescriptionReviewDeletePageAlertConfirmButton',
background: new _Common.BackgroundStyle({
fillColor: '?sbColorPrimary',
strokeWidth: 0.0
}),
foreground: new _Common.ForegroundStyle({
color: '?sbColorOnPrimary'
})
}),
actionButton: new _Common.ButtonConfiguration({
text: '?reviewDeletePageAlertDeleteRetakeButtonTitle',
accessibilityDescription: '?accessibilityDescriptionReviewDeletePageAlertDeleteRetakeButton',
background: new _Common.BackgroundStyle({
fillColor: '#00000000',
strokeWidth: 0.0
}),
foreground: new _Common.ForegroundStyle({
color: '?sbColorPrimary'
})
}),
cancelButton: new _Common.ButtonConfiguration({
text: '?reviewDeletePageAlertCancelButtonTitle',
accessibilityDescription: '?accessibilityDescriptionReviewDeletePageAlertCancelButton',
background: new _Common.BackgroundStyle({
fillColor: '#00000000',
strokeWidth: 0.0
}),
foreground: new _Common.ForegroundStyle({
color: '?sbColorPrimary'
})
})
});
/** @param source {@displayType `DeepPartial<ReviewScreenConfiguration>`} */
constructor(source = {}) {
super();
if (source.enabled !== undefined) {
this.enabled = source.enabled;
}
if (source.topBarTitle !== undefined) {
this.topBarTitle = new _Common.StyledText(source.topBarTitle);
}
if (source.topBarMoreButton !== undefined) {
this.topBarMoreButton = new _Common.IconButton(source.topBarMoreButton);
}
if (source.topBarBackButton !== undefined) {
this.topBarBackButton = new _Common.ButtonConfiguration(source.topBarBackButton);
}
if (source.morePopup !== undefined) {
this.morePopup = new ReviewMorePopupMenu(source.morePopup);
}
if (source.zoomButton !== undefined) {
this.zoomButton = new _Common.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 _Common.IconButton(source.switchNextPageButton);
}
if (source.switchPreviousPageButton !== undefined) {
this.switchPreviousPageButton = new _Common.IconButton(source.switchPreviousPageButton);
}
if (source.pageCounter !== undefined) {
this.pageCounter = new _UserGuidanceConfiguration.UserGuidanceConfiguration(source.pageCounter);
}
if (source.deleteAllPagesAlertDialog !== undefined) {
this.deleteAllPagesAlertDialog = new _ScanbotAlertDialog.ScanbotAlertDialog(source.deleteAllPagesAlertDialog);
}
if (source.deletePageAlertDialog !== undefined) {
this.deletePageAlertDialog = new _ScanbotAlertDialog.ScanbotAlertDialog(source.deletePageAlertDialog);
}
}
}
exports.ReviewScreenConfiguration = ReviewScreenConfiguration;
//# sourceMappingURL=ReviewScreenConfiguration.js.map