@paperbits/core
Advanced tools
Comparing version 0.1.49 to 0.1.50
@@ -9,3 +9,3 @@ import { WidgetModel } from "@paperbits/common/widgets"; | ||
public overflowY: string; | ||
public styles: Object; | ||
public styles: any; | ||
@@ -15,4 +15,4 @@ constructor() { | ||
this.alignment = {}; | ||
this.styles = {}; | ||
this.styles = { appearance: "components/card/default" }; | ||
} | ||
} |
@@ -24,2 +24,4 @@ import * as ko from "knockout"; | ||
public readonly typography: KnockoutObservable<TypographyContract>; | ||
public readonly appearanceStyles: KnockoutObservableArray<any>; | ||
public readonly appearanceStyle: KnockoutObservable<any>; | ||
@@ -42,4 +44,5 @@ constructor( | ||
this.applyChanges = this.applyChanges.bind(this); | ||
this.alignment = ko.observable<string>(); | ||
this.alignment.subscribe(this.applyChanges.bind(this)); | ||
@@ -50,6 +53,8 @@ this.verticalAlignment = ko.observable<string>(); | ||
this.scrollOnOverlow = ko.observable<boolean>(); | ||
this.scrollOnOverlow.subscribe(this.applyChanges.bind(this)); | ||
this.background = ko.observable<BackgroundContract>(); | ||
this.typography = ko.observable<TypographyContract>(); | ||
this.appearanceStyles = ko.observableArray<any>(); | ||
this.appearanceStyle = ko.observable<any>(); | ||
} | ||
@@ -97,2 +102,4 @@ | ||
this.model.styles.appearance = this.appearanceStyle(); | ||
this.onChange(this.model); | ||
@@ -138,2 +145,3 @@ } | ||
public async initialize(): Promise<void> { | ||
const viewport = this.viewManager.getViewport(); | ||
@@ -150,11 +158,21 @@ | ||
const variations = await this.styleService.getComponentVariations("card"); | ||
this.appearanceStyles(variations.filter(x => x.category === "appearance")); | ||
if (this.model.styles && this.model.styles["instance"]) { | ||
const styles = await this.styleService.getStyleByKey(this.model.styles["instance"]); | ||
if (this.model.styles) { | ||
if (this.model.styles["instance"]) { | ||
const styles = await this.styleService.getStyleByKey(this.model.styles["instance"]); | ||
if (styles) { | ||
this.background(styles.background); | ||
this.typography(styles.typography); | ||
if (styles) { | ||
this.background(styles.background); | ||
this.typography(styles.typography); | ||
} | ||
} | ||
this.appearanceStyle(this.model.styles.appearance); | ||
} | ||
this.alignment.subscribe(this.applyChanges); | ||
this.scrollOnOverlow.subscribe(this.applyChanges); | ||
this.appearanceStyle.subscribe(this.applyChanges); | ||
} | ||
@@ -240,3 +258,3 @@ | ||
instanceKey = `instances/card-${Utils.identifier()}`; | ||
this.model.styles = { instance: instanceKey }; | ||
this.model.styles.instance = instanceKey; | ||
} | ||
@@ -256,3 +274,3 @@ | ||
instanceKey = `instances/card-${Utils.identifier()}`; | ||
this.model.styles = { instance: instanceKey }; | ||
this.model.styles.instance = instanceKey; | ||
} | ||
@@ -259,0 +277,0 @@ |
{ | ||
"name": "@paperbits/core", | ||
"version": "0.1.49", | ||
"version": "0.1.50", | ||
"description": "Paperbits core components.", | ||
@@ -23,4 +23,4 @@ "author": "Paperbits", | ||
"dependencies": { | ||
"@paperbits/common": "0.1.49", | ||
"@paperbits/styles": "0.1.49", | ||
"@paperbits/common": "0.1.50", | ||
"@paperbits/styles": "0.1.50", | ||
"cropperjs": "^1.4.0", | ||
@@ -27,0 +27,0 @@ "file-saver": "^2.0.0", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
637687
11859
+ Added@paperbits/common@0.1.50(transitive)
+ Added@paperbits/styles@0.1.50(transitive)
- Removed@paperbits/common@0.1.49(transitive)
- Removed@paperbits/styles@0.1.49(transitive)
Updated@paperbits/common@0.1.50
Updated@paperbits/styles@0.1.50