diff --git a/packages/fineui/dist/font/iconfont.eot b/packages/fineui/dist/font/iconfont.eot index 30d5644ca..044b77bf6 100644 Binary files a/packages/fineui/dist/font/iconfont.eot and b/packages/fineui/dist/font/iconfont.eot differ diff --git a/packages/fineui/dist/font/iconfont.svg b/packages/fineui/dist/font/iconfont.svg index 0aa415779..cfaa0c400 100644 --- a/packages/fineui/dist/font/iconfont.svg +++ b/packages/fineui/dist/font/iconfont.svg @@ -14,6 +14,58 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -610,7 +662,7 @@ - + @@ -658,7 +710,7 @@ - + @@ -1382,7 +1434,7 @@ - + @@ -1436,7 +1488,7 @@ - + @@ -1448,7 +1500,7 @@ - + @@ -1546,13 +1598,13 @@ - + - + @@ -1998,13 +2050,13 @@ - + - + diff --git a/packages/fineui/dist/font/iconfont.ttf b/packages/fineui/dist/font/iconfont.ttf index 243165efe..c0b1a2247 100644 Binary files a/packages/fineui/dist/font/iconfont.ttf and b/packages/fineui/dist/font/iconfont.ttf differ diff --git a/packages/fineui/dist/font/iconfont.woff b/packages/fineui/dist/font/iconfont.woff index e8fb8e441..b5741e03d 100644 Binary files a/packages/fineui/dist/font/iconfont.woff and b/packages/fineui/dist/font/iconfont.woff differ diff --git a/packages/fineui/dist/font/iconfont.woff2 b/packages/fineui/dist/font/iconfont.woff2 index 2229cff55..31c1eb2ef 100644 Binary files a/packages/fineui/dist/font/iconfont.woff2 and b/packages/fineui/dist/font/iconfont.woff2 differ diff --git a/packages/fineui/src/base/1.pane.js b/packages/fineui/src/base/1.pane.js index e36f2bd81..ddb731dc8 100644 --- a/packages/fineui/src/base/1.pane.js +++ b/packages/fineui/src/base/1.pane.js @@ -111,11 +111,11 @@ export class Pane extends Widget { } ]; isNotEmptyString(o.loadingText) && - loadingTipItems.push({ - type: Text.xtype, - text: o.loadingText, - tgap: this._getSize(10), - }); + loadingTipItems.push({ + type: Text.xtype, + text: o.loadingText, + tgap: this._getSize(10), + }); return [ { @@ -158,4 +158,10 @@ export class Pane extends Widget { this.options.items = items || []; this.check(); } + + destroyed() { + super.destroyed?.(); + Layers.remove(`${this.getName()}-loading`); + this._loading?.destroy(); + } } diff --git a/packages/fineui/src/base/layer/layer.popover.js b/packages/fineui/src/base/layer/layer.popover.js index d7649c389..0f08ac097 100644 --- a/packages/fineui/src/base/layer/layer.popover.js +++ b/packages/fineui/src/base/layer/layer.popover.js @@ -198,11 +198,11 @@ export class Popover extends Widget { mounted() { this.startX = 0; this.startY = 0; - const bodyDom = getOuterBody(); this.tracker = new MouseMoveTracker( (deltaX, deltaY) => { - const W = Widget._renderEngine.createElement(bodyDom).width(); - const H = Widget._renderEngine.createElement(bodyDom).height(); + const el = Widget._renderEngine.createElement(getOuterBody())[0]; + const W = el.clientWidth; + const H = el.clientHeight; this.startX += deltaX; this.startY += deltaY; this.element.css({ @@ -246,7 +246,7 @@ export class Popover extends Widget { } _getSuitableWidth(width) { - return clamp(width, 0, Widget._renderEngine.createElement(getOuterBody()).width()); + return clamp(width, 0, Widget._renderEngine.createElement(getOuterBody())[0].clientWidth); } _calculateSize() { diff --git a/packages/fineui/src/base/tree/customtree.js b/packages/fineui/src/base/tree/customtree.js index 349ae0912..eb774edfc 100644 --- a/packages/fineui/src/base/tree/customtree.js +++ b/packages/fineui/src/base/tree/customtree.js @@ -16,7 +16,8 @@ import { isNull, createWidget, Controller, - Events + Events, + omit, } from "@/core"; /** @@ -104,7 +105,7 @@ export class CustomTree extends Widget { return itemsCreator.apply(this, args); }; - isNull(item.popup.el) && (item.popup.el = deepClone(this.options.el)); + isNull(item.popup.el) && (item.popup.el = deepClone(omit(this.options.el, "node"))); item.popup.el.node = item.el; items.push(item); } else { diff --git a/packages/fineui/src/case/button/treeitem/item.icon.treeleaf.js b/packages/fineui/src/case/button/treeitem/item.icon.treeleaf.js index 186dacd2d..b6a254974 100644 --- a/packages/fineui/src/case/button/treeitem/item.icon.treeleaf.js +++ b/packages/fineui/src/case/button/treeitem/item.icon.treeleaf.js @@ -1,6 +1,9 @@ import { CenterAdaptLayout, shortcut, extend, createWidget, LogicFactory, Direction } from "@/core"; import { Icon, Label, BasicButton } from "@/base"; +/** + * @deprecated + */ @shortcut() export class IconTreeLeafItem extends BasicButton { static xtype = "bi.icon_tree_leaf_item"; diff --git a/packages/fineui/src/case/button/treeitem/item.multilayer.icon.treeleaf.js b/packages/fineui/src/case/button/treeitem/item.multilayer.icon.treeleaf.js index cd2eb820d..97763ca35 100644 --- a/packages/fineui/src/case/button/treeitem/item.multilayer.icon.treeleaf.js +++ b/packages/fineui/src/case/button/treeitem/item.multilayer.icon.treeleaf.js @@ -1,9 +1,14 @@ -import { IconTreeLeafItem } from "./item.icon.treeleaf"; -import { Layout, HorizontalAdaptLayout, shortcut, extend, createWidget, Controller, makeArray, count, Events } from "@/core"; -import { BasicButton } from "@/base"; - +import { + shortcut, + extend, +} from "@/core"; +import { BasicTreeItem } from "./treeitem"; + +/** + * @deprecated + */ @shortcut() -export class MultiLayerIconTreeLeafItem extends BasicButton { +export class MultiLayerIconTreeLeafItem extends BasicTreeItem { static xtype = "bi.multilayer_icon_tree_leaf_item"; _defaultConfig() { @@ -14,89 +19,8 @@ export class MultiLayerIconTreeLeafItem extends BasicButton { iconCls: "", iconHeight: 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; - } } diff --git a/packages/fineui/src/case/button/treeitem/treeitem.js b/packages/fineui/src/case/button/treeitem/treeitem.js index 722694d34..73b792ad1 100644 --- a/packages/fineui/src/case/button/treeitem/treeitem.js +++ b/packages/fineui/src/case/button/treeitem/treeitem.js @@ -20,6 +20,8 @@ export class BasicTreeItem extends NodeButton { iconWidth: null, iconHeight: null, iconCls: "", + showLine: true, + indentWidth: null, }); } @@ -37,14 +39,16 @@ export class BasicTreeItem extends NodeButton { py, keyword, iconCls, + showLine, + indentWidth } = this.options; const indent = { el: { type: Layout.xtype, height, - width: height, - cls: this.getLineCls(), + width: indentWidth ?? height, + cls: showLine ? this.getLineCls() : "", }, lgap: layer * SIZE_CONSANTS.LIST_ITEM_HEIGHT / 2, // 偏移公式为每一层的偏移量为节点高度的一半 width: "", diff --git a/packages/fineui/src/core/controller/controller.popover.js b/packages/fineui/src/core/controller/controller.popover.js index c4b8337b8..d8a800780 100644 --- a/packages/fineui/src/core/controller/controller.popover.js +++ b/packages/fineui/src/core/controller/controller.popover.js @@ -38,7 +38,7 @@ export class PopoverController extends Controller { type: "bi.popover", }, context); this.add(name, popover, options, context); - + return this; } @@ -58,8 +58,8 @@ export class PopoverController extends Controller { const popover = this.get(name); popover.show && popover.show(); const render = this.getRender(); - const W = Widget._renderEngine.createElement(render).width(), - H = Widget._renderEngine.createElement(render).height(); + const el = Widget._renderEngine.createElement(render)[0]; + const W = el.clientWidth, H = el.clientHeight; const w = popover.element.width(), h = popover.element.height(); let left = (W - w) / 2, top = (H - h) / 2; if (left < 0) { @@ -74,7 +74,7 @@ export class PopoverController extends Controller { top: `${top}px`, }); } - + return this; } @@ -87,7 +87,7 @@ export class PopoverController extends Controller { this.floatContainer[name].invisible(); this.modal && this.floatContainer[name].element.__releaseZIndexMask__(this.zindexMap[name]); } - + return this; } @@ -135,7 +135,7 @@ export class PopoverController extends Controller { bottom: 0, }], }); - + return this; } @@ -167,7 +167,7 @@ export class PopoverController extends Controller { delete this.zindexMap[name]; delete this.floatContainer[name]; delete this.floatOpened[name]; - + return this; } @@ -181,7 +181,7 @@ export class PopoverController extends Controller { this.floatContainer = {}; this.floatOpened = {}; this.zindexMap = {}; - + return this; } diff --git a/packages/fineui/src/core/func/alias.js b/packages/fineui/src/core/func/alias.js index fc0eaa772..94f12a814 100644 --- a/packages/fineui/src/core/func/alias.js +++ b/packages/fineui/src/core/func/alias.js @@ -9,7 +9,8 @@ import { leftPad, parseDateTime, values, - isArray + isArray, + getDate } from "../2.base"; import { replaceAll } from "./string"; import { getFullDayName, getMonthName, getTimezone } from "./date"; @@ -680,10 +681,10 @@ export const contentFormat = function(cv, fmt) { if (!(cv instanceof Date)) { if (typeof cv === "number") { // 毫秒数类型 - cv = new Date(cv); + cv = getDate(cv); } else { // 字符串类型转化为date类型 - cv = new Date(Date.parse((`${cv}`).replace(/-|\./g, "/"))); + cv = getDate(Date.parse((`${cv}`).replace(/-|\./g, "/"))); } } if (!isInvalidDate(cv) && !isNull(cv)) { diff --git a/packages/fineui/src/core/utils/dom.js b/packages/fineui/src/core/utils/dom.js index fbee6b287..1be70de14 100644 --- a/packages/fineui/src/core/utils/dom.js +++ b/packages/fineui/src/core/utils/dom.js @@ -744,10 +744,11 @@ export function getComboPosition(combo, popup, extraWidth, extraHeight, needAdap if (needAdaptHeight === true && popup.resetHeight) { const comboRect = combo.element[0].getBoundingClientRect(); const relativeOffset = positionRelativeElement ? positionRelativeElement.getBoundingClientRect().top : 0; - if (position.top < comboRect.top) { - popup.resetHeight(Math.min(viewportBounds.height - position.top - relativeOffset, comboRect.top, maxHeight)); - } else if (position.top >= comboRect.bottom) { - popup.resetHeight(Math.min(viewportBounds.height - position.top - relativeOffset, viewportBounds.height - comboRect.bottom, maxHeight)); + const positionTop = position.top + relativeOffset; + if (positionTop < comboRect.top) { + popup.resetHeight(Math.min(viewportBounds.height - positionTop, comboRect.top, maxHeight)); + } else if (positionTop >= comboRect.bottom) { + popup.resetHeight(Math.min(viewportBounds.height - positionTop, viewportBounds.height - comboRect.bottom, maxHeight)); } } diff --git a/packages/fineui/src/widget/downlist/item.downlist.js b/packages/fineui/src/widget/downlist/item.downlist.js index 6e27674ec..a83de5eb6 100644 --- a/packages/fineui/src/widget/downlist/item.downlist.js +++ b/packages/fineui/src/widget/downlist/item.downlist.js @@ -1,5 +1,14 @@ import { Label, Icon, BasicButton } from "@/base"; -import { CenterAdaptLayout, shortcut, extend, createWidget, isPlainObject, LogicFactory, Direction, SIZE_CONSANTS } from "@/core"; +import { + CenterAdaptLayout, + shortcut, + extend, + createWidget, + isPlainObject, + LogicFactory, + Direction, + SIZE_CONSANTS +} from "@/core"; @shortcut() export class DownListItem extends BasicButton { @@ -39,7 +48,6 @@ export class DownListItem extends BasicButton { lgap: o.textLgap, rgap: o.textRgap, text: o.text, - title: o.title, value: o.value, keyword: o.keyword, height: o.height, diff --git a/packages/fineui/src/widget/downlist/popup.downlist.js b/packages/fineui/src/widget/downlist/popup.downlist.js index ebb1e48ce..e85e05819 100644 --- a/packages/fineui/src/widget/downlist/popup.downlist.js +++ b/packages/fineui/src/widget/downlist/popup.downlist.js @@ -127,7 +127,7 @@ export class DownListPopup extends Pane { item.trigger = "hover"; item.isNeedAdjustWidth = false; item.el = sourceItem.el; - item.el.title = sourceItem.el.title || sourceItem.el.text; + item.el.title = sourceItem.el.title; item.el.type = "bi.down_list_group_item"; item.el.logic = { dynamic: true, @@ -151,7 +151,7 @@ export class DownListPopup extends Pane { this._createChildren(item, sourceItem); } else { item.type = sourceItem.type || "bi.down_list_item"; - item.title = sourceItem.title || sourceItem.text; + item.title = sourceItem.title; item.textRgap = 10; item.isNeedAdjustWidth = false; item.logic = { @@ -202,7 +202,7 @@ export class DownListPopup extends Pane { this.singleValues.push(item.value); item.type = item.type || "bi.down_list_item"; item.extraCls = " child-down-list-item"; - item.title = item.title || item.text; + item.title = item.title; item.textRgap = 10; item.isNeedAdjustWidth = false; item.logic = { diff --git a/packages/fineui/src/widget/multilayerdownlist/popup.downlist.js b/packages/fineui/src/widget/multilayerdownlist/popup.downlist.js index a55504ec0..512ca7a0f 100644 --- a/packages/fineui/src/widget/multilayerdownlist/popup.downlist.js +++ b/packages/fineui/src/widget/multilayerdownlist/popup.downlist.js @@ -131,7 +131,7 @@ export class MultiLayerDownListPopup extends Pane { item.trigger = "hover"; item.isNeedAdjustWidth = false; item.el = sourceItem.el; - item.el.title = sourceItem.el.title || sourceItem.el.text; + item.el.title = sourceItem.el.title; item.el.type = DownListGroupItem.xtype; item.el.logic = { dynamic: true, @@ -155,7 +155,7 @@ export class MultiLayerDownListPopup extends Pane { self._createChildren(item, sourceItem); } else { item.type = sourceItem.type || DownListItem.xtype; - item.title = sourceItem.title || sourceItem.text; + item.title = sourceItem.title; item.textRgap = 10; item.isNeedAdjustWidth = false; item.logic = { @@ -209,7 +209,6 @@ export class MultiLayerDownListPopup extends Pane { self.singleValues.push(item.value); item.type = item.type || DownListItem.xtype; item.extraCls = " child-down-list-item"; - item.title = item.title || item.text; item.textRgap = 10; item.isNeedAdjustWidth = false; item.logic = { diff --git a/packages/fineui/src/widget/multiselect/loader.js b/packages/fineui/src/widget/multiselect/loader.js index 933c96e43..589b205e7 100644 --- a/packages/fineui/src/widget/multiselect/loader.js +++ b/packages/fineui/src/widget/multiselect/loader.js @@ -74,7 +74,7 @@ export class MultiSelectInnerLoader extends Widget { this.next.setLoaded(); const items = this._composeItems(this.cachItems.slice(0, 100)); this.cachItems = this.cachItems.slice(100); - this.addItems(items); + this.addItems(items, true); return; } @@ -183,7 +183,7 @@ export class MultiSelectInnerLoader extends Widget { ]); } - addItems(items) { + addItems(items, isFromCache = false) { this.count += items.length; if (isObject(this.next)) { if (this.hasNext()) { @@ -194,7 +194,7 @@ export class MultiSelectInnerLoader extends Widget { } } // cacheGroup渲染的是全量的,如果这次加载更多add的items是从cacheItems里面拿的,那不用再add了 - if (this.cachItems.length > 0) { + if (isFromCache) { this.button_group.addItems(...arguments); return; } diff --git a/packages/fineui/webpack/webpack.dev.js b/packages/fineui/webpack/webpack.dev.js index 3b795e02d..1f80646d2 100644 --- a/packages/fineui/webpack/webpack.dev.js +++ b/packages/fineui/webpack/webpack.dev.js @@ -6,7 +6,7 @@ const dirs = require("./dirs"); module.exports = merge(common, { mode: "development", - devtool: "inline-source-map", + devtool: "eval-source-map", output: { path: dirs.DEST, @@ -14,14 +14,14 @@ module.exports = merge(common, { }, devServer: { + headers: { + "Access-Control-Allow-Origin": "*", + }, port: 9001, // liveReload: true, client: { logging: 'error', - overlay: { - errors: true, - warnings: false, - }, + overlay: false, }, } });