Browse Source

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

es6
iapyang 3 years ago
parent
commit
485c41384b
  1. 2
      package.json
  2. 30
      src/case/colorchooser/colorpicker/editor.colorpicker.hex.js
  3. 30
      src/case/colorchooser/colorpicker/editor.colorpicker.js
  4. 2
      src/core/6.inject.js
  5. 3
      src/core/wrapper/layout.js

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "fineui", "name": "fineui",
"version": "2.0.20211102143200", "version": "2.0.20211107204304",
"description": "fineui", "description": "fineui",
"main": "dist/fineui.min.js", "main": "dist/fineui.min.js",
"types": "dist/lib/index.d.ts", "types": "dist/lib/index.d.ts",

30
src/case/colorchooser/colorpicker/editor.colorpicker.hex.js

@ -72,20 +72,9 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
listeners: [{ listeners: [{
eventName: BI.ColorChooserShowButton.EVENT_CHANGE, eventName: BI.ColorChooserShowButton.EVENT_CHANGE,
action: function () { action: function () {
if (this.isSelected()) { var value = self.getValue();
self.lastColor = self.getValue(); self.setValue("transparent");
self.setValue("transparent"); (value !== "transparent") && self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
} else {
if (self.lastColor === "transparent") {
self.lastColor = "";
}
self.setValue(self.lastColor || "#ffffff");
}
if ((self.R.isValid() && self.G.isValid() && self.B.isValid()) ||
self._isEmptyRGB()) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
} }
}], }],
ref: function (_ref) { ref: function (_ref) {
@ -101,16 +90,9 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, {
listeners: [{ listeners: [{
eventName: BI.ColorChooserShowButton.EVENT_CHANGE, eventName: BI.ColorChooserShowButton.EVENT_CHANGE,
action: function () { action: function () {
if (this.isSelected()) { var value = self.getValue();
self.lastColor = self.getValue(); self.setValue("");
self.setValue(""); (value !== "") && self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
} else {
self.setValue(self.lastColor || "#ffffff");
}
if ((self.R.isValid() && self.G.isValid() && self.B.isValid()) || self._isEmptyRGB()) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
} }
}], }],
ref: function (_ref) { ref: function (_ref) {

30
src/case/colorchooser/colorpicker/editor.colorpicker.js

@ -72,16 +72,9 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
title: BI.i18nText("BI-Basic_Auto") title: BI.i18nText("BI-Basic_Auto")
}); });
this.none.on(BI.IconButton.EVENT_CHANGE, function () { this.none.on(BI.IconButton.EVENT_CHANGE, function () {
if (this.isSelected()) { var value = self.getValue();
self.lastColor = self.getValue(); self.setValue("");
self.setValue(""); (value !== "") && self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
} else {
self.setValue(self.lastColor || "#ffffff");
}
if ((self.R.isValid() && self.G.isValid() && self.B.isValid()) || self._isEmptyRGB()) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
}); });
this.transparent = BI.createWidget({ this.transparent = BI.createWidget({
@ -94,20 +87,9 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, {
title: BI.i18nText("BI-Transparent_Color") title: BI.i18nText("BI-Transparent_Color")
}); });
this.transparent.on(BI.IconButton.EVENT_CHANGE, function () { this.transparent.on(BI.IconButton.EVENT_CHANGE, function () {
if (this.isSelected()) { var value = self.getValue();
self.lastColor = self.getValue(); self.setValue("transparent");
self.setValue("transparent"); (value !== "transparent") && self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
} else {
if (self.lastColor === "transparent") {
self.lastColor = "";
}
self.setValue(self.lastColor || "#ffffff");
}
if ((self.R.isValid() && self.G.isValid() && self.B.isValid()) ||
self._isEmptyRGB()) {
self.colorShow.element.css("background-color", self.getValue());
self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE);
}
}); });
BI.createWidget({ BI.createWidget({

2
src/core/6.inject.js

@ -397,7 +397,7 @@
if (!providers[type]) { if (!providers[type]) {
providers[type] = new providerInjection[type](); providers[type] = new providerInjection[type]();
} }
if (!providerInstance[type]) { if (!providerInstance[type] && providers[type].$get) {
providerInstance[type] = new (providers[type].$get())(config); providerInstance[type] = new (providers[type].$get())(config);
} }
return providerInstance[type]; return providerInstance[type];

3
src/core/wrapper/layout.js

@ -240,7 +240,7 @@ BI.Layout = BI.inherit(BI.Widget, {
var w = this._newElement(newIndex, item); var w = this._newElement(newIndex, item);
// 需要有个地方临时存一下新建的组件,否则如果直接使用newIndex的话,newIndex位置的元素可能会被用到 // 需要有个地方临时存一下新建的组件,否则如果直接使用newIndex的话,newIndex位置的元素可能会被用到
this._children[this._getChildName(newIndex) + "-temp"] = w; this._children[this._getChildName(newIndex) + "-temp"] = w;
var nextSibling = del.element[0].nextSibling; var nextSibling = del.element.next();
if (nextSibling) { if (nextSibling) {
BI.Widget._renderEngine.createElement(nextSibling).before(w.element); BI.Widget._renderEngine.createElement(nextSibling).before(w.element);
} else { } else {
@ -420,6 +420,7 @@ BI.Layout = BI.inherit(BI.Widget, {
var shouldUpdate = this.shouldUpdateItem(oldIndex, vnode); var shouldUpdate = this.shouldUpdateItem(oldIndex, vnode);
var child = this._children[this._getChildName(oldIndex)]; var child = this._children[this._getChildName(oldIndex)];
if (shouldUpdate) { if (shouldUpdate) {
this._children[this._getChildName(newIndex) + "-temp"] = child;
return child._update(this._getOptions(vnode), shouldUpdate); return child._update(this._getOptions(vnode), shouldUpdate);
} }
if (shouldUpdate === null && !this._compare(oldVnode, vnode)) { if (shouldUpdate === null && !this._compare(oldVnode, vnode)) {

Loading…
Cancel
Save