Browse Source

Merge pull request #240425 in DEC/fineui from master to feature/x

* commit '3243c0314400fe78fc14f0ae38cc332b3f2f0fcf':
  update
  无JIRA 添加EVENT_AFTER_HIDEVIEW 事件
  BI-128437 fix: 【来源PT项目】BI绑定参数文本下拉问题
  KERNEL-14848 feat: VirtualGroupList组件新增getNodeByValue方法
research/test
superman 1 year ago
parent
commit
cc9576f3f7
  1. 2
      packages/fineui/package.json
  2. 4
      packages/fineui/src/base/list/virtualgrouplist.js
  3. 13
      packages/fineui/src/widget/multiselect/loader.js
  4. 2
      packages/fineui/src/widget/multiselect/multiselect.combo.js
  5. 2
      packages/fineui/src/widget/multiselect/multiselect.combo.nobar.js
  6. 2
      packages/fineui/src/widget/multiselect/multiselect.insert.combo.js
  7. 2
      packages/fineui/src/widget/multiselect/multiselect.insert.combo.nobar.js
  8. 3
      packages/fineui/typescript/widget/multiselect/multiselect.combo.ts
  9. 3
      packages/fineui/typescript/widget/multiselect/multiselect.insert.combo.ts

2
packages/fineui/package.json

@ -1,6 +1,6 @@
{ {
"name": "@fui/core", "name": "@fui/core",
"version": "3.0.20230627163539", "version": "3.0.20230707165537",
"description": "fineui", "description": "fineui",
"main": "dist/fineui.min.js", "main": "dist/fineui.min.js",
"module": "dist/lib/index.js", "module": "dist/lib/index.js",

4
packages/fineui/src/base/list/virtualgrouplist.js

@ -214,4 +214,8 @@ export class VirtualGroupList extends Widget {
ResizeDetector.removeResizeListener(this); ResizeDetector.removeResizeListener(this);
this.restore(); this.restore();
} }
getNodeByValue(value) {
return this.container.getNodeByValue(value);
}
} }

13
packages/fineui/src/widget/multiselect/loader.js

