diff --git a/dist/fix/fix.compact.js b/dist/fix/fix.compact.js index 87d22bd83..b8e49eb28 100644 --- a/dist/fix/fix.compact.js +++ b/dist/fix/fix.compact.js @@ -105,6 +105,10 @@ if (workerMode && this._worker) { return; } + if (this.store) { + pushTarget(this.store); + return true; + } if (this._store) { var store = findStore(this.options.context || this._parent || this.options.element || this._context); if (store) { diff --git a/dist/font/iconfont.eot b/dist/font/iconfont.eot index 9467079b9..e65645dbd 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 1d370825c..a04b152fa 100644 --- a/dist/font/iconfont.svg +++ b/dist/font/iconfont.svg @@ -14,1331 +14,1681 @@ /> - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/dist/font/iconfont.ttf b/dist/font/iconfont.ttf index 112a82ca3..09cb798ae 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 601304710..fb99c8512 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 1d2e11a8e..5b9bb3bd0 100644 Binary files a/dist/font/iconfont.woff2 and b/dist/font/iconfont.woff2 differ diff --git a/package.json b/package.json index dff5e1f39..fcbe06539 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220310163323", + "version": "2.0.20220313163326", "description": "fineui", "main": "dist/fineui.min.js", "types": "dist/lib/index.d.ts", diff --git a/src/base/single/button/buttons/button.icon.js b/src/base/single/button/buttons/button.icon.js index 5eb104e6d..3def60551 100644 --- a/src/base/single/button/buttons/button.icon.js +++ b/src/base/single/button/buttons/button.icon.js @@ -8,6 +8,12 @@ BI.IconButton = BI.inherit(BI.BasicButton, { var conf = BI.IconButton.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { _baseCls: (conf._baseCls || "") + " bi-icon-button horizon-center", + hgap: 0, + vgap: 0, + tgap: 0, + bgap: 0, + lgap: 0, + rgap: 0, iconWidth: null, iconHeight: null }); @@ -28,6 +34,12 @@ BI.IconButton = BI.inherit(BI.BasicButton, { BI.createWidget({ type: "bi.default", element: this, + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap, items: [this.icon] }); } else { @@ -35,6 +47,12 @@ BI.IconButton = BI.inherit(BI.BasicButton, { BI.createWidget({ element: this, type: "bi.center_adapt", + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap, items: [this.icon] }); } diff --git a/src/base/single/button/listitem/blankiconicontextitem.js b/src/base/single/button/listitem/blankiconicontextitem.js index 3c0fcb94b..ed8f0b6d1 100644 --- a/src/base/single/button/listitem/blankiconicontextitem.js +++ b/src/base/single/button/listitem/blankiconicontextitem.js @@ -50,19 +50,21 @@ BI.BlankIconIconTextItem = BI.inherit(BI.BasicButton, { iconWidth: o.iconWidth, iconHeight: o.iconHeight }, { - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }] }; }, diff --git a/src/base/single/button/listitem/blankicontexticonitem.js b/src/base/single/button/listitem/blankicontexticonitem.js index 9085d997d..815589387 100644 --- a/src/base/single/button/listitem/blankicontexticonitem.js +++ b/src/base/single/button/listitem/blankicontexticonitem.js @@ -44,19 +44,21 @@ BI.BlankIconTextIconItem = BI.inherit(BI.BasicButton, { iconWidth: o.iconWidth, iconHeight: o.iconHeight }, { - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }, { type: "bi.icon_label", cls: o.iconCls2, diff --git a/src/base/single/button/listitem/blankicontextitem.js b/src/base/single/button/listitem/blankicontextitem.js index f83e14c57..54be05c5b 100644 --- a/src/base/single/button/listitem/blankicontextitem.js +++ b/src/base/single/button/listitem/blankicontextitem.js @@ -42,20 +42,22 @@ BI.BlankIconTextItem = BI.inherit(BI.BasicButton, { iconWidth: o.iconWidth, iconHeight: o.iconHeight }, { - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }] }; }, diff --git a/src/base/single/button/listitem/icontexticonitem.js b/src/base/single/button/listitem/icontexticonitem.js index 80e0d0a1c..8db8ae483 100644 --- a/src/base/single/button/listitem/icontexticonitem.js +++ b/src/base/single/button/listitem/icontexticonitem.js @@ -40,19 +40,21 @@ BI.IconTextIconItem = BI.inherit(BI.BasicButton, { iconWidth: o.iconWidth, iconHeight: o.iconHeight }, { - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }, { type: "bi.icon_label", cls: o.iconCls2, diff --git a/src/base/single/button/listitem/icontextitem.js b/src/base/single/button/listitem/icontextitem.js index 6d3bf7199..76c19e25d 100644 --- a/src/base/single/button/listitem/icontextitem.js +++ b/src/base/single/button/listitem/icontextitem.js @@ -40,20 +40,22 @@ BI.IconTextItem = BI.inherit(BI.BasicButton, { iconWidth: o.iconWidth, iconHeight: o.iconHeight }, { - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }] }; }, diff --git a/src/base/single/button/listitem/texticonitem.js b/src/base/single/button/listitem/texticonitem.js index 87d188859..92c696780 100644 --- a/src/base/single/button/listitem/texticonitem.js +++ b/src/base/single/button/listitem/texticonitem.js @@ -33,20 +33,22 @@ BI.TextIconItem = BI.inherit(BI.BasicButton, { type: "bi.vertical_adapt", columnSize: ["fill", o.iconWrapperWidth || o.height], items: [{ - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }, { type: "bi.icon_label", cls: o.iconCls, diff --git a/src/base/single/button/node/icontexticonnode.js b/src/base/single/button/node/icontexticonnode.js index df2e28eb5..79bc0167f 100644 --- a/src/base/single/button/node/icontexticonnode.js +++ b/src/base/single/button/node/icontexticonnode.js @@ -38,19 +38,21 @@ BI.IconTextIconNode = BI.inherit(BI.NodeButton, { iconWidth: o.iconWidth, iconHeight: o.iconHeight }, { - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }, { type: "bi.icon_label", cls: o.iconCls2, diff --git a/src/base/single/button/node/icontextnode.js b/src/base/single/button/node/icontextnode.js index 653888a4a..00f1adf86 100644 --- a/src/base/single/button/node/icontextnode.js +++ b/src/base/single/button/node/icontextnode.js @@ -37,20 +37,22 @@ BI.IconTextNode = BI.inherit(BI.NodeButton, { iconWidth: o.iconWidth, iconHeight: o.iconHeight }, { - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }] }; }, diff --git a/src/base/single/button/node/texticonnode.js b/src/base/single/button/node/texticonnode.js index 71217b746..67844bddc 100644 --- a/src/base/single/button/node/texticonnode.js +++ b/src/base/single/button/node/texticonnode.js @@ -29,20 +29,22 @@ BI.TextIconNode = BI.inherit(BI.NodeButton, { type: "bi.vertical_adapt", columnSize: ["fill", o.iconWrapperWidth || o.height], items: [{ - type: "bi.label", - ref: function (_ref) { - self.text = _ref; - }, - cls: "list-item-text", - textAlign: "left", - hgap: o.textHgap, - vgap: o.textVgap, - lgap: o.textLgap, - rgap: o.textRgap, - text: o.text, - value: o.value, - keyword: o.keyword, - height: o.height + el: { + type: "bi.label", + ref: function (_ref) { + self.text = _ref; + }, + cls: "list-item-text", + textAlign: "left", + hgap: o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, + text: o.text, + value: o.value, + keyword: o.keyword, + height: o.height + } }, { type: "bi.icon_label", cls: o.iconCls, diff --git a/src/base/single/label/icon.label.js b/src/base/single/label/icon.label.js index 6575564b1..b5779c3e5 100644 --- a/src/base/single/label/icon.label.js +++ b/src/base/single/label/icon.label.js @@ -7,6 +7,12 @@ BI.IconLabel = BI.inherit(BI.Single, { props: { baseCls: "bi-icon-label horizon-center", + hgap: 0, + vgap: 0, + tgap: 0, + bgap: 0, + lgap: 0, + rgap: 0, iconWidth: null, iconHeight: null, lineHeight: null, @@ -27,6 +33,12 @@ BI.IconLabel = BI.inherit(BI.Single, { BI.createWidget({ type: "bi.default", element: this, + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap, items: [this.icon] }); } else { @@ -34,6 +46,12 @@ BI.IconLabel = BI.inherit(BI.Single, { BI.createWidget({ element: this, type: "bi.center_adapt", + hgap: o.hgap, + vgap: o.vgap, + lgap: o.lgap, + rgap: o.rgap, + tgap: o.tgap, + bgap: o.bgap, items: [this.icon] }); } diff --git a/src/case/button/item.multiselect.js b/src/case/button/item.multiselect.js index 648036f61..83071a763 100644 --- a/src/case/button/item.multiselect.js +++ b/src/case/button/item.multiselect.js @@ -17,7 +17,8 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { iconWrapperWidth: 26, textHgap: 0, textLgap: 0, - textRgap: 0 + textRgap: 0, + textVgap: 0, }); }, @@ -48,9 +49,10 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, { whiteSpace: "nowrap", textHeight: o.height, height: o.height, - hgap: o.hgap, - rgap: o.rgap, + hgap: o.textHgap, + rgap: o.textRgap, lgap: o.textLgap, + vgap: o.textVgap, text: o.text, keyword: o.keyword, value: o.value, diff --git a/src/case/button/item.singleselect.icontext.js b/src/case/button/item.singleselect.icontext.js index a84170cb4..de00e362a 100644 --- a/src/case/button/item.singleselect.icontext.js +++ b/src/case/button/item.singleselect.icontext.js @@ -28,6 +28,10 @@ BI.SingleSelectIconTextItem = BI.inherit(BI.Single, { height: o.height, iconHeight: o.iconHeight, iconWidth: o.iconWidth, + textHgap: o.textHgap, + textVgap: o.textVgap, + textLgap: o.textLgap, + textRgap: o.textRgap, text: o.text, keyword: o.keyword, value: o.value, diff --git a/src/case/button/item.singleselect.js b/src/case/button/item.singleselect.js index 56d7ac6a4..791c66383 100644 --- a/src/case/button/item.singleselect.js +++ b/src/case/button/item.singleselect.js @@ -5,7 +5,7 @@ BI.SingleSelectItem = BI.inherit(BI.BasicButton, { attributes: { tabIndex: 1 }, - hgap: 10, + textHgap: 10, height: 24, textAlign: "left" }); @@ -20,7 +20,10 @@ BI.SingleSelectItem = BI.inherit(BI.BasicButton, { whiteSpace: "nowrap", textHeight: o.height, height: o.height, - hgap: o.hgap, + hgap: o.hgap || o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, text: o.text, keyword: o.keyword, value: o.value, diff --git a/src/case/button/item.singleselect.radio.js b/src/case/button/item.singleselect.radio.js index 911dd56e0..910ec253e 100644 --- a/src/case/button/item.singleselect.radio.js +++ b/src/case/button/item.singleselect.radio.js @@ -15,8 +15,8 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { }, height: 24, iconWrapperWidth: 16, - hgap: 10, - textHgap: 0, + textHgap: 10, + textVgap: 0, textLgap: 0, textRgap: 0 }); @@ -46,9 +46,10 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { whiteSpace: "nowrap", textHeight: o.height, height: o.height, - hgap: o.hgap, - rgap: o.textRgap, + hgap: o.hgap || o.textHgap, + vgap: o.textVgap, lgap: o.textLgap, + rgap: o.textRgap, text: o.text, keyword: o.keyword, value: o.value, diff --git a/src/case/button/node/node.arrow.js b/src/case/button/node/node.arrow.js index 259ea3158..6fc690d7b 100644 --- a/src/case/button/node/node.arrow.js +++ b/src/case/button/node/node.arrow.js @@ -41,7 +41,10 @@ BI.ArrowNode = BI.inherit(BI.NodeButton, { whiteSpace: "nowrap", textHeight: o.height, height: o.height, - hgap: o.hgap, + hgap: o.hgap || o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, text: o.text, value: o.value, py: o.py, diff --git a/src/case/button/node/node.plus.js b/src/case/button/node/node.plus.js index d5de8817b..ec38ca0e0 100644 --- a/src/case/button/node/node.plus.js +++ b/src/case/button/node/node.plus.js @@ -46,7 +46,10 @@ BI.PlusGroupNode = BI.inherit(BI.NodeButton, { whiteSpace: "nowrap", textHeight: o.height, height: o.height, - hgap: o.hgap, + hgap: o.hgap || o.textHgap, + vgap: o.textVgap, + lgap: o.textLgap, + rgap: o.textRgap, text: o.text, value: o.value, keyword: o.keyword, diff --git a/src/case/combo/iconcombo/combo.icon.js b/src/case/combo/iconcombo/combo.icon.js index 409e1a003..81050859a 100644 --- a/src/case/combo/iconcombo/combo.icon.js +++ b/src/case/combo/iconcombo/combo.icon.js @@ -25,8 +25,14 @@ BI.IconCombo = BI.inherit(BI.Widget, { }, _init: function () { - BI.IconCombo.superclass._init.apply(this, arguments); var self = this, o = this.options; + o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { + self.setValue(newValue); + }) : o.value; + o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) { + self.populate(newValue); + }) : o.items; + BI.IconCombo.superclass._init.apply(this, arguments); this.trigger = BI.createWidget(o.el, { type: "bi.icon_combo_trigger", iconCls: o.iconCls, diff --git a/src/case/combo/icontextvaluecombo/combo.icontextvalue.js b/src/case/combo/icontextvaluecombo/combo.icontextvalue.js index 35758a089..92732d9b1 100644 --- a/src/case/combo/icontextvaluecombo/combo.icontextvalue.js +++ b/src/case/combo/icontextvaluecombo/combo.icontextvalue.js @@ -15,8 +15,14 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; - o.height -= 2; BI.isNumeric(o.width) && (o.width -= 2); + BI.isNumeric(o.height) && (o.height -= 2); + o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { + self.setValue(newValue); + }) : o.value; + o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) { + self.populate(newValue); + }) : o.items; BI.IconTextValueCombo.superclass._init.apply(this, arguments); this.trigger = BI.createWidget({ type: "bi.select_icon_text_trigger", diff --git a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js index e86bec863..ac3fad335 100644 --- a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js +++ b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js @@ -15,6 +15,12 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; + o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { + self.setValue(newValue); + }) : o.value; + o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) { + self.populate(newValue); + }) : o.items; return { type: "bi.absolute", items: [{ diff --git a/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js b/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js index 891481a8a..1b9b9a0ce 100644 --- a/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js +++ b/src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js @@ -16,8 +16,14 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; - o.height -= 2; BI.isNumeric(o.width) && (o.width -= 2); + BI.isNumeric(o.height) && (o.height -= 2); + o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { + self.setValue(newValue); + }) : o.value; + o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) { + self.populate(newValue); + }) : o.items; BI.TextValueCheckCombo.superclass._init.apply(this, arguments); this.trigger = BI.createWidget({ type: "bi.select_text_trigger", diff --git a/src/case/combo/textvaluecombo/combo.textvalue.js b/src/case/combo/textvaluecombo/combo.textvalue.js index 7dc38d9fe..6b9ef321b 100644 --- a/src/case/combo/textvaluecombo/combo.textvalue.js +++ b/src/case/combo/textvaluecombo/combo.textvalue.js @@ -17,8 +17,14 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { _init: function () { var self = this, o = this.options; - o.height -= 2; BI.isNumeric(o.width) && (o.width -= 2); + BI.isNumeric(o.height) && (o.height -= 2); + o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { + self.setValue(newValue); + }) : o.value; + o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) { + self.populate(newValue); + }) : o.items; BI.TextValueCombo.superclass._init.apply(this, arguments); this.trigger = BI.createWidget({ type: "bi.select_text_trigger", diff --git a/src/case/combo/textvaluecombo/combo.textvaluesmall.js b/src/case/combo/textvaluecombo/combo.textvaluesmall.js index 70e551737..b6609544b 100644 --- a/src/case/combo/textvaluecombo/combo.textvaluesmall.js +++ b/src/case/combo/textvaluecombo/combo.textvaluesmall.js @@ -16,8 +16,14 @@ BI.SmallTextValueCombo = BI.inherit(BI.Widget, { }, _init: function () { - BI.SmallTextValueCombo.superclass._init.apply(this, arguments); var self = this, o = this.options; + o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) { + self.setValue(newValue); + }) : o.value; + o.items = BI.isFunction(o.items) ? this.__watch(o.items, function (context, newValue) { + self.populate(newValue); + }) : o.items; + BI.SmallTextValueCombo.superclass._init.apply(this, arguments); this.trigger = BI.createWidget(o.el, { type: "bi.small_select_text_trigger", items: o.items, diff --git a/src/case/trigger/trigger.text.js b/src/case/trigger/trigger.text.js index eb9c7c937..f5481222c 100644 --- a/src/case/trigger/trigger.text.js +++ b/src/case/trigger/trigger.text.js @@ -44,10 +44,11 @@ BI.TextTrigger = BI.inherit(BI.Trigger, { BI.createWidget({ element: this, - type: "bi.htape", + type: "bi.horizontal_fill", items: [ { - el: this.text + el: this.text, + width: "fill" }, { el: this.trigerButton, width: o.triggerWidth || o.height diff --git a/src/core/3.ob.js b/src/core/3.ob.js index 8f7ed1004..2c21a11fb 100644 --- a/src/core/3.ob.js +++ b/src/core/3.ob.js @@ -51,9 +51,11 @@ if (BI.isFunction(this.props)) { props = this.props(config); } - var defaultProps = this._defaultConfig(config); - var modifiedDefaultProps = (config && config.type && BI.OB.configFunctions[config.type + ".props"]) ? BI.OB.configFunctions[config.type + ".props"](config, defaultProps) : null; - this.options = extend(defaultProps, props, modifiedDefaultProps, config); + var defaultProps = extend(this._defaultConfig(config), props); + var modifiedDefaultProps = (config && config.type && BI.OB.configFunctions[config.type + ".props"]) ? BI.reduce(BI.OB.configFunctions[config.type + ".props"], function (value, conf, index) { + return extend(conf, value.fn(defaultProps, config, value.opt)); + }, {}) : null; + this.options = extend(defaultProps, modifiedDefaultProps, config); }, _init: function () { diff --git a/src/core/4.widget.js b/src/core/4.widget.js index bddc7caba..7447ec6cf 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -147,7 +147,10 @@ self.__async = true; var beforeRenderResult = (self.options.beforeRender || self.beforeRender).call(self, render); if (beforeRenderResult instanceof Promise) { - beforeRenderResult.then(render); + beforeRenderResult.then(render).catch(function (e) { + _global.console && console.error(e); + render(); + }); } } else { self._render(); @@ -159,7 +162,10 @@ this.__asking = true; var beforeInitResult = (this.options.beforeInit || this.beforeInit).call(this, init); if (beforeInitResult instanceof Promise) { - beforeInitResult.then(init); + beforeInitResult.then(init).catch(function (e) { + _global.console && console.error(e); + init(); + }); } } else { init(); @@ -291,10 +297,15 @@ }, _initVisual: function () { - var o = this.options; + var self = this, o = this.options; if (o.invisible) { - // 用display属性做显示和隐藏,否则jquery会在显示时将display设为block会覆盖掉display:flex属性 - this.element.css("display", "none"); + var invisible = BI.isFunction(o.invisible) ? this.__watch(o.invisible, function (context, newValue) { + self.setVisible(!newValue); + }) : o.invisible; + if (invisible) { + // 用display属性做显示和隐藏,否则jquery会在显示时将display设为block会覆盖掉display:flex属性 + this.element.css("display", "none"); + } } }, @@ -302,10 +313,20 @@ var self = this, o = this.options; if (o.disabled || o.invalid) { if (this.options.disabled) { - this.setEnable(false); + var disabled = BI.isFunction(o.disabled) ? this.__watch(o.disabled, function (context, newValue) { + self.setEnable(!newValue); + }) : o.disabled; + if (disabled) { + this.setEnable(false); + } } if (this.options.invalid) { - this.setValid(false); + var invalid = BI.isFunction(o.invalid) ? this.__watch(o.invalid, function (context, newValue) { + self.setEnable(!newValue); + }) : o.invalid; + if (invalid) { + this.setValid(false); + } } } if (o.effect) { @@ -750,12 +771,20 @@ // } // this._isMounted = false; // this.purgeListeners(); + + // 去掉组件绑定的watcher + BI.each(this._watchers, function (i, unwatches) { + unwatches = BI.isArray(unwatches) ? unwatches : [unwatches]; + BI.each(unwatches, function (j, unwatch) { + unwatch(); + }); + }); + this._watchers && (this._watchers = []); this.__d(); this.element.empty(); this.element.unbind(); this._initCurrent(); this._init(); - this._mount(); // this._initRef(); }, diff --git a/src/less/lib/font.less b/src/less/lib/font.less index 3e545b4c4..2ad25a0b2 100644 --- a/src/less/lib/font.less +++ b/src/less/lib/font.less @@ -1,57 +1,57 @@ //字体库 -@font-cross: "e6d0"; +@font-cross: "e1ab"; -@font-circle-close: "e6d5"; +@font-circle-close: "e1a9"; -@font-search: "e6dc"; +@font-search: "e1c3"; -@font-date: "e733"; -@font-time: "e6b1"; -@font-change: "e72f"; +@font-date: "e1d3"; +@font-time: "e1ae"; +@font-change: "e1cd"; -@font-dot: "e762"; +@font-dot: "e1aa"; -@font-plus: "e75b"; -@font-minus: "e75a"; +@font-plus: "e1a0"; +@font-minus: "e19e"; -@font-right-triangle: "e70c"; +@font-right-triangle: "e1bd"; -@font-copy: "e6bd"; -@font-check-mark: "e6cf"; +@font-copy: "e1ad"; +@font-check-mark: "e1b0"; -@font-arrow-left: "e70d"; -@font-arrow-right: "e70c"; +@font-arrow-left: "e1bc"; +@font-arrow-right: "e1bd"; -@font-up-triangle: "e70a"; -@font-down-triangle: "e70b"; +@font-up-triangle: "e1c6"; +@font-down-triangle: "e1c9"; -@font-solid-left: "e6d9"; -@font-solid-right: "e6d8"; -@font-solid-top: "e6d6"; -@font-solid-bottom: "e6d7"; +@font-solid-left: "e1c4"; +@font-solid-right: "e1a5"; +@font-solid-top: "e1ac"; +@font-solid-bottom: "e1c0"; -@font-trigger-triangle: "e64e"; +@font-trigger-triangle: "e1d5"; -@font-less: "e75e"; -@font-less-equal: "e761"; +@font-less: "e1d1"; +@font-less-equal: "e1d2"; -@font-bold: "e697"; -@font-italic: "e69d"; -@font-underline: "e69c"; -@font-color: "e698"; -@font-background: "e699"; -@font-color-underline: "e69a"; -@font-align-left: "e6ca"; -@font-align-center: "e6bf"; -@font-align-right: "e6c8"; +@font-bold: "e19b"; +@font-italic: "e199"; +@font-underline: "e1d6"; +@font-color: "e198"; +@font-background: "e19a"; +@font-color-underline: "e19c"; +@font-align-left: "e1a7"; +@font-align-center: "e1a2"; +@font-align-right: "e1af"; -@font-tip-error: "e757"; -@font-tip-success: "e756"; -@font-tip-warning: "e755"; -@font-tip-message: "e74b"; +@font-tip-error: "e1da"; +@font-tip-success: "e1db"; +@font-tip-warning: "e1d7"; +@font-tip-message: "e1d9"; -@font-key: "e740"; +@font-key: "e1d0"; -@font-add: "e6dd"; +@font-add: "e1c7";