Browse Source

Merge branch 'master' of ssh://code.fineres.com:7999/~dailer/fineui

research/test
翠屏山最速下山传说 1 year ago
parent
commit
6a9e826012
  1. 4
      packages/fineui/src/case/colorchooser/colorchooser.js
  2. 5
      packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js
  3. 6
      packages/fineui/src/core/4.widget.js
  4. 7
      packages/fineui/typescript/case/colorchooser/colorchooser.ts

4
packages/fineui/src/case/colorchooser/colorchooser.js

@ -24,6 +24,8 @@ export class ColorChooser extends Widget {
height: 24,
el: {},
simple: false,
colorItems: null,
colorBoardHeight: 80,
});
}
@ -62,6 +64,8 @@ export class ColorChooser extends Widget {
el: extend(
{
type: HexColorChooserPopup.xtype,
colorItems: o.colorItems,
colorBoardHeight: o.colorBoardHeight,
recommendColorsGetter: o.recommendColorsGetter,
ref: _ref => {
this.colorPicker = _ref;

5
packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js

@ -47,6 +47,8 @@ export class HexColorChooserPopup extends Widget {
width: 300,
recommendColorsGetter: emptyFn, // 推荐色获取接口
simple: false, // 简单模式, popup中没有自动和透明
colorItems: null,
colorBoardHeight: 80,
};
render() {
@ -167,6 +169,7 @@ export class HexColorChooserPopup extends Widget {
type: HexColorPicker.xtype,
space: true,
value: o.value,
items: o.colorItems,
listeners: [
{
eventName: ColorPicker.EVENT_CHANGE,
@ -187,7 +190,7 @@ export class HexColorChooserPopup extends Widget {
bottom: 1,
}
],
height: 80,
height: o.colorBoardHeight,
}
],
},

6
packages/fineui/src/core/4.widget.js

@ -241,7 +241,8 @@ export class Widget extends OB {
if (beforeRenderResult instanceof Promise) {
beforeRenderResult.then(render).catch((e) => {
_global.console && console.error(e);
!this.isDestroyed() && render(); // 异步render,改组件此时可能已经被销毁
// 异步render,组件此时可能已经被销毁
!this.isDestroyed() ? render() : _global.console && console.error('Async render error! Widget has been destroyed!');
});
}
} else {
@ -258,7 +259,8 @@ export class Widget extends OB {
if (beforeInitResult instanceof Promise) {
beforeInitResult.then(init).catch((e) => {
_global.console && console.error(e);
!this.isDestroyed() && init(); // 异步render,改组件此时可能已经被销毁
// 异步init,组件此时可能已经被销毁
!this.isDestroyed() ? init() : _global.console && console.error('Async init error! Widget has been destroyed!');
});
}
} else {

7
packages/fineui/typescript/case/colorchooser/colorchooser.ts

@ -1,3 +1,4 @@
import { Single } from 'typescript/base/single/single';
import { Widget } from '../../core/widget';
export declare class ColorChooser extends Widget {
@ -5,6 +6,12 @@ export declare class ColorChooser extends Widget {
static EVENT_CHANGE: string;
static EVENT_AFTER_POPUPVIEW: string;
props: {
stopEvent?: boolean;
colorBoardHeight?: number;
colorItems?: { value: string }[][];
} & Single["props"];
isViewVisible(): boolean;
hideView(): void;

Loading…
Cancel
Save