diff --git a/bi.lessconfig.json b/bi.lessconfig.json index d4042b18d..a5f1d669f 100644 --- a/bi.lessconfig.json +++ b/bi.lessconfig.json @@ -15,7 +15,7 @@ "@color-bi-background-active-radio-content": "#2C60DB", "@color-bi-background-disabled-active-radio-content": "#D0D4DA", "@color-bi-background-disabled-active-radio-content-theme-dark": "#606479", - "@color-bi-background-disabled-active-checkbox-content": "#D0D4DA", + "@color-bi-background-disabled-active-checkbox-content": "#FFFFFF", "@color-bi-background-disabled-active-checkbox-content-theme-dark": "#606479", "@color-bi-background-tooltip-success": "#2E3A4D", "@color-bi-text-header-background": "#647185", diff --git a/demo/js/config/widget.js b/demo/js/config/widget.js index 37b467282..d2e1b1d5b 100644 --- a/demo/js/config/widget.js +++ b/demo/js/config/widget.js @@ -194,4 +194,12 @@ Demo.WIDGET_CONFIG = [{ id: 420, text: "滚动sliders", value: "demo.slider" +}, { + pId: 4, + id: 414, + text: "折叠面板" +}, { + pId: 414, + text: "bi.collapse", + value: "demo.collapse" }]; \ No newline at end of file diff --git a/demo/js/widget/collapase/API.md b/demo/js/widget/collapase/API.md new file mode 100644 index 000000000..2ba16aa32 --- /dev/null +++ b/demo/js/widget/collapase/API.md @@ -0,0 +1,12 @@ +## API + +### bi.collapse + +| 参数 | 说明 | 类型 | 默认值 | +| ---------- | ---------- | ------- | -------------------- | +| accordion | 手风琴模式 | boolean | false | +| bordered | 带边框风格的折叠面板 | boolean | true | +| ghost | 使折叠面板透明且无边框 | boolean | false | +| openMotion | 展开动画 | object | { animation: "bi-slide-up", animationDuring: 100} +| value | 初始化选中面板的 key | string\[]
number\[] | - | +| listeners | 监听切换面板事件 | [{eventName: "EVENT_EXPAND", action:(activeKey) => void}] | - | diff --git a/demo/js/widget/collapase/demo.collapse.js b/demo/js/widget/collapase/demo.collapse.js new file mode 100644 index 000000000..b75e29c57 --- /dev/null +++ b/demo/js/widget/collapase/demo.collapse.js @@ -0,0 +1,59 @@ +Demo.Collapse = BI.inherit(BI.Widget, { + props: { + baseCls: "demo-collapse" + }, + + render: function () { + var self = this; + + var items = [{ + value: "test", + popup: { + cls: "mvc-border", + items: BI.createItems([{ + text: "项目1", + value: 1 + }, { + text: "项目2", + value: 2 + }, { + text: "项目3", + value: 3 + }, { + text: "项目4", + value: 4 + }], { + type: "bi.single_select_item", + height: 25 + }) + } + }, { + value: 2, + popup: { + type: "bi.label", + value: "给岁月以文明,而不是给文明以岁月" + } + }, { + value: 3, + popup: { + type: "bi.label", + value: "漂流瓶隐没于黑暗里,在一千米见方的宇宙中,只有生态球里的小太阳发出一点光芒。在这个小小的生命世界中,几只清澈的水球在零重力环境中静静地飘浮着,有一条小鱼从一只水球中蹦出,跃入另一只水球,轻盈地穿游于绿藻之间。" + } + }]; + + return { + type: "bi.vertical", + items: [{ + type: "bi.collapse", + accordion: true, + items: items, + value: [2], + }], + width: '60%', + tgap: 100, + hgap: 100 + }; + } +}); + +BI.shortcut("demo.collapse", Demo.Collapse); diff --git a/demo/less/face.less b/demo/less/face.less index 6c0577491..b9c4fe499 100644 --- a/demo/less/face.less +++ b/demo/less/face.less @@ -1,4 +1,4 @@ -@import "index"; +@import "index.less"; .demo-face { .face-config { diff --git a/demo/less/index.less b/demo/less/index.less index 6c2ad3201..9c7a9a367 100644 --- a/demo/less/index.less +++ b/demo/less/index.less @@ -1 +1 @@ -@import "../../src/less/index"; \ No newline at end of file +@import "../../src/less/index.less"; \ No newline at end of file diff --git a/demo/less/main.less b/demo/less/main.less index 184d3c197..4e6cb4376 100644 --- a/demo/less/main.less +++ b/demo/less/main.less @@ -1,4 +1,4 @@ -@import "index"; +@import "index.less"; .layout-bg-white { background-color: #ffffff; } diff --git a/demo/less/north.less b/demo/less/north.less index 1991671f5..0114afd65 100644 --- a/demo/less/north.less +++ b/demo/less/north.less @@ -1,4 +1,4 @@ -@import "index"; +@import "index.less"; .demo-north { background-color: #3c8dbc; diff --git a/demo/less/preview.less b/demo/less/preview.less index 50f9e79dc..600ec4476 100644 --- a/demo/less/preview.less +++ b/demo/less/preview.less @@ -1,4 +1,4 @@ -@import "index"; +@import "index.less"; .demo-preview { } \ No newline at end of file diff --git a/demo/less/vm.less b/demo/less/vm.less index 22ff13396..45094646a 100644 --- a/demo/less/vm.less +++ b/demo/less/vm.less @@ -1,4 +1,4 @@ -@import "index"; +@import "index.less"; .mvc-button { &:hover, &.hover { diff --git a/demo/less/west.less b/demo/less/west.less index a3ed9a55e..c9f6477ee 100644 --- a/demo/less/west.less +++ b/demo/less/west.less @@ -1,4 +1,4 @@ -@import "index"; +@import "index.less"; .demo-west { } diff --git a/dist/font/iconfont.eot b/dist/font/iconfont.eot index e65645dbd..f5457bc8e 100644 Binary files a/dist/font/iconfont.eot and b/dist/font/iconfont.eot differ diff --git a/dist/font/iconfont.svg b/dist/font/iconfont.svg index a04b152fa..3bff3722b 100644 --- a/dist/font/iconfont.svg +++ b/dist/font/iconfont.svg @@ -14,6 +14,74 @@ /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -78,12 +146,6 @@ - - - - - - @@ -96,8 +158,6 @@ - - @@ -200,7 +260,7 @@ - + @@ -228,7 +288,7 @@ - + @@ -250,7 +310,7 @@ - + @@ -492,7 +552,7 @@ - + @@ -534,7 +594,7 @@ - + @@ -548,13 +608,13 @@ - + - + @@ -656,7 +716,7 @@ - + @@ -1072,7 +1132,7 @@ - + @@ -1130,7 +1190,7 @@ - + @@ -1328,7 +1388,7 @@ - + diff --git a/dist/font/iconfont.ttf b/dist/font/iconfont.ttf index 09cb798ae..c19a5fc27 100644 Binary files a/dist/font/iconfont.ttf and b/dist/font/iconfont.ttf differ diff --git a/dist/font/iconfont.woff b/dist/font/iconfont.woff index fb99c8512..f25ee6f70 100644 Binary files a/dist/font/iconfont.woff and b/dist/font/iconfont.woff differ diff --git a/dist/font/iconfont.woff2 b/dist/font/iconfont.woff2 index 5b9bb3bd0..36c093a94 100644 Binary files a/dist/font/iconfont.woff2 and b/dist/font/iconfont.woff2 differ diff --git a/i18n/i18n.cn.js b/i18n/i18n.cn.js index 74fb1e212..900ff7630 100644 --- a/i18n/i18n.cn.js +++ b/i18n/i18n.cn.js @@ -199,6 +199,6 @@ BI.i18n = { "BI-Basic_Search_And_Patch_Paste": "搜索,支持批量粘贴、粘贴值通过换行识别", "BI-Basic_Recommend_Color": "推荐色", "BI-Basic_Too_Much_Value_Get_Two_Thousand": "粘贴的值过多,只能识别出前2000个值", - "BI-Basic_Open": "开", - "BI-Basic_Close": "关", + "BI-Basic_Simple_Open": "开", + "BI-Basic_Simple_Close": "关", }; \ No newline at end of file diff --git a/package.json b/package.json index ef8da5f5a..b3355d4f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220322093515", + "version": "2.0.20220505161347", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", diff --git a/private/less/app.less b/private/less/app.less index d086387ac..dd4d62029 100644 --- a/private/less/app.less +++ b/private/less/app.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/app"; -@import "var"; +@import "../../src/less/resource/app.less"; +@import "var.less"; diff --git a/private/less/background.less b/private/less/background.less index 996147127..0897148ea 100644 --- a/private/less/background.less +++ b/private/less/background.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/background"; -@import "var"; +@import "../../src/less/resource/background.less"; +@import "var.less"; diff --git a/private/less/font.less b/private/less/font.less index c236f82ed..d7399c46e 100644 --- a/private/less/font.less +++ b/private/less/font.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/font"; -@import "var"; +@import "../../src/less/resource/font.less"; +@import "var.less"; diff --git a/private/less/icon.less b/private/less/icon.less index 43e3123c5..8aa44a2ae 100644 --- a/private/less/icon.less +++ b/private/less/icon.less @@ -1,5 +1,5 @@ -@import "../../src/less/resource/icon"; -@import "var"; +@import "../../src/less/resource/icon.less"; +@import "var.less"; diff --git a/public/less/app.less b/public/less/app.less index d086387ac..dd4d62029 100644 --- a/public/less/app.less +++ b/public/less/app.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/app"; -@import "var"; +@import "../../src/less/resource/app.less"; +@import "var.less"; diff --git a/public/less/background.less b/public/less/background.less index 996147127..0897148ea 100644 --- a/public/less/background.less +++ b/public/less/background.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/background"; -@import "var"; +@import "../../src/less/resource/background.less"; +@import "var.less"; diff --git a/public/less/font.less b/public/less/font.less index c236f82ed..d7399c46e 100644 --- a/public/less/font.less +++ b/public/less/font.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/font"; -@import "var"; +@import "../../src/less/resource/font.less"; +@import "var.less"; diff --git a/public/less/icon.less b/public/less/icon.less index 43e3123c5..8aa44a2ae 100644 --- a/public/less/icon.less +++ b/public/less/icon.less @@ -1,5 +1,5 @@ -@import "../../src/less/resource/icon"; -@import "var"; +@import "../../src/less/resource/icon.less"; +@import "var.less"; diff --git a/src/base/combination/bubble.js b/src/base/combination/bubble.js index e35fa38ca..11af9cb7a 100644 --- a/src/base/combination/bubble.js +++ b/src/base/combination/bubble.js @@ -228,7 +228,7 @@ _assertPopupView: function () { var self = this, o = this.options; if (this.popupView == null) { - this.popupView = BI.createWidget(this.options.popup, { + this.popupView = BI.createWidget(BI.isFunction(this.options.popup) ? this.options.popup() : this.options.popup, { type: "bi.bubble_popup_view", showArrow: o.showArrow, value: o.value @@ -332,7 +332,7 @@ name: "offset", options: { offset: function () { - return [o.adjustXOffset, (o.showArrow ? 9 : 0) + (o.adjustYOffset + o.adjustLength)]; + return [o.adjustXOffset, (o.showArrow ? 12 : 0) + (o.adjustYOffset + o.adjustLength)]; } } }]; @@ -340,7 +340,7 @@ modifiers.push({ name: "arrow", options: { - padding: 5, + padding: 4, element: this.popupView.arrow.element[0] } }); diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index bdb488e4c..ddf020a62 100644 --- a/src/base/combination/combo.js +++ b/src/base/combination/combo.js @@ -7,7 +7,7 @@ */ BI.Combo = BI.inherit(BI.Bubble, { _const: { - TRIANGLE_LENGTH: 9 + TRIANGLE_LENGTH: 12 }, _defaultConfig: function () { var conf = BI.Combo.superclass._defaultConfig.apply(this, arguments); @@ -103,7 +103,7 @@ _assertPopupView: function () { var self = this, o = this.options; if (this.popupView == null) { - this.popupView = BI.createWidget(this.options.popup, { + this.popupView = BI.createWidget(BI.isFunction(this.options.popup) ? this.options.popup() : this.options.popup, { type: "bi.popup_view", showArrow: o.showArrow, value: o.value diff --git a/src/base/combination/group.button.js b/src/base/combination/group.button.js index 4df7b392e..a9ba5c23c 100644 --- a/src/base/combination/group.button.js +++ b/src/base/combination/group.button.js @@ -33,11 +33,9 @@ BI.ButtonGroup = BI.inherit(BI.Widget, { self.populate(newValue); }) : o.items; this.populate(items); - if (BI.isFunction(o.value)) { - this.__watch(o.value, function (context, newValue) { - self.setValue(newValue); - }) - } + o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { + self.setValue(newValue); + }) : o.value; if (BI.isKey(o.value) || BI.isNotEmptyArray(o.value)) { this.setValue(o.value); } diff --git a/src/base/combination/group.virtual.js b/src/base/combination/group.virtual.js index eb2b63b85..e816ab108 100644 --- a/src/base/combination/group.virtual.js +++ b/src/base/combination/group.virtual.js @@ -17,11 +17,9 @@ BI.VirtualGroup = BI.inherit(BI.Widget, { self.populate(newValue); }) : o.items; this.populate(items); - if (BI.isFunction(o.value)) { - this.__watch(o.value, function (context, newValue) { - self.setValue(newValue); - }) - } + o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { + self.setValue(newValue); + }) : o.value; if (BI.isKey(o.value)) { this.setValue(o.value); } @@ -66,11 +64,11 @@ BI.VirtualGroup = BI.inherit(BI.Widget, { }, addItems: function (items) { - this.layouts.addItems(items); + this.layouts.addItems(items, this); }, prependItems: function (items) { - this.layouts.prependItems(items); + this.layouts.prependItems(items, this); }, setValue: function (v) { diff --git a/src/base/foundation/message.js b/src/base/foundation/message.js index 860449ab4..156297c9d 100644 --- a/src/base/foundation/message.js +++ b/src/base/foundation/message.js @@ -22,6 +22,7 @@ BI.Msg = function () { // BI.Msg.prompt(title, message, value, callback, min_width); }, toast: function (message, options, context) { + BI.isString(options) && (options = { level: options }) options = options || {}; context = context || BI.Widget._renderEngine.createElement("body"); var level = options.level || "common"; diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js index a4cd139b3..8e747d24f 100644 --- a/src/base/layer/layer.popup.js +++ b/src/base/layer/layer.popup.js @@ -5,7 +5,7 @@ */ BI.PopupView = BI.inherit(BI.Widget, { _const: { - TRIANGLE_LENGTH: 9 + TRIANGLE_LENGTH: 12 }, _defaultConfig: function (props) { return BI.extend(BI.PopupView.superclass._defaultConfig.apply(this, arguments), { @@ -185,7 +185,7 @@ BI.PopupView = BI.inherit(BI.Widget, { setDirection: function (direction, position) { var o = this.options; if (o.showArrow) { - var style, wrapperStyle, placeholderStyle; + var style = {}, wrapperStyle = {}, placeholderStyle = {}; var adjustXOffset = position.adjustXOffset || 0; var adjustYOffset = position.adjustYOffset || 0; var bodyBounds = BI.Widget._renderEngine.createElement("body").bounds(); @@ -197,22 +197,22 @@ BI.PopupView = BI.inherit(BI.Widget, { var offsetStyle = position.offsetStyle; var middle = offsetStyle === "center" || offsetStyle === "middle"; - var minLeft = Math.max(5, offset.left + 5 + popupWidth - bodyWidth); - var minRight = Math.max(5, popupWidth - (offset.left + 5)); - var minTop = Math.max(5, offset.top + 5 + popupHeight - bodyHeight); - var minBottom = Math.max(5, popupHeight - (offset.top + 5)); + var minLeft = Math.max(4, offset.left + 4 + popupWidth - bodyWidth); + var minRight = Math.max(4, popupWidth - (offset.left + 4)); + var minTop = Math.max(4, offset.top + 4 + popupHeight - bodyHeight); + var minBottom = Math.max(4, popupHeight - (offset.top + 4)); - var maxLeft = Math.min(popupWidth - 12 - 5, offset.left + position.width - 12 - 5); - var maxRight = Math.min(popupWidth - 12 - 5, bodyWidth - (offset.left + position.width - 12 - 5)); - var maxTop = Math.min(popupHeight - 12 - 5, offset.top + position.height - 12 - 5); - var maxBottom = Math.min(popupHeight - 12 - 5, bodyHeight - (offset.top + position.height - 12 - 5)); + var maxLeft = Math.min(popupWidth - 16 - 4, offset.left + position.width - 16 - 4); + var maxRight = Math.min(popupWidth - 16 - 4, bodyWidth - (offset.left + position.width - 16 - 4)); + var maxTop = Math.min(popupHeight - 16 - 4, offset.top + position.height - 16 - 4); + var maxBottom = Math.min(popupHeight - 16 - 4, bodyHeight - (offset.top + position.height - 16 - 4)); switch (direction) { case "bottom": case "bottom,right": direction = "bottom"; style = { // 5表示留出一定的空间 - left: BI.clamp(((middle ? popupWidth : position.width) - adjustXOffset) / 2 - 6, minLeft, maxLeft) + left: BI.clamp(((middle ? popupWidth : position.width) - adjustXOffset) / 2 - 8, minLeft, maxLeft) }; wrapperStyle = { top: o.tgap + o.vgap, @@ -231,7 +231,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "bottom,left": direction = "bottom"; style = { - right: BI.clamp(((middle ? popupWidth : position.width) + adjustXOffset) / 2 - 6, minRight, maxRight) + right: BI.clamp(((middle ? popupWidth : position.width) + adjustXOffset) / 2 - 8, minRight, maxRight) }; wrapperStyle = { top: o.bgap + o.vgap, @@ -251,7 +251,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "top,right": direction = "top"; style = { - left: BI.clamp(((middle ? popupWidth : position.width) - adjustXOffset) / 2 - 6, minLeft, maxLeft) + left: BI.clamp(((middle ? popupWidth : position.width) - adjustXOffset) / 2 - 8, minLeft, maxLeft) }; wrapperStyle = { bottom: o.bgap + o.vgap, @@ -270,7 +270,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "top,left": direction = "top"; style = { - right: BI.clamp(((middle ? popupWidth : position.width) + adjustXOffset) / 2 - 6, minRight, maxRight) + right: BI.clamp(((middle ? popupWidth : position.width) + adjustXOffset) / 2 - 8, minRight, maxRight) }; wrapperStyle = { bottom: o.bgap + o.vgap, @@ -290,7 +290,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "left,bottom": direction = "left"; style = { - top: BI.clamp(((middle ? popupHeight : position.height) - adjustYOffset) / 2 - 6, minTop, maxTop) + top: BI.clamp(((middle ? popupHeight : position.height) - adjustYOffset) / 2 - 8, minTop, maxTop) }; wrapperStyle = { right: o.rgap + o.hgap, @@ -309,7 +309,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "left,top": direction = "left"; style = { - bottom: BI.clamp(((middle ? popupHeight : position.height) + adjustYOffset) / 2 - 6, minBottom, maxBottom) + bottom: BI.clamp(((middle ? popupHeight : position.height) + adjustYOffset) / 2 - 8, minBottom, maxBottom) }; wrapperStyle = { right: o.rgap + o.hgap, @@ -329,7 +329,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "right,bottom": direction = "right"; style = { - top: BI.clamp(((middle ? popupHeight : position.height) - adjustYOffset) / 2 - 6, minTop, maxTop) + top: BI.clamp(((middle ? popupHeight : position.height) - adjustYOffset) / 2 - 8, minTop, maxTop) }; wrapperStyle = { left: o.lgap + o.hgap, @@ -348,7 +348,7 @@ BI.PopupView = BI.inherit(BI.Widget, { case "right,top": direction = "right"; style = { - bottom: BI.clamp(((middle ? popupHeight : position.height) + adjustYOffset) / 2 - 6, minBottom, maxBottom) + bottom: BI.clamp(((middle ? popupHeight : position.height) + adjustYOffset) / 2 - 8, minBottom, maxBottom) }; wrapperStyle = { left: o.lgap + o.hgap, diff --git a/src/base/list/virtualgrouplist.js b/src/base/list/virtualgrouplist.js index 7a4a9323b..9039552c2 100644 --- a/src/base/list/virtualgrouplist.js +++ b/src/base/list/virtualgrouplist.js @@ -21,7 +21,6 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, { }, init: function () { - var self = this; this.renderedIndex = -1; }, @@ -90,10 +89,10 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, { var getElementHeight = function () { return self.container.element.height() + self.topBlank.element.height() + self.bottomBlank.element.height(); }; - while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) { + while ((lastHeight = this.renderedIndex === -1 ? 0 : getElementHeight()) < minContentHeight && index < o.items.length) { var items = o.items.slice(index, index + o.blockSize); - this.container.addItems(items.map(function (item, i) { - return o.itemFormatter(item, index + i) + this.container[self.renderedIndex === -1 ? "populate" : "addItems"](items.map(function (item, i) { + return o.itemFormatter(item, index + i); }), this); var addedHeight = getElementHeight() - lastHeight; this.tree.set(cnt, addedHeight); @@ -142,7 +141,9 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, { _populate: function (items) { var o = this.options; if (items && this.options.items !== items) { + // 重新populate一组items,需要重新对线段树分块 this.options.items = items; + this._restore(); } this.tree = BI.PrefixIntervalTree.uniform(Math.ceil(o.items.length / o.blockSize), this._isAutoHeight() ? 0 : o.rowHeight * o.blockSize); @@ -153,14 +154,18 @@ BI.VirtualGroupList = BI.inherit(BI.Widget, { } }, - restore: function () { + _restore: function () { this.renderedIndex = -1; - this.options.scrollTop = 0; // 依赖于cache的占位元素也要初始化 this.topBlank.setHeight(0); this.bottomBlank.setHeight(0); }, + restore: function () { + this.options.scrollTop = 0; + this._restore(); + }, + populate: function (items) { this._populate(items); } diff --git a/src/base/pager/pager.js b/src/base/pager/pager.js index 6689774f6..64ea9a942 100644 --- a/src/base/pager/pager.js +++ b/src/base/pager/pager.js @@ -12,6 +12,8 @@ BI.Pager = BI.inherit(BI.Widget, { behaviors: {}, layouts: [{ type: "bi.horizontal", + hgap: 10, + vgap: 0 }], dynamicShow: true, // 是否动态显示上一页、下一页、首页、尾页, 若为false,则指对其设置使能状态 @@ -24,7 +26,6 @@ BI.Pager = BI.inherit(BI.Widget, { }, // 初始化当前页 groups: 0, // 连续显示分页数 jump: BI.emptyFn, // 分页的回调函数 - first: false, // 是否显示首页 last: false, // 是否显示尾页 prev: "上一页", @@ -35,7 +36,7 @@ BI.Pager = BI.inherit(BI.Widget, { return 1; }, hasPrev: BI.emptyFn, // pages不可用时有效 - hasNext: BI.emptyFn // pages不可用时有效 + hasNext: BI.emptyFn // pages不可用时有效 }); }, @@ -81,9 +82,11 @@ BI.Pager = BI.inherit(BI.Widget, { disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false) }); } else { - view.push(BI.extend({ - disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false) - }, prev)); + view.push({ + el: BI.extend({ + disabled: pages === false ? o.hasPrev(curr) === false : !(curr > 1 && prev !== false) + }, prev) + }); } } @@ -94,7 +97,7 @@ BI.Pager = BI.inherit(BI.Widget, { value: "first", disabled: !(dict.index > 1 && groups !== 0) }); - if (dict.index > 1 && groups !== 0) { + if (dict.index > 1 && groups !== 0 && groups !== pages - 1) { view.push({ type: "bi.label", cls: "page-ellipsis", @@ -108,6 +111,7 @@ BI.Pager = BI.inherit(BI.Widget, { dict.start = dict.index > 1 ? curr - dict.poor : 1; dict.end = dict.index > 1 ? (function () { var max = curr + (groups - dict.poor - 1); + return max > pages ? pages : max; }()) : groups; if (dict.end - dict.start < groups - 1) { // 最后一组状态 @@ -135,7 +139,7 @@ BI.Pager = BI.inherit(BI.Widget, { // 总页数大于连续分页数,且当前组最大页小于总页,输出尾页 if (((!o.dynamicShow && !o.dynamicShowFirstLast) || (pages > groups && dict.end < pages && groups !== 0)) && last) { - if (pages > groups && dict.end < pages && groups !== 0) { + if (pages > groups && dict.end < pages && groups !== 0 && groups !== pages - 1) { view.push({ type: "bi.label", cls: "page-ellipsis", @@ -155,28 +159,36 @@ BI.Pager = BI.inherit(BI.Widget, { view.push((function () { if (BI.isKey(next)) { if (pages === false) { - return {text: next, value: "next", disabled: o.hasNext(curr) === false}; + return { text: next, value: "next", disabled: o.hasNext(curr) === false }; } + return (dict.flow && curr === pages) ? - {text: next, value: "next", disabled: true} + { text: next, value: "next", disabled: true } : - {text: next, value: "next", disabled: !(curr !== pages && next || dict.flow)}; + { text: next, value: "next", disabled: !(curr !== pages && next || dict.flow) }; } - return BI.extend({ - disabled: pages === false ? o.hasNext(curr) === false : !(curr !== pages && next || dict.flow) - }, next); + return { + el: BI.extend({ + disabled: pages === false ? o.hasNext(curr) === false : !(curr !== pages && next || dict.flow) + }, next) + }; }())); } this.button_group = BI.createWidget({ type: "bi.button_group", element: this, - items: BI.createItems(view, { - cls: "bi-list-item-select bi-border-radius", - height: 23, - stopPropagation: true + items: BI.map(view, function (idx, v) { + v = BI.extend({ + cls: "bi-list-item-select bi-border-radius", + height: 23, + hgap: v.el ? 0 : 10, + stopPropagation: true + }, BI.stripEL(v)); + + return BI.formatEL(v); }), behaviors: o.behaviors, layouts: o.layouts @@ -230,6 +242,7 @@ BI.Pager = BI.inherit(BI.Widget, { v || (v = 1); var o = this.options; var pages = this.options.pages; + return pages === false ? o.hasPrev(v) : v > 1; }, @@ -237,6 +250,7 @@ BI.Pager = BI.inherit(BI.Widget, { v || (v = 1); var o = this.options; var pages = this.options.pages; + return pages === false ? o.hasNext(v) : v < pages; }, @@ -265,7 +279,7 @@ BI.Pager = BI.inherit(BI.Widget, { return BI.MIN; case "last": return BI.MAX; - default : + default: return val; } }, diff --git a/src/base/single/input/file.js b/src/base/single/input/file.js index 50ec58bdc..802e8472f 100644 --- a/src/base/single/input/file.js +++ b/src/base/single/input/file.js @@ -97,7 +97,7 @@ split = "onabort.onerror.onloadstart.onprogress".split("."), length = split.length, CRLF = "\r\n", - xhr = this.XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP"), + xhr = XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP"), sendFile; // FireFox 3+, Safari 4 beta (Chrome 2 beta file is buggy and will not work) diff --git a/src/case/button/node/node.arrow.js b/src/case/button/node/node.arrow.js index 6fc690d7b..052858e52 100644 --- a/src/case/button/node/node.arrow.js +++ b/src/case/button/node/node.arrow.js @@ -22,12 +22,6 @@ BI.ArrowNode = BI.inherit(BI.NodeButton, { this.checkbox = BI.createWidget({ type: "bi.arrow_group_node_checkbox" }); - this.checkbox.on(BI.Controller.EVENT_CHANGE, function (type) { - if (type === BI.Events.CLICK) { - self.setSelected(self.isSelected()); - } - self.fireEvent(BI.Controller.EVENT_CHANGE, arguments); - }); return { type: "bi.vertical_adapt", columnSize: [o.iconWrapperWidth || o.height, "fill"], diff --git a/src/case/button/switch.js b/src/case/button/switch.js index e88360266..ba4de99d2 100644 --- a/src/case/button/switch.js +++ b/src/case/button/switch.js @@ -36,24 +36,24 @@ BI.Switch = BI.inherit(BI.BasicButton, { width: 12, height: 12, top: tgap, - left: this.options.selected ? 28 : 4 + left: o.selected ? 28 : 4 }, { type: "bi.label", - text: BI.i18nText("BI-Basic_Open"), + text: BI.i18nText("BI-Basic_Simple_Open"), cls: "content-tip", left: 8, top: tgap - 2, - invisible: !o.showTip, + invisible: !(o.showTip && o.selected), ref: function (ref) { self.openTip = ref; } }, { type: "bi.label", - text: BI.i18nText("BI-Basic_Close"), + text: BI.i18nText("BI-Basic_Simple_Close"), cls: "content-tip", right: 8, top: tgap - 2, - invisible: !o.showTip, + invisible: !(o.showTip && !o.selected), ref: function (ref) { self.closeTip = ref; } diff --git a/src/case/colorchooser/farbtastic/farbtastic.js b/src/case/colorchooser/farbtastic/farbtastic.js index a5ec6736b..0bf1061b0 100644 --- a/src/case/colorchooser/farbtastic/farbtastic.js +++ b/src/case/colorchooser/farbtastic/farbtastic.js @@ -16,6 +16,7 @@ BI.Farbtastic = BI.inherit(BI.BasicButton, { render: function () { var self = this; + this._defaultState(); return { type: "bi.absolute", items: [{ @@ -87,6 +88,10 @@ BI.Farbtastic = BI.inherit(BI.BasicButton, { } }, + _defaultState: function () { + this.hsl = [0, 0, 0]; + }, + _unpack: function (color) { if (color.length === 7) { return [parseInt("0x" + color.substring(1, 3)) / 255, diff --git a/src/case/combo/bubblecombo/combo.bubble.js b/src/case/combo/bubblecombo/combo.bubble.js index 2f1db8b2d..2709295d9 100644 --- a/src/case/combo/bubblecombo/combo.bubble.js +++ b/src/case/combo/bubblecombo/combo.bubble.js @@ -53,12 +53,12 @@ BI.BubbleCombo = BI.inherit(BI.Widget, { offsetStyle: o.offsetStyle, showArrow: true, el: o.el, - popup: BI.extend({ + popup: () => BI.extend({ type: "bi.bubble_popup_view", animation: "bi-zoom-big", animationDuring: 200, primary: o.primary - }, o.popup) + }, BI.isFunction(this.options.popup) ? this.options.popup() : this.options.popup) }); this.combo.on(BI.Combo.EVENT_TRIGGER_CHANGE, function () { self.fireEvent(BI.BubbleCombo.EVENT_TRIGGER_CHANGE, arguments); @@ -99,6 +99,14 @@ BI.BubbleCombo = BI.inherit(BI.Widget, { isViewVisible: function () { return this.combo.isViewVisible(); + }, + + adjustWidth: function () { + this.combo.adjustWidth(); + }, + + adjustHeight: function () { + this.combo.adjustHeight(); } }); diff --git a/src/case/list/list.select.js b/src/case/list/list.select.js index 12f71e383..12037b9a9 100644 --- a/src/case/list/list.select.js +++ b/src/case/list/list.select.js @@ -93,10 +93,23 @@ BI.SelectList = BI.inherit(BI.Widget, { var notSelectLength = this.getAllLeaves().length - selectLength; var hasNext = this.list.hasNext(); var isAlreadyAllSelected = this.toolbar.isSelected(); - var isHalf = selectLength > 0 && (notSelectLength > 0 || (!isAlreadyAllSelected && hasNext)); - isHalf = isHalf || (notSelectLength > 0 && hasNext && isAlreadyAllSelected); + var isHalf = selectLength > 0 && notSelectLength > 0; + var allSelected = isAlreadyAllSelected; + + if (this.isAllSelected() === false) { + hasNext && (isHalf = selectLength > 0); + if (!isAlreadyAllSelected && notSelectLength === 0 && !hasNext) { + allSelected = true; + } + } else { + hasNext && (isHalf = notSelectLength > 0); + if (!isAlreadyAllSelected && notSelectLength === 0) { + allSelected = true; + } + } + this.toolbar.setHalfSelected(isHalf); - !isHalf && this.toolbar.setSelected(selectLength > 0 && notSelectLength <= 0 && (!hasNext || isAlreadyAllSelected)); + !isHalf && this.toolbar.setSelected(allSelected); }, setAllSelected: function (v) { diff --git a/src/case/ztree/0.treeview.js b/src/case/ztree/0.treeview.js index 79ffd5bb6..2ee02010f 100644 --- a/src/case/ztree/0.treeview.js +++ b/src/case/ztree/0.treeview.js @@ -347,33 +347,33 @@ BI.TreeView = BI.inherit(BI.Pane, { _dealWidthNodes: function (nodes) { var self = this, o = this.options; var ns = BI.Tree.arrayFormat(nodes); - BI.each(ns, function (i, n) { - n.isParent = n.isParent || n.parent; + return BI.map(ns, function (i, n) { + var newNode = BI.extend({}, n); + newNode.isParent = newNode.isParent || newNode.parent; // n.value = BI.isUndefined(n.value) ? n.text : n.value; // n.text = BI.isUndefined(n.text) ? n.value : n.text; // if (n.text === null) { // n.text = ""; // } - if (BI.isNull(n.title)) { - n.title = n.text; + if (BI.isNull(newNode.title)) { + newNode.title = newNode.text; } - if (n.disabled) { - n.title = n.warningTitle || n.title; + if (newNode.disabled) { + newNode.title = newNode.warningTitle || newNode.title; } var text = BI.createWidget(BI.extend({ cls: "tree-node-text", - css: { - display: "inline" - }, + tagName: "span", whiteSpace: "nowrap", root: true, keyword: o.paras.keyword - }, n, { - type: "bi.text" + }, newNode, { + type: "bi.text", + text: BI.replaceAll(newNode.text, "\n", " ") })); var fragment = BI.Widget._renderEngine.createElement("
"); fragment.append(text.element[0]); - n.text = fragment.html(); + newNode.text = fragment.html(); // // 处理标红 // if (BI.isNotNull(n.text)) { // if (BI.isKey(o.paras.keyword)) { @@ -382,8 +382,8 @@ BI.TreeView = BI.inherit(BI.Pane, { // n.text = BI.htmlEncode(BI.Text.formatText(n.text + "")); // } // } + return newNode; }); - return nodes; }, _loadMore: function () { diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.js b/src/component/treevaluechooser/abstract.treevaluechooser.js index 5b3a1f580..eb918abf9 100644 --- a/src/component/treevaluechooser/abstract.treevaluechooser.js +++ b/src/component/treevaluechooser/abstract.treevaluechooser.js @@ -549,7 +549,9 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { checked: state[0], halfCheck: state[1], open: o.open, - disabled: nodes[i].disabled + disabled: nodes[i].disabled, + title: nodes[i].title || nodes[i].text, + warningTitle: nodes[i].warningTitle, }); } // 如果指定节点全部打开 @@ -588,7 +590,9 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { checked: state[0], halfCheck: state[1], open: self.options.open, - disabled: node.disabled + disabled: node.disabled, + title: node.title || node.text, + warningTitle: node.warningTitle, }); }); } diff --git a/src/core/0.foundation.js b/src/core/0.foundation.js index 067178cbd..ea69e97a9 100644 --- a/src/core/0.foundation.js +++ b/src/core/0.foundation.js @@ -4,7 +4,7 @@ /** * 初始化BI对象 */ -_global = undefined; +var _global = undefined; if (typeof window !== "undefined") { _global = window; } else if (typeof global !== "undefined") { @@ -14,6 +14,11 @@ if (typeof window !== "undefined") { } else { _global = this; } + +if (_global) { + _global._global = _global; +} + if (_global.BI == null) { _global.BI = {prepares: []}; } diff --git a/src/core/2.base.js b/src/core/2.base.js index 16a4a9f70..ba2d9ec77 100644 --- a/src/core/2.base.js +++ b/src/core/2.base.js @@ -3,20 +3,6 @@ * Create By GUY 2014\11\17 * */ -_global = undefined; -if (typeof window !== "undefined") { - _global = window; -} else if (typeof global !== "undefined") { - _global = global; -} else if (typeof self !== "undefined") { - _global = self; -} else { - _global = this; -} -if (!_global.BI) { - _global.BI = {}; -} - !(function (undefined) { var traverse = function (func, context) { return function (value, key, obj) { @@ -295,13 +281,13 @@ if (!_global.BI) { var i; if (BI.isArray(obj)) { for (i = 0; i < obj.length; i++) { - if ((isFunction && target.apply(context, [i, obj[i]]) === true) || (!isFunction && BI.contains(target, obj[i]))) { + if ((isFunction && (target === obj[i] || target.apply(context, [i, obj[i]]) === true)) || (!isFunction && BI.contains(target, obj[i]))) { obj.splice(i--, 1); } } } else { BI.each(obj, function (i, v) { - if ((isFunction && target.apply(context, [i, obj[i]]) === true) || (!isFunction && BI.contains(target, obj[i]))) { + if ((isFunction && (target === obj[i] || target.apply(context, [i, obj[i]]) === true)) || (!isFunction && BI.contains(target, obj[i]))) { delete obj[i]; } }); @@ -749,20 +735,6 @@ if (!_global.BI) { BI[name] = _apply(name); }); _.extend(BI, { - getTime: function () { - if (_global.performance && _global.performance.now) { - return _global.performance.now(); - } - if (_global.performance && _global.performance.webkitNow) { - return _global.performance.webkitNow(); - } - if (Date.now) { - return Date.now(); - } - return BI.getDate().getTime(); - - - }, parseInt: function (number) { var radix = 10; diff --git a/src/core/4.widget.js b/src/core/4.widget.js index deb7758ab..861fce38f 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -398,6 +398,10 @@ lifeHook !== false && !this.__async && callLifeHook(this, "beforeMount"); this._isMounted = true; this.__isMounting = false; + for (var key in this._children) { + var child = this._children[key]; + child._mount && child._mount(deep ? force : false, deep, lifeHook, predicate, layer + 1); + } if (this._parent) { if (!this._parent.isEnabled()) { this._setEnable(false); @@ -406,10 +410,6 @@ this._setValid(false); } } - for (var key in this._children) { - var child = this._children[key]; - child._mount && child._mount(deep ? force : false, deep, lifeHook, predicate, layer + 1); - } this._mountChildren && this._mountChildren(); if (layer === 0) { // mounted里面会执行scrollTo之类的方法,如果放宏任务里会闪 @@ -461,9 +461,9 @@ _setEnable: function (enable) { if (enable === true) { - this.options.disabled = false; + this.options._disabled = false; } else if (enable === false) { - this.options.disabled = true; + this.options._disabled = true; } // 递归将所有子组件使能 BI.each(this._children, function (i, child) { @@ -473,9 +473,9 @@ _setValid: function (valid) { if (valid === true) { - this.options.invalid = false; + this.options._invalid = false; } else if (valid === false) { - this.options.invalid = true; + this.options._invalid = true; } // 递归将所有子组件使有效 BI.each(this._children, function (i, child) { @@ -493,6 +493,7 @@ setEnable: function (enable) { this._manualSetEnable = true; + this.options.disabled = !enable; this._setEnable(enable); if (enable === true) { this.element.removeClass("base-disabled disabled"); @@ -555,6 +556,7 @@ setValid: function (valid) { this._manualSetValid = true; + this.options.invalid = !valid; this._setValid(valid); if (valid === true) { this.element.removeClass("base-invalid invalid"); @@ -579,10 +581,6 @@ return this.options.height; }, - isValid: function () { - return !this.options.invalid; - }, - addWidget: function (name, widget) { var self = this; if (name instanceof BI.Widget) { @@ -597,12 +595,6 @@ throw new Error("组件:组件名已存在,不能进行添加"); } widget._setParent && widget._setParent(this); - // if (this.options.disabled) { - // widget.options && (widget.options.disabled = true); - // } - // if (this.options.invalid) { - // widget.options && (widget.options.invalid = true); - // } widget.on(BI.Events.DESTROY, function () { BI.remove(self._children, this); }); @@ -689,7 +681,11 @@ }, isEnabled: function () { - return !this.options.disabled; + return this.options.disabled === true ? false: !this.options._disabled; + }, + + isValid: function () { + return this.options.invalid === true ? false: !this.options._invalid; }, isVisible: function () { diff --git a/src/core/controller/controller.broadcast.js b/src/core/controller/controller.broadcast.js index 89b2f0c35..71d7330c7 100644 --- a/src/core/controller/controller.broadcast.js +++ b/src/core/controller/controller.broadcast.js @@ -30,10 +30,9 @@ BI.BroadcastController = BI.inherit(BI.Controller, { remove: function (name, fn) { var self = this; if (fn) { - BI.remove(this._broadcasts[name], function (idx) { - return self._broadcasts[name].indexOf(fn) === idx; + BI.remove(this._broadcasts[name], function (index, cb) { + return fn === cb; }); - this._broadcasts[name].remove(fn); if (this._broadcasts[name].length === 0) { delete this._broadcasts[name]; } diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js index 0076811fd..3bd279aab 100644 --- a/src/core/platform/web/config.js +++ b/src/core/platform/web/config.js @@ -49,7 +49,7 @@ BI.prepares.push(function () { // 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧 var hasAutoAndFillColumnSize = false; if (ob.columnSize && ob.columnSize.length > 0) { - if (ob.columnSize.indexOf("") >= 0 && ob.columnSize.indexOf("fill") >= 0) { + if ((ob.columnSize.indexOf("") >= 0 || ob.columnSize.indexOf("auto") >= 0) && ob.columnSize.indexOf("fill") >= 0) { hasAutoAndFillColumnSize = true; } } else { @@ -57,7 +57,7 @@ BI.prepares.push(function () { BI.each(ob.items, function (i, item) { if (item.width === "fill") { hasFill = true; - } else if (BI.isNull(item.width) || item.width === "") { + } else if (BI.isNull(item.width) || item.width === "" || item.width === "auto") { hasAuto = true; } }); @@ -173,7 +173,7 @@ BI.prepares.push(function () { } var hasAuto = false; if (ob.rowSize && ob.rowSize.length > 0) { - if (ob.rowSize.indexOf("") >= 0) { + if (ob.rowSize.indexOf("") >= 0 || ob.rowSize.indexOf("auto") >= 0) { hasAuto = true; } } else { diff --git a/src/core/platform/web/dom.js b/src/core/platform/web/dom.js index 52976e103..05757959d 100644 --- a/src/core/platform/web/dom.js +++ b/src/core/platform/web/dom.js @@ -628,20 +628,20 @@ return pos; default : if (BI.DOM.isBottomSpaceLarger(combo)) { - pos = BI.DOM.getBottomAdaptPosition(combo, popup, extraHeight, needAdaptHeight); + top = BI.DOM.getBottomAdaptPosition(combo, popup, extraHeight, needAdaptHeight).top; firstDir = "bottom"; } else { - pos = BI.DOM.getTopAdaptPosition(combo, popup, extraHeight, needAdaptHeight); + top = BI.DOM.getTopAdaptPosition(combo, popup, extraHeight, needAdaptHeight).top; firstDir = "top"; } if (leftRight[0] === "right") { - left = BI.DOM.getLeftAlignPosition(combo, popup, extraWidth, needAdaptHeight).left; - pos.left = left; + pos = BI.DOM.getLeftAlignPosition(combo, popup, extraWidth, needAdaptHeight); + pos.top = top; pos.dir = firstDir + "," + pos.dir; return pos; } - left = BI.DOM.getRightAlignPosition(combo, popup, extraWidth).left; - pos.left = left; + pos = BI.DOM.getRightAlignPosition(combo, popup, extraWidth); + pos.top = top; pos.dir = firstDir + "," + pos.dir; return pos; } diff --git a/src/core/wrapper/layout/flex/flex.horizontal.js b/src/core/wrapper/layout/flex/flex.horizontal.js index 1d921c89f..7d53dfe0e 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.js +++ b/src/core/wrapper/layout/flex/flex.horizontal.js @@ -40,10 +40,10 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, { _hasFill: function () { var o = this.options; if (o.columnSize.length > 0) { - return o.columnSize.indexOf("fill") >= 0; + return o.columnSize.indexOf("fill") >= 0 || o.columnSize.indexOf("auto") >= 0; } return BI.some(o.items, function (i, item) { - if (item.width === "fill") { + if (item.width === "fill" || item.width === "auto") { return true; } }); @@ -52,7 +52,7 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, { _addElement: function (i, item) { var o = this.options; var w = BI.FlexHorizontalLayout.superclass._addElement.apply(this, arguments); - var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width >= 1 ? null : item.width; + var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width; if (o.columnSize.length > 0) { if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) { columnSize = null; diff --git a/src/core/wrapper/layout/flex/flex.vertical.js b/src/core/wrapper/layout/flex/flex.vertical.js index e885f5b9e..46b175e9b 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.js +++ b/src/core/wrapper/layout/flex/flex.vertical.js @@ -39,10 +39,10 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, { _hasFill: function () { var o = this.options; if (o.rowSize.length > 0) { - return o.rowSize.indexOf("fill") >= 0; + return o.rowSize.indexOf("fill") >= 0 || o.rowSize.indexOf("auto") >= 0; } return BI.some(o.items, function (i, item) { - if (item.height === "fill") { + if (item.height === "fill" || item.height === "auto") { return true; } }); @@ -51,7 +51,7 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, { _addElement: function (i, item) { var o = this.options; var w = BI.FlexVerticalLayout.superclass._addElement.apply(this, arguments); - var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height >= 1 ? null : item.height; + var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height; if (o.rowSize.length > 0) { if (item.height >= 1 && o.rowSize[i] >= 1 && o.rowSize[i] !== item.height) { rowSize = null; diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js index 94e10fb14..8c803abaa 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js @@ -36,10 +36,10 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, { _hasFill: function () { var o = this.options; if (o.columnSize.length > 0) { - return o.columnSize.indexOf("fill") >= 0; + return o.columnSize.indexOf("fill") >= 0 || o.columnSize.indexOf("auto") >= 0; } return BI.some(o.items, function (i, item) { - if (item.width === "fill") { + if (item.width === "fill" || item.width === "auto") { return true; } }); @@ -48,7 +48,7 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, { _addElement: function (i, item) { var o = this.options; var w = BI.FlexWrapperHorizontalLayout.superclass._addElement.apply(this, arguments); - var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width >= 1 ? null : item.width; + var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width; if (o.columnSize.length > 0) { if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) { columnSize = null; diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js index f9d85948f..33609e717 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js @@ -36,10 +36,10 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, { _hasFill: function () { var o = this.options; if (o.rowSize.length > 0) { - return o.rowSize.indexOf("fill") >= 0; + return o.rowSize.indexOf("fill") >= 0 || o.rowSize.indexOf("auto") >= 0; } return BI.some(o.items, function (i, item) { - if (item.height === "fill") { + if (item.height === "fill" || item.height === "auto") { return true; } }); @@ -48,7 +48,7 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, { _addElement: function (i, item) { var o = this.options; var w = BI.FlexWrapperVerticalLayout.superclass._addElement.apply(this, arguments); - var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height >= 1 ? null : item.height; + var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height; if (o.rowSize.length > 0) { if (item.height >= 1 && o.rowSize[i] >= 1 && o.rowSize[i] !== item.height) { rowSize = null; diff --git a/src/core/wrapper/layout/sticky/sticky.horizontal.js b/src/core/wrapper/layout/sticky/sticky.horizontal.js index f178afd6b..c5b644542 100644 --- a/src/core/wrapper/layout/sticky/sticky.horizontal.js +++ b/src/core/wrapper/layout/sticky/sticky.horizontal.js @@ -13,7 +13,7 @@ BI.HorizontalStickyLayout = BI.inherit(BI.FlexHorizontalLayout, { _addElement: function (i, item) { var o = this.options; var w = BI.HorizontalStickyLayout.superclass._addElement.apply(this, arguments); - var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width >= 1 ? null : item.width; + var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width; if (o.columnSize.length > 0) { if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) { columnSize = null; diff --git a/src/core/wrapper/layout/sticky/sticky.vertical.js b/src/core/wrapper/layout/sticky/sticky.vertical.js index d99b8828e..a5ba3d837 100644 --- a/src/core/wrapper/layout/sticky/sticky.vertical.js +++ b/src/core/wrapper/layout/sticky/sticky.vertical.js @@ -13,7 +13,7 @@ BI.VerticalStickyLayout = BI.inherit(BI.FlexVerticalLayout, { _addElement: function (i, item) { var o = this.options; var w = BI.VerticalStickyLayout.superclass._addElement.apply(this, arguments); - var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height >= 1 ? null : item.height; + var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height; if (o.rowSize.length > 0) { if (item.height >= 1 && o.rowSize[i] >= 1 && o.rowSize[i] !== item.height) { rowSize = null; diff --git a/src/less/base/colorchooser/colorchooser.popup.less b/src/less/base/colorchooser/colorchooser.popup.less index c1dd8ecda..6568f8319 100644 --- a/src/less/base/colorchooser/colorchooser.popup.less +++ b/src/less/base/colorchooser/colorchooser.popup.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-color-chooser-popup { & .disable-mask { diff --git a/src/less/base/colorchooser/colorchooser.trigger.less b/src/less/base/colorchooser/colorchooser.trigger.less index 95739ca30..a647bb9f2 100644 --- a/src/less/base/colorchooser/colorchooser.trigger.less +++ b/src/less/base/colorchooser/colorchooser.trigger.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-color-chooser-trigger { .border-radius(2px); diff --git a/src/less/base/colorchooser/colorpicker/button.colorpicker.less b/src/less/base/colorchooser/colorpicker/button.colorpicker.less index 3e85065bc..05219eb3e 100644 --- a/src/less/base/colorchooser/colorpicker/button.colorpicker.less +++ b/src/less/base/colorchooser/colorpicker/button.colorpicker.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-color-picker-button { & .color-picker-button-mask { diff --git a/src/less/base/colorchooser/colorpicker/button.colorshow.less b/src/less/base/colorchooser/colorpicker/button.colorshow.less index 85aac4635..c754a42cd 100644 --- a/src/less/base/colorchooser/colorpicker/button.colorshow.less +++ b/src/less/base/colorchooser/colorpicker/button.colorshow.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-color-chooser-show-button { &.active, &:active { diff --git a/src/less/base/colorchooser/colorpicker/editor.colorpicker.less b/src/less/base/colorchooser/colorpicker/editor.colorpicker.less index 12239c7de..ce0979d5b 100644 --- a/src/less/base/colorchooser/colorpicker/editor.colorpicker.less +++ b/src/less/base/colorchooser/colorpicker/editor.colorpicker.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-color-picker-editor { & .color-picker-editor-display { diff --git a/src/less/base/colorchooser/farbtastic/farbtastic.less b/src/less/base/colorchooser/farbtastic/farbtastic.less index 38e719ea6..757d57599 100644 --- a/src/less/base/colorchooser/farbtastic/farbtastic.less +++ b/src/less/base/colorchooser/farbtastic/farbtastic.less @@ -1,5 +1,5 @@ -@import "../../../index"; -@import "../../../image"; +@import "../../../index.less"; +@import "../../../image.less"; .bi-farbtastic { & * { diff --git a/src/less/base/combo/combo.bubble.less b/src/less/base/combo/combo.bubble.less index a6f21add1..c3c14ac0a 100644 --- a/src/less/base/combo/combo.bubble.less +++ b/src/less/base/combo/combo.bubble.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; // .bi-bubble-combo { // & .button-combo-triangle-wrapper { diff --git a/src/less/base/combo/combo.less b/src/less/base/combo/combo.less index e6b8bcded..9725ac58a 100644 --- a/src/less/base/combo/combo.less +++ b/src/less/base/combo/combo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; @val: transform .3s ease; .bi-combo { & > .bi-trigger { diff --git a/src/less/base/combo/combo.searchtextvalue.less b/src/less/base/combo/combo.searchtextvalue.less index de0ec79b3..5d5a5524c 100644 --- a/src/less/base/combo/combo.searchtextvalue.less +++ b/src/less/base/combo/combo.searchtextvalue.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; @val: transform .3s ease; .bi-search-text-value-combo{ & .trigger-icon-button{ diff --git a/src/less/base/combo/combo.textvalue.icon.less b/src/less/base/combo/combo.textvalue.icon.less index 79fef76ed..9d32d4971 100644 --- a/src/less/base/combo/combo.textvalue.icon.less +++ b/src/less/base/combo/combo.textvalue.icon.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-icon-text-value-combo{ &.combo-error { diff --git a/src/less/base/combo/combo.textvalue.less b/src/less/base/combo/combo.textvalue.less index dbf76aaa0..1feec1972 100644 --- a/src/less/base/combo/combo.textvalue.less +++ b/src/less/base/combo/combo.textvalue.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-text-value-combo { &.combo-error { diff --git a/src/less/base/combo/combo.textvaluecheck.less b/src/less/base/combo/combo.textvaluecheck.less index 9965f103f..7bed7c0db 100644 --- a/src/less/base/combo/combo.textvaluecheck.less +++ b/src/less/base/combo/combo.textvaluecheck.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-text-value-check-combo { &.bi-combo-popup, &:hover { diff --git a/src/less/base/combo/combo.textvaluedownlist.less b/src/less/base/combo/combo.textvaluedownlist.less index 823410272..be66b4294 100644 --- a/src/less/base/combo/combo.textvaluedownlist.less +++ b/src/less/base/combo/combo.textvaluedownlist.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-text-value-down-list-combo { &.bi-combo-popup, &:hover { diff --git a/src/less/base/combo/popup.bubble.less b/src/less/base/combo/popup.bubble.less index 4a324ac95..09b440c28 100644 --- a/src/less/base/combo/popup.bubble.less +++ b/src/less/base/combo/popup.bubble.less @@ -1,8 +1,8 @@ -@import "../../index"; +@import "../../index.less"; .bi-bubble-popup-view { &.bi-popup-view > .list-view-shadow { .box-shadows(0px 9px 28px 8px rgba(0, 0, 0, 0.05), 0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12)); .border-radius(4px); } -} \ No newline at end of file +} diff --git a/src/less/base/dom.less b/src/less/base/dom.less index 6dc909e1a..ffac75ef8 100644 --- a/src/less/base/dom.less +++ b/src/less/base/dom.less @@ -1,2 +1,2 @@ -@import "../index"; -@import "../lib/colors"; +@import "../index.less"; +@import "../lib/colors.less"; diff --git a/src/less/base/editor/editor.search.less b/src/less/base/editor/editor.search.less index f9094473b..cf29965b0 100644 --- a/src/less/base/editor/editor.search.less +++ b/src/less/base/editor/editor.search.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; /*************BI.SearchEditor******************/ .bi-search-editor { .border-radius(2px); diff --git a/src/less/base/editor/editor.search.small.less b/src/less/base/editor/editor.search.small.less index 234609f99..4eadc15aa 100644 --- a/src/less/base/editor/editor.search.small.less +++ b/src/less/base/editor/editor.search.small.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-small-search-editor { & .bi-editor { diff --git a/src/less/base/foundation/bi.message.less b/src/less/base/foundation/bi.message.less index 1e48abe01..c1605f47b 100644 --- a/src/less/base/foundation/bi.message.less +++ b/src/less/base/foundation/bi.message.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-message-title { font-size: @font-size-14; diff --git a/src/less/base/layer/layer.multiselect.less b/src/less/base/layer/layer.multiselect.less index 50b0f492e..adabe161e 100644 --- a/src/less/base/layer/layer.multiselect.less +++ b/src/less/base/layer/layer.multiselect.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-multi-list-view{ & .bi-button-mask{ diff --git a/src/less/base/layer/panel.less b/src/less/base/layer/panel.less index 79332582f..a76212335 100644 --- a/src/less/base/layer/panel.less +++ b/src/less/base/layer/panel.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-panel{ .border-radius(2px); diff --git a/src/less/base/loader/sort.list.less b/src/less/base/loader/sort.list.less index 14dc71457..a8239b708 100644 --- a/src/less/base/loader/sort.list.less +++ b/src/less/base/loader/sort.list.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-sortable-holder { border: 1px dashed @color-bi-border-sortable-holder; diff --git a/src/less/base/pager/pager.all.count.less b/src/less/base/pager/pager.all.count.less index 717c2f5ec..71a90bb9a 100644 --- a/src/less/base/pager/pager.all.count.less +++ b/src/less/base/pager/pager.all.count.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-all-count-pager { & .all-pager-prev { diff --git a/src/less/base/pager/pager.direction.less b/src/less/base/pager/pager.direction.less index c558a3472..5c946cd29 100644 --- a/src/less/base/pager/pager.direction.less +++ b/src/less/base/pager/pager.direction.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-direction-pager { & .direction-pager-prev { diff --git a/src/less/base/pager/pager.less b/src/less/base/pager/pager.less index 8b4530186..bd4b5abcc 100644 --- a/src/less/base/pager/pager.less +++ b/src/less/base/pager/pager.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-pager{ & .page-item{ diff --git a/src/less/base/pane.less b/src/less/base/pane.less index a83e80756..ea7783f0a 100644 --- a/src/less/base/pane.less +++ b/src/less/base/pane.less @@ -1,6 +1,6 @@ -@import "../index"; -@import "../image"; -@import "../lib/icon"; +@import "../index.less"; +@import "../image.less"; +@import "../lib/icon.less"; .bi-pane { min-height: 25px; &.loading-status{ diff --git a/src/less/base/segment/button.segment.less b/src/less/base/segment/button.segment.less index acb0a7b43..451d65f33 100644 --- a/src/less/base/segment/button.segment.less +++ b/src/less/base/segment/button.segment.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-segment-button { @transition: color 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s; diff --git a/src/less/base/segment/segment.less b/src/less/base/segment/segment.less index cfbf6c77e..f106ddc75 100644 --- a/src/less/base/segment/segment.less +++ b/src/less/base/segment/segment.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-segment{ & > .center-element{ diff --git a/src/less/base/single/button/button.half.less b/src/less/base/single/button/button.half.less index 79669689e..b652328fb 100644 --- a/src/less/base/single/button/button.half.less +++ b/src/less/base/single/button/button.half.less @@ -1,8 +1,9 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-half-button { .border-radius(2px); box-sizing: border-box; + &:after { position: absolute; left: 2px; @@ -12,4 +13,10 @@ background-color: @color-bi-background-half-button-content; content: ''; } + + &.disabled { + &:after { + background-color: @color-bi-background-disabled-half-button-content; + } + } } diff --git a/src/less/base/single/button/button.less b/src/less/base/single/button/button.less index d8f511c01..e34c4f5f0 100644 --- a/src/less/base/single/button/button.less +++ b/src/less/base/single/button/button.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; @hoverVal: opacity .3s ease; @activeVal: transform .5s ease, opacity 1s ease; @activeStopVal: transform 0s; diff --git a/src/less/base/single/button/item.singleselect.icontext.less b/src/less/base/single/button/item.singleselect.icontext.less index 94228aaf8..2f698d894 100644 --- a/src/less/base/single/button/item.singleselect.icontext.less +++ b/src/less/base/single/button/item.singleselect.icontext.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-single-select-icon-text-item{ &:active, &.active { diff --git a/src/less/base/single/button/switch.less b/src/less/base/single/button/switch.less index 22ba538c9..f7101201a 100644 --- a/src/less/base/single/button/switch.less +++ b/src/less/base/single/button/switch.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-switch { font-size: @font-size-12; diff --git a/src/less/base/single/editor/editor.multifile.less b/src/less/base/single/editor/editor.multifile.less index fea7b2e9e..1bf507ca7 100644 --- a/src/less/base/single/editor/editor.multifile.less +++ b/src/less/base/single/editor/editor.multifile.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-multifile-editor { .multifile-editor { diff --git a/src/less/base/single/editor/editor.textarea.less b/src/less/base/single/editor/editor.textarea.less index 2ba0dd548..dc0a77a03 100644 --- a/src/less/base/single/editor/editor.textarea.less +++ b/src/less/base/single/editor/editor.textarea.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-textarea-editor { .overflow-hidden(); diff --git a/src/less/base/single/html.less b/src/less/base/single/html.less index 0af012d03..3159bc630 100644 --- a/src/less/base/single/html.less +++ b/src/less/base/single/html.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-html { article, diff --git a/src/less/base/single/input/checkbox.less b/src/less/base/single/input/checkbox.less index 89c9b205b..7141d75a9 100644 --- a/src/less/base/single/input/checkbox.less +++ b/src/less/base/single/input/checkbox.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-checkbox { & .checkbox-content, &.checkbox-content { diff --git a/src/less/base/single/input/file.less b/src/less/base/single/input/file.less index 4a4e31aef..03488689f 100644 --- a/src/less/base/single/input/file.less +++ b/src/less/base/single/input/file.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-file{ .opacity(0); diff --git a/src/less/base/single/input/input.less b/src/less/base/single/input/input.less index 6d4017e5c..504088485 100644 --- a/src/less/base/single/input/input.less +++ b/src/less/base/single/input/input.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-input, .bi-textarea{ border: none; diff --git a/src/less/base/single/input/radio.less b/src/less/base/single/input/radio.less index 1f5383177..8e48818e7 100644 --- a/src/less/base/single/input/radio.less +++ b/src/less/base/single/input/radio.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-radio { & .radio-content, &.radio-content { diff --git a/src/less/base/single/label.less b/src/less/base/single/label.less index 726d2a208..e0d6982d5 100644 --- a/src/less/base/single/label.less +++ b/src/less/base/single/label.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-label { .overflow-hidden(); diff --git a/src/less/base/single/text.less b/src/less/base/single/text.less index ec0841923..bd4aada73 100644 --- a/src/less/base/single/text.less +++ b/src/less/base/single/text.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-text { .overflow-hidden(); diff --git a/src/less/base/single/tip/tip.bubble.less b/src/less/base/single/tip/tip.bubble.less index ea40fd784..e18e3ffc9 100644 --- a/src/less/base/single/tip/tip.bubble.less +++ b/src/less/base/single/tip/tip.bubble.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-bubble { z-index: @zIndex-tip; diff --git a/src/less/base/single/tip/tip.less b/src/less/base/single/tip/tip.less index 087f342a6..209fbb664 100644 --- a/src/less/base/single/tip/tip.less +++ b/src/less/base/single/tip/tip.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-tip{ position: fixed !important; diff --git a/src/less/base/single/tip/tip.toast.less b/src/less/base/single/tip/tip.toast.less index 49b174614..875dfa586 100644 --- a/src/less/base/single/tip/tip.toast.less +++ b/src/less/base/single/tip/tip.toast.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-toast{ color: @color-bi-color-toast-text; diff --git a/src/less/base/single/tip/tip.tooltip.less b/src/less/base/single/tip/tip.tooltip.less index d78cd410f..bd1b22f98 100644 --- a/src/less/base/single/tip/tip.tooltip.less +++ b/src/less/base/single/tip/tip.tooltip.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-tooltip{ max-width: 250px; diff --git a/src/less/base/tree/tree.branch.less b/src/less/base/tree/tree.branch.less index 8c4ba3b9c..7328be6f5 100644 --- a/src/less/base/tree/tree.branch.less +++ b/src/less/base/tree/tree.branch.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-branch-tree{ & .bi-branch-tree-view{ min-width: 300px; diff --git a/src/less/base/tree/tree.display.less b/src/less/base/tree/tree.display.less index 20124e7d6..2343d4054 100644 --- a/src/less/base/tree/tree.display.less +++ b/src/less/base/tree/tree.display.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-display-tree{ .ztree * { diff --git a/src/less/base/tree/tree.expander.less b/src/less/base/tree/tree.expander.less index b2e5b0c85..04bdd64ac 100644 --- a/src/less/base/tree/tree.expander.less +++ b/src/less/base/tree/tree.expander.less @@ -1,6 +1,6 @@ -@import "../../index"; -@import "../../image"; -@import "../../lib/icon"; +@import "../../index.less"; +@import "../../image.less"; +@import "../../lib/icon.less"; .bi-tree-expander-popup.line:before { position: absolute; content: ""; @@ -12,7 +12,7 @@ .bi-tree-expander-popup.line.solid:before { .imagePath(@icon-tree-solid-vertical-line-1, 0, 0, repeat-y); width: 24px; - left:4px; + left: 8px; } .bi-theme-dark { @@ -23,6 +23,6 @@ .bi-tree-expander-popup.line.solid:before { .imagePath(@icon-tree-solid-vertical-line-1-theme-dark, 0, 0, repeat-y); width: 24px; - left:4px; + left: 8px; } } diff --git a/src/less/base/tree/tree.list.display.less b/src/less/base/tree/tree.list.display.less index e58d3a5dd..0a6b114d2 100644 --- a/src/less/base/tree/tree.list.display.less +++ b/src/less/base/tree/tree.list.display.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-list-display-tree{ diff --git a/src/less/base/tree/ztree.less b/src/less/base/tree/ztree.less index 630c48b45..4d3cfc877 100644 --- a/src/less/base/tree/ztree.less +++ b/src/less/base/tree/ztree.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .ztree * { padding: 0; diff --git a/src/less/base/trigger/trigger.less b/src/less/base/trigger/trigger.less index 1d25e3fd0..bcd89590a 100644 --- a/src/less/base/trigger/trigger.less +++ b/src/less/base/trigger/trigger.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-trigger{ & .bi-trigger-icon-button{ diff --git a/src/less/base/trigger/trigger.selecttext.less b/src/less/base/trigger/trigger.selecttext.less index 309aa7ef5..2c353833e 100644 --- a/src/less/base/trigger/trigger.selecttext.less +++ b/src/less/base/trigger/trigger.selecttext.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-select-text-trigger{ .border-radius(2px); diff --git a/src/less/base/trigger/trigger.selecttextsmall.less b/src/less/base/trigger/trigger.selecttextsmall.less index a4480d44e..749fd67f9 100644 --- a/src/less/base/trigger/trigger.selecttextsmall.less +++ b/src/less/base/trigger/trigger.selecttextsmall.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-small-select-text-trigger{ .border-radius(2px); diff --git a/src/less/base/view/drawer.less b/src/less/base/view/drawer.less index 80a8ca1be..76ab23d18 100644 --- a/src/less/base/view/drawer.less +++ b/src/less/base/view/drawer.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-drawer { .box-shadows(-6px 0 16px -8px #00000014, -9px 0 28px #0000000d, -12px 0 48px 16px #00000008); diff --git a/src/less/base/view/popover.less b/src/less/base/view/popover.less index 27b65a895..98dedcc7a 100644 --- a/src/less/base/view/popover.less +++ b/src/less/base/view/popover.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-popover { border: 1px solid transparent; diff --git a/src/less/base/view/popupview.less b/src/less/base/view/popupview.less index 318518b57..676e19f1d 100644 --- a/src/less/base/view/popupview.less +++ b/src/less/base/view/popupview.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-popup-view { position: fixed !important; @@ -33,9 +33,9 @@ left: 0; > .bi-bubble-arrow { bottom: -12px; - width: 14px; + width: 16px; > .bubble-arrow { - bottom: 8px; + bottom: 7px; left: 1px; } } @@ -47,9 +47,9 @@ left: 0; > .bi-bubble-arrow { top: -12px; - width: 14px; + width: 16px; > .bubble-arrow { - top: 8px; + top: 7px; left: 1px; } } @@ -61,9 +61,9 @@ top: 0; > .bi-bubble-arrow { right: -12px; - height: 14px; + height: 16px; > .bubble-arrow { - right: 8px; + right: 7px; top: 1px; } } @@ -75,9 +75,9 @@ top: 0; > .bi-bubble-arrow { left: -12px; - height: 14px; + height: 16px; > .bubble-arrow { - left: 8px; + left: 7px; top: 1px; } } @@ -85,18 +85,18 @@ } .bi-bubble-arrow { - width: 12px; - height: 12px; + width: 14px; + height: 14px; // 消除祖先节点设置的line-height:normal对空白节点的行高影响 line-height: 0; overflow: hidden; .bubble-arrow { - width: 12px; - height: 12px; + width: 14px; + height: 14px; position: absolute; &:before { - width: 12px; - height: 12px; + width: 14px; + height: 14px; position: absolute; content: ""; background: @color-bi-background-default; @@ -106,7 +106,8 @@ visibility: visible; transform: translateX(0px) rotate(-135deg); transform-origin: center center; - .box-shadow(3px 3px 10px 0,rgba(0,0,0,6%)); + .box-shadow(3px 3px 10px 0,rgba(0, 0, 0, 6%)); + .border-radius(2px); } } } diff --git a/src/less/component/form/form.less b/src/less/component/form/form.less index b4e77e0a8..5dfc027b2 100644 --- a/src/less/component/form/form.less +++ b/src/less/component/form/form.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-form { & .bi-form-field.error { diff --git a/src/less/core/normalize2.less b/src/less/core/normalize2.less index 11c876b5c..e2bea8699 100644 --- a/src/less/core/normalize2.less +++ b/src/less/core/normalize2.less @@ -1,4 +1,4 @@ -@import "../index"; +@import "../index.less"; a { outline: none; diff --git a/src/less/core/utils/animation.less b/src/less/core/utils/animation.less index 22bd65cde..809604ee2 100644 --- a/src/less/core/utils/animation.less +++ b/src/less/core/utils/animation.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; /** 循环旋转动画 **/ .anim-rotate { .animation(rotate 1s infinite linear both); diff --git a/src/less/core/utils/common.less b/src/less/core/utils/common.less index 5d9b11c3e..fd9b61c4a 100644 --- a/src/less/core/utils/common.less +++ b/src/less/core/utils/common.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .base-disabled { cursor: not-allowed !important; diff --git a/src/less/core/utils/list-item.less b/src/less/core/utils/list-item.less index 8964830cd..c084ac275 100644 --- a/src/less/core/utils/list-item.less +++ b/src/less/core/utils/list-item.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; // hover的时候背景变化,文字变黑 .bi-list-item { diff --git a/src/less/core/utils/motion/fade.less b/src/less/core/utils/motion/fade.less index d51a68c75..5f0fee5ff 100644 --- a/src/less/core/utils/motion/fade.less +++ b/src/less/core/utils/motion/fade.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .fade-motion(@className, @keyframeName) { .make-motion(@className, @keyframeName); diff --git a/src/less/core/utils/motion/move.less b/src/less/core/utils/motion/move.less index 3024c2a8b..eac06e005 100644 --- a/src/less/core/utils/motion/move.less +++ b/src/less/core/utils/motion/move.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .move-motion(@className, @keyframeName) { .make-motion(@className, @keyframeName); diff --git a/src/less/core/utils/motion/slide.less b/src/less/core/utils/motion/slide.less index 0fa6567a4..fd62e95fe 100644 --- a/src/less/core/utils/motion/slide.less +++ b/src/less/core/utils/motion/slide.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .slide-motion(@className, @keyframeName) { .make-motion(@className, @keyframeName); diff --git a/src/less/core/utils/motion/zoom.less b/src/less/core/utils/motion/zoom.less index 2407b8428..7e0e0ec44 100644 --- a/src/less/core/utils/motion/zoom.less +++ b/src/less/core/utils/motion/zoom.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .zoom-motion(@className, @keyframeName, @duration: @animation-duration-base) { .make-motion(@className, @keyframeName, @duration); diff --git a/src/less/core/utils/position.less b/src/less/core/utils/position.less index a9693147e..12f687077 100644 --- a/src/less/core/utils/position.less +++ b/src/less/core/utils/position.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .display-block { display: block; diff --git a/src/less/core/utils/size.less b/src/less/core/utils/size.less index e14cca14c..575729c28 100644 --- a/src/less/core/utils/size.less +++ b/src/less/core/utils/size.less @@ -1,5 +1,5 @@ -@import "../../lib/constant"; -@import "../../image"; +@import "../../lib/constant.less"; +@import "../../image.less"; .iconSize(icon-size-12, @font-size-12); .iconSize(icon-size-13, @font-size-13); diff --git a/src/less/core/utils/sizing.less b/src/less/core/utils/sizing.less index 643984a57..e199658b2 100644 --- a/src/less/core/utils/sizing.less +++ b/src/less/core/utils/sizing.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; /*类似ie6的盒子模型 可以在有百分比的时候加border 支持到ie8*/ .border-sizing{ .box-sizing(border-box); diff --git a/src/less/core/utils/typographic.less b/src/less/core/utils/typographic.less index e15f24cf9..ebdedf85e 100644 --- a/src/less/core/utils/typographic.less +++ b/src/less/core/utils/typographic.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .y-overflow-auto { overflow-y: auto; diff --git a/src/less/core/wrapper/flex.horizontal.less b/src/less/core/wrapper/flex.horizontal.less index b6a8ccc97..a6a38704d 100644 --- a/src/less/core/wrapper/flex.horizontal.less +++ b/src/less/core/wrapper/flex.horizontal.less @@ -169,6 +169,7 @@ } > .f-f { + min-width: 0; -webkit-flex-grow: 1; -moz-flex-grow: 1; -ms-flex-grow: 1; diff --git a/src/less/core/wrapper/flex.vertical.less b/src/less/core/wrapper/flex.vertical.less index c8fbefa6b..5b97ea999 100644 --- a/src/less/core/wrapper/flex.vertical.less +++ b/src/less/core/wrapper/flex.vertical.less @@ -168,6 +168,7 @@ } > .f-f { + min-height: 0; -webkit-flex-grow: 1; -moz-flex-grow: 1; -ms-flex-grow: 1; diff --git a/src/less/core/wrapper/flex.wrapper.horizontal.less b/src/less/core/wrapper/flex.wrapper.horizontal.less index 89de62f88..1b38fa0be 100644 --- a/src/less/core/wrapper/flex.wrapper.horizontal.less +++ b/src/less/core/wrapper/flex.wrapper.horizontal.less @@ -265,6 +265,7 @@ } > .f-f { + min-width: 0; -webkit-flex-grow: 1; -moz-flex-grow: 1; -ms-flex-grow: 1; diff --git a/src/less/core/wrapper/flex.wrapper.vertical.less b/src/less/core/wrapper/flex.wrapper.vertical.less index 477891105..09693c348 100644 --- a/src/less/core/wrapper/flex.wrapper.vertical.less +++ b/src/less/core/wrapper/flex.wrapper.vertical.less @@ -259,6 +259,7 @@ } > .f-f { + min-height: 0; -webkit-flex-grow: 1; -moz-flex-grow: 1; -ms-flex-grow: 1; diff --git a/src/less/image.less b/src/less/image.less index 0e4a7d49f..bd2bcfabc 100644 --- a/src/less/image.less +++ b/src/less/image.less @@ -1,4 +1,4 @@ -@import "var"; +@import "var.less"; .imagePath(none) { background: none; diff --git a/src/less/index.less b/src/less/index.less index 3644b8e34..47f735cef 100644 --- a/src/less/index.less +++ b/src/less/index.less @@ -1,8 +1,8 @@ -@import "position"; -@import "box-model"; -@import "typographic"; -@import "visual"; -@import "motion"; -@import "var"; -@import "lib/colors"; -@import "lib/theme"; +@import "position.less"; +@import "box-model.less"; +@import "typographic.less"; +@import "visual.less"; +@import "motion.less"; +@import "var.less"; +@import "lib/colors.less"; +@import "lib/theme.less"; diff --git a/src/less/lib/colors.less b/src/less/lib/colors.less index 394bb5f66..060768c03 100644 --- a/src/less/lib/colors.less +++ b/src/less/lib/colors.less @@ -1,4 +1,4 @@ -@import "constant"; +@import "constant.less"; // 通用色彩库。从constant.less中获取相关颜色,不要出现#xxxxxx diff --git a/src/less/lib/theme-modern.less b/src/less/lib/theme-modern.less index 000a92253..c2f3d9c55 100644 --- a/src/less/lib/theme-modern.less +++ b/src/less/lib/theme-modern.less @@ -1,4 +1,4 @@ -@import "colors"; +@import "colors.less"; // 专属组件色彩库,通用配色中有的用通用配色,否则选constant自定义配色 diff --git a/src/less/lib/theme.less b/src/less/lib/theme.less index d83ef3789..db42c9ef4 100644 --- a/src/less/lib/theme.less +++ b/src/less/lib/theme.less @@ -1,4 +1,4 @@ -@import "colors"; +@import "colors.less"; // 专属组件色彩库,通用配色中有的用通用配色,否则选constant自定义配色 @@ -195,6 +195,7 @@ @color-bi-split-disabled-segment: @color-bi-border-disabled; // 半选 @color-bi-background-half-button-content: @color-bi-background-highlight; +@color-bi-background-disabled-half-button-content: @color-bi-background-light-disabled; // items @color-bi-text-active-single-select-icon-text-item: @color-bi-text-highlight; // editor diff --git a/src/less/resource/app.less b/src/less/resource/app.less index 4d80b12b9..4f61322d1 100644 --- a/src/less/resource/app.less +++ b/src/less/resource/app.less @@ -1,4 +1,4 @@ -@import "../index"; +@import "../index.less"; html { height: 100%; diff --git a/src/less/resource/background.less b/src/less/resource/background.less index 4e1c6a51e..8aca40b17 100644 --- a/src/less/resource/background.less +++ b/src/less/resource/background.less @@ -1,6 +1,6 @@ -@import "../image"; -@import "../lib/icon"; -@import "../lib/background"; +@import "../image.less"; +@import "../lib/icon.less"; +@import "../lib/background.less"; @import "../base/tree/tree.expander.less"; .bi-display-tree { diff --git a/src/less/resource/font.less b/src/less/resource/font.less index 7e7e4e91c..a6551f864 100644 --- a/src/less/resource/font.less +++ b/src/less/resource/font.less @@ -1,7 +1,7 @@ -@import "../lib/font"; -@import "../lib/colors"; -@import "../lib/theme"; -@import "../image"; +@import "../lib/font.less"; +@import "../lib/colors.less"; +@import "../lib/theme.less"; +@import "../image.less"; .addFontRes(); .activateFont(); diff --git a/src/less/resource/icon.less b/src/less/resource/icon.less index a97b429da..be2f6885d 100644 --- a/src/less/resource/icon.less +++ b/src/less/resource/icon.less @@ -1,5 +1,5 @@ -@import "../image"; -@import "../lib/icon"; +@import "../image.less"; +@import "../lib/icon.less"; //Tree Widget .icon(tree-collapse-icon-type1, @icon-tree-collapse-type1); diff --git a/src/less/theme/dark.less b/src/less/theme/dark.less index ed4bc3c67..a0149a1f9 100644 --- a/src/less/theme/dark.less +++ b/src/less/theme/dark.less @@ -1,4 +1,4 @@ -@import "../index"; +@import "../index.less"; .bi-theme-dark { color: @color-bi-text-theme-dark; diff --git a/src/less/theme/default.less b/src/less/theme/default.less index 303dfa0a4..ad1daefb1 100644 --- a/src/less/theme/default.less +++ b/src/less/theme/default.less @@ -1,4 +1,4 @@ -@import "../index"; +@import "../index.less"; .bi-theme-default{ diff --git a/src/less/theme/light.less b/src/less/theme/light.less index 0accbb8b3..50210951d 100644 --- a/src/less/theme/light.less +++ b/src/less/theme/light.less @@ -1,4 +1,4 @@ -@import "../index"; +@import "../index.less"; .bi-theme-light { } \ No newline at end of file diff --git a/src/less/widget/date/trigger.date.less b/src/less/widget/date/trigger.date.less index 99162d9c2..50e341418 100644 --- a/src/less/widget/date/trigger.date.less +++ b/src/less/widget/date/trigger.date.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-date-trigger { .border-radius(2px); diff --git a/src/less/widget/downlist/popup.downlist.less b/src/less/widget/downlist/popup.downlist.less index cdddf37da..ba48525f2 100644 --- a/src/less/widget/downlist/popup.downlist.less +++ b/src/less/widget/downlist/popup.downlist.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-down-list-popup { & .list-group-item-text { diff --git a/src/less/widget/dynamicdatecombo/dynamicdatepopup.less b/src/less/widget/dynamicdatecombo/dynamicdatepopup.less index 81b8893a2..4c4cb053e 100644 --- a/src/less/widget/dynamicdatecombo/dynamicdatepopup.less +++ b/src/less/widget/dynamicdatecombo/dynamicdatepopup.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-dynamic-date-popup{ & .dynamic-date-pane { diff --git a/src/less/widget/dynamicdatecombo/dynamicdatetime.combo.less b/src/less/widget/dynamicdatecombo/dynamicdatetime.combo.less index d15ab68dc..79bbf4542 100644 --- a/src/less/widget/dynamicdatecombo/dynamicdatetime.combo.less +++ b/src/less/widget/dynamicdatecombo/dynamicdatetime.combo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-dynamic-date-combo { & .date-font { diff --git a/src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less b/src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less index 81a06aff7..100770f16 100644 --- a/src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less +++ b/src/less/widget/dynamicdatecombo/dynamicdatetimepopup.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-dynamic-date-time-popup{ & .dynamic-date-pane { diff --git a/src/less/widget/month/trigger.month.less b/src/less/widget/month/trigger.month.less index ff75d4df7..17796dbd5 100644 --- a/src/less/widget/month/trigger.month.less +++ b/src/less/widget/month/trigger.month.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-month-trigger{ .border-radius(2px); } \ No newline at end of file diff --git a/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less b/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less index 4a725cd98..ca3a79fbc 100644 --- a/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less +++ b/src/less/widget/multilayerselecttree/multilayerselecttree.combo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; @val: transform .3s ease; .bi-multilayer-select-tree-combo { & .trigger-icon-button{ diff --git a/src/less/widget/multilayersingletree/multilayersingletree.combo.less b/src/less/widget/multilayersingletree/multilayersingletree.combo.less index a589309fd..af046bc74 100644 --- a/src/less/widget/multilayersingletree/multilayersingletree.combo.less +++ b/src/less/widget/multilayersingletree/multilayersingletree.combo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; @val: transform .3s ease; .bi-multilayer-single-tree-combo { & .trigger-icon-button{ diff --git a/src/less/widget/multiselect/check/multiselect.check.pane.less b/src/less/widget/multiselect/check/multiselect.check.pane.less index 7f0db5920..f64d2e8c2 100644 --- a/src/less/widget/multiselect/check/multiselect.check.pane.less +++ b/src/less/widget/multiselect/check/multiselect.check.pane.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-multi-select-check-pane { & .multi-select-check-selected { diff --git a/src/less/widget/multiselect/multiselect.combo.less b/src/less/widget/multiselect/multiselect.combo.less index 643062ec9..0399dd67a 100644 --- a/src/less/widget/multiselect/multiselect.combo.less +++ b/src/less/widget/multiselect/multiselect.combo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; @val: transform .3s ease; .bi-multi-select-combo{ & .multi-select-trigger-icon-button{ diff --git a/src/less/widget/multiselect/multiselect.insert.combo.less b/src/less/widget/multiselect/multiselect.insert.combo.less index ed721fce8..ae89eed14 100644 --- a/src/less/widget/multiselect/multiselect.insert.combo.less +++ b/src/less/widget/multiselect/multiselect.insert.combo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; @val: transform .3s ease; .bi-multi-select-insert-combo{ & .multi-select-trigger-icon-button{ diff --git a/src/less/widget/multiselect/search/multiselect.search.pane.less b/src/less/widget/multiselect/search/multiselect.search.pane.less index 97dfa3ace..27560e350 100644 --- a/src/less/widget/multiselect/search/multiselect.search.pane.less +++ b/src/less/widget/multiselect/search/multiselect.search.pane.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-multi-select-search-pane{ diff --git a/src/less/widget/multiselect/trigger/button.checkselected.less b/src/less/widget/multiselect/trigger/button.checkselected.less index deea8a46b..35c00dec0 100644 --- a/src/less/widget/multiselect/trigger/button.checkselected.less +++ b/src/less/widget/multiselect/trigger/button.checkselected.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-multi-select-check-selected-button { z-index: 1; diff --git a/src/less/widget/multistringlist/multistringlist.insert.less b/src/less/widget/multistringlist/multistringlist.insert.less index 0f33e2779..63362ff92 100644 --- a/src/less/widget/multistringlist/multistringlist.insert.less +++ b/src/less/widget/multistringlist/multistringlist.insert.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-multi-select-insert-list{ & .bi-search-editor{ .border-corner-bottom-radius(0px, 0px) diff --git a/src/less/widget/multistringlist/multistringlist.less b/src/less/widget/multistringlist/multistringlist.less index fb8e5030e..b21d88709 100644 --- a/src/less/widget/multistringlist/multistringlist.less +++ b/src/less/widget/multistringlist/multistringlist.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-multi-select-list{ & .bi-search-editor{ .border-corner-bottom-radius(0px, 0px) diff --git a/src/less/widget/multitree/check/multi.tree.check.pane.less b/src/less/widget/multitree/check/multi.tree.check.pane.less index 3d40ae597..e193fb210 100644 --- a/src/less/widget/multitree/check/multi.tree.check.pane.less +++ b/src/less/widget/multitree/check/multi.tree.check.pane.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-multi-tree-check-pane { & .multi-tree-continue-select { diff --git a/src/less/widget/multitree/multi.tree.combo.less b/src/less/widget/multitree/multi.tree.combo.less index 73db11ef5..7e193b7d3 100644 --- a/src/less/widget/multitree/multi.tree.combo.less +++ b/src/less/widget/multitree/multi.tree.combo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; @val: transform .3s ease; .bi-multi-tree-combo{ & .multi-select-trigger-icon-button{ diff --git a/src/less/widget/multitree/popup.multi.tree.less b/src/less/widget/multitree/popup.multi.tree.less index c19617edd..e1a55ac69 100644 --- a/src/less/widget/multitree/popup.multi.tree.less +++ b/src/less/widget/multitree/popup.multi.tree.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-multi-tree-popup{ & .popup-view-tree{ diff --git a/src/less/widget/multitree/trigger/multi.tree.button.checkselected.less b/src/less/widget/multitree/trigger/multi.tree.button.checkselected.less index b4903d3ba..55207b67a 100644 --- a/src/less/widget/multitree/trigger/multi.tree.button.checkselected.less +++ b/src/less/widget/multitree/trigger/multi.tree.button.checkselected.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-multi-tree-check-selected-button { & .trigger-check-selected{ diff --git a/src/less/widget/numbereditor/number.editor.less b/src/less/widget/numbereditor/number.editor.less index 6a86c5372..ba8ab84ac 100644 --- a/src/less/widget/numbereditor/number.editor.less +++ b/src/less/widget/numbereditor/number.editor.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-number-editor { .border-radius(2px); diff --git a/src/less/widget/numberinterval/numberinterval.less b/src/less/widget/numberinterval/numberinterval.less index 811caf679..67b5a835a 100644 --- a/src/less/widget/numberinterval/numberinterval.less +++ b/src/less/widget/numberinterval/numberinterval.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-number-interval { &.hack { diff --git a/src/less/widget/quarter/trigger.quarter.less b/src/less/widget/quarter/trigger.quarter.less index 7d50e896c..f50734871 100644 --- a/src/less/widget/quarter/trigger.quarter.less +++ b/src/less/widget/quarter/trigger.quarter.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-quarter-trigger{ .border-radius(2px); } \ No newline at end of file diff --git a/src/less/widget/searchmultiselect/searchmultiselect.less b/src/less/widget/searchmultiselect/searchmultiselect.less index ff7a3c41c..bd43f3a11 100644 --- a/src/less/widget/searchmultiselect/searchmultiselect.less +++ b/src/less/widget/searchmultiselect/searchmultiselect.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-search-multi-text-value-combo{ & .multi-select-trigger-icon-button{ diff --git a/src/less/widget/singleselect/search/singleselect.search.pane.less b/src/less/widget/singleselect/search/singleselect.search.pane.less index 0ac8837e0..e9fcd04ec 100644 --- a/src/less/widget/singleselect/search/singleselect.search.pane.less +++ b/src/less/widget/singleselect/search/singleselect.search.pane.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-single-select-search-pane{ diff --git a/src/less/widget/singleselect/singleselect.combo.less b/src/less/widget/singleselect/singleselect.combo.less index c32f46b04..c75ee780f 100644 --- a/src/less/widget/singleselect/singleselect.combo.less +++ b/src/less/widget/singleselect/singleselect.combo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; @val: transform .3s ease; .bi-single-select-combo{ & .single-select-trigger-icon-button{ diff --git a/src/less/widget/singleslider/slider/widget.slider.less b/src/less/widget/singleslider/slider/widget.slider.less index 9ecc523d8..dc6f563b4 100644 --- a/src/less/widget/singleslider/slider/widget.slider.less +++ b/src/less/widget/singleslider/slider/widget.slider.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-single-slider-button { & .slider-button { diff --git a/src/less/widget/singleslider/track/widget.track.less b/src/less/widget/singleslider/track/widget.track.less index ba1fdebb3..833fdb4be 100644 --- a/src/less/widget/singleslider/track/widget.track.less +++ b/src/less/widget/singleslider/track/widget.track.less @@ -1,4 +1,4 @@ -@import "../../../index"; +@import "../../../index.less"; .bi-slider-track { & .gray-track { diff --git a/src/less/widget/timecombo/timecombo.less b/src/less/widget/timecombo/timecombo.less index 6ed973121..4929b415d 100644 --- a/src/less/widget/timecombo/timecombo.less +++ b/src/less/widget/timecombo/timecombo.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-time-trigger{ & .show-text { diff --git a/src/less/widget/timeinterval/dateinterval.less b/src/less/widget/timeinterval/dateinterval.less index 0680ad971..f39baa3f5 100644 --- a/src/less/widget/timeinterval/dateinterval.less +++ b/src/less/widget/timeinterval/dateinterval.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-date-interval{ &.time-error .bi-input{ diff --git a/src/less/widget/timeinterval/timeinterval.less b/src/less/widget/timeinterval/timeinterval.less index 81e252c20..6f64b0ae7 100644 --- a/src/less/widget/timeinterval/timeinterval.less +++ b/src/less/widget/timeinterval/timeinterval.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-time-interval{ & .bi-date-time-trigger{ diff --git a/src/less/widget/year/popup.year.less b/src/less/widget/year/popup.year.less index 814878f89..148f40508 100644 --- a/src/less/widget/year/popup.year.less +++ b/src/less/widget/year/popup.year.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-year-popup { & .year-popup-navigation { diff --git a/src/less/widget/year/trigger.year.less b/src/less/widget/year/trigger.year.less index 8b1c1296e..ed8d0d442 100644 --- a/src/less/widget/year/trigger.year.less +++ b/src/less/widget/year/trigger.year.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-year-trigger{ .border-radius(2px); } \ No newline at end of file diff --git a/src/less/widget/yearinterval/yearinterval.less b/src/less/widget/yearinterval/yearinterval.less index 8a4929dac..e2f7a497e 100644 --- a/src/less/widget/yearinterval/yearinterval.less +++ b/src/less/widget/yearinterval/yearinterval.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-year-interval{ &.time-error .bi-input{ diff --git a/src/less/widget/yearmonth/popup.yearmonth.less b/src/less/widget/yearmonth/popup.yearmonth.less index 614fbd4c8..1ec1ab0b0 100644 --- a/src/less/widget/yearmonth/popup.yearmonth.less +++ b/src/less/widget/yearmonth/popup.yearmonth.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-year-month-popup{ & .dynamic-year-month-pane { diff --git a/src/less/widget/yearmonthinterval/yearmonthinterval.less b/src/less/widget/yearmonthinterval/yearmonthinterval.less index 12db6801c..807140f67 100644 --- a/src/less/widget/yearmonthinterval/yearmonthinterval.less +++ b/src/less/widget/yearmonthinterval/yearmonthinterval.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-year-month-interval{ &.time-error .bi-input{ diff --git a/src/less/widget/yearquarter/popup.yearquarter.less b/src/less/widget/yearquarter/popup.yearquarter.less index 37c00f9dc..7c9d97ffb 100644 --- a/src/less/widget/yearquarter/popup.yearquarter.less +++ b/src/less/widget/yearquarter/popup.yearquarter.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-year-quarter-popup{ & .dynamic-year-quarter-pane { diff --git a/src/less/widget/yearquarterinterval/yearquarterinterval.less b/src/less/widget/yearquarterinterval/yearquarterinterval.less index 380e59fbe..35508cb67 100644 --- a/src/less/widget/yearquarterinterval/yearquarterinterval.less +++ b/src/less/widget/yearquarterinterval/yearquarterinterval.less @@ -1,4 +1,4 @@ -@import "../../index"; +@import "../../index.less"; .bi-year-quarter-interval{ &.time-error .bi-input{ diff --git a/src/router/router.js b/src/router/router.js index efcf2f777..7a44bb5d9 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -3126,7 +3126,9 @@ BI.RouterWidget = BI.inherit(BI.Widget, { init: function () { this.$router = this._router = BI.Router.$router = $router = new VueRouter({ - routes: this.options.routes + mode: this.options.mode, + routes: this.options.routes, + base: this.options.base, }); this.$router.beforeEach(function (to, from, next) { if (to.matched.length === 0) { diff --git a/src/widget/collapse/collapse.js b/src/widget/collapse/collapse.js new file mode 100644 index 000000000..f899c3588 --- /dev/null +++ b/src/widget/collapse/collapse.js @@ -0,0 +1,108 @@ +BI.Collapse = BI.inherit(BI.Widget, { + + props: { + baseCls: "bi-collapse", + items: [], + value: [], + trigger: "click", + accordion: false, + bordered: true, + ghost: false, + isDefaultInit: false, + openMotion: { + animation: "bi-slide-up", + animationDuring: 200 + } + }, + + render: function () { + var o = this.options; + + var collapseCls = o.ghost ? "" : "bi-background " + (o.bordered ? "bi-border bi-border-radius" : ""); + + this.expanders = {}; + + return { + type: "bi.vertical", + cls: collapseCls, + items: this._getItems(this.options.items) + + }; + }, + + _getItems: function (items) { + var self = this, o = this.options; + + return BI.map(items, function (index, item) { + var isActive = BI.contains(self._getCurrentValue(o.value), item.value); + var cls = o.ghost || index === 0 ? "" : "bi-border-top"; + + var el = BI.extend({ + type: "bi.arrow_group_node", + height: 30, + text: item.text, + value: item.value, + open: isActive + }, item.el); + + var popup = BI.extend({ + animation: o.openMotion.animation, + animationDuring: o.openMotion.animationDuring + }, item.popup); + + return BI.extend({ + type: "bi.expander", + cls: cls, + isDefaultInit: o.isDefaultInit, + trigger: o.trigger, + listeners: [{ + eventName: BI.Expander.EVENT_EXPAND, + action: function () { + self._hideOtherExpander(item.value); + self.fireEvent(BI.Collapse.EVENT_EXPAND, item.value); + } + }] + }, item, { + el: el, + popup: popup, + ref: function (_ref) { + BI.isFunction(item.ref) && item.ref(_ref); + self.expanders[item.value] = _ref; + } + }); + }); + }, + + _hideOtherExpander: function (expandKey) { + if (this.options.accordion) { + BI.each(this.expanders, function (key, expander) { + key !== (expandKey + "") && expander.hideView(); + }); + } + }, + + _getCurrentValue: function (v) { + var values = BI.isNotEmptyArray(v) ? v : BI.isKey(v) ? [v] : []; + + return this.options.accordion ? values.slice(0, 1) : values; + }, + + getValue: function () { + var value = []; + BI.each(this.expanders, function (key, expander) { + expander.isExpanded() && value.push(key); + }); + + return value; + }, + + setValue: function (v) { + var values = BI.map(this._getCurrentValue(v), function (idx, value) {return value + "";}); + BI.each(this.expanders, function (key, expander) { + BI.contains(values, key) ? expander.showView() : expander.hideView(); + }); + } +}); + +BI.Collapse.EVENT_EXPAND = "EVENT_EXPAND"; +BI.shortcut("bi.collapse", BI.Collapse); diff --git a/src/widget/date/calendar/combo.month.date.js b/src/widget/date/calendar/combo.month.date.js index cb5e6f20f..82068ceac 100644 --- a/src/widget/date/calendar/combo.month.date.js +++ b/src/widget/date/calendar/combo.month.date.js @@ -59,7 +59,7 @@ BI.MonthDateCombo = BI.inherit(BI.Trigger, { }, populate: function () { - this.combo.populate.apply(this.combo, arguments); + this.popup.populate.apply(this.popup, arguments); }, setValue: function (v) { diff --git a/src/widget/downlist/item.downlistgroup.js b/src/widget/downlist/item.downlistgroup.js index d89132f47..31492b78b 100644 --- a/src/widget/downlist/item.downlistgroup.js +++ b/src/widget/downlist/item.downlistgroup.js @@ -28,6 +28,7 @@ BI.DownListGroupItem = BI.inherit(BI.BasicButton, { type: "bi.icon_button", cls: o.iconCls1, width: 36, + height: o.height, disableSelected: true, selected: this._digest(o.value) }); diff --git a/src/widget/downlist/popup.downlist.js b/src/widget/downlist/popup.downlist.js index 5abb8fe96..35d395334 100644 --- a/src/widget/downlist/popup.downlist.js +++ b/src/widget/downlist/popup.downlist.js @@ -26,8 +26,8 @@ BI.DownListPopup = BI.inherit(BI.Pane, { this.singleValues = []; this.childValueMap = {}; this.fatherValueMap = {}; - this.items = BI.deepClone(this.options.items); - var self = this, o = this.options, children = this._createChildren(this.items); + this.items = []; + var self = this, o = this.options, children = this._createPopupItems(o.items); this.popup = BI.createWidget({ type: "bi.button_tree", items: BI.createItems(children, @@ -75,7 +75,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, { }); }, - _createChildren: function (items) { + _createPopupItems: function (items) { var self = this, result = []; // 不能修改populate进来的item的引用 BI.each(items, function (i, it) { @@ -84,8 +84,11 @@ BI.DownListPopup = BI.inherit(BI.Pane, { items: [] }; - BI.each(it, function (i, item) { - if (BI.isNotEmptyArray(item.children) && !BI.isEmpty(item.el)) { + var storeItem = []; + + BI.each(it, function (i, sourceItem) { + var item = BI.extend({}, sourceItem); + if (BI.isNotEmptyArray(sourceItem.children) && !BI.isEmpty(sourceItem.el)) { item.type = "bi.combo_group"; // popup未初始化返回的是options中的value, 在经过buttontree的getValue concat之后,无法区分值来自options // 还是item自身, 这边控制defaultInit为true来避免这个问题 @@ -93,12 +96,13 @@ BI.DownListPopup = BI.inherit(BI.Pane, { item.cls = "down-list-group"; item.trigger = "hover"; item.isNeedAdjustWidth = false; - item.el.title = item.el.title || item.el.text; + item.el = sourceItem.el; + item.el.title = sourceItem.el.title || sourceItem.el.text; item.el.type = "bi.down_list_group_item"; item.el.logic = { dynamic: true }; - item.el.height = item.el.height || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT; + item.el.height = sourceItem.el.height || BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT; item.el.iconCls2 = self.constants.nextIcon; item.popup = { lgap: 1, @@ -113,30 +117,10 @@ BI.DownListPopup = BI.inherit(BI.Pane, { innerVgap: 5, maxHeight: 378 }; - item.el.childValues = []; - item.items = item.children; - BI.each(item.children, function (i, child) { - var fatherValue = BI.deepClone(item.el.value); - var childValue = BI.deepClone(child.value); - self.singleValues.push(child.value); - child.type = child.type || "bi.down_list_item"; - child.extraCls = " child-down-list-item"; - child.title = child.title || child.text; - child.textRgap = 10; - child.isNeedAdjustWidth = false; - child.logic = { - dynamic: true - }; - child.father = fatherValue; - child.childValue = child.value; - self.fatherValueMap[self._createChildValue(fatherValue, childValue)] = fatherValue; - self.childValueMap[self._createChildValue(fatherValue, childValue)] = childValue; - child.value = self._createChildValue(fatherValue, childValue); - item.el.childValues.push(child.value); - }); + self._createChildren(item, sourceItem); } else { - item.type = item.type || "bi.down_list_item"; - item.title = item.title || item.text; + item.type = sourceItem.type || "bi.down_list_item"; + item.title = sourceItem.title || sourceItem.text; item.textRgap = 10; item.isNeedAdjustWidth = false; item.logic = { @@ -146,6 +130,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, { var el_done = {}; el_done.el = item; item_done.items.push(el_done); + storeItem.push(item); }); if (self._isGroup(item_done.items)) { BI.each(item_done.items, function (i, item) { @@ -154,6 +139,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, { } result.push(item_done); + self.items.push(storeItem); if (self._needSpliter(i, items.length)) { var spliter_container = BI.createWidget({ type: "bi.vertical", @@ -176,6 +162,33 @@ BI.DownListPopup = BI.inherit(BI.Pane, { return result; }, + _createChildren: function (targetItem, sourceItem) { + var self = this; + targetItem.el.childValues = []; + targetItem.items = targetItem.children = []; + BI.each(sourceItem.children, function (i, child) { + var item = BI.extend({}, child); + var fatherValue = BI.deepClone(targetItem.el.value); + var childValue = BI.deepClone(item.value); + self.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.textRgap = 10; + item.isNeedAdjustWidth = false; + item.logic = { + dynamic: true + }; + item.father = fatherValue; + item.childValue = item.value; + self.fatherValueMap[self._createChildValue(fatherValue, childValue)] = fatherValue; + self.childValueMap[self._createChildValue(fatherValue, childValue)] = childValue; + item.value = self._createChildValue(fatherValue, childValue); + targetItem.el.childValues.push(item.value); + targetItem.items.push(item); + }); + }, + _isGroup: function (i) { return i.length > 1; }, @@ -239,11 +252,11 @@ BI.DownListPopup = BI.inherit(BI.Pane, { populate: function (items) { BI.DownListPopup.superclass.populate.apply(this, arguments); - this.items = BI.deepClone(items); + this.items = []; this.childValueMap = {}; this.fatherValueMap = {}; this.singleValues = []; - var children = this._createChildren(this.items); + var children = this._createPopupItems(items); var popupItem = BI.createItems(children, {}, { adjustLength: -2 diff --git a/src/widget/editor/editor.search.js b/src/widget/editor/editor.search.js index af9a14614..14f8cb5f4 100644 --- a/src/widget/editor/editor.search.js +++ b/src/widget/editor/editor.search.js @@ -10,7 +10,8 @@ BI.SearchEditor = BI.inherit(BI.Widget, { errorText: "", watermark: BI.i18nText("BI-Basic_Search"), validationChecker: BI.emptyFn, - quitChecker: BI.emptyFn + quitChecker: BI.emptyFn, + value: "" }); }, _init: function () { @@ -32,7 +33,8 @@ BI.SearchEditor = BI.inherit(BI.Widget, { this.clear = BI.createWidget({ type: "bi.icon_button", stopEvent: true, - cls: "close-font" + cls: "close-font", + invisible: BI.isKey(o.value) }); this.clear.on(BI.IconButton.EVENT_CHANGE, function () { self.setValue(""); @@ -123,8 +125,6 @@ BI.SearchEditor = BI.inherit(BI.Widget, { this.editor.on(BI.Editor.EVENT_STOP, function () { self.fireEvent(BI.SearchEditor.EVENT_STOP); }); - - this.clear.invisible(); }, _checkClear: function () { @@ -214,4 +214,4 @@ BI.SearchEditor.EVENT_ENTER = "EVENT_ENTER"; BI.SearchEditor.EVENT_RESTRICT = "EVENT_RESTRICT"; BI.SearchEditor.EVENT_REMOVE = "EVENT_REMOVE"; BI.SearchEditor.EVENT_EMPTY = "EVENT_EMPTY"; -BI.shortcut("bi.search_editor", BI.SearchEditor); \ No newline at end of file +BI.shortcut("bi.search_editor", BI.SearchEditor); diff --git a/src/widget/multilayerdownlist/popup.downlist.js b/src/widget/multilayerdownlist/popup.downlist.js index c18351220..fa222005d 100644 --- a/src/widget/multilayerdownlist/popup.downlist.js +++ b/src/widget/multilayerdownlist/popup.downlist.js @@ -26,6 +26,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, { this.singleValues = []; this.childValueMap = {}; this.fatherValueMap = {}; + this.items = []; var self = this, o = this.options, children = this._createPopupItems(o.items); this.popup = BI.createWidget({ type: "bi.button_tree", @@ -83,19 +84,22 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, { type: "bi.down_list_group", items: [] }; + var storeItem = []; - BI.each(it, function (i, item) { - if (BI.isNotEmptyArray(item.children) && !BI.isEmpty(item.el)) { + BI.each(it, function (i, sourceItem) { + var item = BI.extend({}, sourceItem); + if (BI.isNotEmptyArray(sourceItem.children) && !BI.isEmpty(sourceItem.el)) { item.type = "bi.combo_group"; item.cls = "down-list-group"; item.trigger = "hover"; item.isNeedAdjustWidth = false; - item.el.title = item.el.title || item.el.text; + item.el = sourceItem.el; + item.el.title = sourceItem.el.title || sourceItem.el.text; item.el.type = "bi.down_list_group_item"; item.el.logic = { dynamic: true }; - item.el.height = item.el.height || self.constants.height; + item.el.height = sourceItem.el.height || self.constants.height; item.el.iconCls2 = self.constants.nextIcon; item.popup = { lgap: 1, @@ -110,10 +114,10 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, { innerVgap: 5, maxHeight: 378, }; - self._createChildren(item); + self._createChildren(item, sourceItem); } else { - item.type = item.type || "bi.down_list_item"; - item.title = item.title || item.text; + item.type = sourceItem.type || "bi.down_list_item"; + item.title = sourceItem.title || sourceItem.text; item.textRgap = 10; item.isNeedAdjustWidth = false; item.logic = { @@ -123,6 +127,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, { var el_done = {}; el_done.el = item; item_done.items.push(el_done); + storeItem.push(item); }); if (self._isGroup(item_done.items)) { BI.each(item_done.items, function (i, item) { @@ -131,6 +136,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, { } result.push(item_done); + self.items.push(storeItem); if (self._needSpliter(i, items.length)) { var spliter_container = BI.createWidget({ type: "bi.vertical", @@ -152,34 +158,35 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, { return result; }, - _createChildren: function (item) { + _createChildren: function (targetItem, sourceItem) { var self = this; - this._formatEL(item).el.childValues = []; - item.items = item.children; - BI.each(item.children, function (i, child) { - child = child.el ? BI.extend(child.el, {children: child.children}) : child; - var fatherValue = BI.deepClone(self._formatEL(item).el.value); - var childValue = BI.deepClone(child.value); - self.singleValues.push(child.value); - child.type = child.type || "bi.down_list_item"; - child.extraCls = " child-down-list-item"; - child.title = child.title || child.text; - child.textRgap = 10; - child.isNeedAdjustWidth = false; - child.logic = { + this._formatEL(targetItem).el.childValues = []; + targetItem.items = targetItem.children = []; + BI.each(sourceItem.children, function (i, child) { + var item = child.el ? BI.extend({}, child.el, {children: child.children}) : BI.extend({}, child); + var fatherValue = BI.deepClone(self._formatEL(targetItem).el.value); + var childValue = BI.deepClone(item.value); + self.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.textRgap = 10; + item.isNeedAdjustWidth = false; + item.logic = { dynamic: true }; - child.father = fatherValue; + item.father = fatherValue; self.fatherValueMap[self._createChildValue(fatherValue, childValue)] = fatherValue; self.childValueMap[self._createChildValue(fatherValue, childValue)] = childValue; - child.value = self._createChildValue(fatherValue, childValue); - self._formatEL(item).el.childValues.push(child.value); + item.value = self._createChildValue(fatherValue, childValue); + self._formatEL(targetItem).el.childValues.push(item.value); if (BI.isNotEmptyArray(child.children)) { - child.type = "bi.down_list_group_item"; - child.iconCls2 = self.constants.nextIcon; - child.height = child.height || self.constants.height; - self._createChildren(child); + item.type = "bi.down_list_group_item"; + item.iconCls2 = self.constants.nextIcon; + item.height = child.height || self.constants.height; + self._createChildren(item, child); } + targetItem.items.push(item); }); }, @@ -228,7 +235,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, { _checkValues: function (values) { var self = this, o = this.options; var value = []; - BI.each(o.items, function (idx, itemGroup) { + BI.each(this.items, function (idx, itemGroup) { BI.each(itemGroup, function (id, item) { if(BI.isNotNull(item.children)) { var childValues = getChildrenValue(item); @@ -277,6 +284,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, { self.childValueMap = {}; self.fatherValueMap = {}; self.singleValues = []; + this.items = []; var children = self._createPopupItems(items); var popupItem = BI.createItems(children, {}, { diff --git a/src/widget/multiselect/multiselect.combo.js b/src/widget/multiselect/multiselect.combo.js index 09c06b6a3..254aa0340 100644 --- a/src/widget/multiselect/multiselect.combo.js +++ b/src/widget/multiselect/multiselect.combo.js @@ -17,14 +17,15 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { }, _init: function () { - var self = this; var o = this.options; + var self = this; + var o = this.options; BI.MultiSelectCombo.superclass._init.apply(this, arguments); var assertShowValue = function () { if (BI.isKey(self._startValue)) { if (self.storeValue.type === BI.Selection.All) { BI.remove(self.storeValue.value, self._startValue); self.storeValue.assist = self.storeValue.assist || []; - self.storeValue.assist.pushDistinct(self._startValue); + BI.pushDistinct(self.storeValue.assist, self._startValue); } else { BI.pushDistinct(self.storeValue.value, self._startValue); BI.remove(self.storeValue.assist, self._startValue); @@ -280,7 +281,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { }, _itemsCreator4Trigger: function (op, callback) { - var self = this; var o = this.options; + var self = this; + var o = this.options; o.itemsCreator(op, function (res) { if (op.times === 1 && BI.isNotNull(op.keywords)) { // 预防trigger内部把当前的storeValue改掉 @@ -311,7 +313,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { }, _joinKeywords: function (keywords, callback) { - var self = this; var o = this.options; + var self = this; + var o = this.options; this._assertValue(this.storeValue); this.requesting = true; o.itemsCreator({ @@ -322,7 +325,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { digest(values); }); - function digest (items) { + function digest(items) { var selectedMap = self._makeMap(items); BI.each(keywords, function (i, val) { if (BI.isNotNull(selectedMap[val])) { @@ -334,7 +337,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { }, _joinAll: function (res, callback) { - var self = this; var o = this.options; + var self = this; + var o = this.options; this._assertValue(res); this.requesting = true; if (this.storeValue.type === res.type) { @@ -385,11 +389,12 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { }, _adjust: function (callback) { - var self = this; var o = this.options; + var self = this; + var o = this.options; adjust(); callback(); - function adjust () { + function adjust() { if (self.wants2Quit === true) { self._dataChange && self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM); self.wants2Quit = false; @@ -399,7 +404,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { }, _join: function (res, callback) { - var self = this; var o = this.options; + var self = this; + var o = this.options; this._assertValue(res); this._assertValue(this.storeValue); if (this.storeValue.type === res.type) { diff --git a/src/widget/multiselect/multiselect.combo.nobar.js b/src/widget/multiselect/multiselect.combo.nobar.js index b4fe04154..06138cf4b 100644 --- a/src/widget/multiselect/multiselect.combo.nobar.js +++ b/src/widget/multiselect/multiselect.combo.nobar.js @@ -23,7 +23,7 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, { if (self.storeValue.type === BI.Selection.All) { BI.remove(self.storeValue.value, self._startValue); self.storeValue.assist = self.storeValue.assist || []; - self.storeValue.assist.pushDistinct(self._startValue); + BI.pushDistinct(self.storeValue.assist, self._startValue); } else { BI.pushDistinct(self.storeValue.value, self._startValue); BI.remove(self.storeValue.assist, self._startValue); @@ -461,11 +461,11 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, { this.combo.populate.apply(this.combo, arguments); }, - showView:function (){ + showView: function () { this.combo.showView(); }, - hideView:function (){ + hideView: function () { this.combo.hideView(); }, diff --git a/src/widget/multiselect/multiselect.insert.combo.js b/src/widget/multiselect/multiselect.insert.combo.js index 0cedaf020..b5906f856 100644 --- a/src/widget/multiselect/multiselect.insert.combo.js +++ b/src/widget/multiselect/multiselect.insert.combo.js @@ -21,10 +21,10 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { BI.MultiSelectInsertCombo.superclass._init.apply(this, arguments); var assertShowValue = function () { if (BI.isKey(self._startValue)) { - if(self.storeValue.type === BI.Selection.All) { + if (self.storeValue.type === BI.Selection.All) { BI.remove(self.storeValue.value, self._startValue); self.storeValue.assist = self.storeValue.assist || []; - self.storeValue.assist.pushDistinct(self._startValue); + BI.pushDistinct(self.storeValue.assist, self._startValue); } else { BI.pushDistinct(self.storeValue.value, self._startValue); BI.remove(self.storeValue.assist, self._startValue); @@ -282,7 +282,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { }); }, - _itemsCreator4Trigger: function(op, callback) { + _itemsCreator4Trigger: function (op, callback) { var self = this, o = this.options; o.itemsCreator(op, function (res) { if (op.times === 1 && BI.isNotNull(op.keywords)) { @@ -313,7 +313,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { }); }, - _stopEditing: function() { + _stopEditing: function () { this.trigger.stopEditing(); this.numberCounter.hideView(); }, @@ -340,7 +340,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { digest(); - function digest () { + function digest() { BI.each(keywords, function (i, val) { self.storeValue.type === BI.Selection.Multi ? BI.pushDistinct(self.storeValue.value, val) : BI.remove(self.storeValue.value, val); }); @@ -403,7 +403,8 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { var self = this, o = this.options; adjust(); callback(); - function adjust () { + + function adjust() { if (self.wants2Quit === true) { self._dataChange && self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CONFIRM); self.wants2Quit = false; @@ -450,11 +451,11 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { this.combo.populate.apply(this.combo, arguments); }, - showView:function (){ + showView: function () { this.combo.showView(); }, - hideView:function (){ + hideView: function () { this.combo.hideView(); }, diff --git a/src/widget/multiselect/multiselect.insert.combo.nobar.js b/src/widget/multiselect/multiselect.insert.combo.nobar.js index 39099bbde..de4f9eb35 100644 --- a/src/widget/multiselect/multiselect.insert.combo.nobar.js +++ b/src/widget/multiselect/multiselect.insert.combo.nobar.js @@ -23,7 +23,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, { if (self.storeValue.type === BI.Selection.All) { BI.remove(self.storeValue.value, self._startValue); self.storeValue.assist = self.storeValue.assist || []; - self.storeValue.assist.pushDistinct(self._startValue); + BI.pushDistinct(self.storeValue.assist, self._startValue); } else { BI.pushDistinct(self.storeValue.value, self._startValue); BI.remove(self.storeValue.assist, self._startValue); @@ -279,7 +279,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, { }); }, - _itemsCreator4Trigger: function(op, callback) { + _itemsCreator4Trigger: function (op, callback) { var self = this, o = this.options; o.itemsCreator(op, function (res) { if (op.times === 1 && BI.isNotNull(op.keywords)) { @@ -310,7 +310,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, { }); }, - _stopEditing: function() { + _stopEditing: function () { this.trigger.stopEditing(); this.numberCounter.hideView(); }, @@ -337,7 +337,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, { digest(); - function digest () { + function digest() { BI.each(keywords, function (i, val) { self.storeValue.type === BI.Selection.Multi ? BI.pushDistinct(self.storeValue.value, val) : BI.remove(self.storeValue.value, val); }); @@ -400,7 +400,8 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, { var self = this, o = this.options; adjust(); callback(); - function adjust () { + + function adjust() { if (self.wants2Quit === true) { self._dataChange && self.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM); self.wants2Quit = false; @@ -446,11 +447,11 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, { this.combo.populate.apply(this.combo, arguments); }, - showView:function (){ + showView: function () { this.combo.showView(); }, - hideView:function (){ + hideView: function () { this.combo.hideView(); }, diff --git a/src/widget/singleselect/singleselect.combo.js b/src/widget/singleselect/singleselect.combo.js index fb873438f..fae620c93 100644 --- a/src/widget/singleselect/singleselect.combo.js +++ b/src/widget/singleselect/singleselect.combo.js @@ -10,6 +10,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { baseCls: "bi-single-select-combo", allowNoSelect: false, itemsCreator: BI.emptyFn, + itemWrapper: BI.emptyFn, valueFormatter: BI.emptyFn, height: 24, allowEdit: true @@ -107,6 +108,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { } }], itemsCreator: o.itemsCreator, + itemWrapper: o.itemWrapper, valueFormatter: o.valueFormatter, onLoaded: function () { BI.nextTick(function () { diff --git a/src/widget/singleselect/singleselect.insert.combo.js b/src/widget/singleselect/singleselect.insert.combo.js index b8b21cd09..46754e1dc 100644 --- a/src/widget/singleselect/singleselect.insert.combo.js +++ b/src/widget/singleselect/singleselect.insert.combo.js @@ -10,6 +10,7 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, { baseCls: "bi-single-select-combo", allowNoSelect: false, itemsCreator: BI.emptyFn, + itemWrapper: BI.emptyFn, valueFormatter: BI.emptyFn, height: 24, allowEdit: true, @@ -118,6 +119,7 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, { } }], itemsCreator: o.itemsCreator, + itemWrapper: o.itemWrapper, valueFormatter: o.valueFormatter, onLoaded: function () { BI.nextTick(function () { diff --git a/src/widget/singleselect/singleselect.loader.js b/src/widget/singleselect/singleselect.loader.js index 1f27b6425..645bdad66 100644 --- a/src/widget/singleselect/singleselect.loader.js +++ b/src/widget/singleselect/singleselect.loader.js @@ -22,6 +22,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, { allowNoSelect: false, valueFormatter: BI.emptyFn, itemsCreator: BI.emptyFn, + itemWrapper: BI.emptyFn, onLoaded: BI.emptyFn }); }, @@ -69,7 +70,12 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, { if (op.times === 1 && !BI.isUndefined(self.storeValue)) { var json = BI.map([self.storeValue], function (i, v) { var txt = opts.valueFormatter(v) || v; - return { + return opts.itemWrapper({ + text: txt, + value: v, + title: txt, + selected: true + }) || { text: txt, value: v, title: txt, @@ -117,7 +123,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, { height: BI.SIZE_CONSANTS.LIST_ITEM_HEIGHT, selected: false, iconWrapperWidth: 26, - hgap: o.allowNoSelect ? 10 : 0, + textHgap: o.allowNoSelect ? 10 : 0, title: item.title || item.text }, item); }); diff --git a/src/widget/singleselect/singleselect.popup.view.js b/src/widget/singleselect/singleselect.popup.view.js index 4e33c004f..ffa8766bd 100644 --- a/src/widget/singleselect/singleselect.popup.view.js +++ b/src/widget/singleselect/singleselect.popup.view.js @@ -14,6 +14,7 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, { maxHeight: 400, valueFormatter: BI.emptyFn, itemsCreator: BI.emptyFn, + itemWrapper: BI.emptyFn, onLoaded: BI.emptyFn }); }, @@ -26,6 +27,7 @@ BI.SingleSelectPopupView = BI.inherit(BI.Widget, { type: "bi.single_select_loader", allowNoSelect: opts.allowNoSelect, itemsCreator: opts.itemsCreator, + itemWrapper: opts.itemWrapper, valueFormatter: opts.valueFormatter, onLoaded: opts.onLoaded, value: opts.value diff --git a/src/widget/singleselect/singleselectlist.insert.js b/src/widget/singleselect/singleselectlist.insert.js index db1722abc..f9bce32e6 100644 --- a/src/widget/singleselect/singleselectlist.insert.js +++ b/src/widget/singleselect/singleselectlist.insert.js @@ -9,6 +9,7 @@ BI.SingleSelectInsertList = BI.inherit(BI.Single, { baseCls: "bi-multi-select-insert-list", allowNoSelect: false, itemsCreator: BI.emptyFn, + itemWrapper: BI.emptyFn, valueFormatter: BI.emptyFn, searcherHeight: 24, }); @@ -30,6 +31,7 @@ BI.SingleSelectInsertList = BI.inherit(BI.Single, { cls: "popup-single-select-list bi-border-left bi-border-right bi-border-bottom", itemsCreator: o.itemsCreator, valueFormatter: o.valueFormatter, + itemWrapper: o.itemWrapper, logic: { dynamic: true }, diff --git a/src/widget/year/combo.year.js b/src/widget/year/combo.year.js index 62a498d54..1774ca384 100644 --- a/src/widget/year/combo.year.js +++ b/src/widget/year/combo.year.js @@ -24,7 +24,8 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, { min: o.minDate, max: o.maxDate, height: o.height - border, - value: o.value || "" + value: o.value || "", + watermark: o.watermark }); this.trigger.on(BI.DynamicYearTrigger.EVENT_KEY_DOWN, function () { if (self.combo.isViewVisible()) { @@ -211,8 +212,11 @@ BI.DynamicYearCombo = BI.inherit(BI.Widget, { isStateValid: function () { return this.trigger.isValid(); - } + }, + setWaterMark: function (v) { + this.trigger.setWaterMark(v); + } }); BI.DynamicYearCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; diff --git a/src/widget/year/trigger.year.js b/src/widget/year/trigger.year.js index 91b80a431..fe8976b2f 100644 --- a/src/widget/year/trigger.year.js +++ b/src/widget/year/trigger.year.js @@ -10,7 +10,8 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { extraCls: "bi-year-trigger", min: "1900-01-01", // 最小日期 max: "2099-12-31", // 最大日期 - height: 24 + height: 24, + watermark: BI.i18nText("BI-Basic_Unrestricted") }); }, @@ -35,7 +36,7 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { }, hgap: c.hgap, vgap: c.vgap, - watermark: BI.i18nText("BI-Basic_Unrestricted"), + watermark: o.watermark, allowBlank: true, errorText: function (v) { if (BI.isPositiveInteger(v)) { @@ -188,6 +189,10 @@ BI.DynamicYearTrigger = BI.inherit(BI.Trigger, { getKey: function () { return this.editor.getValue() | 0; + }, + + setWaterMark: function (v) { + this.editor.setWaterMark(v); } }); BI.DynamicYearTrigger.EVENT_KEY_DOWN = "EVENT_KEY_DOWN"; diff --git a/typescript/base/combination/combo.ts b/typescript/base/combination/combo.ts index 249e7e6f2..c7d511a2b 100644 --- a/typescript/base/combination/combo.ts +++ b/typescript/base/combination/combo.ts @@ -59,6 +59,8 @@ export declare class Combo extends Widget { getPopupPosition(): any; + adjustWidth(e?:MouseEvent): void; + adjustHeight(e?: MouseEvent): void; toggle(): void; diff --git a/typescript/base/foundation/message.ts b/typescript/base/foundation/message.ts index ce7d54c3a..63790d1cb 100644 --- a/typescript/base/foundation/message.ts +++ b/typescript/base/foundation/message.ts @@ -2,5 +2,5 @@ export type _msg = { alert: (title: string, message?: string | {[key: string]: any}, callback?: (result?: boolean)=>void) => void confirm: (title: string, message?: string | {[key: string]: any}, callback?: (result: boolean)=>void) => void prompt: (title: string, message?: string, value?: any, callback?: (result: string) => void, minWidth?: number) => void - toast: (message: string, options?: object, context?: HTMLElement) => void + toast: (message: string, options?: object | string, context?: HTMLElement) => void } diff --git a/typescript/case/combo/bubblecombo/combo.bubble.ts b/typescript/case/combo/bubblecombo/combo.bubble.ts index cd50d722b..d5366233f 100644 --- a/typescript/case/combo/bubblecombo/combo.bubble.ts +++ b/typescript/case/combo/bubblecombo/combo.bubble.ts @@ -17,4 +17,8 @@ export declare class BubbleCombo extends Widget { showView(): void; isViewVisible(): boolean; + + adjustWidth(e?:MouseEvent): void; + + adjustHeight(e?: MouseEvent): void; } diff --git a/typescript/widget/collapse/collapse.ts b/typescript/widget/collapse/collapse.ts new file mode 100644 index 000000000..949987186 --- /dev/null +++ b/typescript/widget/collapse/collapse.ts @@ -0,0 +1,10 @@ +import { Widget } from "../../core/widget"; + +export declare class Collapse extends Widget { + static xtype: string; + static EVENT_EXPAND: string; + + getValue(): string[]; + + setValue(v: string[]): void; +} diff --git a/ui/less/app.less b/ui/less/app.less index d086387ac..27e4631e7 100644 --- a/ui/less/app.less +++ b/ui/less/app.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/app"; -@import "var"; +@import "../../src/less/resource/app.less"; +@import "var.less"; diff --git a/ui/less/background.less b/ui/less/background.less index 996147127..a6cbde36b 100644 --- a/ui/less/background.less +++ b/ui/less/background.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/background"; -@import "var"; +@import "../../src/less/resource/background.less"; +@import "var.less"; diff --git a/ui/less/font.less b/ui/less/font.less index c236f82ed..d7399c46e 100644 --- a/ui/less/font.less +++ b/ui/less/font.less @@ -1,2 +1,2 @@ -@import "../../src/less/resource/font"; -@import "var"; +@import "../../src/less/resource/font.less"; +@import "var.less"; diff --git a/ui/less/icon.less b/ui/less/icon.less index 43e3123c5..8aa44a2ae 100644 --- a/ui/less/icon.less +++ b/ui/less/icon.less @@ -1,5 +1,5 @@ -@import "../../src/less/resource/icon"; -@import "var"; +@import "../../src/less/resource/icon.less"; +@import "var.less"; diff --git a/webpack/webpack.dev.js b/webpack/webpack.dev.js index d3c0fb5bc..9e5a21432 100644 --- a/webpack/webpack.dev.js +++ b/webpack/webpack.dev.js @@ -36,11 +36,17 @@ module.exports = merge(common, { output: { path: dirs.DEST, filename: "[name].js", + publicPath: '/', }, devServer: { contentBase: path.join(__dirname, ".."), port: 9001, liveReload: true, + historyApiFallback: { + rewrites: [ + { from: /.*/, to: '/index.html' }, + ], + }, }, plugins: [ new MiniCssExtractPlugin({ diff --git a/webpack/webpack.prod.js b/webpack/webpack.prod.js index 7d8dd939c..05cb95648 100644 --- a/webpack/webpack.prod.js +++ b/webpack/webpack.prod.js @@ -23,6 +23,7 @@ module.exports = merge.smart(common, { utils: attachments.utils, "utils.min": attachments.utils, "fineui_without_jquery_polyfill": attachments.fineuiWithoutJqueryAndPolyfillJs, + "fineui_without_jquery_polyfill.min": attachments.fineuiWithoutJqueryAndPolyfillJs, "2.0/fineui": attachments.bundle, "2.0/fineui.min": attachments.bundle, "2.0/fineui_without_normalize": attachments.bundleWithoutNormalize,