FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: circular reference · NativeScript/NativeScript@557d34b · GitHub

Commit 557d34b

Browse files
committed
fix: circular reference
1 parent e9fdd28 commit 557d34b

8 files changed

Lines changed: 42 additions & 34 deletions

File tree

‎tns-core-modules/application/application-common.ts‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import {
4040
LoadAppCSSEventData,
4141
UnhandledErrorEventData
4242
} from "./application";
43+
import { CSS_CLASS_PREFIX } from "./application-utils";
4344
import { DeviceOrientation } from "../ui/enums/enums";
4445

4546
export { UnhandledErrorEventData, DiscardedErrorEventData, CssChangedEventData, LoadAppCSSEventData };
@@ -54,13 +55,6 @@ export const uncaughtErrorEvent = "uncaughtError";
5455
export const discardedErrorEvent = "discardedError";
5556
export const orientationChangedEvent = "orientationChanged";
5657

57-
const MODAL = "modal";
58-
const ROOT = "root";
59-
60-
export const CSS_CLASS_PREFIX = "ns-";
61-
export const MODAL_ROOT_VIEW_CSS_CLASS = `${CSS_CLASS_PREFIX}${MODAL}`;
62-
export const ROOT_VIEW_CSS_CLASSES = [`${CSS_CLASS_PREFIX}${ROOT}`];
63-
6458
const ORIENTATION_CSS_CLASSES = [
6559
`${CSS_CLASS_PREFIX}${DeviceOrientation.portrait}`,
6660
`${CSS_CLASS_PREFIX}${DeviceOrientation.landscape}`,
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Contains the application utils referenced in application and ui modules.
3+
* @module "application"
4+
*/ /** */
5+
6+
/**
7+
* String value "ns-" used for CSS class prefix.
8+
*/
9+
export const CSS_CLASS_PREFIX: string;
10+
11+
/**
12+
* String value "ns-modal" used for default CSS class of a modal root view.
13+
*/
14+
export const MODAL_ROOT_VIEW_CSS_CLASS: string;
15+
16+
/**
17+
* Array of string values used for CSS classes of a root view.
18+
* Default value - "ns-root".
19+
* Platform values: "ns-android" and "ns-ios".
20+
* Device type values: "ns-phone" and "ns-tablet".
21+
* Orientation values: "ns-portrait", "ns-landscape" and "ns-unknown".
22+
*/
23+
export const ROOT_VIEW_CSS_CLASSES: string[];
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const MODAL = "modal";
2+
const ROOT = "root";
3+
4+
export const CSS_CLASS_PREFIX = "ns-";
5+
export const MODAL_ROOT_VIEW_CSS_CLASS = `${CSS_CLASS_PREFIX}${MODAL}`;
6+
export const ROOT_VIEW_CSS_CLASSES = [`${CSS_CLASS_PREFIX}${ROOT}`];

‎tns-core-modules/application/application.d.ts‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,6 @@ export const lowMemoryEvent: string;
5353
*/
5454
export const orientationChangedEvent: string;
5555

56-
/**
57-
* String value "ns-" used for CSS class prefix.
58-
*/
59-
export const CSS_CLASS_PREFIX: string;
60-
61-
/**
62-
* String value "ns-modal" used for default CSS class of a modal root view.
63-
*/
64-
export const MODAL_ROOT_VIEW_CSS_CLASS: string;
65-
66-
/**
67-
* Array of string values used for CSS classes of a root view.
68-
* Default value - "ns-root".
69-
* Platform values: "ns-android" and "ns-ios".
70-
* Device type values: "ns-phone" and "ns-tablet".
71-
* Orientation values: "ns-portrait", "ns-landscape" and "ns-unknown".
72-
*/
73-
export const ROOT_VIEW_CSS_CLASSES: string[];
74-
7556
/**
7657
* Event data containing information for the application events.
7758
*/

‎tns-core-modules/application/application.ios.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ import {
88
} from ".";
99

1010
import {
11-
CSS_CLASS_PREFIX, displayedEvent, exitEvent, getCssFileName, launchEvent, livesync, lowMemoryEvent, notify, on,
12-
orientationChanged, orientationChangedEvent, resumeEvent, ROOT_VIEW_CSS_CLASSES, setApplication, suspendEvent
11+
displayedEvent, exitEvent, getCssFileName, launchEvent, livesync, lowMemoryEvent, notify, on,
12+
orientationChanged, orientationChangedEvent, resumeEvent, setApplication, suspendEvent
1313
} from "./application-common";
1414

1515
// First reexport so that app module is initialized.
1616
export * from "./application-common";
1717

18+
import { CSS_CLASS_PREFIX, ROOT_VIEW_CSS_CLASSES } from "./application-utils";
19+
1820
// TODO: Remove this and get it from global to decouple builder for angular
1921
import { createViewFromEntry } from "../ui/builder";
2022
import { ios as iosView, View } from "../ui/core/view";

‎tns-core-modules/ui/core/view-base/view-base.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Definitions.
22
import { ViewBase as ViewBaseDefinition } from ".";
3-
import { MODAL_ROOT_VIEW_CSS_CLASS, ROOT_VIEW_CSS_CLASSES } from "../../../application";
3+
import { MODAL_ROOT_VIEW_CSS_CLASS, ROOT_VIEW_CSS_CLASSES } from "../../../application/application-utils";
44
import {
55
AlignSelf, FlexGrow, FlexShrink, FlexWrapBefore, Order
66
} from "../../layouts/flexbox-layout";

‎tns-core-modules/ui/core/view/view-common.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
Property, ShowModalOptions, traceCategories, traceEnabled, traceWrite, ViewBase
1010
} from "../view-base";
1111

