capacitor-plugin-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK for Capacitor
62 lines • 2.18 kB
JavaScript
import { PartiallyConstructible } from '../../utils';
import { BackgroundStyle, ButtonConfiguration, ForegroundStyle, StyledText, } from '../common/Common';
/**
Configuration of the top bar's appearance.
*/
export class TopBarConfiguration extends PartiallyConstructible {
/** @param source {@displayType `DeepPartial<TopBarConfiguration>`} */
constructor(source = {}) {
super();
/**
Appearance of the top bar's title.
*/
this.title = new StyledText({
visible: false,
text: 'Scan Item',
color: '?sbColorOnPrimary',
});
/**
The visual mode used for the top bar.
Default is SOLID
*/
this.mode = 'SOLID';
/**
The visual mode used for the status bar icons.
Default is LIGHT
*/
this.statusBarMode = 'LIGHT';
/**
The background color of the top bar to be used when the visual mode is specified as SOLID. Otherwise ignored.
Default is "?sbColorPrimary"
*/
this.backgroundColor = '?sbColorPrimary';
/**
Configuration of the 'cancel' button's appearance.
*/
this.cancelButton = new ButtonConfiguration({
text: 'Cancel',
background: new BackgroundStyle({
strokeColor: '#00000000',
fillColor: '#00000000',
strokeWidth: 0.0,
}),
foreground: new ForegroundStyle({ color: '?sbColorOnPrimary' }),
});
if (source.title !== undefined) {
this.title = new StyledText(source.title);
}
if (source.mode !== undefined) {
this.mode = source.mode;
}
if (source.statusBarMode !== undefined) {
this.statusBarMode = source.statusBarMode;
}
if (source.backgroundColor !== undefined) {
this.backgroundColor = source.backgroundColor;
}
if (source.cancelButton !== undefined) {
this.cancelButton = new ButtonConfiguration(source.cancelButton);
}
}
}
//# sourceMappingURL=TopBarConfiguration.js.map