|
|
@ -16,8 +16,7 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, { |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
var hasRecommendColors = BI.isNotNull(o.recommendColorsGetter()); |
|
|
|
var hasRecommendColors = BI.isNotNull(o.recommendColorsGetter()); |
|
|
|
return [{ |
|
|
|
return [{ |
|
|
|
el: { |
|
|
|
type: "bi.vertical", |
|
|
|
type: 'bi.vertical', |
|
|
|
|
|
|
|
items: [{ |
|
|
|
items: [{ |
|
|
|
el: { |
|
|
|
el: { |
|
|
|
type: "bi.vertical", |
|
|
|
type: "bi.vertical", |
|
|
@ -60,12 +59,12 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, { |
|
|
|
height: 22 |
|
|
|
height: 22 |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
el: hasRecommendColors ? { |
|
|
|
el: hasRecommendColors ? { |
|
|
|
type: 'bi.vertical', |
|
|
|
type: "bi.vertical", |
|
|
|
items: [{ |
|
|
|
items: [{ |
|
|
|
type: 'bi.label', |
|
|
|
type: "bi.label", |
|
|
|
text: BI.i18nText('BI-Basic_Recommend_Color'), |
|
|
|
text: BI.i18nText("BI-Basic_Recommend_Color"), |
|
|
|
textAlign: 'left', |
|
|
|
textAlign: "left", |
|
|
|
height: 24, |
|
|
|
height: 24 |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
type: "bi.hex_color_picker", |
|
|
|
type: "bi.hex_color_picker", |
|
|
|
cls: "bi-border-bottom bi-border-right", |
|
|
|
cls: "bi-border-bottom bi-border-right", |
|
|
@ -84,18 +83,18 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, { |
|
|
|
self.recommendColors = _ref; |
|
|
|
self.recommendColors = _ref; |
|
|
|
} |
|
|
|
} |
|
|
|
}] |
|
|
|
}] |
|
|
|
} : { type: 'bi.layout' }, |
|
|
|
} : {type: "bi.layout"}, |
|
|
|
tgap: hasRecommendColors ? 10 : 0, |
|
|
|
tgap: hasRecommendColors ? 10 : 0, |
|
|
|
height: hasRecommendColors ? 47 : 0 |
|
|
|
height: hasRecommendColors ? 47 : 0 |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
el: { |
|
|
|
el: { |
|
|
|
type: 'bi.layout', |
|
|
|
type: "bi.layout", |
|
|
|
cls: 'bi-border-top', |
|
|
|
cls: "bi-border-top" |
|
|
|
}, |
|
|
|
}, |
|
|
|
vgap: 10, |
|
|
|
vgap: 10, |
|
|
|
height: 1 |
|
|
|
height: 1 |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
type: 'bi.absolute', |
|
|
|
type: "bi.absolute", |
|
|
|
items: [{ |
|
|
|
items: [{ |
|
|
|
el: { |
|
|
|
el: { |
|
|
|
type: "bi.hex_color_picker", |
|
|
|
type: "bi.hex_color_picker", |
|
|
@ -111,14 +110,14 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, { |
|
|
|
}], |
|
|
|
}], |
|
|
|
ref: function (_ref) { |
|
|
|
ref: function (_ref) { |
|
|
|
self.colorPicker = _ref; |
|
|
|
self.colorPicker = _ref; |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
top: 0, |
|
|
|
top: 0, |
|
|
|
left: 0, |
|
|
|
left: 0, |
|
|
|
right: 0, |
|
|
|
right: 0, |
|
|
|
bottom: 1, |
|
|
|
bottom: 1 |
|
|
|
}], |
|
|
|
}], |
|
|
|
height: 80, |
|
|
|
height: 80 |
|
|
|
}] |
|
|
|
}] |
|
|
|
} |
|
|
|
} |
|
|
|
}, { |
|
|
|
}, { |
|
|
@ -186,11 +185,6 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, { |
|
|
|
tgap: 10, |
|
|
|
tgap: 10, |
|
|
|
height: 24 |
|
|
|
height: 24 |
|
|
|
}] |
|
|
|
}] |
|
|
|
}, |
|
|
|
|
|
|
|
left: 0, |
|
|
|
|
|
|
|
right: 0, |
|
|
|
|
|
|
|
top: 0, |
|
|
|
|
|
|
|
bottom: 0 |
|
|
|
|
|
|
|
}, { |
|
|
|
}, { |
|
|
|
type: "bi.absolute", |
|
|
|
type: "bi.absolute", |
|
|
|
items: [{ |
|
|
|
items: [{ |
|
|
@ -212,7 +206,6 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, { |
|
|
|
|
|
|
|
|
|
|
|
// 这里就实现的不好了,setValue里面有个editor,editor的setValue会检测错误然后出bubble提示
|
|
|
|
// 这里就实现的不好了,setValue里面有个editor,editor的setValue会检测错误然后出bubble提示
|
|
|
|
mounted: function () { |
|
|
|
mounted: function () { |
|
|
|
var self = this; |
|
|
|
|
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
|
if (BI.isNotNull(o.value)) { |
|
|
|
if (BI.isNotNull(o.value)) { |
|
|
|
this.setValue(o.value); |
|
|
|
this.setValue(o.value); |
|
|
@ -251,7 +244,7 @@ BI.HexColorChooserPopup = BI.inherit(BI.Widget, { |
|
|
|
return items; |
|
|
|
return items; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_getStoreColors: function() { |
|
|
|
_getStoreColors: function () { |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
var colorsArray = BI.string2Array(BI.Cache.getItem("colors") || ""); |
|
|
|
var colorsArray = BI.string2Array(BI.Cache.getItem("colors") || ""); |
|
|
|
return BI.filter(colorsArray, function (idx, color) { |
|
|
|
return BI.filter(colorsArray, function (idx, color) { |
|
|
|