12-
import { MODAL_ROOT_VIEW_CSS_CLASS } from "../../../application";
12+
import { MODAL_ROOT_VIEW_CSS_CLASS } from "../../../application/application-utils";
1313
import { HorizontalAlignment, VerticalAlignment, Visibility, Length, PercentLength } from "../../styling/style-properties";
1414

1515
import {

‎tns-core-modules/ui/frame/frame.android.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { Page } from "../page";
77

88
// Types.
99
import * as application from "../../application";
10+
import { CSS_CLASS_PREFIX, ROOT_VIEW_CSS_CLASSES } from "../../application/application-utils";
11+
1012
import {
1113
_stack, FrameBase, goBack, NavigationType, Observable,
1214
traceCategories, traceEnabled, traceError, traceWrite, View
@@ -1284,10 +1286,10 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
12841286
activityRootViewsMap.set(rootView._domId, new WeakRef(rootView));
12851287

12861288
const deviceType = device.deviceType.toLowerCase();
1287-
application.ROOT_VIEW_CSS_CLASSES.push(`${application.CSS_CLASS_PREFIX}${ANDROID_PLATFORM}`);
1288-
application.ROOT_VIEW_CSS_CLASSES.push(`${application.CSS_CLASS_PREFIX}${deviceType}`);
1289-
application.ROOT_VIEW_CSS_CLASSES.push(`${application.CSS_CLASS_PREFIX}${application.android.orientation}`);
1290-
application.ROOT_VIEW_CSS_CLASSES.forEach(c => this._rootView.cssClasses.add(c));
1289+
ROOT_VIEW_CSS_CLASSES.push(`${CSS_CLASS_PREFIX}${ANDROID_PLATFORM}`);
1290+
ROOT_VIEW_CSS_CLASSES.push(`${CSS_CLASS_PREFIX}${deviceType}`);
1291+
ROOT_VIEW_CSS_CLASSES.push(`${CSS_CLASS_PREFIX}${application.android.orientation}`);
1292+
ROOT_VIEW_CSS_CLASSES.forEach(c => this._rootView.cssClasses.add(c));
12911293
}
12921294

12931295
// Initialize native visual tree;

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL