Browse Source

Revert "feat: 新增一个basic button装饰器"

This reverts commit 0f3e94688d.
es6
iapyang 4 years ago
parent
commit
efebc47b48
  1. 19
      typescript/component/basicbuttonwrapper/basic.button.wrapper.ts
  2. 24
      typescript/core/decorator/decorator.ts
  3. 4
      typescript/index.ts

19
typescript/component/basicbuttonwrapper/basic.button.wrapper.ts

@ -1,19 +0,0 @@
import { shortcut } from "../../core/decorator/decorator";
@shortcut()
export class BasicButtonWrapper extends BI.BasicButton {
public static xtype = 'bi.component.basic_button_wrapper';
public props: {
render(): any;
doClick(): void;
}
public render() {
return this.options.render();
}
public doClick() {
this.options.doClick();
}
}

24
typescript/core/decorator/decorator.ts

@ -1,5 +1,3 @@
import { BasicButtonWrapper } from "../../component/basicbuttonwrapper/basic.button.wrapper";
export type Constructor<T> = new(...args: any[]) => T;
/**
@ -29,28 +27,6 @@ export function model() {
};
}
/**
* render外包装basicButton
*/
export function click() {
return function (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) {
const render = descriptor.value;
descriptor.value = function(this:any, ...args: any[]) {
return {
type: BasicButtonWrapper.xtype,
cls: 'cursor-default',
render: () => render.apply(this, args),
doClick: () => {
this.fireEvent('click');
},
};
};
return descriptor;
};
}
/**
* _store属性
* @param Model model类

4
typescript/index.ts

@ -152,7 +152,6 @@ import { Tree, Node } from "./core/utils/tree";
import { TextNode } from "./base/single/button/node/textnode";
import { TextValueCheckComboPopup } from "./case/combo/textvaluecheckcombo/popup.textvaluecheck";
import { ImageButton } from './base/single/button/buttons/button.image';
import { BasicButtonWrapper } from "./component/basicbuttonwrapper/basic.button.wrapper";
export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils {
@ -310,12 +309,10 @@ export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils {
TextNode: typeof TextNode;
TextValueCheckComboPopup: typeof TextValueCheckComboPopup;
ImageButton: typeof ImageButton;
BasicButtonWrapper: typeof BasicButtonWrapper;
}
export default {
Decorators: decorator,
BasicButtonWrapper,
};
export {
OB,
@ -471,5 +468,4 @@ export {
TextNode,
TextValueCheckComboPopup,
ImageButton,
BasicButtonWrapper,
};

Loading…
Cancel
Save