diff --git a/packages/fineui/src/case/colorchooser/colorchooser.js b/packages/fineui/src/case/colorchooser/colorchooser.js index 7b075eae0..81d0594ea 100644 --- a/packages/fineui/src/case/colorchooser/colorchooser.js +++ b/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; diff --git a/packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js b/packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js index afde53a6a..d653de37a 100644 --- a/packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js +++ b/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, } ], }, diff --git a/packages/fineui/src/core/4.widget.js b/packages/fineui/src/core/4.widget.js index df12ef774..7ddf3b320 100644 --- a/packages/fineui/src/core/4.widget.js +++ b/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 { diff --git a/packages/fineui/typescript/case/colorchooser/colorchooser.ts b/packages/fineui/typescript/case/colorchooser/colorchooser.ts index b58869e37..ac429ef46 100644 --- a/packages/fineui/typescript/case/colorchooser/colorchooser.ts +++ b/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;