Add animations demo to the gallery app, make vertical alignment center and visibility collapsed backward compatible

This commit is contained in:
Panayot Cankov
2017-01-25 13:17:33 +02:00
parent ba2d5d42e6
commit 0dd8f985c4
12 changed files with 376 additions and 11 deletions

View File

@@ -65,6 +65,13 @@ declare module "data/observable" {
* Observable is used when you want to be notified when a change occurs. Use on/off methods to add/remove listener.
*/
class Observable {
/**
* Please note that should you be using the `new Observable({})` constructor, it is **obsolete** since v3.0,
* and you have to migrate to the "data/observable" `fromObject({})` or the `fromObjectRecursive({})` functions.
*/
constructor();
/**
* String value used when hooking to propertyChange event.
*/

View File

@@ -1250,16 +1250,8 @@ export namespace VerticalAlignment {
export const BOTTOM: "bottom" = "bottom";
export const STRETCH: "stretch" = "stretch";
export const isValid = makeValidator<VerticalAlignment>(TOP, MIDDLE, BOTTOM, STRETCH);
export const parse = value => {
const lower = value && value.toLowerCase();
if (lower === "canter") {
return MIDDLE;
} else if (isValid(lower)) {
return lower;
} else {
throw new Error("Invalid value: " + value);
}
}
export const parse = (value: string) => value.toLowerCase() === "center" ? MIDDLE : parseStrict(value);
const parseStrict = makeParser<VerticalAlignment>(isValid);
}
export const verticalAlignmentProperty = new CssProperty<Style, VerticalAlignment>({ name: "verticalAlignment", cssName: "vertical-align", defaultValue: VerticalAlignment.STRETCH, affectsLayout: isIOS, valueConverter: VerticalAlignment.parse });
@@ -2025,7 +2017,8 @@ export namespace Visibility {
export const HIDDEN: "hidden" = "hidden";
export const COLLAPSE: "collapse" = "collapse";
export const isValid = makeValidator<Visibility>(VISIBLE, HIDDEN, COLLAPSE);
export const parse = makeParser<Visibility>(isValid);
export const parse = (value: string) => value.toLowerCase() === "collapsed" ? COLLAPSE : parseStrict(value);
const parseStrict = makeParser<Visibility>(isValid);
}
export const visibilityProperty = new CssProperty<Style, Visibility>({