capacitor-plugin-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK for Capacitor
582 lines (564 loc) • 24.9 kB
JavaScript
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from rtu-ui-v2/schemas/barcode/MultipleScanningModeUseCase.yaml
import { ArOverlayGeneralConfiguration, ArOverlayPolygonConfiguration, BarcodeItemConfiguration, } from '../../ui_v2/barcode/ArTrackingOverlayConfiguration';
import { BarcodeInfoMapping, BarcodeItemErrorState } from '../../ui_v2/barcode/BarcodeInfoMapping';
import { BackgroundStyle, BadgeStyle, BadgedButton, ButtonConfiguration, ForegroundStyle, IconStyle, PolygonStyle, StyledText, } from '../../ui_v2/common/Common';
import { PartiallyConstructible } from '../../utils/utils';
export const MultipleBarcodesScanningModeValues = ['COUNTING', 'UNIQUE'];
export const SheetModeValues = ['BUTTON', 'COLLAPSED_SHEET'];
export const CollapsedVisibleHeightValues = ['SMALL', 'LARGE'];
/**
Configuration of the preview mode for scanning multiple barcodes.
*/
export class Sheet extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<Sheet>`} */
constructor(source = {}) {
super();
/**
Mode used for the preview for scanning multiple barcodes.
Default is COLLAPSED_SHEET
*/
this.mode = 'COLLAPSED_SHEET';
/**
Height of the collapsed result sheet.
Default is SMALL
*/
this.collapsedVisibleHeight = 'SMALL';
/**
Configuration of the list button.
*/
this.listButton = new BadgedButton({});
if (source.mode !== undefined) {
this.mode = source.mode;
}
if (source.collapsedVisibleHeight !== undefined) {
this.collapsedVisibleHeight = source.collapsedVisibleHeight;
}
if (source.listButton !== undefined) {
this.listButton = new BadgedButton(source.listButton);
}
}
}
/**
Configuration of the swipe-to-delete button.
*/
export class SwipeToDelete extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<SwipeToDelete>`} */
constructor(source = {}) {
super();
/**
Whether swipe to delete is enabled or not.
Default is true
*/
this.enabled = true;
/**
Color of the swipe-to-delete button.
Default is "?sbColorNegative"
*/
this.backgroundColor = '?sbColorNegative';
/**
Color of the icon on the swipe-to-delete button.
Default is "?sbColorOnPrimary"
*/
this.iconColor = '?sbColorOnPrimary';
if (source.enabled !== undefined) {
this.enabled = source.enabled;
}
if (source.backgroundColor !== undefined) {
this.backgroundColor = source.backgroundColor;
}
if (source.iconColor !== undefined) {
this.iconColor = source.iconColor;
}
}
}
/**
Configuration of the dialog to manually edit the barcode count.
*/
export class ManualCountEditDialog extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<ManualCountEditDialog>`} */
constructor(source = {}) {
super();
/**
Color of the edit dialog's background.
Default is "?sbColorSurface"
*/
this.sheetColor = '?sbColorSurface';
/**
Color of the divider and separator lines in the edit dialog.
Default is "?sbColorOutline"
*/
this.dividerColor = '?sbColorOutline';
/**
Background color of the overlay surrounding the edit dialog.
Default is "?sbColorModalOverlay"
*/
this.modalOverlayColor = '?sbColorModalOverlay';
/**
Configuration of the edit dialog's title.
*/
this.title = new StyledText({ text: 'Update count', color: '?sbColorOnSurface' });
/**
Configuration of the edit dialog's info text.
*/
this.info = new StyledText({
text: 'Adjust the number of items you scanned.',
color: '?sbColorOnSurfaceVariant',
});
/**
Configuration of the edit dialog's confirm button. Hiding both the update and cancel buttons simultaneously is an undefined behavior.
*/
this.updateButton = new ButtonConfiguration({
visible: true,
text: 'Update',
background: new BackgroundStyle({ strokeColor: '?sbColorPrimary', fillColor: '?sbColorPrimary', strokeWidth: 1.0 }),
foreground: new ForegroundStyle({ iconVisible: false, color: '?sbColorOnPrimary', useShadow: false }),
});
/**
Configuration of the edit dialog's cancel button. Hiding both the update and cancel buttons simultaneously is an undefined behavior.
*/
this.cancelButton = new ButtonConfiguration({
visible: true,
text: 'Cancel',
background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 1.0 }),
foreground: new ForegroundStyle({ iconVisible: false, color: '?sbColorPrimary', useShadow: false }),
});
/**
Configuration of the edit dialog's button to clear the entered count number.
*/
this.clearTextButton = new IconStyle({ visible: true, color: '?sbColorOnSurfaceVariant' });
if (source.sheetColor !== undefined) {
this.sheetColor = source.sheetColor;
}
if (source.dividerColor !== undefined) {
this.dividerColor = source.dividerColor;
}
if (source.modalOverlayColor !== undefined) {
this.modalOverlayColor = source.modalOverlayColor;
}
if (source.title !== undefined) {
this.title = new StyledText(source.title);
}
if (source.info !== undefined) {
this.info = new StyledText(source.info);
}
if (source.updateButton !== undefined) {
this.updateButton = new ButtonConfiguration(source.updateButton);
}
if (source.cancelButton !== undefined) {
this.cancelButton = new ButtonConfiguration(source.cancelButton);
}
if (source.clearTextButton !== undefined) {
this.clearTextButton = new IconStyle(source.clearTextButton);
}
}
}
/**
Configuration of the list containing the barcodes that have already been scanned.
*/
export class SheetContent extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<SheetContent>`} */
constructor(source = {}) {
super();
/**
Color of the list's background.
Default is "?sbColorSurface"
*/
this.sheetColor = '?sbColorSurface';
/**
The color of the dividers in the list sheet.
Default is "?sbColorOutline"
*/
this.dividerColor = '?sbColorOutline';
/**
Enables the user to change the number of scanned items by pressing +,-, or changing the number using a keyboard.
Default is true
*/
this.manualCountChangeEnabled = true;
/**
The color of the outline of the manual counting buttons in the list sheet.
Default is "?sbColorOutline"
*/
this.manualCountOutlineColor = '?sbColorOutline';
/**
Color of the buttons for manually changing the barcode count.
Default is "?sbColorPrimary"
*/
this.manualCountChangeColor = '?sbColorPrimary';
/**
Configuration of the barcode list's title. By default displays the total number of scanned barcodes.
*/
this.title = new StyledText({ text: '%d items', color: '?sbColorOnSurface' });
/**
Configuration of the button for clearing the barcode list.
*/
this.clearAllButton = new ButtonConfiguration({
visible: true,
text: 'Clear all',
background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 1.0 }),
foreground: new ForegroundStyle({ iconVisible: false, color: '?sbColorOnSurface', useShadow: false }),
});
/**
Configuration of the title of a barcode list entry (displaying the barcode's value).
*/
this.barcodeItemTitle = new StyledText({
visible: true,
text: 'BARCODE_TITLE',
color: '?sbColorOnSurface',
useShadow: false,
});
/**
Configuration of the subtitle of a barcode list entry (displaying the barcode's symbology).
*/
this.barcodeItemSubtitle = new StyledText({
text: 'BARCODE_SUBTITLE',
color: '?sbColorOnSurfaceVariant',
});
/**
Visibility of the barcode image in a barcode list entry.
Default is true
*/
this.barcodeItemImageVisible = true;
/**
Configuration of the barcode list's submit button.
*/
this.submitButton = new ButtonConfiguration({
visible: true,
text: 'Submit',
background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 1.0 }),
foreground: new ForegroundStyle({ iconVisible: false, color: '?sbColorOnSurface', useShadow: false }),
});
/**
Configuration of the button to start scanning displayed in an empty barcode list.
*/
this.startScanningButton = new ButtonConfiguration({
visible: true,
text: 'Start scanning',
background: new BackgroundStyle({ strokeColor: '?sbColorPrimary', fillColor: '?sbColorPrimary', strokeWidth: 1.0 }),
foreground: new ForegroundStyle({ iconVisible: true, color: '?sbColorOnPrimary', useShadow: false }),
});
/**
Configuration of the title displayed in an empty barcode list.
*/
this.placeholderTitle = new StyledText({ text: 'No barcodes here!', color: '?sbColorOnSurface' });
/**
Configuration of the subtitle displayed in an empty barcode list.
*/
this.placeholderSubtitle = new StyledText({
text: 'The barcode list is currently empty. Close this sheet and scan your items to add them.',
color: '?sbColorOnSurfaceVariant',
});
/**
Background color of the icon displayed in an empty barcode list.
Default is "?sbColorOutline"
*/
this.placeholderIconBackground = '?sbColorOutline';
/**
Configuration of the icon displayed in an empty barcode list.
*/
this.placeholderIcon = new IconStyle({ visible: true, color: '?sbColorOnSurface' });
/**
The style of the swipe-to-delete button.
*/
this.swipeToDelete = new SwipeToDelete({
enabled: true,
backgroundColor: '?sbColorNegative',
iconColor: '?sbColorOnPrimary',
});
if (source.sheetColor !== undefined) {
this.sheetColor = source.sheetColor;
}
if (source.dividerColor !== undefined) {
this.dividerColor = source.dividerColor;
}
if (source.manualCountChangeEnabled !== undefined) {
this.manualCountChangeEnabled = source.manualCountChangeEnabled;
}
if (source.manualCountOutlineColor !== undefined) {
this.manualCountOutlineColor = source.manualCountOutlineColor;
}
if (source.manualCountChangeColor !== undefined) {
this.manualCountChangeColor = source.manualCountChangeColor;
}
if (source.title !== undefined) {
this.title = new StyledText(source.title);
}
if (source.clearAllButton !== undefined) {
this.clearAllButton = new ButtonConfiguration(source.clearAllButton);
}
if (source.barcodeItemTitle !== undefined) {
this.barcodeItemTitle = new StyledText(source.barcodeItemTitle);
}
if (source.barcodeItemSubtitle !== undefined) {
this.barcodeItemSubtitle = new StyledText(source.barcodeItemSubtitle);
}
if (source.barcodeItemImageVisible !== undefined) {
this.barcodeItemImageVisible = source.barcodeItemImageVisible;
}
if (source.submitButton !== undefined) {
this.submitButton = new ButtonConfiguration(source.submitButton);
}
if (source.startScanningButton !== undefined) {
this.startScanningButton = new ButtonConfiguration(source.startScanningButton);
}
if (source.placeholderTitle !== undefined) {
this.placeholderTitle = new StyledText(source.placeholderTitle);
}
if (source.placeholderSubtitle !== undefined) {
this.placeholderSubtitle = new StyledText(source.placeholderSubtitle);
}
if (source.placeholderIconBackground !== undefined) {
this.placeholderIconBackground = source.placeholderIconBackground;
}
if (source.placeholderIcon !== undefined) {
this.placeholderIcon = new IconStyle(source.placeholderIcon);
}
if (source.swipeToDelete !== undefined) {
this.swipeToDelete = new SwipeToDelete(source.swipeToDelete);
}
}
}
/**
Configuration of the mode for scanning multiple barcodes.
*/
export class MultipleScanningMode extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<MultipleScanningMode>`} */
constructor(source = {}) {
super();
this._type = 'MultipleScanningMode';
/**
Time interval in milliseconds before a barcode is counted again. 0 = no delay. The default value is 1000.
Default is 1000
*/
this.countingRepeatDelay = 1000;
/**
Whether the user can submit an empty barcode list.
Default is false
*/
this.allowEmptySubmission = false;
/**
Mode used for scanning multiple barcodes.
Default is COUNTING
*/
this.mode = 'COUNTING';
/**
Configuration of the preview mode for scanning multiple barcodes.
*/
this.sheet = new Sheet({
mode: 'COLLAPSED_SHEET',
collapsedVisibleHeight: 'SMALL',
listButton: new BadgedButton({
badgeBackgroundColor: '?sbColorSurface',
badgeForegroundColor: '?sbColorPrimary',
visible: true,
backgroundColor: '?sbColorSurfaceHigh',
foregroundColor: '?sbColorOnPrimary',
activeBackgroundColor: '?sbColorSurfaceHigh',
activeForegroundColor: '?sbColorOnPrimary',
}),
});
/**
Configuration of the list containing the barcodes that have already been scanned.
*/
this.sheetContent = new SheetContent({
sheetColor: '?sbColorSurface',
dividerColor: '?sbColorOutline',
manualCountChangeEnabled: true,
manualCountOutlineColor: '?sbColorOutline',
manualCountChangeColor: '?sbColorPrimary',
title: new StyledText({ text: '?multipleModeSheetTitle', color: '?sbColorOnSurface' }),
clearAllButton: new ButtonConfiguration({
visible: true,
text: '?sheetClearAllButton',
background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 1.0 }),
foreground: new ForegroundStyle({ iconVisible: false, color: '?sbColorOnSurface', useShadow: false }),
}),
barcodeItemTitle: new StyledText({
visible: true,
text: 'BARCODE_TITLE',
color: '?sbColorOnSurface',
useShadow: false,
}),
barcodeItemSubtitle: new StyledText({
visible: true,
text: 'BARCODE_SUBTITLE',
color: '?sbColorOnSurfaceVariant',
useShadow: false,
}),
barcodeItemImageVisible: true,
submitButton: new ButtonConfiguration({
visible: true,
text: '?sheetSubmitButton',
background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 1.0 }),
foreground: new ForegroundStyle({ iconVisible: false, color: '?sbColorOnSurface', useShadow: false }),
}),
startScanningButton: new ButtonConfiguration({
visible: true,
text: '?sheetStartScanningButton',
background: new BackgroundStyle({
strokeColor: '?sbColorPrimary',
fillColor: '?sbColorPrimary',
strokeWidth: 1.0,
}),
foreground: new ForegroundStyle({ iconVisible: false, color: '?sbColorOnPrimary', useShadow: false }),
}),
placeholderTitle: new StyledText({
visible: true,
text: '?sheetPlaceholderTitle',
color: '?sbColorOnSurface',
useShadow: false,
}),
placeholderSubtitle: new StyledText({
visible: true,
text: '?sheetPlaceholderSubtitle',
color: '?sbColorOnSurfaceVariant',
useShadow: false,
}),
placeholderIconBackground: '?sbColorOutline',
placeholderIcon: new IconStyle({ visible: true, color: '?sbColorOnSurface' }),
swipeToDelete: new SwipeToDelete({
enabled: true,
backgroundColor: '?sbColorNegative',
iconColor: '?sbColorOnPrimary',
}),
});
/**
Configuration of the dialog to manually edit the barcode count.
*/
this.manualCountEditDialog = new ManualCountEditDialog({
sheetColor: '?sbColorSurface',
dividerColor: '?sbColorOutline',
modalOverlayColor: '?sbColorModalOverlay',
title: new StyledText({ text: '?manualCountEditDialogTitle', color: '?sbColorOnSurface' }),
info: new StyledText({ text: '?manualCountEditDialogInfo', color: '?sbColorOnSurfaceVariant' }),
updateButton: new ButtonConfiguration({
visible: true,
text: '?manualCountEditDialogUpdateButton',
background: new BackgroundStyle({
strokeColor: '?sbColorPrimary',
fillColor: '?sbColorPrimary',
strokeWidth: 1.0,
}),
foreground: new ForegroundStyle({ iconVisible: false, color: '?sbColorOnPrimary', useShadow: false }),
}),
cancelButton: new ButtonConfiguration({
visible: true,
text: '?manualCountEditDialogCancelButton',
background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 1.0 }),
foreground: new ForegroundStyle({ iconVisible: false, color: '?sbColorPrimary', useShadow: false }),
}),
clearTextButton: new IconStyle({ visible: true, color: '?sbColorOnSurfaceVariant' }),
});
/**
Appearance of the barcode info mapping.
*/
this.barcodeInfoMapping = new BarcodeInfoMapping({
sheetColor: '?sbColorSurface',
dividerColor: '?sbColorOutline',
modalOverlayColor: '?sbColorModalOverlay',
loadingMessage: new StyledText({ text: '?barcodeInfoMappingLoadingMessage', color: '?sbColorPrimary' }),
errorState: new BarcodeItemErrorState({
title: new StyledText({ text: '?barcodeInfoMappingErrorStateTitle', color: '?sbColorOnSurface' }),
subtitle: new StyledText({ text: '?barcodeInfoMappingErrorStateSubtitle', color: '?sbColorOnSurfaceVariant' }),
retryButton: new ButtonConfiguration({
visible: true,
text: '?barcodeInfoMappingErrorStateRetryButton',
background: new BackgroundStyle({
strokeColor: '?sbColorPrimary',
fillColor: '?sbColorPrimary',
strokeWidth: 1.0,
}),
foreground: new ForegroundStyle({ iconVisible: true, color: '?sbColorOnPrimary', useShadow: false }),
}),
cancelButton: new ButtonConfiguration({
visible: true,
text: '?barcodeInfoMappingErrorStateCancelButton',
background: new BackgroundStyle({ strokeColor: '#00000000', fillColor: '#00000000', strokeWidth: 1.0 }),
foreground: new ForegroundStyle({ iconVisible: false, color: '?sbColorPrimary', useShadow: false }),
}),
}),
});
/**
Configuration of the AR overlay.
*/
this.arOverlay = new ArOverlayGeneralConfiguration({
visible: false,
counterBadge: new BadgeStyle({
visible: true,
background: new BackgroundStyle({ strokeColor: '#FF000000', fillColor: '?sbColorPositive', strokeWidth: 0.0 }),
foregroundColor: '?sbColorOnSurface',
}),
automaticSelectionEnabled: false,
barcodeItemInfoPosition: 'BELOW',
polygon: new ArOverlayPolygonConfiguration({
visible: true,
deselected: new PolygonStyle({
strokeColor: '?sbColorSurface',
fillColor: '#00000000',
strokeWidth: 3.0,
cornerRadius: 5.0,
}),
selected: new PolygonStyle({
strokeColor: '?sbColorPositive',
fillColor: '#00000000',
strokeWidth: 3.0,
cornerRadius: 5.0,
}),
}),
barcodeItemConfiguration: new BarcodeItemConfiguration({
imageVisible: true,
titleSelected: new StyledText({ text: 'BARCODE_TITLE', color: '?sbColorOnSurface' }),
subtitleSelected: new StyledText({
visible: true,
text: 'BARCODE_SUBTITLE',
color: '?sbColorOnSurfaceVariant',
useShadow: false,
}),
titleDeselected: new StyledText({
visible: true,
text: 'BARCODE_TITLE',
color: '?sbColorOnSurface',
useShadow: false,
}),
subtitleDeselected: new StyledText({ text: 'BARCODE_SUBTITLE', color: '?sbColorOnSurfaceVariant' }),
backgroundSelected: new PolygonStyle({
strokeColor: '?sbColorPositive',
fillColor: '?sbColorPositive',
strokeWidth: 1.0,
cornerRadius: 5.0,
}),
backgroundDeselected: new PolygonStyle({
strokeColor: '?sbColorSurface',
fillColor: '?sbColorSurface',
strokeWidth: 1.0,
cornerRadius: 5.0,
}),
}),
});
if (source.countingRepeatDelay !== undefined) {
this.countingRepeatDelay = source.countingRepeatDelay;
}
if (source.allowEmptySubmission !== undefined) {
this.allowEmptySubmission = source.allowEmptySubmission;
}
if (source.mode !== undefined) {
this.mode = source.mode;
}
if (source.sheet !== undefined) {
this.sheet = new Sheet(source.sheet);
}
if (source.sheetContent !== undefined) {
this.sheetContent = new SheetContent(source.sheetContent);
}
if (source.manualCountEditDialog !== undefined) {
this.manualCountEditDialog = new ManualCountEditDialog(source.manualCountEditDialog);
}
if (source.barcodeInfoMapping !== undefined) {
this.barcodeInfoMapping = new BarcodeInfoMapping(source.barcodeInfoMapping);
}
if (source.arOverlay !== undefined) {
this.arOverlay = new ArOverlayGeneralConfiguration(source.arOverlay);
}
}
}
//# sourceMappingURL=MultipleScanningModeUseCase.js.map