feat:input add onSubmitEditing
This commit is contained in:
11
doric-js/lib/src/widget/input.d.ts
vendored
11
doric-js/lib/src/widget/input.d.ts
vendored
@@ -2,6 +2,14 @@ import { View } from "../ui/view";
|
||||
import { Color } from "../util/color";
|
||||
import { Gravity } from "../util/gravity";
|
||||
import { BridgeContext } from "../runtime/global";
|
||||
export declare enum ReturnKeyType {
|
||||
Default = 0,
|
||||
Done = 1,
|
||||
Search = 2,
|
||||
Next = 3,
|
||||
Go = 4,
|
||||
Send = 5
|
||||
}
|
||||
export declare class Input extends View {
|
||||
text?: string;
|
||||
textColor?: Color;
|
||||
@@ -15,6 +23,9 @@ export declare class Input extends View {
|
||||
onFocusChange?: (focused: boolean) => void;
|
||||
maxLength?: number;
|
||||
password?: boolean;
|
||||
editable?: boolean;
|
||||
returnKeyType?: ReturnKeyType;
|
||||
onSubmitEditing?: (text: string) => void;
|
||||
getText(context: BridgeContext): Promise<string>;
|
||||
setSelection(context: BridgeContext, start: number, end?: number): Promise<string>;
|
||||
requestFocus(context: BridgeContext): Promise<any>;
|
||||
|
@@ -26,6 +26,15 @@ import { View, Property, InconsistProperty } from "../ui/view";
|
||||
import { Color } from "../util/color";
|
||||
import { Gravity } from "../util/gravity";
|
||||
import { layoutConfig } from "../util/index.util";
|
||||
export var ReturnKeyType;
|
||||
(function (ReturnKeyType) {
|
||||
ReturnKeyType[ReturnKeyType["Default"] = 0] = "Default";
|
||||
ReturnKeyType[ReturnKeyType["Done"] = 1] = "Done";
|
||||
ReturnKeyType[ReturnKeyType["Search"] = 2] = "Search";
|
||||
ReturnKeyType[ReturnKeyType["Next"] = 3] = "Next";
|
||||
ReturnKeyType[ReturnKeyType["Go"] = 4] = "Go";
|
||||
ReturnKeyType[ReturnKeyType["Send"] = 5] = "Send";
|
||||
})(ReturnKeyType || (ReturnKeyType = {}));
|
||||
export class Input extends View {
|
||||
getText(context) {
|
||||
return this.nativeChannel(context, 'getText')();
|
||||
@@ -91,6 +100,18 @@ __decorate([
|
||||
Property,
|
||||
__metadata("design:type", Boolean)
|
||||
], Input.prototype, "password", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Boolean)
|
||||
], Input.prototype, "editable", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Number)
|
||||
], Input.prototype, "returnKeyType", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Function)
|
||||
], Input.prototype, "onSubmitEditing", void 0);
|
||||
export var InputType;
|
||||
(function (InputType) {
|
||||
InputType[InputType["Default"] = 0] = "Default";
|
||||
|
Reference in New Issue
Block a user