Browse Source

Pull request #200608: 无JIRA任务 同步修改

Merge in DEC/fineui from ~WINDY/fineui:final/11.0 to final/11.0

* commit '97c6a13151d481f5eb350d5f23be1fc1a0ac5594':
  同步
  同步
  Pull request #3135: BI-115516 check面板也处理下
  Merge pull request #200297 in DEC/fineui from master to feature/x
  Merge pull request #200530 in DEC/fineui from master to feature/x
research/test
windy-许昊 2 years ago
parent
commit
3d3973ee8c
  1. 11
      src/base/combination/bubble.js
  2. 22
      src/widget/multiselect/check/multiselect.display.js
  3. 9
      src/widget/multiselect/loader.js
  4. 2
      src/widget/singleselect/trigger/searcher.singleselect.js
  5. 4
      typescript/core/platform/web/detectElementResize.ts

11
src/base/combination/bubble.js

@ -12,7 +12,7 @@
attributes: { attributes: {
tabIndex: -1, tabIndex: -1,
}, },
trigger: "click", // click || hover || click-hover || "" trigger: "click", // click || hover || click-hover || "hover-click" || ""
toggle: true, toggle: true,
direction: "", direction: "",
placement: "bottom-start", // top-start/top/top-end/bottom-start/bottom/bottom-end/left-start/left/left-end/right-start/right/right-end placement: "bottom-start", // top-start/top/top-end/bottom-start/bottom/bottom-end/left-start/left/left-end/right-start/right/right-end
@ -219,6 +219,15 @@
} }
}); });
break; break;
case "hover-click":
self.element.on("mouseenter." + self.getName(), function (e) {
if (self.isEnabled() && self.isValid() && self.combo.isEnabled() && self.combo.isValid()) {
self._popupView(e);
self.fireEvent(BI.Controller.EVENT_CHANGE, BI.Events.EXPAND, "", self.combo);
self.fireEvent(BI.Bubble.EVENT_EXPAND);
}
});
break;
default: default:
break; break;
} }

22
src/widget/multiselect/check/multiselect.display.js

@ -26,6 +26,7 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
var self = this, opts = this.options; var self = this, opts = this.options;
this.hasNext = false; this.hasNext = false;
var cacheItems = [];
this.button_group = BI.createWidget({ this.button_group = BI.createWidget({
type: "bi.list_pane", type: "bi.list_pane",
@ -45,10 +46,29 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
}] }]
}, },
itemsCreator: function (options, callback) { itemsCreator: function (options, callback) {
if (options.times === 1) {
cacheItems = [];
}
if (cacheItems.length > 0) {
var renderedItems = cacheItems.slice(0, 100);
cacheItems = cacheItems.slice(100);
self.hasNext = true;
if (cacheItems.length === 0) {
self.hasNext = false;
}
callback(self._createItems(renderedItems));
return;
}
opts.itemsCreator(options, function (ob) { opts.itemsCreator(options, function (ob) {
self.hasNext = !!ob.hasNext; self.hasNext = !!ob.hasNext;
callback(self._createItems(ob.items)); var firstItemsCount = 100 + ob.items.length % 100;
if (ob.items.length > 100) {
cacheItems = ob.items.slice(100 + ob.items.length % 100);
self.hasNext = true;
}
callback(self._createItems(ob.items.slice(0, firstItemsCount)));
}); });
}, },
hasNext: function () { hasNext: function () {

9
src/widget/multiselect/loader.js

@ -167,7 +167,7 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, {
}]); }]);
return false; return false;
} }
this.options.items = (items || []).slice(0, 100); this.options.items = (items || []).slice(0, 100 + (items || []).length % 100);
this.times = 1; this.times = 1;
this.count = 0; this.count = 0;
this.count += items.length; this.count += items.length;
@ -184,14 +184,15 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, {
populate: function (items, keyword) { populate: function (items, keyword) {
if (this._populate.apply(this, arguments)) { if (this._populate.apply(this, arguments)) {
this.cachItems = []; this.cachItems = [];
if (items.length > 100) { var firstItemsCount = 100 + items.length % 100;
this.cachItems = items.slice(100); if (items.length > firstItemsCount) {
this.cachItems = items.slice(firstItemsCount);
} }
var renderEngine = BI.Widget._renderEngine; var renderEngine = BI.Widget._renderEngine;
BI.Widget.registerRenderEngine(BI.Element.renderEngine); BI.Widget.registerRenderEngine(BI.Element.renderEngine);
this.cachGroup.populate.call(this.cachGroup, items, keyword); this.cachGroup.populate.call(this.cachGroup, items, keyword);
BI.Widget.registerRenderEngine(renderEngine); BI.Widget.registerRenderEngine(renderEngine);
this.button_group.populate.call(this.button_group, items.slice(0, 100), keyword); this.button_group.populate.call(this.button_group, items.slice(0, firstItemsCount), keyword);
} }
}, },

2
src/widget/singleselect/trigger/searcher.singleselect.js

@ -128,7 +128,7 @@ BI.SingleSelectSearcher = BI.inherit(BI.Widget, {
if (BI.isUndefined(v)) { if (BI.isUndefined(v)) {
this.editor.setState(BI.Selection.None); this.editor.setState(BI.Selection.None);
} else { } else {
v = v || ""; v = v ?? "";
this.editor.setState(o.valueFormatter(v + "") || (v + "")); this.editor.setState(o.valueFormatter(v + "") || (v + ""));
} }
}, },

4
typescript/core/platform/web/detectElementResize.ts

@ -2,5 +2,5 @@ import { Widget } from "../../../core/widget";
export type _DetectElementResize = { export type _DetectElementResize = {
addResizeListener: (widget: Widget, fn: Function) => Function addResizeListener: (widget: Widget, fn: Function) => Function
removeResizeListener: (widget: Widget, fn: Function) => void removeResizeListener: (widget: Widget, fn?: Function) => void
} }

Loading…
Cancel
Save