update demo

This commit is contained in:
pengfei.zhou 2020-06-13 11:58:24 +08:00 committed by osborn
parent 4a788eb4bb
commit 662909438b
9 changed files with 63 additions and 6 deletions

View File

@ -1,4 +1,4 @@
import { Panel, Group, scroller, vlayout, layoutConfig, LayoutSpec, Input, Gravity, log, Color, input, text } from "doric";
import { Panel, Group, scroller, vlayout, layoutConfig, LayoutSpec, Input, Gravity, log, Color, input, text, InputType } from "doric";
import { title, colors } from "./utils";
@ -44,7 +44,8 @@ class InputDemo extends Panel {
multiline: false,
textSize: 20,
maxLength: 20,
padding: { top: 10, bottom: 11 }
padding: { top: 10, bottom: 11 },
inputType: InputType.Decimal
});
scroller(
vlayout(
@ -71,7 +72,7 @@ class InputDemo extends Panel {
{
space: 10,
layoutConfig: layoutConfig().most().configHeight(LayoutSpec.MOST),
onClick: () => {
onClick: () => {
(inputView as Input).releaseFocus(context);
}
}

View File

@ -2683,6 +2683,10 @@ var Input = /** @class */ (function (_super) {
Property,
__metadata$a("design:type", String)
], Input.prototype, "hintText", void 0);
__decorate$a([
Property,
__metadata$a("design:type", Number)
], Input.prototype, "inputType", void 0);
__decorate$a([
Property,
__metadata$a("design:type", Color)
@ -2709,6 +2713,13 @@ var Input = /** @class */ (function (_super) {
], Input.prototype, "maxLength", void 0);
return Input;
}(View));
(function (InputType) {
InputType[InputType["Default"] = 0] = "Default";
InputType[InputType["Number"] = 1] = "Number";
InputType[InputType["Decimal"] = 2] = "Decimal";
InputType[InputType["Alphabet"] = 3] = "Alphabet";
InputType[InputType["Phone"] = 4] = "Phone";
})(exports.InputType || (exports.InputType = {}));
function input(config) {
var ret = new Input;
ret.layoutConfig = layoutConfig().just();

View File

@ -2101,6 +2101,10 @@ let Input = /** @class */ (() => {
Property,
__metadata$a("design:type", String)
], Input.prototype, "hintText", void 0);
__decorate$a([
Property,
__metadata$a("design:type", Number)
], Input.prototype, "inputType", void 0);
__decorate$a([
Property,
__metadata$a("design:type", Color)
@ -2127,6 +2131,13 @@ let Input = /** @class */ (() => {
], Input.prototype, "maxLength", void 0);
return Input;
})();
(function (InputType) {
InputType[InputType["Default"] = 0] = "Default";
InputType[InputType["Number"] = 1] = "Number";
InputType[InputType["Decimal"] = 2] = "Decimal";
InputType[InputType["Alphabet"] = 3] = "Alphabet";
InputType[InputType["Phone"] = 4] = "Phone";
})(exports.InputType || (exports.InputType = {}));
function input(config) {
const ret = new Input;
ret.layoutConfig = layoutConfig().just();

View File

@ -3560,6 +3560,10 @@ let Input = /** @class */ (() => {
Property,
__metadata$a("design:type", String)
], Input.prototype, "hintText", void 0);
__decorate$a([
Property,
__metadata$a("design:type", Number)
], Input.prototype, "inputType", void 0);
__decorate$a([
Property,
__metadata$a("design:type", Color)
@ -3586,6 +3590,13 @@ let Input = /** @class */ (() => {
], Input.prototype, "maxLength", void 0);
return Input;
})();
(function (InputType) {
InputType[InputType["Default"] = 0] = "Default";
InputType[InputType["Number"] = 1] = "Number";
InputType[InputType["Decimal"] = 2] = "Decimal";
InputType[InputType["Alphabet"] = 3] = "Alphabet";
InputType[InputType["Phone"] = 4] = "Phone";
})(exports.InputType || (exports.InputType = {}));
function input(config) {
const ret = new Input;
ret.layoutConfig = layoutConfig().just();

2
doric-js/index.d.ts vendored
View File

@ -720,7 +720,7 @@ declare module 'doric/lib/src/widget/input' {
export enum InputType {
Default = 0,
Number = 1,
NumberSigned = 2,
Decimal = 2,
Alphabet = 3,
Phone = 4
}

View File

@ -22,7 +22,7 @@ export declare class Input extends View {
export declare enum InputType {
Default = 0,
Number = 1,
NumberSigned = 2,
Decimal = 2,
Alphabet = 3,
Phone = 4
}

View File

@ -60,6 +60,10 @@ let Input = /** @class */ (() => {
Property,
__metadata("design:type", String)
], Input.prototype, "hintText", void 0);
__decorate([
Property,
__metadata("design:type", Number)
], Input.prototype, "inputType", void 0);
__decorate([
Property,
__metadata("design:type", Color)
@ -87,6 +91,14 @@ let Input = /** @class */ (() => {
return Input;
})();
export { Input };
export var InputType;
(function (InputType) {
InputType[InputType["Default"] = 0] = "Default";
InputType[InputType["Number"] = 1] = "Number";
InputType[InputType["Decimal"] = 2] = "Decimal";
InputType[InputType["Alphabet"] = 3] = "Alphabet";
InputType[InputType["Phone"] = 4] = "Phone";
})(InputType || (InputType = {}));
export function input(config) {
const ret = new Input;
ret.layoutConfig = layoutConfig().just();

View File

@ -3618,6 +3618,10 @@ let Input = /** @class */ (() => {
Property,
__metadata$a("design:type", String)
], Input.prototype, "hintText", void 0);
__decorate$a([
Property,
__metadata$a("design:type", Number)
], Input.prototype, "inputType", void 0);
__decorate$a([
Property,
__metadata$a("design:type", Color)
@ -3644,6 +3648,13 @@ let Input = /** @class */ (() => {
], Input.prototype, "maxLength", void 0);
return Input;
})();
(function (InputType) {
InputType[InputType["Default"] = 0] = "Default";
InputType[InputType["Number"] = 1] = "Number";
InputType[InputType["Decimal"] = 2] = "Decimal";
InputType[InputType["Alphabet"] = 3] = "Alphabet";
InputType[InputType["Phone"] = 4] = "Phone";
})(exports.InputType || (exports.InputType = {}));
function input(config) {
const ret = new Input;
ret.layoutConfig = layoutConfig().just();

File diff suppressed because one or more lines are too long