in source/community/reactnative/src/utils/host-config.js [478:528]
constructor(obj) {
if (obj) {
if (typeof obj === "string" || obj instanceof String) {
obj = JSON.parse(obj);
}
this.choiceSetInputValueSeparator = (obj && typeof obj["choiceSetInputValueSeparator"] === "string") ? obj["choiceSetInputValueSeparator"] : this.choiceSetInputValueSeparator;
this.supportsInteractivity = (obj && typeof obj["supportsInteractivity"] === "boolean") ? obj["supportsInteractivity"] : this.supportsInteractivity;
if (obj.lineHeights) {
this.lineHeights = {
small: obj.lineHeights["small"],
default: obj.lineHeights["default"],
medium: obj.lineHeights["medium"],
large: obj.lineHeights["large"],
extraLarge: obj.lineHeights["extraLarge"]
};
};
this.imageSizes = {
small: obj.imageSizes && obj.imageSizes["small"] || this.imageSizes.small,
medium: obj.imageSizes && obj.imageSizes["medium"] || this.imageSizes.medium,
large: obj.imageSizes && obj.imageSizes["large"] || this.imageSizes.large,
};
this.containerStyles = new ContainerStyleSet(obj["containerStyles"]);
if (obj.spacing) {
this.spacing = {
none: Utils.isaNumber(obj.spacing["none"]) ? obj.spacing["none"] : this.spacing.none,
small: Utils.isaNumber(obj.spacing["small"]) ? obj.spacing["small"] : this.spacing.small,
default: Utils.isaNumber(obj.spacing["default"]) ? obj.spacing["default"] : this.spacing.default,
medium: Utils.isaNumber(obj.spacing["medium"]) ? obj.spacing["medium"] : this.spacing.medium,
large: Utils.isaNumber(obj.spacing["large"]) ? obj.spacing["large"] : this.spacing.large,
extraLarge: Utils.isaNumber(obj.spacing["extraLarge"]) ? obj.spacing["extraLarge"] : this.spacing.extraLarge,
padding: Utils.isaNumber(obj.spacing["padding"]) ? obj.spacing["padding"] : this.spacing.padding
};
}
this.separator = {
lineThickness: obj.separator && obj.separator["lineThickness"] || this.separator.lineThickness,
lineColor: obj.separator && obj.separator["lineColor"] || this.separator.lineColor
}
this.actions = new ActionsConfig(obj.actions || this.actions);
this.adaptiveCard = new AdaptiveCardConfig(obj.adaptiveCard || this.adaptiveCard);
this.richTextBlock = new RichTextBlockConfig(obj["richTextBlock"]);
this.imageSet = new ImageSetConfig(obj["imageSet"]);
this.factSet = new FactSetConfig(obj["factSet"]);
this.fontStyles = new FontStyleConfig(obj);
this.hostCapabilities = new HostCapabilities(obj.hostCapabilities)
}
}