feat:add maxWidth and maxHeight for text
This commit is contained in:
@@ -1620,6 +1620,14 @@ var Text = /** @class */ (function (_super) {
|
||||
Property,
|
||||
__metadata$3("design:type", String)
|
||||
], Text.prototype, "font", void 0);
|
||||
__decorate$3([
|
||||
Property,
|
||||
__metadata$3("design:type", Number)
|
||||
], Text.prototype, "maxWidth", void 0);
|
||||
__decorate$3([
|
||||
Property,
|
||||
__metadata$3("design:type", Number)
|
||||
], Text.prototype, "maxHeight", void 0);
|
||||
return Text;
|
||||
}(View));
|
||||
function text(config) {
|
||||
|
@@ -1204,6 +1204,14 @@ __decorate$3([
|
||||
Property,
|
||||
__metadata$3("design:type", String)
|
||||
], Text.prototype, "font", void 0);
|
||||
__decorate$3([
|
||||
Property,
|
||||
__metadata$3("design:type", Number)
|
||||
], Text.prototype, "maxWidth", void 0);
|
||||
__decorate$3([
|
||||
Property,
|
||||
__metadata$3("design:type", Number)
|
||||
], Text.prototype, "maxHeight", void 0);
|
||||
function text(config) {
|
||||
const ret = new Text;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
|
@@ -2663,6 +2663,14 @@ __decorate$3([
|
||||
Property,
|
||||
__metadata$3("design:type", String)
|
||||
], Text.prototype, "font", void 0);
|
||||
__decorate$3([
|
||||
Property,
|
||||
__metadata$3("design:type", Number)
|
||||
], Text.prototype, "maxWidth", void 0);
|
||||
__decorate$3([
|
||||
Property,
|
||||
__metadata$3("design:type", Number)
|
||||
], Text.prototype, "maxHeight", void 0);
|
||||
function text(config) {
|
||||
const ret = new Text;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
|
4
doric-js/index.d.ts
vendored
4
doric-js/index.d.ts
vendored
@@ -472,6 +472,8 @@ declare module 'doric/lib/src/widget/text' {
|
||||
textAlignment?: Gravity;
|
||||
fontStyle?: "normal" | "bold" | "italic" | "bold_italic";
|
||||
font?: string;
|
||||
maxWidth?: number;
|
||||
maxHeight?: number;
|
||||
}
|
||||
export class Text extends View implements IText {
|
||||
text?: string;
|
||||
@@ -481,6 +483,8 @@ declare module 'doric/lib/src/widget/text' {
|
||||
textAlignment?: Gravity;
|
||||
fontStyle?: "normal" | "bold" | "italic" | "bold_italic";
|
||||
font?: string;
|
||||
maxWidth?: number;
|
||||
maxHeight?: number;
|
||||
}
|
||||
export function text(config: IText): Text;
|
||||
}
|
||||
|
4
doric-js/lib/src/widget/text.d.ts
vendored
4
doric-js/lib/src/widget/text.d.ts
vendored
@@ -9,6 +9,8 @@ export interface IText extends IView {
|
||||
textAlignment?: Gravity;
|
||||
fontStyle?: "normal" | "bold" | "italic" | "bold_italic";
|
||||
font?: string;
|
||||
maxWidth?: number;
|
||||
maxHeight?: number;
|
||||
}
|
||||
export declare class Text extends View implements IText {
|
||||
text?: string;
|
||||
@@ -18,5 +20,7 @@ export declare class Text extends View implements IText {
|
||||
textAlignment?: Gravity;
|
||||
fontStyle?: "normal" | "bold" | "italic" | "bold_italic";
|
||||
font?: string;
|
||||
maxWidth?: number;
|
||||
maxHeight?: number;
|
||||
}
|
||||
export declare function text(config: IText): Text;
|
||||
|
@@ -56,6 +56,14 @@ __decorate([
|
||||
Property,
|
||||
__metadata("design:type", String)
|
||||
], Text.prototype, "font", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Number)
|
||||
], Text.prototype, "maxWidth", void 0);
|
||||
__decorate([
|
||||
Property,
|
||||
__metadata("design:type", Number)
|
||||
], Text.prototype, "maxHeight", void 0);
|
||||
export function text(config) {
|
||||
const ret = new Text;
|
||||
ret.layoutConfig = layoutConfig().fit();
|
||||
|
@@ -26,6 +26,8 @@ export interface IText extends IView {
|
||||
textAlignment?: Gravity
|
||||
fontStyle?: "normal" | "bold" | "italic" | "bold_italic"
|
||||
font?: string
|
||||
maxWidth?: number
|
||||
maxHeight?: number
|
||||
}
|
||||
|
||||
export class Text extends View implements IText {
|
||||
@@ -49,6 +51,12 @@ export class Text extends View implements IText {
|
||||
|
||||
@Property
|
||||
font?: string
|
||||
|
||||
@Property
|
||||
maxWidth?: number
|
||||
|
||||
@Property
|
||||
maxHeight?: number
|
||||
}
|
||||
|
||||
export function text(config: IText) {
|
||||
|
Reference in New Issue
Block a user