Browse Source

KERNEL-7826 refactor: 补充props声明

es6
Kira 4 years ago
parent
commit
dfc74134d8
  1. 13
      typescript/base/single/label/abstract.label.ts
  2. 9
      typescript/base/single/label/html.label.ts
  3. 1
      typescript/base/single/label/label.ts
  4. 5
      typescript/core/wrapper/layout/layout.grid.ts
  5. 3
      typescript/index.ts
  6. 8
      typescript/shims-tsx.ts

13
typescript/base/single/label/abstract.label.ts

@ -4,12 +4,13 @@ export declare class AbstractLabel extends Single {
static xtype: string; static xtype: string;
props: { props: {
textAlign: "left" | "center" | "right", textAlign: "left" | "center" | "right";
whiteSpace: "nowrap" | "normal", whiteSpace: "nowrap" | "normal";
textWidth: number | null, textWidth: number | null;
textHeight: number | null, textHeight: number | null;
highLight: boolean, highLight: boolean;
handler: Function | null, handler: Function | null;
text: string;
} & Single['props'] } & Single['props']
doRedMark(...args: any[]): void; doRedMark(...args: any[]): void;

9
typescript/base/single/label/html.label.ts

@ -0,0 +1,9 @@
import { AbstractLabel } from "./abstract.label";
export declare class HtmlLabel extends AbstractLabel {
props: {
lineHeight: number;
} & AbstractLabel['props'];
static xtype: string;
}

1
typescript/base/single/label/label.ts

@ -4,7 +4,6 @@ export declare class Label extends AbstractLabel {
props: { props: {
py: string; py: string;
keyword: string; keyword: string;
text: string;
} & AbstractLabel['props']; } & AbstractLabel['props'];
static xtype: string; static xtype: string;

5
typescript/core/wrapper/layout/layout.grid.ts

@ -2,4 +2,9 @@ import { Layout } from '../layout';
export declare class GridLayout extends Layout { export declare class GridLayout extends Layout {
static xtype: string; static xtype: string;
props: {
columns: number;
rows: number;
}
} }

3
typescript/index.ts

@ -168,6 +168,7 @@ import { TimeInterval } from './widget/timeinterval/timeinterval';
import { DynamicDateTimePane } from './widget/datetimepane/datetimepane'; import { DynamicDateTimePane } from './widget/datetimepane/datetimepane';
import { SingleSelectInsertList } from './widget/singleselect/singleselectlist.insert'; import { SingleSelectInsertList } from './widget/singleselect/singleselectlist.insert';
import { MultiSelectTree } from './widget/multiselecttree/multiselecttree'; import { MultiSelectTree } from './widget/multiselecttree/multiselecttree';
import { HtmlLabel } from "./base/single/label/html.label";
export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils { export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils {
@ -343,6 +344,7 @@ export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils {
DynamicDateTimePane: typeof DynamicDateTimePane; DynamicDateTimePane: typeof DynamicDateTimePane;
SingleSelectInsertList: typeof SingleSelectInsertList; SingleSelectInsertList: typeof SingleSelectInsertList;
MultiSelectTree: typeof MultiSelectTree; MultiSelectTree: typeof MultiSelectTree;
HtmlLabel: typeof HtmlLabel;
} }
export default { export default {
@ -518,4 +520,5 @@ export {
DynamicDateTimePane, DynamicDateTimePane,
SingleSelectInsertList, SingleSelectInsertList,
MultiSelectTree, MultiSelectTree,
HtmlLabel,
}; };

8
typescript/shims-tsx.ts

@ -15,6 +15,12 @@ interface UIProps {
hgap: number; hgap: number;
} }
// 一些布局的附加属性
interface AdditionalProps {
column: number;
row: number;
}
interface ElementClassProps<T> extends UIProps { interface ElementClassProps<T> extends UIProps {
cls: string; cls: string;
extraCls: string; extraCls: string;
@ -48,7 +54,7 @@ interface ElementClassProps<T> extends UIProps {
declare namespace JSX { declare namespace JSX {
// for undefined // for undefined
interface IntrinsicElements { interface IntrinsicElements {
[elemName: string]: Partial<UIProps>; [elemName: string]: Partial<UIProps & AdditionalProps>;
} }
interface ElementAttributesProperty { interface ElementAttributesProperty {

Loading…
Cancel
Save