From 41e13887387f014be89491128188f8821f162eda Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 15 Dec 2022 17:19:00 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E6=97=A0JRIA=20fix:=20=E5=86=8D=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E4=B8=80=E9=81=8D=E8=BE=93=E5=85=A5=E6=A1=86=E5=9C=86?= =?UTF-8?q?=E8=A7=92=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../colorpicker/button/button.colorshow.js | 38 +-- .../colorpicker/editor.colorpicker.hex.js | 274 +++++++++--------- .../editor.colorpicker.hex.simple.js | 170 +++++------ .../colorpicker/editor.colorpicker.js | 96 +++--- .../colorpicker/editor.colorpicker.simple.js | 64 ++-- 5 files changed, 337 insertions(+), 305 deletions(-) diff --git a/src/case/colorchooser/colorpicker/button/button.colorshow.js b/src/case/colorchooser/colorpicker/button/button.colorshow.js index 740a5d0a7..c9b2da438 100644 --- a/src/case/colorchooser/colorpicker/button/button.colorshow.js +++ b/src/case/colorchooser/colorpicker/button/button.colorshow.js @@ -6,30 +6,32 @@ BI.ColorChooserShowButton = BI.inherit(BI.BasicButton, { props: { - baseCls: 'bi-color-chooser-show-button bi-border bi-list-item-effect', + baseCls: 'bi-color-chooser-show-button bi-border bi-list-item-effect bi-border-radius', }, render: function () { var self = this, o = this.options; return { type: 'bi.htape', - items: [{ - el: { - type: "bi.icon_label", - ref: function (_ref) { - self.icon = _ref; + items: [ + { + el: { + type: "bi.icon_label", + ref: function (_ref) { + self.icon = _ref; + }, + iconWidth: 16, + iconHeight: 16, }, - iconWidth: 16, - iconHeight: 16, - }, - hgap: 20, - width: 16, - }, { - type: 'bi.label', - textAlign: 'left', - text: o.text, - }] - } + hgap: 20, + width: 16, + }, { + type: 'bi.label', + textAlign: 'left', + text: o.text, + } + ] + }; }, doClick: function () { @@ -40,4 +42,4 @@ BI.ColorChooserShowButton = BI.inherit(BI.BasicButton, { }, }); BI.ColorChooserShowButton.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.color_picker_show_button", BI.ColorChooserShowButton); \ No newline at end of file +BI.shortcut("bi.color_picker_show_button", BI.ColorChooserShowButton); diff --git a/src/case/colorchooser/colorpicker/editor.colorpicker.hex.js b/src/case/colorchooser/colorpicker/editor.colorpicker.hex.js index d2be8a8f9..22c66a250 100644 --- a/src/case/colorchooser/colorpicker/editor.colorpicker.hex.js +++ b/src/case/colorchooser/colorpicker/editor.colorpicker.hex.js @@ -21,7 +21,7 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options, c = this.constants; this.storeValue = {}; - var RGB = BI.createItems([{text: "R"}, {text: "G"}, {text: "B"}], { + var RGB = BI.createItems([{ text: "R" }, { text: "G" }, { text: "B" }], { type: "bi.label", cls: "color-picker-editor-label", height: 20 @@ -33,146 +33,162 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, { var Ws = BI.map(BI.range(0, 3), function () { return { type: "bi.small_text_editor", - cls: "color-picker-editor-input", + cls: "color-picker-editor-input bi-border-radius", validationChecker: checker, errorText: BI.i18nText("BI-Color_Picker_Error_Text"), allowBlank: true, value: 255, width: c.RGB_WIDTH, height: 24, - listeners: [{ - eventName: BI.TextEditor.EVENT_CHANGE, - action: function () { - self._checkEditors(); - if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) { - self.colorShow.element.css("background-color", self.getValue()); - self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); + listeners: [ + { + eventName: BI.TextEditor.EVENT_CHANGE, + action: function () { + self._checkEditors(); + if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) { + self.colorShow.element.css("background-color", self.getValue()); + self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); + } } } - }] + ] }; }); return { type: "bi.absolute", - items: [{ - el: { - type: "bi.vertical", - tgap: 10, - items: [{ - type: 'bi.vertical_adapt', - columnSize: ["fill", 'fill'], - height: 24, - items: [{ - type: "bi.color_picker_show_button", - cls: "trans-color-icon", - height: 22, - title: BI.i18nText("BI-Transparent_Color"), - text: BI.i18nText("BI-Transparent_Color"), - listeners: [{ - eventName: BI.ColorChooserShowButton.EVENT_CHANGE, - action: function () { - self.setValue("transparent"); - self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); - } - }], - ref: function (_ref) { - self.transparent = _ref; - } - }, { - el: { - type: "bi.color_picker_show_button", - cls: "auto-color-icon", - height: 22, - title: BI.i18nText("BI-Basic_Auto"), - text: BI.i18nText("BI-Basic_Auto"), - listeners: [{ - eventName: BI.ColorChooserShowButton.EVENT_CHANGE, - action: function () { - self.setValue(""); - self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); - } - }], - ref: function (_ref) { - self.none = _ref; - } - }, - lgap: 10, - }] - }, { - el: { - type: "bi.vertical_adapt", - columnSize: [22, 10, 'fill', 12, c.RGB_WIDTH, 12, c.RGB_WIDTH, 12, c.RGB_WIDTH], - - rgap: 5, - items: [{ - el: { - type: "bi.layout", - cls: "color-picker-editor-display bi-card bi-border", - height: 22, - width: 22, - ref: function (_ref) { - self.colorShow = _ref; - } - }, - width: 18 - }, { - type: "bi.label", - text: "#", - width: 10 - }, { - type: "bi.small_text_editor", - ref: function (_ref) { - self.hexEditor = _ref; - }, - cls: "color-picker-editor-input", - validationChecker: this._hexChecker, - allowBlank: true, - errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"), - width: c.HEX_WIDTH, + items: [ + { + el: { + type: "bi.vertical", + tgap: 10, + items: [ + { + type: 'bi.vertical_adapt', + columnSize: ["fill", 'fill'], height: 24, - listeners: [{ - eventName: "EVENT_CHANGE", - action: function () { - self._checkHexEditor(); - if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) { - self.colorShow.element.css("background-color", self.getValue()); - self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); + items: [ + { + type: "bi.color_picker_show_button", + cls: "trans-color-icon", + height: 22, + title: BI.i18nText("BI-Transparent_Color"), + text: BI.i18nText("BI-Transparent_Color"), + listeners: [ + { + eventName: BI.ColorChooserShowButton.EVENT_CHANGE, + action: function () { + self.setValue("transparent"); + self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); + } + } + ], + ref: function (_ref) { + self.transparent = _ref; } - + }, { + el: { + type: "bi.color_picker_show_button", + cls: "auto-color-icon", + height: 22, + title: BI.i18nText("BI-Basic_Auto"), + text: BI.i18nText("BI-Basic_Auto"), + listeners: [ + { + eventName: BI.ColorChooserShowButton.EVENT_CHANGE, + action: function () { + self.setValue(""); + self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); + } + } + ], + ref: function (_ref) { + self.none = _ref; + } + }, + lgap: 10, } - }] - }, RGB[0], { - el: BI.extend(Ws[0], { - ref: function (_ref) { - self.R = _ref - } - }), - width: c.RGB_WIDTH - }, RGB[1], { - el: BI.extend(Ws[1], { - ref: function (_ref) { - self.G = _ref - } - }), - width: c.RGB_WIDTH - }, RGB[2], { - el: BI.extend(Ws[2], { - ref: function (_ref) { - self.B = _ref - } - }), - rgap: -5, - width: c.RGB_WIDTH - }] - } - }] - }, - left: 0, - right: 0, - top: 0, - bottom: 0 - }] + ] + }, { + el: { + type: "bi.vertical_adapt", + columnSize: [22, 10, 'fill', 12, c.RGB_WIDTH, 12, c.RGB_WIDTH, 12, c.RGB_WIDTH], + + rgap: 5, + items: [ + { + el: { + type: "bi.layout", + cls: "color-picker-editor-display bi-card bi-border", + height: 22, + width: 22, + ref: function (_ref) { + self.colorShow = _ref; + } + }, + width: 18 + }, { + type: "bi.label", + text: "#", + width: 10 + }, { + type: "bi.small_text_editor", + ref: function (_ref) { + self.hexEditor = _ref; + }, + cls: "color-picker-editor-input bi-border-radius", + validationChecker: this._hexChecker, + allowBlank: true, + errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"), + width: c.HEX_WIDTH, + height: 24, + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function () { + self._checkHexEditor(); + if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) { + self.colorShow.element.css("background-color", self.getValue()); + self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); + } + + } + } + ] + }, RGB[0], { + el: BI.extend(Ws[0], { + ref: function (_ref) { + self.R = _ref; + } + }), + width: c.RGB_WIDTH + }, RGB[1], { + el: BI.extend(Ws[1], { + ref: function (_ref) { + self.G = _ref; + } + }), + width: c.RGB_WIDTH + }, RGB[2], { + el: BI.extend(Ws[2], { + ref: function (_ref) { + self.B = _ref; + } + }), + rgap: -5, + width: c.RGB_WIDTH + } + ] + } + } + ] + }, + left: 0, + right: 0, + top: 0, + bottom: 0 + } + ] }; }, @@ -181,13 +197,13 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, { }, _checkEditors: function () { - if(BI.isEmptyString(this.R.getValue())) { + if (BI.isEmptyString(this.R.getValue())) { this.R.setValue(0); } - if(BI.isEmptyString(this.G.getValue())) { + if (BI.isEmptyString(this.G.getValue())) { this.G.setValue(0); } - if(BI.isEmptyString(this.B.getValue())) { + if (BI.isEmptyString(this.B.getValue())) { this.B.setValue(0); } this.storeValue = { @@ -223,7 +239,7 @@ BI.HexColorPickerEditor = BI.inherit(BI.Widget, { } else if (color === "transparent") { this.colorShow.element.css("background-color", "").removeClass("auto-color-square-normal-background").addClass("trans-color-background"); } else { - this.colorShow.element.css({"background-color": color}).removeClass("auto-color-square-normal-background").removeClass("trans-color-background"); + this.colorShow.element.css({ "background-color": color }).removeClass("auto-color-square-normal-background").removeClass("trans-color-background"); } }, diff --git a/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js b/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js index 9e9c33e90..749806355 100644 --- a/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js +++ b/src/case/colorchooser/colorpicker/editor.colorpicker.hex.simple.js @@ -19,7 +19,7 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options, c = this.constants; - var RGB = BI.createItems([{text: "R"}, {text: "G"}, {text: "B"}], { + var RGB = BI.createItems([{ text: "R" }, { text: "G" }, { text: "B" }], { type: "bi.label", cls: "color-picker-editor-label", height: 20 @@ -31,97 +31,105 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, { var Ws = BI.map(BI.range(0, 3), function () { return { type: "bi.small_text_editor", - cls: "color-picker-editor-input", + cls: "color-picker-editor-input bi-border-radius", validationChecker: checker, errorText: BI.i18nText("BI-Color_Picker_Error_Text"), allowBlank: true, value: 255, width: c.RGB_WIDTH, height: 24, - listeners: [{ - eventName: BI.TextEditor.EVENT_CHANGE, - action: function () { - self._checkEditors(); - if (self.R.isValid() && self.G.isValid() && self.B.isValid()) { - self.colorShow.element.css("background-color", self.getValue()); - self.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE); + listeners: [ + { + eventName: BI.TextEditor.EVENT_CHANGE, + action: function () { + self._checkEditors(); + if (self.R.isValid() && self.G.isValid() && self.B.isValid()) { + self.colorShow.element.css("background-color", self.getValue()); + self.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE); + } } } - }] - } + ] + }; }); return { type: "bi.vertical", tgap: 10, - items: [{ - el: { - type: "bi.vertical_adapt", - rgap: 5, - columnSize: [22, 10, 'fill', 12, c.RGB_WIDTH, 12, c.RGB_WIDTH, 12, c.RGB_WIDTH], - items: [{ - el: { - type: "bi.layout", - cls: "color-picker-editor-display bi-card bi-border", - height: 22, - width: 22, - ref: function (_ref) { - self.colorShow = _ref; - } - }, - width: 18, - }, { - type: "bi.label", - text: "#", - width: 10 - }, { - type: "bi.small_text_editor", - ref: function (_ref) { - self.hexEditor = _ref; - }, - cls: "color-picker-editor-input", - validationChecker: this._hexChecker, - allowBlank: true, - errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"), - width: c.HEX_WIDTH, - height: 24, - listeners: [{ - eventName: "EVENT_CHANGE", - action: function () { - self._checkHexEditor(); - if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) { - self.colorShow.element.css("background-color", self.getValue()); - self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); - } - } - }] - }, RGB[0], { - el: BI.extend(Ws[0], { - ref: function (_ref) { - self.R = _ref - } - }), - width: c.RGB_WIDTH - }, RGB[1], { - el: BI.extend(Ws[1], { - ref: function (_ref) { - self.G = _ref + items: [ + { + el: { + type: "bi.vertical_adapt", + rgap: 5, + columnSize: [22, 10, 'fill', 12, c.RGB_WIDTH, 12, c.RGB_WIDTH, 12, c.RGB_WIDTH], + items: [ + { + el: { + type: "bi.layout", + cls: "color-picker-editor-display bi-card bi-border", + height: 22, + width: 22, + ref: function (_ref) { + self.colorShow = _ref; + } + }, + width: 18, + }, { + type: "bi.label", + text: "#", + width: 10 + }, { + type: "bi.small_text_editor", + ref: function (_ref) { + self.hexEditor = _ref; + }, + cls: "color-picker-editor-input bi-border-radius", + validationChecker: this._hexChecker, + allowBlank: true, + errorText: BI.i18nText("BI-Color_Picker_Error_Text_Hex"), + width: c.HEX_WIDTH, + height: 24, + listeners: [ + { + eventName: "EVENT_CHANGE", + action: function () { + self._checkHexEditor(); + if (checker(self.storeValue.r) && checker(self.storeValue.g) && checker(self.storeValue.b)) { + self.colorShow.element.css("background-color", self.getValue()); + self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE); + } + } + } + ] + }, RGB[0], { + el: BI.extend(Ws[0], { + ref: function (_ref) { + self.R = _ref; + } + }), + width: c.RGB_WIDTH + }, RGB[1], { + el: BI.extend(Ws[1], { + ref: function (_ref) { + self.G = _ref; + } + }), + width: c.RGB_WIDTH + }, RGB[2], { + el: BI.extend(Ws[2], { + ref: function (_ref) { + self.B = _ref; + } + }), + rgap: -5, + width: c.RGB_WIDTH } - }), - width: c.RGB_WIDTH - }, RGB[2], { - el: BI.extend(Ws[2], { - ref: function (_ref) { - self.B = _ref - } - }), - rgap: -5, - width: c.RGB_WIDTH - }] + ] + } } - }] + ] - } + }; }, _hexChecker: function (v) { @@ -129,13 +137,13 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, { }, _checkEditors: function () { - if(BI.isEmptyString(this.R.getValue())) { + if (BI.isEmptyString(this.R.getValue())) { this.R.setValue(0); } - if(BI.isEmptyString(this.G.getValue())) { + if (BI.isEmptyString(this.G.getValue())) { this.G.setValue(0); } - if(BI.isEmptyString(this.B.getValue())) { + if (BI.isEmptyString(this.B.getValue())) { this.B.setValue(0); } this.hexEditor.setValue(this.getValue().slice(this.constants.HEX_PREFIX_POSITION)); @@ -157,7 +165,7 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, { }, setValue: function (color) { - this.colorShow.element.css({"background-color": color}); + this.colorShow.element.css({ "background-color": color }); var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color)); this.R.setValue(BI.isNull(json.r) ? "" : json.r); this.G.setValue(BI.isNull(json.g) ? "" : json.g); @@ -174,4 +182,4 @@ BI.SimpleHexColorPickerEditor = BI.inherit(BI.Widget, { } }); BI.SimpleHexColorPickerEditor.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.simple_hex_color_picker_editor", BI.SimpleHexColorPickerEditor); \ No newline at end of file +BI.shortcut("bi.simple_hex_color_picker_editor", BI.SimpleHexColorPickerEditor); diff --git a/src/case/colorchooser/colorpicker/editor.colorpicker.js b/src/case/colorchooser/colorpicker/editor.colorpicker.js index 9d0dbbca0..982d333c3 100644 --- a/src/case/colorchooser/colorpicker/editor.colorpicker.js +++ b/src/case/colorchooser/colorpicker/editor.colorpicker.js @@ -29,7 +29,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, { height: 16, width: 16 }); - var RGB = BI.createWidgets(BI.createItems([{text: "R"}, {text: "G"}, {text: "B"}], { + var RGB = BI.createWidgets(BI.createItems([{ text: "R" }, { text: "G" }, { text: "B" }], { type: "bi.label", cls: "color-picker-editor-label", width: 20, @@ -41,7 +41,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, { }; var Ws = BI.createWidgets([{}, {}, {}], { type: "bi.small_text_editor", - cls: "color-picker-editor-input", + cls: "color-picker-editor-input bi-border-radius", validationChecker: checker, errorText: BI.i18nText("BI-Color_Picker_Error_Text"), allowBlank: true, @@ -95,56 +95,60 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, { BI.createWidget({ type: "bi.absolute", element: this, - items: [{ - el: { - type: "bi.vertical_adapt", - items: [{ - el: this.colorShow, - width: 16 - }, { - el: RGB[0], - width: 20 - }, { - el: this.R, - width: c.RGB_WIDTH - }, { - el: RGB[1], - width: 20 - }, { - el: this.G, - width: c.RGB_WIDTH - }, { - el: RGB[2], - width: 20 - }, { - el: this.B, - width: c.RGB_WIDTH - }, { - el: this.transparent, - width: 16, - lgap: 5 - }, { - el: this.none, - width: 16, - lgap: 5 - }] - }, - left: 10, - right: 10, - top: 0, - bottom: 0 - }] + items: [ + { + el: { + type: "bi.vertical_adapt", + items: [ + { + el: this.colorShow, + width: 16 + }, { + el: RGB[0], + width: 20 + }, { + el: this.R, + width: c.RGB_WIDTH + }, { + el: RGB[1], + width: 20 + }, { + el: this.G, + width: c.RGB_WIDTH + }, { + el: RGB[2], + width: 20 + }, { + el: this.B, + width: c.RGB_WIDTH + }, { + el: this.transparent, + width: 16, + lgap: 5 + }, { + el: this.none, + width: 16, + lgap: 5 + } + ] + }, + left: 10, + right: 10, + top: 0, + bottom: 0 + } + ] }); }, _checkEditors: function () { - if(BI.isEmptyString(this.R.getValue())) { + if (BI.isEmptyString(this.R.getValue())) { this.R.setValue(0); } - if(BI.isEmptyString(this.G.getValue())) { + if (BI.isEmptyString(this.G.getValue())) { this.G.setValue(0); } - if(BI.isEmptyString(this.B.getValue())) { + if (BI.isEmptyString(this.B.getValue())) { this.B.setValue(0); } this.storeValue = { @@ -164,7 +168,7 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, { } else if (color === "transparent") { this.colorShow.element.css("background-color", "").removeClass("auto-color-normal-background").addClass("trans-color-background"); } else { - this.colorShow.element.css({"background-color": color}).removeClass("auto-color-normal-background").removeClass("trans-color-background"); + this.colorShow.element.css({ "background-color": color }).removeClass("auto-color-normal-background").removeClass("trans-color-background"); } }, @@ -223,4 +227,4 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, { } }); BI.ColorPickerEditor.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.color_picker_editor", BI.ColorPickerEditor); \ No newline at end of file +BI.shortcut("bi.color_picker_editor", BI.ColorPickerEditor); diff --git a/src/case/colorchooser/colorpicker/editor.colorpicker.simple.js b/src/case/colorchooser/colorpicker/editor.colorpicker.simple.js index 32943ecee..63b7576b4 100644 --- a/src/case/colorchooser/colorpicker/editor.colorpicker.simple.js +++ b/src/case/colorchooser/colorpicker/editor.colorpicker.simple.js @@ -28,7 +28,7 @@ BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, { height: 16, width: 16 }); - var RGB = BI.createWidgets(BI.createItems([{text: "R"}, {text: "G"}, {text: "B"}], { + var RGB = BI.createWidgets(BI.createItems([{ text: "R" }, { text: "G" }, { text: "B" }], { type: "bi.label", cls: "color-picker-editor-label", width: 20, @@ -40,7 +40,7 @@ BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, { }; var Ws = BI.createWidgets([{}, {}, {}], { type: "bi.small_text_editor", - cls: "color-picker-editor-input", + cls: "color-picker-editor-input bi-border-radius", validationChecker: checker, errorText: BI.i18nText("BI-Color_Picker_Error_Text"), allowBlank: true, @@ -64,47 +64,49 @@ BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, { BI.createWidget({ type: "bi.vertical_adapt", element: this, - items: [{ - el: this.colorShow, - width: 16, - lgap: 20, - rgap: 15 - }, { - el: RGB[0], - width: 20 - }, { - el: this.R, - width: c.RGB_WIDTH - }, { - el: RGB[1], - width: 20 - }, { - el: this.G, - width: c.RGB_WIDTH - }, { - el: RGB[2], - width: 20 - }, { - el: this.B, - width: c.RGB_WIDTH - }] + items: [ + { + el: this.colorShow, + width: 16, + lgap: 20, + rgap: 15 + }, { + el: RGB[0], + width: 20 + }, { + el: this.R, + width: c.RGB_WIDTH + }, { + el: RGB[1], + width: 20 + }, { + el: this.G, + width: c.RGB_WIDTH + }, { + el: RGB[2], + width: 20 + }, { + el: this.B, + width: c.RGB_WIDTH + } + ] }); }, _checkEditors: function () { - if(BI.isEmptyString(this.R.getValue())) { + if (BI.isEmptyString(this.R.getValue())) { this.R.setValue(0); } - if(BI.isEmptyString(this.G.getValue())) { + if (BI.isEmptyString(this.G.getValue())) { this.G.setValue(0); } - if(BI.isEmptyString(this.B.getValue())) { + if (BI.isEmptyString(this.B.getValue())) { this.B.setValue(0); } }, setValue: function (color) { - this.colorShow.element.css({"background-color": color}); + this.colorShow.element.css({ "background-color": color }); var json = BI.DOM.rgb2json(BI.DOM.hex2rgb(color)); this.R.setValue(BI.isNull(json.r) ? "" : json.r); this.G.setValue(BI.isNull(json.g) ? "" : json.g); @@ -120,4 +122,4 @@ BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, { } }); BI.SimpleColorPickerEditor.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.simple_color_picker_editor", BI.SimpleColorPickerEditor); \ No newline at end of file +BI.shortcut("bi.simple_color_picker_editor", BI.SimpleColorPickerEditor); From 1f424148c29504ca8f208e47fa64385fda50b9e6 Mon Sep 17 00:00:00 2001 From: data Date: Thu, 15 Dec 2022 22:05:59 +0800 Subject: [PATCH 02/10] auto upgrade version to 2.0.20221215220552 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 211e2bb1c..c78febdb4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221215171537", + "version": "2.0.20221215220552", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 795f0f038985c5419afd28b608cd8787a8add0e9 Mon Sep 17 00:00:00 2001 From: data Date: Thu, 15 Dec 2022 22:16:43 +0800 Subject: [PATCH 03/10] auto upgrade version to 2.0.20221215221629 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c78febdb4..194b09f6d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221215220552", + "version": "2.0.20221215221629", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 0684c11e2b82962cd83d3eee13a2be8942423d89 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 16 Dec 2022 10:05:25 +0800 Subject: [PATCH 04/10] auto upgrade version to 2.0.20221216100516 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 194b09f6d..806ed86bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221215221629", + "version": "2.0.20221216100516", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 62b9aa0326207798d1357d33cd9ec7ad3c4f53f5 Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 16 Dec 2022 11:19:42 +0800 Subject: [PATCH 05/10] =?UTF-8?q?KERNEL-13893=20feat:=20=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=99=A8=E9=BB=98=E8=AE=A4=E8=89=B2=E6=9D=BF?= =?UTF-8?q?=E5=80=99=E9=80=89=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../colorpicker/colorpicker.hex.js | 261 +++++++++++------- 1 file changed, 158 insertions(+), 103 deletions(-) diff --git a/src/case/colorchooser/colorpicker/colorpicker.hex.js b/src/case/colorchooser/colorpicker/colorpicker.hex.js index 993607841..8154b9c23 100644 --- a/src/case/colorchooser/colorpicker/colorpicker.hex.js +++ b/src/case/colorchooser/colorpicker/colorpicker.hex.js @@ -11,118 +11,173 @@ BI.HexColorPicker = BI.inherit(BI.Widget, { }, _items: [ - [{ - value: "#808080" - }, { - value: "#ffffff" - }, { - value: "#ffebe5" - }, { - value: "#ffddba" - }, { - value: "#ffeebb" - }, { - value: "#d4e9bf" - }, { - value: "#c7e1e1" - }, { - value: "#bfe3f0" - }, { - value: "#ccd6eb" - }], - [{ - value: "#616161" - }, { - value: "#f2f2f2" - }, { - value: "#ffd6cc" - }, { - value: "#ffb87a" - }, { - value: "#ffdf91" - }, { - value: "#b7d2b6" - }, { - value: "#a3d2c9" - }, { - value: "#8ab6d6" - }, { - value: "#bcbce0" - }], - [{ - value: "#404040" - }, { - value: "#dedede" - }, { - value: "#ffab9b" - }, { - value: "#eb8a3a" - }, { - value: "#ffc947" - }, { - value: "#8aa964" - }, { - value: "#5eaaa0" - }, { - value: "#2978b5" - }, { - value: "#8f8faa" - }], - [{ - value: "#202020" - }, { - value: "#bfbfbf" - }, { - value: "#df7461" - }, { - value: "#cf7536" - }, { - value: "#e6b63b" - }, { - value: "#5b8a72" - }, { - value: "#3b9aa3" - }, { - value: "#336291" - }, { - value: "#58568f" - }], - [{ - value: "#000000" - }, { - value: "#a1a1a1" - }, { - value: "#b55140" - }, { - value: "#a6713c" - }, { - value: "#ad975f" - }, { - value: "#5f7d6e" - }, { - value: "#3b7480" - }, { - value: "#425d78" - }, { - value: "#62608a" - }] + [ + { + "value": "#999999" + }, + { + "value": "#FFFFFF" + }, + { + "value": "#FFE5E5" + }, + { + "value": "#FFF1E5" + }, + { + "value": "#FFF9E5" + }, + { + "value": "#E9F5E9" + }, + { + "value": "#EAEEFF" + }, + { + "value": "#EFEBF7" + }, + { + "value": "#FCE8EF" + } + ], + [ + { + "value": "#737373" + }, + { + "value": "#F2F2F2" + }, + { + "value": "#FFA6A6" + }, + { + "value": "#FFD0A6" + }, + { + "value": "#FFEDA6" + }, + { + "value": "#B3DCB2" + }, + { + "value": "#B9C6FF" + }, + { + "value": "#CABAE6" + }, + { + "value": "#F8B1C9" + } + ], + [ + { + "value": "#4C4C4C" + }, + { + "value": "#D9D9D9" + }, + { + "value": "#FF5959" + }, + { + "value": "#FFA759" + }, + { + "value": "#FFDD59" + }, + { + "value": "#7EBE70" + }, + { + "value": "#7B95FF" + }, + { + "value": "#9C7FD0" + }, + { + "value": "#F06D99" + } + ], + [ + { + "value": "#262626" + }, + { + "value": "#BFBFBF" + }, + { + "value": "#FF0000" + }, + { + "value": "#FF7800" + }, + { + "value": "#FFCB00" + }, + { + "value": "#259B23" + }, + { + "value": "#355CFF" + }, + { + "value": "#673AB7" + }, + { + "value": "#E91E63" + } + ], + [ + { + "value": "#000000" + }, + { + "value": "#A6A6A6" + }, + { + "value": "#A80000" + }, + { + "value": "#B65600" + }, + { + "value": "#CEB000" + }, + { + "value": "#0E550C" + }, + { + "value": "#09269C" + }, + { + "value": "#3A1A73" + }, + { + "value": "#B30072" + } + ] ], render: function () { var self = this, o = this.options; + return { type: "bi.button_group", items: this._digest(o.items || this._items), - layouts: [{ - type: "bi.grid", - }], + layouts: [ + { + type: "bi.grid", + } + ], value: o.value, - listeners: [{ - eventName: BI.ButtonGroup.EVENT_CHANGE, - action: function () { - self.fireEvent(BI.HexColorPicker.EVENT_CHANGE, arguments); + listeners: [ + { + eventName: BI.ButtonGroup.EVENT_CHANGE, + action: function () { + self.fireEvent(BI.HexColorPicker.EVENT_CHANGE, arguments); + } } - }], + ], ref: function (_ref) { self.colors = _ref; } From e40e4ff43b13183e851847567e88082420b90cf7 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 16 Dec 2022 11:44:00 +0800 Subject: [PATCH 06/10] auto upgrade version to 2.0.20221216114354 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 806ed86bf..e9a08f146 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221216100516", + "version": "2.0.20221216114354", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 1d0e5930c1d2e6cc0cef7fec87d632b1479f0a17 Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 16 Dec 2022 14:24:11 +0800 Subject: [PATCH 07/10] =?UTF-8?q?BI-117667=20fix:=20=E3=80=906.0.5?= =?UTF-8?q?=E5=86=92=E7=83=9F=E3=80=91=E6=95=B0=E5=80=BC=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=A4=9A=E4=B8=AA=E9=80=89=E9=A1=B9=EF=BC=8C?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=B7=B2=E9=80=89=E7=82=B9=E5=87=BB=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=9B=B4=E5=A4=9A=E5=B1=95=E7=A4=BA=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../multiselect/check/multiselect.display.js | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/widget/multiselect/check/multiselect.display.js b/src/widget/multiselect/check/multiselect.display.js index b5b4f76e8..30442583c 100644 --- a/src/widget/multiselect/check/multiselect.display.js +++ b/src/widget/multiselect/check/multiselect.display.js @@ -40,10 +40,12 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, { }, items: this._createItems(opts.items), chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI, - layouts: [{ - type: "bi.vertical", - lgap: 10 - }] + layouts: [ + { + type: "bi.vertical", + lgap: 10 + } + ] }, itemsCreator: function (options, callback) { if (options.times === 1) { @@ -53,10 +55,7 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, { if (cacheItems.length > 0) { var renderedItems = cacheItems.slice(0, 100); cacheItems = cacheItems.slice(100); - self.hasNext = true; - if (cacheItems.length === 0) { - self.hasNext = false; - } + self.hasNext = cacheItems.length > 0; callback(self._createItems(renderedItems)); return; } @@ -65,8 +64,8 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, { self.hasNext = !!ob.hasNext; var firstItemsCount = 100 + ob.items.length % 100; if (ob.items.length > 100) { - cacheItems = ob.items.slice(100 + ob.items.length % 100); - self.hasNext = true; + cacheItems = ob.items.slice(firstItemsCount); + self.hasNext = (firstItemsCount === ob.items.length) ? false : true; } callback(self._createItems(ob.items.slice(0, firstItemsCount))); }); @@ -104,4 +103,4 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, { } }); -BI.shortcut("bi.display_selected_list", BI.DisplaySelectedList); \ No newline at end of file +BI.shortcut("bi.display_selected_list", BI.DisplaySelectedList); From 8fce13ef6937e2a0220b35fca256e2772c04c3c9 Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 16 Dec 2022 17:02:33 +0800 Subject: [PATCH 08/10] =?UTF-8?q?BI-118262=20fix:=20=E6=A0=91=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E7=BB=84=E4=BB=B6=E6=90=9C=E7=B4=A2=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 搜索面板点击node,会发请求去adjust数据,回调之后才发change事件,如果在这之前点确定,_datachange还没有发生呢 当然即使这样,外部getValue的数据也可能是没adjust的数据,这就是另外的问题了 --- src/case/ztree/parttree.js | 8 +- src/widget/multitree/multi.tree.combo.js | 124 ++++++++------- .../multitree/multi.tree.insert.combo.js | 143 ++++++++++-------- .../trigger/multi.tree.search.insert.pane.js | 108 +++++++------ .../trigger/multi.tree.search.pane.js | 30 ++-- .../multitree/trigger/searcher.multi.tree.js | 31 ++-- 6 files changed, 249 insertions(+), 195 deletions(-) diff --git a/src/case/ztree/parttree.js b/src/case/ztree/parttree.js index 974196b33..8a347548a 100644 --- a/src/case/ztree/parttree.js +++ b/src/case/ztree/parttree.js @@ -37,6 +37,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, { var self = this, o = this.options; var parentValues = BI.deepClone(treeNode.parentValues || self._getParentValues(treeNode)); var name = this._getNodeValue(treeNode); + this.fireEvent(BI.PartTree.EVENT_CLICK_TREE_NODE); if (treeNode.checked === true) { this.options.paras.selectedValues = this._getUnionValue(); // this._buildTree(self.options.paras.selectedValues, BI.concat(parentValues, name)); @@ -80,7 +81,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, { var rootNoots = this.nodes.getNodes(); track(rootNoots); - function track (nodes) { + function track(nodes) { BI.each(nodes, function (i, node) { var checkState = node.getCheckStatus(); if (checkState.checked === false) { @@ -135,7 +136,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, { self.fireEvent(BI.Events.AFTERINIT); }; - function callback (nodes) { + function callback(nodes) { if (self._stop === true) { return; } @@ -171,7 +172,7 @@ BI.PartTree = BI.inherit(BI.AsyncTree, { track([], valueA, valueB); track([], valueB, valueA); - function track (parent, node, compare) { + function track(parent, node, compare) { BI.each(node, function (n, item) { if (BI.isNull(compare[n])) { self._addTreeNode(map, parent, n, item); @@ -197,4 +198,5 @@ BI.PartTree = BI.inherit(BI.AsyncTree, { } }); +BI.PartTree.EVENT_CLICK_TREE_NODE = "EVENT_CLICK_TREE_NODE"; BI.shortcut("bi.part_tree", BI.PartTree); diff --git a/src/widget/multitree/multi.tree.combo.js b/src/widget/multitree/multi.tree.combo.js index bdf374f07..5fca0ca4f 100644 --- a/src/widget/multitree/multi.tree.combo.js +++ b/src/widget/multitree/multi.tree.combo.js @@ -42,7 +42,15 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { }, searcher: { type: "bi.multi_tree_searcher", - itemsCreator: o.itemsCreator + itemsCreator: o.itemsCreator, + listeners: [ + { + eventName: BI.MultiTreeSearcher.EVENT_CLICK_TREE_NODE, + action: function () { + self._dataChange = true; + } + } + ], }, value: { value: o.value || {} } }); @@ -61,43 +69,45 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { self.trigger.setAdapter(this); self.numberCounter.setAdapter(this); }, - listeners: [{ - eventName: BI.MultiTreePopup.EVENT_AFTERINIT, - action: function () { - self.numberCounter.adjustView(); - isInit = true; - if (want2showCounter === true) { - showCounter(); + listeners: [ + { + eventName: BI.MultiTreePopup.EVENT_AFTERINIT, + action: function () { + self.numberCounter.adjustView(); + isInit = true; + if (want2showCounter === true) { + showCounter(); + } + } + }, { + eventName: BI.MultiTreePopup.EVENT_CHANGE, + action: function () { + change = true; + var val = { + type: BI.Selection.Multi, + value: this.hasChecked() ? this.getValue() : {} + }; + self.trigger.getSearcher().setState(val); + self.numberCounter.setButtonChecked(val); + self.storeValue = { value: self.combo.getValue() }; + self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM, self.combo.getValue()); + self._dataChange = true; + } + }, { + eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM, + action: function () { + self.combo.hideView(); + } + }, { + eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR, + action: function () { + clear = true; + self._dataChange = true; + self.setValue(); + self._defaultState(); } } - }, { - eventName: BI.MultiTreePopup.EVENT_CHANGE, - action: function () { - change = true; - var val = { - type: BI.Selection.Multi, - value: this.hasChecked() ? this.getValue() : {} - }; - self.trigger.getSearcher().setState(val); - self.numberCounter.setButtonChecked(val); - self.storeValue = { value: self.combo.getValue() }; - self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM, self.combo.getValue()); - self._dataChange = true; - } - }, { - eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM, - action: function () { - self.combo.hideView(); - } - }, { - eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR, - action: function () { - clear = true; - self._dataChange = true; - self.setValue(); - self._defaultState(); - } - }], + ], itemsCreator: o.itemsCreator, onLoaded: function () { BI.nextTick(function () { @@ -293,26 +303,28 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, { BI.createWidget({ type: "bi.absolute", element: this, - items: [{ - el: this.combo, - left: 0, - right: 0, - top: 0, - bottom: 0 - }, { - el: triggerBtn, - right: 0, - top: 0, - bottom: 0 - }, { - el: { - type: "bi.vertical_adapt", - items: [this.numberCounter] - }, - right: o.height, - top: 0, - bottom: 0 - }] + items: [ + { + el: this.combo, + left: 0, + right: 0, + top: 0, + bottom: 0 + }, { + el: triggerBtn, + right: 0, + top: 0, + bottom: 0 + }, { + el: { + type: "bi.vertical_adapt", + items: [this.numberCounter] + }, + right: o.height, + top: 0, + bottom: 0 + } + ] }); }, diff --git a/src/widget/multitree/multi.tree.insert.combo.js b/src/widget/multitree/multi.tree.insert.combo.js index 6db34dc61..acacbb875 100644 --- a/src/widget/multitree/multi.tree.insert.combo.js +++ b/src/widget/multitree/multi.tree.insert.combo.js @@ -47,18 +47,25 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { itemsCreator: o.itemsCreator, popup: { type: "bi.multi_tree_search_insert_pane", - listeners: [{ - eventName: BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM, - action: function () { - self.storeValue.value[self.trigger.getSearcher().getKeyword()] = {}; - self._assertShowValue(); - // setValue以更新paras.value, 之后从search popup中拿到的就能有add的值了 - self.combo.setValue(self.storeValue); - self.numberCounter.setValue(self.storeValue); - self._stopEditing(); - self._dataChange = true; + listeners: [ + { + eventName: BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM, + action: function () { + self.storeValue.value[self.trigger.getSearcher().getKeyword()] = {}; + self._assertShowValue(); + // setValue以更新paras.value, 之后从search popup中拿到的就能有add的值了 + self.combo.setValue(self.storeValue); + self.numberCounter.setValue(self.storeValue); + self._stopEditing(); + self._dataChange = true; + } + }, { + eventName: BI.MultiTreeSearchInsertPane.EVENT_CLICK_TREE_NODE, + action: function () { + self._dataChange = true; + } } - }] + ] } }, value: { value: o.value || {} } @@ -79,43 +86,45 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { self.trigger.setAdapter(this); self.numberCounter.setAdapter(this); }, - listeners: [{ - eventName: BI.MultiTreePopup.EVENT_AFTERINIT, - action: function () { - self.numberCounter.adjustView(); - isInit = true; - if (want2showCounter === true) { - showCounter(); + listeners: [ + { + eventName: BI.MultiTreePopup.EVENT_AFTERINIT, + action: function () { + self.numberCounter.adjustView(); + isInit = true; + if (want2showCounter === true) { + showCounter(); + } + } + }, { + eventName: BI.MultiTreePopup.EVENT_CHANGE, + action: function () { + change = true; + var val = { + type: BI.Selection.Multi, + value: this.hasChecked() ? this.getValue() : {} + }; + self.trigger.getSearcher().setState(val); + self.numberCounter.setButtonChecked(val); + self.storeValue = { value: self.combo.getValue() }; + self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.getValue()); + self._dataChange = true; + } + }, { + eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM, + action: function () { + self.combo.hideView(); + } + }, { + eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR, + action: function () { + clear = true; + self._dataChange = true; + self.setValue(); + self._defaultState(); } } - }, { - eventName: BI.MultiTreePopup.EVENT_CHANGE, - action: function () { - change = true; - var val = { - type: BI.Selection.Multi, - value: this.hasChecked() ? this.getValue() : {} - }; - self.trigger.getSearcher().setState(val); - self.numberCounter.setButtonChecked(val); - self.storeValue = { value: self.combo.getValue() }; - self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.getValue()); - self._dataChange = true; - } - }, { - eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM, - action: function () { - self.combo.hideView(); - } - }, { - eventName: BI.MultiTreePopup.EVENT_CLICK_CLEAR, - action: function () { - clear = true; - self._dataChange = true; - self.setValue(); - self._defaultState(); - } - }], + ], itemsCreator: o.itemsCreator, onLoaded: function () { BI.nextTick(function () { @@ -303,26 +312,28 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, { BI.createWidget({ type: "bi.absolute", element: this, - items: [{ - el: this.combo, - left: 0, - right: 0, - top: 0, - bottom: 0 - }, { - el: triggerBtn, - right: 0, - top: 0, - bottom: 0 - }, { - el: { - type: "bi.vertical_adapt", - items: [this.numberCounter] - }, - right: o.height, - top: 0, - height: o.height, - }] + items: [ + { + el: this.combo, + left: 0, + right: 0, + top: 0, + bottom: 0 + }, { + el: triggerBtn, + right: 0, + top: 0, + bottom: 0 + }, { + el: { + type: "bi.vertical_adapt", + items: [this.numberCounter] + }, + right: o.height, + top: 0, + height: o.height, + } + ] }); }, diff --git a/src/widget/multitree/trigger/multi.tree.search.insert.pane.js b/src/widget/multitree/trigger/multi.tree.search.insert.pane.js index cc5bff3c9..345d8dab2 100644 --- a/src/widget/multitree/trigger/multi.tree.search.insert.pane.js +++ b/src/widget/multitree/trigger/multi.tree.search.insert.pane.js @@ -25,55 +25,64 @@ BI.MultiTreeSearchInsertPane = BI.inherit(BI.Widget, { return { type: "bi.absolute", - items: [{ - el: { - type: "bi.text_button", - invisible: true, - ref: function (_ref) { - self.addTip = _ref; - }, - text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""), - height: this.constants.height, - cls: "bi-high-light", - handler: function () { - self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM, opts.keywordGetter()); - } - }, - top: 5, - left: 0, - right: 0 - }, { - el: BI.extend({ - type: "bi.part_tree", - tipText: BI.i18nText("BI-No_Select"), - itemsCreator: function (op, callback) { - op.keyword = opts.keywordGetter(); - opts.itemsCreator(op, function (res) { - callback(res); - self.setKeyword(opts.keywordGetter(), res.items); - }); - }, - ref: function (_ref) { - self.partTree = _ref; - }, - value: opts.value, - listeners: [{ - eventName: BI.Controller.EVENT_CHANGE, - action: function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + items: [ + { + el: { + type: "bi.text_button", + invisible: true, + ref: function (_ref) { + self.addTip = _ref; + }, + text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""), + height: this.constants.height, + cls: "bi-high-light", + handler: function () { + self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM, opts.keywordGetter()); } - }, { - eventName: BI.TreeView.EVENT_CHANGE, - action: function () { - self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_CHANGE); - } - }] - }, opts.el), - left: 0, - top: 0, - bottom: 0, - right: 0 - }] + }, + top: 5, + left: 0, + right: 0 + }, { + el: BI.extend({ + type: "bi.part_tree", + tipText: BI.i18nText("BI-No_Select"), + itemsCreator: function (op, callback) { + op.keyword = opts.keywordGetter(); + opts.itemsCreator(op, function (res) { + callback(res); + self.setKeyword(opts.keywordGetter(), res.items); + }); + }, + ref: function (_ref) { + self.partTree = _ref; + }, + value: opts.value, + listeners: [ + { + eventName: BI.Controller.EVENT_CHANGE, + action: function () { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + } + }, { + eventName: BI.TreeView.EVENT_CHANGE, + action: function () { + self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_CHANGE); + } + }, { + eventName: BI.PartTree.EVENT_CLICK_TREE_NODE, + action: function () { + self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_CLICK_TREE_NODE); + } + } + ] + }, opts.el), + left: 0, + top: 0, + bottom: 0, + right: 0 + } + ] }; }, @@ -115,5 +124,6 @@ BI.MultiTreeSearchInsertPane.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiTreeSearchInsertPane.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM"; BI.MultiTreeSearchInsertPane.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR"; BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM = "EVENT_ADD_ITEM"; +BI.MultiTreeSearchInsertPane.EVENT_CLICK_TREE_NODE = "EVENT_CLICK_TREE_NODE"; -BI.shortcut("bi.multi_tree_search_insert_pane", BI.MultiTreeSearchInsertPane); \ No newline at end of file +BI.shortcut("bi.multi_tree_search_insert_pane", BI.MultiTreeSearchInsertPane); diff --git a/src/widget/multitree/trigger/multi.tree.search.pane.js b/src/widget/multitree/trigger/multi.tree.search.pane.js index a18ab2a04..82c221d18 100644 --- a/src/widget/multitree/trigger/multi.tree.search.pane.js +++ b/src/widget/multitree/trigger/multi.tree.search.pane.js @@ -25,17 +25,24 @@ BI.MultiTreeSearchPane = BI.inherit(BI.Pane, { opts.itemsCreator(op, callback); }, value: opts.value, - listeners: [{ - eventName: BI.Controller.EVENT_CHANGE, - action: function () { - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + listeners: [ + { + eventName: BI.Controller.EVENT_CHANGE, + action: function () { + self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); + } + }, { + eventName: BI.TreeView.EVENT_CHANGE, + action: function () { + self.fireEvent(BI.MultiTreeSearchPane.EVENT_CHANGE); + } + }, { + eventName: BI.PartTree.EVENT_CLICK_TREE_NODE, + action: function () { + self.fireEvent(BI.MultiTreeSearchPane.EVENT_CLICK_TREE_NODE); + } } - }, { - eventName: BI.TreeView.EVENT_CHANGE, - action: function () { - self.fireEvent(BI.MultiTreeSearchPane.EVENT_CHANGE); - } - }], + ], ref: function (_ref) { self.partTree = _ref; } @@ -72,5 +79,6 @@ BI.MultiTreeSearchPane.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiTreeSearchPane.EVENT_CLICK_CONFIRM = "EVENT_CLICK_CONFIRM"; BI.MultiTreeSearchPane.EVENT_CLICK_CLEAR = "EVENT_CLICK_CLEAR"; +BI.MultiTreeSearchPane.EVENT_CLICK_TREE_NODE = "EVENT_CLICK_TREE_NODE"; -BI.shortcut("bi.multi_tree_search_pane", BI.MultiTreeSearchPane); \ No newline at end of file +BI.shortcut("bi.multi_tree_search_pane", BI.MultiTreeSearchPane); diff --git a/src/widget/multitree/trigger/searcher.multi.tree.js b/src/widget/multitree/trigger/searcher.multi.tree.js index 8b9c4f004..1b2dc6983 100644 --- a/src/widget/multitree/trigger/searcher.multi.tree.js +++ b/src/widget/multitree/trigger/searcher.multi.tree.js @@ -33,17 +33,19 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, { defaultText: o.defaultText, height: o.height }, - listeners: [{ - eventName: BI.MultiSelectEditor.EVENT_FOCUS, - action: function () { - self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS); + listeners: [ + { + eventName: BI.MultiSelectEditor.EVENT_FOCUS, + action: function () { + self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS); + } + }, { + eventName: BI.MultiSelectEditor.EVENT_BLUR, + action: function () { + self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR); + } } - }, { - eventName: BI.MultiSelectEditor.EVENT_BLUR, - action: function () { - self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR); - } - }] + ] }); this.searcher = BI.createWidget({ @@ -67,6 +69,14 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, { op.keyword = self.editor.getValue(); o.itemsCreator(op, callback); }, + listeners: [ + { + eventName: BI.MultiTreeSearchPane.EVENT_CLICK_TREE_NODE, + action: function () { + self.fireEvent(BI.MultiTreeSearcher.EVENT_CLICK_TREE_NODE, arguments); + } + } + ], value: o.value }, o.popup), @@ -206,4 +216,5 @@ BI.MultiTreeSearcher.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiTreeSearcher.EVENT_START = "EVENT_START"; BI.MultiTreeSearcher.EVENT_STOP = "EVENT_STOP"; BI.MultiTreeSearcher.EVENT_PAUSE = "EVENT_PAUSE"; +BI.MultiTreeSearcher.EVENT_CLICK_TREE_NODE = "EVENT_CLICK_TREE_NODE"; BI.shortcut("bi.multi_tree_searcher", BI.MultiTreeSearcher); From 445a3b780609a7d3d84aec2f77b21d485c55a1ac Mon Sep 17 00:00:00 2001 From: data Date: Fri, 16 Dec 2022 17:04:41 +0800 Subject: [PATCH 09/10] auto upgrade version to 2.0.20221216170431 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e9a08f146..17810a088 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221216114354", + "version": "2.0.20221216170431", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 3a57a96f957ed8860b4e51bfcb7c8fa35ec8b417 Mon Sep 17 00:00:00 2001 From: data Date: Sun, 18 Dec 2022 19:45:59 +0800 Subject: [PATCH 10/10] auto upgrade version to 2.0.20221218194544 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 17810a088..0c0ff4c72 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20221216170431", + "version": "2.0.20221218194544", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts",