Browse Source

JSY-35428 feat:增加选色控件传递可选颜色色值

research/test
Claire 11 months ago
parent
commit
bc3a1372a8
  1. 2
      packages/fineui/src/case/colorchooser/colorchooser.js
  2. 2
      packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js
  3. 4
      packages/fineui/typescript/case/colorchooser/colorchooser.ts

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

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

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

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

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

@ -5,6 +5,10 @@ export declare class ColorChooser extends Widget {
static EVENT_CHANGE: string; static EVENT_CHANGE: string;
static EVENT_AFTER_POPUPVIEW: string; static EVENT_AFTER_POPUPVIEW: string;
props: {
colorItems?: { value: string }[][];
};
isViewVisible(): boolean; isViewVisible(): boolean;
hideView(): void; hideView(): void;

Loading…
Cancel
Save