feat:Input add beforeTextChange API
This commit is contained in:
@@ -2860,6 +2860,10 @@ var Input = /** @class */ (function (_super) {
|
||||
Property,
|
||||
__metadata$3("design:type", Function)
|
||||
], Input.prototype, "onSubmitEditing", void 0);
|
||||
__decorate$3([
|
||||
Property,
|
||||
__metadata$3("design:type", Function)
|
||||
], Input.prototype, "beforeTextChange", void 0);
|
||||
return Input;
|
||||
}(View));
|
||||
exports.InputType = void 0;
|
||||
|
@@ -2224,6 +2224,10 @@ __decorate$3([
|
||||
Property,
|
||||
__metadata$3("design:type", Function)
|
||||
], Input.prototype, "onSubmitEditing", void 0);
|
||||
__decorate$3([
|
||||
Property,
|
||||
__metadata$3("design:type", Function)
|
||||
], Input.prototype, "beforeTextChange", void 0);
|
||||
exports.InputType = void 0;
|
||||
(function (InputType) {
|
||||
InputType[InputType["Default"] = 0] = "Default";
|
||||
|
@@ -3745,6 +3745,10 @@ __decorate$3([
|
||||
Property,
|
||||
__metadata$3("design:type", Function)
|
||||
], Input.prototype, "onSubmitEditing", void 0);
|
||||
__decorate$3([
|
||||
Property,
|
||||
__metadata$3("design:type", Function)
|
||||
], Input.prototype, "beforeTextChange", void 0);
|
||||
exports.InputType = void 0;
|
||||
(function (InputType) {
|
||||
InputType[InputType["Default"] = 0] = "Default";
|
||||
|
6
doric-js/index.d.ts
vendored
6
doric-js/index.d.ts
vendored
@@ -784,6 +784,12 @@ declare module 'doric/lib/src/widget/input' {
|
||||
editable?: boolean;
|
||||
returnKeyType?: ReturnKeyType;
|
||||
onSubmitEditing?: (text: string) => void;
|
||||
beforeTextChange?: (change: {
|
||||
editing: string;
|
||||
start: number;
|
||||
length: number;
|
||||
replacement: string;
|
||||
}) => boolean;
|
||||
getText(context: BridgeContext): Promise<string>;
|
||||
setSelection(context: BridgeContext, start: number, end?: number): Promise<any>;
|
||||
getSelection(context: BridgeContext): Promise<{
|
||||
|
6
doric-js/lib/src/widget/input.d.ts
vendored
6
doric-js/lib/src/widget/input.d.ts
vendored
@@ -26,6 +26,12 @@ export declare class Input extends View {
|
||||
editable?: boolean;
|
||||
returnKeyType?: ReturnKeyType;
|
||||
onSubmitEditing?: (text: string) => void;
|
||||
beforeTextChange?: (change: {
|
||||
editing: string;
|
||||
start: number;
|
||||
length: number;
|
||||
replacement: string;
|
||||
}) => boolean;
|
||||
getText(context: BridgeContext): Promise<string>;
|
||||
setSelection(context: BridgeContext, start: number, end?: number): Promise<any>;
|
||||
getSelection(context: BridgeContext): Promise<{
|
||||
|
@@ -115,6 +115,10 @@ __decorate([
|
||||
Property,
|
||||
__metadata("design:type", Function)
|
||||
], Input.prototype, "onSubmitEditing", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Function)
|
||||
], Input.prototype, "beforeTextChange", void 0);
|
||||
export var InputType;
|
||||
(function (InputType) {
|
||||
InputType[InputType["Default"] = 0] = "Default";
|
||||
|
@@ -75,6 +75,14 @@ export class Input extends View {
|
||||
@Property
|
||||
onSubmitEditing?: (text: string) => void
|
||||
|
||||
@Property
|
||||
beforeTextChange?: (change: {
|
||||
editing: string,
|
||||
start: number,
|
||||
length: number,
|
||||
replacement: string,
|
||||
}) => boolean
|
||||
|
||||
getText(context: BridgeContext) {
|
||||
return this.nativeChannel(context, 'getText')() as Promise<string>
|
||||
}
|
||||
|
Reference in New Issue
Block a user