@ -72,7 +72,8 @@ export class MultiSelectInnerLoader extends Widget {
this.next.setLoading(); this.next.setLoading();
if (this.cachItems && this.cachItems.length > 0) { if (this.cachItems && this.cachItems.length > 0) {
this.next.setLoaded(); this.next.setLoaded();
this.addItems(this.cachItems.slice(0, 100)); const items = this._composeItems(this.cachItems.slice(0, 100));
this.addItems(items);
this.cachItems = this.cachItems.slice(100); this.cachItems = this.cachItems.slice(100);
return; return;
@ -204,6 +205,16 @@ export class MultiSelectInnerLoader extends Widget {
this.button_group.addItems(...arguments); this.button_group.addItems(...arguments);
} }
_composeItems(items) {
const cacheValue = this.cachGroup.getValue();
return items.map(item => {
return {
...item,
selected: cacheValue.includes(item.value || item.id)
};
});
}
_populate(items) { _populate(items) {
const self = this, const self = this,
o = this.options; o = this.options;

2
packages/fineui/src/widget/multiselect/multiselect.combo.js

@ -47,6 +47,7 @@ export class MultiSelectCombo extends Single {
static EVENT_SEARCHING = "EVENT_SEARCHING"; static EVENT_SEARCHING = "EVENT_SEARCHING";
static EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; static EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
static EVENT_CONFIRM = "EVENT_CONFIRM"; static EVENT_CONFIRM = "EVENT_CONFIRM";
static MultiSelectCombo = "MultiSelectCombo";
_defaultConfig() { _defaultConfig() {
return extend(super._defaultConfig(...arguments), { return extend(super._defaultConfig(...arguments), {
@ -249,6 +250,7 @@ export class MultiSelectCombo extends Single {
} else { } else {
self._dataChange && self.fireEvent(MultiSelectCombo.EVENT_CONFIRM); self._dataChange && self.fireEvent(MultiSelectCombo.EVENT_CONFIRM);
} }
this.fireEvent(MultiSelectCombo.EVENT_AFTER_HIDEVIEW);
}); });
triggerBtn.on(TriggerIconButton.EVENT_CHANGE, () => { triggerBtn.on(TriggerIconButton.EVENT_CHANGE, () => {

2
packages/fineui/src/widget/multiselect/multiselect.combo.nobar.js

@ -48,6 +48,7 @@ export class MultiSelectNoBarCombo extends Single {
static EVENT_SEARCHING = "EVENT_SEARCHING"; static EVENT_SEARCHING = "EVENT_SEARCHING";
static EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; static EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
static EVENT_CONFIRM = "EVENT_CONFIRM"; static EVENT_CONFIRM = "EVENT_CONFIRM";
static EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
_defaultConfig() { _defaultConfig() {
return extend(super._defaultConfig(...arguments), { return extend(super._defaultConfig(...arguments), {
@ -252,6 +253,7 @@ export class MultiSelectNoBarCombo extends Single {
} else { } else {
self._dataChange && self.fireEvent(MultiSelectNoBarCombo.EVENT_CONFIRM); self._dataChange && self.fireEvent(MultiSelectNoBarCombo.EVENT_CONFIRM);
} }
this.fireEvent(MultiSelectNoBarCombo.EVENT_AFTER_HIDEVIEW);
}); });
triggerBtn.on(TriggerIconButton.EVENT_CHANGE, () => { triggerBtn.on(TriggerIconButton.EVENT_CHANGE, () => {

2
packages/fineui/src/widget/multiselect/multiselect.insert.combo.js

@ -50,6 +50,7 @@ export class MultiSelectInsertCombo extends Single {
static EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM"; static EVENT_CLICK_ITEM = "EVENT_CLICK_ITEM";
static EVENT_CONFIRM = "EVENT_CONFIRM"; static EVENT_CONFIRM = "EVENT_CONFIRM";
static EVENT_ADD_ITEM = "EVENT_ADD_ITEM"; static EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
static EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
_defaultConfig() { _defaultConfig() {
return extend(super._defaultConfig(...arguments), { return extend(super._defaultConfig(...arguments), {
@ -255,6 +256,7 @@ export class MultiSelectInsertCombo extends Single {
} else { } else {
self._dataChange && self.fireEvent(MultiSelectInsertCombo.EVENT_CONFIRM); self._dataChange && self.fireEvent(MultiSelectInsertCombo.EVENT_CONFIRM);
} }
this.fireEvent(MultiSelectInsertCombo.EVENT_AFTER_HIDEVIEW);
}); });
triggerBtn.on(TriggerIconButton.EVENT_CHANGE, () => { triggerBtn.on(TriggerIconButton.EVENT_CHANGE, () => {

2
packages/fineui/src/widget/multiselect/multiselect.insert.combo.nobar.js

@ -45,6 +45,7 @@ export class MultiSelectInsertNoBarCombo extends Single {
static REQ_GET_ALL_DATA = "-1"; static REQ_GET_ALL_DATA = "-1";
static EVENT_CONFIRM = "EVENT_CONFIRM"; static EVENT_CONFIRM = "EVENT_CONFIRM";
static EVENT_ADD_ITEM = "EVENT_ADD_ITEM"; static EVENT_ADD_ITEM = "EVENT_ADD_ITEM";
static EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
_defaultConfig() { _defaultConfig() {
return extend(super._defaultConfig(...arguments), { return extend(super._defaultConfig(...arguments), {
@ -242,6 +243,7 @@ export class MultiSelectInsertNoBarCombo extends Single {
} else { } else {
self._dataChange && self.fireEvent(MultiSelectInsertNoBarCombo.EVENT_CONFIRM); self._dataChange && self.fireEvent(MultiSelectInsertNoBarCombo.EVENT_CONFIRM);
} }
this.fireEvent(MultiSelectInsertNoBarCombo.EVENT_AFTER_HIDEVIEW);
}); });
triggerBtn.on(TriggerIconButton.EVENT_CHANGE, () => { triggerBtn.on(TriggerIconButton.EVENT_CHANGE, () => {

3
packages/fineui/typescript/widget/multiselect/multiselect.combo.ts

@ -10,6 +10,7 @@ export declare class MultiSelectCombo extends Single {
static EVENT_CONFIRM: string; static EVENT_CONFIRM: string;
static REQ_GET_DATA_LENGTH: 1; static REQ_GET_DATA_LENGTH: 1;
static REQ_GET_ALL_DATA: -1; static REQ_GET_ALL_DATA: -1;
static EVENT_AFTER_HIDEVIEW: string;
props: { props: {
itemsCreator: (options: any, callback: () => any[]) => void; itemsCreator: (options: any, callback: () => any[]) => void;
@ -17,7 +18,7 @@ export declare class MultiSelectCombo extends Single {
text: string; text: string;
valueFormatter: (v: string) => string; valueFormatter: (v: string) => string;
allowEdit: boolean; allowEdit: boolean;
} & Single['props'] } & Single["props"];
_itemsCreator4Trigger(op: any, callback: Function): void; _itemsCreator4Trigger(op: any, callback: Function): void;

3
packages/fineui/typescript/widget/multiselect/multiselect.insert.combo.ts

@ -11,6 +11,7 @@ export declare class MultiSelectInsertCombo extends Single {
static EVENT_ADD_ITEM: string; static EVENT_ADD_ITEM: string;
static REQ_GET_DATA_LENGTH: 1; static REQ_GET_DATA_LENGTH: 1;
static REQ_GET_ALL_DATA: -1; static REQ_GET_ALL_DATA: -1;
static EVENT_AFTER_HIDEVIEW: string;
props: { props: {
itemsCreator?: Function; itemsCreator?: Function;
@ -20,7 +21,7 @@ export declare class MultiSelectInsertCombo extends Single {
text?: string; text?: string;
watermark?: string; watermark?: string;
container?: any; container?: any;
} & Single['props']; } & Single["props"];
_itemsCreator4Trigger(op: any, callback: Function): void; _itemsCreator4Trigger(op: any, callback: Function): void;

Loading…
Cancel
Save