Browse Source

Merge pull request #278310 in DEC/fineui from release/11.0 to final/11.0

* commit 'fba1af3f9b72c83a16799f133b6468d52c766b6a':
  BI-148103 fix: 6.0.18过滤组件下拉框异常变小
  BI-138636 fix: 文本、动态时间支持按钮组
  无JIRA 节点的宽度要随内容撑起来
  REPORT-119215 fix: 统一使用clientWidth和clientHeight,父页面代理掉子应用的body的clientHeight和clientWidth到父应用的body上
  REPORT-119215 fix: 统一使用clientWidth和clientHeight,父页面代理掉子应用的body的clientHeight和clientWidth到父应用的body上
  REPORT-119215 fix: 统一获取宽高的方法
master
superman 6 months ago
parent
commit
d3ab2af3fd
  1. BIN
      packages/fineui/dist/font/iconfont.eot
  2. 12
      packages/fineui/dist/font/iconfont.svg
  3. BIN
      packages/fineui/dist/font/iconfont.ttf
  4. BIN
      packages/fineui/dist/font/iconfont.woff
  5. BIN
      packages/fineui/dist/font/iconfont.woff2
  6. 8
      packages/fineui/src/base/layer/layer.popover.js
  7. 3
      packages/fineui/src/case/button/treeitem/item.icon.treeleaf.js
  8. 100
      packages/fineui/src/case/button/treeitem/item.multilayer.icon.treeleaf.js
  9. 8
      packages/fineui/src/case/button/treeitem/treeitem.js
  10. 16
      packages/fineui/src/core/controller/controller.popover.js
  11. 9
      packages/fineui/src/core/utils/dom.js
  12. 10
      packages/fineui/webpack/webpack.dev.js

BIN
packages/fineui/dist/font/iconfont.eot vendored

Binary file not shown.

12
packages/fineui/dist/font/iconfont.svg vendored

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
packages/fineui/dist/font/iconfont.ttf vendored

Binary file not shown.

BIN
packages/fineui/dist/font/iconfont.woff vendored

Binary file not shown.

BIN
packages/fineui/dist/font/iconfont.woff2 vendored

Binary file not shown.

8
packages/fineui/src/base/layer/layer.popover.js

