chore: cleanup reexports

This commit is contained in:
Nathan Walker
2020-07-05 14:53:34 -07:00
parent 1525c89733
commit 8f2900ad0b
306 changed files with 1197 additions and 1534 deletions

View File

@@ -1,6 +1,7 @@
import { Property, CssProperty, CssAnimationProperty, InheritedProperty, Style } from "../properties";
import { Property, CssProperty, CssAnimationProperty, InheritedProperty } from "../properties";
import { BindingOptions } from "../bindable";
import { Observable } from "../../../data/observable";
import { Style } from "../../styling/style";
import { Page } from "../../page";
@@ -163,7 +164,7 @@ export abstract class ViewBase extends Observable {
* and will be applied when all prerequisites are met.
* @private
*/
_suspendedUpdates: { [propertyName: string]: Property<ViewBase, any> | CssProperty<Style, any> | CssAnimationProperty<Style, any> };
_suspendedUpdates: { [propertyName: string]: Property<any, any> | CssProperty<Style, any> | CssAnimationProperty<Style, any> };
//@endprivate
/**
@@ -493,9 +494,9 @@ export class Binding {
public unbind();
}
export const idProperty: Property<ViewBase, string>;
export const classNameProperty: Property<ViewBase, string>;
export const bindingContextProperty: InheritedProperty<ViewBase, any>;
export const idProperty: Property<any, string>;
export const classNameProperty: Property<any, string>;
export const bindingContextProperty: InheritedProperty<any, any>;
/**
* Converts string into boolean value.

View File

@@ -41,6 +41,62 @@ function ensureStyleScopeModule() {
let defaultBindingSource = {};
export interface ShowModalOptions {
/**
* Any context you want to pass to the modally shown view. This same context will be available in the arguments of the shownModally event handler.
*/
context: any;
/**
* A function that will be called when the view is closed. Any arguments provided when calling ShownModallyData.closeCallback will be available here.
*/
closeCallback: Function;
/**
* An optional parameter specifying whether to show the modal view in full-screen mode.
*/
fullscreen?: boolean;
/**
* An optional parameter specifying whether to show the modal view with animation.
*/
animated?: boolean;
/**
* An optional parameter specifying whether to stretch the modal view when not in full-screen mode.
*/
stretched?: boolean;
/**
* An optional parameter that specify options specific to iOS as an object.
*/
ios?: {
/**
* The UIModalPresentationStyle to be used when showing the dialog in iOS .
*/
presentationStyle?: any; /* UIModalPresentationStyle */
/**
* width of the popup dialog
*/
width?: number;
/**
* height of the popup dialog
*/
height?: number;
}
android?: {
/**
* @deprecated Use ShowModalOptions.cancelable instead.
* An optional parameter specifying whether the modal view can be dismissed when not in full-screen mode.
*/
cancelable?: boolean
}
/**
* An optional parameter specifying whether the modal view can be dismissed when not in full-screen mode.
*/
cancelable?: boolean
}
export function getAncestor(view: ViewBaseDefinition, criterion: string | Function): ViewBaseDefinition {
let matcher: (view: ViewBaseDefinition) => boolean = null;
if (typeof criterion === "string") {
@@ -334,7 +390,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
this[name] = WrappedValue.unwrap(value);
}
@profile
@profile()
public onLoaded() {
this.setFlag(Flags.superOnLoadedCalled, true);
if (this._isLoaded) {
@@ -354,7 +410,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
this._emit("loaded");
}
@profile
@profile()
public onUnloaded() {
this.setFlag(Flags.superOnUnloadedCalled, true);
if (!this._isLoaded) {
@@ -476,7 +532,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
return allStates;
}
@profile
@profile()
public addPseudoClass(name: string): void {
let allStates = this.getAllAliasedStates(name);
for (let i = 0; i < allStates.length; i++) {
@@ -487,7 +543,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
}
}
@profile
@profile()
public deletePseudoClass(name: string): void {
let allStates = this.getAllAliasedStates(name);
for (let i = 0; i < allStates.length; i++) {
@@ -570,7 +626,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
}
}
@profile
@profile()
public requestLayout(): void {
// Default implementation for non View instances (like TabViewItem).
const parent = this.parent;
@@ -583,7 +639,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
//
}
@profile
@profile()
public _addView(view: ViewBase, atIndex?: number) {
if (Trace.isEnabled()) {
Trace.write(`${this}._addView(${view}, ${atIndex})`, Trace.categories.ViewHierarchy);
@@ -710,7 +766,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
this._setupUI(context);
}
@profile
@profile()
public _setupUI(context: android.content.Context, atIndex?: number, parentIsLoaded?: boolean): void {
if (this._context === context) {
return;
@@ -804,7 +860,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
}
}
@profile
@profile()
public _tearDownUI(force?: boolean): void {
// No context means we are already teared down.
if (!this._context) {
@@ -921,7 +977,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
}
ensureStyleScopeModule();
styleScopeModule.applyInlineStyle(this, style);
styleScopeModule.applyInlineStyle(this, style, undefined);
}
public _parentChanged(oldParent: ViewBase): void {
@@ -941,7 +997,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
public onResumeNativeUpdates(): void {
// Apply native setters...
initNativeView(this);
initNativeView(this, undefined, undefined);
}
public toString(): string {

View File

@@ -1,5 +0,0 @@
{
"name": "view-base",
"main": "view-base",
"types": "view-base.d.ts"
}

View File

@@ -3,13 +3,13 @@ import { Point, CustomLayoutView as CustomLayoutViewDefinition, dip } from ".";
import { GestureTypes, GestureEventData } from "../../gestures";
// Types.
import {
ViewCommon, isEnabledProperty, originXProperty, originYProperty, automationTextProperty, isUserInteractionEnabledProperty,
paddingLeftProperty, paddingTopProperty, paddingRightProperty, paddingBottomProperty,
EventData, ShowModalOptions
ViewCommon, isEnabledProperty, originXProperty, originYProperty, automationTextProperty, isUserInteractionEnabledProperty
} from "./view-common";
// import { layout} from "../../layouts"
import { paddingLeftProperty, paddingTopProperty, paddingRightProperty, paddingBottomProperty } from "../../styling/style-properties";
import { layout} from "../../../utils/utils";
import { Trace } from "../../../trace";
import { Color } from "../../../color";
import { ShowModalOptions } from "../view-base";
import { EventData } from "../../../data/observable";
import {
perspectiveProperty, Length, PercentLength, Visibility, HorizontalAlignment, VerticalAlignment,
@@ -374,7 +374,7 @@ export class View extends ViewCommon {
return manager;
}
@profile
@profile()
public onLoaded() {
this._manager = null;
this._rootManager = null;
@@ -382,7 +382,7 @@ export class View extends ViewCommon {
this.setOnTouchListener();
}
@profile
@profile()
public onUnloaded() {
if (this.touchListenerIsSet) {
this.touchListenerIsSet = false;
@@ -502,7 +502,7 @@ export class View extends ViewCommon {
}
}
@profile
@profile()
public requestLayout(): void {
super.requestLayout();
if (this.nativeViewProtected) {

View File

@@ -23,7 +23,6 @@ import {
import { profile } from "../../../profiling";
export * from "./view-common";
export { IOSHelper };
const PFLAG_FORCE_LAYOUT = 1;
const PFLAG_MEASURED_DIMENSION_SET = 1 << 1;
@@ -91,7 +90,7 @@ export class View extends ViewCommon implements ViewDefinition {
}
}
@profile
@profile()
public layout(left: number, top: number, right: number, bottom: number, setFrame = true): void {
const { boundsChanged, sizeChanged } = this._setCurrentLayoutBounds(left, top, right, bottom);
if (setFrame) {
@@ -129,7 +128,7 @@ export class View extends ViewCommon implements ViewDefinition {
this._privateFlags |= PFLAG_MEASURED_DIMENSION_SET;
}
@profile
@profile()
public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
const view = this.nativeViewProtected;
const width = layout.getMeasureSpecSize(widthMeasureSpec);
@@ -252,7 +251,7 @@ export class View extends ViewCommon implements ViewDefinition {
public focus(): boolean {
if (this.ios) {
return this.IOSHelper.becomeFirstResponder();
return this.ios.becomeFirstResponder();
}
return false;
@@ -446,13 +445,13 @@ export class View extends ViewCommon implements ViewDefinition {
controller.modalPresentationStyle = UIModalPresentationStyle.FormSheet;
//check whether both height and width is provided and are positive numbers
// set it has prefered content size to the controller presenting the dialog
if (options.ios && options.IOSHelper.width > 0 && options.IOSHelper.height > 0) {
controller.preferredContentSize = CGSizeMake(options.IOSHelper.width, options.IOSHelper.height);
if (options.ios && options.ios.width > 0 && options.ios.height > 0) {
controller.preferredContentSize = CGSizeMake(options.ios.width, options.ios.height);
}
}
if (options.ios && options.IOSHelper.presentationStyle) {
const presentationStyle = options.IOSHelper.presentationStyle;
if (options.ios && options.ios.presentationStyle) {
const presentationStyle = options.ios.presentationStyle;
controller.modalPresentationStyle = presentationStyle;
if (presentationStyle === UIModalPresentationStyle.Popover) {

View File

@@ -1,5 +0,0 @@
{
"name": "view",
"main": "view",
"types": "view.d.ts"
}