feat:android input add maxLength
This commit is contained in:
@@ -2610,6 +2610,10 @@ var Input = /** @class */ (function (_super) {
|
||||
Property,
|
||||
__metadata$a("design:type", Function)
|
||||
], Input.prototype, "onFocusChange", void 0);
|
||||
__decorate$a([
|
||||
Property,
|
||||
__metadata$a("design:type", Number)
|
||||
], Input.prototype, "maxLength", void 0);
|
||||
return Input;
|
||||
}(View));
|
||||
function input(config) {
|
||||
|
||||
@@ -1993,6 +1993,10 @@ __decorate$a([
|
||||
Property,
|
||||
__metadata$a("design:type", Function)
|
||||
], Input.prototype, "onFocusChange", void 0);
|
||||
__decorate$a([
|
||||
Property,
|
||||
__metadata$a("design:type", Number)
|
||||
], Input.prototype, "maxLength", void 0);
|
||||
function input(config) {
|
||||
const ret = new Input;
|
||||
ret.layoutConfig = layoutConfig().just();
|
||||
|
||||
@@ -3452,6 +3452,10 @@ __decorate$a([
|
||||
Property,
|
||||
__metadata$a("design:type", Function)
|
||||
], Input.prototype, "onFocusChange", void 0);
|
||||
__decorate$a([
|
||||
Property,
|
||||
__metadata$a("design:type", Number)
|
||||
], Input.prototype, "maxLength", void 0);
|
||||
function input(config) {
|
||||
const ret = new Input;
|
||||
ret.layoutConfig = layoutConfig().just();
|
||||
|
||||
1
doric-js/index.d.ts
vendored
1
doric-js/index.d.ts
vendored
@@ -679,6 +679,7 @@ declare module 'doric/lib/src/widget/input' {
|
||||
textAlignment?: Gravity;
|
||||
onTextChange?: (text: string) => void;
|
||||
onFocusChange?: (focused: boolean) => void;
|
||||
maxLength?: number;
|
||||
getText(context: BridgeContext): Promise<string>;
|
||||
setSelection(context: BridgeContext, start: number, end?: number): Promise<string>;
|
||||
requestFocus(context: BridgeContext): Promise<any>;
|
||||
|
||||
1
doric-js/lib/src/widget/input.d.ts
vendored
1
doric-js/lib/src/widget/input.d.ts
vendored
@@ -12,6 +12,7 @@ export declare class Input extends View {
|
||||
textAlignment?: Gravity;
|
||||
onTextChange?: (text: string) => void;
|
||||
onFocusChange?: (focused: boolean) => void;
|
||||
maxLength?: number;
|
||||
getText(context: BridgeContext): Promise<string>;
|
||||
setSelection(context: BridgeContext, start: number, end?: number): Promise<string>;
|
||||
requestFocus(context: BridgeContext): Promise<any>;
|
||||
|
||||
@@ -79,6 +79,10 @@ __decorate([
|
||||
Property,
|
||||
__metadata("design:type", Function)
|
||||
], Input.prototype, "onFocusChange", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Number)
|
||||
], Input.prototype, "maxLength", void 0);
|
||||
export function input(config) {
|
||||
const ret = new Input;
|
||||
ret.layoutConfig = layoutConfig().just();
|
||||
|
||||
@@ -48,6 +48,9 @@ export class Input extends View {
|
||||
@Property
|
||||
onFocusChange?: (focused: boolean) => void
|
||||
|
||||
@Property
|
||||
maxLength?: number
|
||||
|
||||
getText(context: BridgeContext) {
|
||||
return this.nativeChannel(context, 'getText')() as Promise<string>
|
||||
}
|
||||
@@ -75,4 +78,4 @@ export function input(config: Partial<Input>) {
|
||||
Reflect.set(ret, key, Reflect.get(config, key, config), ret)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user