@ -198,11 +198,11 @@ export class Popover extends Widget {
mounted() { mounted() {
this.startX = 0; this.startX = 0;
this.startY = 0; this.startY = 0;
const bodyDom = getOuterBody();
this.tracker = new MouseMoveTracker( this.tracker = new MouseMoveTracker(
(deltaX, deltaY) => { (deltaX, deltaY) => {
const W = Widget._renderEngine.createElement(bodyDom).width(); const el = Widget._renderEngine.createElement(getOuterBody())[0];
const H = Widget._renderEngine.createElement(bodyDom).height(); const W = el.clientWidth;
const H = el.clientHeight;
this.startX += deltaX; this.startX += deltaX;
this.startY += deltaY; this.startY += deltaY;
this.element.css({ this.element.css({
@ -246,7 +246,7 @@ export class Popover extends Widget {
} }
_getSuitableWidth(width) { _getSuitableWidth(width) {
return clamp(width, 0, Widget._renderEngine.createElement(getOuterBody()).width()); return clamp(width, 0, Widget._renderEngine.createElement(getOuterBody())[0].clientWidth);
} }
_calculateSize() { _calculateSize() {

3
packages/fineui/src/case/button/treeitem/item.icon.treeleaf.js

@ -1,6 +1,9 @@
import { CenterAdaptLayout, shortcut, extend, createWidget, LogicFactory, Direction } from "@/core"; import { CenterAdaptLayout, shortcut, extend, createWidget, LogicFactory, Direction } from "@/core";
import { Icon, Label, BasicButton } from "@/base"; import { Icon, Label, BasicButton } from "@/base";
/**
* @deprecated
*/
@shortcut() @shortcut()
export class IconTreeLeafItem extends BasicButton { export class IconTreeLeafItem extends BasicButton {
static xtype = "bi.icon_tree_leaf_item"; static xtype = "bi.icon_tree_leaf_item";

100
packages/fineui/src/case/button/treeitem/item.multilayer.icon.treeleaf.js

@ -1,9 +1,14 @@
import { IconTreeLeafItem } from "./item.icon.treeleaf"; import {
import { Layout, HorizontalAdaptLayout, shortcut, extend, createWidget, Controller, makeArray, count, Events } from "@/core"; shortcut,
import { BasicButton } from "@/base"; extend,
} from "@/core";
import { BasicTreeItem } from "./treeitem";
/**
* @deprecated
*/
@shortcut() @shortcut()
export class MultiLayerIconTreeLeafItem extends BasicButton { export class MultiLayerIconTreeLeafItem extends BasicTreeItem {
static xtype = "bi.multilayer_icon_tree_leaf_item"; static xtype = "bi.multilayer_icon_tree_leaf_item";
_defaultConfig() { _defaultConfig() {
@ -14,89 +19,8 @@ export class MultiLayerIconTreeLeafItem extends BasicButton {
iconCls: "", iconCls: "",
iconHeight: 16, iconHeight: 16,
iconWidth: 16, iconWidth: 16,
showLine: false,
indentWidth: 0
}); });
} }
_init() {
super._init(...arguments);
const o = this.options;
this.item = createWidget({
type: IconTreeLeafItem.xtype,
cls: "bi-list-item-none",
iconCls: o.iconCls,
id: o.id,
pId: o.pId,
isFront: true,
height: o.height,
hgap: o.hgap,
text: o.text,
value: o.value,
py: o.py,
keyword: o.keyword,
iconWidth: o.iconWidth,
iconHeight: o.iconHeight,
});
this.item.on(Controller.EVENT_CHANGE, (...args) => {
const [type] = args;
if (type === Events.CLICK) {
// 本身实现click功能
return;
}
this.fireEvent(Controller.EVENT_CHANGE, ...args);
});
const items = [];
count(0, o.layer, () => {
items.push({
type: Layout.xtype,
width: 15,
height: o.height,
});
});
items.push(this.item);
createWidget({
type: HorizontalAdaptLayout.xtype,
element: this,
columnSize: makeArray(o.layer, 15),
items,
});
}
doRedMark() {
this.item.doRedMark(...arguments);
}
unRedMark() {
this.item.unRedMark(...arguments);
}
doHighLight() {
this.item.doHighLight(...arguments);
}
unHighLight() {
this.item.unHighLight(...arguments);
}
getId() {
return this.options.id;
}
getPId() {
return this.options.pId;
}
doClick() {
super.doClick(...arguments);
this.item.setSelected(this.isSelected());
}
setSelected(v) {
super.setSelected(...arguments);
this.item.setSelected(v);
}
getValue() {
return this.options.value;
}
} }

8
packages/fineui/src/case/button/treeitem/treeitem.js

@ -20,6 +20,8 @@ export class BasicTreeItem extends NodeButton {
iconWidth: null, iconWidth: null,
iconHeight: null, iconHeight: null,
iconCls: "", iconCls: "",
showLine: true,
indentWidth: null,
}); });
} }
@ -37,14 +39,16 @@ export class BasicTreeItem extends NodeButton {
py, py,
keyword, keyword,
iconCls, iconCls,
showLine,
indentWidth
} = this.options; } = this.options;
const indent = { const indent = {
el: { el: {
type: Layout.xtype, type: Layout.xtype,
height, height,
width: height, width: indentWidth ?? height,
cls: this.getLineCls(), cls: showLine ? this.getLineCls() : "",
}, },
lgap: layer * SIZE_CONSANTS.LIST_ITEM_HEIGHT / 2, // 偏移公式为每一层的偏移量为节点高度的一半 lgap: layer * SIZE_CONSANTS.LIST_ITEM_HEIGHT / 2, // 偏移公式为每一层的偏移量为节点高度的一半
width: "", width: "",

16
packages/fineui/src/core/controller/controller.popover.js

@ -38,7 +38,7 @@ export class PopoverController extends Controller {
type: "bi.popover", type: "bi.popover",
}, context); }, context);
this.add(name, popover, options, context); this.add(name, popover, options, context);
return this; return this;
} }
@ -58,8 +58,8 @@ export class PopoverController extends Controller {
const popover = this.get(name); const popover = this.get(name);
popover.show && popover.show(); popover.show && popover.show();
const render = this.getRender(); const render = this.getRender();
const W = Widget._renderEngine.createElement(render).width(), const el = Widget._renderEngine.createElement(render)[0];
H = Widget._renderEngine.createElement(render).height(); const W = el.clientWidth, H = el.clientHeight;
const w = popover.element.width(), h = popover.element.height(); const w = popover.element.width(), h = popover.element.height();
let left = (W - w) / 2, top = (H - h) / 2; let left = (W - w) / 2, top = (H - h) / 2;
if (left < 0) { if (left < 0) {
@ -74,7 +74,7 @@ export class PopoverController extends Controller {
top: `${top}px`, top: `${top}px`,
}); });
} }
return this; return this;
} }
@ -87,7 +87,7 @@ export class PopoverController extends Controller {
this.floatContainer[name].invisible(); this.floatContainer[name].invisible();
this.modal && this.floatContainer[name].element.__releaseZIndexMask__(this.zindexMap[name]); this.modal && this.floatContainer[name].element.__releaseZIndexMask__(this.zindexMap[name]);
} }
return this; return this;
} }
@ -135,7 +135,7 @@ export class PopoverController extends Controller {
bottom: 0, bottom: 0,
}], }],
}); });
return this; return this;
} }
@ -167,7 +167,7 @@ export class PopoverController extends Controller {
delete this.zindexMap[name]; delete this.zindexMap[name];
delete this.floatContainer[name]; delete this.floatContainer[name];
delete this.floatOpened[name]; delete this.floatOpened[name];
return this; return this;
} }
@ -181,7 +181,7 @@ export class PopoverController extends Controller {
this.floatContainer = {}; this.floatContainer = {};
this.floatOpened = {}; this.floatOpened = {};
this.zindexMap = {}; this.zindexMap = {};
return this; return this;
} }

