feat:Input add getSelection API
This commit is contained in:
@@ -2791,6 +2791,9 @@ var Input = /** @class */ (function (_super) {
|
||||
end: end,
|
||||
});
|
||||
};
|
||||
Input.prototype.getSelection = function (context) {
|
||||
return this.nativeChannel(context, 'getSelection')();
|
||||
};
|
||||
Input.prototype.requestFocus = function (context) {
|
||||
return this.nativeChannel(context, 'requestFocus')();
|
||||
};
|
||||
|
@@ -2154,6 +2154,9 @@ class Input extends View {
|
||||
end,
|
||||
});
|
||||
}
|
||||
getSelection(context) {
|
||||
return this.nativeChannel(context, 'getSelection')();
|
||||
}
|
||||
requestFocus(context) {
|
||||
return this.nativeChannel(context, 'requestFocus')();
|
||||
}
|
||||
|
@@ -3675,6 +3675,9 @@ class Input extends View {
|
||||
end,
|
||||
});
|
||||
}
|
||||
getSelection(context) {
|
||||
return this.nativeChannel(context, 'getSelection')();
|
||||
}
|
||||
requestFocus(context) {
|
||||
return this.nativeChannel(context, 'requestFocus')();
|
||||
}
|
||||
|
6
doric-js/index.d.ts
vendored
6
doric-js/index.d.ts
vendored
@@ -785,7 +785,11 @@ declare module 'doric/lib/src/widget/input' {
|
||||
returnKeyType?: ReturnKeyType;
|
||||
onSubmitEditing?: (text: string) => void;
|
||||
getText(context: BridgeContext): Promise<string>;
|
||||
setSelection(context: BridgeContext, start: number, end?: number): Promise<string>;
|
||||
setSelection(context: BridgeContext, start: number, end?: number): Promise<any>;
|
||||
getSelection(context: BridgeContext): Promise<{
|
||||
start: number;
|
||||
end: number;
|
||||
}>;
|
||||
requestFocus(context: BridgeContext): Promise<any>;
|
||||
releaseFocus(context: BridgeContext): Promise<any>;
|
||||
}
|
||||
|
6
doric-js/lib/src/widget/input.d.ts
vendored
6
doric-js/lib/src/widget/input.d.ts
vendored
@@ -27,7 +27,11 @@ export declare class Input extends View {
|
||||
returnKeyType?: ReturnKeyType;
|
||||
onSubmitEditing?: (text: string) => void;
|
||||
getText(context: BridgeContext): Promise<string>;
|
||||
setSelection(context: BridgeContext, start: number, end?: number): Promise<string>;
|
||||
setSelection(context: BridgeContext, start: number, end?: number): Promise<any>;
|
||||
getSelection(context: BridgeContext): Promise<{
|
||||
start: number;
|
||||
end: number;
|
||||
}>;
|
||||
requestFocus(context: BridgeContext): Promise<any>;
|
||||
releaseFocus(context: BridgeContext): Promise<any>;
|
||||
}
|
||||
|
@@ -45,6 +45,9 @@ export class Input extends View {
|
||||
end,
|
||||
});
|
||||
}
|
||||
getSelection(context) {
|
||||
return this.nativeChannel(context, 'getSelection')();
|
||||
}
|
||||
requestFocus(context) {
|
||||
return this.nativeChannel(context, 'requestFocus')();
|
||||
}
|
||||
|
@@ -75,7 +75,6 @@ export class Input extends View {
|
||||
@Property
|
||||
onSubmitEditing?: (text: string) => void
|
||||
|
||||
|
||||
getText(context: BridgeContext) {
|
||||
return this.nativeChannel(context, 'getText')() as Promise<string>
|
||||
}
|
||||
@@ -84,9 +83,17 @@ export class Input extends View {
|
||||
return this.nativeChannel(context, 'setSelection')({
|
||||
start,
|
||||
end,
|
||||
}) as Promise<string>
|
||||
}) as Promise<any>
|
||||
}
|
||||
|
||||
getSelection(context: BridgeContext) {
|
||||
return this.nativeChannel(context, 'getSelection')() as Promise<{
|
||||
start: number,
|
||||
end: number,
|
||||
}>
|
||||
}
|
||||
|
||||
|
||||
requestFocus(context: BridgeContext) {
|
||||
return this.nativeChannel(context, 'requestFocus')()
|
||||
}
|
||||
|
Reference in New Issue
Block a user