iOS support internal class
This commit is contained in:
@@ -2959,12 +2959,15 @@ function navbar(context) {
|
||||
};
|
||||
}
|
||||
|
||||
function internalScheme(context, panelClass) {
|
||||
return "_internal_://export?class=" + encodeURIComponent(panelClass.name) + "&context=" + context.id;
|
||||
}
|
||||
function navigator(context) {
|
||||
var moduleName = "navigator";
|
||||
return {
|
||||
push: function (source, config) {
|
||||
if (typeof source === 'function') {
|
||||
source = "_internal_://export?class=" + encodeURIComponent(source.name) + "&context=" + context.id;
|
||||
source = internalScheme(context, source);
|
||||
}
|
||||
if (config && config.extra) {
|
||||
config.extra = JSON.stringify(config.extra);
|
||||
@@ -3536,6 +3539,7 @@ exports.gravity = gravity;
|
||||
exports.hlayout = hlayout;
|
||||
exports.image = image;
|
||||
exports.input = input;
|
||||
exports.internalScheme = internalScheme;
|
||||
exports.layoutConfig = layoutConfig;
|
||||
exports.list = list;
|
||||
exports.listItem = listItem;
|
||||
|
||||
@@ -2291,12 +2291,15 @@ function navbar(context) {
|
||||
};
|
||||
}
|
||||
|
||||
function internalScheme(context, panelClass) {
|
||||
return `_internal_://export?class=${encodeURIComponent(panelClass.name)}&context=${context.id}`;
|
||||
}
|
||||
function navigator(context) {
|
||||
const moduleName = "navigator";
|
||||
return {
|
||||
push: (source, config) => {
|
||||
if (typeof source === 'function') {
|
||||
source = `_internal_://export?class=${encodeURIComponent(source.name)}&context=${context.id}`;
|
||||
source = internalScheme(context, source);
|
||||
}
|
||||
if (config && config.extra) {
|
||||
config.extra = JSON.stringify(config.extra);
|
||||
@@ -2754,6 +2757,7 @@ exports.gravity = gravity;
|
||||
exports.hlayout = hlayout;
|
||||
exports.image = image;
|
||||
exports.input = input;
|
||||
exports.internalScheme = internalScheme;
|
||||
exports.layoutConfig = layoutConfig;
|
||||
exports.list = list;
|
||||
exports.listItem = listItem;
|
||||
|
||||
@@ -3786,12 +3786,15 @@ function navbar(context) {
|
||||
};
|
||||
}
|
||||
|
||||
function internalScheme(context, panelClass) {
|
||||
return `_internal_://export?class=${encodeURIComponent(panelClass.name)}&context=${context.id}`;
|
||||
}
|
||||
function navigator(context) {
|
||||
const moduleName = "navigator";
|
||||
return {
|
||||
push: (source, config) => {
|
||||
if (typeof source === 'function') {
|
||||
source = `_internal_://export?class=${encodeURIComponent(source.name)}&context=${context.id}`;
|
||||
source = internalScheme(context, source);
|
||||
}
|
||||
if (config && config.extra) {
|
||||
config.extra = JSON.stringify(config.extra);
|
||||
@@ -4384,6 +4387,7 @@ exports.gravity = gravity;
|
||||
exports.hlayout = hlayout;
|
||||
exports.image = image;
|
||||
exports.input = input;
|
||||
exports.internalScheme = internalScheme;
|
||||
exports.layoutConfig = layoutConfig;
|
||||
exports.list = list;
|
||||
exports.listItem = listItem;
|
||||
|
||||
1
doric-js/index.d.ts
vendored
1
doric-js/index.d.ts
vendored
@@ -842,6 +842,7 @@ declare module 'doric/lib/src/native/navigator' {
|
||||
import { BridgeContext } from "doric/lib/src/runtime/global";
|
||||
import { ClassType } from "doric/lib/src/pattern/mvvm";
|
||||
import { Panel } from "doric/lib/src/ui/panel";
|
||||
export function internalScheme(context: BridgeContext, panelClass: ClassType<Panel>): string;
|
||||
export function navigator(context: BridgeContext): {
|
||||
push: (source: string | ClassType<Panel>, config?: {
|
||||
alias?: string | undefined;
|
||||
|
||||
1
doric-js/lib/src/native/navigator.d.ts
vendored
1
doric-js/lib/src/native/navigator.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
import { BridgeContext } from "../runtime/global";
|
||||
import { ClassType } from "../pattern/mvvm";
|
||||
import { Panel } from "../ui/panel";
|
||||
export declare function internalScheme(context: BridgeContext, panelClass: ClassType<Panel>): string;
|
||||
export declare function navigator(context: BridgeContext): {
|
||||
push: (source: string | ClassType<Panel>, config?: {
|
||||
alias?: string | undefined;
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
export function internalScheme(context, panelClass) {
|
||||
return `_internal_://export?class=${encodeURIComponent(panelClass.name)}&context=${context.id}`;
|
||||
}
|
||||
export function navigator(context) {
|
||||
const moduleName = "navigator";
|
||||
return {
|
||||
push: (source, config) => {
|
||||
if (typeof source === 'function') {
|
||||
source = `_internal_://export?class=${encodeURIComponent(source.name)}&context=${context.id}`;
|
||||
source = internalScheme(context, source);
|
||||
}
|
||||
if (config && config.extra) {
|
||||
config.extra = JSON.stringify(config.extra);
|
||||
|
||||
@@ -17,6 +17,10 @@ import { BridgeContext } from "../runtime/global"
|
||||
import { ClassType } from "../pattern/mvvm"
|
||||
import { Panel } from "../ui/panel"
|
||||
|
||||
export function internalScheme(context: BridgeContext, panelClass: ClassType<Panel>) {
|
||||
return `_internal_://export?class=${encodeURIComponent(panelClass.name)}&context=${context.id}`
|
||||
}
|
||||
|
||||
export function navigator(context: BridgeContext) {
|
||||
const moduleName = "navigator"
|
||||
return {
|
||||
@@ -27,7 +31,7 @@ export function navigator(context: BridgeContext) {
|
||||
singlePage?: boolean,
|
||||
}) => {
|
||||
if (typeof source === 'function') {
|
||||
source = `_internal_://export?class=${encodeURIComponent(source.name)}&context=${context.id}`
|
||||
source = internalScheme(context, source)
|
||||
}
|
||||
if (config && config.extra) {
|
||||
(config as any).extra = JSON.stringify(config.extra)
|
||||
|
||||
Reference in New Issue
Block a user