9
packages/fineui/src/core/utils/dom.js

@ -744,10 +744,11 @@ export function getComboPosition(combo, popup, extraWidth, extraHeight, needAdap
if (needAdaptHeight === true && popup.resetHeight) { if (needAdaptHeight === true && popup.resetHeight) {
const comboRect = combo.element[0].getBoundingClientRect(); const comboRect = combo.element[0].getBoundingClientRect();
const relativeOffset = positionRelativeElement ? positionRelativeElement.getBoundingClientRect().top : 0; const relativeOffset = positionRelativeElement ? positionRelativeElement.getBoundingClientRect().top : 0;
if (position.top < comboRect.top) { const positionTop = position.top + relativeOffset;
popup.resetHeight(Math.min(viewportBounds.height - position.top - relativeOffset, comboRect.top, maxHeight)); if (positionTop < comboRect.top) {
} else if (position.top >= comboRect.bottom) { popup.resetHeight(Math.min(viewportBounds.height - positionTop, comboRect.top, maxHeight));
popup.resetHeight(Math.min(viewportBounds.height - position.top - relativeOffset, viewportBounds.height - comboRect.bottom, maxHeight)); } else if (positionTop >= comboRect.bottom) {
popup.resetHeight(Math.min(viewportBounds.height - positionTop, viewportBounds.height - comboRect.bottom, maxHeight));
} }
} }

10
packages/fineui/webpack/webpack.dev.js

@ -6,7 +6,7 @@ const dirs = require("./dirs");
module.exports = merge(common, { module.exports = merge(common, {
mode: "development", mode: "development",
devtool: "inline-source-map", devtool: "eval-source-map",
output: { output: {
path: dirs.DEST, path: dirs.DEST,
@ -14,14 +14,14 @@ module.exports = merge(common, {
}, },
devServer: { devServer: {
headers: {
"Access-Control-Allow-Origin": "*",
},
port: 9001, port: 9001,
// liveReload: true, // liveReload: true,
client: { client: {
logging: 'error', logging: 'error',
overlay: { overlay: false,
errors: true,
warnings: false,
},
}, },
} }
}); });

Loading…
Cancel
Save