From 68a4467a9f9ff0e60c9fdd479f96c162cd70eeef Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 30 Oct 2017 15:09:43 +0800 Subject: [PATCH 1/6] =?UTF-8?q?BI-11060=20firefox=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=9C=89=E6=9D=A1=E9=BB=84=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bi/base.js | 642 +++--- bi/core.js | 4 +- bi/sliders.css | 42 +- dist/base.js | 642 +++--- dist/bundle.js | 646 +++--- dist/bundle.min.js | 6 +- dist/core.js | 4 +- dist/demo.js | 2410 ++++++++++---------- dist/sliders.css | 42 +- src/core/controller/controller.tooltips.js | 4 +- 10 files changed, 2225 insertions(+), 2217 deletions(-) diff --git a/bi/base.js b/bi/base.js index 88a7768e1..a5a6a8188 100644 --- a/bi/base.js +++ b/bi/base.js @@ -16267,68 +16267,68 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { key: function (e) { } -});/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorTextToolbar - * @extends BI.Widget - */ -BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-rich-editor-text-toolbar bi-background", - buttons: [ - {type: "bi.rich_editor_size_chooser"}, - {type: "bi.rich_editor_bold_button"}, - {type: "bi.rich_editor_italic_button"}, - {type: "bi.rich_editor_underline_button"}, - {type: "bi.rich_editor_color_chooser"}, - {type: "bi.rich_editor_background_color_chooser"}, - {type: "bi.rich_editor_align_left_button"}, - {type: "bi.rich_editor_align_center_button"}, - {type: "bi.rich_editor_align_right_button"}, - {type: "bi.rich_editor_param_button"}, - ], - height: 28 - }); - }, - - _init: function () { - BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); - var self = this, o = this.options; - BI.createWidget({ - type: "bi.left", - element: this, - items: BI.map(o.buttons, function (i, btn) { - return BI.extend(btn, { - editor: o.editor - }); - }), - hgap: 3, - vgap: 3 - }) - }, - - mounted: function () { - var self = this; - if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 - this.element.mousedown(function () { - self._noSelect(self.element[0]); - }); - this._noSelect(this.element[0]); - } - }, - - _noSelect: function (element) { - if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { - element.setAttribute('unselectable', 'on'); - } - for (var i = 0; i < element.childNodes.length; i++) { - this._noSelect(element.childNodes[i]); - } - } -}); +});/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorTextToolbar + * @extends BI.Widget + */ +BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-rich-editor-text-toolbar bi-background", + buttons: [ + {type: "bi.rich_editor_size_chooser"}, + {type: "bi.rich_editor_bold_button"}, + {type: "bi.rich_editor_italic_button"}, + {type: "bi.rich_editor_underline_button"}, + {type: "bi.rich_editor_color_chooser"}, + {type: "bi.rich_editor_background_color_chooser"}, + {type: "bi.rich_editor_align_left_button"}, + {type: "bi.rich_editor_align_center_button"}, + {type: "bi.rich_editor_align_right_button"}, + {type: "bi.rich_editor_param_button"}, + ], + height: 28 + }); + }, + + _init: function () { + BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); + var self = this, o = this.options; + BI.createWidget({ + type: "bi.left", + element: this, + items: BI.map(o.buttons, function (i, btn) { + return BI.extend(btn, { + editor: o.editor + }); + }), + hgap: 3, + vgap: 3 + }) + }, + + mounted: function () { + var self = this; + if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 + this.element.mousedown(function () { + self._noSelect(self.element[0]); + }); + this._noSelect(this.element[0]); + } + }, + + _noSelect: function (element) { + if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { + element.setAttribute('unselectable', 'on'); + } + for (var i = 0; i < element.childNodes.length; i++) { + this._noSelect(element.childNodes[i]); + } + } +}); BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** * 富文本编辑器 * @@ -16609,57 +16609,57 @@ BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** } }); }()); -/** - * 颜色选择trigger - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorBackgroundChooserTrigger - * @extends BI.Widget - */ -BI.RichEditorBackgroundChooserTrigger = BI.inherit(BI.Widget, { - _defaultConfig: function () { - var conf = BI.RichEditorBackgroundChooserTrigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - width: 20, - height: 20 - }); - }, - - _init: function () { - BI.RichEditorBackgroundChooserTrigger.superclass._init.apply(this, arguments); - this.font = BI.createWidget({ - type: "bi.icon_button", - cls: "text-background-font" - }); - - this.underline = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-underline-font" - }); - - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.font, - top: 2, - left: 2 - }, { - el: this.underline, - top: 7, - left: 2 - }] - }) - }, - - setValue: function (color) { - this.underline.element.css("color", color); - }, - - getValue: function () { - return this.font.element.css("color"); - } -}); +/** + * 颜色选择trigger + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorBackgroundChooserTrigger + * @extends BI.Widget + */ +BI.RichEditorBackgroundChooserTrigger = BI.inherit(BI.Widget, { + _defaultConfig: function () { + var conf = BI.RichEditorBackgroundChooserTrigger.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + width: 20, + height: 20 + }); + }, + + _init: function () { + BI.RichEditorBackgroundChooserTrigger.superclass._init.apply(this, arguments); + this.font = BI.createWidget({ + type: "bi.icon_button", + cls: "text-background-font" + }); + + this.underline = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-underline-font" + }); + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.font, + top: 2, + left: 2 + }, { + el: this.underline, + top: 7, + left: 2 + }] + }) + }, + + setValue: function (color) { + this.underline.element.css("color", color); + }, + + getValue: function () { + return this.font.element.css("color"); + } +}); BI.shortcut('bi.rich_editor_background_color_chooser_trigger', BI.RichEditorBackgroundChooserTrigger);/** * * Created by GUY on 2015/11/26. @@ -16927,214 +16927,214 @@ BI.RichEditorUnderlineButton = BI.inherit(BI.RichEditorAction, { this.underline.setSelected(false); }, }); -BI.shortcut("bi.rich_editor_underline_button", BI.RichEditorUnderlineButton)/** - * 颜色选择trigger - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorColorChooserTrigger - * @extends BI.Widget - */ -BI.RichEditorColorChooserTrigger = BI.inherit(BI.Widget, { - _defaultConfig: function () { - var conf = BI.RichEditorColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - width: 20, - height: 20 - }); - }, - - _init: function () { - BI.RichEditorColorChooserTrigger.superclass._init.apply(this, arguments); - this.font = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-font" - }); - - this.underline = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-underline-font" - }); - - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.font, - top: 2, - left: 2 - }, { - el: this.underline, - top: 7, - left: 2 - }] - }) - }, - - setValue: function (color) { - this.underline.element.css("color", color); - }, - - getValue: function () { - return this.font.element.css("color"); - } -}); -BI.shortcut('bi.rich_editor_color_chooser_trigger', BI.RichEditorColorChooserTrigger);/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorBackgroundColorChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorBackgroundColorChooser.superclass._defaultConfig.apply(this, arguments), { - width: 20, - height: 20, - }); - }, - - _init: function () { - BI.RichEditorBackgroundColorChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.colorchooser = BI.createWidget({ - type: "bi.color_chooser", - element: this, - width: o.width, - height: o.height, - el: { - type: "bi.rich_editor_background_color_chooser_trigger", - title: BI.i18nText("BI-Widget_Background_Colour"), - cls: "text-toolbar-button" - } - }); - this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { - var backgroundColor = this.getValue(); - o.editor.element.css({ - backgroundColor: backgroundColor, - color: BI.DOM.getContrastColor(backgroundColor) - }); - this.setValue(""); - }); - }, - - deactivate: function () { - } -}); -BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorColorChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this, arguments), { - width: 20, - height: 20, - command: "foreColor" - }); - }, - - _init: function () { - BI.RichEditorColorChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.colorchooser = BI.createWidget({ - type: "bi.color_chooser", - element: this, - width: o.width, - height: o.height, - el: { - type: "bi.rich_editor_color_chooser_trigger", - title: BI.i18nText("BI-Font_Colour"), - cls: "text-toolbar-button" - } - }); - this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { - self.doCommand(this.getValue()); - }); - - }, - - deactivate: function () { - this.colorchooser.setValue(""); - } -}); -BI.shortcut('bi.rich_editor_color_chooser', BI.RichEditorColorChooser);/** - * 字体大小选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorSizeChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-rich-editor-size-chooser bi-border bi-card", - command: "FontSize", - width: 50, - height: 20 - }); - }, - - _items: [{ - value: 1, - text: "1(8pt)" - }, { - value: 2, - text: "2(10pt)" - }, { - value: 3, - text: "3(12pt)" - }, { - value: 4, - text: "4(14pt)" - }, { - value: 5, - text: "5(18pt)" - }, { - value: 6, - text: "6(24pt)" - }], - - _init: function () { - BI.RichEditorSizeChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.trigger = BI.createWidget({ - type: "bi.text_trigger", - readonly: true, - height: o.height, - triggerWidth: 12, - text: BI.i18nText("BI-Font_Size") - }); - - this.combo = BI.createWidget({ - type: "bi.combo", - element: this, - el: this.trigger, - adjustLength: 1, - popup: { - maxWidth: 70, - minWidth: 70, - el: { - type: "bi.button_group", - items: BI.createItems(this._items, { - type: "bi.single_select_item" - }), - layouts: [{ - type: "bi.vertical" - }] - } - } - }); - this.combo.on(BI.Combo.EVENT_CHANGE, function () { - var val = this.getValue()[0]; - self.doCommand(val); - this.hideView(); - this.setValue([]); - }) - } -}); +BI.shortcut("bi.rich_editor_underline_button", BI.RichEditorUnderlineButton)/** + * 颜色选择trigger + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorColorChooserTrigger + * @extends BI.Widget + */ +BI.RichEditorColorChooserTrigger = BI.inherit(BI.Widget, { + _defaultConfig: function () { + var conf = BI.RichEditorColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + width: 20, + height: 20 + }); + }, + + _init: function () { + BI.RichEditorColorChooserTrigger.superclass._init.apply(this, arguments); + this.font = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-font" + }); + + this.underline = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-underline-font" + }); + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.font, + top: 2, + left: 2 + }, { + el: this.underline, + top: 7, + left: 2 + }] + }) + }, + + setValue: function (color) { + this.underline.element.css("color", color); + }, + + getValue: function () { + return this.font.element.css("color"); + } +}); +BI.shortcut('bi.rich_editor_color_chooser_trigger', BI.RichEditorColorChooserTrigger);/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorBackgroundColorChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorBackgroundColorChooser.superclass._defaultConfig.apply(this, arguments), { + width: 20, + height: 20, + }); + }, + + _init: function () { + BI.RichEditorBackgroundColorChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.colorchooser = BI.createWidget({ + type: "bi.color_chooser", + element: this, + width: o.width, + height: o.height, + el: { + type: "bi.rich_editor_background_color_chooser_trigger", + title: BI.i18nText("BI-Widget_Background_Colour"), + cls: "text-toolbar-button" + } + }); + this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { + var backgroundColor = this.getValue(); + o.editor.element.css({ + backgroundColor: backgroundColor, + color: BI.DOM.getContrastColor(backgroundColor) + }); + this.setValue(""); + }); + }, + + deactivate: function () { + } +}); +BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorColorChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this, arguments), { + width: 20, + height: 20, + command: "foreColor" + }); + }, + + _init: function () { + BI.RichEditorColorChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.colorchooser = BI.createWidget({ + type: "bi.color_chooser", + element: this, + width: o.width, + height: o.height, + el: { + type: "bi.rich_editor_color_chooser_trigger", + title: BI.i18nText("BI-Font_Colour"), + cls: "text-toolbar-button" + } + }); + this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { + self.doCommand(this.getValue()); + }); + + }, + + deactivate: function () { + this.colorchooser.setValue(""); + } +}); +BI.shortcut('bi.rich_editor_color_chooser', BI.RichEditorColorChooser);/** + * 字体大小选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorSizeChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-rich-editor-size-chooser bi-border bi-card", + command: "FontSize", + width: 50, + height: 20 + }); + }, + + _items: [{ + value: 1, + text: "1(8pt)" + }, { + value: 2, + text: "2(10pt)" + }, { + value: 3, + text: "3(12pt)" + }, { + value: 4, + text: "4(14pt)" + }, { + value: 5, + text: "5(18pt)" + }, { + value: 6, + text: "6(24pt)" + }], + + _init: function () { + BI.RichEditorSizeChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.trigger = BI.createWidget({ + type: "bi.text_trigger", + readonly: true, + height: o.height, + triggerWidth: 12, + text: BI.i18nText("BI-Font_Size") + }); + + this.combo = BI.createWidget({ + type: "bi.combo", + element: this, + el: this.trigger, + adjustLength: 1, + popup: { + maxWidth: 70, + minWidth: 70, + el: { + type: "bi.button_group", + items: BI.createItems(this._items, { + type: "bi.single_select_item" + }), + layouts: [{ + type: "bi.vertical" + }] + } + } + }); + this.combo.on(BI.Combo.EVENT_CHANGE, function () { + var val = this.getValue()[0]; + self.doCommand(val); + this.hideView(); + this.setValue([]); + }) + } +}); BI.shortcut('bi.rich_editor_size_chooser', BI.RichEditorSizeChooser);/** * 富文本编辑器 * diff --git a/bi/core.js b/bi/core.js index 54fb53aa1..32cf8562b 100644 --- a/bi/core.js +++ b/bi/core.js @@ -18683,7 +18683,9 @@ BI.TooltipsController = BI.inherit(BI.Controller, { var offset = context.element.offset(); var bounds = context.element.bounds(); - + if(bounds.height === 0 || bounds.width === 0) { + return; + } var top = offset.top + bounds.height + 5; var tooltip = this.get(name); tooltip.setText(text); diff --git a/bi/sliders.css b/bi/sliders.css index a8d9688bb..66780294e 100644 --- a/bi/sliders.css +++ b/bi/sliders.css @@ -24,27 +24,15 @@ -moz-border-radius: 7px; border-radius: 7px; } -.bi-single-slider-button .slider-button { - cursor: ew-resize; - -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); - -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); - -webkit-border-radius: 7px; - -moz-border-radius: 7px; - border-radius: 7px; -} -.bi-slider-track .gray-track { - background-color: rgba(153, 153, 153, 0.3); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d999999,endColorstr=#4d999999); - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} -.bi-slider-track .blue-track { - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} +.bi-single-slider-button .slider-button { + cursor: ew-resize; + -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + -webkit-border-radius: 7px; + -moz-border-radius: 7px; + border-radius: 7px; +} .bi-slider-track .gray-track { background-color: rgba(153, 153, 153, 0.3); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d999999,endColorstr=#4d999999); @@ -57,3 +45,15 @@ -moz-border-radius: 3px; border-radius: 3px; } +.bi-slider-track .gray-track { + background-color: rgba(153, 153, 153, 0.3); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d999999,endColorstr=#4d999999); + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.bi-slider-track .blue-track { + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} diff --git a/dist/base.js b/dist/base.js index 88a7768e1..a5a6a8188 100644 --- a/dist/base.js +++ b/dist/base.js @@ -16267,68 +16267,68 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { key: function (e) { } -});/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorTextToolbar - * @extends BI.Widget - */ -BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-rich-editor-text-toolbar bi-background", - buttons: [ - {type: "bi.rich_editor_size_chooser"}, - {type: "bi.rich_editor_bold_button"}, - {type: "bi.rich_editor_italic_button"}, - {type: "bi.rich_editor_underline_button"}, - {type: "bi.rich_editor_color_chooser"}, - {type: "bi.rich_editor_background_color_chooser"}, - {type: "bi.rich_editor_align_left_button"}, - {type: "bi.rich_editor_align_center_button"}, - {type: "bi.rich_editor_align_right_button"}, - {type: "bi.rich_editor_param_button"}, - ], - height: 28 - }); - }, - - _init: function () { - BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); - var self = this, o = this.options; - BI.createWidget({ - type: "bi.left", - element: this, - items: BI.map(o.buttons, function (i, btn) { - return BI.extend(btn, { - editor: o.editor - }); - }), - hgap: 3, - vgap: 3 - }) - }, - - mounted: function () { - var self = this; - if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 - this.element.mousedown(function () { - self._noSelect(self.element[0]); - }); - this._noSelect(this.element[0]); - } - }, - - _noSelect: function (element) { - if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { - element.setAttribute('unselectable', 'on'); - } - for (var i = 0; i < element.childNodes.length; i++) { - this._noSelect(element.childNodes[i]); - } - } -}); +});/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorTextToolbar + * @extends BI.Widget + */ +BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-rich-editor-text-toolbar bi-background", + buttons: [ + {type: "bi.rich_editor_size_chooser"}, + {type: "bi.rich_editor_bold_button"}, + {type: "bi.rich_editor_italic_button"}, + {type: "bi.rich_editor_underline_button"}, + {type: "bi.rich_editor_color_chooser"}, + {type: "bi.rich_editor_background_color_chooser"}, + {type: "bi.rich_editor_align_left_button"}, + {type: "bi.rich_editor_align_center_button"}, + {type: "bi.rich_editor_align_right_button"}, + {type: "bi.rich_editor_param_button"}, + ], + height: 28 + }); + }, + + _init: function () { + BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); + var self = this, o = this.options; + BI.createWidget({ + type: "bi.left", + element: this, + items: BI.map(o.buttons, function (i, btn) { + return BI.extend(btn, { + editor: o.editor + }); + }), + hgap: 3, + vgap: 3 + }) + }, + + mounted: function () { + var self = this; + if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 + this.element.mousedown(function () { + self._noSelect(self.element[0]); + }); + this._noSelect(this.element[0]); + } + }, + + _noSelect: function (element) { + if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { + element.setAttribute('unselectable', 'on'); + } + for (var i = 0; i < element.childNodes.length; i++) { + this._noSelect(element.childNodes[i]); + } + } +}); BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** * 富文本编辑器 * @@ -16609,57 +16609,57 @@ BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** } }); }()); -/** - * 颜色选择trigger - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorBackgroundChooserTrigger - * @extends BI.Widget - */ -BI.RichEditorBackgroundChooserTrigger = BI.inherit(BI.Widget, { - _defaultConfig: function () { - var conf = BI.RichEditorBackgroundChooserTrigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - width: 20, - height: 20 - }); - }, - - _init: function () { - BI.RichEditorBackgroundChooserTrigger.superclass._init.apply(this, arguments); - this.font = BI.createWidget({ - type: "bi.icon_button", - cls: "text-background-font" - }); - - this.underline = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-underline-font" - }); - - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.font, - top: 2, - left: 2 - }, { - el: this.underline, - top: 7, - left: 2 - }] - }) - }, - - setValue: function (color) { - this.underline.element.css("color", color); - }, - - getValue: function () { - return this.font.element.css("color"); - } -}); +/** + * 颜色选择trigger + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorBackgroundChooserTrigger + * @extends BI.Widget + */ +BI.RichEditorBackgroundChooserTrigger = BI.inherit(BI.Widget, { + _defaultConfig: function () { + var conf = BI.RichEditorBackgroundChooserTrigger.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + width: 20, + height: 20 + }); + }, + + _init: function () { + BI.RichEditorBackgroundChooserTrigger.superclass._init.apply(this, arguments); + this.font = BI.createWidget({ + type: "bi.icon_button", + cls: "text-background-font" + }); + + this.underline = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-underline-font" + }); + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.font, + top: 2, + left: 2 + }, { + el: this.underline, + top: 7, + left: 2 + }] + }) + }, + + setValue: function (color) { + this.underline.element.css("color", color); + }, + + getValue: function () { + return this.font.element.css("color"); + } +}); BI.shortcut('bi.rich_editor_background_color_chooser_trigger', BI.RichEditorBackgroundChooserTrigger);/** * * Created by GUY on 2015/11/26. @@ -16927,214 +16927,214 @@ BI.RichEditorUnderlineButton = BI.inherit(BI.RichEditorAction, { this.underline.setSelected(false); }, }); -BI.shortcut("bi.rich_editor_underline_button", BI.RichEditorUnderlineButton)/** - * 颜色选择trigger - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorColorChooserTrigger - * @extends BI.Widget - */ -BI.RichEditorColorChooserTrigger = BI.inherit(BI.Widget, { - _defaultConfig: function () { - var conf = BI.RichEditorColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - width: 20, - height: 20 - }); - }, - - _init: function () { - BI.RichEditorColorChooserTrigger.superclass._init.apply(this, arguments); - this.font = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-font" - }); - - this.underline = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-underline-font" - }); - - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.font, - top: 2, - left: 2 - }, { - el: this.underline, - top: 7, - left: 2 - }] - }) - }, - - setValue: function (color) { - this.underline.element.css("color", color); - }, - - getValue: function () { - return this.font.element.css("color"); - } -}); -BI.shortcut('bi.rich_editor_color_chooser_trigger', BI.RichEditorColorChooserTrigger);/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorBackgroundColorChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorBackgroundColorChooser.superclass._defaultConfig.apply(this, arguments), { - width: 20, - height: 20, - }); - }, - - _init: function () { - BI.RichEditorBackgroundColorChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.colorchooser = BI.createWidget({ - type: "bi.color_chooser", - element: this, - width: o.width, - height: o.height, - el: { - type: "bi.rich_editor_background_color_chooser_trigger", - title: BI.i18nText("BI-Widget_Background_Colour"), - cls: "text-toolbar-button" - } - }); - this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { - var backgroundColor = this.getValue(); - o.editor.element.css({ - backgroundColor: backgroundColor, - color: BI.DOM.getContrastColor(backgroundColor) - }); - this.setValue(""); - }); - }, - - deactivate: function () { - } -}); -BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorColorChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this, arguments), { - width: 20, - height: 20, - command: "foreColor" - }); - }, - - _init: function () { - BI.RichEditorColorChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.colorchooser = BI.createWidget({ - type: "bi.color_chooser", - element: this, - width: o.width, - height: o.height, - el: { - type: "bi.rich_editor_color_chooser_trigger", - title: BI.i18nText("BI-Font_Colour"), - cls: "text-toolbar-button" - } - }); - this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { - self.doCommand(this.getValue()); - }); - - }, - - deactivate: function () { - this.colorchooser.setValue(""); - } -}); -BI.shortcut('bi.rich_editor_color_chooser', BI.RichEditorColorChooser);/** - * 字体大小选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorSizeChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-rich-editor-size-chooser bi-border bi-card", - command: "FontSize", - width: 50, - height: 20 - }); - }, - - _items: [{ - value: 1, - text: "1(8pt)" - }, { - value: 2, - text: "2(10pt)" - }, { - value: 3, - text: "3(12pt)" - }, { - value: 4, - text: "4(14pt)" - }, { - value: 5, - text: "5(18pt)" - }, { - value: 6, - text: "6(24pt)" - }], - - _init: function () { - BI.RichEditorSizeChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.trigger = BI.createWidget({ - type: "bi.text_trigger", - readonly: true, - height: o.height, - triggerWidth: 12, - text: BI.i18nText("BI-Font_Size") - }); - - this.combo = BI.createWidget({ - type: "bi.combo", - element: this, - el: this.trigger, - adjustLength: 1, - popup: { - maxWidth: 70, - minWidth: 70, - el: { - type: "bi.button_group", - items: BI.createItems(this._items, { - type: "bi.single_select_item" - }), - layouts: [{ - type: "bi.vertical" - }] - } - } - }); - this.combo.on(BI.Combo.EVENT_CHANGE, function () { - var val = this.getValue()[0]; - self.doCommand(val); - this.hideView(); - this.setValue([]); - }) - } -}); +BI.shortcut("bi.rich_editor_underline_button", BI.RichEditorUnderlineButton)/** + * 颜色选择trigger + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorColorChooserTrigger + * @extends BI.Widget + */ +BI.RichEditorColorChooserTrigger = BI.inherit(BI.Widget, { + _defaultConfig: function () { + var conf = BI.RichEditorColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + width: 20, + height: 20 + }); + }, + + _init: function () { + BI.RichEditorColorChooserTrigger.superclass._init.apply(this, arguments); + this.font = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-font" + }); + + this.underline = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-underline-font" + }); + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.font, + top: 2, + left: 2 + }, { + el: this.underline, + top: 7, + left: 2 + }] + }) + }, + + setValue: function (color) { + this.underline.element.css("color", color); + }, + + getValue: function () { + return this.font.element.css("color"); + } +}); +BI.shortcut('bi.rich_editor_color_chooser_trigger', BI.RichEditorColorChooserTrigger);/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorBackgroundColorChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorBackgroundColorChooser.superclass._defaultConfig.apply(this, arguments), { + width: 20, + height: 20, + }); + }, + + _init: function () { + BI.RichEditorBackgroundColorChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.colorchooser = BI.createWidget({ + type: "bi.color_chooser", + element: this, + width: o.width, + height: o.height, + el: { + type: "bi.rich_editor_background_color_chooser_trigger", + title: BI.i18nText("BI-Widget_Background_Colour"), + cls: "text-toolbar-button" + } + }); + this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { + var backgroundColor = this.getValue(); + o.editor.element.css({ + backgroundColor: backgroundColor, + color: BI.DOM.getContrastColor(backgroundColor) + }); + this.setValue(""); + }); + }, + + deactivate: function () { + } +}); +BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorColorChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this, arguments), { + width: 20, + height: 20, + command: "foreColor" + }); + }, + + _init: function () { + BI.RichEditorColorChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.colorchooser = BI.createWidget({ + type: "bi.color_chooser", + element: this, + width: o.width, + height: o.height, + el: { + type: "bi.rich_editor_color_chooser_trigger", + title: BI.i18nText("BI-Font_Colour"), + cls: "text-toolbar-button" + } + }); + this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { + self.doCommand(this.getValue()); + }); + + }, + + deactivate: function () { + this.colorchooser.setValue(""); + } +}); +BI.shortcut('bi.rich_editor_color_chooser', BI.RichEditorColorChooser);/** + * 字体大小选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorSizeChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-rich-editor-size-chooser bi-border bi-card", + command: "FontSize", + width: 50, + height: 20 + }); + }, + + _items: [{ + value: 1, + text: "1(8pt)" + }, { + value: 2, + text: "2(10pt)" + }, { + value: 3, + text: "3(12pt)" + }, { + value: 4, + text: "4(14pt)" + }, { + value: 5, + text: "5(18pt)" + }, { + value: 6, + text: "6(24pt)" + }], + + _init: function () { + BI.RichEditorSizeChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.trigger = BI.createWidget({ + type: "bi.text_trigger", + readonly: true, + height: o.height, + triggerWidth: 12, + text: BI.i18nText("BI-Font_Size") + }); + + this.combo = BI.createWidget({ + type: "bi.combo", + element: this, + el: this.trigger, + adjustLength: 1, + popup: { + maxWidth: 70, + minWidth: 70, + el: { + type: "bi.button_group", + items: BI.createItems(this._items, { + type: "bi.single_select_item" + }), + layouts: [{ + type: "bi.vertical" + }] + } + } + }); + this.combo.on(BI.Combo.EVENT_CHANGE, function () { + var val = this.getValue()[0]; + self.doCommand(val); + this.hideView(); + this.setValue([]); + }) + } +}); BI.shortcut('bi.rich_editor_size_chooser', BI.RichEditorSizeChooser);/** * 富文本编辑器 * diff --git a/dist/bundle.js b/dist/bundle.js index c82012cb5..a294d056e 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -18734,7 +18734,9 @@ BI.TooltipsController = BI.inherit(BI.Controller, { var offset = context.element.offset(); var bounds = context.element.bounds(); - + if(bounds.height === 0 || bounds.width === 0) { + return; + } var top = offset.top + bounds.height + 5; var tooltip = this.get(name); tooltip.setText(text); @@ -42045,68 +42047,68 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { key: function (e) { } -});/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorTextToolbar - * @extends BI.Widget - */ -BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-rich-editor-text-toolbar bi-background", - buttons: [ - {type: "bi.rich_editor_size_chooser"}, - {type: "bi.rich_editor_bold_button"}, - {type: "bi.rich_editor_italic_button"}, - {type: "bi.rich_editor_underline_button"}, - {type: "bi.rich_editor_color_chooser"}, - {type: "bi.rich_editor_background_color_chooser"}, - {type: "bi.rich_editor_align_left_button"}, - {type: "bi.rich_editor_align_center_button"}, - {type: "bi.rich_editor_align_right_button"}, - {type: "bi.rich_editor_param_button"}, - ], - height: 28 - }); - }, - - _init: function () { - BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); - var self = this, o = this.options; - BI.createWidget({ - type: "bi.left", - element: this, - items: BI.map(o.buttons, function (i, btn) { - return BI.extend(btn, { - editor: o.editor - }); - }), - hgap: 3, - vgap: 3 - }) - }, - - mounted: function () { - var self = this; - if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 - this.element.mousedown(function () { - self._noSelect(self.element[0]); - }); - this._noSelect(this.element[0]); - } - }, - - _noSelect: function (element) { - if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { - element.setAttribute('unselectable', 'on'); - } - for (var i = 0; i < element.childNodes.length; i++) { - this._noSelect(element.childNodes[i]); - } - } -}); +});/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorTextToolbar + * @extends BI.Widget + */ +BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-rich-editor-text-toolbar bi-background", + buttons: [ + {type: "bi.rich_editor_size_chooser"}, + {type: "bi.rich_editor_bold_button"}, + {type: "bi.rich_editor_italic_button"}, + {type: "bi.rich_editor_underline_button"}, + {type: "bi.rich_editor_color_chooser"}, + {type: "bi.rich_editor_background_color_chooser"}, + {type: "bi.rich_editor_align_left_button"}, + {type: "bi.rich_editor_align_center_button"}, + {type: "bi.rich_editor_align_right_button"}, + {type: "bi.rich_editor_param_button"}, + ], + height: 28 + }); + }, + + _init: function () { + BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); + var self = this, o = this.options; + BI.createWidget({ + type: "bi.left", + element: this, + items: BI.map(o.buttons, function (i, btn) { + return BI.extend(btn, { + editor: o.editor + }); + }), + hgap: 3, + vgap: 3 + }) + }, + + mounted: function () { + var self = this; + if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 + this.element.mousedown(function () { + self._noSelect(self.element[0]); + }); + this._noSelect(this.element[0]); + } + }, + + _noSelect: function (element) { + if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { + element.setAttribute('unselectable', 'on'); + } + for (var i = 0; i < element.childNodes.length; i++) { + this._noSelect(element.childNodes[i]); + } + } +}); BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** * 富文本编辑器 * @@ -42387,57 +42389,57 @@ BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** } }); }()); -/** - * 颜色选择trigger - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorBackgroundChooserTrigger - * @extends BI.Widget - */ -BI.RichEditorBackgroundChooserTrigger = BI.inherit(BI.Widget, { - _defaultConfig: function () { - var conf = BI.RichEditorBackgroundChooserTrigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - width: 20, - height: 20 - }); - }, - - _init: function () { - BI.RichEditorBackgroundChooserTrigger.superclass._init.apply(this, arguments); - this.font = BI.createWidget({ - type: "bi.icon_button", - cls: "text-background-font" - }); - - this.underline = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-underline-font" - }); - - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.font, - top: 2, - left: 2 - }, { - el: this.underline, - top: 7, - left: 2 - }] - }) - }, - - setValue: function (color) { - this.underline.element.css("color", color); - }, - - getValue: function () { - return this.font.element.css("color"); - } -}); +/** + * 颜色选择trigger + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorBackgroundChooserTrigger + * @extends BI.Widget + */ +BI.RichEditorBackgroundChooserTrigger = BI.inherit(BI.Widget, { + _defaultConfig: function () { + var conf = BI.RichEditorBackgroundChooserTrigger.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + width: 20, + height: 20 + }); + }, + + _init: function () { + BI.RichEditorBackgroundChooserTrigger.superclass._init.apply(this, arguments); + this.font = BI.createWidget({ + type: "bi.icon_button", + cls: "text-background-font" + }); + + this.underline = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-underline-font" + }); + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.font, + top: 2, + left: 2 + }, { + el: this.underline, + top: 7, + left: 2 + }] + }) + }, + + setValue: function (color) { + this.underline.element.css("color", color); + }, + + getValue: function () { + return this.font.element.css("color"); + } +}); BI.shortcut('bi.rich_editor_background_color_chooser_trigger', BI.RichEditorBackgroundChooserTrigger);/** * * Created by GUY on 2015/11/26. @@ -42705,214 +42707,214 @@ BI.RichEditorUnderlineButton = BI.inherit(BI.RichEditorAction, { this.underline.setSelected(false); }, }); -BI.shortcut("bi.rich_editor_underline_button", BI.RichEditorUnderlineButton)/** - * 颜色选择trigger - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorColorChooserTrigger - * @extends BI.Widget - */ -BI.RichEditorColorChooserTrigger = BI.inherit(BI.Widget, { - _defaultConfig: function () { - var conf = BI.RichEditorColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - width: 20, - height: 20 - }); - }, - - _init: function () { - BI.RichEditorColorChooserTrigger.superclass._init.apply(this, arguments); - this.font = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-font" - }); - - this.underline = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-underline-font" - }); - - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.font, - top: 2, - left: 2 - }, { - el: this.underline, - top: 7, - left: 2 - }] - }) - }, - - setValue: function (color) { - this.underline.element.css("color", color); - }, - - getValue: function () { - return this.font.element.css("color"); - } -}); -BI.shortcut('bi.rich_editor_color_chooser_trigger', BI.RichEditorColorChooserTrigger);/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorBackgroundColorChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorBackgroundColorChooser.superclass._defaultConfig.apply(this, arguments), { - width: 20, - height: 20, - }); - }, - - _init: function () { - BI.RichEditorBackgroundColorChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.colorchooser = BI.createWidget({ - type: "bi.color_chooser", - element: this, - width: o.width, - height: o.height, - el: { - type: "bi.rich_editor_background_color_chooser_trigger", - title: BI.i18nText("BI-Widget_Background_Colour"), - cls: "text-toolbar-button" - } - }); - this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { - var backgroundColor = this.getValue(); - o.editor.element.css({ - backgroundColor: backgroundColor, - color: BI.DOM.getContrastColor(backgroundColor) - }); - this.setValue(""); - }); - }, - - deactivate: function () { - } -}); -BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorColorChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this, arguments), { - width: 20, - height: 20, - command: "foreColor" - }); - }, - - _init: function () { - BI.RichEditorColorChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.colorchooser = BI.createWidget({ - type: "bi.color_chooser", - element: this, - width: o.width, - height: o.height, - el: { - type: "bi.rich_editor_color_chooser_trigger", - title: BI.i18nText("BI-Font_Colour"), - cls: "text-toolbar-button" - } - }); - this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { - self.doCommand(this.getValue()); - }); - - }, - - deactivate: function () { - this.colorchooser.setValue(""); - } -}); -BI.shortcut('bi.rich_editor_color_chooser', BI.RichEditorColorChooser);/** - * 字体大小选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorSizeChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-rich-editor-size-chooser bi-border bi-card", - command: "FontSize", - width: 50, - height: 20 - }); - }, - - _items: [{ - value: 1, - text: "1(8pt)" - }, { - value: 2, - text: "2(10pt)" - }, { - value: 3, - text: "3(12pt)" - }, { - value: 4, - text: "4(14pt)" - }, { - value: 5, - text: "5(18pt)" - }, { - value: 6, - text: "6(24pt)" - }], - - _init: function () { - BI.RichEditorSizeChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.trigger = BI.createWidget({ - type: "bi.text_trigger", - readonly: true, - height: o.height, - triggerWidth: 12, - text: BI.i18nText("BI-Font_Size") - }); - - this.combo = BI.createWidget({ - type: "bi.combo", - element: this, - el: this.trigger, - adjustLength: 1, - popup: { - maxWidth: 70, - minWidth: 70, - el: { - type: "bi.button_group", - items: BI.createItems(this._items, { - type: "bi.single_select_item" - }), - layouts: [{ - type: "bi.vertical" - }] - } - } - }); - this.combo.on(BI.Combo.EVENT_CHANGE, function () { - var val = this.getValue()[0]; - self.doCommand(val); - this.hideView(); - this.setValue([]); - }) - } -}); +BI.shortcut("bi.rich_editor_underline_button", BI.RichEditorUnderlineButton)/** + * 颜色选择trigger + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorColorChooserTrigger + * @extends BI.Widget + */ +BI.RichEditorColorChooserTrigger = BI.inherit(BI.Widget, { + _defaultConfig: function () { + var conf = BI.RichEditorColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + width: 20, + height: 20 + }); + }, + + _init: function () { + BI.RichEditorColorChooserTrigger.superclass._init.apply(this, arguments); + this.font = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-font" + }); + + this.underline = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-underline-font" + }); + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.font, + top: 2, + left: 2 + }, { + el: this.underline, + top: 7, + left: 2 + }] + }) + }, + + setValue: function (color) { + this.underline.element.css("color", color); + }, + + getValue: function () { + return this.font.element.css("color"); + } +}); +BI.shortcut('bi.rich_editor_color_chooser_trigger', BI.RichEditorColorChooserTrigger);/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorBackgroundColorChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorBackgroundColorChooser.superclass._defaultConfig.apply(this, arguments), { + width: 20, + height: 20, + }); + }, + + _init: function () { + BI.RichEditorBackgroundColorChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.colorchooser = BI.createWidget({ + type: "bi.color_chooser", + element: this, + width: o.width, + height: o.height, + el: { + type: "bi.rich_editor_background_color_chooser_trigger", + title: BI.i18nText("BI-Widget_Background_Colour"), + cls: "text-toolbar-button" + } + }); + this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { + var backgroundColor = this.getValue(); + o.editor.element.css({ + backgroundColor: backgroundColor, + color: BI.DOM.getContrastColor(backgroundColor) + }); + this.setValue(""); + }); + }, + + deactivate: function () { + } +}); +BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorColorChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this, arguments), { + width: 20, + height: 20, + command: "foreColor" + }); + }, + + _init: function () { + BI.RichEditorColorChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.colorchooser = BI.createWidget({ + type: "bi.color_chooser", + element: this, + width: o.width, + height: o.height, + el: { + type: "bi.rich_editor_color_chooser_trigger", + title: BI.i18nText("BI-Font_Colour"), + cls: "text-toolbar-button" + } + }); + this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { + self.doCommand(this.getValue()); + }); + + }, + + deactivate: function () { + this.colorchooser.setValue(""); + } +}); +BI.shortcut('bi.rich_editor_color_chooser', BI.RichEditorColorChooser);/** + * 字体大小选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorSizeChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-rich-editor-size-chooser bi-border bi-card", + command: "FontSize", + width: 50, + height: 20 + }); + }, + + _items: [{ + value: 1, + text: "1(8pt)" + }, { + value: 2, + text: "2(10pt)" + }, { + value: 3, + text: "3(12pt)" + }, { + value: 4, + text: "4(14pt)" + }, { + value: 5, + text: "5(18pt)" + }, { + value: 6, + text: "6(24pt)" + }], + + _init: function () { + BI.RichEditorSizeChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.trigger = BI.createWidget({ + type: "bi.text_trigger", + readonly: true, + height: o.height, + triggerWidth: 12, + text: BI.i18nText("BI-Font_Size") + }); + + this.combo = BI.createWidget({ + type: "bi.combo", + element: this, + el: this.trigger, + adjustLength: 1, + popup: { + maxWidth: 70, + minWidth: 70, + el: { + type: "bi.button_group", + items: BI.createItems(this._items, { + type: "bi.single_select_item" + }), + layouts: [{ + type: "bi.vertical" + }] + } + } + }); + this.combo.on(BI.Combo.EVENT_CHANGE, function () { + var val = this.getValue()[0]; + self.doCommand(val); + this.hideView(); + this.setValue([]); + }) + } +}); BI.shortcut('bi.rich_editor_size_chooser', BI.RichEditorSizeChooser);/** * 富文本编辑器 * diff --git a/dist/bundle.min.js b/dist/bundle.min.js index 39e2fd05f..cfad9d983 100644 --- a/dist/bundle.min.js +++ b/dist/bundle.min.js @@ -5,9 +5,9 @@ return[c<0?c+b:c]}),even:k(function(a,b){for(var c=0;c0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function b(a){return function(b,c,d){c=t(c,d);for(var e=null!=b&&b.length,f=a>0?0:e-1;f>=0&&f=0&&b<=w};r.each=r.forEach=function(a,b,c){b=s(b,c);var d,e;if(x(a))for(d=0,e=a.length;d=0},r.invoke=function(a,b){var c=j.call(arguments,2),d=r.isFunction(b);return r.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},r.pluck=function(a,b){return r.map(a,r.property(b))},r.where=function(a,b){return r.filter(a,r.matcher(b))},r.findWhere=function(a,b){return r.find(a,r.matcher(b))},r.max=function(a,b,c){var d,e,f=-(1/0),g=-(1/0);if(null==b&&null!=a){a=x(a)?a:r.values(a);for(var h=0,i=a.length;hf&&(f=d)}else b=t(b,c),r.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-(1/0)&&f===-(1/0))&&(f=a,g=e)});return f},r.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=x(a)?a:r.values(a);for(var h=0,i=a.length;hd||void 0===c)return 1;if(c=0;)if(a[d]===b)return d;return-1},r.findIndex=b(1),r.findLastIndex=b(-1),r.sortedIndex=function(a,b,c,d){c=t(c,d,1);for(var e=c(b),f=0,g=a.length;fb?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},r.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=r.now()-g;j=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=r.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},r.wrap=function(a,b){return r.partial(b,a)},r.negate=function(a){return function(){return!a.apply(this,arguments)}},r.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},r.after=function(a,b){return function(){if(--a<1)return b.apply(this,arguments)}},r.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),a<=1&&(b=null),c}},r.once=r.partial(r.before,2);var B=!{toString:null}.propertyIsEnumerable("toString"),C=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];r.keys=function(a){if(!r.isObject(a))return[];if(n)return n(a);var b=[];for(var d in a)r.has(a,d)&&b.push(d);return B&&c(a,b),b},r.allKeys=function(a){if(!r.isObject(a))return[];var b=[];for(var d in a)b.push(d);return B&&c(a,b),b},r.values=function(a){for(var b=r.keys(a),c=b.length,d=Array(c),e=0;e":">",'"':""","'":"'","`":"`"},F=r.invert(E),G=function(a){var b=function(b){return a[b]},c="(?:"+r.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};r.escape=G(E),r.unescape=G(F),r.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),r.isFunction(d)?d.call(a):d};var H=0;r.uniqueId=function(a){var b=++H+"";return a?a+b:b},r.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var I=/(.)^/,J={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},K=/\\|'|\r|\n|\u2028|\u2029/g,L=function(a){return"\\"+J[a]};r.template=function(a,b,c){!b&&c&&(b=c),b=r.defaults({},b,r.templateSettings);var d=RegExp([(b.escape||I).source,(b.interpolate||I).source,(b.evaluate||I).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(K,L),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,r)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},r.chain=function(a){var b=r(a);return b._chain=!0,b};var M=function(a,b){return a._chain?r(b).chain():b};r.mixin=function(a){r.each(r.functions(a),function(b){var c=r[b]=a[b];r.prototype[b]=function(){var a=[this._wrapped];return i.apply(a,arguments),M(this,c.apply(r,a))}})},r.mixin(r),r.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=f[a];r.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],M(this,c)}}),r.each(["concat","join","slice"],function(a){var b=f[a];r.prototype[a]=function(){return M(this,b.apply(this._wrapped,arguments))}}),r.prototype.value=function(){return this._wrapped},r.prototype.valueOf=r.prototype.toJSON=r.prototype.value,r.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return r})}.call(this),null==window.BI&&(window.BI={}),window.BI||(window.BI={}),!function(a,b){var c=function(a,b){return function(c,d,e){return a.call(b,d,c,e)}},d=function(a){return function(){return _[a].apply(_,arguments)}},e=function(a){return function(){var b=Array.prototype.slice.call(arguments,0);return b[1]=_.isFunction(b[1])?c(b[1],b[2]):b[1],_[a].apply(_,b)}};_.extend(BI,{i18nText:function(a){var b=BI.i18n&&BI.i18n[a]||"";b||(b=a);var c=arguments.length;if(c>1)for(var d=1;d=0;c--)a=BI.map(a,function(a,d){return BI.extend({},b[c],{items:[BI.extend({},b[c].el,{el:d})]})});return a},formatEL:function(a){return a&&!a.type&&a.el?a:{el:a}},stripEL:function(a){return a.type&&a||a.el||a},trans2Element:function(a){return BI.map(a,function(a,b){return b.element})}}),_.each(["where","findWhere","contains","invoke","pluck","shuffle","sample","toArray","size"],function(a){BI[a]=d(a)}),_.each(["each","map","reduce","reduceRight","find","filter","reject","every","all","some","any","max","min","sortBy","groupBy","indexBy","countBy","partition"],function(a){BI[a]=e(a)}),_.extend(BI,{clamp:function(a,b,c){return ac&&(a=c),a},count:function(a,b,c){var d;if(c)for(d=a;d=0;d--)b(d,a[d],a);return!1},backAny:function(a,b,c){b=BI.iteratee(b,c);for(var d=a.length-1;d>=0;d--)if(b(d,a[d],a))return!0;return!1},backEvery:function(a,b,c){b=BI.iteratee(b,c);for(var d=a.length-1;d>=0;d--)if(!b(d,a[d],a))return!1;return!0},backFindKey:function(a,b,c){b=BI.iteratee(b,c);for(var d,e=_.keys(a),f=e.length-1;f>=0;f--)if(d=e[f],b(a[d],d,a))return d},backFind:function(a,b,c){var d;if(d=BI.isArray(a)?BI.findLastIndex(a,b,c):BI.backFindKey(a,b,c),void 0!==d&&d!==-1)return a[d]},remove:function(a,b,c){var d=BI.isFunction(b);b=d||BI.isArray(b)?b:[b];var e;if(BI.isArray(a))for(e=0;e(2147483646-a.charAt(d).charCodeAt(0)+c.charCodeAt(0))/26)return 0;return b},int2Abc:function(a){var b=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],c=a,d="";if(0===a)return"";for(;0!==c;){var e=c%26;0===e&&(e=26),d=b[e-1]+d,c=(c-e)/26}return d}}),_.each(["first","initial","last","rest","compact","flatten","without","union","intersection","difference","zip","unzip","object","indexOf","lastIndexOf","sortedIndex","range"],function(a){BI[a]=d(a)}),_.each(["findIndex","findLastIndex"],function(a){BI[a]=e(a)}),_.extend(BI,{makeArray:function(a,b){for(var c=[],d=0;d0},isCapitalEqual:function(a,b){return a=BI.isNull(a)?a:(""+a).toLowerCase(),b=BI.isNull(b)?b:(""+b).toLowerCase(),BI.isEqual(a,b)},isWidthOrHeight:function(a){return"number"==typeof a?a>=0:"string"==typeof a?/^\d{1,3}%$/.exec(a)||"auto"==a||/^\d+px$/.exec(a):void 0},isNotNull:function(a){return!BI.isNull(a)},isNull:function(a){return"undefined"==typeof a||null===a},isPlainObject:function(){return a.isPlainObject.apply(a,arguments)},isEmptyArray:function(a){return BI.isArray(a)&&BI.isEmpty(a)},isNotEmptyArray:function(a){return BI.isArray(a)&&!BI.isEmpty(a)},isEmptyObject:function(a){return BI.isEqual(a,{})},isNotEmptyObject:function(a){return BI.isPlainObject(a)&&!BI.isEmptyObject(a)},isEmptyString:function(a){return BI.isString(a)&&0===a.length},isNotEmptyString:function(a){return BI.isString(a)&&!BI.isEmptyString(a)},isWindow:function(){return a.isWindow.apply(a,arguments)}}),_.extend(BI,{deepClone:function(a){if(null===a||a===b)return a;var c=Object.prototype.toString.call(a);if("[object Date]"===c)return new Date(a.getTime());var d,e;if("[object Array]"===c)for(d=a.length,e=[];d--;)e[d]=BI.deepClone(a[d]);else if("[object Object]"===c&&a.constructor===Object){e={};for(var d in a)_.has(a,d)&&(e[d]=BI.deepClone(a[d]))}return e||a},isDeepMatch:function(a,b){var c=BI.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;f10;)c=(parseInt(c.substring(0,10))+parseInt(c.substring(10,c.length),10)).toString();c=(f*c+g)%h;for(var j="",k="",d=0;d10;)c=(parseInt(c.substring(0,10),10)+parseInt(c.substring(10,c.length),10)).toString();c=(g*c+h)%i;for(var k="",l="",d=0;d127&&d<2048?(b+=String.fromCharCode(d>>6|192),b+=String.fromCharCode(63&d|128)):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128),b+=String.fromCharCode(63&d|128))}return b},c=function(a){for(var b="",c=0,d=0,e=0,f=0;c191&&d<224?(f=a.charCodeAt(c+1),b+=String.fromCharCode((31&d)<<6|63&f),c+=2):(f=a.charCodeAt(c+1),e=a.charCodeAt(c+2),b+=String.fromCharCode((15&d)<<12|(63&f)<<6|63&e),c+=3);return b};_.extend(BI,{encode:function(c){var d,e,f,g,h,i,j,k="",l=0;for(c=b(c);l>2,h=(3&d)<<4|e>>4,i=(15&e)<<2|f>>6,j=63&f,isNaN(e)?i=j=64:isNaN(f)&&(j=64),k=k+a.charAt(g)+a.charAt(h)+a.charAt(i)+a.charAt(j);return k},decode:function(b){var d,e,f,g,h,i,j,k="",l=0;for(b=b.replace(/[^A-Za-z0-9\+\/\=]/g,"");l>4,e=(15&h)<<4|i>>2,f=(3&i)<<6|j,k+=String.fromCharCode(d),64!=i&&(k+=String.fromCharCode(e)),64!=j&&(k+=String.fromCharCode(f));return k=c(k)}})}(),BI.CellSizeAndPositionManager=function(a,b,c){this._cellSizeGetter=b,this._cellCount=a,this._estimatedCellSize=c,this._cellSizeAndPositionData={},this._lastMeasuredIndex=-1},BI.CellSizeAndPositionManager.prototype={constructor:BI.CellSizeAndPositionManager,configure:function(a,b){this._cellCount=a,this._estimatedCellSize=b},getCellCount:function(){return this._cellCount},getEstimatedCellSize:function(){return this._estimatedCellSize},getLastMeasuredIndex:function(){return this._lastMeasuredIndex},getSizeAndPositionOfCell:function(a){if(!(a<0||a>=this._cellCount)){if(a>this._lastMeasuredIndex){for(var b=this.getSizeAndPositionOfLastMeasuredCell(),c=b.offset+b.size,d=this._lastMeasuredIndex+1;d<=a;d++){var e=this._cellSizeGetter(d);null==e||isNaN(e)||(this._cellSizeAndPositionData[d]={offset:c,size:e},c+=e)}this._lastMeasuredIndex=a}return this._cellSizeAndPositionData[a]}},getSizeAndPositionOfLastMeasuredCell:function(){return this._lastMeasuredIndex>=0?this._cellSizeAndPositionData[this._lastMeasuredIndex]:{offset:0,size:0}},getTotalSize:function(){var a=this.getSizeAndPositionOfLastMeasuredCell();return a.offset+a.size+(this._cellCount-this._lastMeasuredIndex-1)*this._estimatedCellSize},getUpdatedOffsetForIndex:function(a,b,c,d){var e,f=this.getSizeAndPositionOfCell(d),g=f.offset,h=g-b+f.size;switch(a){case"start":e=g;break;case"end":e=h;break;case"center":e=g-(b-f.size)/2;break;default:e=Math.max(h,Math.min(g,c))}var i=this.getTotalSize();return Math.max(0,Math.min(i-b,e))},getVisibleCellRange:function(a,b){var c=this.getTotalSize();if(0===c)return{};var d=b+a,e=this._findNearestCell(b),f=this.getSizeAndPositionOfCell(e);b=f.offset+f.size;for(var g=e;bc&&(a=d-1)}if(b>0)return b-1},_exponentialSearch:function(a,b){for(var c=1;a=a?this._binarySearch(c,0,a):this._exponentialSearch(c,a)}}},BI.ScalingCellSizeAndPositionManager=function(a,b,c,d){this._cellSizeAndPositionManager=new BI.CellSizeAndPositionManager(a,b,c),this._maxScrollSize=d||1e7},BI.ScalingCellSizeAndPositionManager.prototype={constructor:BI.ScalingCellSizeAndPositionManager,configure:function(){this._cellSizeAndPositionManager.configure.apply(this._cellSizeAndPositionManager,arguments)},getCellCount:function(){return this._cellSizeAndPositionManager.getCellCount()},getEstimatedCellSize:function(){return this._cellSizeAndPositionManager.getEstimatedCellSize()},getLastMeasuredIndex:function(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()},getOffsetAdjustment:function(a,b){var c=this._cellSizeAndPositionManager.getTotalSize(),d=this.getTotalSize(),e=this._getOffsetPercentage(a,b,d);return Math.round(e*(d-c))},getSizeAndPositionOfCell:function(a){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(a)},getSizeAndPositionOfLastMeasuredCell:function(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()},getTotalSize:function(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())},getUpdatedOffsetForIndex:function(a,b,c,d){c=this._safeOffsetToOffset(b,c);var e=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex(a,b,c,d);return this._offsetToSafeOffset(b,e)},getVisibleCellRange:function(a,b){return b=this._safeOffsetToOffset(a,b),this._cellSizeAndPositionManager.getVisibleCellRange(a,b)},resetCell:function(a){this._cellSizeAndPositionManager.resetCell(a)},_getOffsetPercentage:function(a,b,c){return c<=a?0:b/(c-a)},_offsetToSafeOffset:function(a,b){var c=this._cellSizeAndPositionManager.getTotalSize(),d=this.getTotalSize();if(c===d)return b;var e=this._getOffsetPercentage(a,b,c);return Math.round(e*(d-a))},_safeOffsetToOffset:function(a,b){var c=this._cellSizeAndPositionManager.getTotalSize(),d=this.getTotalSize();if(c===d)return b;var e=this._getOffsetPercentage(a,b,d);return Math.round(e*(c-a))}},!function(){var a="YDYQSXMWZSSXJBYMGCCZQPSSQBYCDSCDQLDYLYBSSJGYZZJJFKCCLZDHWDWZJLJPFYYNWJJTMYHZWZHFLZPPQHGSCYYYNJQYXXGJHHSDSJNKKTMOMLCRXYPSNQSECCQZGGLLYJLMYZZSECYKYYHQWJSSGGYXYZYJWWKDJHYCHMYXJTLXJYQBYXZLDWRDJRWYSRLDZJPCBZJJBRCFTLECZSTZFXXZHTRQHYBDLYCZSSYMMRFMYQZPWWJJYFCRWFDFZQPYDDWYXKYJAWJFFXYPSFTZYHHYZYSWCJYXSCLCXXWZZXNBGNNXBXLZSZSBSGPYSYZDHMDZBQBZCWDZZYYTZHBTSYYBZGNTNXQYWQSKBPHHLXGYBFMJEBJHHGQTJCYSXSTKZHLYCKGLYSMZXYALMELDCCXGZYRJXSDLTYZCQKCNNJWHJTZZCQLJSTSTBNXBTYXCEQXGKWJYFLZQLYHYXSPSFXLMPBYSXXXYDJCZYLLLSJXFHJXPJBTFFYABYXBHZZBJYZLWLCZGGBTSSMDTJZXPTHYQTGLJSCQFZKJZJQNLZWLSLHDZBWJNCJZYZSQQYCQYRZCJJWYBRTWPYFTWEXCSKDZCTBZHYZZYYJXZCFFZZMJYXXSDZZOTTBZLQWFCKSZSXFYRLNYJMBDTHJXSQQCCSBXYYTSYFBXDZTGBCNSLCYZZPSAZYZZSCJCSHZQYDXLBPJLLMQXTYDZXSQJTZPXLCGLQTZWJBHCTSYJSFXYEJJTLBGXSXJMYJQQPFZASYJNTYDJXKJCDJSZCBARTDCLYJQMWNQNCLLLKBYBZZSYHQQLTWLCCXTXLLZNTYLNEWYZYXCZXXGRKRMTCNDNJTSYYSSDQDGHSDBJGHRWRQLYBGLXHLGTGXBQJDZPYJSJYJCTMRNYMGRZJCZGJMZMGXMPRYXKJNYMSGMZJYMKMFXMLDTGFBHCJHKYLPFMDXLQJJSMTQGZSJLQDLDGJYCALCMZCSDJLLNXDJFFFFJCZFMZFFPFKHKGDPSXKTACJDHHZDDCRRCFQYJKQCCWJDXHWJLYLLZGCFCQDSMLZPBJJPLSBCJGGDCKKDEZSQCCKJGCGKDJTJDLZYCXKLQSCGJCLTFPCQCZGWPJDQYZJJBYJHSJDZWGFSJGZKQCCZLLPSPKJGQJHZZLJPLGJGJJTHJJYJZCZMLZLYQBGJWMLJKXZDZNJQSYZMLJLLJKYWXMKJLHSKJGBMCLYYMKXJQLBMLLKMDXXKWYXYSLMLPSJQQJQXYXFJTJDXMXXLLCXQBSYJBGWYMBGGBCYXPJYGPEPFGDJGBHBNSQJYZJKJKHXQFGQZKFHYGKHDKLLSDJQXPQYKYBNQSXQNSZSWHBSXWHXWBZZXDMNSJBSBKBBZKLYLXGWXDRWYQZMYWSJQLCJXXJXKJEQXSCYETLZHLYYYSDZPAQYZCMTLSHTZCFYZYXYLJSDCJQAGYSLCQLYYYSHMRQQKLDXZSCSSSYDYCJYSFSJBFRSSZQSBXXPXJYSDRCKGJLGDKZJZBDKTCSYQPYHSTCLDJDHMXMCGXYZHJDDTMHLTXZXYLYMOHYJCLTYFBQQXPFBDFHHTKSQHZYYWCNXXCRWHOWGYJLEGWDQCWGFJYCSNTMYTOLBYGWQWESJPWNMLRYDZSZTXYQPZGCWXHNGPYXSHMYQJXZTDPPBFYHZHTJYFDZWKGKZBLDNTSXHQEEGZZYLZMMZYJZGXZXKHKSTXNXXWYLYAPSTHXDWHZYMPXAGKYDXBHNHXKDPJNMYHYLPMGOCSLNZHKXXLPZZLBMLSFBHHGYGYYGGBHSCYAQTYWLXTZQCEZYDQDQMMHTKLLSZHLSJZWFYHQSWSCWLQAZYNYTLSXTHAZNKZZSZZLAXXZWWCTGQQTDDYZTCCHYQZFLXPSLZYGPZSZNGLNDQTBDLXGTCTAJDKYWNSYZLJHHZZCWNYYZYWMHYCHHYXHJKZWSXHZYXLYSKQYSPSLYZWMYPPKBYGLKZHTYXAXQSYSHXASMCHKDSCRSWJPWXSGZJLWWSCHSJHSQNHCSEGNDAQTBAALZZMSSTDQJCJKTSCJAXPLGGXHHGXXZCXPDMMHLDGTYBYSJMXHMRCPXXJZCKZXSHMLQXXTTHXWZFKHCCZDYTCJYXQHLXDHYPJQXYLSYYDZOZJNYXQEZYSQYAYXWYPDGXDDXSPPYZNDLTWRHXYDXZZJHTCXMCZLHPYYYYMHZLLHNXMYLLLMDCPPXHMXDKYCYRDLTXJCHHZZXZLCCLYLNZSHZJZZLNNRLWHYQSNJHXYNTTTKYJPYCHHYEGKCTTWLGQRLGGTGTYGYHPYHYLQYQGCWYQKPYYYTTTTLHYHLLTYTTSPLKYZXGZWGPYDSSZZDQXSKCQNMJJZZBXYQMJRTFFBTKHZKBXLJJKDXJTLBWFZPPTKQTZTGPDGNTPJYFALQMKGXBDCLZFHZCLLLLADPMXDJHLCCLGYHDZFGYDDGCYYFGYDXKSSEBDHYKDKDKHNAXXYBPBYYHXZQGAFFQYJXDMLJCSQZLLPCHBSXGJYNDYBYQSPZWJLZKSDDTACTBXZDYZYPJZQSJNKKTKNJDJGYYPGTLFYQKASDNTCYHBLWDZHBBYDWJRYGKZYHEYYFJMSDTYFZJJHGCXPLXHLDWXXJKYTCYKSSSMTWCTTQZLPBSZDZWZXGZAGYKTYWXLHLSPBCLLOQMMZSSLCMBJCSZZKYDCZJGQQDSMCYTZQQLWZQZXSSFPTTFQMDDZDSHDTDWFHTDYZJYQJQKYPBDJYYXTLJHDRQXXXHAYDHRJLKLYTWHLLRLLRCXYLBWSRSZZSYMKZZHHKYHXKSMDSYDYCJPBZBSQLFCXXXNXKXWYWSDZYQOGGQMMYHCDZTTFJYYBGSTTTYBYKJDHKYXBELHTYPJQNFXFDYKZHQKZBYJTZBXHFDXKDASWTAWAJLDYJSFHBLDNNTNQJTJNCHXFJSRFWHZFMDRYJYJWZPDJKZYJYMPCYZNYNXFBYTFYFWYGDBNZZZDNYTXZEMMQBSQEHXFZMBMFLZZSRXYMJGSXWZJSPRYDJSJGXHJJGLJJYNZZJXHGXKYMLPYYYCXYTWQZSWHWLYRJLPXSLSXMFSWWKLCTNXNYNPSJSZHDZEPTXMYYWXYYSYWLXJQZQXZDCLEEELMCPJPCLWBXSQHFWWTFFJTNQJHJQDXHWLBYZNFJLALKYYJLDXHHYCSTYYWNRJYXYWTRMDRQHWQCMFJDYZMHMYYXJWMYZQZXTLMRSPWWCHAQBXYGZYPXYYRRCLMPYMGKSJSZYSRMYJSNXTPLNBAPPYPYLXYYZKYNLDZYJZCZNNLMZHHARQMPGWQTZMXXMLLHGDZXYHXKYXYCJMFFYYHJFSBSSQLXXNDYCANNMTCJCYPRRNYTYQNYYMBMSXNDLYLYSLJRLXYSXQMLLYZLZJJJKYZZCSFBZXXMSTBJGNXYZHLXNMCWSCYZYFZLXBRNNNYLBNRTGZQYSATSWRYHYJZMZDHZGZDWYBSSCSKXSYHYTXXGCQGXZZSHYXJSCRHMKKBXCZJYJYMKQHZJFNBHMQHYSNJNZYBKNQMCLGQHWLZNZSWXKHLJHYYBQLBFCDSXDLDSPFZPSKJYZWZXZDDXJSMMEGJSCSSMGCLXXKYYYLNYPWWWGYDKZJGGGZGGSYCKNJWNJPCXBJJTQTJWDSSPJXZXNZXUMELPXFSXTLLXCLJXJJLJZXCTPSWXLYDHLYQRWHSYCSQYYBYAYWJJJQFWQCQQCJQGXALDBZZYJGKGXPLTZYFXJLTPADKYQHPMATLCPDCKBMTXYBHKLENXDLEEGQDYMSAWHZMLJTWYGXLYQZLJEEYYBQQFFNLYXRDSCTGJGXYYNKLLYQKCCTLHJLQMKKZGCYYGLLLJDZGYDHZWXPYSJBZKDZGYZZHYWYFQYTYZSZYEZZLYMHJJHTSMQWYZLKYYWZCSRKQYTLTDXWCTYJKLWSQZWBDCQYNCJSRSZJLKCDCDTLZZZACQQZZDDXYPLXZBQJYLZLLLQDDZQJYJYJZYXNYYYNYJXKXDAZWYRDLJYYYRJLXLLDYXJCYWYWNQCCLDDNYYYNYCKCZHXXCCLGZQJGKWPPCQQJYSBZZXYJSQPXJPZBSBDSFNSFPZXHDWZTDWPPTFLZZBZDMYYPQJRSDZSQZSQXBDGCPZSWDWCSQZGMDHZXMWWFYBPDGPHTMJTHZSMMBGZMBZJCFZWFZBBZMQCFMBDMCJXLGPNJBBXGYHYYJGPTZGZMQBQTCGYXJXLWZKYDPDYMGCFTPFXYZTZXDZXTGKMTYBBCLBJASKYTSSQYYMSZXFJEWLXLLSZBQJJJAKLYLXLYCCTSXMCWFKKKBSXLLLLJYXTYLTJYYTDPJHNHNNKBYQNFQYYZBYYESSESSGDYHFHWTCJBSDZZTFDMXHCNJZYMQWSRYJDZJQPDQBBSTJGGFBKJBXTGQHNGWJXJGDLLTHZHHYYYYYYSXWTYYYCCBDBPYPZYCCZYJPZYWCBDLFWZCWJDXXHYHLHWZZXJTCZLCDPXUJCZZZLYXJJTXPHFXWPYWXZPTDZZBDZCYHJHMLXBQXSBYLRDTGJRRCTTTHYTCZWMXFYTWWZCWJWXJYWCSKYBZSCCTZQNHXNWXXKHKFHTSWOCCJYBCMPZZYKBNNZPBZHHZDLSYDDYTYFJPXYNGFXBYQXCBHXCPSXTYZDMKYSNXSXLHKMZXLYHDHKWHXXSSKQYHHCJYXGLHZXCSNHEKDTGZXQYPKDHEXTYKCNYMYYYPKQYYYKXZLTHJQTBYQHXBMYHSQCKWWYLLHCYYLNNEQXQWMCFBDCCMLJGGXDQKTLXKGNQCDGZJWYJJLYHHQTTTNWCHMXCXWHWSZJYDJCCDBQCDGDNYXZTHCQRXCBHZTQCBXWGQWYYBXHMBYMYQTYEXMQKYAQYRGYZSLFYKKQHYSSQYSHJGJCNXKZYCXSBXYXHYYLSTYCXQTHYSMGSCPMMGCCCCCMTZTASMGQZJHKLOSQYLSWTMXSYQKDZLJQQYPLSYCZTCQQPBBQJZCLPKHQZYYXXDTDDTSJCXFFLLCHQXMJLWCJCXTSPYCXNDTJSHJWXDQQJSKXYAMYLSJHMLALYKXCYYDMNMDQMXMCZNNCYBZKKYFLMCHCMLHXRCJJHSYLNMTJZGZGYWJXSRXCWJGJQHQZDQJDCJJZKJKGDZQGJJYJYLXZXXCDQHHHEYTMHLFSBDJSYYSHFYSTCZQLPBDRFRZTZYKYWHSZYQKWDQZRKMSYNBCRXQBJYFAZPZZEDZCJYWBCJWHYJBQSZYWRYSZPTDKZPFPBNZTKLQYHBBZPNPPTYZZYBQNYDCPJMMCYCQMCYFZZDCMNLFPBPLNGQJTBTTNJZPZBBZNJKLJQYLNBZQHKSJZNGGQSZZKYXSHPZSNBCGZKDDZQANZHJKDRTLZLSWJLJZLYWTJNDJZJHXYAYNCBGTZCSSQMNJPJYTYSWXZFKWJQTKHTZPLBHSNJZSYZBWZZZZLSYLSBJHDWWQPSLMMFBJDWAQYZTCJTBNNWZXQXCDSLQGDSDPDZHJTQQPSWLYYJZLGYXYZLCTCBJTKTYCZJTQKBSJLGMGZDMCSGPYNJZYQYYKNXRPWSZXMTNCSZZYXYBYHYZAXYWQCJTLLCKJJTJHGDXDXYQYZZBYWDLWQCGLZGJGQRQZCZSSBCRPCSKYDZNXJSQGXSSJMYDNSTZTPBDLTKZWXQWQTZEXNQCZGWEZKSSBYBRTSSSLCCGBPSZQSZLCCGLLLZXHZQTHCZMQGYZQZNMCOCSZJMMZSQPJYGQLJYJPPLDXRGZYXCCSXHSHGTZNLZWZKJCXTCFCJXLBMQBCZZWPQDNHXLJCTHYZLGYLNLSZZPCXDSCQQHJQKSXZPBAJYEMSMJTZDXLCJYRYYNWJBNGZZTMJXLTBSLYRZPYLSSCNXPHLLHYLLQQZQLXYMRSYCXZLMMCZLTZSDWTJJLLNZGGQXPFSKYGYGHBFZPDKMWGHCXMSGDXJMCJZDYCABXJDLNBCDQYGSKYDQTXDJJYXMSZQAZDZFSLQXYJSJZYLBTXXWXQQZBJZUFBBLYLWDSLJHXJYZJWTDJCZFQZQZZDZSXZZQLZCDZFJHYSPYMPQZMLPPLFFXJJNZZYLSJEYQZFPFZKSYWJJJHRDJZZXTXXGLGHYDXCSKYSWMMZCWYBAZBJKSHFHJCXMHFQHYXXYZFTSJYZFXYXPZLCHMZMBXHZZSXYFYMNCWDABAZLXKTCSHHXKXJJZJSTHYGXSXYYHHHJWXKZXSSBZZWHHHCWTZZZPJXSNXQQJGZYZYWLLCWXZFXXYXYHXMKYYSWSQMNLNAYCYSPMJKHWCQHYLAJJMZXHMMCNZHBHXCLXTJPLTXYJHDYYLTTXFSZHYXXSJBJYAYRSMXYPLCKDUYHLXRLNLLSTYZYYQYGYHHSCCSMZCTZQXKYQFPYYRPFFLKQUNTSZLLZMWWTCQQYZWTLLMLMPWMBZSSTZRBPDDTLQJJBXZCSRZQQYGWCSXFWZLXCCRSZDZMCYGGDZQSGTJSWLJMYMMZYHFBJDGYXCCPSHXNZCSBSJYJGJMPPWAFFYFNXHYZXZYLREMZGZCYZSSZDLLJCSQFNXZKPTXZGXJJGFMYYYSNBTYLBNLHPFZDCYFBMGQRRSSSZXYSGTZRNYDZZCDGPJAFJFZKNZBLCZSZPSGCYCJSZLMLRSZBZZLDLSLLYSXSQZQLYXZLSKKBRXBRBZCYCXZZZEEYFGKLZLYYHGZSGZLFJHGTGWKRAAJYZKZQTSSHJJXDCYZUYJLZYRZDQQHGJZXSSZBYKJPBFRTJXLLFQWJHYLQTYMBLPZDXTZYGBDHZZRBGXHWNJTJXLKSCFSMWLSDQYSJTXKZSCFWJLBXFTZLLJZLLQBLSQMQQCGCZFPBPHZCZJLPYYGGDTGWDCFCZQYYYQYSSCLXZSKLZZZGFFCQNWGLHQYZJJCZLQZZYJPJZZBPDCCMHJGXDQDGDLZQMFGPSYTSDYFWWDJZJYSXYYCZCYHZWPBYKXRYLYBHKJKSFXTZJMMCKHLLTNYYMSYXYZPYJQYCSYCWMTJJKQYRHLLQXPSGTLYYCLJSCPXJYZFNMLRGJJTYZBXYZMSJYJHHFZQMSYXRSZCWTLRTQZSSTKXGQKGSPTGCZNJSJCQCXHMXGGZTQYDJKZDLBZSXJLHYQGGGTHQSZPYHJHHGYYGKGGCWJZZYLCZLXQSFTGZSLLLMLJSKCTBLLZZSZMMNYTPZSXQHJCJYQXYZXZQZCPSHKZZYSXCDFGMWQRLLQXRFZTLYSTCTMJCXJJXHJNXTNRZTZFQYHQGLLGCXSZSJDJLJCYDSJTLNYXHSZXCGJZYQPYLFHDJSBPCCZHJJJQZJQDYBSSLLCMYTTMQTBHJQNNYGKYRQYQMZGCJKPDCGMYZHQLLSLLCLMHOLZGDYYFZSLJCQZLYLZQJESHNYLLJXGJXLYSYYYXNBZLJSSZCQQCJYLLZLTJYLLZLLBNYLGQCHXYYXOXCXQKYJXXXYKLXSXXYQXCYKQXQCSGYXXYQXYGYTQOHXHXPYXXXULCYEYCHZZCBWQBBWJQZSCSZSSLZYLKDESJZWMYMCYTSDSXXSCJPQQSQYLYYZYCMDJDZYWCBTJSYDJKCYDDJLBDJJSODZYSYXQQYXDHHGQQYQHDYXWGMMMAJDYBBBPPBCMUUPLJZSMTXERXJMHQNUTPJDCBSSMSSSTKJTSSMMTRCPLZSZMLQDSDMJMQPNQDXCFYNBFSDQXYXHYAYKQYDDLQYYYSSZBYDSLNTFQTZQPZMCHDHCZCWFDXTMYQSPHQYYXSRGJCWTJTZZQMGWJJTJHTQJBBHWZPXXHYQFXXQYWYYHYSCDYDHHQMNMTMWCPBSZPPZZGLMZFOLLCFWHMMSJZTTDHZZYFFYTZZGZYSKYJXQYJZQBHMBZZLYGHGFMSHPZFZSNCLPBQSNJXZSLXXFPMTYJYGBXLLDLXPZJYZJYHHZCYWHJYLSJEXFSZZYWXKZJLUYDTMLYMQJPWXYHXSKTQJEZRPXXZHHMHWQPWQLYJJQJJZSZCPHJLCHHNXJLQWZJHBMZYXBDHHYPZLHLHLGFWLCHYYTLHJXCJMSCPXSTKPNHQXSRTYXXTESYJCTLSSLSTDLLLWWYHDHRJZSFGXTSYCZYNYHTDHWJSLHTZDQDJZXXQHGYLTZPHCSQFCLNJTCLZPFSTPDYNYLGMJLLYCQHYSSHCHYLHQYQTMZYPBYWRFQYKQSYSLZDQJMPXYYSSRHZJNYWTQDFZBWWTWWRXCWHGYHXMKMYYYQMSMZHNGCEPMLQQMTCWCTMMPXJPJJHFXYYZSXZHTYBMSTSYJTTQQQYYLHYNPYQZLCYZHZWSMYLKFJXLWGXYPJYTYSYXYMZCKTTWLKSMZSYLMPWLZWXWQZSSAQSYXYRHSSNTSRAPXCPWCMGDXHXZDZYFJHGZTTSBJHGYZSZYSMYCLLLXBTYXHBBZJKSSDMALXHYCFYGMQYPJYCQXJLLLJGSLZGQLYCJCCZOTYXMTMTTLLWTGPXYMZMKLPSZZZXHKQYSXCTYJZYHXSHYXZKXLZWPSQPYHJWPJPWXQQYLXSDHMRSLZZYZWTTCYXYSZZSHBSCCSTPLWSSCJCHNLCGCHSSPHYLHFHHXJSXYLLNYLSZDHZXYLSXLWZYKCLDYAXZCMDDYSPJTQJZLNWQPSSSWCTSTSZLBLNXSMNYYMJQBQHRZWTYYDCHQLXKPZWBGQYBKFCMZWPZLLYYLSZYDWHXPSBCMLJBSCGBHXLQHYRLJXYSWXWXZSLDFHLSLYNJLZYFLYJYCDRJLFSYZFSLLCQYQFGJYHYXZLYLMSTDJCYHBZLLNWLXXYGYYHSMGDHXXHHLZZJZXCZZZCYQZFNGWPYLCPKPYYPMCLQKDGXZGGWQBDXZZKZFBXXLZXJTPJPTTBYTSZZDWSLCHZHSLTYXHQLHYXXXYYZYSWTXZKHLXZXZPYHGCHKCFSYHUTJRLXFJXPTZTWHPLYXFCRHXSHXKYXXYHZQDXQWULHYHMJTBFLKHTXCWHJFWJCFPQRYQXCYYYQYGRPYWSGSUNGWCHKZDXYFLXXHJJBYZWTSXXNCYJJYMSWZJQRMHXZWFQSYLZJZGBHYNSLBGTTCSYBYXXWXYHXYYXNSQYXMQYWRGYQLXBBZLJSYLPSYTJZYHYZAWLRORJMKSCZJXXXYXCHDYXRYXXJDTSQFXLYLTSFFYXLMTYJMJUYYYXLTZCSXQZQHZXLYYXZHDNBRXXXJCTYHLBRLMBRLLAXKYLLLJLYXXLYCRYLCJTGJCMTLZLLCYZZPZPCYAWHJJFYBDYYZSMPCKZDQYQPBPCJPDCYZMDPBCYYDYCNNPLMTMLRMFMMGWYZBSJGYGSMZQQQZTXMKQWGXLLPJGZBQCDJJJFPKJKCXBLJMSWMDTQJXLDLPPBXCWRCQFBFQJCZAHZGMYKPHYYHZYKNDKZMBPJYXPXYHLFPNYYGXJDBKXNXHJMZJXSTRSTLDXSKZYSYBZXJLXYSLBZYSLHXJPFXPQNBYLLJQKYGZMCYZZYMCCSLCLHZFWFWYXZMWSXTYNXJHPYYMCYSPMHYSMYDYSHQYZCHMJJMZCAAGCFJBBHPLYZYLXXSDJGXDHKXXTXXNBHRMLYJSLTXMRHNLXQJXYZLLYSWQGDLBJHDCGJYQYCMHWFMJYBMBYJYJWYMDPWHXQLDYGPDFXXBCGJSPCKRSSYZJMSLBZZJFLJJJLGXZGYXYXLSZQYXBEXYXHGCXBPLDYHWETTWWCJMBTXCHXYQXLLXFLYXLLJLSSFWDPZSMYJCLMWYTCZPCHQEKCQBWLCQYDPLQPPQZQFJQDJHYMMCXTXDRMJWRHXCJZYLQXDYYNHYYHRSLSRSYWWZJYMTLTLLGTQCJZYABTCKZCJYCCQLJZQXALMZYHYWLWDXZXQDLLQSHGPJFJLJHJABCQZDJGTKHSSTCYJLPSWZLXZXRWGLDLZRLZXTGSLLLLZLYXXWGDZYGBDPHZPBRLWSXQBPFDWOFMWHLYPCBJCCLDMBZPBZZLCYQXLDOMZBLZWPDWYYGDSTTHCSQSCCRSSSYSLFYBFNTYJSZDFNDPDHDZZMBBLSLCMYFFGTJJQWFTMTPJWFNLBZCMMJTGBDZLQLPYFHYYMJYLSDCHDZJWJCCTLJCLDTLJJCPDDSQDSSZYBNDBJLGGJZXSXNLYCYBJXQYCBYLZCFZPPGKCXZDZFZTJJFJSJXZBNZYJQTTYJYHTYCZHYMDJXTTMPXSPLZCDWSLSHXYPZGTFMLCJTYCBPMGDKWYCYZCDSZZYHFLYCTYGWHKJYYLSJCXGYWJCBLLCSNDDBTZBSCLYZCZZSSQDLLMQYYHFSLQLLXFTYHABXGWNYWYYPLLSDLDLLBJCYXJZMLHLJDXYYQYTDLLLBUGBFDFBBQJZZMDPJHGCLGMJJPGAEHHBWCQXAXHHHZCHXYPHJAXHLPHJPGPZJQCQZGJJZZUZDMQYYBZZPHYHYBWHAZYJHYKFGDPFQSDLZMLJXKXGALXZDAGLMDGXMWZQYXXDXXPFDMMSSYMPFMDMMKXKSYZYSHDZKXSYSMMZZZMSYDNZZCZXFPLSTMZDNMXCKJMZTYYMZMZZMSXHHDCZJEMXXKLJSTLWLSQLYJZLLZJSSDPPMHNLZJCZYHMXXHGZCJMDHXTKGRMXFWMCGMWKDTKSXQMMMFZZYDKMSCLCMPCGMHSPXQPZDSSLCXKYXTWLWJYAHZJGZQMCSNXYYMMPMLKJXMHLMLQMXCTKZMJQYSZJSYSZHSYJZJCDAJZYBSDQJZGWZQQXFKDMSDJLFWEHKZQKJPEYPZYSZCDWYJFFMZZYLTTDZZEFMZLBNPPLPLPEPSZALLTYLKCKQZKGENQLWAGYXYDPXLHSXQQWQCQXQCLHYXXMLYCCWLYMQYSKGCHLCJNSZKPYZKCQZQLJPDMDZHLASXLBYDWQLWDNBQCRYDDZTJYBKBWSZDXDTNPJDTCTQDFXQQMGNXECLTTBKPWSLCTYQLPWYZZKLPYGZCQQPLLKCCYLPQMZCZQCLJSLQZDJXLDDHPZQDLJJXZQDXYZQKZLJCYQDYJPPYPQYKJYRMPCBYMCXKLLZLLFQPYLLLMBSGLCYSSLRSYSQTMXYXZQZFDZUYSYZTFFMZZSMZQHZSSCCMLYXWTPZGXZJGZGSJSGKDDHTQGGZLLBJDZLCBCHYXYZHZFYWXYZYMSDBZZYJGTSMTFXQYXQSTDGSLNXDLRYZZLRYYLXQHTXSRTZNGZXBNQQZFMYKMZJBZYMKBPNLYZPBLMCNQYZZZSJZHJCTZKHYZZJRDYZHNPXGLFZTLKGJTCTSSYLLGZRZBBQZZKLPKLCZYSSUYXBJFPNJZZXCDWXZYJXZZDJJKGGRSRJKMSMZJLSJYWQSKYHQJSXPJZZZLSNSHRNYPZTWCHKLPSRZLZXYJQXQKYSJYCZTLQZYBBYBWZPQDWWYZCYTJCJXCKCWDKKZXSGKDZXWWYYJQYYTCYTDLLXWKCZKKLCCLZCQQDZLQLCSFQCHQHSFSMQZZLNBJJZBSJHTSZDYSJQJPDLZCDCWJKJZZLPYCGMZWDJJBSJQZSYZYHHXJPBJYDSSXDZNCGLQMBTSFSBPDZDLZNFGFJGFSMPXJQLMBLGQCYYXBQKDJJQYRFKZTJDHCZKLBSDZCFJTPLLJGXHYXZCSSZZXSTJYGKGCKGYOQXJPLZPBPGTGYJZGHZQZZLBJLSQFZGKQQJZGYCZBZQTLDXRJXBSXXPZXHYZYCLWDXJJHXMFDZPFZHQHQMQGKSLYHTYCGFRZGNQXCLPDLBZCSCZQLLJBLHBZCYPZZPPDYMZZSGYHCKCPZJGSLJLNSCDSLDLXBMSTLDDFJMKDJDHZLZXLSZQPQPGJLLYBDSZGQLBZLSLKYYHZTTNTJYQTZZPSZQZTLLJTYYLLQLLQYZQLBDZLSLYYZYMDFSZSNHLXZNCZQZPBWSKRFBSYZMTHBLGJPMCZZLSTLXSHTCSYZLZBLFEQHLXFLCJLYLJQCBZLZJHHSSTBRMHXZHJZCLXFNBGXGTQJCZTMSFZKJMSSNXLJKBHSJXNTNLZDNTLMSJXGZJYJCZXYJYJWRWWQNZTNFJSZPZSHZJFYRDJSFSZJZBJFZQZZHZLXFYSBZQLZSGYFTZDCSZXZJBQMSZKJRHYJZCKMJKHCHGTXKXQGLXPXFXTRTYLXJXHDTSJXHJZJXZWZLCQSBTXWXGXTXXHXFTSDKFJHZYJFJXRZSDLLLTQSQQZQWZXSYQTWGWBZCGZLLYZBCLMQQTZHZXZXLJFRMYZFLXYSQXXJKXRMQDZDMMYYBSQBHGZMWFWXGMXLZPYYTGZYCCDXYZXYWGSYJYZNBHPZJSQSYXSXRTFYZGRHZTXSZZTHCBFCLSYXZLZQMZLMPLMXZJXSFLBYZMYQHXJSXRXSQZZZSSLYFRCZJRCRXHHZXQYDYHXSJJHZCXZBTYNSYSXJBQLPXZQPYMLXZKYXLXCJLCYSXXZZLXDLLLJJYHZXGYJWKJRWYHCPSGNRZLFZWFZZNSXGXFLZSXZZZBFCSYJDBRJKRDHHGXJLJJTGXJXXSTJTJXLYXQFCSGSWMSBCTLQZZWLZZKXJMLTMJYHSDDBXGZHDLBMYJFRZFSGCLYJBPMLYSMSXLSZJQQHJZFXGFQFQBPXZGYYQXGZTCQWYLTLGWSGWHRLFSFGZJMGMGBGTJFSYZZGZYZAFLSSPMLPFLCWBJZCLJJMZLPJJLYMQDMYYYFBGYGYZMLYZDXQYXRQQQHSYYYQXYLJTYXFSFSLLGNQCYHYCWFHCCCFXPYLYPLLZYXXXXXKQHHXSHJZCFZSCZJXCPZWHHHHHAPYLQALPQAFYHXDYLUKMZQGGGDDESRNNZLTZGCHYPPYSQJJHCLLJTOLNJPZLJLHYMHEYDYDSQYCDDHGZUNDZCLZYZLLZNTNYZGSLHSLPJJBDGWXPCDUTJCKLKCLWKLLCASSTKZZDNQNTTLYYZSSYSSZZRYLJQKCQDHHCRXRZYDGRGCWCGZQFFFPPJFZYNAKRGYWYQPQXXFKJTSZZXSWZDDFBBXTBGTZKZNPZZPZXZPJSZBMQHKCYXYLDKLJNYPKYGHGDZJXXEAHPNZKZTZCMXCXMMJXNKSZQNMNLWBWWXJKYHCPSTMCSQTZJYXTPCTPDTNNPGLLLZSJLSPBLPLQHDTNJNLYYRSZFFJFQWDPHZDWMRZCCLODAXNSSNYZRESTYJWJYJDBCFXNMWTTBYLWSTSZGYBLJPXGLBOCLHPCBJLTMXZLJYLZXCLTPNCLCKXTPZJSWCYXSFYSZDKNTLBYJCYJLLSTGQCBXRYZXBXKLYLHZLQZLNZCXWJZLJZJNCJHXMNZZGJZZXTZJXYCYYCXXJYYXJJXSSSJSTSSTTPPGQTCSXWZDCSYFPTFBFHFBBLZJCLZZDBXGCXLQPXKFZFLSYLTUWBMQJHSZBMDDBCYSCCLDXYCDDQLYJJWMQLLCSGLJJSYFPYYCCYLTJANTJJPWYCMMGQYYSXDXQMZHSZXPFTWWZQSWQRFKJLZJQQYFBRXJHHFWJJZYQAZMYFRHCYYBYQWLPEXCCZSTYRLTTDMQLYKMBBGMYYJPRKZNPBSXYXBHYZDJDNGHPMFSGMWFZMFQMMBCMZZCJJLCNUXYQLMLRYGQZCYXZLWJGCJCGGMCJNFYZZJHYCPRRCMTZQZXHFQGTJXCCJEAQCRJYHPLQLSZDJRBCQHQDYRHYLYXJSYMHZYDWLDFRYHBPYDTSSCNWBXGLPZMLZZTQSSCPJMXXYCSJYTYCGHYCJWYRXXLFEMWJNMKLLSWTXHYYYNCMMCWJDQDJZGLLJWJRKHPZGGFLCCSCZMCBLTBHBQJXQDSPDJZZGKGLFQYWBZYZJLTSTDHQHCTCBCHFLQMPWDSHYYTQWCNZZJTLBYMBPDYYYXSQKXWYYFLXXNCWCXYPMAELYKKJMZZZBRXYYQJFLJPFHHHYTZZXSGQQMHSPGDZQWBWPJHZJDYSCQWZKTXXSQLZYYMYSDZGRXCKKUJLWPYSYSCSYZLRMLQSYLJXBCXTLWDQZPCYCYKPPPNSXFYZJJRCEMHSZMSXLXGLRWGCSTLRSXBZGBZGZTCPLUJLSLYLYMTXMTZPALZXPXJTJWTCYYZLBLXBZLQMYLXPGHDSLSSDMXMBDZZSXWHAMLCZCPJMCNHJYSNSYGCHSKQMZZQDLLKABLWJXSFMOCDXJRRLYQZKJMYBYQLYHETFJZFRFKSRYXFJTWDSXXSYSQJYSLYXWJHSNLXYYXHBHAWHHJZXWMYLJCSSLKYDZTXBZSYFDXGXZJKHSXXYBSSXDPYNZWRPTQZCZENYGCXQFJYKJBZMLJCMQQXUOXSLYXXLYLLJDZBTYMHPFSTTQQWLHOKYBLZZALZXQLHZWRRQHLSTMYPYXJJXMQSJFNBXYXYJXXYQYLTHYLQYFMLKLJTMLLHSZWKZHLJMLHLJKLJSTLQXYLMBHHLNLZXQJHXCFXXLHYHJJGBYZZKBXSCQDJQDSUJZYYHZHHMGSXCSYMXFEBCQWWRBPYYJQTYZCYQYQQZYHMWFFHGZFRJFCDPXNTQYZPDYKHJLFRZXPPXZDBBGZQSTLGDGYLCQMLCHHMFYWLZYXKJLYPQHSYWMQQGQZMLZJNSQXJQSYJYCBEHSXFSZPXZWFLLBCYYJDYTDTHWZSFJMQQYJLMQXXLLDTTKHHYBFPWTYYSQQWNQWLGWDEBZWCMYGCULKJXTMXMYJSXHYBRWFYMWFRXYQMXYSZTZZTFYKMLDHQDXWYYNLCRYJBLPSXCXYWLSPRRJWXHQYPHTYDNXHHMMYWYTZCSQMTSSCCDALWZTCPQPYJLLQZYJSWXMZZMMYLMXCLMXCZMXMZSQTZPPQQBLPGXQZHFLJJHYTJSRXWZXSCCDLXTYJDCQJXSLQYCLZXLZZXMXQRJMHRHZJBHMFLJLMLCLQNLDXZLLLPYPSYJYSXCQQDCMQJZZXHNPNXZMEKMXHYKYQLXSXTXJYYHWDCWDZHQYYBGYBCYSCFGPSJNZDYZZJZXRZRQJJYMCANYRJTLDPPYZBSTJKXXZYPFDWFGZZRPYMTNGXZQBYXNBUFNQKRJQZMJEGRZGYCLKXZDSKKNSXKCLJSPJYYZLQQJYBZSSQLLLKJXTBKTYLCCDDBLSPPFYLGYDTZJYQGGKQTTFZXBDKTYYHYBBFYTYYBCLPDYTGDHRYRNJSPTCSNYJQHKLLLZSLYDXXWBCJQSPXBPJZJCJDZFFXXBRMLAZHCSNDLBJDSZBLPRZTSWSBXBCLLXXLZDJZSJPYLYXXYFTFFFBHJJXGBYXJPMMMPSSJZJMTLYZJXSWXTYLEDQPJMYGQZJGDJLQJWJQLLSJGJGYGMSCLJJXDTYGJQJQJCJZCJGDZZSXQGSJGGCXHQXSNQLZZBXHSGZXCXYLJXYXYYDFQQJHJFXDHCTXJYRXYSQTJXYEFYYSSYYJXNCYZXFXMSYSZXYYSCHSHXZZZGZZZGFJDLTYLNPZGYJYZYYQZPBXQBDZTZCZYXXYHHSQXSHDHGQHJHGYWSZTMZMLHYXGEBTYLZKQWYTJZRCLEKYSTDBCYKQQSAYXCJXWWGSBHJYZYDHCSJKQCXSWXFLTYNYZPZCCZJQTZWJQDZZZQZLJJXLSBHPYXXPSXSHHEZTXFPTLQYZZXHYTXNCFZYYHXGNXMYWXTZSJPTHHGYMXMXQZXTSBCZYJYXXTYYZYPCQLMMSZMJZZLLZXGXZAAJZYXJMZXWDXZSXZDZXLEYJJZQBHZWZZZQTZPSXZTDSXJJJZNYAZPHXYYSRNQDTHZHYYKYJHDZXZLSWCLYBZYECWCYCRYLCXNHZYDZYDYJDFRJJHTRSQTXYXJRJHOJYNXELXSFSFJZGHPZSXZSZDZCQZBYYKLSGSJHCZSHDGQGXYZGXCHXZJWYQWGYHKSSEQZZNDZFKWYSSTCLZSTSYMCDHJXXYWEYXCZAYDMPXMDSXYBSQMJMZJMTZQLPJYQZCGQHXJHHLXXHLHDLDJQCLDWBSXFZZYYSCHTYTYYBHECXHYKGJPXHHYZJFXHWHBDZFYZBCAPNPGNYDMSXHMMMMAMYNBYJTMPXYYMCTHJBZYFCGTYHWPHFTWZZEZSBZEGPFMTSKFTYCMHFLLHGPZJXZJGZJYXZSBBQSCZZLZCCSTPGXMJSFTCCZJZDJXCYBZLFCJSYZFGSZLYBCWZZBYZDZYPSWYJZXZBDSYUXLZZBZFYGCZXBZHZFTPBGZGEJBSTGKDMFHYZZJHZLLZZGJQZLSFDJSSCBZGPDLFZFZSZYZYZSYGCXSNXXCHCZXTZZLJFZGQSQYXZJQDCCZTQCDXZJYQJQCHXZTDLGSCXZSYQJQTZWLQDQZTQCHQQJZYEZZZPBWKDJFCJPZTYPQYQTTYNLMBDKTJZPQZQZZFPZSBNJLGYJDXJDZZKZGQKXDLPZJTCJDQBXDJQJSTCKNXBXZMSLYJCQMTJQWWCJQNJNLLLHJCWQTBZQYDZCZPZZDZYDDCYZZZCCJTTJFZDPRRTZTJDCQTQZDTJNPLZBCLLCTZSXKJZQZPZLBZRBTJDCXFCZDBCCJJLTQQPLDCGZDBBZJCQDCJWYNLLZYZCCDWLLXWZLXRXNTQQCZXKQLSGDFQTDDGLRLAJJTKUYMKQLLTZYTDYYCZGJWYXDXFRSKSTQTENQMRKQZHHQKDLDAZFKYPBGGPZREBZZYKZZSPEGJXGYKQZZZSLYSYYYZWFQZYLZZLZHWCHKYPQGNPGBLPLRRJYXCCSYYHSFZFYBZYYTGZXYLXCZWXXZJZBLFFLGSKHYJZEYJHLPLLLLCZGXDRZELRHGKLZZYHZLYQSZZJZQLJZFLNBHGWLCZCFJYSPYXZLZLXGCCPZBLLCYBBBBUBBCBPCRNNZCZYRBFSRLDCGQYYQXYGMQZWTZYTYJXYFWTEHZZJYWLCCNTZYJJZDEDPZDZTSYQJHDYMBJNYJZLXTSSTPHNDJXXBYXQTZQDDTJTDYYTGWSCSZQFLSHLGLBCZPHDLYZJYCKWTYTYLBNYTSDSYCCTYSZYYEBHEXHQDTWNYGYCLXTSZYSTQMYGZAZCCSZZDSLZCLZRQXYYELJSBYMXSXZTEMBBLLYYLLYTDQYSHYMRQWKFKBFXNXSBYCHXBWJYHTQBPBSBWDZYLKGZSKYHXQZJXHXJXGNLJKZLYYCDXLFYFGHLJGJYBXQLYBXQPQGZTZPLNCYPXDJYQYDYMRBESJYYHKXXSTMXRCZZYWXYQYBMCLLYZHQYZWQXDBXBZWZMSLPDMYSKFMZKLZCYQYCZLQXFZZYDQZPZYGYJYZMZXDZFYFYTTQTZHGSPCZMLCCYTZXJCYTJMKSLPZHYSNZLLYTPZCTZZCKTXDHXXTQCYFKSMQCCYYAZHTJPCYLZLYJBJXTPNYLJYYNRXSYLMMNXJSMYBCSYSYLZYLXJJQYLDZLPQBFZZBLFNDXQKCZFYWHGQMRDSXYCYTXNQQJZYYPFZXDYZFPRXEJDGYQBXRCNFYYQPGHYJDYZXGRHTKYLNWDZNTSMPKLBTHBPYSZBZTJZSZZJTYYXZPHSSZZBZCZPTQFZMYFLYPYBBJQXZMXXDJMTSYSKKBJZXHJCKLPSMKYJZCXTMLJYXRZZQSLXXQPYZXMKYXXXJCLJPRMYYGADYSKQLSNDHYZKQXZYZTCGHZTLMLWZYBWSYCTBHJHJFCWZTXWYTKZLXQSHLYJZJXTMPLPYCGLTBZZTLZJCYJGDTCLKLPLLQPJMZPAPXYZLKKTKDZCZZBNZDYDYQZJYJGMCTXLTGXSZLMLHBGLKFWNWZHDXUHLFMKYSLGXDTWWFRJEJZTZHYDXYKSHWFZCQSHKTMQQHTZHYMJDJSKHXZJZBZZXYMPAGQMSTPXLSKLZYNWRTSQLSZBPSPSGZWYHTLKSSSWHZZLYYTNXJGMJSZSUFWNLSOZTXGXLSAMMLBWLDSZYLAKQCQCTMYCFJBSLXCLZZCLXXKSBZQCLHJPSQPLSXXCKSLNHPSFQQYTXYJZLQLDXZQJZDYYDJNZPTUZDSKJFSLJHYLZSQZLBTXYDGTQFDBYAZXDZHZJNHHQBYKNXJJQCZMLLJZKSPLDYCLBBLXKLELXJLBQYCXJXGCNLCQPLZLZYJTZLJGYZDZPLTQCSXFDMNYCXGBTJDCZNBGBQYQJWGKFHTNPYQZQGBKPBBYZMTJDYTBLSQMPSXTBNPDXKLEMYYCJYNZCTLDYKZZXDDXHQSHDGMZSJYCCTAYRZLPYLTLKXSLZCGGEXCLFXLKJRTLQJAQZNCMBYDKKCXGLCZJZXJHPTDJJMZQYKQSECQZDSHHADMLZFMMZBGNTJNNLGBYJBRBTMLBYJDZXLCJLPLDLPCQDHLXZLYCBLCXZZJADJLNZMMSSSMYBHBSQKBHRSXXJMXSDZNZPXLGBRHWGGFCXGMSKLLTSJYYCQLTSKYWYYHYWXBXQYWPYWYKQLSQPTNTKHQCWDQKTWPXXHCPTHTWUMSSYHBWCRWXHJMKMZNGWTMLKFGHKJYLSYYCXWHYECLQHKQHTTQKHFZLDXQWYZYYDESBPKYRZPJFYYZJCEQDZZDLATZBBFJLLCXDLMJSSXEGYGSJQXCWBXSSZPDYZCXDNYXPPZYDLYJCZPLTXLSXYZYRXCYYYDYLWWNZSAHJSYQYHGYWWAXTJZDAXYSRLTDPSSYYFNEJDXYZHLXLLLZQZSJNYQYQQXYJGHZGZCYJCHZLYCDSHWSHJZYJXCLLNXZJJYYXNFXMWFPYLCYLLABWDDHWDXJMCXZTZPMLQZHSFHZYNZTLLDYWLSLXHYMMYLMBWWKYXYADTXYLLDJPYBPWUXJMWMLLSAFDLLYFLBHHHBQQLTZJCQJLDJTFFKMMMBYTHYGDCQRDDWRQJXNBYSNWZDBYYTBJHPYBYTTJXAAHGQDQTMYSTQXKBTZPKJLZRBEQQSSMJJBDJOTGTBXPGBKTLHQXJJJCTHXQDWJLWRFWQGWSHCKRYSWGFTGYGBXSDWDWRFHWYTJJXXXJYZYSLPYYYPAYXHYDQKXSHXYXGSKQHYWFDDDPPLCJLQQEEWXKSYYKDYPLTJTHKJLTCYYHHJTTPLTZZCDLTHQKZXQYSTEEYWYYZYXXYYSTTJKLLPZMCYHQGXYHSRMBXPLLNQYDQHXSXXWGDQBSHYLLPJJJTHYJKYPPTHYYKTYEZYENMDSHLCRPQFDGFXZPSFTLJXXJBSWYYSKSFLXLPPLBBBLBSFXFYZBSJSSYLPBBFFFFSSCJDSTZSXZRYYSYFFSYZYZBJTBCTSBSDHRTJJBYTCXYJEYLXCBNEBJDSYXYKGSJZBXBYTFZWGENYHHTHZHHXFWGCSTBGXKLSXYWMTMBYXJSTZSCDYQRCYTWXZFHMYMCXLZNSDJTTTXRYCFYJSBSDYERXJLJXBBDEYNJGHXGCKGSCYMBLXJMSZNSKGXFBNBPTHFJAAFXYXFPXMYPQDTZCXZZPXRSYWZDLYBBKTYQPQJPZYPZJZNJPZJLZZFYSBTTSLMPTZRTDXQSJEHBZYLZDHLJSQMLHTXTJECXSLZZSPKTLZKQQYFSYGYWPCPQFHQHYTQXZKRSGTTSQCZLPTXCDYYZXSQZSLXLZMYCPCQBZYXHBSXLZDLTCDXTYLZJYYZPZYZLTXJSJXHLPMYTXCQRBLZSSFJZZTNJYTXMYJHLHPPLCYXQJQQKZZSCPZKSWALQSBLCCZJSXGWWWYGYKTJBBZTDKHXHKGTGPBKQYSLPXPJCKBMLLXDZSTBKLGGQKQLSBKKTFXRMDKBFTPZFRTBBRFERQGXYJPZSSTLBZTPSZQZSJDHLJQLZBPMSMMSXLQQNHKNBLRDDNXXDHDDJCYYGYLXGZLXSYGMQQGKHBPMXYXLYTQWLWGCPBMQXCYZYDRJBHTDJYHQSHTMJSBYPLWHLZFFNYPMHXXHPLTBQPFBJWQDBYGPNZTPFZJGSDDTQSHZEAWZZYLLTYYBWJKXXGHLFKXDJTMSZSQYNZGGSWQSPHTLSSKMCLZXYSZQZXNCJDQGZDLFNYKLJCJLLZLMZZNHYDSSHTHZZLZZBBHQZWWYCRZHLYQQJBEYFXXXWHSRXWQHWPSLMSSKZTTYGYQQWRSLALHMJTQJSMXQBJJZJXZYZKXBYQXBJXSHZTSFJLXMXZXFGHKZSZGGYLCLSARJYHSLLLMZXELGLXYDJYTLFBHBPNLYZFBBHPTGJKWETZHKJJXZXXGLLJLSTGSHJJYQLQZFKCGNNDJSSZFDBCTWWSEQFHQJBSAQTGYPQLBXBMMYWXGSLZHGLZGQYFLZBYFZJFRYSFMBYZHQGFWZSYFYJJPHZBYYZFFWODGRLMFTWLBZGYCQXCDJYGZYYYYTYTYDWEGAZYHXJLZYYHLRMGRXXZCLHNELJJTJTPWJYBJJBXJJTJTEEKHWSLJPLPSFYZPQQBDLQJJTYYQLYZKDKSQJYYQZLDQTGJQYZJSUCMRYQTHTEJMFCTYHYPKMHYZWJDQFHYYXWSHCTXRLJHQXHCCYYYJLTKTTYTMXGTCJTZAYYOCZLYLBSZYWJYTSJYHBYSHFJLYGJXXTMZYYLTXXYPZLXYJZYZYYPNHMYMDYYLBLHLSYYQQLLNJJYMSOYQBZGDLYXYLCQYXTSZEGXHZGLHWBLJHEYXTWQMAKBPQCGYSHHEGQCMWYYWLJYJHYYZLLJJYLHZYHMGSLJLJXCJJYCLYCJPCPZJZJMMYLCQLNQLJQJSXYJMLSZLJQLYCMMHCFMMFPQQMFYLQMCFFQMMMMHMZNFHHJGTTHHKHSLNCHHYQDXTMMQDCYZYXYQMYQYLTDCYYYZAZZCYMZYDLZFFFMMYCQZWZZMABTBYZTDMNZZGGDFTYPCGQYTTSSFFWFDTZQSSYSTWXJHXYTSXXYLBYQHWWKXHZXWZNNZZJZJJQJCCCHYYXBZXZCYZTLLCQXYNJYCYYCYNZZQYYYEWYCZDCJYCCHYJLBTZYYCQWMPWPYMLGKDLDLGKQQBGYCHJXY",b={ 19969:"DZ",19975:"WM",19988:"QJ",20048:"YL",20056:"SC",20060:"NM",20094:"QG",20127:"QJ",20167:"QC",20193:"YG",20250:"KH",20256:"ZC",20282:"SC",20285:"QJG",20291:"TD",20314:"YD",20340:"NE",20375:"TD",20389:"YJ",20391:"CZ",20415:"PB",20446:"YS",20447:"SQ",20504:"TC",20608:"KG",20854:"QJ",20857:"ZC",20911:"PF",20504:"TC",20608:"KG",20854:"QJ",20857:"ZC",20911:"PF",20985:"AW",21032:"PB",21048:"XQ",21049:"SC",21089:"YS",21119:"JC",21242:"SB",21273:"SC",21305:"YP",21306:"QO",21330:"ZC",21333:"SDC",21345:"QK",21378:"CA",21397:"SC",21414:"XS",21442:"SC",21477:"JG",21480:"TD",21484:"ZS",21494:"YX",21505:"YX",21512:"HG",21523:"XH",21537:"PB",21542:"PF",21549:"KH",21571:"E",21574:"DA",21588:"TD",21589:"O",21618:"ZC",21621:"KHA",21632:"ZJ",21654:"KG",21679:"LKG",21683:"KH",21710:"A",21719:"YH",21734:"WOE",21769:"A",21780:"WN",21804:"XH",21834:"A",21899:"ZD",21903:"RN",21908:"WO",21939:"ZC",21956:"SA",21964:"YA",21970:"TD",22003:"A",22031:"JG",22040:"XS",22060:"ZC",22066:"ZC",22079:"MH",22129:"XJ",22179:"XA",22237:"NJ",22244:"TD",22280:"JQ",22300:"YH",22313:"XW",22331:"YQ",22343:"YJ",22351:"PH",22395:"DC",22412:"TD",22484:"PB",22500:"PB",22534:"ZD",22549:"DH",22561:"PB",22612:"TD",22771:"KQ",22831:"HB",22841:"JG",22855:"QJ",22865:"XQ",23013:"ML",23081:"WM",23487:"SX",23558:"QJ",23561:"YW",23586:"YW",23614:"YW",23615:"SN",23631:"PB",23646:"ZS",23663:"ZT",23673:"YG",23762:"TD",23769:"ZS",23780:"QJ",23884:"QK",24055:"XH",24113:"DC",24162:"ZC",24191:"GA",24273:"QJ",24324:"NL",24377:"TD",24378:"QJ",24439:"PF",24554:"ZS",24683:"TD",24694:"WE",24733:"LK",24925:"TN",25094:"ZG",25100:"XQ",25103:"XH",25153:"PB",25170:"PB",25179:"KG",25203:"PB",25240:"ZS",25282:"FB",25303:"NA",25324:"KG",25341:"ZY",25373:"WZ",25375:"XJ",25384:"A",25457:"A",25528:"SD",25530:"SC",25552:"TD",25774:"ZC",25874:"ZC",26044:"YW",26080:"WM",26292:"PB",26333:"PB",26355:"ZY",26366:"CZ",26397:"ZC",26399:"QJ",26415:"ZS",26451:"SB",26526:"ZC",26552:"JG",26561:"TD",26588:"JG",26597:"CZ",26629:"ZS",26638:"YL",26646:"XQ",26653:"KG",26657:"XJ",26727:"HG",26894:"ZC",26937:"ZS",26946:"ZC",26999:"KJ",27099:"KJ",27449:"YQ",27481:"XS",27542:"ZS",27663:"ZS",27748:"TS",27784:"SC",27788:"ZD",27795:"TD",27812:"O",27850:"PB",27852:"MB",27895:"SL",27898:"PL",27973:"QJ",27981:"KH",27986:"HX",27994:"XJ",28044:"YC",28065:"WG",28177:"SM",28267:"QJ",28291:"KH",28337:"ZQ",28463:"TL",28548:"DC",28601:"TD",28689:"PB",28805:"JG",28820:"QG",28846:"PB",28952:"TD",28975:"ZC",29100:"A",29325:"QJ",29575:"SL",29602:"FB",30010:"TD",30044:"CX",30058:"PF",30091:"YSP",30111:"YN",30229:"XJ",30427:"SC",30465:"SX",30631:"YQ",30655:"QJ",30684:"QJG",30707:"SD",30729:"XH",30796:"LG",30917:"PB",31074:"NM",31085:"JZ",31109:"SC",31181:"ZC",31192:"MLB",31293:"JQ",31400:"YX",31584:"YJ",31896:"ZN",31909:"ZY",31995:"XJ",32321:"PF",32327:"ZY",32418:"HG",32420:"XQ",32421:"HG",32438:"LG",32473:"GJ",32488:"TD",32521:"QJ",32527:"PB",32562:"ZSQ",32564:"JZ",32735:"ZD",32793:"PB",33071:"PF",33098:"XL",33100:"YA",33152:"PB",33261:"CX",33324:"BP",33333:"TD",33406:"YA",33426:"WM",33432:"PB",33445:"JG",33486:"ZN",33493:"TS",33507:"QJ",33540:"QJ",33544:"ZC",33564:"XQ",33617:"YT",33632:"QJ",33636:"XH",33637:"YX",33694:"WG",33705:"PF",33728:"YW",33882:"SR",34067:"WM",34074:"YW",34121:"QJ",34255:"ZC",34259:"XL",34425:"JH",34430:"XH",34485:"KH",34503:"YS",34532:"HG",34552:"XS",34558:"YE",34593:"ZL",34660:"YQ",34892:"XH",34928:"SC",34999:"QJ",35048:"PB",35059:"SC",35098:"ZC",35203:"TQ",35265:"JX",35299:"JX",35782:"SZ",35828:"YS",35830:"E",35843:"TD",35895:"YG",35977:"MH",36158:"JG",36228:"QJ",36426:"XQ",36466:"DC",36710:"JC",36711:"ZYG",36767:"PB",36866:"SK",36951:"YW",37034:"YX",37063:"XH",37218:"ZC",37325:"ZC",38063:"PB",38079:"TD",38085:"QY",38107:"DC",38116:"TD",38123:"YD",38224:"HG",38241:"XTC",38271:"ZC",38415:"YE",38426:"KH",38461:"YD",38463:"AE",38466:"PB",38477:"XJ",38518:"YT",38551:"WK",38585:"ZC",38704:"XS",38739:"LJ",38761:"GJ",38808:"SQ",39048:"JG",39049:"XJ",39052:"HG",39076:"CZ",39271:"XT",39534:"TD",39552:"TD",39584:"PB",39647:"SB",39730:"LG",39748:"TPB",40109:"ZQ",40479:"ND",40516:"HG",40536:"HG",40583:"QJ",40765:"YQ",40784:"QJ",40840:"YK",40863:"QJG"},c=function(c){var d=c.charCodeAt(0);return d>40869||d<19968?c:b[d]?b[d]:a.charAt(d-19968)},d=function(a){for(var b,c=[""],d=0,e=a.length;d div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',b=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.type="text/css",d.styleSheet?d.styleSheet.cssText=a:d.appendChild(document.createTextNode(a)),b.appendChild(d),c=!0}},v=function(a,c){b?(a.__resizeTriggers__||("static"===getComputedStyle(a).position&&(a.style.position="relative"),u(),a.__resizeLast__={},a.__resizeListeners__=[],(a.__resizeTriggers__=document.createElement("div")).className="resize-triggers",a.__resizeTriggers__.innerHTML='
',a.appendChild(a.__resizeTriggers__),f(a),a.addEventListener("scroll",h,!0),l&&a.__resizeTriggers__.addEventListener(l,function(b){b.animationName===r&&f(a)})),a.__resizeListeners__.push(c)):a.attachEvent("onresize",c)},w=function(a,c){b?(a.__resizeListeners__.splice(a.__resizeListeners__.indexOf(c),1),a.__resizeListeners__.length||(a.removeEventListener("scroll",h,!0),a.__resizeTriggers__=!a.removeChild(a.__resizeTriggers__))):a.detachEvent("onresize",c)};BI.ResizeDetector={addResizeListener:function(a,b){return v(a.element[0],b),function(){w(a.element[0],b)}},removeResizeListener:function(a,b){w(a.element[0],b)}}}(),function(){function a(a,b){return a0&&(this._items[0]=b,this._sinkDown(0)),a}},push:function(a){this._items[this._size++]=a,this._bubbleUp(this._size-1)},size:function(){return this._size},peek:function(){if(0!==this._size)return this._items[0]},_heapify:function(){for(var a=Math.floor((this._size+1)/2);a>=0;a--)this._sinkDown(a)},_bubbleUp:function(a){for(var b=this._items[a];a>0;){var c=Math.floor((a+1)/2)-1,d=this._items[c];if(this._comparator(d,b))return;this._items[c]=b,this._items[a]=d,a=c}},_sinkDown:function(a){for(var b=this._items[a];;){var c=2*(a+1)-1,d=2*(a+1),e=-1;if(cc?c:b},b=5,c={index:0,offset:0,position:0,contentHeight:0};BI.TableScrollHelper=function(a,b,c,d){this._rowOffsets=BI.PrefixIntervalTree.uniform(a,b),this._storedHeights=new Array(a);for(var e=0;e=0&&c>=a-b;){var d=this._updateRowHeight(c);this._position+=d,c--}},_updateRowHeight:function(a){if(a<0||a>=this._rowCount)return 0;var b=this._rowHeightGetter(a);if(b!==this._storedHeights[a]){var c=b-this._storedHeights[a];return this._rowOffsets.set(a,b),this._storedHeights[a]=b,this._contentHeight+=c,c}return 0},getRowPosition:function(a){return this._updateRowHeight(a),this._rowOffsets.sumUntil(a)},scrollBy:function(b){if(0===this._rowCount)return c;var d=this._rowOffsets.greatestLowerBound(this._position);d=a(d,0,Math.max(this._rowCount-1,0));var e=this._rowOffsets.sumUntil(d),f=d,g=this._position,h=this._updateRowHeight(f);0!==e&&(g+=h);var i=this._storedHeights[f]-(g-e);if(b>=0)for(;b>0&&f0&&f>=0;)if(b=0){var k=this._updateRowHeight(f);j=this._storedHeights[f],g+=k}}var l=this._contentHeight-this._viewportHeight;g=a(g,0,l),this._position=g;var m=this._rowOffsets.greatestLowerBound(g);m=a(m,0,Math.max(this._rowCount-1,0)),e=this._rowOffsets.sumUntil(m);var n=e-g;return this._updateHeightsInViewport(m,n),this._updateHeightsAboveViewport(m),{index:m,offset:n,position:this._position,contentHeight:this._contentHeight}},_getRowAtEndPosition:function(a){this._updateRowHeight(a);for(var b=a,c=this._storedHeights[b];c=0;)b--,b>=0&&(this._updateRowHeight(b),c+=this._storedHeights[b]);var d=this._rowOffsets.sumTo(a)-this._viewportHeight;return d<0&&(d=0),d},scrollTo:function(b){if(0===this._rowCount)return c;if(b<=0)return this._position=0,this._updateHeightsInViewport(0,0),{index:0,offset:0,position:this._position,contentHeight:this._contentHeight};if(b>=this._contentHeight-this._viewportHeight){var d=this._rowCount-1;b=this._getRowAtEndPosition(d)}this._position=b;var e=this._rowOffsets.greatestLowerBound(b);e=a(e,0,Math.max(this._rowCount-1,0));var f=this._rowOffsets.sumUntil(e),g=f-b;return this._updateHeightsInViewport(e,g),this._updateHeightsAboveViewport(e),{index:e,offset:g,position:this._position,contentHeight:this._contentHeight}},scrollToRow:function(b,c){b=a(b,0,Math.max(this._rowCount-1,0)),c=a(c,-this._storedHeights[b],0);var d=this._rowOffsets.sumUntil(b);return this.scrollTo(d-c)},scrollRowIntoView:function(b){b=a(b,0,Math.max(this._rowCount-1,0));var c=this._rowOffsets.sumUntil(b),d=c+this._storedHeights[b];if(c=a&&e<=b)return null;var f;a-d>e-b?(f=d,this._smallValues.pop()):(f=e,this._largeValues.pop());var g=this._valueToPositionMap[f];return delete this._valueToPositionMap[f],this._valueToPositionMap[c]=g,this._pushToHeaps(g,c),g},_pushToHeaps:function(a,b){var c={position:a,value:b};this._smallValues.push(c),this._largeValues.push(c)},_cleanHeaps:function(){this._cleanHeap(this._smallValues),this._cleanHeap(this._largeValues);var a=Math.min(this._smallValues.size(),this._largeValues.size()),b=Math.max(this._smallValues.size(),this._largeValues.size());b>10*a&&this._recreateHeaps()},_recreateHeaps:function(){for(var a=this._smallValues.size()b.value}},!function(){BI.LinkHashMap=function(){this.array=[],this.map={}},BI.LinkHashMap.prototype={constructor:BI.LinkHashMap,has:function(a){return a in this.map},add:function(a,b){"undefined"!=typeof a&&(a in this.map?this.map[a]=b:(this.array.push(a),this.map[a]=b))},remove:function(a){if(a in this.map){delete this.map[a];for(var b=0;b>5]|=128<>>9<<4)+14]=b;for(var c=1732584193,d=-271733879,e=-1732584194,f=271733878,g=0;g16&&(c=this.core_md5(c,a.length*this.chrsz));for(var d=Array(16),e=Array(16),f=0;f<16;f++)d[f]=909522486^c[f],e[f]=1549556828^c[f];var g=this.core_md5(d.concat(this.str2binl(b)),512+b.length*this.chrsz);return this.core_md5(e.concat(g),640)},a.prototype.safe_add=function(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c},a.prototype.bit_rol=function(a,b){return a<>>32-b},a.prototype.str2binl=function(a){for(var b=Array(),c=(1<>5]|=(a.charCodeAt(d/this.chrsz)&c)<>2]>>d%4*8+4&15)+b.charAt(a[d>>2]>>d%4*8&15);return c},a.prototype.binl2b64=function(a){for(var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c="",d=0;d<4*a.length;d+=3)for(var e=(a[d>>2]>>8*(d%4)&255)<<16|(a[d+1>>2]>>8*((d+1)%4)&255)<<8|a[d+2>>2]>>8*((d+2)%4)&255,f=0;f<4;f++)c+=8*d+6*f>32*a.length?this.b64pad:b.charAt(e>>6*(3-f)&63);return c},BI.MD5=new a}(),function(){var a=function(a){return Math.floor(a/2)},b=window.Int32Array||function(a){for(var b=[],c=a-1;c>=0;--c)b[c]=0;return b},c=function(a){for(var b=1;b0;--d)this._heap[d]=this._heap[2*d]+this._heap[2*d+1]},BI.PrefixIntervalTree.prototype={constructor:BI.PrefixIntervalTree,set:function(b,c){var d=this._half+b;for(this._heap[d]=c,d=a(d);0!==d;d=a(d))this._heap[d]=this._heap[2*d]+this._heap[2*d+1]},get:function(a){var b=this._half+a;return this._heap[b]},getSize:function(){return this._size},sumUntil:function(b){if(0===b)return 0;for(var c=this._half+b-1,d=this._heap[c];1!==c;c=a(c))c%2===1&&(d+=this._heap[c-1]);return d},sumTo:function(a){return this.sumUntil(a+1)},sum:function(a,b){return this.sumUntil(b)-this.sumUntil(a)},greatestLowerBound:function(a){if(a<0)return-1;var b=1;if(this._heap[b]<=a)return this._size;for(;b=0;--d)c[d]=b;return new BI.PrefixIntervalTree(c)},BI.PrefixIntervalTree.empty=function(a){return BI.PrefixIntervalTree.uniform(a,0)}}(),!function(){BI.Queue=function(a){this.capacity=a,this.array=[]},BI.Queue.prototype={constructor:BI.Queue,contains:function(a){return this.array.contains(a)},indexOf:function(a){return this.array.contains(a)},getElementByIndex:function(a){return this.array[a]},push:function(a){this.array.push(a),this.capacity&&this.array.length>this.capacity&&this.array.shift()},pop:function(){this.array.pop()},shift:function(){this.array.shift()},unshift:function(a){this.array.unshift(a),this.capacity&&this.array.length>this.capacity&&this.array.pop()},remove:function(a){this.array.remove(a)},splice:function(){this.array.splice.apply(this.array,arguments)},slice:function(){this.array.slice.apply(this.array,arguments)},size:function(){return this.array.length},each:function(a,b){var b=b||window,a=a||null;if(null!=a&&"function"==typeof a)for(var c=0;cc?c:a},b=6,c=10;BI.TableRowBuffer=function(d,e,f,g){this._bufferSet=new BI.IntegerBufferSet,this._defaultRowHeight=e,this._viewportRowsBegin=0,this._viewportRowsEnd=0,this._maxVisibleRowCount=Math.ceil(f/e)+1,this._bufferRowsCount=a(Math.floor(this._maxVisibleRowCount/2),b,c),this._rowsCount=d,this._rowHeightGetter=g,this._rows=[],this._viewportHeight=f},BI.TableRowBuffer.prototype={constructor:BI.TableRowBuffer,getRowsWithUpdatedBuffer:function(){for(var a=2*this._bufferRowsCount,b=Math.max(this._viewportRowsBegin-this._bufferRowsCount,0);b0;)this._addRowToBuffer(b,this._viewportRowsBegin,this._viewportRowsEnd-1),b++,a--;return this._rows},getRows:function(a,b){var c=b,d=c,e=a,f=Math.min(a+this._maxVisibleRowCount,this._rowsCount);for(this._viewportRowsBegin=a;e=f&&(d=this._bufferSet.replaceFurthestValuePosition(b,c,a)),null===d?(d=this._bufferSet.getNewPositionForValue(a),this._rows[d]=a):this._rows[d]=a}}}(),function(){BI.Tree=function(){this.root=new BI.Node(BI.UUID())},BI.Tree.prototype={constructor:BI.Tree,addNode:function(a,b,c){BI.isNull(b)?this.root.addChild(a,c):BI.isNull(a)?this.root.addChild(b,c):a.addChild(b,c)},isRoot:function(a){return a===this.root},getRoot:function(){return this.root},clear:function(){this.root.clear()},initTree:function(a){var b=this;this.clear();var c=[];for(BI.each(a,function(a,d){var e=new BI.Node(d);e.set("data",d),b.addNode(e),c.push(e)});!BI.isEmpty(c);){var d=c.shift(),e=d.get("data");BI.each(e.children,function(a,e){var f=new BI.Node(e);f.set("data",e),c.push(f),b.addNode(d,f)})}},_toJSON:function(a){var b=this,c=[];return BI.each(a.getChildren(),function(a,d){c.push(b._toJSON(d))}),BI.extend({id:a.id},BI.deepClone(a.get("data")),c.length>0?{children:c}:{})},toJSON:function(a){var b=this,c=[];return BI.each((a||this.root).getChildren(),function(a,d){c.push(b._toJSON(d))}),c},_toJSONWithNode:function(a){var b=this,c=[];return BI.each(a.getChildren(),function(a,d){c.push(b._toJSONWithNode(d))}),BI.extend({id:a.id},BI.deepClone(a.get("data")),{node:a},c.length>0?{children:c}:{})},toJSONWithNode:function(a){var b=this,c=[];return BI.each((a||this.root).getChildren(),function(a,d){c.push(b._toJSONWithNode(d))}),c},search:function(a,b,c){if(!(a instanceof BI.Node))return arguments.callee.apply(this,[this.root,a,b]);var d=this,e=null;return BI.isNull(b)?null:BI.isEqual(a[c||"id"],b)?a:(BI.any(a.getChildren(),function(a,f){if(e=d.search(f,b,c),null!==e)return!0}),e)},_traverse:function(a,b){var c=[];for(c.push(a);!BI.isEmpty(c);){var d=c.shift(),e=b&&b(d);if(e===!1)break;e!==!0&&null!=d&&(c=c.concat(d.getChildren()))}},traverse:function(a){this._traverse(this.root,a)},_recursion:function(a,b,c){var d=this;return BI.every(a.getChildren(),function(a,e){var f=BI.clone(b);f.push(e.id);var g=c&&c(e,f);return g!==!1&&(g===!0||d._recursion(e,f,c))})},recursion:function(a){this._recursion(this.root,[],a)},inOrderTraverse:function(a){this._inOrderTraverse(this.root,a)},_inOrderTraverse:function(a,b){null!=a&&(this._inOrderTraverse(a.getLeft()),b&&b(a),this._inOrderTraverse(a.getRight()))},nrInOrderTraverse:function(a){for(var b=[],c=this.root;null!=c||!BI.isEmpty(b);){for(;null!=c;)b.push(c),c=c.getLeft();c=b.pop(),a&&a(c),c=c.getRight()}},preOrderTraverse:function(a){this._preOrderTraverse(this.root,a)},_preOrderTraverse:function(a,b){null!=a&&(b&&b(a),this._preOrderTraverse(a.getLeft()),this._preOrderTraverse(a.getRight()))},nrPreOrderTraverse:function(a){for(var b=[],c=this.root;null!=c||!BI.isEmpty(b);){for(;null!=c;)a&&a(c),b.push(c),c=c.getLeft();c=b.pop(),c=c.getRight()}},postOrderTraverse:function(a){this._postOrderTraverse(this.root,a)},_postOrderTraverse:function(a,b){null!=a&&(this._postOrderTraverse(a.getLeft()),this._postOrderTraverse(a.getRight()),b&&b(a))},nrPostOrderTraverse:function(a){for(var b=[],c=this.root,d=null;null!=c||!BI.isEmpty(b);){for(;null!=c;)b.push(c),c=c.getLeft();c=BI.last(b),null==c.getRight()||c.getRight()==d?(a&&a(c),c=b.pop(),d=c,c=null):c=c.getRight()}}},BI.Node=function(a){BI.isObject(a)?BI.extend(this,a):this.id=a,this.clear.apply(this,arguments)},BI.Node.prototype={constructor:BI.Node,set:function(a,b){return BI.isObject(a)?void BI.extend(this,a):void(this[a]=b)},get:function(a){return this[a]},isLeaf:function(){return BI.isEmpty(this.children)},getChildren:function(){return this.children},getChildrenLength:function(){return this.children.length},getFirstChild:function(){return BI.first(this.children)},getLastChild:function(){return BI.last(this.children)},setLeft:function(a){this.left=a},getLeft:function(){return this.left},setRight:function(a){this.right=a},getRight:function(){return this.right},setParent:function(a){this.parent=a},getParent:function(){return this.parent},getChild:function(a){return this.children[a]},getChildIndex:function(a){return BI.findIndex(this.children,function(b,c){return c.get("id")===a})},removeChild:function(a){this.removeChildByIndex(this.getChildIndex(a))},removeChildByIndex:function(a){var b=this.getChild(a-1),c=this.getChild(a+1); -null!=b&&b.setRight(c||null),null!=c&&c.setLeft(b||null),this.children.splice(a,1)},removeAllChilds:function(){this.children=[]},addChild:function(a,b){var c=null;c=BI.isUndefined(b)?this.children.length-1:b-1,a.setParent(this),c>=0&&(this.getChild(c)&&this.getChild(c).setRight(a),a.setLeft(this.getChild(c))),BI.isUndefined(b)?this.children.push(a):this.children.splice(b,0,a)},equals:function(a){return this===a||this.id===a.id},clear:function(){this.parent=null,this.left=null,this.right=null,this.children=[]}},BI.extend(BI.Tree,{transformToArrayFormat:function(a,b){if(!a)return[];var c=[];if(BI.isArray(a))for(var d=0,e=a.length;d=this.x&&a<=this.x+this.w&&b>=this.y&&b<=this.y+this.h)},getPosition:function(){var a=[];return a.push(this.x+this.w/2),a.push(this.y+this.h/2),a}},BI.BehaviorFactory={createBehavior:function(a,b){var c;switch(a){case"highlight":c=BI.HighlightBehavior;break;case"redmark":c=BI.RedMarkBehavior}return new c(b)}},BI.Behavior=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.Behavior.superclass._defaultConfig.apply(this,arguments),{rule:function(){return!0}})},_init:function(){BI.Behavior.superclass._init.apply(this,arguments)},doBehavior:function(){}}),BI.Layout=BI.inherit(BI.Widget,{props:function(){return{scrollable:null,scrollx:!1,scrolly:!1,items:[]}},render:function(){this._init4Margin(),this._init4Scroll()},_init4Margin:function(){this.options.top&&this.element.css("top",this.options.top),this.options.left&&this.element.css("left",this.options.left),this.options.bottom&&this.element.css("bottom",this.options.bottom),this.options.right&&this.element.css("right",this.options.right)},_init4Scroll:function(){switch(this.options.scrollable){case!0:this.element.css("overflow","auto");break;case!1:this.element.css("overflow","hidden")}this.options.scrollx&&this.element.css({"overflow-x":"auto","overflow-y":"hidden"}),this.options.scrolly&&this.element.css({"overflow-x":"hidden","overflow-y":"auto"})},_mountChildren:function(){var a=this,b=document.createDocumentFragment(),c=!1;BI.each(this._children,function(d,e){e.element!==a.element&&(b.appendChild(e.element[0]),c=!0)}),c===!0&&this.element.append(b)},_getChildName:function(a){return a+""},_addElement:function(a,b){var c,d=this;return this.hasWidget(this._getChildName(a))?c=this.getWidgetByName(this._getChildName(a)):(c=BI.createWidget(b),c.on(BI.Events.DESTROY,function(){BI.each(d._children,function(a,b){b===c&&(BI.remove(d._children,b),d.removeItemAt(0|a))})}),this.addWidget(this._getChildName(a),c)),c},_getOptions:function(a){return a instanceof BI.Widget&&(a=a.options),a=BI.stripEL(a),a instanceof BI.Widget&&(a=a.options),a},_compare:function(a,b){function c(a,b,e,f){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;var g=Object.prototype.toString.call(a);switch(g){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var h="[object Array]"===g;if(!h){if(BI.isFunction(a)&&BI.isFunction(b))return!0;a=d._getOptions(a),b=d._getOptions(b)}e=e||[],f=f||[];for(var i=e.length;i--;)if(e[i]===a)return f[i]===b;if(e.push(a),f.push(b),h){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!c(a[i],b[i],e,f))return!1}else{var j,k=_.keys(a);if(i=k.length,_.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!_.has(b,j)||!c(a[j],b[j],e,f))return!1}return e.pop(),f.pop(),!0}var d=this;return c(a,b)},_getWrapper:function(){return this.element},_addItemAt:function(a,b){for(var c=this.options.items.length;c>a;c--)this._children[this._getChildName(c)]=this._children[this._getChildName(c-1)];delete this._children[this._getChildName(a)],this.options.items.splice(a,0,b)},_removeItemAt:function(a){for(var b=a;bthis.options.items.length)){this._addItemAt(a,b);var c=this._addElement(a,b);return a>0?this._children[this._getChildName(a-1)].element.after(c.element):c.element.prependTo(this._getWrapper()),c._mount(),c}},removeItemAt:function(a){a=BI.isArray(a)?a:[a];for(var b=[],c=[],d={},e=0,f=this.options.items.length;ethis.options.items.length-1)return!1;var c=this._children[this._getChildName(a)];return c.shouldUpdate?c.shouldUpdate(this._getOptions(b))===!0:null},updateItemAt:function(a,b){if(!(a<0||a>this.options.items.length-1)){var c,d=this._children[this._getChildName(a)];if(c=d.update(this._getOptions(b)))return c;var e=this._children[this._getChildName(a)];delete this._children[this._getChildName(a)],this.options.items.splice(a,1);var f=this._addElement(a,b);this.options.items.splice(a,0,b),this._children[this._getChildName(a)]=f,a>0?this._children[this._getChildName(a-1)].element.after(f.element):f.element.prependTo(this._getWrapper()),e._destroy(),f._mount()}},addItems:function(a){var b=this,c=this.options,d=document.createDocumentFragment(),e=[];BI.each(a,function(a,f){var g=b._addElement(c.items.length,f);b._children[b._getChildName(c.items.length)]=g,c.items.push(f),e.push(g),d.appendChild(g.element[0])}),this._getWrapper().append(d),BI.each(e,function(a,b){b._mount()})},prependItems:function(a){var b=this;a=a||[];for(var c=document.createDocumentFragment(),d=[],e=a.length-1;e>=0;e--){this._addItemAt(0,a[e]);var f=this._addElement(0,a[e]);b._children[b._getChildName(0)]=f,this.options.items.unshift(a[e]),d.push(f),c.appendChild(f.element[0])}this._getWrapper().prepend(c),BI.each(d,function(a,b){b._mount()})},getValue:function(){var a,b=this,c=[];return BI.each(this.options.items,function(d){if(a=b._children[b._getChildName(d)]){var e=a.getValue();e=BI.isArray(e)?e:[e],c=c.concat(e)}}),c},setValue:function(a){var b,c=this;BI.each(this.options.items,function(d){(b=c._children[c._getChildName(d)])&&b.setValue(a)})},setText:function(a){var b,c=this;BI.each(this.options.items,function(d){(b=c._children[c._getChildName(d)])&&b.setText(a)})},patchItem:function(a,b,c){var d=this.shouldUpdateItem(c,b);if(d===!0||null===d&&!this._compare(a,b))return this.updateItemAt(c,b)},updateChildren:function(a,b){function c(a,b,c,d){return a=j._getOptions(a),b=j._getOptions(b),BI.isKey(a.key)?a.key===b.key:c>=0?c===d:void 0}function d(a,b){var c=j._getOptions(a),d=null==c.key?b:c.key;return s[d]=j._addElement(d,a)}function e(a,b,c,e){for(;c<=e;++c){var f=d(b[c],c);g(f,a,!1,c)}}function f(a,b,c){for(;b<=c;++b){var d=j._getOptions(a[b]),e=null==d.key?b:d.key;s[e]._destroy()}}function g(a,b,c,d){a=j._getOptions(a),b=b&&j._getOptions(b);var e=BI.isKey(a.key)?a.key:d;if(b&&s[b.key]){var f,g=BI.isKey(b.key)?b.key:d;f=c?s[g].element.next():s[g].element,f.length>0?f.before(s[e].element):j._getWrapper().append(s[e].element)}else j._getWrapper().append(s[e].element)}var h,i,j=this,k=0,l=0,m=a.length-1,n=a[0],o=a[m],p=b.length-1,q=b[0],r=b[p],s={};for(BI.each(a,function(a,b){b=j._getOptions(b);var c=null==b.key?a:b.key;BI.isKey(c)&&(s[c]=j._children[j._getChildName(a)])});k<=m&&l<=p;)if(BI.isNull(n))n=a[++k];else if(BI.isNull(o))o=a[--m];else if(c(n,q,k,l))i=this.patchItem(n,q,k)||i,s[null==n.key?this._getChildName(k):n.key]=this._children[this._getChildName(k)],n=a[++k],q=b[++l];else if(c(o,r,m,p))i=this.patchItem(o,r,m)||i,s[null==o.key?this._getChildName(m):o.key]=this._children[this._getChildName(m)],o=a[--m],r=b[--p];else if(c(n,r))i=this.patchItem(n,r,k)||i,s[null==n.key?this._getChildName(k):n.key]=this._children[this._getChildName(k)],g(n,o,!0),n=a[++k],r=b[--p];else if(c(o,q))i=this.patchItem(o,q,m)||i,s[null==o.key?this._getChildName(m):o.key]=this._children[this._getChildName(m)],g(o,n),o=a[--m],q=b[++l];else{var t=d(q);g(t,n),q=b[++l]}return k>m?(h=BI.isNull(b[p+1])?null:b[p+1].elm,e(h,b,l,p)):l>p&&f(a,k,m),this._children={},BI.each(b,function(a,b){var c=j._getOptions(b),d=null==c.key?a:c.key;s[d]._mount(),j._children[j._getChildName(a)]=s[d]}),i},update:function(a){var b=this.options,c=a.items||[],d=this.updateChildren(b.items,c);return this.options.items=c,d},stroke:function(a){var b=this;BI.each(a,function(a,c){c&&b._addElement(a,c)})},removeWidget:function(a){var b;BI.isWidget(a)?BI.each(this._children,function(c,d){d===a&&(b=c)}):b=a,b&&this._removeItemAt(0|b)},empty:function(){BI.Layout.superclass.empty.apply(this,arguments),this.options.items=[]},destroy:function(){BI.Layout.superclass.destroy.apply(this,arguments),this.options.items=[]},populate:function(a){this.options;return a=a||[],this._isMounted?void this.update({items:a}):(this.options.items=a,void this.stroke(a))},resize:function(){}}),BI.shortcut("bi.layout",BI.Layout),BI.Action=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.Action.superclass._defaultConfig.apply(this,arguments),{src:null,tar:null})},_init:function(){BI.Action.superclass._init.apply(this,arguments)},actionPerformed:function(a,b,c){},actionBack:function(a,b,c){}}),BI.ActionFactory={createAction:function(a,b){var c;switch(a){case"show":c=BI.ShowAction}return new c(b)}},BI.ShowAction=BI.inherit(BI.Action,{_defaultConfig:function(){return BI.extend(BI.ShowAction.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ShowAction.superclass._init.apply(this,arguments)},actionPerformed:function(a,b,c){b=b||this.options.tar,b.setVisible(!0),c&&c()},actionBack:function(a,b,c){a=a||this.options.tar,a.setVisible(!1),c&&c()}}),BI.PopoverSection=BI.inherit(BI.Widget,{_init:function(){BI.PopoverSection.superclass._init.apply(this,arguments)},rebuildNorth:function(a){return!0},rebuildCenter:function(a){},rebuildSouth:function(a){return!1},close:function(){this.fireEvent(BI.PopoverSection.EVENT_CLOSE)},end:function(){}}),BI.PopoverSection.EVENT_CLOSE="EVENT_CLOSE",function(){function a(a){var b=""===a||null===a||void 0===a;return b}function b(a){return"Invalid Date"==a||"NaN"==a}function c(a,b){var c=b.indexOf("E"),d=b.substr(0,c),e=b.substr(c+1);if(/^[0\.-]+$/.test(a))a=BI._numberFormat(0,d)+"E"+BI._numberFormat(0,e);else{var f=a<0;f&&(a=a.substr(1));var g=(d.split(".")[0]||"").length,h=a.indexOf(".");h<0&&(h=a.length);var i=0;a=a.replace(".","");for(var j=a.length;i="1")break}var l=h-i-g,m=a.substr(i,g),n=i+g-a.length;if(n>0)for(var o=0;o-1)return a>=0?d(a+"",b.substring(0,c)):d(-a+"",b.substr(c+1));if(+a<0&&"-"!==b.charAt(0))return d(-a+"","-"+b);var g=a.split("."),h=b.split("."),i=g[0]||"",j=h[0]||"",k=g[1]||"",l=h[1]||"";if(/[%‰]$/.test(b)){var m=/[%]$/.test(b)?"00":"000";k+=m,i+=k.substr(0,m.length),i=i.replace(/^0+/gi,""),k=k.substr(m.length).replace(/0+$/gi,"")}var n=e(k,l);n.leftPlus&&(i=parseInt(i)+1+"",i=isNaN(i)?"1":i),n=n.num;var o=f(i,j);return/[0-9]/.test(o)||(o+="0"),/[0-9]/.test(n)?o+"."+n:o+n}function e(b,c){for(var d="",e=0,f=0,g=c.length;f4){k.leftPlus=!0;var l=d.match(/^[0-9]+/);if(l){var m=l[0],n=m.length,o=parseInt(m)+1+"";o.length>n?o=o.substr(1):(o=String.leftPad(o,n,"0"),k.leftPlus=!1),d=d.replace(/^[0-9]+/,o)}}return k.num=d,k}function f(b,c){for(var d="",e=b.length-1,f=-1,g=-1,h=c.length-1;h>=0;h--){var i=c.charAt(h),j=b.charAt(e);switch(i){case"0":a(j)&&(j="0"),g=-1,d=j+d,e--;break;case"#":g=h,d=j+d,e--;break;case",":if(!a(j)){var k=c.match(/,[#0]+/);k&&(f=k[0].length-1),d=","+d}break;default:d=i+d}}if(g>-1){var l=b.substr(0,e+1);d=d.substr(0,g)+l+d.substr(g)}if(f>0){var m=d.match(/[0-9]+,/);if(m){m=m[0];for(var n="",o=m.length-1-f;o>=0;o-=f)n=m.substr(o,f)+","+n;var p=m.substr(0,o+f);a(p)||(n=p+","+n)}d=d.replace(/[0-9]+,/,n)}return d}window.BI||(window.BI={}),BI.cjkEncode=function(a){if("string"!=typeof a)return a;for(var b="",c=0;c=128||91===d||93===d?"["+d.toString(16)+"]":a.charAt(c)}return b},BI.cjkEncodeDO=function(a){if(BI.isPlainObject(a)){var b={};return $.each(a,function(a,c){"string"!=typeof c&&(c=BI.jsonEncode(c)),a=BI.cjkEncode(a),b[a]=BI.cjkEncode(c)}),b}return a},BI.jsonEncode=function(a){var b=!!{}.hasOwnProperty,c={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},d=function(a){return/["\\\x00-\x1f]/.test(a)?'"'+a.replace(/([\x00-\x1f\\"])/g,function(a,b){var d=c[b];return d?d:(d=b.charCodeAt(),"\\u00"+Math.floor(d/16).toString(16)+(d%16).toString(16))})+'"':'"'+a+'"'},e=function(a){var b,c,d,e=["["],f=a.length;for(c=0;c2?Date._MN[b.getMonth()]:d<2?b.getMonth()+1:String.leftPad(b.getMonth()+1+"",2,"0");break;case"d":c=d>1?String.leftPad(b.getDate()+"",2,"0"):b.getDate();break;case"h":var f=b.getHours()%12;0===f&&(f=12),c=d>1?String.leftPad(f+"",2,"0"):f;break;case"H":c=d>1?String.leftPad(b.getHours()+"",2,"0"):b.getHours();break;case"m":c=d>1?String.leftPad(b.getMinutes()+"",2,"0"):b.getMinutes();break;case"s":c=d>1?String.leftPad(b.getSeconds()+"",2,"0"):b.getSeconds();break;case"a":c=b.getHours()<12?"am":"pm";break;case"z":c=b.getTimezone();break;default:c=a.str}return c}if(!a)return"";var d=b.length,e="";if(d>0){for(var f=b.charAt(0),g=0,h=f,i=1;i$("body").outerWidth()&&(l-=k.element.outerWidth()),m+k.element.outerHeight()>$("body").outerHeight()?(m-=k.element.outerHeight()+15,j=h.top-k.element.outerHeight()-5,!f.belowMouse&&(m=Math.min(m,j))):!f.belowMouse&&(m=Math.max(m,j)),k.element.css({left:l<0?0:l+"px",top:m<0?0:m+"px"}),k.element.hover(function(){g.remove(b),e.element.trigger("mouseleave.title"+e.getName())}),this},add:function(a,b){return this.has(a)?this:(this.set(a,b),this)},get:function(a){return this.tooltipsManager[a]; -},set:function(a,b){this.tooltipsManager[a]=b},has:function(a){return null!=this.tooltipsManager[a]},remove:function(a){return this.has(a)?(this.tooltipsManager[a].destroy(),delete this.tooltipsManager[a],this):this}}),_.extend(BI,{Events:{KEYDOWN:"_KEYDOWN",BACKSPACE:"_BACKSPACE",SPACE:"_SPACE",ENTER:"_ENTER",CONFIRM:"_CONFIRM",ERROR:"_ERROR",PAUSE:"_PAUSE",DESTROY:"_DESTROY",UNMOUNT:"_UNMOUNT",CLEAR:"_CLEAR",ADD:"_ADD",EDITING:"_EDITING",EMPTY:"_EMPTY",VIEW:"_VIEW",RESIZE:"_RESIZE",BEFOREEDIT:"_BEFOREEDIT",AFTEREDIT:"_AFTEREDIT",STARTEDIT:"_STARTEDIT",STOPEDIT:"_STOPEDIT",CHANGE:"_CHANGE",EXPAND:"_EXPAND",COLLAPSE:"_COLLAPSE",CALLBACK:"_CALLBACK",CLICK:"_CLICK",STATECHANGE:"_STATECHANGE",BEFORESTATECHANGE:"_BEFORESTATECHANGE",INIT:"_INIT",AFTERINIT:"_AFTERINIT",SCROLL:"_SCROLL",STARTLOAD:"_STARTLOAD",AFTERLOAD:"_AFTERLOAD",BS:"beforesubmit",AS:"aftersubmit",SC:"submitcomplete",SF:"submitfailure",SS:"submitsuccess",BVW:"beforeverifywrite",AVW:"afterverifywrite",AV:"afterverify",BW:"beforewrite",AW:"afterwrite",WS:"writesuccess",WF:"writefailure",BA:"beforeappend",AA:"afterappend",BD:"beforedelete",AD:"beforedelete",UC:"unloadcheck",BTOPDF:"beforetopdf",ATOPDF:"aftertopdf",BTOEXCEL:"beforetoexcel",ATOEXCEL:"aftertoexcel",BTOWORD:"beforetoword",ATOWORD:"aftertoword",BTOIMAGE:"beforetoimage",ATOIMAGE:"aftertoimage",BTOHTML:"beforetohtml",ATOHTML:"aftertohtml",BIMEXCEL:"beforeimportexcel",AIMEXCEL:"afterimportexcel",BPDFPRINT:"beforepdfprint",APDFPRINT:"afterpdfprint",BFLASHPRINT:"beforeflashprint",AFLASHPRINT:"afterflashprint",BAPPLETPRINT:"beforeappletprint",AAPPLETPRINT:"afterappletprint",BSEVERPRINT:"beforeserverprint",ASERVERPRINT:"afterserverprint",BEMAIL:"beforeemail",AEMAIL:"afteremail"}}),BI.extend(jQuery.fn,{destroy:function(){this.remove(),BI.isIE()===!0&&(this[0].outerHTML="")},__textKeywordMarked__:function(a,b,c){if(!BI.isKey(b)||(a+"").length>100)return this.text((a+"").replaceAll(" "," "));b+="",b=BI.toUpperCase(b);var d=(a||"")+"";for(c=(c||BI.makeFirstPY(a))+"",null!=c&&(c=BI.toUpperCase(c)),this.empty();;){var e=BI.toUpperCase(d).indexOf(b),f=null;if(null!=c&&(f=c.indexOf(b),f>=0&&(f%=a.length)),e>=0)this.append(d.substr(0,e)),this.append($("").addClass("bi-keyword-red-mark").text(d.substr(e,b.length).replaceAll(" "," "))),d=d.substr(e+b.length),null!=c&&(c=c.substr(e+b.length));else{if(!(null!=f&&f>=0&&Math.floor(f/a.length)===Math.floor((f+b.length-1)/a.length))){this.append(d);break}this.append(d.substr(0,f)),this.append($("").addClass("bi-keyword-red-mark").text(d.substr(f,b.length).replaceAll(" "," "))),null!=c&&(c=c.substr(f+b.length)),d=d.substr(f+b.length)}}return this},getDomHeight:function(a){var b=$(this).clone();b.appendTo($(a||"body"));var c=b.height();return b.remove(),c},hasVerticalScroll:function(){return this.height()>0&&this[0].clientWidth0&&this[0].clientHeightb.left+this.outerWidth()||a.pageYb.top+this.outerHeight())},__hasZIndexMask__:function(a){return a&&null!=this.zIndexMask[a]},__buildZIndexMask__:function(a,b){this.zIndexMask=this.zIndexMask||{},this.indexMask=this.indexMask||[];var c=BI.createWidget({type:"bi.center_adapt",cls:"bi-z-index-mask",items:b});return c.element.css({"z-index":a}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:c,left:0,right:0,top:0,bottom:0}]}),this.indexMask.push(c),a&&(this.zIndexMask[a]=c),c.element},__releaseZIndexMask__:function(a){if(a&&this.zIndexMask[a])return this.indexMask.remove(this.zIndexMask[a]),void this.zIndexMask[a].destroy();this.indexMask=this.indexMask||[];var b=this.indexMask.pop();b&&b.destroy()}}),BI.extend(jQuery,{getLeftPosition:function(a,b,c){return{left:a.element.offset().left-b.element.outerWidth()-(c||0)}},getRightPosition:function(a,b,c){var d=a.element;return{left:d.offset().left+d.outerWidth()+(c||0)}},getTopPosition:function(a,b,c){return{top:a.element.offset().top-b.element.outerHeight()-(c||0)}},getBottomPosition:function(a,b,c){var d=a.element;return{top:d.offset().top+d.outerHeight()+(c||0)}},isLeftSpaceEnough:function(a,b,c){return $.getLeftPosition(a,b,c).left>=0},isRightSpaceEnough:function(a,b,c){var d=b.element.bounds(),e=$("body").bounds();return $.getRightPosition(a,b,c).left+d.width<=e.width},isTopSpaceEnough:function(a,b,c){return $.getTopPosition(a,b,c).top>=0},isBottomSpaceEnough:function(a,b,c){var d=b.element.bounds(),e=$("body").bounds();return $.getBottomPosition(a,b,c).top+d.height<=e.height},isRightSpaceLarger:function(a){var b=$("body").bounds();return b.width-a.element.offset().left-a.element.bounds().width>=a.element.offset().left},isBottomSpaceLarger:function(a){var b=$("body").bounds();return b.height-a.element.offset().top-a.element.bounds().height>=a.element.offset().top},getLeftAlignPosition:function(a,b,c){var d=b.element.bounds(),e=$("body").bounds(),f=a.element.offset().left+c;return f+d.width>e.width&&(f=e.width-d.width),f<0&&(f=0),{left:f}},getLeftAdaptPosition:function(a,b,c){return $.isLeftSpaceEnough(a,b,c)?$.getLeftPosition(a,b,c):{left:0}},getRightAlignPosition:function(a,b,c){var d=a.element.bounds(),e=b.element.bounds(),f=a.element.offset().left+d.width-e.width-c;return f<0&&(f=0),{left:f}},getRightAdaptPosition:function(a,b,c){return $.isRightSpaceEnough(a,b,c)?$.getRightPosition(a,b,c):{left:$("body").bounds().width-b.element.bounds().width}},getTopAlignPosition:function(a,b,c,d){var e,f,g=a.element.offset(),h=a.element.bounds(),i=b.element.bounds(),j=$("body").bounds();return $.isBottomSpaceEnough(a,b,-1*h.height+c)?e=g.top+c:d?(e=g.top+c,f=j.height-e):(e=j.height-i.height,ef.height?{top:0,adaptHeight:f.height-c}:{top:0}},getBottomAlignPosition:function(a,b,c,d){var e,f,g=a.element.offset(),h=a.element.bounds(),i=b.element.bounds(),j=$("body").bounds();return $.isTopSpaceEnough(a,b,-1*h.height+c)?e=g.top+h.height-i.height-c:d?(e=0,f=g.top+h.height-c):(e=0,i.height+c>j.height&&(f=j.height-c)),e<0&&(e=0),f?{top:e,adaptHeight:f}:{top:e}},getBottomAdaptPosition:function(a,b,c,d){var e=a.element.offset(),f=a.element.bounds(),g=b.element.bounds(),h=$("body").bounds();return $.isBottomSpaceEnough(a,b,c)?$.getBottomPosition(a,b,c):d?{top:e.top+f.height+c,adaptHeight:h.height-e.top-f.height-c}:g.height+c>h.height?{top:c,adaptHeight:h.height-c}:{top:h.height-g.height-c}},getCenterAdaptPosition:function(a,b){var c,d=a.element.offset(),e=a.element.bounds(),f=b.element.bounds(),g=$("body").bounds();return c=d.left+e.width/2+f.width/2>g.width?g.width-f.width:d.left+e.width/2-f.width/2,c<0&&(c=0),{left:c}},getMiddleAdaptPosition:function(a,b){var c,d=a.element.offset(),e=a.element.bounds(),f=b.element.bounds(),g=$("body").bounds();return c=d.top+e.height/2+f.height/2>g.height?g.height-f.height:d.top+e.height/2-f.height/2,c<0&&(c=0),{top:c}},getComboPositionByDirections:function(a,b,c,d,e,f){c||(c=0),d||(d=0);var g,h,i,j,k,l=[],m=[],n=!1,o=!1,p=!1;for(g=0;g-1?f===b?d?h.push(j):h[a]=j:d?i.push(j):i[a]=j:(k=g.indexOf(b),k>-1&&Math.floor(k/f.length)===Math.floor((k+b.length-1)/f.length)&&(f===b||b.length===f.length?d?h.push(j):h[a]=j:d?i.push(j):i[a]=j))}),{matched:h,finded:i}}}),BI.DOM={},BI.extend(BI.DOM,{hang:function(a){if(!BI.isEmpty(a)){var b=document.createDocumentFragment();return BI.each(a,function(a,c){c instanceof BI.Widget&&(c=c.element),c instanceof $&&c[0]&&b.appendChild(c[0])}),b}},isExist:function(a){return $("body").find(a.element).length>0},preloadImages:function(a,b){function c(){d++,d>=a.length&&b()}var d=0,e=[];BI.each(a,function(a,b){e[a]=new Image,e[a].src=b,e[a].onload=function(){c()},e[a].onerror=function(){c()}})},isColor:function(a){return a&&(this.isRGBColor(a)||this.isHexColor(a))},isRGBColor:function(a){return!!a&&"rgb"===a.substr(0,3)},isHexColor:function(a){return!!a&&("#"===a[0]&&7===a.length)},isDarkColor:function(a){if(!a||!this.isHexColor(a))return!1;var b=this.rgb2json(this.hex2rgb(a)),c=Math.round(.299*b.r+.587*b.g+.114*b.b);return c<192},getContrastColor:function(a){return a&&this.isColor(a)?this.isDarkColor(a)?"#ffffff":"#1a1a1a":""},rgb2hex:function(a){if(!a||"rgb"!=a.substr(0,3))return"";var b=a.match(/\d+(\.\d+)?/g),c=BI.parseInt(b[0]),d=BI.parseInt(b[1]),e=BI.parseInt(b[2]),f="#"+this.int2hex(c)+this.int2hex(d)+this.int2hex(e);return f},rgb2json:function(a){if(!a)return{};if(!this.isRGBColor(a))return{};var b=a.match(/\d+(\.\d+)?/g);return{r:BI.parseInt(b[0]),g:BI.parseInt(b[1]),b:BI.parseInt(b[2])}},rgba2json:function(a){if(!a)return{};var b=a.match(/\d+(\.\d+)?/g);return{r:BI.parseInt(b[0]),g:BI.parseInt(b[1]),b:BI.parseInt(b[2]),a:BI.parseFloat(b[3])}},json2rgb:function(a){return BI.isKey(a.r)&&BI.isKey(a.g)&&BI.isKey(a.b)?"rgb("+a.r+","+a.g+","+a.b+")":""},json2rgba:function(a){return BI.isKey(a.r)&&BI.isKey(a.g)&&BI.isKey(a.b)?"rgba("+a.r+","+a.g+","+a.b+","+a.a+")":""},int2hex:function(a){var b=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];return b[a>>>4]+""+b[15&a]},hex2rgb:function(a){if(!a)return"";if(!this.isHexColor(a))return a;var b,c="rgb(";return 7===a.length?b=[BI.parseInt("0x"+a.substring(1,3)),BI.parseInt("0x"+a.substring(3,5)),BI.parseInt("0x"+a.substring(5,7))]:4===a.length&&(b=[BI.parseInt("0x"+a.substring(1,2)),BI.parseInt("0x"+a.substring(2,3)),BI.parseInt("0x"+a.substring(3,4))]),c+=b[0]+",",c+=b[1]+",",c+=b[2]+")"},rgba2rgb:function(a,b){if(BI.isNull(b)&&(b=1),"rgba"!=a.substr(0,4))return"";var c=a.match(/\d+(\.\d+)?/g);if(c.length<4)return"";var d=BI.parseFloat(c[0]),e=BI.parseFloat(c[1]),f=BI.parseFloat(c[2]),g=BI.parseFloat(c[3]);return"rgb("+Math.floor(255*(b*(1-g))+d*g)+","+Math.floor(255*(b*(1-g))+e*g)+","+Math.floor(255*(b*(1-g))+f*g)+")"},getTextSizeWidth:function(a,b){var c=$("").addClass("text-width-span").appendTo($("body"));null==b&&(b=12),b+="px",c.css("font-size",b).text(a);var d=c.width();return c.remove(),d},getScrollWidth:function(){if(null==this._scrollWidth){var a=$("
").width(50).height(50).css({position:"absolute",top:"-9999px",overflow:"scroll"}).appendTo($("body"));this._scrollWidth=a[0].offsetWidth-a[0].clientWidth,a.destroy()}return this._scrollWidth}}),BI.ShowListener=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.ShowListener.superclass._defaultConfig.apply(this,arguments),{eventObj:BI.createWidget(),cardLayout:null,cardNameCreator:function(a){return a},cardCreator:BI.emptyFn,afterCardCreated:BI.emptyFn,afterCardShow:BI.emptyFn})},_init:function(){BI.ShowListener.superclass._init.apply(this,arguments);var a=this,b=this.options;b.eventObj.on(BI.Controller.EVENT_CHANGE,function(c,d,e){if(c===BI.Events.CLICK){if(d=d||b.eventObj.getValue(),d=BI.isArray(d)?d.length>1?d.toString():d[0]:d,BI.isNull(d))throw new Error("value cannot be null");var f=b.cardNameCreator(d);if(!b.cardLayout.isCardExisted(f)){var g=b.cardCreator(f);b.cardLayout.addCardByName(f,g),b.afterCardCreated(f)}b.cardLayout.showCardByName(f),BI.nextTick(function(){b.afterCardShow(f),a.fireEvent(BI.ShowListener.EVENT_CHANGE,f)})}})}}),BI.ShowListener.EVENT_CHANGE="ShowListener.EVENT_CHANGE",BI.StyleLoaderManager=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.StyleLoaderManager.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.StyleLoaderManager.superclass._init.apply(this,arguments),this.stylesManager={}},loadStyle:function(a,b){var c=document,d=c.createElement("style");return c.getElementsByTagName("head")[0].appendChild(d),d.setAttribute("type","text/css"),d.styleSheet?d.styleSheet.cssText=b:d.appendChild(document.createTextNode(b)),this.stylesManager[a]=d,this},get:function(a){return this.stylesManager[a]},has:function(a){return null!=this.stylesManager[a]},removeStyle:function(a){return this.has(a)?(this.stylesManager[a].parentNode.removeChild(this.stylesManager[a]),delete this.stylesManager[a],this):this}}),BI.Logic=BI.inherit(BI.OB,{createLogic:function(){return this.options||{}}}),BI.LogicFactory={Type:{Vertical:"vertical",Horizontal:"horizontal",Table:"table",HorizontalFill:"horizontal_fill"},createLogic:function(a,b){var c;switch(a){case BI.LogicFactory.Type.Vertical:c=BI.VerticalLayoutLogic;break;case BI.LogicFactory.Type.Horizontal:c=BI.HorizontalLayoutLogic;break;case BI.LogicFactory.Type.Table:c=BI.TableLayoutLogic;break;case BI.LogicFactory.Type.HorizontalFill:c=BI.HorizontalFillLayoutLogic;break;default:c=BI.Logic}return new c(b).createLogic()},createLogicTypeByDirection:function(a){switch(a){case BI.Direction.Top:case BI.Direction.Bottom:case BI.Direction.Custom:return BI.LogicFactory.Type.Vertical;case BI.Direction.Left:case BI.Direction.Right:return BI.LogicFactory.Type.Horizontal}},createLogicItemsByDirection:function(a){var b,c=Array.prototype.slice.call(arguments,1);switch(c=BI.map(c,function(a,b){return BI.isWidget(b)?{el:b,width:b.options.width,height:b.options.height}:b}),a){case BI.Direction.Bottom:b=BI.LogicFactory.Type.Vertical,c.reverse();break;case BI.Direction.Right:b=BI.LogicFactory.Type.Horizontal,c.reverse();break;case BI.Direction.Custom:c=c.slice(1)}return c}},BI.VerticalLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.VerticalLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var a,b=this.options;return a=b.dynamic?"bi.vertical":"bi.vtape",{type:a,scrollable:b.scrollable,scrolly:b.scrolly,scrollx:b.scrollx,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,items:b.items}},_init:function(){BI.VerticalLayoutLogic.superclass._init.apply(this,arguments)}}),BI.HorizontalLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.HorizontalLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var a,b=this.options;return a=b.dynamic?"bi.vertical_adapt":"bi.htape",{type:a,scrollable:b.scrollable,scrolly:b.scrolly,scrollx:b.scrollx,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,items:b.items}},_init:function(){BI.HorizontalLayoutLogic.superclass._init.apply(this,arguments)}}),BI.TableLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.TableLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,columns:0,rows:0,columnSize:[],rowSize:[],hgap:0,vgap:0,items:[]})},createLogic:function(){var a,b=this.options;return a=b.dynamic?"bi.table":"bi.window",{type:a,scrollable:b.scrollable,scrolly:b.scrolly,scrollx:b.scrollx,columns:b.columns,rows:b.rows,columnSize:b.columnSize,rowSize:b.rowSize,hgap:b.hgap,vgap:b.vgap,items:b.items}},_init:function(){BI.TableLayoutLogic.superclass._init.apply(this,arguments)}}),BI.HorizontalFillLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.HorizontalFillLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var a,b=this.options,c=[];return BI.each(b.items,function(a,b){c.push(b.width||0)}),a=b.dynamic?"bi.horizontal_adapt":"bi.htape",{type:a,columnSize:c,scrollable:b.scrollable,scrolly:b.scrolly,scrollx:b.scrollx,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,items:b.items}},_init:function(){BI.HorizontalFillLayoutLogic.superclass._init.apply(this,arguments)}}),BI.Plugin=BI.Plugin||{},function(){var a={},b={};BI.extend(BI.Plugin,{getWidget:function(b,c){if(a[b])for(var d,e=a[b].length-1;e>=0;e--)if(d=a[b][e](c))return d;return c},registerWidget:function(b,c){a[b]||(a[b]=[]),a[b].length>0&&console.log("组件已经注册过了!"),a[b].push(c)},relieveWidget:function(b){delete a[b]},getObject:function(a,c){if(b[a])for(var d,e=0,f=b[a].length;e0&&console.log("对象已经注册过了!"),b[a].push(c)},relieveObject:function(a){delete b[a]}})}(),$.extend(Array.prototype,{contains:function(a){return this.indexOf(a)>-1},remove:function(a){var b=this.indexOf(a);return b!==-1&&this.splice(b,1),this},pushArray:function(a){for(var b=0;b=0;a--){var b=localStorage.key(a);b&&0===b.indexOf(BI.Cache._getKeyPrefix())&&localStorage.removeItem(b)}},keys:function(){for(var a=[],b=localStorage.length;b>=0;b--){var c=localStorage.key(b);if(c){var d=BI.Cache._getKeyPrefix();0===c.indexOf(d)&&(a[a.length]=c.substring(d.length))}}return a},addCookie:function(a,b,c,d){var e=a+"="+escape(b);if(d&&d>0){var f=new Date;f.setTime(f.getTime()+3600*d*1e3),e=e+"; expires="+f.toGMTString()}c&&(e=e+"; path="+c),document.cookie=e},getCookie:function(a){var b,c=new RegExp("(^| )"+a+"=([^;]*)(;|$)");return(b=document.cookie.match(c))?unescape(b[2]):null},deleteCookie:function(a,b){var c=new Date;c.setTime(c.getTime()-1e4);var d=a+"=v; expires="+c.toGMTString();b&&(d=d+"; path="+b),document.cookie=d}},Date._DN=[BI.i18nText("BI-Basic_Sunday"),BI.i18nText("BI-Basic_Monday"),BI.i18nText("BI-Basic_Tuesday"),BI.i18nText("BI-Basic_Wednesday"),BI.i18nText("BI-Basic_Thursday"),BI.i18nText("BI-Basic_Friday"),BI.i18nText("BI-Basic_Saturday"),BI.i18nText("BI-Basic_Sunday")],Date._SDN=[BI.i18nText("BI-Basic_Simple_Sunday"),BI.i18nText("BI-Basic_Simple_Monday"),BI.i18nText("BI-Basic_Simple_Tuesday"),BI.i18nText("BI-Basic_Simple_Wednesday"),BI.i18nText("BI-Basic_Simple_Thursday"),BI.i18nText("BI-Basic_Simple_Friday"),BI.i18nText("BI-Basic_Simple_Saturday"),BI.i18nText("BI-Basic_Simple_Sunday")],Date._FD=1,Date._MN=[BI.i18nText("BI-Basic_January"),BI.i18nText("BI-Basic_February"),BI.i18nText("BI-Basic_March"),BI.i18nText("BI-Basic_April"),BI.i18nText("BI-Basic_May"),BI.i18nText("BI-Basic_June"),BI.i18nText("BI-Basic_July"),BI.i18nText("BI-Basic_August"),BI.i18nText("BI-Basic_September"),BI.i18nText("BI-Basic_October"),BI.i18nText("BI-Basic_November"),BI.i18nText("BI-Basic_December")],Date._SMN=[0,1,2,3,4,5,6,7,8,9,10,11],Date._QN=["",BI.i18nText("BI-Quarter_1"),BI.i18nText("BI-Quarter_2"),BI.i18nText("BI-Quarter_3"),BI.i18nText("BI-Quarter_4")],Date._MD=[31,28,31,30,31,30,31,31,30,31,30,31],Date.SECOND=1e3,Date.MINUTE=60*Date.SECOND,Date.HOUR=60*Date.MINUTE,Date.DAY=24*Date.HOUR,Date.WEEK=7*Date.DAY,Date.prototype.getTimezone=function(){return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/,"$1$2").replace(/[^A-Z]/g,"")},Date.prototype.getMonthDays=function(a){var b=this.getFullYear();return"undefined"==typeof a&&(a=this.getMonth()),0!=b%4||0==b%100&&0!=b%400||1!=a?Date._MD[a]:29},Date.prototype.getLastDateOfMonth=function(){return new Date(this.getFullYear(),this.getMonth(),this.getMonthDays())},Date.prototype.getDayOfYear=function(){var a=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),b=new Date(this.getFullYear(),0,0,0,0,0),c=a-b;return Math.floor(c/Date.DAY)},Date.prototype.getWeekNumber=function(){var a=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),b=a.getDay();if(0===this.getMonth()&&this.getDate()<=b)return 1;a.setDate(this.getDate()-b);var c=a.valueOf();a.setMonth(0),a.setDate(1);var d=Math.floor((c-a.valueOf())/6048e5)+1;return a.getDay()>0&&d++,d},Date.prototype.getOffsetDate=function(a){return new Date(this.getTime()+864e5*a)},Date.prototype.getAfterMulQuarter=function(a){var b=new Date(this.getTime());return b.setMonth(b.getMonth()+3*a),b},Date.prototype.getBeforeMulQuarter=function(a){var b=new Date(this.getTime());return b.setMonth(b.getMonth()-3*a),b},Date.prototype.getQuarterStartMonth=function(){var a=0,b=this.getMonth();return b<3&&(a=0),28&&(a=9),a},Date.prototype.getQuarterStartDate=function(){return new Date(this.getFullYear(),this.getQuarterStartMonth(),1)},Date.prototype.getQuarterEndDate=function(){var a=this.getQuarterStartMonth()+2;return new Date(this.getFullYear(),a,this.getMonthDays(a))},Date.prototype.getAfterMultiMonth=function(a){var b=new Date(this.getTime());return b.setMonth(b.getMonth()+a|0),b},Date.prototype.getBeforeMultiMonth=function(a){var b=new Date(this.getTime());return b.setMonth(b.getMonth()-a|0),b},Date.prototype.getAfterMulQuarter=function(a){var b=new Date(this.getTime());return b.setMonth(b.getMonth()+3*a),b},Date.prototype.getBeforeMulQuarter=function(a){var b=new Date(this.getTime());return b.setMonth(b.getMonth()-3*a),b},Date.prototype.getQuarterStartMonth=function(){var a=0,b=this.getMonth();return b<3&&(a=0),28&&(a=9),a},Date.prototype.getOffsetMonth=function(a){var b=new Date(this.getTime()),c=b.getDate(),d=new Date(b.getFullYear(),b.getMonth()+parseInt(a),1).getMonthDays();return c>d&&(c=d),b.setDate(c),b.setMonth(b.getMonth()+parseInt(a)),b},Date.prototype.getWeekStartDate=function(){var a=this.getDay();return this.getOffsetDate(-a)},Date.prototype.getWeekEndDate=function(){var a=this.getDay(),b=0===a?6:6-a;return this.getOffsetDate(b)},Date.prototype.getQuarterStartDate=function(){return new Date(this.getFullYear(),this.getQuarterStartMonth(),1)},Date.prototype.getQuarterEndDate=function(){var a=this.getQuarterStartMonth()+2;return new Date(this.getFullYear(),a,this.getMonthDays(a))},Date.prototype.getAfterMultiMonth=function(a){var b=new Date(this.getTime());return b.setMonth(b.getMonth()+a|0),b},Date.prototype.getBeforeMultiMonth=function(a){var b=new Date(this.getTime());return b.setMonth(b.getMonth()-a|0),b},Date.prototype.equalsTo=function(a){return this.getFullYear()==a.getFullYear()&&this.getMonth()==a.getMonth()&&this.getDate()==a.getDate()&&this.getHours()==a.getHours()&&this.getMinutes()==a.getMinutes()&&this.getSeconds()==a.getSeconds()},Date.prototype.setDateOnly=function(a){var b=new Date(a);this.setDate(1),this.setFullYear(b.getFullYear()),this.setMonth(b.getMonth()),this.setDate(b.getDate())},Date.prototype.print=function(a){var b=this.getMonth(),c=this.getDate(),d=this.getFullYear(),e=this.getWeekNumber(),f=this.getDay(),g={},h=this.getHours(),i=h>=12,j=i?h-12:h,k=this.getDayOfYear();0==j&&(j=12);var l=this.getMinutes(),m=this.getSeconds();g["%a"]=Date._SDN[f],g["%A"]=Date._DN[f],g["%b"]=Date._SMN[b],g["%B"]=Date._MN[b],g["%C"]=1+Math.floor(d/100),g["%d"]=c<10?"0"+c:c,g["%e"]=c,g["%H"]=h<10?"0"+h:h,g["%I"]=j<10?"0"+j:j,g["%j"]=k<100?k<10?"00"+k:"0"+k:k,g["%k"]=h,g["%l"]=j,g["%X"]=b<9?"0"+(1+b):1+b,g["%x"]=b+1,g["%M"]=l<10?"0"+l:l,g["%n"]="\n",g["%p"]=i?"PM":"AM",g["%P"]=i?"pm":"am",g["%s"]=Math.floor(this.getTime()/1e3),g["%S"]=m<10?"0"+m:m,g["%t"]="\t",g["%U"]=g["%W"]=g["%V"]=e<10?"0"+e:e,g["%u"]=f+1,g["%w"]=f,g["%y"]=(""+d).substr(2,2),g["%Y"]=d,g["%%"]="%";var n=/%./g;if(!BI.isKhtml())return a.replace(n,function(a){return g[a]||a});for(var o=a.match(n),p=0;pe[0]?f=["y",1]:a>=d[0]&&a<=e[0]&&(a==d[0]&&(be[1]?f=["m",1]:b==e[1]&&c>e[2]&&(f=["d",1]))),f},Date.checkLegal=function(a){var b=a.match(/\d+/g),c=0|b[0],d=0|b[1],e=0|b[2];if(b.length<=1)return!0;if(b.length<=2)return d>=1&&d<=12;var f=Date._MD.slice(0);return f[1]=Date.isLeap(c)?29:28,d>=1&&d<=12&&e<=f[d-1]},Date.parseDateTime=function(a,b){var c=new Date,d=0,e=0,f=1,g=a.split(/\W+/);if("%y%x"==b.toLowerCase()||"%y%x%d"==b.toLowerCase()){var h=4,i=2;g[0]=a.substring(0,h),g[1]=a.substring(h,h+i),g[2]=a.substring(h+i,h+2*i)}var j=b.match(/%./g),k=0,l=0,m=0,n=0,o=0;for(k=0;k29?1900:2e3);break;case"%b":case"%B":for(l=0;l<12;++l)if(Date._MN[l].substr(0,g[k].length).toLowerCase()==g[k].toLowerCase()){e=l;break}break;case"%H":case"%I":case"%k":case"%l":m=parseInt(g[k],10);break;case"%P":case"%p":/pm/i.test(g[k])&&m<12?m+=12:/am/i.test(g[k])&&m>=12&&(m-=12);break;case"%M":n=parseInt(g[k],10);case"%S":o=parseInt(g[k],10)}if(isNaN(d)&&(d=c.getFullYear()),isNaN(e)&&(e=c.getMonth()),isNaN(f)&&(f=c.getDate()),isNaN(m)&&(m=c.getHours()),isNaN(n)&&(n=c.getMinutes()),isNaN(o)&&(o=c.getSeconds()),0!=d)return new Date(d,e,f,m,n,o);for(d=0,e=-1,f=0,k=0;k31&&0==d?(d=parseInt(g[k],10),d<100&&(d+=d>29?1900:2e3)):0==f&&(f=g[k]);return 0==d&&(d=c.getFullYear()),e!=-1&&0!=f?new Date(d,e,f,m,n,o):c},$.extend($.Event.prototype,{stopEvent:function(){this.stopPropagation(),this.preventDefault()}}),Function.prototype.before=function(a){var b=this;return function(){return a.apply(this,arguments)!==!1&&b.apply(this,arguments)}},Function.prototype.after=function(a){var b=this;return function(){var c=b.apply(this,arguments);return c!==!1&&(a.apply(this,arguments),c)}},jQuery&&!function(a){a.fn.insets||(a.fn.insets=function(){var a=this.padding(),b=this.border();return{top:a.top,bottom:a.bottom+b.bottom+b.top,left:a.left,right:a.right+b.right+b.left}}),a.fn.bounds||(a.fn.bounds=function(a){var b={hasIgnoredBounds:!0};return a?(isNaN(a.x)||(b.left=a.x),isNaN(a.y)||(b.top=a.y),null!=a.width&&(b.width=a.width-(this.outerWidth(!0)-this.width()),b.width=b.width>=0?b.width:a.width),null!=a.height&&(b.height=a.height-(this.outerHeight(!0)-this.height()),b.height=b.height>=0?b.height:a.height),this.css(b),this):(b=this.position(),{x:b.left,y:b.top,width:this.outerWidth(),height:this.outerHeight()})})}(jQuery),Number.prototype.toFixed&&"0.000"===8e-5.toFixed(3)&&"0"!==.9.toFixed(0)&&"1.25"===1.255.toFixed(2)&&"1000000000000000128"===(0xde0b6b3a7640080).toFixed(0)||!function(){function a(a,b){for(var c=-1;++c=0;)c+=h[b],h[b]=Math.floor(c/a),c=c%a*f}function c(){for(var a=g,b="";--a>=0;)if(""!==b||0===a||0!==h[a]){var c=String(h[a]);""===b?b=c:b+="0000000".slice(0,7-c.length)+c}return b}function d(a,b,c){return 0===b?c:b%2===1?d(a,b-1,c*a):d(a*a,b/2,c)}function e(a){for(var b=0;a>=4096;)b+=12,a/=4096;for(;a>=2;)b+=1,a/=2;return b}var f,g,h;f=1e7,g=6,h=[0,0,0,0,0,0],Number.prototype.toFixed=function(f){var g,h,i,j,k,l,m,n;if(g=Number(f),g=g!==g?0:Math.floor(g),g<0||g>20)throw new RangeError("Number.toFixed called with invalid number of decimals");if(h=Number(this),h!==h)return"NaN";if(h<=-1e21||h>1e21)return String(h);if(i="",h<0&&(i="-",h=-h),j="0",h>1e-21)if(k=e(h*d(2,69,1))-69,l=k<0?h*d(2,-k,1):h/d(2,k,1),l*=4503599627370496,k=52-k,k>0){for(a(0,l),m=g;m>=7;)a(1e7,0),m-=7;for(a(d(10,m,1),0),m=k-1;m>=23;)b(1<<23),m-=23;b(1<0?(n=j.length,j=n<=g?i+"0.0000000000000000000".slice(0,g-n+2)+j:i+j.slice(0,n-g)+"."+j.slice(n-g)):j=i+j,j}}(),Number.prototype.add=function(a){return accAdd(a,this)},Number.prototype.sub=function(a){return accSub(this,a)},Number.prototype.mul=function(a){return accMul(a,this)},Number.prototype.div=function(a){ -return accDiv(this,a)},$.extend(String.prototype,{startWith:function(a){return!(null==a||""==a||0===this.length||a.length>this.length)&&this.substr(0,a.length)==a},endWith:function(a){return!(null==a||""==a||0===this.length||a.length>this.length)&&this.substring(this.length-a.length)==a},getQuery:function(a){var b=new RegExp("(^|&)"+a+"=([^&]*)(&|$)"),c=this.substr(this.indexOf("?")+1).match(b);return c?unescape(c[2]):null},appendQuery:function(a){if(!a)return this;var b=this;return b.indexOf("?")===-1&&(b+="?"),b.endWith("?")!==!1||(b+="&"),$.each(a,function(a,c){"string"==typeof a&&(b+=a+"="+c+"&")}),b=b.substr(0,b.length-1)},replaceAll:function(a,b){return this.replace(new RegExp(a,"gm"),b)},perfectStart:function(a){return this.startWith(a)?this:a+this},allIndexOf:function(a){if("string"!=typeof a)return[];for(var b=this,c=[],d=0;b.length>0;){var e=b.indexOf(a);if(e===-1)break;c.push(d+e),b=b.substring(e+a.length,b.length),d+=e+a.length}return c}}),$.extend(String,{escape:function(a){return a.replace(/('|\\)/g,"\\$1")},leftPad:function(a,b,c){var d=String(a);for(c||(c=" ");d.length").attr({cellspacing:0,cellpadding:0}).css({position:"relative",width:"100%",height:"100%","white-space":"nowrap","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.$tr=$(""),this.$tr.appendTo(this.$table),this.populate(this.options.items)},_addElement:function(a,b){var c,d=this.options,e=d.columnSize[a]<=1?100*d.columnSize[a]+"%":d.columnSize[a];if(this.hasWidget(this._getChildName(a)))c=this.getWidgetByName(this._getChildName(a)),c.element.attr("width",e);else{var f=BI.createWidget(b);f.element.css({position:"relative",top:"0",left:"0",margin:"0px auto"}),c=BI.createWidget({type:"bi.default",tagName:"td",attributes:{width:e},items:[f]}),this.addWidget(this._getChildName(a),c)}return c.element.css({"max-width":d.columnSize[a]}),0===a&&c.element.addClass("first-element"),c.element.css({position:"relative",height:"100%","vertical-align":"middle",margin:"0",padding:"0",border:"none"}),d.hgap+d.lgap+(b.lgap||0)!==0&&f.element.css({"margin-left":d.hgap+d.lgap+(b.lgap||0)+"px"}),d.hgap+d.rgap+(b.rgap||0)!==0&&f.element.css({"margin-right":d.hgap+d.rgap+(b.rgap||0)+"px"}),d.vgap+d.tgap+(b.tgap||0)!==0&&f.element.css({"margin-top":d.vgap+d.tgap+(b.tgap||0)+"px"}),d.vgap+d.bgap+(b.bgap||0)!==0&&f.element.css({"margin-bottom":d.vgap+d.bgap+(b.bgap||0)+"px"}),c},_mountChildren:function(){var a=this,b=document.createDocumentFragment(),c=!1;BI.each(this._children,function(d,e){e.element!==a.element&&(b.appendChild(e.element[0]),c=!0)}),c===!0&&(this.$tr.append(b),this.element.append(this.$table))},resize:function(){},_getWrapper:function(){return this.$tr},populate:function(a){BI.CenterAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.center_adapt",BI.CenterAdaptLayout),BI.HorizontalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizontal-adapt-layout",verticalAlign:BI.VerticalAlign.Top,columnSize:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.HorizontalAdaptLayout.superclass.render.apply(this,arguments),this.$table=$("").attr({cellspacing:0,cellpadding:0}).css({position:"relative",width:"100%","white-space":"nowrap","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.$tr=$(""),this.$tr.appendTo(this.$table),this.populate(this.options.items)},_addElement:function(a,b){var c,d=this.options,e=d.columnSize[a]<=1?100*d.columnSize[a]+"%":d.columnSize[a];if(this.hasWidget(this._getChildName(a)))c=this.getWidgetByName(this._getChildName(a)),c.element.attr("width",e);else{var f=BI.createWidget(b);f.element.css({position:"relative",top:"0",left:"0",margin:"0px auto"}),c=BI.createWidget({type:"bi.default",tagName:"td",attributes:{width:e},items:[f]}),this.addWidget(this._getChildName(a),c)}return c.element.css({"max-width":d.columnSize[a]+"px"}),0===a&&c.element.addClass("first-element"),c.element.css({position:"relative","vertical-align":d.verticalAlign,margin:"0",padding:"0",border:"none"}),d.hgap+d.lgap+(b.lgap||0)!==0&&f.element.css({"margin-left":d.hgap+d.lgap+(b.lgap||0)+"px"}),d.hgap+d.rgap+(b.rgap||0)!==0&&f.element.css({"margin-right":d.hgap+d.rgap+(b.rgap||0)+"px"}),d.vgap+d.tgap+(b.tgap||0)!==0&&f.element.css({"margin-top":d.vgap+d.tgap+(b.tgap||0)+"px"}),d.vgap+d.bgap+(b.bgap||0)!==0&&f.element.css({"margin-bottom":d.vgap+d.bgap+(b.bgap||0)+"px"}),c},_mountChildren:function(){var a=this,b=document.createDocumentFragment(),c=!1;BI.each(this._children,function(d,e){e.element!==a.element&&(b.appendChild(e.element[0]),c=!0)}),c===!0&&(this.$tr.append(b),this.element.append(this.$table))},resize:function(){},_getWrapper:function(){return this.$tr},populate:function(a){BI.HorizontalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_adapt",BI.HorizontalAdaptLayout),BI.LeftRightVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-left-right-vertical-adapt-layout",items:{},llgap:0,lrgap:0,lhgap:0,rlgap:0,rrgap:0,rhgap:0})},render:function(){BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},addItem:function(){throw new Error("cannot be added")},stroke:function(a){var b=this.options;if("left"in a){var c=BI.createWidget({type:"bi.vertical_adapt",items:a.left,hgap:b.lhgap,lgap:b.llgap,rgap:b.lrgap});c.element.css("height","100%"),BI.createWidget({type:"bi.left",element:this,items:[c]})}if("right"in a){var d=BI.createWidget({type:"bi.vertical_adapt",items:a.right,hgap:b.rhgap,lgap:b.rlgap,rgap:b.rrgap});d.element.css("height","100%"),BI.createWidget({type:"bi.right",element:this,items:[d]})}},populate:function(a){BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.left_right_vertical_adapt",BI.LeftRightVerticalAdaptLayout),BI.LeftVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-left-vertical-adapt-layout",items:[],lgap:0,rgap:0,hgap:0})},render:function(){BI.LeftVerticalAdaptLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},addItem:function(){throw new Error("cannot be added")},stroke:function(a){var b=this.options,c=BI.createWidget({type:"bi.vertical_adapt",items:a,lgap:b.lgap,hgap:b.hgap,rgap:b.rgap});c.element.css("height","100%"),BI.createWidget({type:"bi.left",element:this,items:[c]})},populate:function(a){BI.LeftVerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.left_vertical_adapt",BI.LeftVerticalAdaptLayout),BI.RightVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.RightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-right-vertical-adapt-layout",items:[],lgap:0,rgap:0,hgap:0})},render:function(){BI.RightVerticalAdaptLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},addItem:function(){throw new Error("cannot be added")},stroke:function(a){var b=this.options,c=BI.createWidget({type:"bi.vertical_adapt",items:a,lgap:b.lgap,hgap:b.hgap,rgap:b.rgap});c.element.css("height","100%"),BI.createWidget({type:"bi.right",element:this,items:[c]})},populate:function(a){BI.RightVerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.right_vertical_adapt",BI.RightVerticalAdaptLayout),BI.VerticalAdaptLayout=BI.inherit(BI.Layout,{props:{baseCls:"bi-vertical-adapt-layout",columnSize:[],horizontalAlign:BI.HorizontalAlign.Left,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0},render:function(){BI.VerticalAdaptLayout.superclass.render.apply(this,arguments);var a=this.options;this.$table=$("
").attr({cellspacing:0,cellpadding:0}).css({position:"relative",width:a.horizontalAlign===BI.HorizontalAlign.Stretch?"100%":"auto",height:"100%","white-space":"nowrap","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.$tr=$(""),this.$tr.appendTo(this.$table),this.populate(this.options.items)},_addElement:function(a,b){var c,d=this.options,e=d.columnSize[a]<=1?100*d.columnSize[a]+"%":d.columnSize[a];if(this.hasWidget(this._getChildName(a)))c=this.getWidgetByName(this._getChildName(a)),c.element.attr("width",e);else{var f=BI.createWidget(b);f.element.css({position:"relative",top:"0",left:"0",margin:"0px auto"}),c=BI.createWidget({type:"bi.default",tagName:"td",attributes:{width:e},items:[f]}),this.addWidget(this._getChildName(a),c)}return 0===a&&c.element.addClass("first-element"),c.element.css({position:"relative",height:"100%","vertical-align":"middle",margin:"0",padding:"0",border:"none"}),d.hgap+d.lgap+(b.lgap||0)!==0&&f.element.css({"margin-left":d.hgap+d.lgap+(b.lgap||0)+"px"}),d.hgap+d.rgap+(b.rgap||0)!==0&&f.element.css({"margin-right":d.hgap+d.rgap+(b.rgap||0)+"px"}),d.vgap+d.tgap+(b.tgap||0)!==0&&f.element.css({"margin-top":d.vgap+d.tgap+(b.tgap||0)+"px"}),d.vgap+d.bgap+(b.bgap||0)!==0&&f.element.css({"margin-bottom":d.vgap+d.bgap+(b.bgap||0)+"px"}),c},_mountChildren:function(){var a=this,b=document.createDocumentFragment(),c=!1;BI.each(this._children,function(d,e){e.element!==a.element&&(b.appendChild(e.element[0]),c=!0)}),c===!0&&(this.$tr.append(b),this.element.append(this.$table))},_getWrapper:function(){return this.$tr},resize:function(){},populate:function(a){BI.VerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.vertical_adapt",BI.VerticalAdaptLayout),BI.HorizontalAutoLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalAutoLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizon-auto-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.HorizontalAutoLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.HorizontalAutoLayout.superclass._addElement.apply(this,arguments);return d.element.css({position:"relative",margin:"0px auto"}),c.hgap+c.lgap+(b.lgap||0)!==0&&d.element.css({"margin-left":c.hgap+c.lgap+(b.lgap||0)+"px"}),c.hgap+c.rgap+(b.rgap||0)!==0&&d.element.css({"margin-right":c.hgap+c.rgap+(b.rgap||0)+"px"}),c.vgap+c.tgap+(b.tgap||0)!==0&&d.element.css({"margin-top":c.vgap+c.tgap+(b.tgap||0)+"px"}),c.vgap+c.bgap+(b.bgap||0)!==0&&d.element.css({"margin-bottom":c.vgap+c.bgap+(b.bgap||0)+"px"}),d},resize:function(){},populate:function(a){BI.HorizontalAutoLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_auto",BI.HorizontalAutoLayout),BI.FloatCenterAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatCenterAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-center-adapt-layout",items:[],hgap:0,vgap:0,tgap:0,bgap:0,lgap:0,rgap:0})},render:function(){BI.FloatCenterAdaptLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},addItem:function(){throw new Error("cannot be added")},mounted:function(){var a=this,b=this.left.element.outerWidth(),c=this.left.element.outerHeight();this.left.element.width(b).height(c).css("float","none"),BI.remove(this._children,function(b,c){c===a.container&&delete a._children[b]}),BI.createWidget({type:"bi.center_adapt",element:this,items:[this.left]})},stroke:function(a){var b=this.options;this.left=BI.createWidget({type:"bi.vertical",items:a,hgap:b.hgap,vgap:b.vgap,tgap:b.tgap,bgap:b.bgap,lgap:b.lgap,rgap:b.rgap}),this.container=BI.createWidget({type:"bi.left",element:this,items:[this.left]})},populate:function(a){BI.FloatCenterAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.float_center_adapt",BI.FloatCenterAdaptLayout),BI.FloatHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-horizontal-adapt-layout",items:[],hgap:0,vgap:0,tgap:0,bgap:0,lgap:0,rgap:0})},render:function(){BI.FloatHorizontalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},mounted:function(){var a=this,b=this.left.element.width(),c=this.left.element.height();this.left.element.width(b).height(c).css("float","none"),BI.remove(this._children,function(b,c){c===a.container&&delete a._children[b]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[this.left]})},_addElement:function(a,b){var c=this.options;return this.left=BI.createWidget({type:"bi.vertical",items:[b],hgap:c.hgap,vgap:c.vgap,tgap:c.tgap,bgap:c.bgap,lgap:c.lgap,rgap:c.rgap}),this.container=BI.createWidget({type:"bi.left",element:this,items:[this.left]}),this.left},populate:function(a){BI.HorizontalAutoLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_float",BI.FloatHorizontalLayout),BI.FlexCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-center-layout"})},render:function(){BI.FlexCenterLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(a,b){var c=(this.options,BI.FlexCenterLayout.superclass._addElement.apply(this,arguments));return c.element.css({position:"relative","flex-shrink":"0"}),c},resize:function(){},populate:function(a){BI.FlexCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_center",BI.FlexCenterLayout),BI.FlexHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-horizontal-layout",verticalAlign:BI.VerticalAlign.Top,columnSize:[],scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexHorizontalLayout.superclass.render.apply(this,arguments);var a=this.options;this.element.addClass(a.verticalAlign),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.FlexHorizontalLayout.superclass._addElement.apply(this,arguments);return d.element.css({position:"relative","flex-shrink":"0"}),c.hgap+c.lgap+(b.lgap||0)>0&&d.element.css({"margin-left":c.hgap+c.lgap+(b.lgap||0)+"px"}),c.hgap+c.rgap+(b.rgap||0)>0&&d.element.css({"margin-right":c.hgap+c.rgap+(b.rgap||0)+"px"}),c.vgap+c.tgap+(b.tgap||0)>0&&d.element.css({"margin-top":c.vgap+c.tgap+(b.tgap||0)+"px"}),c.vgap+c.bgap+(b.bgap||0)>0&&d.element.css({"margin-bottom":c.vgap+c.bgap+(b.bgap||0)+"px"}),d},resize:function(){},populate:function(a){BI.FlexHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_horizontal",BI.FlexHorizontalLayout),BI.FlexVerticalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexVerticalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-vertical-center",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexVerticalCenter.superclass.render.apply(this,arguments);var a=this.options;this.element.addClass(a.horizontalAlign),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.FlexVerticalCenter.superclass._addElement.apply(this,arguments);return d.element.css({position:"relative","flex-shrink":"0"}),c.hgap+c.lgap+(b.lgap||0)>0&&d.element.css({"margin-left":c.hgap+c.lgap+(b.lgap||0)+"px"}),c.hgap+c.rgap+(b.rgap||0)>0&&d.element.css({"margin-right":c.hgap+c.rgap+(b.rgap||0)+"px"}),c.vgap+c.tgap+(b.tgap||0)>0&&d.element.css({"margin-top":c.vgap+c.tgap+(b.tgap||0)+"px"}),c.vgap+c.bgap+(b.bgap||0)>0&&d.element.css({"margin-bottom":c.vgap+c.bgap+(b.bgap||0)+"px"}),d},resize:function(){},populate:function(a){BI.FlexVerticalCenter.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_vertical_center",BI.FlexVerticalCenter),BI.FlexCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-wrapper-center-layout clearfix"})},render:function(){BI.FlexCenterLayout.superclass.render.apply(this,arguments),this.$wrapper=$("
").addClass("flex-wrapper-center-layout-wrapper"),this.populate(this.options.items)},_addElement:function(a,b){var c=(this.options,BI.FlexCenterLayout.superclass._addElement.apply(this,arguments));return c.element.css({position:"relative"}),c},_mountChildren:function(){var a=this,b=document.createDocumentFragment(),c=!1;BI.each(this._children,function(d,e){e.element!==a.element&&(b.appendChild(e.element[0]),c=!0)}),c===!0&&(this.$wrapper.append(b),this.element.append(this.$wrapper))},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(a){BI.FlexCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_wrapper_center",BI.FlexCenterLayout),BI.FlexHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-wrapper-horizontal-layout clearfix",verticalAlign:BI.VerticalAlign.Middle,columnSize:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexHorizontalLayout.superclass.render.apply(this,arguments);var a=this.options;this.$wrapper=$("
").addClass("flex-wrapper-horizontal-layout-wrapper "+a.verticalAlign),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.FlexHorizontalLayout.superclass._addElement.apply(this,arguments);return d.element.css({position:"relative"}),c.hgap+c.lgap+(b.lgap||0)>0&&d.element.css({"margin-left":c.hgap+c.lgap+(b.lgap||0)+"px"}),c.hgap+c.rgap+(b.rgap||0)>0&&d.element.css({"margin-right":c.hgap+c.rgap+(b.rgap||0)+"px"}),c.vgap+c.tgap+(b.tgap||0)>0&&d.element.css({"margin-top":c.vgap+c.tgap+(b.tgap||0)+"px"}),c.vgap+c.bgap+(b.bgap||0)>0&&d.element.css({"margin-bottom":c.vgap+c.bgap+(b.bgap||0)+"px"}),d},_mountChildren:function(){var a=this,b=document.createDocumentFragment(),c=!1;BI.each(this._children,function(d,e){e.element!==a.element&&(b.appendChild(e.element[0]),c=!0)}),c===!0&&(this.$wrapper.append(b),this.element.append(this.$wrapper))},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(a){BI.FlexHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_wrapper_horizontal",BI.FlexHorizontalLayout),BI.FlexVerticalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexVerticalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-wrapper-vertical-center clearfix",horizontalAlign:BI.HorizontalAlign.Middle,columnSize:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexVerticalCenter.superclass.render.apply(this,arguments);var a=this.options;this.$wrapper=$("
").addClass("flex-wrapper-vertical-center-wrapper "+a.horizontalAlign),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.FlexVerticalCenter.superclass._addElement.apply(this,arguments);return d.element.css({position:"relative"}),c.hgap+c.lgap+(b.lgap||0)>0&&d.element.css({"margin-left":c.hgap+c.lgap+(b.lgap||0)+"px"}),c.hgap+c.rgap+(b.rgap||0)>0&&d.element.css({"margin-right":c.hgap+c.rgap+(b.rgap||0)+"px"}),c.vgap+c.tgap+(b.tgap||0)>0&&d.element.css({"margin-top":c.vgap+c.tgap+(b.tgap||0)+"px"}),c.vgap+c.bgap+(b.bgap||0)>0&&d.element.css({"margin-bottom":c.vgap+c.bgap+(b.bgap||0)+"px"}),d},_mountChildren:function(){var a=this,b=document.createDocumentFragment(),c=!1;BI.each(this._children,function(d,e){e.element!==a.element&&(b.appendChild(e.element[0]),c=!0)}),c===!0&&(this.$wrapper.append(b),this.element.append(this.$wrapper))},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(a){BI.FlexVerticalCenter.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_wrapper_vertical_center",BI.FlexVerticalCenter),BI.AbsoluteLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-layout",hgap:null,vgap:null,lgap:null,rgap:null,tgap:null,bgap:null})},render:function(){BI.AbsoluteLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.AbsoluteLayout.superclass._addElement.apply(this,arguments),e=0,f=0,g=0,h=0;return BI.isNotNull(b.left)&&(d.element.css({left:b.left}),e+=b.left),BI.isNotNull(b.right)&&(d.element.css({right:b.right}),f+=b.right),BI.isNotNull(b.top)&&(d.element.css({top:b.top}),g+=b.top),BI.isNotNull(b.bottom)&&(d.element.css({bottom:b.bottom}),h+=b.bottom),BI.isNotNull(c.hgap)&&(e+=c.hgap,d.element.css({left:e}),f+=c.hgap,d.element.css({right:f})),BI.isNotNull(c.vgap)&&(g+=c.vgap,d.element.css({top:g}),h+=c.vgap,d.element.css({bottom:h})),BI.isNotNull(c.lgap)&&(e+=c.lgap,d.element.css({left:e})),BI.isNotNull(c.rgap)&&(f+=c.rgap,d.element.css({right:f})),BI.isNotNull(c.tgap)&&(g+=c.tgap,d.element.css({top:g})),BI.isNotNull(c.bgap)&&(h+=c.bgap,d.element.css({bottom:h})),BI.isNotNull(b.width)&&d.element.css({width:b.width}),BI.isNotNull(b.height)&&d.element.css({height:b.height}),d.element.css({position:"absolute"}),d},resize:function(){this.stroke(this.options.items)},stroke:function(a){this.options.items=a||[];var b=this;BI.each(a,function(a,c){if(c){if(!BI.isWidget(c)&&!c.el)throw new Error("el must be exist");b._addElement(a,c)}})},populate:function(a){BI.AbsoluteLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute",BI.AbsoluteLayout),BI.AdaptiveLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AdaptiveLayout.superclass.props.apply(this,arguments),{baseCls:"bi-adaptive-layout",hgap:null,vgap:null,lgap:null,rgap:null,tgap:null,bgap:null})},render:function(){BI.AdaptiveLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.AdaptiveLayout.superclass._addElement.apply(this,arguments);d.element.css({position:"relative"});var e=0,f=0,g=0,h=0;return BI.isNotNull(b.left)&&d.element.css({"margin-left":b.left}),BI.isNotNull(b.right)&&d.element.css({"margin-right":b.right}),BI.isNotNull(b.top)&&d.element.css({"margin-top":b.top}),BI.isNotNull(b.bottom)&&d.element.css({"margin-bottom":b.bottom}),BI.isNotNull(c.hgap)&&(e+=c.hgap,d.element.css({left:e}),f+=c.hgap,d.element.css({right:f})),BI.isNotNull(c.vgap)&&(g+=c.vgap,d.element.css({top:g}),h+=c.vgap,d.element.css({bottom:h})),BI.isNotNull(c.lgap)&&(e+=c.lgap,d.element.css({left:e})),BI.isNotNull(c.rgap)&&(f+=c.rgap,d.element.css({right:f})),BI.isNotNull(c.tgap)&&(g+=c.tgap,d.element.css({top:g})),BI.isNotNull(c.bgap)&&(h+=c.bgap,d.element.css({bottom:h})),BI.isNotNull(b.width)&&d.element.css({width:b.width}),BI.isNotNull(b.height)&&d.element.css({height:b.height}),d},resize:function(){this.stroke(this.options.items)},populate:function(a){BI.AbsoluteLayout.superclass.populate.apply(this,arguments), +null!=b&&b.setRight(c||null),null!=c&&c.setLeft(b||null),this.children.splice(a,1)},removeAllChilds:function(){this.children=[]},addChild:function(a,b){var c=null;c=BI.isUndefined(b)?this.children.length-1:b-1,a.setParent(this),c>=0&&(this.getChild(c)&&this.getChild(c).setRight(a),a.setLeft(this.getChild(c))),BI.isUndefined(b)?this.children.push(a):this.children.splice(b,0,a)},equals:function(a){return this===a||this.id===a.id},clear:function(){this.parent=null,this.left=null,this.right=null,this.children=[]}},BI.extend(BI.Tree,{transformToArrayFormat:function(a,b){if(!a)return[];var c=[];if(BI.isArray(a))for(var d=0,e=a.length;d=this.x&&a<=this.x+this.w&&b>=this.y&&b<=this.y+this.h)},getPosition:function(){var a=[];return a.push(this.x+this.w/2),a.push(this.y+this.h/2),a}},BI.BehaviorFactory={createBehavior:function(a,b){var c;switch(a){case"highlight":c=BI.HighlightBehavior;break;case"redmark":c=BI.RedMarkBehavior}return new c(b)}},BI.Behavior=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.Behavior.superclass._defaultConfig.apply(this,arguments),{rule:function(){return!0}})},_init:function(){BI.Behavior.superclass._init.apply(this,arguments)},doBehavior:function(){}}),BI.Layout=BI.inherit(BI.Widget,{props:function(){return{scrollable:null,scrollx:!1,scrolly:!1,items:[]}},render:function(){this._init4Margin(),this._init4Scroll()},_init4Margin:function(){this.options.top&&this.element.css("top",this.options.top),this.options.left&&this.element.css("left",this.options.left),this.options.bottom&&this.element.css("bottom",this.options.bottom),this.options.right&&this.element.css("right",this.options.right)},_init4Scroll:function(){switch(this.options.scrollable){case!0:this.element.css("overflow","auto");break;case!1:this.element.css("overflow","hidden")}this.options.scrollx&&this.element.css({"overflow-x":"auto","overflow-y":"hidden"}),this.options.scrolly&&this.element.css({"overflow-x":"hidden","overflow-y":"auto"})},_mountChildren:function(){var a=this,b=document.createDocumentFragment(),c=!1;BI.each(this._children,function(d,e){e.element!==a.element&&(b.appendChild(e.element[0]),c=!0)}),c===!0&&this.element.append(b)},_getChildName:function(a){return a+""},_addElement:function(a,b){var c,d=this;return this.hasWidget(this._getChildName(a))?c=this.getWidgetByName(this._getChildName(a)):(c=BI.createWidget(b),c.on(BI.Events.DESTROY,function(){BI.each(d._children,function(a,b){b===c&&(BI.remove(d._children,b),d.removeItemAt(0|a))})}),this.addWidget(this._getChildName(a),c)),c},_getOptions:function(a){return a instanceof BI.Widget&&(a=a.options),a=BI.stripEL(a),a instanceof BI.Widget&&(a=a.options),a},_compare:function(a,b){function c(a,b,e,f){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;var g=Object.prototype.toString.call(a);switch(g){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var h="[object Array]"===g;if(!h){if(BI.isFunction(a)&&BI.isFunction(b))return!0;a=d._getOptions(a),b=d._getOptions(b)}e=e||[],f=f||[];for(var i=e.length;i--;)if(e[i]===a)return f[i]===b;if(e.push(a),f.push(b),h){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!c(a[i],b[i],e,f))return!1}else{var j,k=_.keys(a);if(i=k.length,_.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!_.has(b,j)||!c(a[j],b[j],e,f))return!1}return e.pop(),f.pop(),!0}var d=this;return c(a,b)},_getWrapper:function(){return this.element},_addItemAt:function(a,b){for(var c=this.options.items.length;c>a;c--)this._children[this._getChildName(c)]=this._children[this._getChildName(c-1)];delete this._children[this._getChildName(a)],this.options.items.splice(a,0,b)},_removeItemAt:function(a){for(var b=a;bthis.options.items.length)){this._addItemAt(a,b);var c=this._addElement(a,b);return a>0?this._children[this._getChildName(a-1)].element.after(c.element):c.element.prependTo(this._getWrapper()),c._mount(),c}},removeItemAt:function(a){a=BI.isArray(a)?a:[a];for(var b=[],c=[],d={},e=0,f=this.options.items.length;ethis.options.items.length-1)return!1;var c=this._children[this._getChildName(a)];return c.shouldUpdate?c.shouldUpdate(this._getOptions(b))===!0:null},updateItemAt:function(a,b){if(!(a<0||a>this.options.items.length-1)){var c,d=this._children[this._getChildName(a)];if(c=d.update(this._getOptions(b)))return c;var e=this._children[this._getChildName(a)];delete this._children[this._getChildName(a)],this.options.items.splice(a,1);var f=this._addElement(a,b);this.options.items.splice(a,0,b),this._children[this._getChildName(a)]=f,a>0?this._children[this._getChildName(a-1)].element.after(f.element):f.element.prependTo(this._getWrapper()),e._destroy(),f._mount()}},addItems:function(a){var b=this,c=this.options,d=document.createDocumentFragment(),e=[];BI.each(a,function(a,f){var g=b._addElement(c.items.length,f);b._children[b._getChildName(c.items.length)]=g,c.items.push(f),e.push(g),d.appendChild(g.element[0])}),this._getWrapper().append(d),BI.each(e,function(a,b){b._mount()})},prependItems:function(a){var b=this;a=a||[];for(var c=document.createDocumentFragment(),d=[],e=a.length-1;e>=0;e--){this._addItemAt(0,a[e]);var f=this._addElement(0,a[e]);b._children[b._getChildName(0)]=f,this.options.items.unshift(a[e]),d.push(f),c.appendChild(f.element[0])}this._getWrapper().prepend(c),BI.each(d,function(a,b){b._mount()})},getValue:function(){var a,b=this,c=[];return BI.each(this.options.items,function(d){if(a=b._children[b._getChildName(d)]){var e=a.getValue();e=BI.isArray(e)?e:[e],c=c.concat(e)}}),c},setValue:function(a){var b,c=this;BI.each(this.options.items,function(d){(b=c._children[c._getChildName(d)])&&b.setValue(a)})},setText:function(a){var b,c=this;BI.each(this.options.items,function(d){(b=c._children[c._getChildName(d)])&&b.setText(a)})},patchItem:function(a,b,c){var d=this.shouldUpdateItem(c,b);if(d===!0||null===d&&!this._compare(a,b))return this.updateItemAt(c,b)},updateChildren:function(a,b){function c(a,b,c,d){return a=j._getOptions(a),b=j._getOptions(b),BI.isKey(a.key)?a.key===b.key:c>=0?c===d:void 0}function d(a,b){var c=j._getOptions(a),d=null==c.key?b:c.key;return s[d]=j._addElement(d,a)}function e(a,b,c,e){for(;c<=e;++c){var f=d(b[c],c);g(f,a,!1,c)}}function f(a,b,c){for(;b<=c;++b){var d=j._getOptions(a[b]),e=null==d.key?b:d.key;s[e]._destroy()}}function g(a,b,c,d){a=j._getOptions(a),b=b&&j._getOptions(b);var e=BI.isKey(a.key)?a.key:d;if(b&&s[b.key]){var f,g=BI.isKey(b.key)?b.key:d;f=c?s[g].element.next():s[g].element,f.length>0?f.before(s[e].element):j._getWrapper().append(s[e].element)}else j._getWrapper().append(s[e].element)}var h,i,j=this,k=0,l=0,m=a.length-1,n=a[0],o=a[m],p=b.length-1,q=b[0],r=b[p],s={};for(BI.each(a,function(a,b){b=j._getOptions(b);var c=null==b.key?a:b.key;BI.isKey(c)&&(s[c]=j._children[j._getChildName(a)])});k<=m&&l<=p;)if(BI.isNull(n))n=a[++k];else if(BI.isNull(o))o=a[--m];else if(c(n,q,k,l))i=this.patchItem(n,q,k)||i,s[null==n.key?this._getChildName(k):n.key]=this._children[this._getChildName(k)],n=a[++k],q=b[++l];else if(c(o,r,m,p))i=this.patchItem(o,r,m)||i,s[null==o.key?this._getChildName(m):o.key]=this._children[this._getChildName(m)],o=a[--m],r=b[--p];else if(c(n,r))i=this.patchItem(n,r,k)||i,s[null==n.key?this._getChildName(k):n.key]=this._children[this._getChildName(k)],g(n,o,!0),n=a[++k],r=b[--p];else if(c(o,q))i=this.patchItem(o,q,m)||i,s[null==o.key?this._getChildName(m):o.key]=this._children[this._getChildName(m)],g(o,n),o=a[--m],q=b[++l];else{var t=d(q);g(t,n),q=b[++l]}return k>m?(h=BI.isNull(b[p+1])?null:b[p+1].elm,e(h,b,l,p)):l>p&&f(a,k,m),this._children={},BI.each(b,function(a,b){var c=j._getOptions(b),d=null==c.key?a:c.key;s[d]._mount(),j._children[j._getChildName(a)]=s[d]}),i},update:function(a){var b=this.options,c=a.items||[],d=this.updateChildren(b.items,c);return this.options.items=c,d},stroke:function(a){var b=this;BI.each(a,function(a,c){c&&b._addElement(a,c)})},removeWidget:function(a){var b;BI.isWidget(a)?BI.each(this._children,function(c,d){d===a&&(b=c)}):b=a,b&&this._removeItemAt(0|b)},empty:function(){BI.Layout.superclass.empty.apply(this,arguments),this.options.items=[]},destroy:function(){BI.Layout.superclass.destroy.apply(this,arguments),this.options.items=[]},populate:function(a){this.options;return a=a||[],this._isMounted?void this.update({items:a}):(this.options.items=a,void this.stroke(a))},resize:function(){}}),BI.shortcut("bi.layout",BI.Layout),BI.Action=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.Action.superclass._defaultConfig.apply(this,arguments),{src:null,tar:null})},_init:function(){BI.Action.superclass._init.apply(this,arguments)},actionPerformed:function(a,b,c){},actionBack:function(a,b,c){}}),BI.ActionFactory={createAction:function(a,b){var c;switch(a){case"show":c=BI.ShowAction}return new c(b)}},BI.ShowAction=BI.inherit(BI.Action,{_defaultConfig:function(){return BI.extend(BI.ShowAction.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ShowAction.superclass._init.apply(this,arguments)},actionPerformed:function(a,b,c){b=b||this.options.tar,b.setVisible(!0),c&&c()},actionBack:function(a,b,c){a=a||this.options.tar,a.setVisible(!1),c&&c()}}),BI.PopoverSection=BI.inherit(BI.Widget,{_init:function(){BI.PopoverSection.superclass._init.apply(this,arguments)},rebuildNorth:function(a){return!0},rebuildCenter:function(a){},rebuildSouth:function(a){return!1},close:function(){this.fireEvent(BI.PopoverSection.EVENT_CLOSE)},end:function(){}}),BI.PopoverSection.EVENT_CLOSE="EVENT_CLOSE",function(){function a(a){var b=""===a||null===a||void 0===a;return b}function b(a){return"Invalid Date"==a||"NaN"==a}function c(a,b){var c=b.indexOf("E"),d=b.substr(0,c),e=b.substr(c+1);if(/^[0\.-]+$/.test(a))a=BI._numberFormat(0,d)+"E"+BI._numberFormat(0,e);else{var f=a<0;f&&(a=a.substr(1));var g=(d.split(".")[0]||"").length,h=a.indexOf(".");h<0&&(h=a.length);var i=0;a=a.replace(".","");for(var j=a.length;i="1")break}var l=h-i-g,m=a.substr(i,g),n=i+g-a.length;if(n>0)for(var o=0;o-1)return a>=0?d(a+"",b.substring(0,c)):d(-a+"",b.substr(c+1));if(+a<0&&"-"!==b.charAt(0))return d(-a+"","-"+b);var g=a.split("."),h=b.split("."),i=g[0]||"",j=h[0]||"",k=g[1]||"",l=h[1]||"";if(/[%‰]$/.test(b)){var m=/[%]$/.test(b)?"00":"000";k+=m,i+=k.substr(0,m.length),i=i.replace(/^0+/gi,""),k=k.substr(m.length).replace(/0+$/gi,"")}var n=e(k,l);n.leftPlus&&(i=parseInt(i)+1+"",i=isNaN(i)?"1":i),n=n.num;var o=f(i,j);return/[0-9]/.test(o)||(o+="0"),/[0-9]/.test(n)?o+"."+n:o+n}function e(b,c){for(var d="",e=0,f=0,g=c.length;f4){k.leftPlus=!0;var l=d.match(/^[0-9]+/);if(l){var m=l[0],n=m.length,o=parseInt(m)+1+"";o.length>n?o=o.substr(1):(o=String.leftPad(o,n,"0"),k.leftPlus=!1),d=d.replace(/^[0-9]+/,o)}}return k.num=d,k}function f(b,c){for(var d="",e=b.length-1,f=-1,g=-1,h=c.length-1;h>=0;h--){var i=c.charAt(h),j=b.charAt(e);switch(i){case"0":a(j)&&(j="0"),g=-1,d=j+d,e--;break;case"#":g=h,d=j+d,e--;break;case",":if(!a(j)){var k=c.match(/,[#0]+/);k&&(f=k[0].length-1),d=","+d}break;default:d=i+d}}if(g>-1){var l=b.substr(0,e+1);d=d.substr(0,g)+l+d.substr(g)}if(f>0){var m=d.match(/[0-9]+,/);if(m){m=m[0];for(var n="",o=m.length-1-f;o>=0;o-=f)n=m.substr(o,f)+","+n;var p=m.substr(0,o+f);a(p)||(n=p+","+n)}d=d.replace(/[0-9]+,/,n)}return d}window.BI||(window.BI={}),BI.cjkEncode=function(a){if("string"!=typeof a)return a;for(var b="",c=0;c=128||91===d||93===d?"["+d.toString(16)+"]":a.charAt(c)}return b},BI.cjkEncodeDO=function(a){if(BI.isPlainObject(a)){var b={};return $.each(a,function(a,c){"string"!=typeof c&&(c=BI.jsonEncode(c)),a=BI.cjkEncode(a),b[a]=BI.cjkEncode(c)}),b}return a},BI.jsonEncode=function(a){var b=!!{}.hasOwnProperty,c={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},d=function(a){return/["\\\x00-\x1f]/.test(a)?'"'+a.replace(/([\x00-\x1f\\"])/g,function(a,b){var d=c[b];return d?d:(d=b.charCodeAt(),"\\u00"+Math.floor(d/16).toString(16)+(d%16).toString(16))})+'"':'"'+a+'"'},e=function(a){var b,c,d,e=["["],f=a.length;for(c=0;c2?Date._MN[b.getMonth()]:d<2?b.getMonth()+1:String.leftPad(b.getMonth()+1+"",2,"0");break;case"d":c=d>1?String.leftPad(b.getDate()+"",2,"0"):b.getDate();break;case"h":var f=b.getHours()%12;0===f&&(f=12),c=d>1?String.leftPad(f+"",2,"0"):f;break;case"H":c=d>1?String.leftPad(b.getHours()+"",2,"0"):b.getHours();break;case"m":c=d>1?String.leftPad(b.getMinutes()+"",2,"0"):b.getMinutes();break;case"s":c=d>1?String.leftPad(b.getSeconds()+"",2,"0"):b.getSeconds();break;case"a":c=b.getHours()<12?"am":"pm";break;case"z":c=b.getTimezone();break;default:c=a.str}return c}if(!a)return"";var d=b.length,e="";if(d>0){for(var f=b.charAt(0),g=0,h=f,i=1;i$("body").outerWidth()&&(l-=k.element.outerWidth()),m+k.element.outerHeight()>$("body").outerHeight()?(m-=k.element.outerHeight()+15,j=h.top-k.element.outerHeight()-5,!f.belowMouse&&(m=Math.min(m,j))):!f.belowMouse&&(m=Math.max(m,j)),k.element.css({left:l<0?0:l+"px",top:m<0?0:m+"px"}),k.element.hover(function(){g.remove(b),e.element.trigger("mouseleave.title"+e.getName())}),this}},add:function(a,b){return this.has(a)?this:(this.set(a,b),this)},get:function(a){ +return this.tooltipsManager[a]},set:function(a,b){this.tooltipsManager[a]=b},has:function(a){return null!=this.tooltipsManager[a]},remove:function(a){return this.has(a)?(this.tooltipsManager[a].destroy(),delete this.tooltipsManager[a],this):this}}),_.extend(BI,{Events:{KEYDOWN:"_KEYDOWN",BACKSPACE:"_BACKSPACE",SPACE:"_SPACE",ENTER:"_ENTER",CONFIRM:"_CONFIRM",ERROR:"_ERROR",PAUSE:"_PAUSE",DESTROY:"_DESTROY",UNMOUNT:"_UNMOUNT",CLEAR:"_CLEAR",ADD:"_ADD",EDITING:"_EDITING",EMPTY:"_EMPTY",VIEW:"_VIEW",RESIZE:"_RESIZE",BEFOREEDIT:"_BEFOREEDIT",AFTEREDIT:"_AFTEREDIT",STARTEDIT:"_STARTEDIT",STOPEDIT:"_STOPEDIT",CHANGE:"_CHANGE",EXPAND:"_EXPAND",COLLAPSE:"_COLLAPSE",CALLBACK:"_CALLBACK",CLICK:"_CLICK",STATECHANGE:"_STATECHANGE",BEFORESTATECHANGE:"_BEFORESTATECHANGE",INIT:"_INIT",AFTERINIT:"_AFTERINIT",SCROLL:"_SCROLL",STARTLOAD:"_STARTLOAD",AFTERLOAD:"_AFTERLOAD",BS:"beforesubmit",AS:"aftersubmit",SC:"submitcomplete",SF:"submitfailure",SS:"submitsuccess",BVW:"beforeverifywrite",AVW:"afterverifywrite",AV:"afterverify",BW:"beforewrite",AW:"afterwrite",WS:"writesuccess",WF:"writefailure",BA:"beforeappend",AA:"afterappend",BD:"beforedelete",AD:"beforedelete",UC:"unloadcheck",BTOPDF:"beforetopdf",ATOPDF:"aftertopdf",BTOEXCEL:"beforetoexcel",ATOEXCEL:"aftertoexcel",BTOWORD:"beforetoword",ATOWORD:"aftertoword",BTOIMAGE:"beforetoimage",ATOIMAGE:"aftertoimage",BTOHTML:"beforetohtml",ATOHTML:"aftertohtml",BIMEXCEL:"beforeimportexcel",AIMEXCEL:"afterimportexcel",BPDFPRINT:"beforepdfprint",APDFPRINT:"afterpdfprint",BFLASHPRINT:"beforeflashprint",AFLASHPRINT:"afterflashprint",BAPPLETPRINT:"beforeappletprint",AAPPLETPRINT:"afterappletprint",BSEVERPRINT:"beforeserverprint",ASERVERPRINT:"afterserverprint",BEMAIL:"beforeemail",AEMAIL:"afteremail"}}),BI.extend(jQuery.fn,{destroy:function(){this.remove(),BI.isIE()===!0&&(this[0].outerHTML="")},__textKeywordMarked__:function(a,b,c){if(!BI.isKey(b)||(a+"").length>100)return this.text((a+"").replaceAll(" "," "));b+="",b=BI.toUpperCase(b);var d=(a||"")+"";for(c=(c||BI.makeFirstPY(a))+"",null!=c&&(c=BI.toUpperCase(c)),this.empty();;){var e=BI.toUpperCase(d).indexOf(b),f=null;if(null!=c&&(f=c.indexOf(b),f>=0&&(f%=a.length)),e>=0)this.append(d.substr(0,e)),this.append($("").addClass("bi-keyword-red-mark").text(d.substr(e,b.length).replaceAll(" "," "))),d=d.substr(e+b.length),null!=c&&(c=c.substr(e+b.length));else{if(!(null!=f&&f>=0&&Math.floor(f/a.length)===Math.floor((f+b.length-1)/a.length))){this.append(d);break}this.append(d.substr(0,f)),this.append($("").addClass("bi-keyword-red-mark").text(d.substr(f,b.length).replaceAll(" "," "))),null!=c&&(c=c.substr(f+b.length)),d=d.substr(f+b.length)}}return this},getDomHeight:function(a){var b=$(this).clone();b.appendTo($(a||"body"));var c=b.height();return b.remove(),c},hasVerticalScroll:function(){return this.height()>0&&this[0].clientWidth0&&this[0].clientHeightb.left+this.outerWidth()||a.pageYb.top+this.outerHeight())},__hasZIndexMask__:function(a){return a&&null!=this.zIndexMask[a]},__buildZIndexMask__:function(a,b){this.zIndexMask=this.zIndexMask||{},this.indexMask=this.indexMask||[];var c=BI.createWidget({type:"bi.center_adapt",cls:"bi-z-index-mask",items:b});return c.element.css({"z-index":a}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:c,left:0,right:0,top:0,bottom:0}]}),this.indexMask.push(c),a&&(this.zIndexMask[a]=c),c.element},__releaseZIndexMask__:function(a){if(a&&this.zIndexMask[a])return this.indexMask.remove(this.zIndexMask[a]),void this.zIndexMask[a].destroy();this.indexMask=this.indexMask||[];var b=this.indexMask.pop();b&&b.destroy()}}),BI.extend(jQuery,{getLeftPosition:function(a,b,c){return{left:a.element.offset().left-b.element.outerWidth()-(c||0)}},getRightPosition:function(a,b,c){var d=a.element;return{left:d.offset().left+d.outerWidth()+(c||0)}},getTopPosition:function(a,b,c){return{top:a.element.offset().top-b.element.outerHeight()-(c||0)}},getBottomPosition:function(a,b,c){var d=a.element;return{top:d.offset().top+d.outerHeight()+(c||0)}},isLeftSpaceEnough:function(a,b,c){return $.getLeftPosition(a,b,c).left>=0},isRightSpaceEnough:function(a,b,c){var d=b.element.bounds(),e=$("body").bounds();return $.getRightPosition(a,b,c).left+d.width<=e.width},isTopSpaceEnough:function(a,b,c){return $.getTopPosition(a,b,c).top>=0},isBottomSpaceEnough:function(a,b,c){var d=b.element.bounds(),e=$("body").bounds();return $.getBottomPosition(a,b,c).top+d.height<=e.height},isRightSpaceLarger:function(a){var b=$("body").bounds();return b.width-a.element.offset().left-a.element.bounds().width>=a.element.offset().left},isBottomSpaceLarger:function(a){var b=$("body").bounds();return b.height-a.element.offset().top-a.element.bounds().height>=a.element.offset().top},getLeftAlignPosition:function(a,b,c){var d=b.element.bounds(),e=$("body").bounds(),f=a.element.offset().left+c;return f+d.width>e.width&&(f=e.width-d.width),f<0&&(f=0),{left:f}},getLeftAdaptPosition:function(a,b,c){return $.isLeftSpaceEnough(a,b,c)?$.getLeftPosition(a,b,c):{left:0}},getRightAlignPosition:function(a,b,c){var d=a.element.bounds(),e=b.element.bounds(),f=a.element.offset().left+d.width-e.width-c;return f<0&&(f=0),{left:f}},getRightAdaptPosition:function(a,b,c){return $.isRightSpaceEnough(a,b,c)?$.getRightPosition(a,b,c):{left:$("body").bounds().width-b.element.bounds().width}},getTopAlignPosition:function(a,b,c,d){var e,f,g=a.element.offset(),h=a.element.bounds(),i=b.element.bounds(),j=$("body").bounds();return $.isBottomSpaceEnough(a,b,-1*h.height+c)?e=g.top+c:d?(e=g.top+c,f=j.height-e):(e=j.height-i.height,ef.height?{top:0,adaptHeight:f.height-c}:{top:0}},getBottomAlignPosition:function(a,b,c,d){var e,f,g=a.element.offset(),h=a.element.bounds(),i=b.element.bounds(),j=$("body").bounds();return $.isTopSpaceEnough(a,b,-1*h.height+c)?e=g.top+h.height-i.height-c:d?(e=0,f=g.top+h.height-c):(e=0,i.height+c>j.height&&(f=j.height-c)),e<0&&(e=0),f?{top:e,adaptHeight:f}:{top:e}},getBottomAdaptPosition:function(a,b,c,d){var e=a.element.offset(),f=a.element.bounds(),g=b.element.bounds(),h=$("body").bounds();return $.isBottomSpaceEnough(a,b,c)?$.getBottomPosition(a,b,c):d?{top:e.top+f.height+c,adaptHeight:h.height-e.top-f.height-c}:g.height+c>h.height?{top:c,adaptHeight:h.height-c}:{top:h.height-g.height-c}},getCenterAdaptPosition:function(a,b){var c,d=a.element.offset(),e=a.element.bounds(),f=b.element.bounds(),g=$("body").bounds();return c=d.left+e.width/2+f.width/2>g.width?g.width-f.width:d.left+e.width/2-f.width/2,c<0&&(c=0),{left:c}},getMiddleAdaptPosition:function(a,b){var c,d=a.element.offset(),e=a.element.bounds(),f=b.element.bounds(),g=$("body").bounds();return c=d.top+e.height/2+f.height/2>g.height?g.height-f.height:d.top+e.height/2-f.height/2,c<0&&(c=0),{top:c}},getComboPositionByDirections:function(a,b,c,d,e,f){c||(c=0),d||(d=0);var g,h,i,j,k,l=[],m=[],n=!1,o=!1,p=!1;for(g=0;g-1?f===b?d?h.push(j):h[a]=j:d?i.push(j):i[a]=j:(k=g.indexOf(b),k>-1&&Math.floor(k/f.length)===Math.floor((k+b.length-1)/f.length)&&(f===b||b.length===f.length?d?h.push(j):h[a]=j:d?i.push(j):i[a]=j))}),{matched:h,finded:i}}}),BI.DOM={},BI.extend(BI.DOM,{hang:function(a){if(!BI.isEmpty(a)){var b=document.createDocumentFragment();return BI.each(a,function(a,c){c instanceof BI.Widget&&(c=c.element),c instanceof $&&c[0]&&b.appendChild(c[0])}),b}},isExist:function(a){return $("body").find(a.element).length>0},preloadImages:function(a,b){function c(){d++,d>=a.length&&b()}var d=0,e=[];BI.each(a,function(a,b){e[a]=new Image,e[a].src=b,e[a].onload=function(){c()},e[a].onerror=function(){c()}})},isColor:function(a){return a&&(this.isRGBColor(a)||this.isHexColor(a))},isRGBColor:function(a){return!!a&&"rgb"===a.substr(0,3)},isHexColor:function(a){return!!a&&("#"===a[0]&&7===a.length)},isDarkColor:function(a){if(!a||!this.isHexColor(a))return!1;var b=this.rgb2json(this.hex2rgb(a)),c=Math.round(.299*b.r+.587*b.g+.114*b.b);return c<192},getContrastColor:function(a){return a&&this.isColor(a)?this.isDarkColor(a)?"#ffffff":"#1a1a1a":""},rgb2hex:function(a){if(!a||"rgb"!=a.substr(0,3))return"";var b=a.match(/\d+(\.\d+)?/g),c=BI.parseInt(b[0]),d=BI.parseInt(b[1]),e=BI.parseInt(b[2]),f="#"+this.int2hex(c)+this.int2hex(d)+this.int2hex(e);return f},rgb2json:function(a){if(!a)return{};if(!this.isRGBColor(a))return{};var b=a.match(/\d+(\.\d+)?/g);return{r:BI.parseInt(b[0]),g:BI.parseInt(b[1]),b:BI.parseInt(b[2])}},rgba2json:function(a){if(!a)return{};var b=a.match(/\d+(\.\d+)?/g);return{r:BI.parseInt(b[0]),g:BI.parseInt(b[1]),b:BI.parseInt(b[2]),a:BI.parseFloat(b[3])}},json2rgb:function(a){return BI.isKey(a.r)&&BI.isKey(a.g)&&BI.isKey(a.b)?"rgb("+a.r+","+a.g+","+a.b+")":""},json2rgba:function(a){return BI.isKey(a.r)&&BI.isKey(a.g)&&BI.isKey(a.b)?"rgba("+a.r+","+a.g+","+a.b+","+a.a+")":""},int2hex:function(a){var b=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];return b[a>>>4]+""+b[15&a]},hex2rgb:function(a){if(!a)return"";if(!this.isHexColor(a))return a;var b,c="rgb(";return 7===a.length?b=[BI.parseInt("0x"+a.substring(1,3)),BI.parseInt("0x"+a.substring(3,5)),BI.parseInt("0x"+a.substring(5,7))]:4===a.length&&(b=[BI.parseInt("0x"+a.substring(1,2)),BI.parseInt("0x"+a.substring(2,3)),BI.parseInt("0x"+a.substring(3,4))]),c+=b[0]+",",c+=b[1]+",",c+=b[2]+")"},rgba2rgb:function(a,b){if(BI.isNull(b)&&(b=1),"rgba"!=a.substr(0,4))return"";var c=a.match(/\d+(\.\d+)?/g);if(c.length<4)return"";var d=BI.parseFloat(c[0]),e=BI.parseFloat(c[1]),f=BI.parseFloat(c[2]),g=BI.parseFloat(c[3]);return"rgb("+Math.floor(255*(b*(1-g))+d*g)+","+Math.floor(255*(b*(1-g))+e*g)+","+Math.floor(255*(b*(1-g))+f*g)+")"},getTextSizeWidth:function(a,b){var c=$("").addClass("text-width-span").appendTo($("body"));null==b&&(b=12),b+="px",c.css("font-size",b).text(a);var d=c.width();return c.remove(),d},getScrollWidth:function(){if(null==this._scrollWidth){var a=$("
").width(50).height(50).css({position:"absolute",top:"-9999px",overflow:"scroll"}).appendTo($("body"));this._scrollWidth=a[0].offsetWidth-a[0].clientWidth,a.destroy()}return this._scrollWidth}}),BI.ShowListener=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.ShowListener.superclass._defaultConfig.apply(this,arguments),{eventObj:BI.createWidget(),cardLayout:null,cardNameCreator:function(a){return a},cardCreator:BI.emptyFn,afterCardCreated:BI.emptyFn,afterCardShow:BI.emptyFn})},_init:function(){BI.ShowListener.superclass._init.apply(this,arguments);var a=this,b=this.options;b.eventObj.on(BI.Controller.EVENT_CHANGE,function(c,d,e){if(c===BI.Events.CLICK){if(d=d||b.eventObj.getValue(),d=BI.isArray(d)?d.length>1?d.toString():d[0]:d,BI.isNull(d))throw new Error("value cannot be null");var f=b.cardNameCreator(d);if(!b.cardLayout.isCardExisted(f)){var g=b.cardCreator(f);b.cardLayout.addCardByName(f,g),b.afterCardCreated(f)}b.cardLayout.showCardByName(f),BI.nextTick(function(){b.afterCardShow(f),a.fireEvent(BI.ShowListener.EVENT_CHANGE,f)})}})}}),BI.ShowListener.EVENT_CHANGE="ShowListener.EVENT_CHANGE",BI.StyleLoaderManager=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.StyleLoaderManager.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.StyleLoaderManager.superclass._init.apply(this,arguments),this.stylesManager={}},loadStyle:function(a,b){var c=document,d=c.createElement("style");return c.getElementsByTagName("head")[0].appendChild(d),d.setAttribute("type","text/css"),d.styleSheet?d.styleSheet.cssText=b:d.appendChild(document.createTextNode(b)),this.stylesManager[a]=d,this},get:function(a){return this.stylesManager[a]},has:function(a){return null!=this.stylesManager[a]},removeStyle:function(a){return this.has(a)?(this.stylesManager[a].parentNode.removeChild(this.stylesManager[a]),delete this.stylesManager[a],this):this}}),BI.Logic=BI.inherit(BI.OB,{createLogic:function(){return this.options||{}}}),BI.LogicFactory={Type:{Vertical:"vertical",Horizontal:"horizontal",Table:"table",HorizontalFill:"horizontal_fill"},createLogic:function(a,b){var c;switch(a){case BI.LogicFactory.Type.Vertical:c=BI.VerticalLayoutLogic;break;case BI.LogicFactory.Type.Horizontal:c=BI.HorizontalLayoutLogic;break;case BI.LogicFactory.Type.Table:c=BI.TableLayoutLogic;break;case BI.LogicFactory.Type.HorizontalFill:c=BI.HorizontalFillLayoutLogic;break;default:c=BI.Logic}return new c(b).createLogic()},createLogicTypeByDirection:function(a){switch(a){case BI.Direction.Top:case BI.Direction.Bottom:case BI.Direction.Custom:return BI.LogicFactory.Type.Vertical;case BI.Direction.Left:case BI.Direction.Right:return BI.LogicFactory.Type.Horizontal}},createLogicItemsByDirection:function(a){var b,c=Array.prototype.slice.call(arguments,1);switch(c=BI.map(c,function(a,b){return BI.isWidget(b)?{el:b,width:b.options.width,height:b.options.height}:b}),a){case BI.Direction.Bottom:b=BI.LogicFactory.Type.Vertical,c.reverse();break;case BI.Direction.Right:b=BI.LogicFactory.Type.Horizontal,c.reverse();break;case BI.Direction.Custom:c=c.slice(1)}return c}},BI.VerticalLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.VerticalLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var a,b=this.options;return a=b.dynamic?"bi.vertical":"bi.vtape",{type:a,scrollable:b.scrollable,scrolly:b.scrolly,scrollx:b.scrollx,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,items:b.items}},_init:function(){BI.VerticalLayoutLogic.superclass._init.apply(this,arguments)}}),BI.HorizontalLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.HorizontalLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var a,b=this.options;return a=b.dynamic?"bi.vertical_adapt":"bi.htape",{type:a,scrollable:b.scrollable,scrolly:b.scrolly,scrollx:b.scrollx,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,items:b.items}},_init:function(){BI.HorizontalLayoutLogic.superclass._init.apply(this,arguments)}}),BI.TableLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.TableLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,columns:0,rows:0,columnSize:[],rowSize:[],hgap:0,vgap:0,items:[]})},createLogic:function(){var a,b=this.options;return a=b.dynamic?"bi.table":"bi.window",{type:a,scrollable:b.scrollable,scrolly:b.scrolly,scrollx:b.scrollx,columns:b.columns,rows:b.rows,columnSize:b.columnSize,rowSize:b.rowSize,hgap:b.hgap,vgap:b.vgap,items:b.items}},_init:function(){BI.TableLayoutLogic.superclass._init.apply(this,arguments)}}),BI.HorizontalFillLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.HorizontalFillLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var a,b=this.options,c=[];return BI.each(b.items,function(a,b){c.push(b.width||0)}),a=b.dynamic?"bi.horizontal_adapt":"bi.htape",{type:a,columnSize:c,scrollable:b.scrollable,scrolly:b.scrolly,scrollx:b.scrollx,hgap:b.hgap,vgap:b.vgap,lgap:b.lgap,rgap:b.rgap,tgap:b.tgap,bgap:b.bgap,items:b.items}},_init:function(){BI.HorizontalFillLayoutLogic.superclass._init.apply(this,arguments)}}),BI.Plugin=BI.Plugin||{},function(){var a={},b={};BI.extend(BI.Plugin,{getWidget:function(b,c){if(a[b])for(var d,e=a[b].length-1;e>=0;e--)if(d=a[b][e](c))return d;return c},registerWidget:function(b,c){a[b]||(a[b]=[]),a[b].length>0&&console.log("组件已经注册过了!"),a[b].push(c)},relieveWidget:function(b){delete a[b]},getObject:function(a,c){if(b[a])for(var d,e=0,f=b[a].length;e0&&console.log("对象已经注册过了!"),b[a].push(c)},relieveObject:function(a){delete b[a]}})}(),$.extend(Array.prototype,{contains:function(a){return this.indexOf(a)>-1},remove:function(a){var b=this.indexOf(a);return b!==-1&&this.splice(b,1),this},pushArray:function(a){for(var b=0;b=0;a--){var b=localStorage.key(a);b&&0===b.indexOf(BI.Cache._getKeyPrefix())&&localStorage.removeItem(b)}},keys:function(){for(var a=[],b=localStorage.length;b>=0;b--){var c=localStorage.key(b);if(c){var d=BI.Cache._getKeyPrefix();0===c.indexOf(d)&&(a[a.length]=c.substring(d.length))}}return a},addCookie:function(a,b,c,d){var e=a+"="+escape(b);if(d&&d>0){var f=new Date;f.setTime(f.getTime()+3600*d*1e3),e=e+"; expires="+f.toGMTString()}c&&(e=e+"; path="+c),document.cookie=e},getCookie:function(a){var b,c=new RegExp("(^| )"+a+"=([^;]*)(;|$)");return(b=document.cookie.match(c))?unescape(b[2]):null},deleteCookie:function(a,b){var c=new Date;c.setTime(c.getTime()-1e4);var d=a+"=v; expires="+c.toGMTString();b&&(d=d+"; path="+b),document.cookie=d}},Date._DN=[BI.i18nText("BI-Basic_Sunday"),BI.i18nText("BI-Basic_Monday"),BI.i18nText("BI-Basic_Tuesday"),BI.i18nText("BI-Basic_Wednesday"),BI.i18nText("BI-Basic_Thursday"),BI.i18nText("BI-Basic_Friday"),BI.i18nText("BI-Basic_Saturday"),BI.i18nText("BI-Basic_Sunday")],Date._SDN=[BI.i18nText("BI-Basic_Simple_Sunday"),BI.i18nText("BI-Basic_Simple_Monday"),BI.i18nText("BI-Basic_Simple_Tuesday"),BI.i18nText("BI-Basic_Simple_Wednesday"),BI.i18nText("BI-Basic_Simple_Thursday"),BI.i18nText("BI-Basic_Simple_Friday"),BI.i18nText("BI-Basic_Simple_Saturday"),BI.i18nText("BI-Basic_Simple_Sunday")],Date._FD=1,Date._MN=[BI.i18nText("BI-Basic_January"),BI.i18nText("BI-Basic_February"),BI.i18nText("BI-Basic_March"),BI.i18nText("BI-Basic_April"),BI.i18nText("BI-Basic_May"),BI.i18nText("BI-Basic_June"),BI.i18nText("BI-Basic_July"),BI.i18nText("BI-Basic_August"),BI.i18nText("BI-Basic_September"),BI.i18nText("BI-Basic_October"),BI.i18nText("BI-Basic_November"),BI.i18nText("BI-Basic_December")],Date._SMN=[0,1,2,3,4,5,6,7,8,9,10,11],Date._QN=["",BI.i18nText("BI-Quarter_1"),BI.i18nText("BI-Quarter_2"),BI.i18nText("BI-Quarter_3"),BI.i18nText("BI-Quarter_4")],Date._MD=[31,28,31,30,31,30,31,31,30,31,30,31],Date.SECOND=1e3,Date.MINUTE=60*Date.SECOND,Date.HOUR=60*Date.MINUTE,Date.DAY=24*Date.HOUR,Date.WEEK=7*Date.DAY,Date.prototype.getTimezone=function(){return this.toString().replace(/^.* (?:\((.*)\)|([A-Z]{1,4})(?:[\-+][0-9]{4})?(?: -?\d+)?)$/,"$1$2").replace(/[^A-Z]/g,"")},Date.prototype.getMonthDays=function(a){var b=this.getFullYear();return"undefined"==typeof a&&(a=this.getMonth()),0!=b%4||0==b%100&&0!=b%400||1!=a?Date._MD[a]:29},Date.prototype.getLastDateOfMonth=function(){return new Date(this.getFullYear(),this.getMonth(),this.getMonthDays())},Date.prototype.getDayOfYear=function(){var a=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),b=new Date(this.getFullYear(),0,0,0,0,0),c=a-b;return Math.floor(c/Date.DAY)},Date.prototype.getWeekNumber=function(){var a=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),b=a.getDay();if(0===this.getMonth()&&this.getDate()<=b)return 1;a.setDate(this.getDate()-b);var c=a.valueOf();a.setMonth(0),a.setDate(1);var d=Math.floor((c-a.valueOf())/6048e5)+1;return a.getDay()>0&&d++,d},Date.prototype.getOffsetDate=function(a){return new Date(this.getTime()+864e5*a)},Date.prototype.getAfterMulQuarter=function(a){var b=new Date(this.getTime());return b.setMonth(b.getMonth()+3*a),b},Date.prototype.getBeforeMulQuarter=function(a){var b=new Date(this.getTime());return b.setMonth(b.getMonth()-3*a),b},Date.prototype.getQuarterStartMonth=function(){var a=0,b=this.getMonth();return b<3&&(a=0),28&&(a=9),a},Date.prototype.getQuarterStartDate=function(){return new Date(this.getFullYear(),this.getQuarterStartMonth(),1)},Date.prototype.getQuarterEndDate=function(){var a=this.getQuarterStartMonth()+2;return new Date(this.getFullYear(),a,this.getMonthDays(a))},Date.prototype.getAfterMultiMonth=function(a){var b=new Date(this.getTime());return b.setMonth(b.getMonth()+a|0),b},Date.prototype.getBeforeMultiMonth=function(a){var b=new Date(this.getTime());return b.setMonth(b.getMonth()-a|0),b},Date.prototype.getAfterMulQuarter=function(a){var b=new Date(this.getTime());return b.setMonth(b.getMonth()+3*a),b},Date.prototype.getBeforeMulQuarter=function(a){var b=new Date(this.getTime());return b.setMonth(b.getMonth()-3*a),b},Date.prototype.getQuarterStartMonth=function(){var a=0,b=this.getMonth();return b<3&&(a=0),28&&(a=9),a},Date.prototype.getOffsetMonth=function(a){var b=new Date(this.getTime()),c=b.getDate(),d=new Date(b.getFullYear(),b.getMonth()+parseInt(a),1).getMonthDays();return c>d&&(c=d),b.setDate(c),b.setMonth(b.getMonth()+parseInt(a)),b},Date.prototype.getWeekStartDate=function(){var a=this.getDay();return this.getOffsetDate(-a)},Date.prototype.getWeekEndDate=function(){var a=this.getDay(),b=0===a?6:6-a;return this.getOffsetDate(b)},Date.prototype.getQuarterStartDate=function(){return new Date(this.getFullYear(),this.getQuarterStartMonth(),1)},Date.prototype.getQuarterEndDate=function(){var a=this.getQuarterStartMonth()+2;return new Date(this.getFullYear(),a,this.getMonthDays(a))},Date.prototype.getAfterMultiMonth=function(a){var b=new Date(this.getTime());return b.setMonth(b.getMonth()+a|0),b},Date.prototype.getBeforeMultiMonth=function(a){var b=new Date(this.getTime());return b.setMonth(b.getMonth()-a|0),b},Date.prototype.equalsTo=function(a){return this.getFullYear()==a.getFullYear()&&this.getMonth()==a.getMonth()&&this.getDate()==a.getDate()&&this.getHours()==a.getHours()&&this.getMinutes()==a.getMinutes()&&this.getSeconds()==a.getSeconds()},Date.prototype.setDateOnly=function(a){var b=new Date(a);this.setDate(1),this.setFullYear(b.getFullYear()),this.setMonth(b.getMonth()),this.setDate(b.getDate())},Date.prototype.print=function(a){var b=this.getMonth(),c=this.getDate(),d=this.getFullYear(),e=this.getWeekNumber(),f=this.getDay(),g={},h=this.getHours(),i=h>=12,j=i?h-12:h,k=this.getDayOfYear();0==j&&(j=12);var l=this.getMinutes(),m=this.getSeconds();g["%a"]=Date._SDN[f],g["%A"]=Date._DN[f],g["%b"]=Date._SMN[b],g["%B"]=Date._MN[b],g["%C"]=1+Math.floor(d/100),g["%d"]=c<10?"0"+c:c,g["%e"]=c,g["%H"]=h<10?"0"+h:h,g["%I"]=j<10?"0"+j:j,g["%j"]=k<100?k<10?"00"+k:"0"+k:k,g["%k"]=h,g["%l"]=j,g["%X"]=b<9?"0"+(1+b):1+b,g["%x"]=b+1,g["%M"]=l<10?"0"+l:l,g["%n"]="\n",g["%p"]=i?"PM":"AM",g["%P"]=i?"pm":"am",g["%s"]=Math.floor(this.getTime()/1e3),g["%S"]=m<10?"0"+m:m,g["%t"]="\t",g["%U"]=g["%W"]=g["%V"]=e<10?"0"+e:e,g["%u"]=f+1,g["%w"]=f,g["%y"]=(""+d).substr(2,2),g["%Y"]=d,g["%%"]="%";var n=/%./g;if(!BI.isKhtml())return a.replace(n,function(a){return g[a]||a});for(var o=a.match(n),p=0;pe[0]?f=["y",1]:a>=d[0]&&a<=e[0]&&(a==d[0]&&(be[1]?f=["m",1]:b==e[1]&&c>e[2]&&(f=["d",1]))),f},Date.checkLegal=function(a){var b=a.match(/\d+/g),c=0|b[0],d=0|b[1],e=0|b[2];if(b.length<=1)return!0;if(b.length<=2)return d>=1&&d<=12;var f=Date._MD.slice(0);return f[1]=Date.isLeap(c)?29:28,d>=1&&d<=12&&e<=f[d-1]},Date.parseDateTime=function(a,b){var c=new Date,d=0,e=0,f=1,g=a.split(/\W+/);if("%y%x"==b.toLowerCase()||"%y%x%d"==b.toLowerCase()){var h=4,i=2;g[0]=a.substring(0,h),g[1]=a.substring(h,h+i),g[2]=a.substring(h+i,h+2*i)}var j=b.match(/%./g),k=0,l=0,m=0,n=0,o=0;for(k=0;k29?1900:2e3);break;case"%b":case"%B":for(l=0;l<12;++l)if(Date._MN[l].substr(0,g[k].length).toLowerCase()==g[k].toLowerCase()){e=l;break}break;case"%H":case"%I":case"%k":case"%l":m=parseInt(g[k],10);break;case"%P":case"%p":/pm/i.test(g[k])&&m<12?m+=12:/am/i.test(g[k])&&m>=12&&(m-=12);break;case"%M":n=parseInt(g[k],10);case"%S":o=parseInt(g[k],10)}if(isNaN(d)&&(d=c.getFullYear()),isNaN(e)&&(e=c.getMonth()),isNaN(f)&&(f=c.getDate()),isNaN(m)&&(m=c.getHours()),isNaN(n)&&(n=c.getMinutes()),isNaN(o)&&(o=c.getSeconds()),0!=d)return new Date(d,e,f,m,n,o);for(d=0,e=-1,f=0,k=0;k31&&0==d?(d=parseInt(g[k],10),d<100&&(d+=d>29?1900:2e3)):0==f&&(f=g[k]);return 0==d&&(d=c.getFullYear()),e!=-1&&0!=f?new Date(d,e,f,m,n,o):c},$.extend($.Event.prototype,{stopEvent:function(){this.stopPropagation(),this.preventDefault()}}),Function.prototype.before=function(a){var b=this;return function(){return a.apply(this,arguments)!==!1&&b.apply(this,arguments)}},Function.prototype.after=function(a){var b=this;return function(){var c=b.apply(this,arguments);return c!==!1&&(a.apply(this,arguments),c)}},jQuery&&!function(a){a.fn.insets||(a.fn.insets=function(){var a=this.padding(),b=this.border();return{top:a.top,bottom:a.bottom+b.bottom+b.top,left:a.left,right:a.right+b.right+b.left}}),a.fn.bounds||(a.fn.bounds=function(a){var b={hasIgnoredBounds:!0};return a?(isNaN(a.x)||(b.left=a.x),isNaN(a.y)||(b.top=a.y),null!=a.width&&(b.width=a.width-(this.outerWidth(!0)-this.width()),b.width=b.width>=0?b.width:a.width),null!=a.height&&(b.height=a.height-(this.outerHeight(!0)-this.height()),b.height=b.height>=0?b.height:a.height),this.css(b),this):(b=this.position(),{x:b.left,y:b.top,width:this.outerWidth(),height:this.outerHeight()})})}(jQuery),Number.prototype.toFixed&&"0.000"===8e-5.toFixed(3)&&"0"!==.9.toFixed(0)&&"1.25"===1.255.toFixed(2)&&"1000000000000000128"===(0xde0b6b3a7640080).toFixed(0)||!function(){function a(a,b){for(var c=-1;++c=0;)c+=h[b],h[b]=Math.floor(c/a),c=c%a*f}function c(){for(var a=g,b="";--a>=0;)if(""!==b||0===a||0!==h[a]){var c=String(h[a]);""===b?b=c:b+="0000000".slice(0,7-c.length)+c}return b}function d(a,b,c){return 0===b?c:b%2===1?d(a,b-1,c*a):d(a*a,b/2,c)}function e(a){for(var b=0;a>=4096;)b+=12,a/=4096;for(;a>=2;)b+=1,a/=2;return b}var f,g,h;f=1e7,g=6,h=[0,0,0,0,0,0],Number.prototype.toFixed=function(f){var g,h,i,j,k,l,m,n;if(g=Number(f),g=g!==g?0:Math.floor(g),g<0||g>20)throw new RangeError("Number.toFixed called with invalid number of decimals");if(h=Number(this),h!==h)return"NaN";if(h<=-1e21||h>1e21)return String(h);if(i="",h<0&&(i="-",h=-h),j="0",h>1e-21)if(k=e(h*d(2,69,1))-69,l=k<0?h*d(2,-k,1):h/d(2,k,1),l*=4503599627370496,k=52-k,k>0){for(a(0,l),m=g;m>=7;)a(1e7,0),m-=7;for(a(d(10,m,1),0),m=k-1;m>=23;)b(1<<23),m-=23;b(1<0?(n=j.length,j=n<=g?i+"0.0000000000000000000".slice(0,g-n+2)+j:i+j.slice(0,n-g)+"."+j.slice(n-g)):j=i+j,j}}(),Number.prototype.add=function(a){return accAdd(a,this)},Number.prototype.sub=function(a){return accSub(this,a)},Number.prototype.mul=function(a){return accMul(a,this); +},Number.prototype.div=function(a){return accDiv(this,a)},$.extend(String.prototype,{startWith:function(a){return!(null==a||""==a||0===this.length||a.length>this.length)&&this.substr(0,a.length)==a},endWith:function(a){return!(null==a||""==a||0===this.length||a.length>this.length)&&this.substring(this.length-a.length)==a},getQuery:function(a){var b=new RegExp("(^|&)"+a+"=([^&]*)(&|$)"),c=this.substr(this.indexOf("?")+1).match(b);return c?unescape(c[2]):null},appendQuery:function(a){if(!a)return this;var b=this;return b.indexOf("?")===-1&&(b+="?"),b.endWith("?")!==!1||(b+="&"),$.each(a,function(a,c){"string"==typeof a&&(b+=a+"="+c+"&")}),b=b.substr(0,b.length-1)},replaceAll:function(a,b){return this.replace(new RegExp(a,"gm"),b)},perfectStart:function(a){return this.startWith(a)?this:a+this},allIndexOf:function(a){if("string"!=typeof a)return[];for(var b=this,c=[],d=0;b.length>0;){var e=b.indexOf(a);if(e===-1)break;c.push(d+e),b=b.substring(e+a.length,b.length),d+=e+a.length}return c}}),$.extend(String,{escape:function(a){return a.replace(/('|\\)/g,"\\$1")},leftPad:function(a,b,c){var d=String(a);for(c||(c=" ");d.length").attr({cellspacing:0,cellpadding:0}).css({position:"relative",width:"100%",height:"100%","white-space":"nowrap","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.$tr=$("
"),this.$tr.appendTo(this.$table),this.populate(this.options.items)},_addElement:function(a,b){var c,d=this.options,e=d.columnSize[a]<=1?100*d.columnSize[a]+"%":d.columnSize[a];if(this.hasWidget(this._getChildName(a)))c=this.getWidgetByName(this._getChildName(a)),c.element.attr("width",e);else{var f=BI.createWidget(b);f.element.css({position:"relative",top:"0",left:"0",margin:"0px auto"}),c=BI.createWidget({type:"bi.default",tagName:"td",attributes:{width:e},items:[f]}),this.addWidget(this._getChildName(a),c)}return c.element.css({"max-width":d.columnSize[a]}),0===a&&c.element.addClass("first-element"),c.element.css({position:"relative",height:"100%","vertical-align":"middle",margin:"0",padding:"0",border:"none"}),d.hgap+d.lgap+(b.lgap||0)!==0&&f.element.css({"margin-left":d.hgap+d.lgap+(b.lgap||0)+"px"}),d.hgap+d.rgap+(b.rgap||0)!==0&&f.element.css({"margin-right":d.hgap+d.rgap+(b.rgap||0)+"px"}),d.vgap+d.tgap+(b.tgap||0)!==0&&f.element.css({"margin-top":d.vgap+d.tgap+(b.tgap||0)+"px"}),d.vgap+d.bgap+(b.bgap||0)!==0&&f.element.css({"margin-bottom":d.vgap+d.bgap+(b.bgap||0)+"px"}),c},_mountChildren:function(){var a=this,b=document.createDocumentFragment(),c=!1;BI.each(this._children,function(d,e){e.element!==a.element&&(b.appendChild(e.element[0]),c=!0)}),c===!0&&(this.$tr.append(b),this.element.append(this.$table))},resize:function(){},_getWrapper:function(){return this.$tr},populate:function(a){BI.CenterAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.center_adapt",BI.CenterAdaptLayout),BI.HorizontalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizontal-adapt-layout",verticalAlign:BI.VerticalAlign.Top,columnSize:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.HorizontalAdaptLayout.superclass.render.apply(this,arguments),this.$table=$("
").attr({cellspacing:0,cellpadding:0}).css({position:"relative",width:"100%","white-space":"nowrap","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.$tr=$(""),this.$tr.appendTo(this.$table),this.populate(this.options.items)},_addElement:function(a,b){var c,d=this.options,e=d.columnSize[a]<=1?100*d.columnSize[a]+"%":d.columnSize[a];if(this.hasWidget(this._getChildName(a)))c=this.getWidgetByName(this._getChildName(a)),c.element.attr("width",e);else{var f=BI.createWidget(b);f.element.css({position:"relative",top:"0",left:"0",margin:"0px auto"}),c=BI.createWidget({type:"bi.default",tagName:"td",attributes:{width:e},items:[f]}),this.addWidget(this._getChildName(a),c)}return c.element.css({"max-width":d.columnSize[a]+"px"}),0===a&&c.element.addClass("first-element"),c.element.css({position:"relative","vertical-align":d.verticalAlign,margin:"0",padding:"0",border:"none"}),d.hgap+d.lgap+(b.lgap||0)!==0&&f.element.css({"margin-left":d.hgap+d.lgap+(b.lgap||0)+"px"}),d.hgap+d.rgap+(b.rgap||0)!==0&&f.element.css({"margin-right":d.hgap+d.rgap+(b.rgap||0)+"px"}),d.vgap+d.tgap+(b.tgap||0)!==0&&f.element.css({"margin-top":d.vgap+d.tgap+(b.tgap||0)+"px"}),d.vgap+d.bgap+(b.bgap||0)!==0&&f.element.css({"margin-bottom":d.vgap+d.bgap+(b.bgap||0)+"px"}),c},_mountChildren:function(){var a=this,b=document.createDocumentFragment(),c=!1;BI.each(this._children,function(d,e){e.element!==a.element&&(b.appendChild(e.element[0]),c=!0)}),c===!0&&(this.$tr.append(b),this.element.append(this.$table))},resize:function(){},_getWrapper:function(){return this.$tr},populate:function(a){BI.HorizontalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_adapt",BI.HorizontalAdaptLayout),BI.LeftRightVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-left-right-vertical-adapt-layout",items:{},llgap:0,lrgap:0,lhgap:0,rlgap:0,rrgap:0,rhgap:0})},render:function(){BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},addItem:function(){throw new Error("cannot be added")},stroke:function(a){var b=this.options;if("left"in a){var c=BI.createWidget({type:"bi.vertical_adapt",items:a.left,hgap:b.lhgap,lgap:b.llgap,rgap:b.lrgap});c.element.css("height","100%"),BI.createWidget({type:"bi.left",element:this,items:[c]})}if("right"in a){var d=BI.createWidget({type:"bi.vertical_adapt",items:a.right,hgap:b.rhgap,lgap:b.rlgap,rgap:b.rrgap});d.element.css("height","100%"),BI.createWidget({type:"bi.right",element:this,items:[d]})}},populate:function(a){BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.left_right_vertical_adapt",BI.LeftRightVerticalAdaptLayout),BI.LeftVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-left-vertical-adapt-layout",items:[],lgap:0,rgap:0,hgap:0})},render:function(){BI.LeftVerticalAdaptLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},addItem:function(){throw new Error("cannot be added")},stroke:function(a){var b=this.options,c=BI.createWidget({type:"bi.vertical_adapt",items:a,lgap:b.lgap,hgap:b.hgap,rgap:b.rgap});c.element.css("height","100%"),BI.createWidget({type:"bi.left",element:this,items:[c]})},populate:function(a){BI.LeftVerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.left_vertical_adapt",BI.LeftVerticalAdaptLayout),BI.RightVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.RightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-right-vertical-adapt-layout",items:[],lgap:0,rgap:0,hgap:0})},render:function(){BI.RightVerticalAdaptLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},addItem:function(){throw new Error("cannot be added")},stroke:function(a){var b=this.options,c=BI.createWidget({type:"bi.vertical_adapt",items:a,lgap:b.lgap,hgap:b.hgap,rgap:b.rgap});c.element.css("height","100%"),BI.createWidget({type:"bi.right",element:this,items:[c]})},populate:function(a){BI.RightVerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.right_vertical_adapt",BI.RightVerticalAdaptLayout),BI.VerticalAdaptLayout=BI.inherit(BI.Layout,{props:{baseCls:"bi-vertical-adapt-layout",columnSize:[],horizontalAlign:BI.HorizontalAlign.Left,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0},render:function(){BI.VerticalAdaptLayout.superclass.render.apply(this,arguments);var a=this.options;this.$table=$("
").attr({cellspacing:0,cellpadding:0}).css({position:"relative",width:a.horizontalAlign===BI.HorizontalAlign.Stretch?"100%":"auto",height:"100%","white-space":"nowrap","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.$tr=$(""),this.$tr.appendTo(this.$table),this.populate(this.options.items)},_addElement:function(a,b){var c,d=this.options,e=d.columnSize[a]<=1?100*d.columnSize[a]+"%":d.columnSize[a];if(this.hasWidget(this._getChildName(a)))c=this.getWidgetByName(this._getChildName(a)),c.element.attr("width",e);else{var f=BI.createWidget(b);f.element.css({position:"relative",top:"0",left:"0",margin:"0px auto"}),c=BI.createWidget({type:"bi.default",tagName:"td",attributes:{width:e},items:[f]}),this.addWidget(this._getChildName(a),c)}return 0===a&&c.element.addClass("first-element"),c.element.css({position:"relative",height:"100%","vertical-align":"middle",margin:"0",padding:"0",border:"none"}),d.hgap+d.lgap+(b.lgap||0)!==0&&f.element.css({"margin-left":d.hgap+d.lgap+(b.lgap||0)+"px"}),d.hgap+d.rgap+(b.rgap||0)!==0&&f.element.css({"margin-right":d.hgap+d.rgap+(b.rgap||0)+"px"}),d.vgap+d.tgap+(b.tgap||0)!==0&&f.element.css({"margin-top":d.vgap+d.tgap+(b.tgap||0)+"px"}),d.vgap+d.bgap+(b.bgap||0)!==0&&f.element.css({"margin-bottom":d.vgap+d.bgap+(b.bgap||0)+"px"}),c},_mountChildren:function(){var a=this,b=document.createDocumentFragment(),c=!1;BI.each(this._children,function(d,e){e.element!==a.element&&(b.appendChild(e.element[0]),c=!0)}),c===!0&&(this.$tr.append(b),this.element.append(this.$table))},_getWrapper:function(){return this.$tr},resize:function(){},populate:function(a){BI.VerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.vertical_adapt",BI.VerticalAdaptLayout),BI.HorizontalAutoLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalAutoLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizon-auto-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.HorizontalAutoLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.HorizontalAutoLayout.superclass._addElement.apply(this,arguments);return d.element.css({position:"relative",margin:"0px auto"}),c.hgap+c.lgap+(b.lgap||0)!==0&&d.element.css({"margin-left":c.hgap+c.lgap+(b.lgap||0)+"px"}),c.hgap+c.rgap+(b.rgap||0)!==0&&d.element.css({"margin-right":c.hgap+c.rgap+(b.rgap||0)+"px"}),c.vgap+c.tgap+(b.tgap||0)!==0&&d.element.css({"margin-top":c.vgap+c.tgap+(b.tgap||0)+"px"}),c.vgap+c.bgap+(b.bgap||0)!==0&&d.element.css({"margin-bottom":c.vgap+c.bgap+(b.bgap||0)+"px"}),d},resize:function(){},populate:function(a){BI.HorizontalAutoLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_auto",BI.HorizontalAutoLayout),BI.FloatCenterAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatCenterAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-center-adapt-layout",items:[],hgap:0,vgap:0,tgap:0,bgap:0,lgap:0,rgap:0})},render:function(){BI.FloatCenterAdaptLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},addItem:function(){throw new Error("cannot be added")},mounted:function(){var a=this,b=this.left.element.outerWidth(),c=this.left.element.outerHeight();this.left.element.width(b).height(c).css("float","none"),BI.remove(this._children,function(b,c){c===a.container&&delete a._children[b]}),BI.createWidget({type:"bi.center_adapt",element:this,items:[this.left]})},stroke:function(a){var b=this.options;this.left=BI.createWidget({type:"bi.vertical",items:a,hgap:b.hgap,vgap:b.vgap,tgap:b.tgap,bgap:b.bgap,lgap:b.lgap,rgap:b.rgap}),this.container=BI.createWidget({type:"bi.left",element:this,items:[this.left]})},populate:function(a){BI.FloatCenterAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.float_center_adapt",BI.FloatCenterAdaptLayout),BI.FloatHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-horizontal-adapt-layout",items:[],hgap:0,vgap:0,tgap:0,bgap:0,lgap:0,rgap:0})},render:function(){BI.FloatHorizontalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},mounted:function(){var a=this,b=this.left.element.width(),c=this.left.element.height();this.left.element.width(b).height(c).css("float","none"),BI.remove(this._children,function(b,c){c===a.container&&delete a._children[b]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[this.left]})},_addElement:function(a,b){var c=this.options;return this.left=BI.createWidget({type:"bi.vertical",items:[b],hgap:c.hgap,vgap:c.vgap,tgap:c.tgap,bgap:c.bgap,lgap:c.lgap,rgap:c.rgap}),this.container=BI.createWidget({type:"bi.left",element:this,items:[this.left]}),this.left},populate:function(a){BI.HorizontalAutoLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_float",BI.FloatHorizontalLayout),BI.FlexCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-center-layout"})},render:function(){BI.FlexCenterLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(a,b){var c=(this.options,BI.FlexCenterLayout.superclass._addElement.apply(this,arguments));return c.element.css({position:"relative","flex-shrink":"0"}),c},resize:function(){},populate:function(a){BI.FlexCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_center",BI.FlexCenterLayout),BI.FlexHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-horizontal-layout",verticalAlign:BI.VerticalAlign.Top,columnSize:[],scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexHorizontalLayout.superclass.render.apply(this,arguments);var a=this.options;this.element.addClass(a.verticalAlign),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.FlexHorizontalLayout.superclass._addElement.apply(this,arguments);return d.element.css({position:"relative","flex-shrink":"0"}),c.hgap+c.lgap+(b.lgap||0)>0&&d.element.css({"margin-left":c.hgap+c.lgap+(b.lgap||0)+"px"}),c.hgap+c.rgap+(b.rgap||0)>0&&d.element.css({"margin-right":c.hgap+c.rgap+(b.rgap||0)+"px"}),c.vgap+c.tgap+(b.tgap||0)>0&&d.element.css({"margin-top":c.vgap+c.tgap+(b.tgap||0)+"px"}),c.vgap+c.bgap+(b.bgap||0)>0&&d.element.css({"margin-bottom":c.vgap+c.bgap+(b.bgap||0)+"px"}),d},resize:function(){},populate:function(a){BI.FlexHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_horizontal",BI.FlexHorizontalLayout),BI.FlexVerticalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexVerticalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-vertical-center",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexVerticalCenter.superclass.render.apply(this,arguments);var a=this.options;this.element.addClass(a.horizontalAlign),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.FlexVerticalCenter.superclass._addElement.apply(this,arguments);return d.element.css({position:"relative","flex-shrink":"0"}),c.hgap+c.lgap+(b.lgap||0)>0&&d.element.css({"margin-left":c.hgap+c.lgap+(b.lgap||0)+"px"}),c.hgap+c.rgap+(b.rgap||0)>0&&d.element.css({"margin-right":c.hgap+c.rgap+(b.rgap||0)+"px"}),c.vgap+c.tgap+(b.tgap||0)>0&&d.element.css({"margin-top":c.vgap+c.tgap+(b.tgap||0)+"px"}),c.vgap+c.bgap+(b.bgap||0)>0&&d.element.css({"margin-bottom":c.vgap+c.bgap+(b.bgap||0)+"px"}),d},resize:function(){},populate:function(a){BI.FlexVerticalCenter.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_vertical_center",BI.FlexVerticalCenter),BI.FlexCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-wrapper-center-layout clearfix"})},render:function(){BI.FlexCenterLayout.superclass.render.apply(this,arguments),this.$wrapper=$("
").addClass("flex-wrapper-center-layout-wrapper"),this.populate(this.options.items)},_addElement:function(a,b){var c=(this.options,BI.FlexCenterLayout.superclass._addElement.apply(this,arguments));return c.element.css({position:"relative"}),c},_mountChildren:function(){var a=this,b=document.createDocumentFragment(),c=!1;BI.each(this._children,function(d,e){e.element!==a.element&&(b.appendChild(e.element[0]),c=!0)}),c===!0&&(this.$wrapper.append(b),this.element.append(this.$wrapper))},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(a){BI.FlexCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_wrapper_center",BI.FlexCenterLayout),BI.FlexHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-wrapper-horizontal-layout clearfix",verticalAlign:BI.VerticalAlign.Middle,columnSize:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexHorizontalLayout.superclass.render.apply(this,arguments);var a=this.options;this.$wrapper=$("
").addClass("flex-wrapper-horizontal-layout-wrapper "+a.verticalAlign),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.FlexHorizontalLayout.superclass._addElement.apply(this,arguments);return d.element.css({position:"relative"}),c.hgap+c.lgap+(b.lgap||0)>0&&d.element.css({"margin-left":c.hgap+c.lgap+(b.lgap||0)+"px"}),c.hgap+c.rgap+(b.rgap||0)>0&&d.element.css({"margin-right":c.hgap+c.rgap+(b.rgap||0)+"px"}),c.vgap+c.tgap+(b.tgap||0)>0&&d.element.css({"margin-top":c.vgap+c.tgap+(b.tgap||0)+"px"}),c.vgap+c.bgap+(b.bgap||0)>0&&d.element.css({"margin-bottom":c.vgap+c.bgap+(b.bgap||0)+"px"}),d},_mountChildren:function(){var a=this,b=document.createDocumentFragment(),c=!1;BI.each(this._children,function(d,e){e.element!==a.element&&(b.appendChild(e.element[0]),c=!0)}),c===!0&&(this.$wrapper.append(b),this.element.append(this.$wrapper))},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(a){BI.FlexHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_wrapper_horizontal",BI.FlexHorizontalLayout),BI.FlexVerticalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexVerticalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-wrapper-vertical-center clearfix",horizontalAlign:BI.HorizontalAlign.Middle,columnSize:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexVerticalCenter.superclass.render.apply(this,arguments);var a=this.options;this.$wrapper=$("
").addClass("flex-wrapper-vertical-center-wrapper "+a.horizontalAlign),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.FlexVerticalCenter.superclass._addElement.apply(this,arguments);return d.element.css({position:"relative"}),c.hgap+c.lgap+(b.lgap||0)>0&&d.element.css({"margin-left":c.hgap+c.lgap+(b.lgap||0)+"px"}),c.hgap+c.rgap+(b.rgap||0)>0&&d.element.css({"margin-right":c.hgap+c.rgap+(b.rgap||0)+"px"}),c.vgap+c.tgap+(b.tgap||0)>0&&d.element.css({"margin-top":c.vgap+c.tgap+(b.tgap||0)+"px"}),c.vgap+c.bgap+(b.bgap||0)>0&&d.element.css({"margin-bottom":c.vgap+c.bgap+(b.bgap||0)+"px"}),d},_mountChildren:function(){var a=this,b=document.createDocumentFragment(),c=!1;BI.each(this._children,function(d,e){e.element!==a.element&&(b.appendChild(e.element[0]),c=!0)}),c===!0&&(this.$wrapper.append(b),this.element.append(this.$wrapper))},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(a){BI.FlexVerticalCenter.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_wrapper_vertical_center",BI.FlexVerticalCenter),BI.AbsoluteLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-layout",hgap:null,vgap:null,lgap:null,rgap:null,tgap:null,bgap:null})},render:function(){BI.AbsoluteLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.AbsoluteLayout.superclass._addElement.apply(this,arguments),e=0,f=0,g=0,h=0;return BI.isNotNull(b.left)&&(d.element.css({left:b.left}),e+=b.left),BI.isNotNull(b.right)&&(d.element.css({right:b.right}),f+=b.right),BI.isNotNull(b.top)&&(d.element.css({top:b.top}),g+=b.top),BI.isNotNull(b.bottom)&&(d.element.css({bottom:b.bottom}),h+=b.bottom),BI.isNotNull(c.hgap)&&(e+=c.hgap,d.element.css({left:e}),f+=c.hgap,d.element.css({right:f})),BI.isNotNull(c.vgap)&&(g+=c.vgap,d.element.css({top:g}),h+=c.vgap,d.element.css({bottom:h})),BI.isNotNull(c.lgap)&&(e+=c.lgap,d.element.css({left:e})),BI.isNotNull(c.rgap)&&(f+=c.rgap,d.element.css({right:f})),BI.isNotNull(c.tgap)&&(g+=c.tgap,d.element.css({top:g})),BI.isNotNull(c.bgap)&&(h+=c.bgap,d.element.css({bottom:h})),BI.isNotNull(b.width)&&d.element.css({width:b.width}),BI.isNotNull(b.height)&&d.element.css({height:b.height}),d.element.css({position:"absolute"}),d},resize:function(){this.stroke(this.options.items)},stroke:function(a){this.options.items=a||[];var b=this;BI.each(a,function(a,c){if(c){if(!BI.isWidget(c)&&!c.el)throw new Error("el must be exist");b._addElement(a,c)}})},populate:function(a){BI.AbsoluteLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute",BI.AbsoluteLayout),BI.AdaptiveLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AdaptiveLayout.superclass.props.apply(this,arguments),{baseCls:"bi-adaptive-layout",hgap:null,vgap:null,lgap:null,rgap:null,tgap:null,bgap:null})},render:function(){BI.AdaptiveLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.AdaptiveLayout.superclass._addElement.apply(this,arguments);d.element.css({position:"relative"});var e=0,f=0,g=0,h=0;return BI.isNotNull(b.left)&&d.element.css({"margin-left":b.left}),BI.isNotNull(b.right)&&d.element.css({"margin-right":b.right}),BI.isNotNull(b.top)&&d.element.css({"margin-top":b.top}),BI.isNotNull(b.bottom)&&d.element.css({"margin-bottom":b.bottom}),BI.isNotNull(c.hgap)&&(e+=c.hgap,d.element.css({left:e}),f+=c.hgap,d.element.css({right:f})),BI.isNotNull(c.vgap)&&(g+=c.vgap,d.element.css({top:g}),h+=c.vgap,d.element.css({bottom:h})),BI.isNotNull(c.lgap)&&(e+=c.lgap,d.element.css({left:e})),BI.isNotNull(c.rgap)&&(f+=c.rgap,d.element.css({right:f})),BI.isNotNull(c.tgap)&&(g+=c.tgap,d.element.css({top:g})),BI.isNotNull(c.bgap)&&(h+=c.bgap,d.element.css({bottom:h})),BI.isNotNull(b.width)&&d.element.css({width:b.width}),BI.isNotNull(b.height)&&d.element.css({height:b.height}),d},resize:function(){this.stroke(this.options.items)},populate:function(a){BI.AbsoluteLayout.superclass.populate.apply(this,arguments), this._mount()}}),BI.shortcut("bi.adaptive",BI.AdaptiveLayout),BI.BorderLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.BorderLayout.superclass.props.apply(this,arguments),{baseCls:"bi-border-layout",items:{}})},render:function(){BI.BorderLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(a){throw new Error("cannot be added")},stroke:function(a){var b,c=0,d=0,e=0,f=0;if("north"in a&&(b=a.north,null!=b)){if(b.el){if(!this.hasWidget(this.getName()+"north")){var g=BI.createWidget(b);this.addWidget(this.getName()+"north",g)}this.getWidgetByName(this.getName()+"north").element.height(b.height).css({position:"absolute",top:b.top||0,left:b.left||0,right:b.right||0,bottom:"initial"})}c=(b.height||0)+(b.top||0)+(b.bottom||0)}if("south"in a&&(b=a.south,null!=b)){if(b.el){if(!this.hasWidget(this.getName()+"south")){var g=BI.createWidget(b);this.addWidget(this.getName()+"south",g)}this.getWidgetByName(this.getName()+"south").element.height(b.height).css({position:"absolute",bottom:b.bottom||0,left:b.left||0,right:b.right||0,top:"initial"})}d=(b.height||0)+(b.top||0)+(b.bottom||0)}if("west"in a&&(b=a.west,null!=b)){if(b.el){if(!this.hasWidget(this.getName()+"west")){var g=BI.createWidget(b);this.addWidget(this.getName()+"west",g)}this.getWidgetByName(this.getName()+"west").element.width(b.width).css({position:"absolute",left:b.left||0,top:c,bottom:d,right:"initial"})}e=(b.width||0)+(b.left||0)+(b.right||0)}if("east"in a&&(b=a.east,null!=b)){if(b.el){if(!this.hasWidget(this.getName()+"east")){var g=BI.createWidget(b);this.addWidget(this.getName()+"east",g)}this.getWidgetByName(this.getName()+"east").element.width(b.width).css({position:"absolute",right:b.right||0,top:c,bottom:d,left:"initial"})}f=(b.width||0)+(b.left||0)+(b.right||0)}if("center"in a&&(b=a.center,null!=b)){if(!this.hasWidget(this.getName()+"center")){var g=BI.createWidget(b);this.addWidget(this.getName()+"center",g)}this.getWidgetByName(this.getName()+"center").element.css({position:"absolute",top:c,bottom:d,left:e,right:f})}},populate:function(a){BI.BorderLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.border",BI.BorderLayout),BI.CardLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.CardLayout.superclass.props.apply(this,arguments),{baseCls:"bi-card-layout",items:[]})},render:function(){BI.CardLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},stroke:function(a){var b=this,c=this.options;this.showIndex=void 0,BI.each(a,function(a,d){if(d){if(b.hasWidget(d.cardName))var e=b.getWidgetByName(d.cardName);else{var e=BI.createWidget(d);e.on(BI.Events.DESTROY,function(){var a=BI.findIndex(c.items,function(a,b){return b.cardName==d.cardName});a>-1&&c.items.splice(a,1)}),b.addWidget(d.cardName,e)}e.element.css({position:"absolute",top:"0",right:"0",bottom:"0",left:"0"}),e.setVisible(!1)}})},update:function(){},empty:function(){BI.CardLayout.superclass.empty.apply(this,arguments),this.options.items=[]},populate:function(a){BI.CardLayout.superclass.populate.apply(this,arguments),this._mount(),this.options.defaultShowName&&this.showCardByName(this.options.defaultShowName)},isCardExisted:function(a){return BI.some(this.options.items,function(b,c){return c.cardName==a&&c.el})},getCardByName:function(a){if(!this.isCardExisted(a))throw new Error("cardName is not exist");return this._children[a]},_deleteCardByName:function(a){delete this._children[a];var b=BI.findIndex(this.options.items,function(b,c){return c.cardName==a});b>-1&&this.options.items.splice(b,1)},deleteCardByName:function(a){if(!this.isCardExisted(a))throw new Error("cardName is not exist");var b=this._children[a];this._deleteCardByName(a),b&&b._destroy()},addCardByName:function(a,b){if(this.isCardExisted(a))throw new Error("cardName is already exist");var c=BI.createWidget(b);return c.element.css({position:"relative",top:"0",left:"0",width:"100%",height:"100%"}).appendTo(this.element),c.invisible(),this.addWidget(a,c),this.options.items.push({el:b,cardName:a}),c},showCardByName:function(a,b,c){var d=this,e=this.isCardExisted(a);null!=this.showIndex&&(this.lastShowIndex=this.showIndex),this.showIndex=a;var f=!1;BI.each(this.options.items,function(g,h){var i=d._children[h.cardName];i&&(a!=h.cardName?!f&&!e&&BI.Action&&b instanceof BI.Action?(b.actionBack(i),f=!0):i.invisible():BI.Action&&b instanceof BI.Action?b.actionPerformed(void 0,i,c):(i.visible(),c&&c()))})},showLastCard:function(){var a=this;this.showIndex=this.lastShowIndex,BI.each(this.options.items,function(b,c){a._children[c.cardName].setVisible(a.showIndex==b)})},setDefaultShowName:function(a){return this.options.defaultShowName=a,this},getDefaultShowName:function(){return this.options.defaultShowName},getAllCardNames:function(){return BI.map(this.options.items,function(a,b){return b.cardName})},getShowingCard:function(){if(BI.isKey(this.showIndex))return this.getWidgetByName(this.showIndex)},deleteAllCard:function(){var a=this;BI.each(this.getAllCardNames(),function(b,c){a.deleteCardByName(c)})},hideAllCard:function(){var a=this;BI.each(this.options.items,function(b,c){a._children[c.cardName].invisible()})},isAllCardHide:function(){var a=this,b=!0;return BI.some(this.options.items,function(c,d){if(a._children[d.cardName].isVisible())return b=!1,!1}),b},removeWidget:function(a){var b;BI.isWidget(a)?BI.each(this._children,function(c,d){d===a&&(b=c)}):b=a,b&&this._deleteCardByName(b)}}),BI.shortcut("bi.card",BI.CardLayout),BI.DefaultLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.DefaultLayout.superclass.props.apply(this,arguments),{hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[]})},render:function(){BI.DefaultLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.DefaultLayout.superclass._addElement.apply(this,arguments);return c.vgap+c.tgap+(b.tgap||0)!==0&&d.element.css({"margin-top":c.vgap+c.tgap+(b.tgap||0)+"px"}),c.hgap+c.lgap+(b.lgap||0)!==0&&d.element.css({"margin-left":c.hgap+c.lgap+(b.lgap||0)+"px"}),c.hgap+c.rgap+(b.rgap||0)!==0&&d.element.css({"margin-right":c.hgap+c.rgap+(b.rgap||0)+"px"}),c.vgap+c.bgap+(b.bgap||0)!==0&&d.element.css({"margin-bottom":c.vgap+c.bgap+(b.bgap||0)+"px"}),d},resize:function(){},populate:function(a){BI.DefaultLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.default",BI.DefaultLayout),BI.DivisionLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.DivisionLayout.superclass.props.apply(this,arguments),{baseCls:"bi-division-layout",columns:null,rows:null,items:[]})},render:function(){BI.DivisionLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.opitons.items)},addItem:function(a){throw new Error("cannot be added")},stroke:function(a){function b(a,b,c){0===b&&a.addClass("first-row"),0===c&&a.addClass("first-col"),a.addClass(BI.isOdd(b+1)?"odd-row":"even-row"),a.addClass(BI.isOdd(c+1)?"odd-col":"even-col"),a.addClass("center-element")}function c(a,b,c){var d="";0===b&&(d+=" first-row"),0===c&&(d+=" first-col"),d+=BI.isOdd(b+1)?" odd-row":" even-row",d+=BI.isOdd(c+1)?" odd-col":" even-col",a.cls=(a.cls||"")+d+" center-element"}function d(a,d,e){a instanceof BI.Widget?b(a.element,d,e):a.el instanceof BI.Widget?b(a.el.element,d,e):a.el?c(a.el,d,e):c(a,d,e)}var e=this.options,f=e.rows||e.items.length,g=e.columns||0|(e.items[0]&&e.items[0].length),h=BI.makeArray(f),i={},j={};BI.each(h,function(a){h[a]=BI.makeArray(g)}),BI.each(a,function(a,b){return BI.isArray(b)?void BI.each(b,function(c,d){i[a]=(i[a]||0)+b.width,j[c]=(j[c]||0)+b.height,h[a][c]=d}):(i[b.row]=(i[b.row]||0)+b.width,j[b.column]=(j[b.column]||0)+b.height,void(h[b.row][b.column]=b))});for(var k=0;k0){var p=this.getWidgetByName(this.getName()+k+"_"+(m-1));p.element.css({right:100-o+"%"})}m==e.columns-1&&n.element.css({right:"0%"}),d(n,k,m),l+=h[k][m].width}for(var m=0;m0){var p=this.getWidgetByName(this.getName()+(k-1)+"_"+m);p.element.css({bottom:100-r+"%"})}k==e.rows-1&&n.element.css({bottom:"0%"}),q+=h[k][m].height}},populate:function(a){BI.DivisionLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.division",BI.DivisionLayout),BI.FloatLeftLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatLeftLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-left-layout clearfix",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FloatLeftLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.FloatLeftLayout.superclass._addElement.apply(this,arguments);return d.element.css({position:"relative","float":"left"}),BI.isNotNull(b.left)&&d.element.css({left:b.left}),BI.isNotNull(b.right)&&d.element.css({right:b.right}),BI.isNotNull(b.top)&&d.element.css({top:b.top}),(b.lgap||0)+c.hgap+c.lgap!==0&&d.element.css("margin-left",(b.lgap||0)+c.hgap+c.lgap),(b.rgap||0)+c.hgap+c.rgap!==0&&d.element.css("margin-right",(b.rgap||0)+c.hgap+c.rgap),(b.tgap||0)+c.vgap+c.tgap!==0&&d.element.css("margin-top",(b.tgap||0)+c.vgap+c.tgap),(b.bgap||0)+c.vgap+c.bgap!==0&&d.element.css("margin-bottom",(b.bgap||0)+c.vgap+c.bgap),d},resize:function(){this.stroke(this.options.items)},populate:function(a){BI.FloatLeftLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.left",BI.FloatLeftLayout),BI.FloatRightLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatRightLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-right-layout clearfix",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FloatRightLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.FloatRightLayout.superclass._addElement.apply(this,arguments);return d.element.css({position:"relative","float":"right"}),BI.isNotNull(b.left)&&d.element.css({left:b.left}),BI.isNotNull(b.right)&&d.element.css({right:b.right}),BI.isNotNull(b.top)&&d.element.css({top:b.top}),(b.lgap||0)+c.hgap+c.lgap!==0&&d.element.css("margin-left",(b.lgap||0)+c.hgap+c.lgap),(b.rgap||0)+c.hgap+c.rgap!==0&&d.element.css("margin-right",(b.rgap||0)+c.hgap+c.rgap),(b.tgap||0)+c.vgap+c.tgap!==0&&d.element.css("margin-top",(b.tgap||0)+c.vgap+c.tgap),(b.bgap||0)+c.vgap+c.bgap!==0&&d.element.css("margin-bottom",(b.bgap||0)+c.vgap+c.bgap),d},resize:function(){this.stroke(this.options.items)},populate:function(a){BI.FloatRightLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.right",BI.FloatRightLayout),BI.GridLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.GridLayout.superclass.props.apply(this,arguments),{baseCls:"bi-grid-layout",columns:null,rows:null,items:[]})},render:function(){BI.GridLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},addItem:function(){throw new Error("cannot be added")},stroke:function(a){function b(a,b,c){0===b&&a.addClass("first-row"),0===c&&a.addClass("first-col"),a.addClass(BI.isOdd(b+1)?"odd-row":"even-row"),a.addClass(BI.isOdd(c+1)?"odd-col":"even-col"),a.addClass("center-element")}function c(a,b,c){var d="";0===b&&(d+=" first-row"),0===c&&(d+=" first-col"),d+=BI.isOdd(b+1)?" odd-row":" even-row",d+=BI.isOdd(c+1)?" odd-col":" even-col",a.cls=(a.cls||"")+d+" center-element"}function d(a,d,e){a instanceof BI.Widget?b(a.element,d,e):a.el instanceof BI.Widget?b(a.el.element,d,e):a.el?c(a.el,d,e):c(a,d,e)}for(var e=this.options,f=e.rows||e.items.length,g=e.columns||0|(e.items[0]&&e.items[0].length),h=100/g,i=100/f,j=[],k=0;k").attr({cellspacing:0,cellpadding:0}).css({position:"relative","white-space":"nowrap","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.$tr=$("
"),this.$tr.appendTo(this.$table),this.populate(this.options.items)},_addElement:function(a,b){var c,d=this.options,e=d.columnSize[a]<=1?100*d.columnSize[a]+"%":d.columnSize[a];if(this.hasWidget(this._getChildName(a)))c=this.getWidgetByName(this._getChildName(a)),c.element.attr("width",e);else{var f=BI.createWidget(b);f.element.css({position:"relative",margin:"0px auto"}),c=BI.createWidget({type:"bi.default",tagName:"td",attributes:{width:e},items:[f]}),this.addWidget(this._getChildName(a),c)}return 0===a&&c.element.addClass("first-element"),c.element.css({position:"relative","vertical-align":d.verticalAlign,margin:"0",padding:"0",border:"none"}),d.hgap+d.lgap+(b.lgap||0)>0&&f.element.css({"margin-left":d.hgap+d.lgap+(b.lgap||0)+"px"}),d.hgap+d.rgap+(b.rgap||0)>0&&f.element.css({"margin-right":d.hgap+d.rgap+(b.rgap||0)+"px"}),d.vgap+d.tgap+(b.tgap||0)>0&&f.element.css({"margin-top":d.vgap+d.tgap+(b.tgap||0)+"px"}),d.vgap+d.bgap+(b.bgap||0)>0&&f.element.css({"margin-bottom":d.vgap+d.bgap+(b.bgap||0)+"px"}),c},_mountChildren:function(){var a=this,b=document.createDocumentFragment(),c=!1;BI.each(this._children,function(d,e){e.element!==a.element&&(b.appendChild(e.element[0]),c=!0)}),c===!0&&(this.$tr.append(b),this.element.append(this.$table))},resize:function(){},_getWrapper:function(){return this.$tr},populate:function(a){BI.HorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal",BI.HorizontalLayout),BI.HorizontalCellLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalCellLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizontal-cell-layout",scrollable:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.HorizontalCellLayout.superclass.render.apply(this,arguments),this.element.css({display:"table","vertical-align":"top"}),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.HorizontalCellLayout.superclass._addElement.apply(this,arguments);return d.element.css({position:"relative",display:"table-cell","vertical-align":"middle"}),c.hgap+c.lgap>0&&d.element.css({"margin-left":c.hgap+c.lgap+"px"}),c.hgap+c.rgap>0&&d.element.css({"margin-right":c.hgap+c.rgap+"px"}),c.vgap+c.tgap>0&&d.element.css({"margin-top":c.vgap+c.tgap+"px"}),c.vgap+c.bgap>0&&d.element.css({"margin-bottom":c.vgap+c.bgap+"px"}),d},resize:function(){},populate:function(a){BI.HorizontalCellLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_cell",BI.HorizontalCellLayout),BI.LatticeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LatticeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-lattice-layout clearfix"})},render:function(){BI.LatticeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(a,b){var c=this.options,d=BI.LatticeLayout.superclass._addElement.apply(this,arguments);if(c.columnSize&&c.columnSize[a])var e=c.columnSize[a]/BI.sum(c.columnSize)*100+"%";else var e=1/this.options.items.length*100+"%";return d.element.css({position:"relative","float":"left",width:e}),d},addItem:function(a){var b=BI.LatticeLayout.superclass.addItem.apply(this,arguments);return this.resize(),b},addItemAt:function(a){var b=BI.LatticeLayout.superclass.addItemAt.apply(this,arguments);return this.resize(),b},resize:function(){this.stroke(this.options.items)},populate:function(a){BI.LatticeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.lattice",BI.LatticeLayout),BI.TableLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TableLayout.superclass.props.apply(this,arguments),{baseCls:"bi-table-layout",scrolly:!0,columnSize:[200,200,"fill"],rowSize:30,hgap:0,vgap:0,items:[[{el:{text:"label1"}},{el:{text:"label2"}},{el:{text:"label3"}}]]})},render:function(){BI.TableLayout.superclass.render.apply(this,arguments),this.rows=0,this.populate(this.options.items)},_addElement:function(a,b){function c(a,b,c){0===b&&a.addClass("first-row"),0===c&&a.addClass("first-col"),a.addClass(BI.isOdd(b+1)?"odd-row":"even-row"),a.addClass(BI.isOdd(c+1)?"odd-col":"even-col"),a.addClass("center-element")}function d(a,b,c){var d="";0===b&&(d+=" first-row"),0===c&&(d+=" first-col"),d+=BI.isOdd(b+1)?" odd-row":" even-row",d+=BI.isOdd(c+1)?" odd-col":" even-col",a.cls=(a.cls||"")+d+" center-element"}function e(a,b,e){a instanceof BI.Widget?c(a.element,b,e):a.el instanceof BI.Widget?c(a.el.element,b,e):a.el?d(a.el,b,e):d(a,b,e)}var f,g,h=this.options,i=[],j=0,k=0;for(f=0;ff;g--){if(!BI.isNumber(h.columnSize[g]))throw new Error("item with fill can only be one");e(b[g],this.rows,g),i.push(BI.extend({top:0,bottom:0,right:h.columnSize[g]<=1?100*k+"%":k,width:h.columnSize[g]<=1?100*h.columnSize[g]+"%":h.columnSize[g]},b[g])),k+=h.columnSize[g]+(h.columnSize[g]<1?0:h.hgap)}f>=0&&f0&&this.getWidgetByName(this.getName()+(this.rows-1)).element.css({"margin-bottom":h.vgap}),l.element.css({position:"relative"}),this.addWidget(this.getName()+this.rows++,l),l},resize:function(){},addItem:function(a){if(!BI.isArray(a))throw new Error("item must be array");return BI.TableLayout.superclass.addItem.apply(this,arguments)},populate:function(a){BI.TableLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.table",BI.TableLayout),BI.HTapeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HTapeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-h-tape-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[{width:100,el:{type:"bi.button",text:"button1"}},{width:"fill",el:{type:"bi.button",text:"button2"}},{width:200,el:{type:"bi.button",text:"button3"}}]})},render:function(){BI.HTapeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(a){throw new Error("cannot be added")},stroke:function(a){var b=this,c=this.options;a=BI.compact(a),BI.each(a,function(a,d){if(b.hasWidget(b.getName()+a+""))e=b.getWidgetByName(b.getName()+a+"");else{var e=BI.createWidget(d);b.addWidget(b.getName()+a+"",e)}e.element.css({position:"absolute",top:c.vgap+c.tgap+"px",bottom:c.vgap+c.bgap+"px"})});var d={},e={};d[0]=0,e[a.length-1]=0,BI.any(a,function(e,f){var g=b.getWidgetByName(b.getName()+e+"");if(BI.isNull(d[e])&&(d[e]=d[e-1]+a[e-1].width+2*c.hgap+c.lgap+c.rgap),f.width<1&&f.width>=0?g.element.css({left:100*d[e]+"%",width:100*f.width+"%"}):g.element.css({left:d[e]+c.hgap+c.lgap+"px",width:BI.isNumber(f.width)?f.width:""}),!BI.isNumber(f.width))return!0}),BI.backAny(a,function(d,f){var g=b.getWidgetByName(b.getName()+d+"");if(BI.isNull(e[d])&&(e[d]=e[d+1]+a[d+1].width+2*c.hgap+c.lgap+c.rgap),f.width<1&&f.width>=0?g.element.css({right:100*e[d]+"%",width:100*f.width+"%"}):g.element.css({right:e[d]+c.hgap+c.rgap+"px",width:BI.isNumber(f.width)?f.width:""}),!BI.isNumber(f.width))return!0})},populate:function(a){BI.HTapeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.htape",BI.HTapeLayout),BI.VTapeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.VTapeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-v-tape-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[{height:100,el:{type:"bi.button",text:"button1"}},{height:"fill",el:{type:"bi.button",text:"button2"}},{height:200,el:{type:"bi.button",text:"button3"}}]})},render:function(){BI.VTapeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(a){throw new Error("cannot be added")},stroke:function(a){var b=this,c=this.options;a=BI.compact(a),BI.each(a,function(a,d){if(b.hasWidget(b.getName()+a+""))e=b.getWidgetByName(b.getName()+a+"");else{var e=BI.createWidget(d);b.addWidget(b.getName()+a+"",e)}e.element.css({position:"absolute",left:c.hgap+c.lgap+"px",right:c.hgap+c.rgap+"px"})});var d={},e={};d[0]=0,e[a.length-1]=0,BI.any(a,function(e,f){var g=b.getWidgetByName(b.getName()+e+"");if(BI.isNull(d[e])&&(d[e]=d[e-1]+a[e-1].height+2*c.vgap+c.tgap+c.bgap),f.height<1&&f.height>=0?g.element.css({top:100*d[e]+"%",height:100*f.height+"%"}):g.element.css({top:d[e]+c.vgap+c.tgap+"px",height:BI.isNumber(f.height)?f.height:""}),!BI.isNumber(f.height))return!0}),BI.backAny(a,function(d,f){var g=b.getWidgetByName(b.getName()+d+"");if(BI.isNull(e[d])&&(e[d]=e[d+1]+a[d+1].height+2*c.vgap+c.tgap+c.bgap),f.height<1&&f.height>=0?g.element.css({bottom:100*e[d]+"%",height:100*f.height+"%"}):g.element.css({bottom:e[d]+c.vgap+c.bgap+"px",height:BI.isNumber(f.height)?f.height:""}),!BI.isNumber(f.height))return!0})},populate:function(a){BI.VTapeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.vtape",BI.VTapeLayout),BI.TdLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TdLayout.superclass.props.apply(this,arguments),{baseCls:"bi-td-layout",columnSize:[200,200,200],hgap:0,vgap:0,items:[[{el:{text:"label1"}},{el:{text:"label2"}},{el:{text:"label3"}}]]})},render:function(){BI.TdLayout.superclass.render.apply(this,arguments),this.$table=$("
").attr({cellspacing:0,cellpadding:0}).css({position:"relative",width:"100%",height:"100%","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.rows=0,this.populate(this.options.items)},_addElement:function(a,b){function c(a,b,c){0===b&&a.addClass("first-row"),0===c&&a.addClass("first-col"),a.addClass(BI.isOdd(b+1)?"odd-row":"even-row"),a.addClass(BI.isOdd(c+1)?"odd-col":"even-col"),a.addClass("center-element")}function d(a,b,c){var d="";0===b&&(d+=" first-row"),0===c&&(d+=" first-col"),d+=BI.isOdd(b+1)?" odd-row":" even-row",d+=BI.isOdd(c+1)?" odd-col":" even-col",a.cls=(a.cls||"")+d+" center-element"}function e(a,b,e){a instanceof BI.Widget?c(a.element,b,e):a.el instanceof BI.Widget?c(a.el.element,b,e):a.el?d(a.el,b,e):d(a,b,e)}for(var f=this.options,g=BI.createWidget({type:"bi.default",tagName:"tr"}),h=0;h=0;f--){for(var g=0;g=0;g--){for(var f=0;f=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var a=h.length;a;)this.addEventListener(h[--a],b,!1);else this.onmousewheel=b},teardown:function(){if(this.removeEventListener)for(var a=h.length;a;)this.removeEventListener(h[--a],b,!1);else this.onmousewheel=null},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),BI.Pane=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Pane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-pane",tipText:BI.i18nText("BI-No_Selected_Item"),overlap:!0,onLoaded:BI.emptyFn})},_init:function(){BI.Pane.superclass._init.apply(this,arguments)},_assertTip:function(){var a=this.options;this._tipText||(this._tipText=BI.createWidget({type:"bi.label",cls:"bi-tips",text:a.tipText,height:25}),BI.createWidget({type:"bi.vertical",element:this,items:[this._tipText],bgap:25}))},loading:function(){var a=this,b=this.options;b.overlap===!0?(BI.Layers.has(this.getName())||BI.createWidget({type:"bi.vtape",items:[{el:{type:"bi.layout",cls:"loading-background"},height:30}],element:BI.Layers.make(this.getName(),this)}),BI.Layers.show(a.getName())):BI.isNull(this._loading)&&(this._loading=BI.createWidget({type:"bi.layout",cls:"loading-background",height:30}),this._loading.element.css("zIndex",1),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this._loading,left:0,right:0,top:0}]}))},loaded:function(){var a=this,b=this.options;BI.Layers.remove(a.getName()),this._loading&&this._loading.destroy(),this._loading&&(this._loading=null),b.onLoaded(),a.fireEvent(BI.Pane.EVENT_LOADED)},check:function(){this.setTipVisible(BI.isEmpty(this.options.items))},setTipVisible:function(a){a===!0?(this._assertTip(),this._tipText.setVisible(!0)):this._tipText&&this._tipText.setVisible(!1)},populate:function(a){this.options.items=a||[],this.check()},empty:function(){}}),BI.Pane.EVENT_LOADED="EVENT_LOADED",BI.Single=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.Single.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-single",readonly:!1,title:null,warningTitle:null,tipType:null,value:null})},_showToolTip:function(a,b){b||(b={});var c=this.getTipType()||(this.isEnabled()?"success":"warning"),d="success"===c?this.getTitle():this.getWarningTitle()||this.getTitle();BI.isKey(d)&&BI.Tooltips.show(a,this.getName(),d,c,this,b)},_hideTooltip:function(){var a=this,b=BI.Tooltips.get(this.getName());BI.isNotNull(b)&&b.element.fadeOut(200,function(){BI.Tooltips.remove(a.getName())})},_init:function(){BI.Single.superclass._init.apply(this,arguments);var a=this.options;(BI.isKey(a.title)||BI.isKey(a.warningTitle)||BI.isFunction(a.title)||BI.isFunction(a.warningTitle))&&this.enableHover()},enableHover:function(a){a||(a={});var b=this;this._hoverBinded||(this.element.on("mouseenter.title"+this.getName(),function(c){b._e=c,"warning"===b.getTipType()||BI.isKey(b.getWarningTitle())&&!b.isEnabled()?b.timeout=BI.delay(function(){b._showToolTip(b._e||c,a)},200):("success"===b.getTipType()||b.isEnabled())&&(b.timeout=BI.delay(function(){b._showToolTip(b._e||c,a)},500))}),this.element.on("mousemove.title"+this.getName(),function(a){b._e=a,b.element.__isMouseInBounds__(a)||(BI.isNotNull(b.timeout)&&clearTimeout(b.timeout),b._hideTooltip())}),this.element.on("mouseleave.title"+this.getName(),function(){b._e=null,BI.isNotNull(b.timeout)&&clearTimeout(b.timeout),b._hideTooltip()}),this._hoverBinded=!0)},disabledHover:function(){BI.isNotNull(this.timeout)&&clearTimeout(this.timeout),this._hideTooltip(),$(this.element).unbind("mouseenter.title"+this.getName()).unbind("mousemove.title"+this.getName()).unbind("mouseleave.title"+this.getName()),this._hoverBinded=!1},populate:function(a){this.items=a||[]},setTitle:function(a,b){this.options.title=a,BI.isKey(a)?this.enableHover(b):this.disabledHover()},setWarningTitle:function(a,b){this.options.warningTitle=a,BI.isKey(a)?this.enableHover(b):this.disabledHover()},getTipType:function(){return this.options.tipType},isReadOnly:function(){return!!this.options.readonly},getTitle:function(){var a=this.options.title;return BI.isFunction(a)?a():a},getWarningTitle:function(){var a=this.options.warningTitle;return BI.isFunction(a)?a():a},setValue:function(a){this.options.readonly||(this.options.value=a)},getValue:function(){return this.options.value}}),BI.Text=BI.inherit(BI.Single,{_defaultConfig:function(){var a=BI.Text.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-text",textAlign:"left",whiteSpace:"normal",lineHeight:null,handler:null,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,text:"",py:""})},_init:function(){BI.Text.superclass._init.apply(this,arguments);var a=this,b=this.options;b.hgap+b.lgap>0&&this.element.css({"padding-left":b.hgap+b.lgap+"px"}),b.hgap+b.rgap>0&&this.element.css({"padding-right":b.hgap+b.rgap+"px"}),b.vgap+b.tgap>0&&this.element.css({"padding-top":b.vgap+b.tgap+"px"}),b.vgap+b.bgap>0&&this.element.css({"padding-bottom":b.vgap+b.bgap+"px"}),BI.isNumber(b.height)&&this.element.css({lineHeight:b.height+"px"}),BI.isNumber(b.lineHeight)&&this.element.css({lineHeight:b.lineHeight+"px"}),this.element.css({textAlign:b.textAlign,whiteSpace:b.whiteSpace}),b.handler?(this.text=BI.createWidget({type:"bi.layout",tagName:"span"}),this.text.element.click(function(){b.handler(a.getValue())}),BI.createWidget({type:"bi.default",element:this,items:[this.text]})):this.text=this,BI.isKey(b.text)?this.setText(b.text):BI.isKey(b.value)&&this.setText(b.value),BI.isKey(b.keyword)&&this.text.element.__textKeywordMarked__(b.text,b.keyword,b.py)},doRedMark:function(a){var b=this.options;this.text.element.__textKeywordMarked__(b.text||b.value,a,b.py)},unRedMark:function(){var a=this.options;this.text.element.__textKeywordMarked__(a.text||a.value,"",a.py)},doHighLight:function(){this.text.element.addClass("bi-high-light")},unHighLight:function(){this.text.element.removeClass("bi-high-light")},setValue:function(a){BI.Text.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.setText(a)},setStyle:function(a){this.text.element.css(a)},setText:function(a){BI.Text.superclass.setText.apply(this,arguments),this.options.text=a,this.text.element.text((a+"").replaceAll(" "," "))}}),BI.shortcut("bi.text",BI.Text),BI.BasicButton=BI.inherit(BI.Single,{_defaultConfig:function(){var a=BI.BasicButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-basic-button"+(a.invalid?"":" cursor-pointer"),value:"",text:"",stopEvent:!1,stopPropagation:!1,selected:!1,once:!1,forceSelected:!1,forceNotSelected:!1,disableSelected:!1,shadow:!1,isShadowShowingOnSelected:!1,trigger:null,handler:BI.emptyFn})},_init:function(){BI.BasicButton.superclass._init.apply(this,arguments);var a=this.options;a.selected===!0&&BI.nextTick(BI.bind(function(){this.setSelected(a.selected)},this)),BI.nextTick(BI.bind(this.bindEvent,this)),a.shadow&&this._createShadow()},_createShadow:function(){var a=this,b=this.options,c=function(){a.$mask||(a.$mask=BI.createWidget(BI.isObject(b.shadow)?b.shadow:{},{type:"bi.layout",cls:"bi-button-mask"}),a.$mask.invisible(),BI.createWidget({type:"bi.absolute",element:a,items:[{el:a.$mask,left:0,right:0,top:0,bottom:0}]}))};this.element.mouseup(function(){a._hover||b.isShadowShowingOnSelected||(c(),a.$mask.invisible())}),this.element.on("mouseenter."+this.getName(),function(d){a.element.__isMouseInBounds__(d)&&(!a.isEnabled()||a._hover||!b.isShadowShowingOnSelected&&a.isSelected()||(c(),a.$mask.visible()))}),this.element.on("mousemove."+this.getName(),function(b){a.element.__isMouseInBounds__(b)||a.isEnabled()&&!a._hover&&(c(),a.$mask.invisible())}),this.element.on("mouseleave."+this.getName(),function(){a.isEnabled()&&!a._hover&&(c(),a.$mask.invisible())})},bindEvent:function(){function a(a){d.stopEvent&&a.stopEvent(),d.stopPropagation&&a.stopPropagation()}function b(b){a(b),!c.isEnabled()||c.isOnce()&&c.isSelected()||h.apply(c,arguments)}var c=this,d=this.options,f=this.handle();if(f){f=f.element;var g=(d.trigger||"").split(",");BI.each(g,function(g,h){switch(h){case"mouseup":var i=!1;f.mousedown(function(){i=!0,a(e)}),f.mouseup(function(c){i===!0&&b(c),i=!1,a(c)});break;case"mousedown":var i=!1,j=!1;f.mousedown(function(d){$(document).bind("mouseup."+c.getName(),function(a){!BI.DOM.isExist(c)||f.__isMouseInBounds__(a)||i!==!0||j||c._trigger(),i=!1,$(document).unbind("mouseup."+c.getName())}),i!==!0&&(c.isSelected()?j=!0:b(d),i=!0,a(d))}),f.mouseup(function(a){BI.DOM.isExist(c)&&i===!0&&j===!0&&b(a),i=!1,j=!1,$(document).unbind("mouseup."+c.getName())});break;case"dblclick":f.dblclick(b);break;case"lclick":var k,i=!1;f.mousedown(function(b){$(document).bind("mouseup."+c.getName(),function(a){k&&clearInterval(k),k=null,i=!1,$(document).unbind("mouseup."+c.getName())}),i!==!0&&(!c.isEnabled()||c.isOnce()&&c.isSelected()||(k=setInterval(function(){c.isEnabled()&&c.doClick()},100),i=!0,a(b)))});break;default:(d.stopEvent||d.stopPropagation)&&(f.mousedown(function(b){a(b)}),f.mouseup(function(b){a(b)})),f.click(b)}});var h=BI.debounce(this._doClick,BI.EVENT_RESPONSE_TIME,!0)}},_trigger:function(){var a=this.options;if(this.isEnabled()&&(this.isDisableSelected()||(this.isForceSelected()?this.setSelected(!0):this.isForceNotSelected()?this.setSelected(!1):this.setSelected(!this.isSelected())),this.isValid())){a.handler.call(this,this.getValue(),this);var b=this.getValue();this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,b,this),this.fireEvent(BI.BasicButton.EVENT_CHANGE,b,this)}},_doClick:function(a){this.isValid()&&this.beforeClick(a),this._trigger(),this.isValid()&&this.doClick(a)},beforeClick:function(){},doClick:function(){},handle:function(){return this},hover:function(){this._hover=!0,this.handle().element.addClass("hover"),this.options.shadow&&this.$mask&&this.$mask.setVisible(!0)},dishover:function(){this._hover=!1,this.handle().element.removeClass("hover"),this.options.shadow&&this.$mask&&this.$mask.setVisible(!1)},setSelected:function(a){var b=this.options;b.selected=a,a?this.handle().element.addClass("active"):this.handle().element.removeClass("active"),b.shadow&&!b.isShadowShowingOnSelected&&this.$mask&&this.$mask.setVisible(!1)},isSelected:function(){return this.options.selected},isOnce:function(){return this.options.once},isForceSelected:function(){return this.options.forceSelected},isForceNotSelected:function(){return this.options.forceNotSelected},isDisableSelected:function(){return this.options.disableSelected},setText:function(a){this.options.text=a},getText:function(){return this.options.text},_setEnable:function(a){BI.BasicButton.superclass._setEnable.apply(this,arguments),a===!0?this.element.removeClass("base-disabled disabled"):a===!1&&this.element.addClass("base-disabled disabled"),a||this.options.shadow&&this.$mask&&this.$mask.setVisible(!1)},empty:function(){$(document).unbind("mouseup."+this.getName()),BI.BasicButton.superclass.empty.apply(this,arguments)},destroy:function(){BI.BasicButton.superclass.destroy.apply(this,arguments)}}),BI.BasicButton.EVENT_CHANGE="BasicButton.EVENT_CHANGE",BI.NodeButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var a=BI.NodeButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-node",open:!1})},_init:function(){BI.NodeButton.superclass._init.apply(this,arguments);var a=this;BI.nextTick(function(){a.setOpened(a.isOpened())})},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.setOpened(!this.isOpened())},isOnce:function(){return!1},isOpened:function(){return!!this.options.open},setOpened:function(a){this.options.open=!!a},triggerCollapse:function(){this.isOpened()&&(this.setOpened(!1),this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,this.getValue(),this))},triggerExpand:function(){this.isOpened()||(this.setOpened(!0),this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,this.getValue(),this))}}),BI.Tip=BI.inherit(BI.Single,{_defaultConfig:function(){var a=BI.Link.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-tip",zIndex:BI.zIndex_tip})},_init:function(){BI.Tip.superclass._init.apply(this,arguments),this.element.css({zIndex:this.options.zIndex})}}),BI.ButtonGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ButtonGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-button-group",behaviors:{},items:[],chooseType:BI.Selection.Single,layouts:[{type:"bi.center",hgap:0,vgap:0}]})},_init:function(){BI.ButtonGroup.superclass._init.apply(this,arguments);var a={};BI.each(this.options.behaviors,function(b,c){a[b]=BI.BehaviorFactory.createBehavior(b,{rule:c})}),this.behaviors=a,this.populate(this.options.items)},_createBtns:function(a){this.options;return BI.createWidgets(BI.createItems(a,{type:"bi.text_button"}))},_btnsCreator:function(a){var b=this,c=Array.prototype.slice.call(arguments),d=this.options,e=this._createBtns(a);return c[0]=e,BI.each(this.behaviors,function(a,b){b.doBehavior.apply(b,c)}),BI.each(e,function(a,c){c.on(BI.Controller.EVENT_CHANGE,function(a,e,f){if(a===BI.Events.CLICK){switch(d.chooseType){case BI.ButtonGroup.CHOOSE_TYPE_SINGLE:b.setValue(c.getValue());break;case BI.ButtonGroup.CHOOSE_TYPE_NONE:b.setValue([])}b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),b.fireEvent(BI.ButtonGroup.EVENT_CHANGE,e,f)}else b.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),c.on(BI.Events.DESTROY,function(){BI.remove(b.buttons,c)})}),e},_packageBtns:function(a){for(var b=this.options,c=b.layouts.length-1;c>0;c--)a=BI.map(a,function(a,d){return BI.extend({},b.layouts[c],{items:[BI.extend({},b.layouts[c].el,{el:d})]})});return a},_packageSimpleItems:function(a){var b=this.options;return BI.map(b.items,function(b,c){return BI.stripEL(c)===c?a[b]:BI.extend({},c,{el:a[b]})})},_packageItems:function(a,b){return BI.createItems(BI.makeArrayByArray(a,{}),BI.clone(b))},_packageLayout:function(a){for(var b=this.options,c=BI.deepClone(b.layouts[0]),d=BI.formatEL(c).el;d&&d.items&&!BI.isEmpty(d.items);)d=BI.formatEL(d.items[0]).el;return d.items=a,c},_isSimpleLayout:function(){var a=this.options;return 1===a.layouts.length&&!BI.isArray(a.items[0])},doBehavior:function(){var a=Array.prototype.slice.call(arguments);a.unshift(this.buttons),BI.each(this.behaviors,function(b,c){c.doBehavior.apply(c,a)})},prependItems:function(a){var b=(this.options,this._btnsCreator.apply(this,arguments));return this.buttons=BI.concat(b,this.buttons),this._isSimpleLayout()&&this.layouts&&this.layouts.prependItems?void this.layouts.prependItems(b):(a=this._packageItems(a,this._packageBtns(b)),void this.layouts.prependItems(this._packageLayout(a).items))},addItems:function(a){var b=(this.options,this._btnsCreator.apply(this,arguments));return this.buttons=BI.concat(this.buttons,b),this._isSimpleLayout()&&this.layouts&&this.layouts.addItems?void this.layouts.addItems(b):(a=this._packageItems(a,this._packageBtns(b)),void this.layouts.addItems(this._packageLayout(a).items))},removeItemAt:function(a){BI.removeAt(this.buttons,a),this.layouts.removeItemAt(a)},removeItems:function(a){a=BI.isArray(a)?a:[a];var b=[];BI.each(this.buttons,function(c,d){BI.deepContains(a,d.getValue())&&b.push(c)}),BI.removeAt(this.buttons,b),this.layouts.removeItemAt(b)},populate:function(a){a=a||[],this.empty(),this.options.items=a,this.buttons=this._btnsCreator.apply(this,arguments),a=this._isSimpleLayout()?this._packageSimpleItems(this.buttons):this._packageItems(a,this._packageBtns(this.buttons)),this.layouts=BI.createWidget(BI.extend({element:this},this._packageLayout(a)))},setNotSelectedValue:function(a){a=BI.isArray(a)?a:[a],BI.each(this.buttons,function(b,c){BI.deepContains(a,c.getValue())?c.setSelected&&c.setSelected(!1):c.setSelected&&c.setSelected(!0)})},setEnabledValue:function(a){a=BI.isArray(a)?a:[a],BI.each(this.buttons,function(b,c){BI.deepContains(a,c.getValue())?c.setEnable(!0):c.setEnable(!1)})},setValue:function(a){a=BI.isArray(a)?a:[a],BI.each(this.buttons,function(b,c){BI.deepContains(a,c.getValue())?c.setSelected&&c.setSelected(!0):c.setSelected&&c.setSelected(!1)})},getNotSelectedValue:function(){var a=[];return BI.each(this.buttons,function(b,c){!c.isEnabled()||c.isSelected&&c.isSelected()||a.push(c.getValue())}),a},getValue:function(){var a=[];return BI.each(this.buttons,function(b,c){c.isEnabled()&&c.isSelected&&c.isSelected()&&a.push(c.getValue())}),a},getAllButtons:function(){return this.buttons},getAllLeaves:function(){return this.buttons},getSelectedButtons:function(){var a=[];return BI.each(this.buttons,function(b,c){c.isSelected&&c.isSelected()&&a.push(c)}),a},getNotSelectedButtons:function(){var a=[];return BI.each(this.buttons,function(b,c){c.isSelected&&!c.isSelected()&&a.push(c)}),a},getIndexByValue:function(a){var b=-1;return BI.any(this.buttons,function(c,d){if(d.isEnabled()&&d.getValue()===a)return b=c,!0}),b},getNodeById:function(a){var b;return BI.any(this.buttons,function(c,d){if(d.isEnabled()&&d.options.id===a)return b=d,!0}),b},getNodeByValue:function(a){var b;return BI.any(this.buttons,function(c,d){if(d.isEnabled()&&d.getValue()===a)return b=d,!0}),b},empty:function(){BI.ButtonGroup.superclass.empty.apply(this,arguments),this.options.items=[]},destroy:function(){BI.ButtonGroup.superclass.destroy.apply(this,arguments),this.options.items=[]}}),BI.extend(BI.ButtonGroup,{CHOOSE_TYPE_SINGLE:BI.Selection.Single,CHOOSE_TYPE_MULTI:BI.Selection.Multi,CHOOSE_TYPE_ALL:BI.Selection.All,CHOOSE_TYPE_NONE:BI.Selection.None,CHOOSE_TYPE_DEFAULT:BI.Selection.Default}),BI.ButtonGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.button_group",BI.ButtonGroup),BI.ButtonTree=BI.inherit(BI.ButtonGroup,{_defaultConfig:function(){return BI.extend(BI.ButtonTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-button-tree"})},_init:function(){BI.ButtonTree.superclass._init.apply(this,arguments)},setNotSelectedValue:function(a){a=BI.isArray(a)?a:[a],BI.each(this.buttons,function(b,c){return BI.isFunction(c.setSelected)?void(BI.deepContains(a,c.getValue())?c.setSelected(!1):c.setSelected(!0)):void c.setNotSelectedValue(a)})},setEnabledValue:function(a){a=BI.isArray(a)?a:[a],BI.each(this.buttons,function(b,c){return BI.isFunction(c.setEnabledValue)?void c.setEnabledValue(a):void(BI.deepContains(a,c.getValue())?c.setEnable(!0):c.setEnable(!1))})},setValue:function(a){a=BI.isArray(a)?a:[a],BI.each(this.buttons,function(b,c){return BI.isFunction(c.setSelected)?void(BI.deepContains(a,c.getValue())?c.setSelected(!0):c.setSelected(!1)):void c.setValue(a)})},getNotSelectedValue:function(){var a=[];return BI.each(this.buttons,function(b,c){return c.isEnabled()&&!BI.isFunction(c.setSelected)?void(a=BI.concat(a,c.getNotSelectedValue())):void(c.isEnabled()&&c.isSelected&&!c.isSelected()&&a.push(c.getValue()))}),a},getValue:function(){var a=[];return BI.each(this.buttons,function(b,c){return c.isEnabled()&&!BI.isFunction(c.setSelected)?void(a=BI.concat(a,c.getValue())):void(c.isEnabled()&&c.isSelected&&c.isSelected()&&a.push(c.getValue()))}),a},getSelectedButtons:function(){var a=[];return BI.each(this.buttons,function(b,c){return c.isEnabled()&&!BI.isFunction(c.setSelected)?void(a=a.concat(c.getSelectedButtons())):void(c.isSelected&&c.isSelected()&&a.push(c))}),a},getNotSelectedButtons:function(){var a=[];return BI.each(this.buttons,function(b,c){return c.isEnabled()&&!BI.isFunction(c.setSelected)?void(a=a.concat(c.getNotSelectedButtons())):void(c.isSelected&&!c.isSelected()&&a.push(c))}),a},getAllLeaves:function(){var a=[];return BI.each(this.buttons,function(b,c){return c.isEnabled()&&!BI.isFunction(c.setSelected)?void(a=a.concat(c.getAllLeaves())):void(c.isEnabled()&&a.push(c))}),a},getIndexByValue:function(a){var b=-1;return BI.any(this.buttons,function(c,d){var e=d.getValue();if(d.isEnabled()&&(e===a||BI.contains(e,a)))return b=c,!0}),b},getNodeById:function(a){var b;return BI.any(this.buttons,function(c,d){if(d.isEnabled()){if(d.attr("id")===a)return b=d,!0;if(BI.isFunction(d.getNodeById)&&(b=d.getNodeById(a)))return!0}}),b},getNodeByValue:function(a){var b;return BI.any(this.buttons,function(c,d){if(d.isEnabled())if(BI.isFunction(d.getNodeByValue)){if(b=d.getNodeByValue(a))return!0}else if(d.attr("value")===a)return b=d,!0}),b}}),BI.ButtonTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.button_tree",BI.ButtonTree),BI.TreeView=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TreeView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tree",paras:{},itemsCreator:BI.emptyFn})},_init:function(){BI.TreeView.superclass._init.apply(this,arguments),this._stop=!1,this._createTree(),this.tip=BI.createWidget({type:"bi.loading_bar",invisible:!0,handler:BI.bind(this._loadMore,this)}),BI.createWidget({type:"bi.vertical",scrollable:!0,scrolly:!1,element:this,items:[this.tip]})},_createTree:function(){this.id="bi-tree"+BI.UUID(),this.nodes&&this.nodes.destroy(),this.tree&&this.tree.destroy(),this.tree=BI.createWidget({type:"bi.layout",element:"
    "}),BI.createWidget({type:"bi.default",element:this.element,items:[this.tree]})},_selectTreeNode:function(a,b){this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,b,this),this.fireEvent(BI.TreeView.EVENT_CHANGE,b,this)},_configSetting:function(){function a(a,b,c){l.nodes.checkNode(c,!c.checked,!0,!0)}function b(a,b){var c=l._getParentValues(b);b.times=b.times||1;var d="id="+b.id+"×="+b.times++ +"&parentValues= "+window.encodeURIComponent(BI.jsonEncode(c))+"&checkState="+window.encodeURIComponent(BI.jsonEncode(b.getCheckStatus()));return BI.servletURL+"?op="+l.options.op+"&cmd="+l.options.cmd+"&"+d}function c(a,b){return b.isAjaxing?(BI.Msg.toast("Please Wait。","warning"),!1):(b.children||(b.times=1,f(b,"refresh")),!0)}function d(a,b,c,d){if(c.halfCheck=!1,d&&0!==d.length&&!/^[\s,\S]*<\/html>$/gi.test(d)&&!l._stop){var e=l.nodes,g=c.count||0;c.children.length>g?(c.count=c.children.length,BI.delay(function(){f(c)},n)):(e.updateNode(c),e.selectNode(c.children[0]))}}function e(a,b,c,d,e,f){l.nodes;BI.Msg.toast("Error!","warning")}function f(a,b){var c=l.nodes;"refresh"==b&&c.updateNode(a),c.reAsyncChildNodes(a,b,!0)}function g(a,b){function c(a){BI.each(a,function(a,b){b.halfCheck===!0&&(b.halfCheck=!1,c(b.children))})}if(b.halfCheck=!1,b.checked===!0){c(b.children);var d=l.nodes,e=d.getSelectedNodes();$.each(e,function(a,b){b.halfCheck=!1})}}function h(a,b,c){l._selectTreeNode(b,c)}function i(a,b,c){c.halfCheck=!1}function j(a,b,c){}var k=this.options.paras,l=this,m={async:{enable:!0,url:b,autoParam:["id","name"],otherParam:BI.cjkEncodeDO(k)},check:{enable:!0},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{beforeExpand:c,onAsyncSuccess:d,onAsyncError:e,beforeCheck:g,onCheck:h,onExpand:i,onCollapse:j,onClick:a}},n=100;return m},_getParentValues:function(a){if(!a.getParentNode())return[];var b=a.getParentNode(),c=this._getParentValues(b);return c=c.concat([this._getNodeValue(b)])},_getNodeValue:function(a){return null==a.value?a.text.replace(/<[^>]+>/g,"").replaceAll(" "," "):a.value},_getHalfSelectedValues:function(a,b){var c=this,d=b.getCheckStatus();if(d.checked!==!1||d.half!==!1){if(BI.isNotEmptyArray(b.children)&&d.half===!0){var e=b.children;return void BI.each(e,function(b,d){c._getHalfSelectedValues(a,d)})}var f=b.parentValues||c._getParentValues(b),g=f.concat(this._getNodeValue(b));if(BI.isNotEmptyArray(b.children)||d.half===!1)return void this._buildTree(a,g);var h=BI.deepClone(this.options.paras.selectedValues),i=this._getTree(h,g);this._addTreeNode(a,f,this._getNodeValue(b),i)}},_getTree:function(a,b){var c=a;return BI.any(b,function(a,b){return null==c[b]||void(c=c[b])}),c},_addTreeNode:function(a,b,c,d){var e=a;BI.each(b,function(a,b){null==e[b]&&(e[b]={}),e=e[b]}),e[c]=d},_buildTree:function(a,b){var c=a;BI.each(b,function(a,b){null==c[b]&&(c[b]={}),c=c[b]})},_getSelectedValues:function(){function a(a){BI.each(a,function(a,d){var e=d.getCheckStatus();if(e.checked===!0||e.half===!0)if(e.half===!0)b._getHalfSelectedValues(c,d);else{var f=d.parentValues||b._getParentValues(d),g=f.concat([b._getNodeValue(d)]);b._buildTree(c,g)}})}var b=this,c={},d=this.nodes.getNodes();return a(d),c},_dealWidthNodes:function(a){var b=this.options,c=BI.Tree.arrayFormat(a);return BI.each(c,function(a,c){c.title=c.title||c.text||c.value,BI.isKey(b.paras.keyword)?c.text=$("
    ").__textKeywordMarked__(c.text,b.paras.keyword,c.py).html():c.text=(c.text+"").replaceAll(" "," ")}),a},_loadMore:function(){var a=this,b=this.options;this.tip.setLoading();var c=BI.extend({},b.paras,{times:++this.times});b.itemsCreator(c,function(b){if(a._stop!==!0){var c=!!b.hasNext,d=b.items||[];c?a.tip.setLoaded():a.tip.setEnd(),d.length>0&&a.nodes.addNodes(null,a._dealWidthNodes(d))}})},_initTree:function(a){var b=this,c=this.options;b.fireEvent(BI.Events.INIT),this.times=1;var d=this.tree;d.empty(),this.loading(),this.tip.setVisible(!1);var e=function(c){b._stop!==!0&&(b.nodes=$.fn.zTree.init(d.element,a,c))},f=BI.extend({},c.paras,{times:1});c.itemsCreator(f,function(a){if(b._stop!==!0){var c=!!a.hasNext,d=a.items||[];d.length>0&&e(b._dealWidthNodes(d)),b.setTipVisible(d.length<=0),b.loaded(),c?b.tip.setLoaded():b.tip.invisible(),1===f.times&&b.fireEvent(BI.Events.AFTERINIT)}})},initTree:function(a,b){var b=b||{async:{enable:!1},check:{enable:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0},callback:{}};this.nodes=$.fn.zTree.init(this.tree.element,b,a)},start:function(){this._stop=!1},stop:function(){this._stop=!0},stroke:function(a){delete this.options.keyword,BI.extend(this.options.paras,a);var b=this._configSetting();this._createTree(),this.start(),this._initTree(b)},populate:function(){this.stroke.apply(this,arguments)},hasChecked:function(){var a=this.nodes;return a.getCheckedNodes(!0).length>0},checkAll:function(a){function b(a){BI.each(a,function(a,c){c.halfCheck=!1,b(c.children)})}BI.each(this.nodes.getNodes(),function(a,c){c.halfCheck=!1,b(c.children)}),this.nodes&&this.nodes.checkAllNodes(a)},expandAll:function(a){this.nodes&&this.nodes.expandAll(a)},setValue:function(a,b){this.checkAll(!1),this.updateValue(a,b),this.refresh()},setSelectedValue:function(a){this.options.paras.selectedValues=BI.deepClone(a||{})},updateValue:function(a,b){if(this.nodes){b||(b="value");var c=this.nodes;BI.each(a,function(a,d){var e=c.getNodesByParam(b,a,null);BI.each(e,function(a,b){BI.extend(b,{checked:!0},d),c.updateNode(b)})})}},refresh:function(){this.nodes&&this.nodes.refresh()},getValue:function(){return this.nodes?this._getSelectedValues():null},destroyed:function(){this.stop(),this.nodes&&this.nodes.destroy()}}),BI.extend(BI.TreeView,{REQ_TYPE_INIT_DATA:1,REQ_TYPE_ADJUST_DATA:2,REQ_TYPE_SELECT_DATA:3,REQ_TYPE_GET_SELECTED_DATA:4}),BI.TreeView.EVENT_CHANGE="EVENT_CHANGE",BI.TreeView.EVENT_INIT=BI.Events.INIT,BI.TreeView.EVENT_AFTERINIT=BI.Events.AFTERINIT,BI.shortcut("bi.tree_view",BI.TreeView),BI.AsyncTree=BI.inherit(BI.TreeView,{_defaultConfig:function(){return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.AsyncTree.superclass._init.apply(this,arguments)},_configSetting:function(){function a(a,b,c){var d=$.fn.zTree.getZTreeObj(b);d.checkNode(c,!c.checked,!0,!0)}function b(a,b){function c(a){BI.each(a,function(a,b){b.halfCheck===!0&&(b.halfCheck=!1,c(b.children))})}if(b.halfCheck=!1,b.checked===!0){c(b.children);var d=$.fn.zTree.getZTreeObj(a),e=d.getSelectedNodes();BI.each(e,function(a,b){b.halfCheck=!1; })}}function c(a,b){h._beforeExpandNode(a,b)}function d(a,b,c){h._selectTreeNode(b,c)}function e(a,b,c){c.halfCheck=!1}function f(a,b,c){c.halfCheck=!1}var g=this.options.paras,h=this,i={async:{enable:!1,otherParam:BI.cjkEncodeDO(g)},check:{enable:!0},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{beforeCheck:b,onCheck:d,beforeExpand:c,onExpand:e,onCollapse:f,onClick:a}};return i},_selectTreeNode:function(a,b){var c=this,d=(this.options,BI.deepClone(b.parentValues||c._getParentValues(b))),e=this._getNodeValue(b);if(b.checked===!0);else{var f=b,g=this._getTree(this.options.paras.selectedValues,d);for(BI.isNotNull(g[e])&&delete g[e];null!=f&&BI.isEmpty(g);)d=d.slice(0,d.length-1),f=f.getParentNode(),null!=f&&(g=this._getTree(this.options.paras.selectedValues,d),e=this._getNodeValue(f),delete g[e])}BI.AsyncTree.superclass._selectTreeNode.apply(c,arguments)},_beforeExpandNode:function(a,b){function c(a,c){d.nodes.addNodes(b,a),c===!0&&BI.delay(function(){i++,g.times=i,e.itemsCreator(g,h)},100)}var d=this,e=this.options,f=b.parentValues||d._getParentValues(b),g=BI.extend({},e.paras,{id:b.id,times:1,parentValues:f.concat(this._getNodeValue(b)),checkState:b.getCheckStatus()}),h=function(a){var b=a.items||[];b.length>0&&c(d._dealWidthNodes(b),!!a.hasNext)},i=1;b.children||e.itemsCreator(g,h)},_join:function(a,b){function c(a,b,f){BI.each(b,function(g,h){BI.isNull(f[g])?d._addTreeNode(e,a,g,h):BI.isEmpty(f[g])?d._addTreeNode(e,a,g,{}):c(a.concat([g]),b[g],f[g])})}var d=this,e={};return c([],a,b),c([],b,a),e},hasChecked:function(){return!BI.isEmpty(this.options.paras.selectedValues)||BI.AsyncTree.superclass.hasChecked.apply(this,arguments)},getValue:function(){if(!this.nodes)return{};var a=this._getSelectedValues();return BI.isEmpty(a)?BI.deepClone(this.options.paras.selectedValues):BI.isEmpty(this.options.paras.selectedValues)?a:this._join(a,this.options.paras.selectedValues)},stroke:function(a){delete this.options.keyword,BI.extend(this.options.paras,a);var b=this._configSetting();this._initTree(b)}}),BI.shortcut("bi.async_tree",BI.AsyncTree),BI.PartTree=BI.inherit(BI.AsyncTree,{_defaultConfig:function(){return BI.extend(BI.PartTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.PartTree.superclass._init.apply(this,arguments)},_loadMore:function(){var a=this,b=this.options,c=BI.extend({},b.paras,{type:BI.TreeView.REQ_TYPE_INIT_DATA,times:++this.times});this.tip.setLoading(),b.itemsCreator(c,function(c){var d=!!c.hasNext,e=c.items||[];b.paras.lastSearchValue=c.lastSearchValue,a._stop!==!0&&(d?a.tip.setLoaded():a.tip.setEnd(),e.length>0&&a.nodes.addNodes(null,a._dealWidthNodes(e)))})},_selectTreeNode:function(a,b){var c=this,d=this.options,e=BI.deepClone(b.parentValues||c._getParentValues(b)),f=this._getNodeValue(b);if(b.checked===!0)BI.AsyncTree.superclass._selectTreeNode.apply(c,arguments);else{for(var g=this.options.paras.selectedValues,h=e.concat(f),i=0,j=h.length;i0&&c(d._dealWidthNodes(g)),d.setTipVisible(g.length<=0),d.loaded(),f?d.tip.setLoaded():d.tip.invisible(),d.fireEvent(BI.Events.AFTERINIT)}};BI.delay(function(){e.itemsCreator(g,h)},100)},getValue:function(){var a=this.options,b=BI.PartTree.superclass.getValue.apply(this,arguments);return a.itemsCreator({type:BI.TreeView.REQ_TYPE_ADJUST_DATA,selectedValues:b},function(a){b=a}),b},stroke:function(a){var b=this.options;delete b.paras.keyword,BI.extend(b.paras,a),delete b.paras.lastSearchValue;var c=this._configSetting();this._initTree(c,b.paras.keyword)}}),BI.shortcut("bi.part_tree",BI.PartTree),BI.Resizers=new BI.ResizeController,BI.Layers=new BI.LayerController,BI.Maskers=new BI.MaskersController,BI.Bubbles=new BI.BubblesController,BI.Tooltips=new BI.TooltipsController,BI.Popovers=new BI.FloatBoxController,BI.Broadcasts=new BI.BroadcastController,BI.StyleLoaders=new BI.StyleLoaderManager,BI.Canvas=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Canvas.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-canvas"})},_init:function(){BI.Canvas.superclass._init.apply(this,arguments);var a=this.options,b=document.createElement("canvas");document.createElement("canvas").getContext||(b=window.G_vmlCanvasManager.initElement(b)),this.element.append(b),b.width=a.width,b.height=a.height,$(b).width("100%"),$(b).height("100%"),this.canvas=b,this._queue=[]},_getContext:function(){return this.ctx||(this.ctx=this.canvas.getContext("2d")),this.ctx},_attr:function(a,b){var c=this;if(!BI.isNull(a))return BI.isObject(a)?void BI.each(a,function(a,b){c._queue.push({k:a,v:b})}):void this._queue.push({k:a,v:b})},_line:function(a,b){var c=this,d=[].slice.call(arguments,2);BI.isOdd(d.length)&&(this._attr(BI.last(d)),d=BI.initial(d)),this._attr("moveTo",[a,b]);var e=BI.filter(d,function(a){return a%2===0}),f=BI.filter(d,function(a){return a%2!==0});d=BI.zip(e,f),BI.each(d,function(a,b){c._attr("lineTo",b)})},line:function(a,b,c,d){this._line.apply(this,arguments),this._attr("stroke",[])},rect:function(a,b,c,d,e){this._attr("fillStyle",e),this._attr("fillRect",[a,b,c,d])},circle:function(a,b,c,d){this._attr({fillStyle:d,beginPath:[],arc:[a,b,c,0,2*Math.PI,!0],closePath:[],fill:[]})},hollow:function(){this._attr("beginPath",[]),this._line.apply(this,arguments),this._attr("closePath",[]),this._attr("stroke",[])},solid:function(){this.hollow.apply(this,arguments),this._attr("fill",[])},gradient:function(a,b,c,d,e,f){var g=this._getContext().createLinearGradient(a,b,c,d);return g.addColorStop(0,e),g.addColorStop(1,f),g},reset:function(){this._getContext().clearRect(0,0,this.canvas.width,this.canvas.height)},stroke:function(a){var b=this;BI.nextTick(function(){var c=b._getContext();BI.each(b._queue,function(a,b){BI.isFunction(c[b.k])?c[b.k].apply(c,b.v):c[b.k]=b.v}),b._queue=[],a&&a()})}}),BI.shortcut("bi.canvas",BI.Canvas),BI.CollectionView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CollectionView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-collection",overflowX:!0,overflowY:!0,cellSizeAndPositionGetter:BI.emptyFn,horizontalOverscanSize:0,verticalOverscanSize:0,scrollLeft:0,scrollTop:0,items:[]})},_init:function(){BI.CollectionView.superclass._init.apply(this,arguments);var a=this,b=this.options;this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1,this._debounceRelease=BI.debounce(function(){a._scrollLock=!1},1e3/60),this.container=BI.createWidget({type:"bi.absolute"}),this.element.scroll(function(){a._scrollLock!==!0&&(b.scrollLeft=a.element.scrollLeft(),b.scrollTop=a.element.scrollTop(),a._calculateChildrenToRender(),a.fireEvent(BI.CollectionView.EVENT_SCROLL,{scrollLeft:b.scrollLeft,scrollTop:b.scrollTop}))}),BI.createWidget({type:"bi.vertical",element:this,scrollable:b.overflowX===!0&&b.overflowY===!0,scrolly:b.overflowX===!1&&b.overflowY===!0,scrollx:b.overflowX===!0&&b.overflowY===!1,items:[this.container]}),b.items.length>0&&(this._calculateSizeAndPositionData(),this._populate()),0===b.scrollLeft&&0===b.scrollTop||BI.nextTick(function(){a.element.scrollTop(b.scrollTop),a.element.scrollLeft(b.scrollLeft)})},_calculateSizeAndPositionData:function(){for(var a=this.options,b=[],c=new BI.SectionManager,d=0,e=0,f=0,g=a.items.length;f0&&h>0){if(f>=this.renderRange.minY&&h<=this.renderRange.maxY&&e>=this.renderRange.minX&&g<=this.renderRange.maxX)return;for(var i=this._cellRenderers(h-f,g-e,e,f),j=[],k={},l={},m={},n={},o=0,p=i.length;o=0?(q.width!==this.renderedCells[A]._width&&(this.renderedCells[A]._width=q.width,this.renderedCells[A].el.setWidth(q.width)),q.height!==this.renderedCells[A]._height&&(this.renderedCells[A]._height=q.height,this.renderedCells[A].el.setHeight(q.height)),this.renderedCells[A]._left!==q.x&&this.renderedCells[A].el.element.css("left",q.x+"px"),this.renderedCells[A]._top!==q.y&&this.renderedCells[A].el.element.css("top",q.y+"px"),j.push(z=this.renderedCells[A])):(z=BI.createWidget(BI.extend({type:"bi.label",width:q.width,height:q.height},b.items[q.index],{cls:(b.items[q.index].cls||"")+" container-cell"+(0===q.y?" first-row":"")+(0===q.x?" first-col":""),_left:q.x,_top:q.y})),j.push({el:z,left:q.x,top:q.y,_left:q.x,_top:q.y,_width:q.width,_height:q.height}));for(var B=0|s[q.y],C=0|s[q.y+q.height],D=B;D<=C;D++){var E=n[D];x(t,E),y(u,E),t[E]=Math.min(t[E],q.x),u[E]=Math.max(u[E],q.x+q.width)}for(var F=0|r[q.x],G=0|r[q.x+q.width],D=F;D<=G;D++){var H=m[D];x(v,H),y(w,H),v[H]=Math.min(v[H],q.y),w[H]=Math.max(w[H],q.y+q.height)}k[q.index]=[q.index,o],l[o]=z}var I={},J={},K=[];BI.each(k,function(b,c){a.renderedKeys[b]?I[b]=c:J[b]=c}),BI.each(this.renderedKeys,function(a,b){I[a]||J[a]||K.push(b[1])}),BI.each(K,function(b,c){a.renderedCells[c].el._destroy()});var L=[];BI.each(J,function(a,b){L.push(j[b[1]])}),this.container.addItems(L),this.container._children=l,this.container.attr("items",j),this.renderedCells=j,this.renderedKeys=k;var M=BI.min(t),N=BI.max(u),O=BI.max(v),P=BI.min(w);this.renderRange={minX:M,minY:O,maxX:N,maxY:P}}},_getMaxScrollLeft:function(){return Math.max(0,this._width-this.options.width+(this.options.overflowX?BI.DOM.getScrollWidth():0))},_getMaxScrollTop:function(){return Math.max(0,this._height-this.options.height+(this.options.overflowY?BI.DOM.getScrollWidth():0))},_populate:function(a){var b=this.options;this._reRange(),a&&a!==this.options.items&&(this.options.items=a,this._calculateSizeAndPositionData()),b.items.length>0&&(this.container.setWidth(this._width),this.container.setHeight(this._height),this._calculateChildrenToRender(),this.element.scrollTop(b.scrollTop),this.element.scrollLeft(b.scrollLeft))},setScrollLeft:function(a){this.options.scrollLeft!==a&&(this._scrollLock=!0,this.options.scrollLeft=BI.clamp(a||0,0,this._getMaxScrollLeft()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollLeft(this.options.scrollLeft))},setScrollTop:function(a){this.options.scrollTop!==a&&(this._scrollLock=!0,this.options.scrollTop=BI.clamp(a||0,0,this._getMaxScrollTop()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollTop(this.options.scrollTop))},setOverflowX:function(a){var b=this;this.options.overflowX!==!!a&&(this.options.overflowX=!!a,BI.nextTick(function(){b.element.css({overflowX:a?"auto":"hidden"})}))},setOverflowY:function(a){var b=this;this.options.overflowY!==!!a&&(this.options.overflowY=!!a,BI.nextTick(function(){b.element.css({overflowY:a?"auto":"hidden"})}))},getScrollLeft:function(){return this.options.scrollLeft},getScrollTop:function(){return this.options.scrollTop},getMaxScrollLeft:function(){return this._getMaxScrollLeft()},getMaxScrollTop:function(){return this._getMaxScrollTop()},_reRange:function(){this.renderRange={}},_clearChildren:function(){this.container._children={},this.container.attr("items",[])},restore:function(){BI.each(this.renderedCells,function(a,b){b.el._destroy()}),this._clearChildren(),this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1},populate:function(a){a&&a!==this.options.items&&this.restore(),this._populate(a)}}),BI.CollectionView.EVENT_SCROLL="EVENT_SCROLL",BI.shortcut("bi.collection_view",BI.CollectionView),BI.Combo=BI.inherit(BI.Widget,{_defaultConfig:function(){var a=BI.Combo.superclass._defaultConfig.apply(this,arguments);return BI.extend(a,{baseCls:(a.baseCls||"")+" bi-combo",trigger:"click",toggle:!0,direction:"bottom",container:null,isDefaultInit:!1,destroyWhenHide:!1,isNeedAdjustHeight:!0,isNeedAdjustWidth:!0,stopEvent:!1,stopPropagation:!1,adjustLength:0,adjustXOffset:0,adjustYOffset:0,hideChecker:BI.emptyFn,offsetStyle:"left",el:{},popup:{},comboClass:"bi-combo-popup",hoverClass:"bi-combo-hover"})},_init:function(){BI.Combo.superclass._init.apply(this,arguments);var a=this,b=this.options;this._initCombo(),this._initPullDownAction(),this.combo.on(BI.Controller.EVENT_CHANGE,function(b,c,d){a.isEnabled()&&a.isValid()&&(b===BI.Events.EXPAND&&a._popupView(),b===BI.Events.COLLAPSE&&a._hideView(),b===BI.Events.EXPAND&&(a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a.fireEvent(BI.Combo.EVENT_EXPAND)),b===BI.Events.COLLAPSE&&(a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a.isViewVisible()&&a.fireEvent(BI.Combo.EVENT_COLLAPSE)),b===BI.Events.CLICK&&a.fireEvent(BI.Combo.EVENT_TRIGGER_CHANGE,d))}),a.element.on("mouseenter."+a.getName(),function(c){a.isEnabled()&&a.isValid()&&a.combo.isEnabled()&&a.combo.isValid()&&a.element.addClass(b.hoverClass)}),a.element.on("mouseleave."+a.getName(),function(c){a.isEnabled()&&a.isValid()&&a.combo.isEnabled()&&a.combo.isValid()&&a.element.removeClass(b.hoverClass)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.combo}]}),b.isDefaultInit&&this._assertPopupView(),BI.Resizers.add(this.getName(),BI.bind(function(){this.isViewVisible()&&this._hideView()},this))},_toggle:function(){this._assertPopupViewRender(),this.popupView.isVisible()?this._hideView():this.isEnabled()&&this._popupView()},_initPullDownAction:function(){var a=this,b=this.options,c=this.options.trigger.split(","),d=function(a){b.stopEvent&&a.stopEvent(),b.stopPropagation&&a.stopPropagation()};BI.each(c,function(c,e){switch(e){case"hover":a.element.on("mouseenter."+a.getName(),function(b){a.isEnabled()&&a.isValid()&&a.combo.isEnabled()&&a.combo.isValid()&&(a._popupView(),a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",a.combo),a.fireEvent(BI.Combo.EVENT_EXPAND))}),a.element.on("mouseleave."+a.getName(),function(c){a.isEnabled()&&a.isValid()&&a.combo.isEnabled()&&a.combo.isValid()&&b.toggle===!0&&(a._hideView(),a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",a.combo),a.fireEvent(BI.Combo.EVENT_COLLAPSE))});break;case"click":var f=BI.debounce(function(c){a.combo.element.__isMouseInBounds__(c)&&a.isEnabled()&&a.isValid()&&a.combo.isEnabled()&&a.combo.isValid()&&(b.toggle?a._toggle():a._popupView(),a.isViewVisible()?(a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",a.combo),a.fireEvent(BI.Combo.EVENT_EXPAND)):(a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",a.combo),a.fireEvent(BI.Combo.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,!0);a.element.off(e+"."+a.getName()).on(e+"."+a.getName(),function(a){f(a),d(a)});break;case"click-hover":var f=BI.debounce(function(b){a.combo.element.__isMouseInBounds__(b)&&a.isEnabled()&&a.isValid()&&a.combo.isEnabled()&&a.combo.isValid()&&(a._popupView(),a.isViewVisible()&&(a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",a.combo),a.fireEvent(BI.Combo.EVENT_EXPAND)))},BI.EVENT_RESPONSE_TIME,!0);a.element.off("click."+a.getName()).on("click."+a.getName(),function(a){f(a),d(a)}),a.element.on("mouseleave."+a.getName(),function(c){a.isEnabled()&&a.isValid()&&a.combo.isEnabled()&&a.combo.isValid()&&b.toggle===!0&&(a._hideView(),a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",a.combo),a.fireEvent(BI.Combo.EVENT_COLLAPSE))})}})},_initCombo:function(){this.combo=BI.createWidget(this.options.el)},_assertPopupView:function(){var a=this;null==this.popupView&&(this.popupView=BI.createWidget(this.options.popup,{type:"bi.popup_view"}),this.popupView.on(BI.Controller.EVENT_CHANGE,function(b,c,d){b===BI.Events.CLICK&&(a.combo.setValue(a.getValue()),a.fireEvent(BI.Combo.EVENT_CHANGE,c,d)),a.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popupView.setVisible(!1),BI.nextTick(function(){a.fireEvent(BI.Combo.EVENT_AFTER_INIT)}))},_assertPopupViewRender:function(){this._assertPopupView(),this._rendered||(BI.createWidget({type:"bi.vertical",scrolly:!1,element:this.options.container||this,items:[{el:this.popupView}]}),this._rendered=!0)},_hideIf:function(a){if(!(this.element.find(a.target).length>0||"CodeMirror-cursor"===a.target.className||$(a.target).closest(".CodeMirror-hints").length>0)){var b=this.options.hideChecker.apply(this,[a]);b!==!1&&this._hideView()}},_hideView:function(){this.fireEvent(BI.Combo.EVENT_BEFORE_HIDEVIEW),this.options.destroyWhenHide===!0?(this.popupView&&this.popupView.destroy(),this.popupView=null,this._rendered=!1):this.popupView&&this.popupView.invisible(),this.element.removeClass(this.options.comboClass),$(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()),this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW)},_popupView:function(){this._assertPopupViewRender(),this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW),this.popupView.visible(),this.adjustWidth(),this.adjustHeight(),this.element.addClass(this.options.comboClass),$(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()),$(document).bind("mousedown."+this.getName(),BI.bind(this._hideIf,this)).bind("mousewheel."+this.getName(),BI.bind(this._hideIf,this)),this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW)},adjustWidth:function(){var a=this.options;if(this.popupView&&a.isNeedAdjustWidth===!0){this.resetListWidth("");var b=this.popupView.element.outerWidth(),c=this.element.outerWidth()||a.width;b>c+80?c+=80:b>c&&(c=b),this.resetListWidth(c<100?100:c)}},adjustHeight:function(){var a=this.options,b={};if(this.popupView){var c=this.popupView.isVisible();switch(this.popupView.visible(),a.direction){case"bottom":case"bottom,right":b=$.getComboPosition(this.combo,this.popupView,a.adjustXOffset,a.adjustYOffset||a.adjustLength,a.isNeedAdjustHeight,["bottom","top","right","left"],a.offsetStyle);break;case"top":case"top,right":b=$.getComboPosition(this.combo,this.popupView,a.adjustXOffset,a.adjustYOffset||a.adjustLength,a.isNeedAdjustHeight,["top","bottom","right","left"],a.offsetStyle);break;case"left":case"left,bottom":b=$.getComboPosition(this.combo,this.popupView,a.adjustXOffset||a.adjustLength,a.adjustYOffset,a.isNeedAdjustHeight,["left","right","bottom","top"],a.offsetStyle);break;case"right":case"right,bottom":b=$.getComboPosition(this.combo,this.popupView,a.adjustXOffset||a.adjustLength,a.adjustYOffset,a.isNeedAdjustHeight,["right","left","bottom","top"],a.offsetStyle);break;case"top,left":b=$.getComboPosition(this.combo,this.popupView,a.adjustXOffset,a.adjustYOffset||a.adjustLength,a.isNeedAdjustHeight,["top","bottom","left","right"],a.offsetStyle);break;case"bottom,left":b=$.getComboPosition(this.combo,this.popupView,a.adjustXOffset,a.adjustYOffset||a.adjustLength,a.isNeedAdjustHeight,["bottom","top","left","right"],a.offsetStyle);break;case"left,top":b=$.getComboPosition(this.combo,this.popupView,a.adjustXOffset||a.adjustLength,a.adjustYOffset,a.isNeedAdjustHeight,["left","right","top","bottom"],a.offsetStyle);break;case"right,top":b=$.getComboPosition(this.combo,this.popupView,a.adjustXOffset||a.adjustLength,a.adjustYOffset,a.isNeedAdjustHeight,["right","left","top","bottom"],a.offsetStyle);break;case"top,custom":case"custom,top":b=$.getTopAdaptPosition(this.combo,this.popupView,a.adjustYOffset||a.adjustLength,a.isNeedAdjustHeight);break;case"custom,bottom":case"bottom,custom":b=$.getBottomAdaptPosition(this.combo,this.popupView,a.adjustYOffset||a.adjustLength,a.isNeedAdjustHeight);break;case"left,custom":case"custom,left":b=$.getLeftAdaptPosition(this.combo,this.popupView,a.adjustXOffset||a.adjustLength),delete b.top,delete b.adaptHeight;break;case"custom,right":case"right,custom":b=$.getRightAdaptPosition(this.combo,this.popupView,a.adjustXOffset||a.adjustLength),delete b.top,delete b.adaptHeight}"adaptHeight"in b&&this.resetListHeight(b.adaptHeight),"left"in b&&this.popupView.element.css({left:b.left}),"top"in b&&this.popupView.element.css({top:b.top}),this.position=b,this.popupView.setVisible(c)}},resetListHeight:function(a){this._assertPopupView(),this.popupView.resetHeight&&this.popupView.resetHeight(a)},resetListWidth:function(a){this._assertPopupView(),this.popupView.resetWidth&&this.popupView.resetWidth(a)},populate:function(a){this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),this.combo.populate.apply(this.combo,arguments)},_setEnable:function(a){BI.Combo.superclass._setEnable.apply(this,arguments),!a&&this.element.removeClass(this.options.hoverClass),!a&&this.isViewVisible()&&this._hideView()},setValue:function(a){this._assertPopupView(),this.combo.setValue(a),this.popupView&&this.popupView.setValue(a)},getValue:function(){return this._assertPopupView(),this.popupView&&this.popupView.getValue()},isViewVisible:function(){return this.isEnabled()&&this.combo.isEnabled()&&!!this.popupView&&this.popupView.isVisible()},showView:function(){this.isEnabled()&&this.combo.isEnabled()&&this._popupView()},hideView:function(){this._hideView()},getView:function(){return this.popupView},getPopupPosition:function(){return this.position},toggle:function(){this._toggle()},destroy:function(){$(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()).unbind("mouseenter."+this.getName()).unbind("mousemove."+this.getName()).unbind("mouseleave."+this.getName()),BI.Resizers.remove(this.getName()),BI.Combo.superclass.destroy.apply(this,arguments)}}),BI.Combo.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Combo.EVENT_CHANGE="EVENT_CHANGE",BI.Combo.EVENT_EXPAND="EVENT_EXPAND",BI.Combo.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Combo.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Combo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Combo.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Combo.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Combo.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.combo",BI.Combo),BI.Expander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Expander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-expander",trigger:"click",toggle:!0,isDefaultInit:!1,el:{},popup:{},expanderClass:"bi-expander-popup",hoverClass:"bi-expander-hover"})},_init:function(){BI.Expander.superclass._init.apply(this,arguments);var a=this,b=this.options;this._expanded=!!b.el.open,this._initExpander(),this._initPullDownAction(),this.expander.on(BI.Controller.EVENT_CHANGE,function(b,c,d){a.isEnabled()&&a.isValid()&&(b===BI.Events.EXPAND&&a._popupView(),b===BI.Events.COLLAPSE&&a._hideView(),b===BI.Events.EXPAND&&(a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a.fireEvent(BI.Expander.EVENT_EXPAND)),b===BI.Events.COLLAPSE&&(a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a.isViewVisible()&&a.fireEvent(BI.Expander.EVENT_COLLAPSE)),b===BI.Events.CLICK&&a.fireEvent(BI.Expander.EVENT_TRIGGER_CHANGE,c,d))}),this.element.hover(function(){a.isEnabled()&&a.isValid()&&a.expander.isEnabled()&&a.expander.isValid()&&a.element.addClass(b.hoverClass)},function(){a.isEnabled()&&a.isValid()&&a.expander.isEnabled()&&a.expander.isValid()&&a.element.removeClass(b.hoverClass)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.expander}]}),b.isDefaultInit&&this._assertPopupView(),this.expander.isOpened()===!0&&this._popupView()},_toggle:function(){this._assertPopupViewRender(),this.popupView.isVisible()?this._hideView():this.isEnabled()&&this._popupView()},_initPullDownAction:function(){var a=this,b=this.options,c=this.options.trigger.split(",");BI.each(c,function(c,d){switch(d){case"hover":a.element[d](function(b){a.isEnabled()&&a.isValid()&&a.expander.isEnabled()&&a.expander.isValid()&&(a._popupView(),a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",a.expander),a.fireEvent(BI.Expander.EVENT_EXPAND))},function(){a.isEnabled()&&a.isValid()&&a.expander.isEnabled()&&a.expander.isValid()&&b.toggle&&(a._hideView(),a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",a.expander),a.fireEvent(BI.Expander.EVENT_COLLAPSE))});break;default:d&&a.element.off(d+"."+a.getName()).on(d+"."+a.getName(),BI.debounce(function(c){a.expander.element.__isMouseInBounds__(c)&&a.isEnabled()&&a.isValid()&&a.expander.isEnabled()&&a.expander.isValid()&&(b.toggle?a._toggle():a._popupView(),a.isExpanded()?(a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",a.expander),a.fireEvent(BI.Expander.EVENT_EXPAND)):(a.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",a.expander),a.fireEvent(BI.Expander.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,!0))}})},_initExpander:function(){this.expander=BI.createWidget(this.options.el)},_assertPopupView:function(){var a=this;null==this.popupView&&(this.popupView=BI.createWidget(this.options.popup,{type:"bi.button_group",cls:"expander-popup",layouts:[{type:"bi.vertical",hgap:0,vgap:0}]}),this.popupView.on(BI.Controller.EVENT_CHANGE,function(b,c,d){a.fireEvent(BI.Controller.EVENT_CHANGE,arguments),b===BI.Events.CLICK&&a.fireEvent(BI.Expander.EVENT_CHANGE,c,d)}),this.popupView.setVisible(this.isExpanded()),BI.nextTick(function(){a.fireEvent(BI.Expander.EVENT_AFTER_INIT)}))},_assertPopupViewRender:function(){this._assertPopupView(),this._rendered||(BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.popupView}]}),this._rendered=!0)},_hideView:function(){this.fireEvent(BI.Expander.EVENT_BEFORE_HIDEVIEW),this._expanded=!1,this.expander.setOpened(!1),this.popupView&&this.popupView.invisible(),this.element.removeClass(this.options.expanderClass),this.fireEvent(BI.Expander.EVENT_AFTER_HIDEVIEW)},_popupView:function(){this._assertPopupViewRender(),this.fireEvent(BI.Expander.EVENT_BEFORE_POPUPVIEW),this._expanded=!0,this.expander.setOpened(!0),this.popupView.visible(),this.element.addClass(this.options.expanderClass),this.fireEvent(BI.Expander.EVENT_AFTER_POPUPVIEW)},populate:function(a){this.popupView&&this.popupView.populate.apply(this.popupView,arguments),this.expander.populate.apply(this.expander,arguments)},_setEnable:function(a){BI.Expander.superclass._setEnable.apply(this,arguments),!a&&this.element.removeClass(this.options.hoverClass),!a&&this.isViewVisible()&&this._hideView()},setValue:function(a){this.expander.setValue(a),this.popupView&&this.popupView.setValue(a)},getValue:function(){return this.popupView?this.popupView.getValue():[]},isViewVisible:function(){return this.isEnabled()&&this.expander.isEnabled()&&!!this.popupView&&this.popupView.isVisible()},isExpanded:function(){return this._expanded},showView:function(){this.isEnabled()&&this.expander.isEnabled()&&this._popupView()},hideView:function(){this._hideView()},getView:function(){return this.popupView},getAllLeaves:function(){return this.popupView&&this.popupView.getAllLeaves()},getNodeById:function(a){return this.expander.options.id===a?this.expander:this.popupView&&this.popupView.getNodeById(a)},getNodeByValue:function(a){return this.expander.getValue()===a?this.expander:this.popupView&&this.popupView.getNodeByValue(a)},destroy:function(){BI.Expander.superclass.destroy.apply(this,arguments)}}),BI.Expander.EVENT_EXPAND="EVENT_EXPAND",BI.Expander.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Expander.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Expander.EVENT_CHANGE="EVENT_CHANGE",BI.Expander.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Expander.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Expander.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Expander.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Expander.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.expander",BI.Expander),BI.ComboGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ComboGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-combo-group bi-list-item",trigger:"click,hover",direction:"right",adjustLength:0,isDefaultInit:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.text_button",text:"",value:""},children:[],popup:{el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]}}})},_init:function(){BI.ComboGroup.superclass._init.apply(this,arguments),this.populate(this.options.el)},populate:function(a){var b=this,c=this.options,d=c.children;if(BI.isEmpty(d))throw new Error("ComboGroup构造错误");BI.each(d,function(a,b){var d=BI.formatEL(b).el.children;b=BI.formatEL(b).el,BI.isEmpty(d)||(b.el=BI.clone(b),b.children=d,b.type="bi.combo_group",b.action=c.action,b.height=c.height,b.direction=c.direction,b.isDefaultInit=c.isDefaultInit,b.isNeedAdjustHeight=c.isNeedAdjustHeight,b.isNeedAdjustWidth=c.isNeedAdjustWidth,b.adjustLength=c.adjustLength,b.popup=c.popup)}),this.combo=BI.createWidget({type:"bi.combo",element:this,height:c.height,trigger:c.trigger,direction:c.direction,isDefaultInit:c.isDefaultInit,isNeedAdjustWidth:c.isNeedAdjustWidth,isNeedAdjustHeight:c.isNeedAdjustHeight,adjustLength:c.adjustLength,el:a,popup:BI.extend({},c.popup,{el:BI.extend({items:d},c.popup.el)})}),this.combo.on(BI.Controller.EVENT_CHANGE,function(a,c,d){b.fireEvent(BI.Controller.EVENT_CHANGE,arguments),a===BI.Events.CLICK&&b.fireEvent(BI.ComboGroup.EVENT_CHANGE,d)})},getValue:function(){return this.combo.getValue()},setValue:function(a){this.combo.setValue(a)}}),BI.ComboGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.combo_group",BI.ComboGroup),BI.VirtualGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.VirtualGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-virtual-group",items:[],layouts:[{type:"bi.center",hgap:0,vgap:0}]})},render:function(){this.populate(this.options.items)},_packageBtns:function(a){for(var b=this.options,c=b.layouts.length-1;c>0;c--)a=BI.map(a,function(a,d){return BI.extend({},b.layouts[c],{items:[BI.extend({},b.layouts[c].el,{el:BI.stripEL(d)})]})});return a},_packageItems:function(a,b){return BI.createItems(BI.makeArrayByArray(a,{}),BI.clone(b))},_packageLayout:function(a){for(var b=this.options,c=BI.deepClone(b.layouts[0]),d=BI.formatEL(c).el;d&&d.items&&!BI.isEmpty(d.items);)d=BI.formatEL(d.items[0]).el;return d.items=a,c},addItems:function(a){this.layouts.addItems(a)},prependItems:function(a){ diff --git a/dist/core.js b/dist/core.js index fb34b9036..227900b6d 100644 --- a/dist/core.js +++ b/dist/core.js @@ -18683,7 +18683,9 @@ BI.TooltipsController = BI.inherit(BI.Controller, { var offset = context.element.offset(); var bounds = context.element.bounds(); - + if(bounds.height === 0 || bounds.width === 0) { + return; + } var top = offset.top + bounds.height + 5; var tooltip = this.get(name); tooltip.setText(text); diff --git a/dist/demo.js b/dist/demo.js index 4e6b12974..e8bd32c9d 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -8865,1211 +8865,1211 @@ BI.shortcut("demo.vtape", Demo.VtapeLayout);Demo.Face = BI.inherit(BI.Widget, { this._runGlobalStyle(); } }); -BI.shortcut("demo.face", Demo.Face);//change函数 -ChangeView = BI.inherit(BI.View, { - _defaultConfig: function(){ - return BI.extend(ChangeView.superclass._defaultConfig.apply(this, arguments),{ - baseCls: "bi-change" - }) - }, - - _init: function(){ - ChangeView.superclass._init.apply(this, arguments); - }, - - change: function(changed){ - if(changed.child){ - this._showModelData(); - } - if(changed.superiors){ - this._showModelData(); - } - }, - - _showModelData: function(){ - this.outerText.setText("父级Model层数据: " + JSON.stringify(this.model.toJSON())); - }, - - _createOuter: function(){ - this.outerText = BI.createWidget({ - type: "bi.label", - cls: "outer-text", - whiteSpace: "normal" - }); - - return BI.createWidget({ - type: "bi.border", - items: { - north: { - el: this.outerText, - height: 50 - }, - center: this._createInner() - } - }); - }, - - _createInner: function(){ - var innerPane = BI.createWidget({ - type: "bi.absolute", - cls: "inner" - }); - this.addSubVessel("innerPane", innerPane, { - defaultShowName: "inner" - }); - return innerPane; - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.center", - element: vessel, - items: [this._createOuter()], - hgap: 100, - vgap: 100 - }); - - this._showModelData(); - }, - - refresh: function(){ - this.skipTo("inner", "innerPane", "superiors"); - } -}); - -ChangeModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(ChangeModel.superclass._defaultConfig.apply(this, arguments),{ - superiors: { - child: "default" - }, - child: "default" - }) - }, - - _init: function(){ - ChangeModel.superclass._init.apply(this, arguments); - }, - - change: function(changed){ - if(changed.superiors){ - this.set("child", changed.superiors.child); - } - } -}); - -//ChangeView 的子级 -ChangeInnerView = BI.inherit(BI.View, { - _init: function(){ - ChangeInnerView.superclass._init.apply(this, arguments); - }, - - change: function(changed){ - if(changed.child){ - this._showModelData(); - } - }, - - _createOuter: function(){ - var self = this; - this.text = BI.createWidget({ - type: "bi.label", - height: 26 - }); - - this.buttons = BI.createWidget({ - type: "bi.button_group", - items: BI.createItems(this.model.get("items"), { - type: "bi.text_button", - height: 30, - textAlign: "center", - hgap: 20 - }) - }); - - this.buttons.on(BI.ButtonGroup.EVENT_CHANGE, function(){ - self.model.set("child", this.getValue()[0]); - }); - - return BI.createWidget({ - type: "bi.vertical", - vgap: 20, - items: [{ - type: "bi.center", - items: [this.buttons], - height: 30 - }, this.text] - }); - }, - - _showModelData: function(){ - this.text.setText("子级Model层数据: " + JSON.stringify(this.model.toJSON())); - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.center", - element: vessel, - items: [this._createOuter()] - }); - this._showModelData(); - } -}); - - -ChangeInnerModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(ChangeInnerModel.superclass._defaultConfig.apply(this, arguments),{ - - }) - }, - - _static: function(){ - return { - items: [{ - text: "Type-1", - value: "First", - cls: "type-first mvc-button" - }, { - text: "Type-2", - value: "Second", - cls: "type-second mvc-button" - }, { - text: "Type-3", - value: "third", - cls: "type-third mvc-button" - }] - } - }, - - _init: function(){ - ChangeInnerModel.superclass._init.apply(this, arguments); - } - -}); - -Demo.Func = BI.inherit(BI.Widget, { - render: function () { - var view = BI.View.createView("/change", {}, { - element: this - }); - view.populate(); - }, - - mounted: function () { - } -}); -BI.shortcut("demo.change", Demo.Func);//local函数 -LocalView = BI.inherit(BI.View, { - _defaultConfig: function(){ - return BI.extend(LocalView.superclass._defaultConfig.apply(this, arguments),{ - baseCls: "bi-local" - }) - }, - - _init: function(){ - LocalView.superclass._init.apply(this, arguments); - this.buttons = {}; - }, - - _addElement2Vessel: function(id){ - var self = this; - this.buttons[id] = this.elementVessel.addItem({ - type: "bi.text_button", - text: "Button:" + id, - width: 180, - height: 22, - cls: "delete-button button", - handler: function(){ - self.set("delete", id); - } - }) - }, - - _deleteElement: function(id){ - this.buttons[id] && this.buttons[id].destroy(); - delete this.buttons[id]; - }, - - _createTop: function(){ - var self = this; - this.elementVessel = BI.createWidget({ - type: "bi.left", - height: 200, - cls: "vessel-border", - scrollable: true, - vgap: 10, - hgap: 10 - }); - - return BI.createWidget({ - type: "bi.vertical", - items: [ - { - el: { - type: "bi.text_button", - text: "点击添加元素", - cls: "top-button", - handler: function(){ - self.model.set("add", true); - }, - height: 30 - } - }, - this.elementVessel - ] - }) - }, - - _showModelData: function(){ - this.text.setText(JSON.stringify(this.model.toJSON())); - }, - - _createCenter: function(){ - var modelData = BI.createWidget({ - type: "bi.center", - vgap: 10, - hgap: 10, - cls: "vessel-border", - height: 200, - items: [{ - el: this.text = BI.createWidget({ - type: "bi.label", - hgap: 30, - textHeight: 30, - whiteSpace: "normal" - }) - }] - }); - - return BI.createWidget({ - type: "bi.vertical", - items: [ - { - el: { - type: "bi.label", - cls: "bottom-label", - text: "Model层数据", - height: 30 - } - }, - modelData - ] - }) - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.vertical", - element: vessel, - items: [{ - el :this._createTop() - },{ - el : this._createCenter() - }], - hgap: 50, - vgap: 20 - }); - - this._showModelData(); - }, - - local: function(){ - if(this.model.has("add")){ - var add = this.model.get("add"); - this._addElement2Vessel(this.model.getEditing()); - this._showModelData(); - return true; - } - if(this.model.has("delete")){ - var id = this.model.get("delete"); - this._deleteElement(id); - this._showModelData(); - return true; - } - return false; - } -}); - -LocalModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(LocalModel.superclass._defaultConfig.apply(this, arguments),{ - - }) - }, - - _init: function(){ - LocalModel.superclass._init.apply(this, arguments); - }, - - local: function(){ - if(this.has("add")){ - this.get("add"); - var id = BI.UUID(); - this.set(id, "这是新增的属性:"+id); - this.setEditing(id); - return true; - } - if(this.has("delete")){ - var id = this.get("delete"); - this.unset(id); - return true; - } - return false; - } - -}); - -Demo.Func = BI.inherit(BI.Widget, { - render: function () { - var view = BI.View.createView("/local", {}, { - element: this - }); - view.populate(); - }, - - mounted: function () { - } -}); -BI.shortcut("demo.local", Demo.Func);//set、get函数 -SetGetView = BI.inherit(BI.View, { - _defaultConfig: function () { - return BI.extend(SetGetView.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-set-get" - }) - }, - - _init: function () { - SetGetView.superclass._init.apply(this, arguments); - }, - - change: function (changed) { - this._showModelData(); - }, - - _createLeft: function () { - var self = this; - return (this.left = BI.createWidget({ - type: "bi.border", - items: { - north: { - el: { - type: "bi.label", - cls: "left-title", - text: "get、set用法:", - height: 30 - }, - height: 30 - }, - center: { - el: { - type: "bi.button_group", - items: BI.createItems(this.model.get("arr"), { - type: "bi.text_button", - cls: "left-nav", - height: 30, - handler: function (v) { - self.model.set("click", v); - } - }), - layouts: [{ - type: "bi.vertical" - }] - } - } - } - })) - }, - - _showModelData: function () { - this.text.setText(JSON.stringify(this.model.toJSON())); - }, - - _createRight: function () { - return (this.right = BI.createWidget({ - type: "bi.border", - items: { - north: { - el: { - type: "bi.label", - cls: "right-title", - text: "Model层数据", - height: 30 - }, - height: 30 - }, - center: { - el: this.text = BI.createWidget({ - type: "bi.label", - whiteSpace: "normal", - textHeight: 50 - }) - } - } - })) - }, - - render: function (vessel) { - BI.createWidget({ - type: "bi.center", - element: vessel, - items: [{ - el: this._createLeft() - }, { - el: this._createRight() - }], - hgap: 50, - vgap: 100 - }) - this._showModelData(); - } -}) - -SetGetModel = BI.inherit(BI.Model, { - _defaultConfig: function () { - return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments), { - arr: [ - {text: "item1", value: 1}, - {text: "item2", value: 2}, - {text: "item3", value: 3}, - {text: "item4", value: 4}, - {text: "item5", value: 5}, - {text: "item6", value: 6}, - {text: "item7", value: 7}, - {text: "item8", value: 8} - ] - }) - }, - - _init: function () { - SetGetModel.superclass._init.apply(this, arguments); - } - -}) - - -Demo.Func = BI.inherit(BI.Widget, { - render: function () { - var view = BI.View.createView("/setget", {}, { - element: this - }); - view.populate(); - }, - - mounted: function () { - } -}); -BI.shortcut("demo.setget", Demo.Func);//skipTo 函数 -SkipToView = BI.inherit(BI.View, { - _defaultConfig: function(){ - return BI.extend(SkipToView.superclass._defaultConfig.apply(this, arguments),{ - baseCls: "bi-skip-to" - }) - }, - - _init: function(){ - SkipToView.superclass._init.apply(this, arguments); - }, - - _createNav: function(){ - var self = this; - var nav = BI.createWidget({ - type: "bi.button_group", - cls: "top-nav", - items: BI.createItems(this.model.get("items"), { - type: "bi.text_button", - height: 30, - textAlign: "center", - hgap: 20 - }), - layouts: [{ - type: "bi.left", - height: 40, - vgap: 5, - hgap: 3 - }] - }); - nav.on(BI.ButtonGroup.EVENT_CHANGE, function(){ - self.skipTo(this.getValue()[0], "pane", this.getValue()[0]); - }); - return nav; - }, - - _createPane: function(){ - var pane = BI.createWidget({ - type:"bi.center", - cls: "center-pane", - height: 200 - }); - this.addSubVessel("pane", pane, { - defaultShowName: "green" - }); - return pane; - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.vertical", - element: vessel, - items: [this._createNav(), this._createPane()], - vgap: 10, - hgap: 10 - }) - }, - - refresh: function(){ - this.skipTo("green", "pane", "green"); - } -}); - -SkipToModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(SkipToModel.superclass._defaultConfig.apply(this, arguments),{ - "red": { - text: "hotpink" - },"blue": { - text: "cornflowerblue" - },"green": { - text: "darkcyan" - },"yellow": { - text: "darkgoldenrod" - } - }) - }, - _static: function(){ - return { - items: [{ - text: "hotpink", - value: "red", - cls: "red-pane mvc-button" - }, { - text: "cornflowerblue", - value: "blue", - cls: "blue-pane mvc-button" - }, { - text: "darkcyan", - value: "green", - cls: "green-pane mvc-button", - selected: true - }, { - text: "darkgoldenrod", - value: "yellow", - cls: "yellow-pane mvc-button" - }] - } - }, - - _init: function(){ - SkipToModel.superclass._init.apply(this, arguments); - } -}); - -//Red pane #FF69B4 -SkipToRedView = BI.inherit(BI.View, { - _init: function(){ - SkipToRedView.superclass._init.apply(this, arguments); - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.absolute", - element: vessel, - cls: "red-pane", - items: [{ - el: { - type: "bi.label", - text: "Model Data: " + JSON.stringify(this.model.toJSON()), - hgap: 20, - height: 26 - } - }] - }) - } - -}); - -SkipToRedModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments),{ - - }) - }, - - _init: function(){ - SkipToRedModel.superclass._init.apply(this, arguments); - } -}); - -//Blue pane #6495ED -SkipToBlueView = BI.inherit(BI.View, { - _init: function(){ - SkipToBlueView.superclass._init.apply(this, arguments); - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.absolute", - element: vessel, - cls: "blue-pane", - items: [{ - el: { - type: "bi.label", - text: "Model Data: " + JSON.stringify(this.model.toJSON()), - hgap: 20, - height: 26 - }, - left: 0, - right: 0, - top: 0, - bottom: 0 - }] - }) - } -}); - -SkipToBlueModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments),{ - }) - }, - - _init: function(){ - SkipToGreenModel.superclass._init.apply(this, arguments); - } -}); - -//Dark green pane #008B8B -SkipToGreenView = BI.inherit(BI.View, { - _init: function(){ - SkipToGreenView.superclass._init.apply(this, arguments); - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.absolute", - element: vessel, - cls: "green-pane", - items: [{ - el:{ - type: "bi.label", - text: "Model Data: " + JSON.stringify(this.model.toJSON()), - hgap: 20, - height: 26 - }, - left: 0, - right: 0, - top: 0, - bottom: 0 - }] - }) - } -}); - -SkipToGreenModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments),{ - }) - }, - - _init: function(){ - SkipToGreenModel.superclass._init.apply(this, arguments); - } -}); - -//Dark yellow pane #B8860B -SkipToYellowView = BI.inherit(BI.View, { - _init: function(){ - SkipToYellowView.superclass._init.apply(this, arguments); - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.absolute", - element: vessel, - cls: "yellow-pane", - items: [{ - el:{ - type: "bi.label", - text: "Model Data: " + JSON.stringify(this.model.toJSON()), - hgap: 20, - height: 26 - }, - left: 0, - right: 0, - top: 0, - bottom: 0 - }] - }) - } -}); - -SkipToYellowModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments),{ - }) - }, - - _init: function(){ - SkipToYellowModel.superclass._init.apply(this, arguments); - } -}); - -Demo.Func = BI.inherit(BI.Widget, { - render: function () { - var view = BI.View.createView("/skipTo", {}, { - element: this - }); - view.populate(); - }, - - mounted: function () { - } -}); -BI.shortcut("demo.skipTo", Demo.Func); -//splice和duplicate函数 -SpliceDuplicateView = BI.inherit(BI.View, { - _defaultConfig: function () { - return BI.extend(SpliceDuplicateView.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-splice-duplicate" - }) - }, - - _init: function () { - SpliceDuplicateView.superclass._init.apply(this, arguments); - this.children = {}; - }, - - splice: function (old, key1, key2) { - this.children[key1].destroy(); - delete this.children[key1]; - this._showModelData(); - }, - - duplicate: function (copy, key1, key2) { - this.add(copy); - this._showModelData(); - }, - - _showModelData: function () { - //这里只是为了输出this.model.data 原则上是不允许这么调用的 - this.text.setText("父级数据:" + JSON.stringify(this.model.data)); - }, - - render: function (vessel) { - this.text = BI.createWidget({ - type: "bi.label", - height: 50, - cls: "superiors-label" - }); - this.container = BI.createWidget({ - type: "bi.vertical", - element: vessel, - items: [this.text], - hgap: 100, - vgap: 10 - }); - this._showModelData(); - }, - - add: function (id) { - this.children[id] = BI.createWidget({ - type: "bi.center", - hgap: 10, - vgap: 10 - }); - this.addSubVessel(id, this.children[id], { - defaultShowName: "sdSub" - }); - this.skipTo("sdSub", id, id); - this.container.addItem(this.children[id]); - }, - - refresh: function () { - var self = this; - BI.each(this.model.toJSON(), function (key, value) { - if (!self.children[key]) { - self.add(key); - } - }) - } -}); - -SpliceDuplicateModel = BI.inherit(BI.Model, { - _defaultConfig: function () { - return BI.extend(SpliceDuplicateModel.superclass._defaultConfig.apply(this, arguments), { - "1": { - name: "名字" - } - }) - }, - - splice: function (key1) { - delete this.data[key1]; - }, - - similar: function (value, key1) { - value.name = BI.Func.createDistinctName(this.data, this.get(key1).name); - return value; - }, - - duplicate: function (copy, key1) { - this.data[copy] = this.get(copy); - }, - - _init: function () { - SpliceDuplicateModel.superclass._init.apply(this, arguments); - }, - - refresh: function () { - this.data = BI.deepClone(this.toJSON()); - } -}); - -SDSubView = BI.inherit(BI.View, { - _defaultConfig: function () { - return SDSubView.superclass._defaultConfig.apply(this, arguments); - }, - - _init: function () { - SDSubView.superclass._init.apply(this, arguments); - }, - - render: function (vessel) { - var self = this; - BI.createWidget({ - type: "bi.center", - element: vessel, - cls: "sd-child", - height: 30, - items: [{ - type: "bi.text_button", - height: 30, - text: "复制 " + this.model.get("name") + " , 数据:" + JSON.stringify(this.model.toJSON()), - cls: "right-button-add", - handler: function () { - self.model.copy(); - } - }, { - type: "bi.text_button", - height: 30, - text: "删除", - cls: "right-button-del", - handler: function () { - self.model.destroy(); - } - }] - }) - } -}); - -SDSubModel = BI.inherit(BI.Model, { - _defaultConfig: function () { - return BI.extend(SDSubModel.superclass._defaultConfig.apply(this, arguments), {}); - }, - - _init: function () { - SDSubModel.superclass._init.apply(this, arguments); - } -}); - -Demo.Func = BI.inherit(BI.Widget, { - render: function () { - var view = BI.View.createView("/spliceDuplicate", {}, { - element: this - }); - view.populate(); - }, - - mounted: function () { - } -}); -BI.shortcut("demo.spliceDuplicate", Demo.Func); -TmpView = BI.inherit(BI.View, { - _defaultConfig: function(){ - return BI.extend(TmpView.superclass._defaultConfig.apply(this, arguments),{ - baseCls: "bi-tmp" - }) - }, - - _init: function(){ - TmpView.superclass._init.apply(this, arguments); - }, - - change: function(changed){ - if(changed.data1){ - this._showModelData(); - } - }, - - _showModelData: function(){ - this.text.setText("父级Model层数据为:"+JSON.stringify(this.model.toJSON())); - }, - - _createMain: function(){ - var self = this; - return BI.createWidget({ - type: "bi.border", - items: { - west: { - el: { - type: "bi.vertical", - vgap: 10, - items: [{ - el: (this.text = BI.createWidget({ - type: "bi.label", - whiteSpace: "normal" - })) - }, { - el: { - type: "bi.text_button", - cls: "tmp-button mvc-button", - text: "点击触发事件tmp('data1', {child: {type: {value: \"临时数据\"}}})", - height: 30, - handler: function(){ - self.model.tmp("data1", { - child: { - type: { - value: "临时数据" - } - } - }) - } - } - }, { - el: { - type: "bi.text_button", - cls: "tmp-button mvc-button", - text: "点击触发事件submit", - height: 30, - handler: function(){ - self.model.submit(); - } - } - }, { - el: { - type: "bi.text_button", - cls: "tmp-button mvc-button", - text: "点击跳转到右方", - height: 30, - handler: function(){ - self.addSubVessel("test", self.center).skipTo("child", "test", "data1"); - } - } - }] - }, - width: 200 - }, - center: { - el: (this.center = BI.createWidget()) - } - } - }) - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.center", - element: vessel, - items: [{ - el: this._createMain() - }], - hgap: 50, - vgap: 100 - }) - }, - - refresh: function(){ - this._showModelData(); - } -}) - -TmpModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(TmpModel.superclass._defaultConfig.apply(this, arguments),{ - data1: { - child: { - type: { - value: "这是一个测试数据" - } - } - }, - data2: "test" - }) - }, - - _init: function(){ - TmpModel.superclass._init.apply(this, arguments); - } - -}) - -TmpChildView = BI.inherit(BI.View, { - _defaultConfig: function(){ - return BI.extend(TmpChildView.superclass._defaultConfig.apply(this, arguments),{ - baseCls: "bi-tmp-child" - }) - }, - - _init: function(){ - TmpChildView.superclass._init.apply(this, arguments); - }, - - change: function(changed){ - if(changed.child){ - this._showModelData(); - } - }, - - _showModelData: function(){ - this.text.setText("子级Model层数据为:"+JSON.stringify(this.model.toJSON())); - }, - - _createMain: function(){ - var self = this; - return BI.createWidget({ - type: "bi.border", - items: { - west: { - el: { - type: "bi.vertical", - vgap: 10, - items: [{ - el: (this.text = BI.createWidget({ - type: "bi.label", - whiteSpace: "normal" - })) - }, { - el: { - type: "bi.text_button", - cls: "tmp-button mvc-button", - text: "点击触发事件set", - height: 30, - handler: function(){ - self.set("child", { - type: { - value: "值改变了" - } - }) - } - } - }, { - el: { - type: "bi.text_button", - cls: "tmp-button mvc-button", - text: "点击跳转到右方", - height: 30, - handler: function(){ - self.addSubVessel("test", self.center).skipTo("child", "test", "child"); - } - } - }] - }, - width: 200 - }, - center: { - el: (this.center = BI.createWidget()) - } - } - }) - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.center", - element: vessel, - items: [{ - el: this._createMain() - }], - hgap: 50 - }) - }, - - refresh: function(){ - this._showModelData(); - } -}) - -TmpChildModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(TmpChildModel.superclass._defaultConfig.apply(this, arguments),{ - - }) - }, - - _init: function(){ - TmpChildModel.superclass._init.apply(this, arguments); - } - -}) -TmpChildChildView = BI.inherit(BI.View, { - _defaultConfig: function(){ - return BI.extend(TmpChildChildView.superclass._defaultConfig.apply(this, arguments),{ - baseCls: "bi-tmp-child-child" - }) - }, - - _init: function(){ - TmpChildChildView.superclass._init.apply(this, arguments); - }, - - change: function(changed){ - if(changed.type){ - this._showModelData(); - } - }, - - _showModelData: function(){ - this.text.setText("叶节点数据为:"+JSON.stringify(this.model.toJSON())); - }, - - _createMain: function(){ - return (this.text = BI.createWidget({ - type: "bi.label", - whiteSpace: "normal" - })) - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.center", - element: vessel, - items: [{ - el: this._createMain() - }], - hgap: 50 - }) - }, - - refresh: function(){ - this._showModelData(); - } -}) - -TmpChildChildModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(TmpChildChildModel.superclass._defaultConfig.apply(this, arguments),{ - - }) - }, - - _init: function(){ - TmpChildChildModel.superclass._init.apply(this, arguments); - } - -}) - -Demo.Func = BI.inherit(BI.Widget, { - render: function () { - var view = BI.View.createView("/tmp", {}, { - element: this - }); - view.populate(); - }, - - mounted: function () { - } -}); -BI.shortcut("demo.tmp", Demo.Func); +BI.shortcut("demo.face", Demo.Face);//change函数 +ChangeView = BI.inherit(BI.View, { + _defaultConfig: function(){ + return BI.extend(ChangeView.superclass._defaultConfig.apply(this, arguments),{ + baseCls: "bi-change" + }) + }, + + _init: function(){ + ChangeView.superclass._init.apply(this, arguments); + }, + + change: function(changed){ + if(changed.child){ + this._showModelData(); + } + if(changed.superiors){ + this._showModelData(); + } + }, + + _showModelData: function(){ + this.outerText.setText("父级Model层数据: " + JSON.stringify(this.model.toJSON())); + }, + + _createOuter: function(){ + this.outerText = BI.createWidget({ + type: "bi.label", + cls: "outer-text", + whiteSpace: "normal" + }); + + return BI.createWidget({ + type: "bi.border", + items: { + north: { + el: this.outerText, + height: 50 + }, + center: this._createInner() + } + }); + }, + + _createInner: function(){ + var innerPane = BI.createWidget({ + type: "bi.absolute", + cls: "inner" + }); + this.addSubVessel("innerPane", innerPane, { + defaultShowName: "inner" + }); + return innerPane; + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.center", + element: vessel, + items: [this._createOuter()], + hgap: 100, + vgap: 100 + }); + + this._showModelData(); + }, + + refresh: function(){ + this.skipTo("inner", "innerPane", "superiors"); + } +}); + +ChangeModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(ChangeModel.superclass._defaultConfig.apply(this, arguments),{ + superiors: { + child: "default" + }, + child: "default" + }) + }, + + _init: function(){ + ChangeModel.superclass._init.apply(this, arguments); + }, + + change: function(changed){ + if(changed.superiors){ + this.set("child", changed.superiors.child); + } + } +}); + +//ChangeView 的子级 +ChangeInnerView = BI.inherit(BI.View, { + _init: function(){ + ChangeInnerView.superclass._init.apply(this, arguments); + }, + + change: function(changed){ + if(changed.child){ + this._showModelData(); + } + }, + + _createOuter: function(){ + var self = this; + this.text = BI.createWidget({ + type: "bi.label", + height: 26 + }); + + this.buttons = BI.createWidget({ + type: "bi.button_group", + items: BI.createItems(this.model.get("items"), { + type: "bi.text_button", + height: 30, + textAlign: "center", + hgap: 20 + }) + }); + + this.buttons.on(BI.ButtonGroup.EVENT_CHANGE, function(){ + self.model.set("child", this.getValue()[0]); + }); + + return BI.createWidget({ + type: "bi.vertical", + vgap: 20, + items: [{ + type: "bi.center", + items: [this.buttons], + height: 30 + }, this.text] + }); + }, + + _showModelData: function(){ + this.text.setText("子级Model层数据: " + JSON.stringify(this.model.toJSON())); + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.center", + element: vessel, + items: [this._createOuter()] + }); + this._showModelData(); + } +}); + + +ChangeInnerModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(ChangeInnerModel.superclass._defaultConfig.apply(this, arguments),{ + + }) + }, + + _static: function(){ + return { + items: [{ + text: "Type-1", + value: "First", + cls: "type-first mvc-button" + }, { + text: "Type-2", + value: "Second", + cls: "type-second mvc-button" + }, { + text: "Type-3", + value: "third", + cls: "type-third mvc-button" + }] + } + }, + + _init: function(){ + ChangeInnerModel.superclass._init.apply(this, arguments); + } + +}); + +Demo.Func = BI.inherit(BI.Widget, { + render: function () { + var view = BI.View.createView("/change", {}, { + element: this + }); + view.populate(); + }, + + mounted: function () { + } +}); +BI.shortcut("demo.change", Demo.Func);//local函数 +LocalView = BI.inherit(BI.View, { + _defaultConfig: function(){ + return BI.extend(LocalView.superclass._defaultConfig.apply(this, arguments),{ + baseCls: "bi-local" + }) + }, + + _init: function(){ + LocalView.superclass._init.apply(this, arguments); + this.buttons = {}; + }, + + _addElement2Vessel: function(id){ + var self = this; + this.buttons[id] = this.elementVessel.addItem({ + type: "bi.text_button", + text: "Button:" + id, + width: 180, + height: 22, + cls: "delete-button button", + handler: function(){ + self.set("delete", id); + } + }) + }, + + _deleteElement: function(id){ + this.buttons[id] && this.buttons[id].destroy(); + delete this.buttons[id]; + }, + + _createTop: function(){ + var self = this; + this.elementVessel = BI.createWidget({ + type: "bi.left", + height: 200, + cls: "vessel-border", + scrollable: true, + vgap: 10, + hgap: 10 + }); + + return BI.createWidget({ + type: "bi.vertical", + items: [ + { + el: { + type: "bi.text_button", + text: "点击添加元素", + cls: "top-button", + handler: function(){ + self.model.set("add", true); + }, + height: 30 + } + }, + this.elementVessel + ] + }) + }, + + _showModelData: function(){ + this.text.setText(JSON.stringify(this.model.toJSON())); + }, + + _createCenter: function(){ + var modelData = BI.createWidget({ + type: "bi.center", + vgap: 10, + hgap: 10, + cls: "vessel-border", + height: 200, + items: [{ + el: this.text = BI.createWidget({ + type: "bi.label", + hgap: 30, + textHeight: 30, + whiteSpace: "normal" + }) + }] + }); + + return BI.createWidget({ + type: "bi.vertical", + items: [ + { + el: { + type: "bi.label", + cls: "bottom-label", + text: "Model层数据", + height: 30 + } + }, + modelData + ] + }) + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.vertical", + element: vessel, + items: [{ + el :this._createTop() + },{ + el : this._createCenter() + }], + hgap: 50, + vgap: 20 + }); + + this._showModelData(); + }, + + local: function(){ + if(this.model.has("add")){ + var add = this.model.get("add"); + this._addElement2Vessel(this.model.getEditing()); + this._showModelData(); + return true; + } + if(this.model.has("delete")){ + var id = this.model.get("delete"); + this._deleteElement(id); + this._showModelData(); + return true; + } + return false; + } +}); + +LocalModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(LocalModel.superclass._defaultConfig.apply(this, arguments),{ + + }) + }, + + _init: function(){ + LocalModel.superclass._init.apply(this, arguments); + }, + + local: function(){ + if(this.has("add")){ + this.get("add"); + var id = BI.UUID(); + this.set(id, "这是新增的属性:"+id); + this.setEditing(id); + return true; + } + if(this.has("delete")){ + var id = this.get("delete"); + this.unset(id); + return true; + } + return false; + } + +}); + +Demo.Func = BI.inherit(BI.Widget, { + render: function () { + var view = BI.View.createView("/local", {}, { + element: this + }); + view.populate(); + }, + + mounted: function () { + } +}); +BI.shortcut("demo.local", Demo.Func);//set、get函数 +SetGetView = BI.inherit(BI.View, { + _defaultConfig: function () { + return BI.extend(SetGetView.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-set-get" + }) + }, + + _init: function () { + SetGetView.superclass._init.apply(this, arguments); + }, + + change: function (changed) { + this._showModelData(); + }, + + _createLeft: function () { + var self = this; + return (this.left = BI.createWidget({ + type: "bi.border", + items: { + north: { + el: { + type: "bi.label", + cls: "left-title", + text: "get、set用法:", + height: 30 + }, + height: 30 + }, + center: { + el: { + type: "bi.button_group", + items: BI.createItems(this.model.get("arr"), { + type: "bi.text_button", + cls: "left-nav", + height: 30, + handler: function (v) { + self.model.set("click", v); + } + }), + layouts: [{ + type: "bi.vertical" + }] + } + } + } + })) + }, + + _showModelData: function () { + this.text.setText(JSON.stringify(this.model.toJSON())); + }, + + _createRight: function () { + return (this.right = BI.createWidget({ + type: "bi.border", + items: { + north: { + el: { + type: "bi.label", + cls: "right-title", + text: "Model层数据", + height: 30 + }, + height: 30 + }, + center: { + el: this.text = BI.createWidget({ + type: "bi.label", + whiteSpace: "normal", + textHeight: 50 + }) + } + } + })) + }, + + render: function (vessel) { + BI.createWidget({ + type: "bi.center", + element: vessel, + items: [{ + el: this._createLeft() + }, { + el: this._createRight() + }], + hgap: 50, + vgap: 100 + }) + this._showModelData(); + } +}) + +SetGetModel = BI.inherit(BI.Model, { + _defaultConfig: function () { + return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments), { + arr: [ + {text: "item1", value: 1}, + {text: "item2", value: 2}, + {text: "item3", value: 3}, + {text: "item4", value: 4}, + {text: "item5", value: 5}, + {text: "item6", value: 6}, + {text: "item7", value: 7}, + {text: "item8", value: 8} + ] + }) + }, + + _init: function () { + SetGetModel.superclass._init.apply(this, arguments); + } + +}) + + +Demo.Func = BI.inherit(BI.Widget, { + render: function () { + var view = BI.View.createView("/setget", {}, { + element: this + }); + view.populate(); + }, + + mounted: function () { + } +}); +BI.shortcut("demo.setget", Demo.Func);//skipTo 函数 +SkipToView = BI.inherit(BI.View, { + _defaultConfig: function(){ + return BI.extend(SkipToView.superclass._defaultConfig.apply(this, arguments),{ + baseCls: "bi-skip-to" + }) + }, + + _init: function(){ + SkipToView.superclass._init.apply(this, arguments); + }, + + _createNav: function(){ + var self = this; + var nav = BI.createWidget({ + type: "bi.button_group", + cls: "top-nav", + items: BI.createItems(this.model.get("items"), { + type: "bi.text_button", + height: 30, + textAlign: "center", + hgap: 20 + }), + layouts: [{ + type: "bi.left", + height: 40, + vgap: 5, + hgap: 3 + }] + }); + nav.on(BI.ButtonGroup.EVENT_CHANGE, function(){ + self.skipTo(this.getValue()[0], "pane", this.getValue()[0]); + }); + return nav; + }, + + _createPane: function(){ + var pane = BI.createWidget({ + type:"bi.center", + cls: "center-pane", + height: 200 + }); + this.addSubVessel("pane", pane, { + defaultShowName: "green" + }); + return pane; + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.vertical", + element: vessel, + items: [this._createNav(), this._createPane()], + vgap: 10, + hgap: 10 + }) + }, + + refresh: function(){ + this.skipTo("green", "pane", "green"); + } +}); + +SkipToModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(SkipToModel.superclass._defaultConfig.apply(this, arguments),{ + "red": { + text: "hotpink" + },"blue": { + text: "cornflowerblue" + },"green": { + text: "darkcyan" + },"yellow": { + text: "darkgoldenrod" + } + }) + }, + _static: function(){ + return { + items: [{ + text: "hotpink", + value: "red", + cls: "red-pane mvc-button" + }, { + text: "cornflowerblue", + value: "blue", + cls: "blue-pane mvc-button" + }, { + text: "darkcyan", + value: "green", + cls: "green-pane mvc-button", + selected: true + }, { + text: "darkgoldenrod", + value: "yellow", + cls: "yellow-pane mvc-button" + }] + } + }, + + _init: function(){ + SkipToModel.superclass._init.apply(this, arguments); + } +}); + +//Red pane #FF69B4 +SkipToRedView = BI.inherit(BI.View, { + _init: function(){ + SkipToRedView.superclass._init.apply(this, arguments); + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.absolute", + element: vessel, + cls: "red-pane", + items: [{ + el: { + type: "bi.label", + text: "Model Data: " + JSON.stringify(this.model.toJSON()), + hgap: 20, + height: 26 + } + }] + }) + } + +}); + +SkipToRedModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments),{ + + }) + }, + + _init: function(){ + SkipToRedModel.superclass._init.apply(this, arguments); + } +}); + +//Blue pane #6495ED +SkipToBlueView = BI.inherit(BI.View, { + _init: function(){ + SkipToBlueView.superclass._init.apply(this, arguments); + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.absolute", + element: vessel, + cls: "blue-pane", + items: [{ + el: { + type: "bi.label", + text: "Model Data: " + JSON.stringify(this.model.toJSON()), + hgap: 20, + height: 26 + }, + left: 0, + right: 0, + top: 0, + bottom: 0 + }] + }) + } +}); + +SkipToBlueModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments),{ + }) + }, + + _init: function(){ + SkipToGreenModel.superclass._init.apply(this, arguments); + } +}); + +//Dark green pane #008B8B +SkipToGreenView = BI.inherit(BI.View, { + _init: function(){ + SkipToGreenView.superclass._init.apply(this, arguments); + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.absolute", + element: vessel, + cls: "green-pane", + items: [{ + el:{ + type: "bi.label", + text: "Model Data: " + JSON.stringify(this.model.toJSON()), + hgap: 20, + height: 26 + }, + left: 0, + right: 0, + top: 0, + bottom: 0 + }] + }) + } +}); + +SkipToGreenModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments),{ + }) + }, + + _init: function(){ + SkipToGreenModel.superclass._init.apply(this, arguments); + } +}); + +//Dark yellow pane #B8860B +SkipToYellowView = BI.inherit(BI.View, { + _init: function(){ + SkipToYellowView.superclass._init.apply(this, arguments); + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.absolute", + element: vessel, + cls: "yellow-pane", + items: [{ + el:{ + type: "bi.label", + text: "Model Data: " + JSON.stringify(this.model.toJSON()), + hgap: 20, + height: 26 + }, + left: 0, + right: 0, + top: 0, + bottom: 0 + }] + }) + } +}); + +SkipToYellowModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments),{ + }) + }, + + _init: function(){ + SkipToYellowModel.superclass._init.apply(this, arguments); + } +}); + +Demo.Func = BI.inherit(BI.Widget, { + render: function () { + var view = BI.View.createView("/skipTo", {}, { + element: this + }); + view.populate(); + }, + + mounted: function () { + } +}); +BI.shortcut("demo.skipTo", Demo.Func); +//splice和duplicate函数 +SpliceDuplicateView = BI.inherit(BI.View, { + _defaultConfig: function () { + return BI.extend(SpliceDuplicateView.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-splice-duplicate" + }) + }, + + _init: function () { + SpliceDuplicateView.superclass._init.apply(this, arguments); + this.children = {}; + }, + + splice: function (old, key1, key2) { + this.children[key1].destroy(); + delete this.children[key1]; + this._showModelData(); + }, + + duplicate: function (copy, key1, key2) { + this.add(copy); + this._showModelData(); + }, + + _showModelData: function () { + //这里只是为了输出this.model.data 原则上是不允许这么调用的 + this.text.setText("父级数据:" + JSON.stringify(this.model.data)); + }, + + render: function (vessel) { + this.text = BI.createWidget({ + type: "bi.label", + height: 50, + cls: "superiors-label" + }); + this.container = BI.createWidget({ + type: "bi.vertical", + element: vessel, + items: [this.text], + hgap: 100, + vgap: 10 + }); + this._showModelData(); + }, + + add: function (id) { + this.children[id] = BI.createWidget({ + type: "bi.center", + hgap: 10, + vgap: 10 + }); + this.addSubVessel(id, this.children[id], { + defaultShowName: "sdSub" + }); + this.skipTo("sdSub", id, id); + this.container.addItem(this.children[id]); + }, + + refresh: function () { + var self = this; + BI.each(this.model.toJSON(), function (key, value) { + if (!self.children[key]) { + self.add(key); + } + }) + } +}); + +SpliceDuplicateModel = BI.inherit(BI.Model, { + _defaultConfig: function () { + return BI.extend(SpliceDuplicateModel.superclass._defaultConfig.apply(this, arguments), { + "1": { + name: "名字" + } + }) + }, + + splice: function (key1) { + delete this.data[key1]; + }, + + similar: function (value, key1) { + value.name = BI.Func.createDistinctName(this.data, this.get(key1).name); + return value; + }, + + duplicate: function (copy, key1) { + this.data[copy] = this.get(copy); + }, + + _init: function () { + SpliceDuplicateModel.superclass._init.apply(this, arguments); + }, + + refresh: function () { + this.data = BI.deepClone(this.toJSON()); + } +}); + +SDSubView = BI.inherit(BI.View, { + _defaultConfig: function () { + return SDSubView.superclass._defaultConfig.apply(this, arguments); + }, + + _init: function () { + SDSubView.superclass._init.apply(this, arguments); + }, + + render: function (vessel) { + var self = this; + BI.createWidget({ + type: "bi.center", + element: vessel, + cls: "sd-child", + height: 30, + items: [{ + type: "bi.text_button", + height: 30, + text: "复制 " + this.model.get("name") + " , 数据:" + JSON.stringify(this.model.toJSON()), + cls: "right-button-add", + handler: function () { + self.model.copy(); + } + }, { + type: "bi.text_button", + height: 30, + text: "删除", + cls: "right-button-del", + handler: function () { + self.model.destroy(); + } + }] + }) + } +}); + +SDSubModel = BI.inherit(BI.Model, { + _defaultConfig: function () { + return BI.extend(SDSubModel.superclass._defaultConfig.apply(this, arguments), {}); + }, + + _init: function () { + SDSubModel.superclass._init.apply(this, arguments); + } +}); + +Demo.Func = BI.inherit(BI.Widget, { + render: function () { + var view = BI.View.createView("/spliceDuplicate", {}, { + element: this + }); + view.populate(); + }, + + mounted: function () { + } +}); +BI.shortcut("demo.spliceDuplicate", Demo.Func); +TmpView = BI.inherit(BI.View, { + _defaultConfig: function(){ + return BI.extend(TmpView.superclass._defaultConfig.apply(this, arguments),{ + baseCls: "bi-tmp" + }) + }, + + _init: function(){ + TmpView.superclass._init.apply(this, arguments); + }, + + change: function(changed){ + if(changed.data1){ + this._showModelData(); + } + }, + + _showModelData: function(){ + this.text.setText("父级Model层数据为:"+JSON.stringify(this.model.toJSON())); + }, + + _createMain: function(){ + var self = this; + return BI.createWidget({ + type: "bi.border", + items: { + west: { + el: { + type: "bi.vertical", + vgap: 10, + items: [{ + el: (this.text = BI.createWidget({ + type: "bi.label", + whiteSpace: "normal" + })) + }, { + el: { + type: "bi.text_button", + cls: "tmp-button mvc-button", + text: "点击触发事件tmp('data1', {child: {type: {value: \"临时数据\"}}})", + height: 30, + handler: function(){ + self.model.tmp("data1", { + child: { + type: { + value: "临时数据" + } + } + }) + } + } + }, { + el: { + type: "bi.text_button", + cls: "tmp-button mvc-button", + text: "点击触发事件submit", + height: 30, + handler: function(){ + self.model.submit(); + } + } + }, { + el: { + type: "bi.text_button", + cls: "tmp-button mvc-button", + text: "点击跳转到右方", + height: 30, + handler: function(){ + self.addSubVessel("test", self.center).skipTo("child", "test", "data1"); + } + } + }] + }, + width: 200 + }, + center: { + el: (this.center = BI.createWidget()) + } + } + }) + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.center", + element: vessel, + items: [{ + el: this._createMain() + }], + hgap: 50, + vgap: 100 + }) + }, + + refresh: function(){ + this._showModelData(); + } +}) + +TmpModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(TmpModel.superclass._defaultConfig.apply(this, arguments),{ + data1: { + child: { + type: { + value: "这是一个测试数据" + } + } + }, + data2: "test" + }) + }, + + _init: function(){ + TmpModel.superclass._init.apply(this, arguments); + } + +}) + +TmpChildView = BI.inherit(BI.View, { + _defaultConfig: function(){ + return BI.extend(TmpChildView.superclass._defaultConfig.apply(this, arguments),{ + baseCls: "bi-tmp-child" + }) + }, + + _init: function(){ + TmpChildView.superclass._init.apply(this, arguments); + }, + + change: function(changed){ + if(changed.child){ + this._showModelData(); + } + }, + + _showModelData: function(){ + this.text.setText("子级Model层数据为:"+JSON.stringify(this.model.toJSON())); + }, + + _createMain: function(){ + var self = this; + return BI.createWidget({ + type: "bi.border", + items: { + west: { + el: { + type: "bi.vertical", + vgap: 10, + items: [{ + el: (this.text = BI.createWidget({ + type: "bi.label", + whiteSpace: "normal" + })) + }, { + el: { + type: "bi.text_button", + cls: "tmp-button mvc-button", + text: "点击触发事件set", + height: 30, + handler: function(){ + self.set("child", { + type: { + value: "值改变了" + } + }) + } + } + }, { + el: { + type: "bi.text_button", + cls: "tmp-button mvc-button", + text: "点击跳转到右方", + height: 30, + handler: function(){ + self.addSubVessel("test", self.center).skipTo("child", "test", "child"); + } + } + }] + }, + width: 200 + }, + center: { + el: (this.center = BI.createWidget()) + } + } + }) + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.center", + element: vessel, + items: [{ + el: this._createMain() + }], + hgap: 50 + }) + }, + + refresh: function(){ + this._showModelData(); + } +}) + +TmpChildModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(TmpChildModel.superclass._defaultConfig.apply(this, arguments),{ + + }) + }, + + _init: function(){ + TmpChildModel.superclass._init.apply(this, arguments); + } + +}) +TmpChildChildView = BI.inherit(BI.View, { + _defaultConfig: function(){ + return BI.extend(TmpChildChildView.superclass._defaultConfig.apply(this, arguments),{ + baseCls: "bi-tmp-child-child" + }) + }, + + _init: function(){ + TmpChildChildView.superclass._init.apply(this, arguments); + }, + + change: function(changed){ + if(changed.type){ + this._showModelData(); + } + }, + + _showModelData: function(){ + this.text.setText("叶节点数据为:"+JSON.stringify(this.model.toJSON())); + }, + + _createMain: function(){ + return (this.text = BI.createWidget({ + type: "bi.label", + whiteSpace: "normal" + })) + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.center", + element: vessel, + items: [{ + el: this._createMain() + }], + hgap: 50 + }) + }, + + refresh: function(){ + this._showModelData(); + } +}) + +TmpChildChildModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(TmpChildChildModel.superclass._defaultConfig.apply(this, arguments),{ + + }) + }, + + _init: function(){ + TmpChildChildModel.superclass._init.apply(this, arguments); + } + +}) + +Demo.Func = BI.inherit(BI.Widget, { + render: function () { + var view = BI.View.createView("/tmp", {}, { + element: this + }); + view.populate(); + }, + + mounted: function () { + } +}); +BI.shortcut("demo.tmp", Demo.Func); var model = Fix.define({ name: 1, arr: [{ diff --git a/dist/sliders.css b/dist/sliders.css index a8d9688bb..66780294e 100644 --- a/dist/sliders.css +++ b/dist/sliders.css @@ -24,27 +24,15 @@ -moz-border-radius: 7px; border-radius: 7px; } -.bi-single-slider-button .slider-button { - cursor: ew-resize; - -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); - -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); - -webkit-border-radius: 7px; - -moz-border-radius: 7px; - border-radius: 7px; -} -.bi-slider-track .gray-track { - background-color: rgba(153, 153, 153, 0.3); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d999999,endColorstr=#4d999999); - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} -.bi-slider-track .blue-track { - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} +.bi-single-slider-button .slider-button { + cursor: ew-resize; + -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + -webkit-border-radius: 7px; + -moz-border-radius: 7px; + border-radius: 7px; +} .bi-slider-track .gray-track { background-color: rgba(153, 153, 153, 0.3); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d999999,endColorstr=#4d999999); @@ -57,3 +45,15 @@ -moz-border-radius: 3px; border-radius: 3px; } +.bi-slider-track .gray-track { + background-color: rgba(153, 153, 153, 0.3); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d999999,endColorstr=#4d999999); + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.bi-slider-track .blue-track { + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} diff --git a/src/core/controller/controller.tooltips.js b/src/core/controller/controller.tooltips.js index c470722b5..6cd9c989c 100644 --- a/src/core/controller/controller.tooltips.js +++ b/src/core/controller/controller.tooltips.js @@ -71,7 +71,9 @@ BI.TooltipsController = BI.inherit(BI.Controller, { var offset = context.element.offset(); var bounds = context.element.bounds(); - + if(bounds.height === 0 || bounds.width === 0) { + return; + } var top = offset.top + bounds.height + 5; var tooltip = this.get(name); tooltip.setText(text); From 0be516fd1a5b08b6c2c5f6d39363efc61fddb550 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 30 Oct 2017 15:20:40 +0800 Subject: [PATCH 2/6] update --- dist/fix/fix.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/dist/fix/fix.js b/dist/fix/fix.js index 534d30b41..7fc2bbff3 100644 --- a/dist/fix/fix.js +++ b/dist/fix/fix.js @@ -438,14 +438,15 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons return ob; } - function defineReactive(obj, shallow) { + function defineReactive(obj, observer, shallow) { var props = {}; _.each(obj, function (val, key) { if (key in $$skipArray) { return; } - var dep = new Dep(); + var dep = observer && observer['__dep' + key] || new Dep(); + observer && (observer['__dep' + key] = dep); var childOb = !shallow && observe(val); props[key] = { enumerable: true, @@ -501,9 +502,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons target[key] = val; return val; } - defineReactive(ob.value, key, val); + ob.value[key] = val; + target = defineReactive(ob.value, ob); ob.dep.notify(); - return val; + return target; } /** @@ -521,11 +523,14 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons if (!_.has(target, key)) { return; } - delete target[key]; if (!ob) { - return; + delete target[key]; + return target; } + delete ob.value[key]; + target = defineReactive(ob.value, ob); ob.dep.notify(); + return target; } /** From dad6fbb5304a48104fa36f1065b86133e89423c8 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 30 Oct 2017 15:22:02 +0800 Subject: [PATCH 3/6] update --- bi/base.js | 642 ++++++------ bi/sliders.css | 42 +- dist/base.js | 642 ++++++------ dist/bundle.js | 642 ++++++------ dist/demo.js | 2410 +++++++++++++++++++++++----------------------- dist/sliders.css | 42 +- 6 files changed, 2210 insertions(+), 2210 deletions(-) diff --git a/bi/base.js b/bi/base.js index a5a6a8188..88a7768e1 100644 --- a/bi/base.js +++ b/bi/base.js @@ -16267,68 +16267,68 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { key: function (e) { } -});/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorTextToolbar - * @extends BI.Widget - */ -BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-rich-editor-text-toolbar bi-background", - buttons: [ - {type: "bi.rich_editor_size_chooser"}, - {type: "bi.rich_editor_bold_button"}, - {type: "bi.rich_editor_italic_button"}, - {type: "bi.rich_editor_underline_button"}, - {type: "bi.rich_editor_color_chooser"}, - {type: "bi.rich_editor_background_color_chooser"}, - {type: "bi.rich_editor_align_left_button"}, - {type: "bi.rich_editor_align_center_button"}, - {type: "bi.rich_editor_align_right_button"}, - {type: "bi.rich_editor_param_button"}, - ], - height: 28 - }); - }, - - _init: function () { - BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); - var self = this, o = this.options; - BI.createWidget({ - type: "bi.left", - element: this, - items: BI.map(o.buttons, function (i, btn) { - return BI.extend(btn, { - editor: o.editor - }); - }), - hgap: 3, - vgap: 3 - }) - }, - - mounted: function () { - var self = this; - if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 - this.element.mousedown(function () { - self._noSelect(self.element[0]); - }); - this._noSelect(this.element[0]); - } - }, - - _noSelect: function (element) { - if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { - element.setAttribute('unselectable', 'on'); - } - for (var i = 0; i < element.childNodes.length; i++) { - this._noSelect(element.childNodes[i]); - } - } -}); +});/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorTextToolbar + * @extends BI.Widget + */ +BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-rich-editor-text-toolbar bi-background", + buttons: [ + {type: "bi.rich_editor_size_chooser"}, + {type: "bi.rich_editor_bold_button"}, + {type: "bi.rich_editor_italic_button"}, + {type: "bi.rich_editor_underline_button"}, + {type: "bi.rich_editor_color_chooser"}, + {type: "bi.rich_editor_background_color_chooser"}, + {type: "bi.rich_editor_align_left_button"}, + {type: "bi.rich_editor_align_center_button"}, + {type: "bi.rich_editor_align_right_button"}, + {type: "bi.rich_editor_param_button"}, + ], + height: 28 + }); + }, + + _init: function () { + BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); + var self = this, o = this.options; + BI.createWidget({ + type: "bi.left", + element: this, + items: BI.map(o.buttons, function (i, btn) { + return BI.extend(btn, { + editor: o.editor + }); + }), + hgap: 3, + vgap: 3 + }) + }, + + mounted: function () { + var self = this; + if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 + this.element.mousedown(function () { + self._noSelect(self.element[0]); + }); + this._noSelect(this.element[0]); + } + }, + + _noSelect: function (element) { + if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { + element.setAttribute('unselectable', 'on'); + } + for (var i = 0; i < element.childNodes.length; i++) { + this._noSelect(element.childNodes[i]); + } + } +}); BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** * 富文本编辑器 * @@ -16609,57 +16609,57 @@ BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** } }); }()); -/** - * 颜色选择trigger - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorBackgroundChooserTrigger - * @extends BI.Widget - */ -BI.RichEditorBackgroundChooserTrigger = BI.inherit(BI.Widget, { - _defaultConfig: function () { - var conf = BI.RichEditorBackgroundChooserTrigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - width: 20, - height: 20 - }); - }, - - _init: function () { - BI.RichEditorBackgroundChooserTrigger.superclass._init.apply(this, arguments); - this.font = BI.createWidget({ - type: "bi.icon_button", - cls: "text-background-font" - }); - - this.underline = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-underline-font" - }); - - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.font, - top: 2, - left: 2 - }, { - el: this.underline, - top: 7, - left: 2 - }] - }) - }, - - setValue: function (color) { - this.underline.element.css("color", color); - }, - - getValue: function () { - return this.font.element.css("color"); - } -}); +/** + * 颜色选择trigger + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorBackgroundChooserTrigger + * @extends BI.Widget + */ +BI.RichEditorBackgroundChooserTrigger = BI.inherit(BI.Widget, { + _defaultConfig: function () { + var conf = BI.RichEditorBackgroundChooserTrigger.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + width: 20, + height: 20 + }); + }, + + _init: function () { + BI.RichEditorBackgroundChooserTrigger.superclass._init.apply(this, arguments); + this.font = BI.createWidget({ + type: "bi.icon_button", + cls: "text-background-font" + }); + + this.underline = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-underline-font" + }); + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.font, + top: 2, + left: 2 + }, { + el: this.underline, + top: 7, + left: 2 + }] + }) + }, + + setValue: function (color) { + this.underline.element.css("color", color); + }, + + getValue: function () { + return this.font.element.css("color"); + } +}); BI.shortcut('bi.rich_editor_background_color_chooser_trigger', BI.RichEditorBackgroundChooserTrigger);/** * * Created by GUY on 2015/11/26. @@ -16927,214 +16927,214 @@ BI.RichEditorUnderlineButton = BI.inherit(BI.RichEditorAction, { this.underline.setSelected(false); }, }); -BI.shortcut("bi.rich_editor_underline_button", BI.RichEditorUnderlineButton)/** - * 颜色选择trigger - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorColorChooserTrigger - * @extends BI.Widget - */ -BI.RichEditorColorChooserTrigger = BI.inherit(BI.Widget, { - _defaultConfig: function () { - var conf = BI.RichEditorColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - width: 20, - height: 20 - }); - }, - - _init: function () { - BI.RichEditorColorChooserTrigger.superclass._init.apply(this, arguments); - this.font = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-font" - }); - - this.underline = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-underline-font" - }); - - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.font, - top: 2, - left: 2 - }, { - el: this.underline, - top: 7, - left: 2 - }] - }) - }, - - setValue: function (color) { - this.underline.element.css("color", color); - }, - - getValue: function () { - return this.font.element.css("color"); - } -}); -BI.shortcut('bi.rich_editor_color_chooser_trigger', BI.RichEditorColorChooserTrigger);/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorBackgroundColorChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorBackgroundColorChooser.superclass._defaultConfig.apply(this, arguments), { - width: 20, - height: 20, - }); - }, - - _init: function () { - BI.RichEditorBackgroundColorChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.colorchooser = BI.createWidget({ - type: "bi.color_chooser", - element: this, - width: o.width, - height: o.height, - el: { - type: "bi.rich_editor_background_color_chooser_trigger", - title: BI.i18nText("BI-Widget_Background_Colour"), - cls: "text-toolbar-button" - } - }); - this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { - var backgroundColor = this.getValue(); - o.editor.element.css({ - backgroundColor: backgroundColor, - color: BI.DOM.getContrastColor(backgroundColor) - }); - this.setValue(""); - }); - }, - - deactivate: function () { - } -}); -BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorColorChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this, arguments), { - width: 20, - height: 20, - command: "foreColor" - }); - }, - - _init: function () { - BI.RichEditorColorChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.colorchooser = BI.createWidget({ - type: "bi.color_chooser", - element: this, - width: o.width, - height: o.height, - el: { - type: "bi.rich_editor_color_chooser_trigger", - title: BI.i18nText("BI-Font_Colour"), - cls: "text-toolbar-button" - } - }); - this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { - self.doCommand(this.getValue()); - }); - - }, - - deactivate: function () { - this.colorchooser.setValue(""); - } -}); -BI.shortcut('bi.rich_editor_color_chooser', BI.RichEditorColorChooser);/** - * 字体大小选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorSizeChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-rich-editor-size-chooser bi-border bi-card", - command: "FontSize", - width: 50, - height: 20 - }); - }, - - _items: [{ - value: 1, - text: "1(8pt)" - }, { - value: 2, - text: "2(10pt)" - }, { - value: 3, - text: "3(12pt)" - }, { - value: 4, - text: "4(14pt)" - }, { - value: 5, - text: "5(18pt)" - }, { - value: 6, - text: "6(24pt)" - }], - - _init: function () { - BI.RichEditorSizeChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.trigger = BI.createWidget({ - type: "bi.text_trigger", - readonly: true, - height: o.height, - triggerWidth: 12, - text: BI.i18nText("BI-Font_Size") - }); - - this.combo = BI.createWidget({ - type: "bi.combo", - element: this, - el: this.trigger, - adjustLength: 1, - popup: { - maxWidth: 70, - minWidth: 70, - el: { - type: "bi.button_group", - items: BI.createItems(this._items, { - type: "bi.single_select_item" - }), - layouts: [{ - type: "bi.vertical" - }] - } - } - }); - this.combo.on(BI.Combo.EVENT_CHANGE, function () { - var val = this.getValue()[0]; - self.doCommand(val); - this.hideView(); - this.setValue([]); - }) - } -}); +BI.shortcut("bi.rich_editor_underline_button", BI.RichEditorUnderlineButton)/** + * 颜色选择trigger + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorColorChooserTrigger + * @extends BI.Widget + */ +BI.RichEditorColorChooserTrigger = BI.inherit(BI.Widget, { + _defaultConfig: function () { + var conf = BI.RichEditorColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + width: 20, + height: 20 + }); + }, + + _init: function () { + BI.RichEditorColorChooserTrigger.superclass._init.apply(this, arguments); + this.font = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-font" + }); + + this.underline = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-underline-font" + }); + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.font, + top: 2, + left: 2 + }, { + el: this.underline, + top: 7, + left: 2 + }] + }) + }, + + setValue: function (color) { + this.underline.element.css("color", color); + }, + + getValue: function () { + return this.font.element.css("color"); + } +}); +BI.shortcut('bi.rich_editor_color_chooser_trigger', BI.RichEditorColorChooserTrigger);/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorBackgroundColorChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorBackgroundColorChooser.superclass._defaultConfig.apply(this, arguments), { + width: 20, + height: 20, + }); + }, + + _init: function () { + BI.RichEditorBackgroundColorChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.colorchooser = BI.createWidget({ + type: "bi.color_chooser", + element: this, + width: o.width, + height: o.height, + el: { + type: "bi.rich_editor_background_color_chooser_trigger", + title: BI.i18nText("BI-Widget_Background_Colour"), + cls: "text-toolbar-button" + } + }); + this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { + var backgroundColor = this.getValue(); + o.editor.element.css({ + backgroundColor: backgroundColor, + color: BI.DOM.getContrastColor(backgroundColor) + }); + this.setValue(""); + }); + }, + + deactivate: function () { + } +}); +BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorColorChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this, arguments), { + width: 20, + height: 20, + command: "foreColor" + }); + }, + + _init: function () { + BI.RichEditorColorChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.colorchooser = BI.createWidget({ + type: "bi.color_chooser", + element: this, + width: o.width, + height: o.height, + el: { + type: "bi.rich_editor_color_chooser_trigger", + title: BI.i18nText("BI-Font_Colour"), + cls: "text-toolbar-button" + } + }); + this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { + self.doCommand(this.getValue()); + }); + + }, + + deactivate: function () { + this.colorchooser.setValue(""); + } +}); +BI.shortcut('bi.rich_editor_color_chooser', BI.RichEditorColorChooser);/** + * 字体大小选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorSizeChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-rich-editor-size-chooser bi-border bi-card", + command: "FontSize", + width: 50, + height: 20 + }); + }, + + _items: [{ + value: 1, + text: "1(8pt)" + }, { + value: 2, + text: "2(10pt)" + }, { + value: 3, + text: "3(12pt)" + }, { + value: 4, + text: "4(14pt)" + }, { + value: 5, + text: "5(18pt)" + }, { + value: 6, + text: "6(24pt)" + }], + + _init: function () { + BI.RichEditorSizeChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.trigger = BI.createWidget({ + type: "bi.text_trigger", + readonly: true, + height: o.height, + triggerWidth: 12, + text: BI.i18nText("BI-Font_Size") + }); + + this.combo = BI.createWidget({ + type: "bi.combo", + element: this, + el: this.trigger, + adjustLength: 1, + popup: { + maxWidth: 70, + minWidth: 70, + el: { + type: "bi.button_group", + items: BI.createItems(this._items, { + type: "bi.single_select_item" + }), + layouts: [{ + type: "bi.vertical" + }] + } + } + }); + this.combo.on(BI.Combo.EVENT_CHANGE, function () { + var val = this.getValue()[0]; + self.doCommand(val); + this.hideView(); + this.setValue([]); + }) + } +}); BI.shortcut('bi.rich_editor_size_chooser', BI.RichEditorSizeChooser);/** * 富文本编辑器 * diff --git a/bi/sliders.css b/bi/sliders.css index 66780294e..a8d9688bb 100644 --- a/bi/sliders.css +++ b/bi/sliders.css @@ -24,15 +24,27 @@ -moz-border-radius: 7px; border-radius: 7px; } -.bi-single-slider-button .slider-button { - cursor: ew-resize; - -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); - -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); - -webkit-border-radius: 7px; - -moz-border-radius: 7px; - border-radius: 7px; -} +.bi-single-slider-button .slider-button { + cursor: ew-resize; + -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + -webkit-border-radius: 7px; + -moz-border-radius: 7px; + border-radius: 7px; +} +.bi-slider-track .gray-track { + background-color: rgba(153, 153, 153, 0.3); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d999999,endColorstr=#4d999999); + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.bi-slider-track .blue-track { + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} .bi-slider-track .gray-track { background-color: rgba(153, 153, 153, 0.3); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d999999,endColorstr=#4d999999); @@ -45,15 +57,3 @@ -moz-border-radius: 3px; border-radius: 3px; } -.bi-slider-track .gray-track { - background-color: rgba(153, 153, 153, 0.3); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d999999,endColorstr=#4d999999); - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} -.bi-slider-track .blue-track { - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} diff --git a/dist/base.js b/dist/base.js index a5a6a8188..88a7768e1 100644 --- a/dist/base.js +++ b/dist/base.js @@ -16267,68 +16267,68 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { key: function (e) { } -});/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorTextToolbar - * @extends BI.Widget - */ -BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-rich-editor-text-toolbar bi-background", - buttons: [ - {type: "bi.rich_editor_size_chooser"}, - {type: "bi.rich_editor_bold_button"}, - {type: "bi.rich_editor_italic_button"}, - {type: "bi.rich_editor_underline_button"}, - {type: "bi.rich_editor_color_chooser"}, - {type: "bi.rich_editor_background_color_chooser"}, - {type: "bi.rich_editor_align_left_button"}, - {type: "bi.rich_editor_align_center_button"}, - {type: "bi.rich_editor_align_right_button"}, - {type: "bi.rich_editor_param_button"}, - ], - height: 28 - }); - }, - - _init: function () { - BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); - var self = this, o = this.options; - BI.createWidget({ - type: "bi.left", - element: this, - items: BI.map(o.buttons, function (i, btn) { - return BI.extend(btn, { - editor: o.editor - }); - }), - hgap: 3, - vgap: 3 - }) - }, - - mounted: function () { - var self = this; - if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 - this.element.mousedown(function () { - self._noSelect(self.element[0]); - }); - this._noSelect(this.element[0]); - } - }, - - _noSelect: function (element) { - if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { - element.setAttribute('unselectable', 'on'); - } - for (var i = 0; i < element.childNodes.length; i++) { - this._noSelect(element.childNodes[i]); - } - } -}); +});/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorTextToolbar + * @extends BI.Widget + */ +BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-rich-editor-text-toolbar bi-background", + buttons: [ + {type: "bi.rich_editor_size_chooser"}, + {type: "bi.rich_editor_bold_button"}, + {type: "bi.rich_editor_italic_button"}, + {type: "bi.rich_editor_underline_button"}, + {type: "bi.rich_editor_color_chooser"}, + {type: "bi.rich_editor_background_color_chooser"}, + {type: "bi.rich_editor_align_left_button"}, + {type: "bi.rich_editor_align_center_button"}, + {type: "bi.rich_editor_align_right_button"}, + {type: "bi.rich_editor_param_button"}, + ], + height: 28 + }); + }, + + _init: function () { + BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); + var self = this, o = this.options; + BI.createWidget({ + type: "bi.left", + element: this, + items: BI.map(o.buttons, function (i, btn) { + return BI.extend(btn, { + editor: o.editor + }); + }), + hgap: 3, + vgap: 3 + }) + }, + + mounted: function () { + var self = this; + if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 + this.element.mousedown(function () { + self._noSelect(self.element[0]); + }); + this._noSelect(this.element[0]); + } + }, + + _noSelect: function (element) { + if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { + element.setAttribute('unselectable', 'on'); + } + for (var i = 0; i < element.childNodes.length; i++) { + this._noSelect(element.childNodes[i]); + } + } +}); BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** * 富文本编辑器 * @@ -16609,57 +16609,57 @@ BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** } }); }()); -/** - * 颜色选择trigger - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorBackgroundChooserTrigger - * @extends BI.Widget - */ -BI.RichEditorBackgroundChooserTrigger = BI.inherit(BI.Widget, { - _defaultConfig: function () { - var conf = BI.RichEditorBackgroundChooserTrigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - width: 20, - height: 20 - }); - }, - - _init: function () { - BI.RichEditorBackgroundChooserTrigger.superclass._init.apply(this, arguments); - this.font = BI.createWidget({ - type: "bi.icon_button", - cls: "text-background-font" - }); - - this.underline = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-underline-font" - }); - - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.font, - top: 2, - left: 2 - }, { - el: this.underline, - top: 7, - left: 2 - }] - }) - }, - - setValue: function (color) { - this.underline.element.css("color", color); - }, - - getValue: function () { - return this.font.element.css("color"); - } -}); +/** + * 颜色选择trigger + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorBackgroundChooserTrigger + * @extends BI.Widget + */ +BI.RichEditorBackgroundChooserTrigger = BI.inherit(BI.Widget, { + _defaultConfig: function () { + var conf = BI.RichEditorBackgroundChooserTrigger.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + width: 20, + height: 20 + }); + }, + + _init: function () { + BI.RichEditorBackgroundChooserTrigger.superclass._init.apply(this, arguments); + this.font = BI.createWidget({ + type: "bi.icon_button", + cls: "text-background-font" + }); + + this.underline = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-underline-font" + }); + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.font, + top: 2, + left: 2 + }, { + el: this.underline, + top: 7, + left: 2 + }] + }) + }, + + setValue: function (color) { + this.underline.element.css("color", color); + }, + + getValue: function () { + return this.font.element.css("color"); + } +}); BI.shortcut('bi.rich_editor_background_color_chooser_trigger', BI.RichEditorBackgroundChooserTrigger);/** * * Created by GUY on 2015/11/26. @@ -16927,214 +16927,214 @@ BI.RichEditorUnderlineButton = BI.inherit(BI.RichEditorAction, { this.underline.setSelected(false); }, }); -BI.shortcut("bi.rich_editor_underline_button", BI.RichEditorUnderlineButton)/** - * 颜色选择trigger - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorColorChooserTrigger - * @extends BI.Widget - */ -BI.RichEditorColorChooserTrigger = BI.inherit(BI.Widget, { - _defaultConfig: function () { - var conf = BI.RichEditorColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - width: 20, - height: 20 - }); - }, - - _init: function () { - BI.RichEditorColorChooserTrigger.superclass._init.apply(this, arguments); - this.font = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-font" - }); - - this.underline = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-underline-font" - }); - - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.font, - top: 2, - left: 2 - }, { - el: this.underline, - top: 7, - left: 2 - }] - }) - }, - - setValue: function (color) { - this.underline.element.css("color", color); - }, - - getValue: function () { - return this.font.element.css("color"); - } -}); -BI.shortcut('bi.rich_editor_color_chooser_trigger', BI.RichEditorColorChooserTrigger);/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorBackgroundColorChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorBackgroundColorChooser.superclass._defaultConfig.apply(this, arguments), { - width: 20, - height: 20, - }); - }, - - _init: function () { - BI.RichEditorBackgroundColorChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.colorchooser = BI.createWidget({ - type: "bi.color_chooser", - element: this, - width: o.width, - height: o.height, - el: { - type: "bi.rich_editor_background_color_chooser_trigger", - title: BI.i18nText("BI-Widget_Background_Colour"), - cls: "text-toolbar-button" - } - }); - this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { - var backgroundColor = this.getValue(); - o.editor.element.css({ - backgroundColor: backgroundColor, - color: BI.DOM.getContrastColor(backgroundColor) - }); - this.setValue(""); - }); - }, - - deactivate: function () { - } -}); -BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorColorChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this, arguments), { - width: 20, - height: 20, - command: "foreColor" - }); - }, - - _init: function () { - BI.RichEditorColorChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.colorchooser = BI.createWidget({ - type: "bi.color_chooser", - element: this, - width: o.width, - height: o.height, - el: { - type: "bi.rich_editor_color_chooser_trigger", - title: BI.i18nText("BI-Font_Colour"), - cls: "text-toolbar-button" - } - }); - this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { - self.doCommand(this.getValue()); - }); - - }, - - deactivate: function () { - this.colorchooser.setValue(""); - } -}); -BI.shortcut('bi.rich_editor_color_chooser', BI.RichEditorColorChooser);/** - * 字体大小选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorSizeChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-rich-editor-size-chooser bi-border bi-card", - command: "FontSize", - width: 50, - height: 20 - }); - }, - - _items: [{ - value: 1, - text: "1(8pt)" - }, { - value: 2, - text: "2(10pt)" - }, { - value: 3, - text: "3(12pt)" - }, { - value: 4, - text: "4(14pt)" - }, { - value: 5, - text: "5(18pt)" - }, { - value: 6, - text: "6(24pt)" - }], - - _init: function () { - BI.RichEditorSizeChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.trigger = BI.createWidget({ - type: "bi.text_trigger", - readonly: true, - height: o.height, - triggerWidth: 12, - text: BI.i18nText("BI-Font_Size") - }); - - this.combo = BI.createWidget({ - type: "bi.combo", - element: this, - el: this.trigger, - adjustLength: 1, - popup: { - maxWidth: 70, - minWidth: 70, - el: { - type: "bi.button_group", - items: BI.createItems(this._items, { - type: "bi.single_select_item" - }), - layouts: [{ - type: "bi.vertical" - }] - } - } - }); - this.combo.on(BI.Combo.EVENT_CHANGE, function () { - var val = this.getValue()[0]; - self.doCommand(val); - this.hideView(); - this.setValue([]); - }) - } -}); +BI.shortcut("bi.rich_editor_underline_button", BI.RichEditorUnderlineButton)/** + * 颜色选择trigger + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorColorChooserTrigger + * @extends BI.Widget + */ +BI.RichEditorColorChooserTrigger = BI.inherit(BI.Widget, { + _defaultConfig: function () { + var conf = BI.RichEditorColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + width: 20, + height: 20 + }); + }, + + _init: function () { + BI.RichEditorColorChooserTrigger.superclass._init.apply(this, arguments); + this.font = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-font" + }); + + this.underline = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-underline-font" + }); + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.font, + top: 2, + left: 2 + }, { + el: this.underline, + top: 7, + left: 2 + }] + }) + }, + + setValue: function (color) { + this.underline.element.css("color", color); + }, + + getValue: function () { + return this.font.element.css("color"); + } +}); +BI.shortcut('bi.rich_editor_color_chooser_trigger', BI.RichEditorColorChooserTrigger);/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorBackgroundColorChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorBackgroundColorChooser.superclass._defaultConfig.apply(this, arguments), { + width: 20, + height: 20, + }); + }, + + _init: function () { + BI.RichEditorBackgroundColorChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.colorchooser = BI.createWidget({ + type: "bi.color_chooser", + element: this, + width: o.width, + height: o.height, + el: { + type: "bi.rich_editor_background_color_chooser_trigger", + title: BI.i18nText("BI-Widget_Background_Colour"), + cls: "text-toolbar-button" + } + }); + this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { + var backgroundColor = this.getValue(); + o.editor.element.css({ + backgroundColor: backgroundColor, + color: BI.DOM.getContrastColor(backgroundColor) + }); + this.setValue(""); + }); + }, + + deactivate: function () { + } +}); +BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorColorChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this, arguments), { + width: 20, + height: 20, + command: "foreColor" + }); + }, + + _init: function () { + BI.RichEditorColorChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.colorchooser = BI.createWidget({ + type: "bi.color_chooser", + element: this, + width: o.width, + height: o.height, + el: { + type: "bi.rich_editor_color_chooser_trigger", + title: BI.i18nText("BI-Font_Colour"), + cls: "text-toolbar-button" + } + }); + this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { + self.doCommand(this.getValue()); + }); + + }, + + deactivate: function () { + this.colorchooser.setValue(""); + } +}); +BI.shortcut('bi.rich_editor_color_chooser', BI.RichEditorColorChooser);/** + * 字体大小选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorSizeChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-rich-editor-size-chooser bi-border bi-card", + command: "FontSize", + width: 50, + height: 20 + }); + }, + + _items: [{ + value: 1, + text: "1(8pt)" + }, { + value: 2, + text: "2(10pt)" + }, { + value: 3, + text: "3(12pt)" + }, { + value: 4, + text: "4(14pt)" + }, { + value: 5, + text: "5(18pt)" + }, { + value: 6, + text: "6(24pt)" + }], + + _init: function () { + BI.RichEditorSizeChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.trigger = BI.createWidget({ + type: "bi.text_trigger", + readonly: true, + height: o.height, + triggerWidth: 12, + text: BI.i18nText("BI-Font_Size") + }); + + this.combo = BI.createWidget({ + type: "bi.combo", + element: this, + el: this.trigger, + adjustLength: 1, + popup: { + maxWidth: 70, + minWidth: 70, + el: { + type: "bi.button_group", + items: BI.createItems(this._items, { + type: "bi.single_select_item" + }), + layouts: [{ + type: "bi.vertical" + }] + } + } + }); + this.combo.on(BI.Combo.EVENT_CHANGE, function () { + var val = this.getValue()[0]; + self.doCommand(val); + this.hideView(); + this.setValue([]); + }) + } +}); BI.shortcut('bi.rich_editor_size_chooser', BI.RichEditorSizeChooser);/** * 富文本编辑器 * diff --git a/dist/bundle.js b/dist/bundle.js index a294d056e..05a8c5dad 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -42047,68 +42047,68 @@ BI.RichEditorParamAction = BI.inherit(BI.RichEditorAction, { key: function (e) { } -});/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorTextToolbar - * @extends BI.Widget - */ -BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-rich-editor-text-toolbar bi-background", - buttons: [ - {type: "bi.rich_editor_size_chooser"}, - {type: "bi.rich_editor_bold_button"}, - {type: "bi.rich_editor_italic_button"}, - {type: "bi.rich_editor_underline_button"}, - {type: "bi.rich_editor_color_chooser"}, - {type: "bi.rich_editor_background_color_chooser"}, - {type: "bi.rich_editor_align_left_button"}, - {type: "bi.rich_editor_align_center_button"}, - {type: "bi.rich_editor_align_right_button"}, - {type: "bi.rich_editor_param_button"}, - ], - height: 28 - }); - }, - - _init: function () { - BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); - var self = this, o = this.options; - BI.createWidget({ - type: "bi.left", - element: this, - items: BI.map(o.buttons, function (i, btn) { - return BI.extend(btn, { - editor: o.editor - }); - }), - hgap: 3, - vgap: 3 - }) - }, - - mounted: function () { - var self = this; - if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 - this.element.mousedown(function () { - self._noSelect(self.element[0]); - }); - this._noSelect(this.element[0]); - } - }, - - _noSelect: function (element) { - if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { - element.setAttribute('unselectable', 'on'); - } - for (var i = 0; i < element.childNodes.length; i++) { - this._noSelect(element.childNodes[i]); - } - } -}); +});/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorTextToolbar + * @extends BI.Widget + */ +BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-rich-editor-text-toolbar bi-background", + buttons: [ + {type: "bi.rich_editor_size_chooser"}, + {type: "bi.rich_editor_bold_button"}, + {type: "bi.rich_editor_italic_button"}, + {type: "bi.rich_editor_underline_button"}, + {type: "bi.rich_editor_color_chooser"}, + {type: "bi.rich_editor_background_color_chooser"}, + {type: "bi.rich_editor_align_left_button"}, + {type: "bi.rich_editor_align_center_button"}, + {type: "bi.rich_editor_align_right_button"}, + {type: "bi.rich_editor_param_button"}, + ], + height: 28 + }); + }, + + _init: function () { + BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); + var self = this, o = this.options; + BI.createWidget({ + type: "bi.left", + element: this, + items: BI.map(o.buttons, function (i, btn) { + return BI.extend(btn, { + editor: o.editor + }); + }), + hgap: 3, + vgap: 3 + }) + }, + + mounted: function () { + var self = this; + if (BI.isIE9Below()) {//IE8下必须要设置unselectable才能不blur输入框 + this.element.mousedown(function () { + self._noSelect(self.element[0]); + }); + this._noSelect(this.element[0]); + } + }, + + _noSelect: function (element) { + if (element.setAttribute && element.nodeName.toLowerCase() != 'input' && element.nodeName.toLowerCase() != 'textarea') { + element.setAttribute('unselectable', 'on'); + } + for (var i = 0; i < element.childNodes.length; i++) { + this._noSelect(element.childNodes[i]); + } + } +}); BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** * 富文本编辑器 * @@ -42389,57 +42389,57 @@ BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** } }); }()); -/** - * 颜色选择trigger - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorBackgroundChooserTrigger - * @extends BI.Widget - */ -BI.RichEditorBackgroundChooserTrigger = BI.inherit(BI.Widget, { - _defaultConfig: function () { - var conf = BI.RichEditorBackgroundChooserTrigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - width: 20, - height: 20 - }); - }, - - _init: function () { - BI.RichEditorBackgroundChooserTrigger.superclass._init.apply(this, arguments); - this.font = BI.createWidget({ - type: "bi.icon_button", - cls: "text-background-font" - }); - - this.underline = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-underline-font" - }); - - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.font, - top: 2, - left: 2 - }, { - el: this.underline, - top: 7, - left: 2 - }] - }) - }, - - setValue: function (color) { - this.underline.element.css("color", color); - }, - - getValue: function () { - return this.font.element.css("color"); - } -}); +/** + * 颜色选择trigger + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorBackgroundChooserTrigger + * @extends BI.Widget + */ +BI.RichEditorBackgroundChooserTrigger = BI.inherit(BI.Widget, { + _defaultConfig: function () { + var conf = BI.RichEditorBackgroundChooserTrigger.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + width: 20, + height: 20 + }); + }, + + _init: function () { + BI.RichEditorBackgroundChooserTrigger.superclass._init.apply(this, arguments); + this.font = BI.createWidget({ + type: "bi.icon_button", + cls: "text-background-font" + }); + + this.underline = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-underline-font" + }); + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.font, + top: 2, + left: 2 + }, { + el: this.underline, + top: 7, + left: 2 + }] + }) + }, + + setValue: function (color) { + this.underline.element.css("color", color); + }, + + getValue: function () { + return this.font.element.css("color"); + } +}); BI.shortcut('bi.rich_editor_background_color_chooser_trigger', BI.RichEditorBackgroundChooserTrigger);/** * * Created by GUY on 2015/11/26. @@ -42707,214 +42707,214 @@ BI.RichEditorUnderlineButton = BI.inherit(BI.RichEditorAction, { this.underline.setSelected(false); }, }); -BI.shortcut("bi.rich_editor_underline_button", BI.RichEditorUnderlineButton)/** - * 颜色选择trigger - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorColorChooserTrigger - * @extends BI.Widget - */ -BI.RichEditorColorChooserTrigger = BI.inherit(BI.Widget, { - _defaultConfig: function () { - var conf = BI.RichEditorColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); - return BI.extend(conf, { - width: 20, - height: 20 - }); - }, - - _init: function () { - BI.RichEditorColorChooserTrigger.superclass._init.apply(this, arguments); - this.font = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-font" - }); - - this.underline = BI.createWidget({ - type: "bi.icon_button", - cls: "text-color-underline-font" - }); - - BI.createWidget({ - type: "bi.absolute", - element: this, - items: [{ - el: this.font, - top: 2, - left: 2 - }, { - el: this.underline, - top: 7, - left: 2 - }] - }) - }, - - setValue: function (color) { - this.underline.element.css("color", color); - }, - - getValue: function () { - return this.font.element.css("color"); - } -}); -BI.shortcut('bi.rich_editor_color_chooser_trigger', BI.RichEditorColorChooserTrigger);/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorBackgroundColorChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorBackgroundColorChooser.superclass._defaultConfig.apply(this, arguments), { - width: 20, - height: 20, - }); - }, - - _init: function () { - BI.RichEditorBackgroundColorChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.colorchooser = BI.createWidget({ - type: "bi.color_chooser", - element: this, - width: o.width, - height: o.height, - el: { - type: "bi.rich_editor_background_color_chooser_trigger", - title: BI.i18nText("BI-Widget_Background_Colour"), - cls: "text-toolbar-button" - } - }); - this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { - var backgroundColor = this.getValue(); - o.editor.element.css({ - backgroundColor: backgroundColor, - color: BI.DOM.getContrastColor(backgroundColor) - }); - this.setValue(""); - }); - }, - - deactivate: function () { - } -}); -BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/** - * 颜色选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorColorChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this, arguments), { - width: 20, - height: 20, - command: "foreColor" - }); - }, - - _init: function () { - BI.RichEditorColorChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.colorchooser = BI.createWidget({ - type: "bi.color_chooser", - element: this, - width: o.width, - height: o.height, - el: { - type: "bi.rich_editor_color_chooser_trigger", - title: BI.i18nText("BI-Font_Colour"), - cls: "text-toolbar-button" - } - }); - this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { - self.doCommand(this.getValue()); - }); - - }, - - deactivate: function () { - this.colorchooser.setValue(""); - } -}); -BI.shortcut('bi.rich_editor_color_chooser', BI.RichEditorColorChooser);/** - * 字体大小选择 - * - * Created by GUY on 2015/11/26. - * @class BI.RichEditorSizeChooser - * @extends BI.RichEditorAction - */ -BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, { - _defaultConfig: function () { - return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-rich-editor-size-chooser bi-border bi-card", - command: "FontSize", - width: 50, - height: 20 - }); - }, - - _items: [{ - value: 1, - text: "1(8pt)" - }, { - value: 2, - text: "2(10pt)" - }, { - value: 3, - text: "3(12pt)" - }, { - value: 4, - text: "4(14pt)" - }, { - value: 5, - text: "5(18pt)" - }, { - value: 6, - text: "6(24pt)" - }], - - _init: function () { - BI.RichEditorSizeChooser.superclass._init.apply(this, arguments); - var self = this, o = this.options; - this.trigger = BI.createWidget({ - type: "bi.text_trigger", - readonly: true, - height: o.height, - triggerWidth: 12, - text: BI.i18nText("BI-Font_Size") - }); - - this.combo = BI.createWidget({ - type: "bi.combo", - element: this, - el: this.trigger, - adjustLength: 1, - popup: { - maxWidth: 70, - minWidth: 70, - el: { - type: "bi.button_group", - items: BI.createItems(this._items, { - type: "bi.single_select_item" - }), - layouts: [{ - type: "bi.vertical" - }] - } - } - }); - this.combo.on(BI.Combo.EVENT_CHANGE, function () { - var val = this.getValue()[0]; - self.doCommand(val); - this.hideView(); - this.setValue([]); - }) - } -}); +BI.shortcut("bi.rich_editor_underline_button", BI.RichEditorUnderlineButton)/** + * 颜色选择trigger + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorColorChooserTrigger + * @extends BI.Widget + */ +BI.RichEditorColorChooserTrigger = BI.inherit(BI.Widget, { + _defaultConfig: function () { + var conf = BI.RichEditorColorChooserTrigger.superclass._defaultConfig.apply(this, arguments); + return BI.extend(conf, { + width: 20, + height: 20 + }); + }, + + _init: function () { + BI.RichEditorColorChooserTrigger.superclass._init.apply(this, arguments); + this.font = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-font" + }); + + this.underline = BI.createWidget({ + type: "bi.icon_button", + cls: "text-color-underline-font" + }); + + BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: this.font, + top: 2, + left: 2 + }, { + el: this.underline, + top: 7, + left: 2 + }] + }) + }, + + setValue: function (color) { + this.underline.element.css("color", color); + }, + + getValue: function () { + return this.font.element.css("color"); + } +}); +BI.shortcut('bi.rich_editor_color_chooser_trigger', BI.RichEditorColorChooserTrigger);/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorBackgroundColorChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorBackgroundColorChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorBackgroundColorChooser.superclass._defaultConfig.apply(this, arguments), { + width: 20, + height: 20, + }); + }, + + _init: function () { + BI.RichEditorBackgroundColorChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.colorchooser = BI.createWidget({ + type: "bi.color_chooser", + element: this, + width: o.width, + height: o.height, + el: { + type: "bi.rich_editor_background_color_chooser_trigger", + title: BI.i18nText("BI-Widget_Background_Colour"), + cls: "text-toolbar-button" + } + }); + this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { + var backgroundColor = this.getValue(); + o.editor.element.css({ + backgroundColor: backgroundColor, + color: BI.DOM.getContrastColor(backgroundColor) + }); + this.setValue(""); + }); + }, + + deactivate: function () { + } +}); +BI.shortcut('bi.rich_editor_background_color_chooser', BI.RichEditorBackgroundColorChooser);/** + * 颜色选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorColorChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorColorChooser.superclass._defaultConfig.apply(this, arguments), { + width: 20, + height: 20, + command: "foreColor" + }); + }, + + _init: function () { + BI.RichEditorColorChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.colorchooser = BI.createWidget({ + type: "bi.color_chooser", + element: this, + width: o.width, + height: o.height, + el: { + type: "bi.rich_editor_color_chooser_trigger", + title: BI.i18nText("BI-Font_Colour"), + cls: "text-toolbar-button" + } + }); + this.colorchooser.on(BI.ColorChooser.EVENT_CHANGE, function () { + self.doCommand(this.getValue()); + }); + + }, + + deactivate: function () { + this.colorchooser.setValue(""); + } +}); +BI.shortcut('bi.rich_editor_color_chooser', BI.RichEditorColorChooser);/** + * 字体大小选择 + * + * Created by GUY on 2015/11/26. + * @class BI.RichEditorSizeChooser + * @extends BI.RichEditorAction + */ +BI.RichEditorSizeChooser = BI.inherit(BI.RichEditorAction, { + _defaultConfig: function () { + return BI.extend(BI.RichEditorSizeChooser.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-rich-editor-size-chooser bi-border bi-card", + command: "FontSize", + width: 50, + height: 20 + }); + }, + + _items: [{ + value: 1, + text: "1(8pt)" + }, { + value: 2, + text: "2(10pt)" + }, { + value: 3, + text: "3(12pt)" + }, { + value: 4, + text: "4(14pt)" + }, { + value: 5, + text: "5(18pt)" + }, { + value: 6, + text: "6(24pt)" + }], + + _init: function () { + BI.RichEditorSizeChooser.superclass._init.apply(this, arguments); + var self = this, o = this.options; + this.trigger = BI.createWidget({ + type: "bi.text_trigger", + readonly: true, + height: o.height, + triggerWidth: 12, + text: BI.i18nText("BI-Font_Size") + }); + + this.combo = BI.createWidget({ + type: "bi.combo", + element: this, + el: this.trigger, + adjustLength: 1, + popup: { + maxWidth: 70, + minWidth: 70, + el: { + type: "bi.button_group", + items: BI.createItems(this._items, { + type: "bi.single_select_item" + }), + layouts: [{ + type: "bi.vertical" + }] + } + } + }); + this.combo.on(BI.Combo.EVENT_CHANGE, function () { + var val = this.getValue()[0]; + self.doCommand(val); + this.hideView(); + this.setValue([]); + }) + } +}); BI.shortcut('bi.rich_editor_size_chooser', BI.RichEditorSizeChooser);/** * 富文本编辑器 * diff --git a/dist/demo.js b/dist/demo.js index e8bd32c9d..4e6b12974 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -8865,1211 +8865,1211 @@ BI.shortcut("demo.vtape", Demo.VtapeLayout);Demo.Face = BI.inherit(BI.Widget, { this._runGlobalStyle(); } }); -BI.shortcut("demo.face", Demo.Face);//change函数 -ChangeView = BI.inherit(BI.View, { - _defaultConfig: function(){ - return BI.extend(ChangeView.superclass._defaultConfig.apply(this, arguments),{ - baseCls: "bi-change" - }) - }, - - _init: function(){ - ChangeView.superclass._init.apply(this, arguments); - }, - - change: function(changed){ - if(changed.child){ - this._showModelData(); - } - if(changed.superiors){ - this._showModelData(); - } - }, - - _showModelData: function(){ - this.outerText.setText("父级Model层数据: " + JSON.stringify(this.model.toJSON())); - }, - - _createOuter: function(){ - this.outerText = BI.createWidget({ - type: "bi.label", - cls: "outer-text", - whiteSpace: "normal" - }); - - return BI.createWidget({ - type: "bi.border", - items: { - north: { - el: this.outerText, - height: 50 - }, - center: this._createInner() - } - }); - }, - - _createInner: function(){ - var innerPane = BI.createWidget({ - type: "bi.absolute", - cls: "inner" - }); - this.addSubVessel("innerPane", innerPane, { - defaultShowName: "inner" - }); - return innerPane; - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.center", - element: vessel, - items: [this._createOuter()], - hgap: 100, - vgap: 100 - }); - - this._showModelData(); - }, - - refresh: function(){ - this.skipTo("inner", "innerPane", "superiors"); - } -}); - -ChangeModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(ChangeModel.superclass._defaultConfig.apply(this, arguments),{ - superiors: { - child: "default" - }, - child: "default" - }) - }, - - _init: function(){ - ChangeModel.superclass._init.apply(this, arguments); - }, - - change: function(changed){ - if(changed.superiors){ - this.set("child", changed.superiors.child); - } - } -}); - -//ChangeView 的子级 -ChangeInnerView = BI.inherit(BI.View, { - _init: function(){ - ChangeInnerView.superclass._init.apply(this, arguments); - }, - - change: function(changed){ - if(changed.child){ - this._showModelData(); - } - }, - - _createOuter: function(){ - var self = this; - this.text = BI.createWidget({ - type: "bi.label", - height: 26 - }); - - this.buttons = BI.createWidget({ - type: "bi.button_group", - items: BI.createItems(this.model.get("items"), { - type: "bi.text_button", - height: 30, - textAlign: "center", - hgap: 20 - }) - }); - - this.buttons.on(BI.ButtonGroup.EVENT_CHANGE, function(){ - self.model.set("child", this.getValue()[0]); - }); - - return BI.createWidget({ - type: "bi.vertical", - vgap: 20, - items: [{ - type: "bi.center", - items: [this.buttons], - height: 30 - }, this.text] - }); - }, - - _showModelData: function(){ - this.text.setText("子级Model层数据: " + JSON.stringify(this.model.toJSON())); - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.center", - element: vessel, - items: [this._createOuter()] - }); - this._showModelData(); - } -}); - - -ChangeInnerModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(ChangeInnerModel.superclass._defaultConfig.apply(this, arguments),{ - - }) - }, - - _static: function(){ - return { - items: [{ - text: "Type-1", - value: "First", - cls: "type-first mvc-button" - }, { - text: "Type-2", - value: "Second", - cls: "type-second mvc-button" - }, { - text: "Type-3", - value: "third", - cls: "type-third mvc-button" - }] - } - }, - - _init: function(){ - ChangeInnerModel.superclass._init.apply(this, arguments); - } - -}); - -Demo.Func = BI.inherit(BI.Widget, { - render: function () { - var view = BI.View.createView("/change", {}, { - element: this - }); - view.populate(); - }, - - mounted: function () { - } -}); -BI.shortcut("demo.change", Demo.Func);//local函数 -LocalView = BI.inherit(BI.View, { - _defaultConfig: function(){ - return BI.extend(LocalView.superclass._defaultConfig.apply(this, arguments),{ - baseCls: "bi-local" - }) - }, - - _init: function(){ - LocalView.superclass._init.apply(this, arguments); - this.buttons = {}; - }, - - _addElement2Vessel: function(id){ - var self = this; - this.buttons[id] = this.elementVessel.addItem({ - type: "bi.text_button", - text: "Button:" + id, - width: 180, - height: 22, - cls: "delete-button button", - handler: function(){ - self.set("delete", id); - } - }) - }, - - _deleteElement: function(id){ - this.buttons[id] && this.buttons[id].destroy(); - delete this.buttons[id]; - }, - - _createTop: function(){ - var self = this; - this.elementVessel = BI.createWidget({ - type: "bi.left", - height: 200, - cls: "vessel-border", - scrollable: true, - vgap: 10, - hgap: 10 - }); - - return BI.createWidget({ - type: "bi.vertical", - items: [ - { - el: { - type: "bi.text_button", - text: "点击添加元素", - cls: "top-button", - handler: function(){ - self.model.set("add", true); - }, - height: 30 - } - }, - this.elementVessel - ] - }) - }, - - _showModelData: function(){ - this.text.setText(JSON.stringify(this.model.toJSON())); - }, - - _createCenter: function(){ - var modelData = BI.createWidget({ - type: "bi.center", - vgap: 10, - hgap: 10, - cls: "vessel-border", - height: 200, - items: [{ - el: this.text = BI.createWidget({ - type: "bi.label", - hgap: 30, - textHeight: 30, - whiteSpace: "normal" - }) - }] - }); - - return BI.createWidget({ - type: "bi.vertical", - items: [ - { - el: { - type: "bi.label", - cls: "bottom-label", - text: "Model层数据", - height: 30 - } - }, - modelData - ] - }) - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.vertical", - element: vessel, - items: [{ - el :this._createTop() - },{ - el : this._createCenter() - }], - hgap: 50, - vgap: 20 - }); - - this._showModelData(); - }, - - local: function(){ - if(this.model.has("add")){ - var add = this.model.get("add"); - this._addElement2Vessel(this.model.getEditing()); - this._showModelData(); - return true; - } - if(this.model.has("delete")){ - var id = this.model.get("delete"); - this._deleteElement(id); - this._showModelData(); - return true; - } - return false; - } -}); - -LocalModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(LocalModel.superclass._defaultConfig.apply(this, arguments),{ - - }) - }, - - _init: function(){ - LocalModel.superclass._init.apply(this, arguments); - }, - - local: function(){ - if(this.has("add")){ - this.get("add"); - var id = BI.UUID(); - this.set(id, "这是新增的属性:"+id); - this.setEditing(id); - return true; - } - if(this.has("delete")){ - var id = this.get("delete"); - this.unset(id); - return true; - } - return false; - } - -}); - -Demo.Func = BI.inherit(BI.Widget, { - render: function () { - var view = BI.View.createView("/local", {}, { - element: this - }); - view.populate(); - }, - - mounted: function () { - } -}); -BI.shortcut("demo.local", Demo.Func);//set、get函数 -SetGetView = BI.inherit(BI.View, { - _defaultConfig: function () { - return BI.extend(SetGetView.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-set-get" - }) - }, - - _init: function () { - SetGetView.superclass._init.apply(this, arguments); - }, - - change: function (changed) { - this._showModelData(); - }, - - _createLeft: function () { - var self = this; - return (this.left = BI.createWidget({ - type: "bi.border", - items: { - north: { - el: { - type: "bi.label", - cls: "left-title", - text: "get、set用法:", - height: 30 - }, - height: 30 - }, - center: { - el: { - type: "bi.button_group", - items: BI.createItems(this.model.get("arr"), { - type: "bi.text_button", - cls: "left-nav", - height: 30, - handler: function (v) { - self.model.set("click", v); - } - }), - layouts: [{ - type: "bi.vertical" - }] - } - } - } - })) - }, - - _showModelData: function () { - this.text.setText(JSON.stringify(this.model.toJSON())); - }, - - _createRight: function () { - return (this.right = BI.createWidget({ - type: "bi.border", - items: { - north: { - el: { - type: "bi.label", - cls: "right-title", - text: "Model层数据", - height: 30 - }, - height: 30 - }, - center: { - el: this.text = BI.createWidget({ - type: "bi.label", - whiteSpace: "normal", - textHeight: 50 - }) - } - } - })) - }, - - render: function (vessel) { - BI.createWidget({ - type: "bi.center", - element: vessel, - items: [{ - el: this._createLeft() - }, { - el: this._createRight() - }], - hgap: 50, - vgap: 100 - }) - this._showModelData(); - } -}) - -SetGetModel = BI.inherit(BI.Model, { - _defaultConfig: function () { - return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments), { - arr: [ - {text: "item1", value: 1}, - {text: "item2", value: 2}, - {text: "item3", value: 3}, - {text: "item4", value: 4}, - {text: "item5", value: 5}, - {text: "item6", value: 6}, - {text: "item7", value: 7}, - {text: "item8", value: 8} - ] - }) - }, - - _init: function () { - SetGetModel.superclass._init.apply(this, arguments); - } - -}) - - -Demo.Func = BI.inherit(BI.Widget, { - render: function () { - var view = BI.View.createView("/setget", {}, { - element: this - }); - view.populate(); - }, - - mounted: function () { - } -}); -BI.shortcut("demo.setget", Demo.Func);//skipTo 函数 -SkipToView = BI.inherit(BI.View, { - _defaultConfig: function(){ - return BI.extend(SkipToView.superclass._defaultConfig.apply(this, arguments),{ - baseCls: "bi-skip-to" - }) - }, - - _init: function(){ - SkipToView.superclass._init.apply(this, arguments); - }, - - _createNav: function(){ - var self = this; - var nav = BI.createWidget({ - type: "bi.button_group", - cls: "top-nav", - items: BI.createItems(this.model.get("items"), { - type: "bi.text_button", - height: 30, - textAlign: "center", - hgap: 20 - }), - layouts: [{ - type: "bi.left", - height: 40, - vgap: 5, - hgap: 3 - }] - }); - nav.on(BI.ButtonGroup.EVENT_CHANGE, function(){ - self.skipTo(this.getValue()[0], "pane", this.getValue()[0]); - }); - return nav; - }, - - _createPane: function(){ - var pane = BI.createWidget({ - type:"bi.center", - cls: "center-pane", - height: 200 - }); - this.addSubVessel("pane", pane, { - defaultShowName: "green" - }); - return pane; - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.vertical", - element: vessel, - items: [this._createNav(), this._createPane()], - vgap: 10, - hgap: 10 - }) - }, - - refresh: function(){ - this.skipTo("green", "pane", "green"); - } -}); - -SkipToModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(SkipToModel.superclass._defaultConfig.apply(this, arguments),{ - "red": { - text: "hotpink" - },"blue": { - text: "cornflowerblue" - },"green": { - text: "darkcyan" - },"yellow": { - text: "darkgoldenrod" - } - }) - }, - _static: function(){ - return { - items: [{ - text: "hotpink", - value: "red", - cls: "red-pane mvc-button" - }, { - text: "cornflowerblue", - value: "blue", - cls: "blue-pane mvc-button" - }, { - text: "darkcyan", - value: "green", - cls: "green-pane mvc-button", - selected: true - }, { - text: "darkgoldenrod", - value: "yellow", - cls: "yellow-pane mvc-button" - }] - } - }, - - _init: function(){ - SkipToModel.superclass._init.apply(this, arguments); - } -}); - -//Red pane #FF69B4 -SkipToRedView = BI.inherit(BI.View, { - _init: function(){ - SkipToRedView.superclass._init.apply(this, arguments); - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.absolute", - element: vessel, - cls: "red-pane", - items: [{ - el: { - type: "bi.label", - text: "Model Data: " + JSON.stringify(this.model.toJSON()), - hgap: 20, - height: 26 - } - }] - }) - } - -}); - -SkipToRedModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments),{ - - }) - }, - - _init: function(){ - SkipToRedModel.superclass._init.apply(this, arguments); - } -}); - -//Blue pane #6495ED -SkipToBlueView = BI.inherit(BI.View, { - _init: function(){ - SkipToBlueView.superclass._init.apply(this, arguments); - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.absolute", - element: vessel, - cls: "blue-pane", - items: [{ - el: { - type: "bi.label", - text: "Model Data: " + JSON.stringify(this.model.toJSON()), - hgap: 20, - height: 26 - }, - left: 0, - right: 0, - top: 0, - bottom: 0 - }] - }) - } -}); - -SkipToBlueModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments),{ - }) - }, - - _init: function(){ - SkipToGreenModel.superclass._init.apply(this, arguments); - } -}); - -//Dark green pane #008B8B -SkipToGreenView = BI.inherit(BI.View, { - _init: function(){ - SkipToGreenView.superclass._init.apply(this, arguments); - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.absolute", - element: vessel, - cls: "green-pane", - items: [{ - el:{ - type: "bi.label", - text: "Model Data: " + JSON.stringify(this.model.toJSON()), - hgap: 20, - height: 26 - }, - left: 0, - right: 0, - top: 0, - bottom: 0 - }] - }) - } -}); - -SkipToGreenModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments),{ - }) - }, - - _init: function(){ - SkipToGreenModel.superclass._init.apply(this, arguments); - } -}); - -//Dark yellow pane #B8860B -SkipToYellowView = BI.inherit(BI.View, { - _init: function(){ - SkipToYellowView.superclass._init.apply(this, arguments); - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.absolute", - element: vessel, - cls: "yellow-pane", - items: [{ - el:{ - type: "bi.label", - text: "Model Data: " + JSON.stringify(this.model.toJSON()), - hgap: 20, - height: 26 - }, - left: 0, - right: 0, - top: 0, - bottom: 0 - }] - }) - } -}); - -SkipToYellowModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments),{ - }) - }, - - _init: function(){ - SkipToYellowModel.superclass._init.apply(this, arguments); - } -}); - -Demo.Func = BI.inherit(BI.Widget, { - render: function () { - var view = BI.View.createView("/skipTo", {}, { - element: this - }); - view.populate(); - }, - - mounted: function () { - } -}); -BI.shortcut("demo.skipTo", Demo.Func); -//splice和duplicate函数 -SpliceDuplicateView = BI.inherit(BI.View, { - _defaultConfig: function () { - return BI.extend(SpliceDuplicateView.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-splice-duplicate" - }) - }, - - _init: function () { - SpliceDuplicateView.superclass._init.apply(this, arguments); - this.children = {}; - }, - - splice: function (old, key1, key2) { - this.children[key1].destroy(); - delete this.children[key1]; - this._showModelData(); - }, - - duplicate: function (copy, key1, key2) { - this.add(copy); - this._showModelData(); - }, - - _showModelData: function () { - //这里只是为了输出this.model.data 原则上是不允许这么调用的 - this.text.setText("父级数据:" + JSON.stringify(this.model.data)); - }, - - render: function (vessel) { - this.text = BI.createWidget({ - type: "bi.label", - height: 50, - cls: "superiors-label" - }); - this.container = BI.createWidget({ - type: "bi.vertical", - element: vessel, - items: [this.text], - hgap: 100, - vgap: 10 - }); - this._showModelData(); - }, - - add: function (id) { - this.children[id] = BI.createWidget({ - type: "bi.center", - hgap: 10, - vgap: 10 - }); - this.addSubVessel(id, this.children[id], { - defaultShowName: "sdSub" - }); - this.skipTo("sdSub", id, id); - this.container.addItem(this.children[id]); - }, - - refresh: function () { - var self = this; - BI.each(this.model.toJSON(), function (key, value) { - if (!self.children[key]) { - self.add(key); - } - }) - } -}); - -SpliceDuplicateModel = BI.inherit(BI.Model, { - _defaultConfig: function () { - return BI.extend(SpliceDuplicateModel.superclass._defaultConfig.apply(this, arguments), { - "1": { - name: "名字" - } - }) - }, - - splice: function (key1) { - delete this.data[key1]; - }, - - similar: function (value, key1) { - value.name = BI.Func.createDistinctName(this.data, this.get(key1).name); - return value; - }, - - duplicate: function (copy, key1) { - this.data[copy] = this.get(copy); - }, - - _init: function () { - SpliceDuplicateModel.superclass._init.apply(this, arguments); - }, - - refresh: function () { - this.data = BI.deepClone(this.toJSON()); - } -}); - -SDSubView = BI.inherit(BI.View, { - _defaultConfig: function () { - return SDSubView.superclass._defaultConfig.apply(this, arguments); - }, - - _init: function () { - SDSubView.superclass._init.apply(this, arguments); - }, - - render: function (vessel) { - var self = this; - BI.createWidget({ - type: "bi.center", - element: vessel, - cls: "sd-child", - height: 30, - items: [{ - type: "bi.text_button", - height: 30, - text: "复制 " + this.model.get("name") + " , 数据:" + JSON.stringify(this.model.toJSON()), - cls: "right-button-add", - handler: function () { - self.model.copy(); - } - }, { - type: "bi.text_button", - height: 30, - text: "删除", - cls: "right-button-del", - handler: function () { - self.model.destroy(); - } - }] - }) - } -}); - -SDSubModel = BI.inherit(BI.Model, { - _defaultConfig: function () { - return BI.extend(SDSubModel.superclass._defaultConfig.apply(this, arguments), {}); - }, - - _init: function () { - SDSubModel.superclass._init.apply(this, arguments); - } -}); - -Demo.Func = BI.inherit(BI.Widget, { - render: function () { - var view = BI.View.createView("/spliceDuplicate", {}, { - element: this - }); - view.populate(); - }, - - mounted: function () { - } -}); -BI.shortcut("demo.spliceDuplicate", Demo.Func); -TmpView = BI.inherit(BI.View, { - _defaultConfig: function(){ - return BI.extend(TmpView.superclass._defaultConfig.apply(this, arguments),{ - baseCls: "bi-tmp" - }) - }, - - _init: function(){ - TmpView.superclass._init.apply(this, arguments); - }, - - change: function(changed){ - if(changed.data1){ - this._showModelData(); - } - }, - - _showModelData: function(){ - this.text.setText("父级Model层数据为:"+JSON.stringify(this.model.toJSON())); - }, - - _createMain: function(){ - var self = this; - return BI.createWidget({ - type: "bi.border", - items: { - west: { - el: { - type: "bi.vertical", - vgap: 10, - items: [{ - el: (this.text = BI.createWidget({ - type: "bi.label", - whiteSpace: "normal" - })) - }, { - el: { - type: "bi.text_button", - cls: "tmp-button mvc-button", - text: "点击触发事件tmp('data1', {child: {type: {value: \"临时数据\"}}})", - height: 30, - handler: function(){ - self.model.tmp("data1", { - child: { - type: { - value: "临时数据" - } - } - }) - } - } - }, { - el: { - type: "bi.text_button", - cls: "tmp-button mvc-button", - text: "点击触发事件submit", - height: 30, - handler: function(){ - self.model.submit(); - } - } - }, { - el: { - type: "bi.text_button", - cls: "tmp-button mvc-button", - text: "点击跳转到右方", - height: 30, - handler: function(){ - self.addSubVessel("test", self.center).skipTo("child", "test", "data1"); - } - } - }] - }, - width: 200 - }, - center: { - el: (this.center = BI.createWidget()) - } - } - }) - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.center", - element: vessel, - items: [{ - el: this._createMain() - }], - hgap: 50, - vgap: 100 - }) - }, - - refresh: function(){ - this._showModelData(); - } -}) - -TmpModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(TmpModel.superclass._defaultConfig.apply(this, arguments),{ - data1: { - child: { - type: { - value: "这是一个测试数据" - } - } - }, - data2: "test" - }) - }, - - _init: function(){ - TmpModel.superclass._init.apply(this, arguments); - } - -}) - -TmpChildView = BI.inherit(BI.View, { - _defaultConfig: function(){ - return BI.extend(TmpChildView.superclass._defaultConfig.apply(this, arguments),{ - baseCls: "bi-tmp-child" - }) - }, - - _init: function(){ - TmpChildView.superclass._init.apply(this, arguments); - }, - - change: function(changed){ - if(changed.child){ - this._showModelData(); - } - }, - - _showModelData: function(){ - this.text.setText("子级Model层数据为:"+JSON.stringify(this.model.toJSON())); - }, - - _createMain: function(){ - var self = this; - return BI.createWidget({ - type: "bi.border", - items: { - west: { - el: { - type: "bi.vertical", - vgap: 10, - items: [{ - el: (this.text = BI.createWidget({ - type: "bi.label", - whiteSpace: "normal" - })) - }, { - el: { - type: "bi.text_button", - cls: "tmp-button mvc-button", - text: "点击触发事件set", - height: 30, - handler: function(){ - self.set("child", { - type: { - value: "值改变了" - } - }) - } - } - }, { - el: { - type: "bi.text_button", - cls: "tmp-button mvc-button", - text: "点击跳转到右方", - height: 30, - handler: function(){ - self.addSubVessel("test", self.center).skipTo("child", "test", "child"); - } - } - }] - }, - width: 200 - }, - center: { - el: (this.center = BI.createWidget()) - } - } - }) - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.center", - element: vessel, - items: [{ - el: this._createMain() - }], - hgap: 50 - }) - }, - - refresh: function(){ - this._showModelData(); - } -}) - -TmpChildModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(TmpChildModel.superclass._defaultConfig.apply(this, arguments),{ - - }) - }, - - _init: function(){ - TmpChildModel.superclass._init.apply(this, arguments); - } - -}) -TmpChildChildView = BI.inherit(BI.View, { - _defaultConfig: function(){ - return BI.extend(TmpChildChildView.superclass._defaultConfig.apply(this, arguments),{ - baseCls: "bi-tmp-child-child" - }) - }, - - _init: function(){ - TmpChildChildView.superclass._init.apply(this, arguments); - }, - - change: function(changed){ - if(changed.type){ - this._showModelData(); - } - }, - - _showModelData: function(){ - this.text.setText("叶节点数据为:"+JSON.stringify(this.model.toJSON())); - }, - - _createMain: function(){ - return (this.text = BI.createWidget({ - type: "bi.label", - whiteSpace: "normal" - })) - }, - - render: function(vessel){ - BI.createWidget({ - type: "bi.center", - element: vessel, - items: [{ - el: this._createMain() - }], - hgap: 50 - }) - }, - - refresh: function(){ - this._showModelData(); - } -}) - -TmpChildChildModel = BI.inherit(BI.Model, { - _defaultConfig: function(){ - return BI.extend(TmpChildChildModel.superclass._defaultConfig.apply(this, arguments),{ - - }) - }, - - _init: function(){ - TmpChildChildModel.superclass._init.apply(this, arguments); - } - -}) - -Demo.Func = BI.inherit(BI.Widget, { - render: function () { - var view = BI.View.createView("/tmp", {}, { - element: this - }); - view.populate(); - }, - - mounted: function () { - } -}); -BI.shortcut("demo.tmp", Demo.Func); +BI.shortcut("demo.face", Demo.Face);//change函数 +ChangeView = BI.inherit(BI.View, { + _defaultConfig: function(){ + return BI.extend(ChangeView.superclass._defaultConfig.apply(this, arguments),{ + baseCls: "bi-change" + }) + }, + + _init: function(){ + ChangeView.superclass._init.apply(this, arguments); + }, + + change: function(changed){ + if(changed.child){ + this._showModelData(); + } + if(changed.superiors){ + this._showModelData(); + } + }, + + _showModelData: function(){ + this.outerText.setText("父级Model层数据: " + JSON.stringify(this.model.toJSON())); + }, + + _createOuter: function(){ + this.outerText = BI.createWidget({ + type: "bi.label", + cls: "outer-text", + whiteSpace: "normal" + }); + + return BI.createWidget({ + type: "bi.border", + items: { + north: { + el: this.outerText, + height: 50 + }, + center: this._createInner() + } + }); + }, + + _createInner: function(){ + var innerPane = BI.createWidget({ + type: "bi.absolute", + cls: "inner" + }); + this.addSubVessel("innerPane", innerPane, { + defaultShowName: "inner" + }); + return innerPane; + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.center", + element: vessel, + items: [this._createOuter()], + hgap: 100, + vgap: 100 + }); + + this._showModelData(); + }, + + refresh: function(){ + this.skipTo("inner", "innerPane", "superiors"); + } +}); + +ChangeModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(ChangeModel.superclass._defaultConfig.apply(this, arguments),{ + superiors: { + child: "default" + }, + child: "default" + }) + }, + + _init: function(){ + ChangeModel.superclass._init.apply(this, arguments); + }, + + change: function(changed){ + if(changed.superiors){ + this.set("child", changed.superiors.child); + } + } +}); + +//ChangeView 的子级 +ChangeInnerView = BI.inherit(BI.View, { + _init: function(){ + ChangeInnerView.superclass._init.apply(this, arguments); + }, + + change: function(changed){ + if(changed.child){ + this._showModelData(); + } + }, + + _createOuter: function(){ + var self = this; + this.text = BI.createWidget({ + type: "bi.label", + height: 26 + }); + + this.buttons = BI.createWidget({ + type: "bi.button_group", + items: BI.createItems(this.model.get("items"), { + type: "bi.text_button", + height: 30, + textAlign: "center", + hgap: 20 + }) + }); + + this.buttons.on(BI.ButtonGroup.EVENT_CHANGE, function(){ + self.model.set("child", this.getValue()[0]); + }); + + return BI.createWidget({ + type: "bi.vertical", + vgap: 20, + items: [{ + type: "bi.center", + items: [this.buttons], + height: 30 + }, this.text] + }); + }, + + _showModelData: function(){ + this.text.setText("子级Model层数据: " + JSON.stringify(this.model.toJSON())); + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.center", + element: vessel, + items: [this._createOuter()] + }); + this._showModelData(); + } +}); + + +ChangeInnerModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(ChangeInnerModel.superclass._defaultConfig.apply(this, arguments),{ + + }) + }, + + _static: function(){ + return { + items: [{ + text: "Type-1", + value: "First", + cls: "type-first mvc-button" + }, { + text: "Type-2", + value: "Second", + cls: "type-second mvc-button" + }, { + text: "Type-3", + value: "third", + cls: "type-third mvc-button" + }] + } + }, + + _init: function(){ + ChangeInnerModel.superclass._init.apply(this, arguments); + } + +}); + +Demo.Func = BI.inherit(BI.Widget, { + render: function () { + var view = BI.View.createView("/change", {}, { + element: this + }); + view.populate(); + }, + + mounted: function () { + } +}); +BI.shortcut("demo.change", Demo.Func);//local函数 +LocalView = BI.inherit(BI.View, { + _defaultConfig: function(){ + return BI.extend(LocalView.superclass._defaultConfig.apply(this, arguments),{ + baseCls: "bi-local" + }) + }, + + _init: function(){ + LocalView.superclass._init.apply(this, arguments); + this.buttons = {}; + }, + + _addElement2Vessel: function(id){ + var self = this; + this.buttons[id] = this.elementVessel.addItem({ + type: "bi.text_button", + text: "Button:" + id, + width: 180, + height: 22, + cls: "delete-button button", + handler: function(){ + self.set("delete", id); + } + }) + }, + + _deleteElement: function(id){ + this.buttons[id] && this.buttons[id].destroy(); + delete this.buttons[id]; + }, + + _createTop: function(){ + var self = this; + this.elementVessel = BI.createWidget({ + type: "bi.left", + height: 200, + cls: "vessel-border", + scrollable: true, + vgap: 10, + hgap: 10 + }); + + return BI.createWidget({ + type: "bi.vertical", + items: [ + { + el: { + type: "bi.text_button", + text: "点击添加元素", + cls: "top-button", + handler: function(){ + self.model.set("add", true); + }, + height: 30 + } + }, + this.elementVessel + ] + }) + }, + + _showModelData: function(){ + this.text.setText(JSON.stringify(this.model.toJSON())); + }, + + _createCenter: function(){ + var modelData = BI.createWidget({ + type: "bi.center", + vgap: 10, + hgap: 10, + cls: "vessel-border", + height: 200, + items: [{ + el: this.text = BI.createWidget({ + type: "bi.label", + hgap: 30, + textHeight: 30, + whiteSpace: "normal" + }) + }] + }); + + return BI.createWidget({ + type: "bi.vertical", + items: [ + { + el: { + type: "bi.label", + cls: "bottom-label", + text: "Model层数据", + height: 30 + } + }, + modelData + ] + }) + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.vertical", + element: vessel, + items: [{ + el :this._createTop() + },{ + el : this._createCenter() + }], + hgap: 50, + vgap: 20 + }); + + this._showModelData(); + }, + + local: function(){ + if(this.model.has("add")){ + var add = this.model.get("add"); + this._addElement2Vessel(this.model.getEditing()); + this._showModelData(); + return true; + } + if(this.model.has("delete")){ + var id = this.model.get("delete"); + this._deleteElement(id); + this._showModelData(); + return true; + } + return false; + } +}); + +LocalModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(LocalModel.superclass._defaultConfig.apply(this, arguments),{ + + }) + }, + + _init: function(){ + LocalModel.superclass._init.apply(this, arguments); + }, + + local: function(){ + if(this.has("add")){ + this.get("add"); + var id = BI.UUID(); + this.set(id, "这是新增的属性:"+id); + this.setEditing(id); + return true; + } + if(this.has("delete")){ + var id = this.get("delete"); + this.unset(id); + return true; + } + return false; + } + +}); + +Demo.Func = BI.inherit(BI.Widget, { + render: function () { + var view = BI.View.createView("/local", {}, { + element: this + }); + view.populate(); + }, + + mounted: function () { + } +}); +BI.shortcut("demo.local", Demo.Func);//set、get函数 +SetGetView = BI.inherit(BI.View, { + _defaultConfig: function () { + return BI.extend(SetGetView.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-set-get" + }) + }, + + _init: function () { + SetGetView.superclass._init.apply(this, arguments); + }, + + change: function (changed) { + this._showModelData(); + }, + + _createLeft: function () { + var self = this; + return (this.left = BI.createWidget({ + type: "bi.border", + items: { + north: { + el: { + type: "bi.label", + cls: "left-title", + text: "get、set用法:", + height: 30 + }, + height: 30 + }, + center: { + el: { + type: "bi.button_group", + items: BI.createItems(this.model.get("arr"), { + type: "bi.text_button", + cls: "left-nav", + height: 30, + handler: function (v) { + self.model.set("click", v); + } + }), + layouts: [{ + type: "bi.vertical" + }] + } + } + } + })) + }, + + _showModelData: function () { + this.text.setText(JSON.stringify(this.model.toJSON())); + }, + + _createRight: function () { + return (this.right = BI.createWidget({ + type: "bi.border", + items: { + north: { + el: { + type: "bi.label", + cls: "right-title", + text: "Model层数据", + height: 30 + }, + height: 30 + }, + center: { + el: this.text = BI.createWidget({ + type: "bi.label", + whiteSpace: "normal", + textHeight: 50 + }) + } + } + })) + }, + + render: function (vessel) { + BI.createWidget({ + type: "bi.center", + element: vessel, + items: [{ + el: this._createLeft() + }, { + el: this._createRight() + }], + hgap: 50, + vgap: 100 + }) + this._showModelData(); + } +}) + +SetGetModel = BI.inherit(BI.Model, { + _defaultConfig: function () { + return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments), { + arr: [ + {text: "item1", value: 1}, + {text: "item2", value: 2}, + {text: "item3", value: 3}, + {text: "item4", value: 4}, + {text: "item5", value: 5}, + {text: "item6", value: 6}, + {text: "item7", value: 7}, + {text: "item8", value: 8} + ] + }) + }, + + _init: function () { + SetGetModel.superclass._init.apply(this, arguments); + } + +}) + + +Demo.Func = BI.inherit(BI.Widget, { + render: function () { + var view = BI.View.createView("/setget", {}, { + element: this + }); + view.populate(); + }, + + mounted: function () { + } +}); +BI.shortcut("demo.setget", Demo.Func);//skipTo 函数 +SkipToView = BI.inherit(BI.View, { + _defaultConfig: function(){ + return BI.extend(SkipToView.superclass._defaultConfig.apply(this, arguments),{ + baseCls: "bi-skip-to" + }) + }, + + _init: function(){ + SkipToView.superclass._init.apply(this, arguments); + }, + + _createNav: function(){ + var self = this; + var nav = BI.createWidget({ + type: "bi.button_group", + cls: "top-nav", + items: BI.createItems(this.model.get("items"), { + type: "bi.text_button", + height: 30, + textAlign: "center", + hgap: 20 + }), + layouts: [{ + type: "bi.left", + height: 40, + vgap: 5, + hgap: 3 + }] + }); + nav.on(BI.ButtonGroup.EVENT_CHANGE, function(){ + self.skipTo(this.getValue()[0], "pane", this.getValue()[0]); + }); + return nav; + }, + + _createPane: function(){ + var pane = BI.createWidget({ + type:"bi.center", + cls: "center-pane", + height: 200 + }); + this.addSubVessel("pane", pane, { + defaultShowName: "green" + }); + return pane; + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.vertical", + element: vessel, + items: [this._createNav(), this._createPane()], + vgap: 10, + hgap: 10 + }) + }, + + refresh: function(){ + this.skipTo("green", "pane", "green"); + } +}); + +SkipToModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(SkipToModel.superclass._defaultConfig.apply(this, arguments),{ + "red": { + text: "hotpink" + },"blue": { + text: "cornflowerblue" + },"green": { + text: "darkcyan" + },"yellow": { + text: "darkgoldenrod" + } + }) + }, + _static: function(){ + return { + items: [{ + text: "hotpink", + value: "red", + cls: "red-pane mvc-button" + }, { + text: "cornflowerblue", + value: "blue", + cls: "blue-pane mvc-button" + }, { + text: "darkcyan", + value: "green", + cls: "green-pane mvc-button", + selected: true + }, { + text: "darkgoldenrod", + value: "yellow", + cls: "yellow-pane mvc-button" + }] + } + }, + + _init: function(){ + SkipToModel.superclass._init.apply(this, arguments); + } +}); + +//Red pane #FF69B4 +SkipToRedView = BI.inherit(BI.View, { + _init: function(){ + SkipToRedView.superclass._init.apply(this, arguments); + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.absolute", + element: vessel, + cls: "red-pane", + items: [{ + el: { + type: "bi.label", + text: "Model Data: " + JSON.stringify(this.model.toJSON()), + hgap: 20, + height: 26 + } + }] + }) + } + +}); + +SkipToRedModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments),{ + + }) + }, + + _init: function(){ + SkipToRedModel.superclass._init.apply(this, arguments); + } +}); + +//Blue pane #6495ED +SkipToBlueView = BI.inherit(BI.View, { + _init: function(){ + SkipToBlueView.superclass._init.apply(this, arguments); + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.absolute", + element: vessel, + cls: "blue-pane", + items: [{ + el: { + type: "bi.label", + text: "Model Data: " + JSON.stringify(this.model.toJSON()), + hgap: 20, + height: 26 + }, + left: 0, + right: 0, + top: 0, + bottom: 0 + }] + }) + } +}); + +SkipToBlueModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments),{ + }) + }, + + _init: function(){ + SkipToGreenModel.superclass._init.apply(this, arguments); + } +}); + +//Dark green pane #008B8B +SkipToGreenView = BI.inherit(BI.View, { + _init: function(){ + SkipToGreenView.superclass._init.apply(this, arguments); + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.absolute", + element: vessel, + cls: "green-pane", + items: [{ + el:{ + type: "bi.label", + text: "Model Data: " + JSON.stringify(this.model.toJSON()), + hgap: 20, + height: 26 + }, + left: 0, + right: 0, + top: 0, + bottom: 0 + }] + }) + } +}); + +SkipToGreenModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments),{ + }) + }, + + _init: function(){ + SkipToGreenModel.superclass._init.apply(this, arguments); + } +}); + +//Dark yellow pane #B8860B +SkipToYellowView = BI.inherit(BI.View, { + _init: function(){ + SkipToYellowView.superclass._init.apply(this, arguments); + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.absolute", + element: vessel, + cls: "yellow-pane", + items: [{ + el:{ + type: "bi.label", + text: "Model Data: " + JSON.stringify(this.model.toJSON()), + hgap: 20, + height: 26 + }, + left: 0, + right: 0, + top: 0, + bottom: 0 + }] + }) + } +}); + +SkipToYellowModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(SetGetModel.superclass._defaultConfig.apply(this, arguments),{ + }) + }, + + _init: function(){ + SkipToYellowModel.superclass._init.apply(this, arguments); + } +}); + +Demo.Func = BI.inherit(BI.Widget, { + render: function () { + var view = BI.View.createView("/skipTo", {}, { + element: this + }); + view.populate(); + }, + + mounted: function () { + } +}); +BI.shortcut("demo.skipTo", Demo.Func); +//splice和duplicate函数 +SpliceDuplicateView = BI.inherit(BI.View, { + _defaultConfig: function () { + return BI.extend(SpliceDuplicateView.superclass._defaultConfig.apply(this, arguments), { + baseCls: "bi-splice-duplicate" + }) + }, + + _init: function () { + SpliceDuplicateView.superclass._init.apply(this, arguments); + this.children = {}; + }, + + splice: function (old, key1, key2) { + this.children[key1].destroy(); + delete this.children[key1]; + this._showModelData(); + }, + + duplicate: function (copy, key1, key2) { + this.add(copy); + this._showModelData(); + }, + + _showModelData: function () { + //这里只是为了输出this.model.data 原则上是不允许这么调用的 + this.text.setText("父级数据:" + JSON.stringify(this.model.data)); + }, + + render: function (vessel) { + this.text = BI.createWidget({ + type: "bi.label", + height: 50, + cls: "superiors-label" + }); + this.container = BI.createWidget({ + type: "bi.vertical", + element: vessel, + items: [this.text], + hgap: 100, + vgap: 10 + }); + this._showModelData(); + }, + + add: function (id) { + this.children[id] = BI.createWidget({ + type: "bi.center", + hgap: 10, + vgap: 10 + }); + this.addSubVessel(id, this.children[id], { + defaultShowName: "sdSub" + }); + this.skipTo("sdSub", id, id); + this.container.addItem(this.children[id]); + }, + + refresh: function () { + var self = this; + BI.each(this.model.toJSON(), function (key, value) { + if (!self.children[key]) { + self.add(key); + } + }) + } +}); + +SpliceDuplicateModel = BI.inherit(BI.Model, { + _defaultConfig: function () { + return BI.extend(SpliceDuplicateModel.superclass._defaultConfig.apply(this, arguments), { + "1": { + name: "名字" + } + }) + }, + + splice: function (key1) { + delete this.data[key1]; + }, + + similar: function (value, key1) { + value.name = BI.Func.createDistinctName(this.data, this.get(key1).name); + return value; + }, + + duplicate: function (copy, key1) { + this.data[copy] = this.get(copy); + }, + + _init: function () { + SpliceDuplicateModel.superclass._init.apply(this, arguments); + }, + + refresh: function () { + this.data = BI.deepClone(this.toJSON()); + } +}); + +SDSubView = BI.inherit(BI.View, { + _defaultConfig: function () { + return SDSubView.superclass._defaultConfig.apply(this, arguments); + }, + + _init: function () { + SDSubView.superclass._init.apply(this, arguments); + }, + + render: function (vessel) { + var self = this; + BI.createWidget({ + type: "bi.center", + element: vessel, + cls: "sd-child", + height: 30, + items: [{ + type: "bi.text_button", + height: 30, + text: "复制 " + this.model.get("name") + " , 数据:" + JSON.stringify(this.model.toJSON()), + cls: "right-button-add", + handler: function () { + self.model.copy(); + } + }, { + type: "bi.text_button", + height: 30, + text: "删除", + cls: "right-button-del", + handler: function () { + self.model.destroy(); + } + }] + }) + } +}); + +SDSubModel = BI.inherit(BI.Model, { + _defaultConfig: function () { + return BI.extend(SDSubModel.superclass._defaultConfig.apply(this, arguments), {}); + }, + + _init: function () { + SDSubModel.superclass._init.apply(this, arguments); + } +}); + +Demo.Func = BI.inherit(BI.Widget, { + render: function () { + var view = BI.View.createView("/spliceDuplicate", {}, { + element: this + }); + view.populate(); + }, + + mounted: function () { + } +}); +BI.shortcut("demo.spliceDuplicate", Demo.Func); +TmpView = BI.inherit(BI.View, { + _defaultConfig: function(){ + return BI.extend(TmpView.superclass._defaultConfig.apply(this, arguments),{ + baseCls: "bi-tmp" + }) + }, + + _init: function(){ + TmpView.superclass._init.apply(this, arguments); + }, + + change: function(changed){ + if(changed.data1){ + this._showModelData(); + } + }, + + _showModelData: function(){ + this.text.setText("父级Model层数据为:"+JSON.stringify(this.model.toJSON())); + }, + + _createMain: function(){ + var self = this; + return BI.createWidget({ + type: "bi.border", + items: { + west: { + el: { + type: "bi.vertical", + vgap: 10, + items: [{ + el: (this.text = BI.createWidget({ + type: "bi.label", + whiteSpace: "normal" + })) + }, { + el: { + type: "bi.text_button", + cls: "tmp-button mvc-button", + text: "点击触发事件tmp('data1', {child: {type: {value: \"临时数据\"}}})", + height: 30, + handler: function(){ + self.model.tmp("data1", { + child: { + type: { + value: "临时数据" + } + } + }) + } + } + }, { + el: { + type: "bi.text_button", + cls: "tmp-button mvc-button", + text: "点击触发事件submit", + height: 30, + handler: function(){ + self.model.submit(); + } + } + }, { + el: { + type: "bi.text_button", + cls: "tmp-button mvc-button", + text: "点击跳转到右方", + height: 30, + handler: function(){ + self.addSubVessel("test", self.center).skipTo("child", "test", "data1"); + } + } + }] + }, + width: 200 + }, + center: { + el: (this.center = BI.createWidget()) + } + } + }) + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.center", + element: vessel, + items: [{ + el: this._createMain() + }], + hgap: 50, + vgap: 100 + }) + }, + + refresh: function(){ + this._showModelData(); + } +}) + +TmpModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(TmpModel.superclass._defaultConfig.apply(this, arguments),{ + data1: { + child: { + type: { + value: "这是一个测试数据" + } + } + }, + data2: "test" + }) + }, + + _init: function(){ + TmpModel.superclass._init.apply(this, arguments); + } + +}) + +TmpChildView = BI.inherit(BI.View, { + _defaultConfig: function(){ + return BI.extend(TmpChildView.superclass._defaultConfig.apply(this, arguments),{ + baseCls: "bi-tmp-child" + }) + }, + + _init: function(){ + TmpChildView.superclass._init.apply(this, arguments); + }, + + change: function(changed){ + if(changed.child){ + this._showModelData(); + } + }, + + _showModelData: function(){ + this.text.setText("子级Model层数据为:"+JSON.stringify(this.model.toJSON())); + }, + + _createMain: function(){ + var self = this; + return BI.createWidget({ + type: "bi.border", + items: { + west: { + el: { + type: "bi.vertical", + vgap: 10, + items: [{ + el: (this.text = BI.createWidget({ + type: "bi.label", + whiteSpace: "normal" + })) + }, { + el: { + type: "bi.text_button", + cls: "tmp-button mvc-button", + text: "点击触发事件set", + height: 30, + handler: function(){ + self.set("child", { + type: { + value: "值改变了" + } + }) + } + } + }, { + el: { + type: "bi.text_button", + cls: "tmp-button mvc-button", + text: "点击跳转到右方", + height: 30, + handler: function(){ + self.addSubVessel("test", self.center).skipTo("child", "test", "child"); + } + } + }] + }, + width: 200 + }, + center: { + el: (this.center = BI.createWidget()) + } + } + }) + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.center", + element: vessel, + items: [{ + el: this._createMain() + }], + hgap: 50 + }) + }, + + refresh: function(){ + this._showModelData(); + } +}) + +TmpChildModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(TmpChildModel.superclass._defaultConfig.apply(this, arguments),{ + + }) + }, + + _init: function(){ + TmpChildModel.superclass._init.apply(this, arguments); + } + +}) +TmpChildChildView = BI.inherit(BI.View, { + _defaultConfig: function(){ + return BI.extend(TmpChildChildView.superclass._defaultConfig.apply(this, arguments),{ + baseCls: "bi-tmp-child-child" + }) + }, + + _init: function(){ + TmpChildChildView.superclass._init.apply(this, arguments); + }, + + change: function(changed){ + if(changed.type){ + this._showModelData(); + } + }, + + _showModelData: function(){ + this.text.setText("叶节点数据为:"+JSON.stringify(this.model.toJSON())); + }, + + _createMain: function(){ + return (this.text = BI.createWidget({ + type: "bi.label", + whiteSpace: "normal" + })) + }, + + render: function(vessel){ + BI.createWidget({ + type: "bi.center", + element: vessel, + items: [{ + el: this._createMain() + }], + hgap: 50 + }) + }, + + refresh: function(){ + this._showModelData(); + } +}) + +TmpChildChildModel = BI.inherit(BI.Model, { + _defaultConfig: function(){ + return BI.extend(TmpChildChildModel.superclass._defaultConfig.apply(this, arguments),{ + + }) + }, + + _init: function(){ + TmpChildChildModel.superclass._init.apply(this, arguments); + } + +}) + +Demo.Func = BI.inherit(BI.Widget, { + render: function () { + var view = BI.View.createView("/tmp", {}, { + element: this + }); + view.populate(); + }, + + mounted: function () { + } +}); +BI.shortcut("demo.tmp", Demo.Func); var model = Fix.define({ name: 1, arr: [{ diff --git a/dist/sliders.css b/dist/sliders.css index 66780294e..a8d9688bb 100644 --- a/dist/sliders.css +++ b/dist/sliders.css @@ -24,15 +24,27 @@ -moz-border-radius: 7px; border-radius: 7px; } -.bi-single-slider-button .slider-button { - cursor: ew-resize; - -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); - -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); - -webkit-border-radius: 7px; - -moz-border-radius: 7px; - border-radius: 7px; -} +.bi-single-slider-button .slider-button { + cursor: ew-resize; + -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + -webkit-border-radius: 7px; + -moz-border-radius: 7px; + border-radius: 7px; +} +.bi-slider-track .gray-track { + background-color: rgba(153, 153, 153, 0.3); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d999999,endColorstr=#4d999999); + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.bi-slider-track .blue-track { + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} .bi-slider-track .gray-track { background-color: rgba(153, 153, 153, 0.3); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d999999,endColorstr=#4d999999); @@ -45,15 +57,3 @@ -moz-border-radius: 3px; border-radius: 3px; } -.bi-slider-track .gray-track { - background-color: rgba(153, 153, 153, 0.3); - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d999999,endColorstr=#4d999999); - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} -.bi-slider-track .blue-track { - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} From 53426900abc768356e4c3d470ca4d5dec1a8bf20 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 30 Oct 2017 16:52:50 +0800 Subject: [PATCH 4/6] update --- demo/js/fix-2.0/demo.js | 5 +++- dist/demo.js | 5 +++- dist/fix/fix.js | 53 ++++++++++++++++++++++++++++++++++++----- 3 files changed, 55 insertions(+), 8 deletions(-) diff --git a/demo/js/fix-2.0/demo.js b/demo/js/fix-2.0/demo.js index fe1d2ce46..f6d30bd71 100644 --- a/demo/js/fix-2.0/demo.js +++ b/demo/js/fix-2.0/demo.js @@ -24,6 +24,9 @@ Demo.Store = BI.inherit(Fix.VM, { computed: { b: function () { return this.comp.c + 1 + }, + c: function () { + return this.comp.name } }, actions: { @@ -39,7 +42,7 @@ Demo.Fix = BI.inherit(BI.Widget, { return new Demo.Store(); }, watch: { - b: function () { + "b&&c||b": function () { debugger; } }, diff --git a/dist/demo.js b/dist/demo.js index 4e6b12974..49edef10a 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -10096,6 +10096,9 @@ Demo.Store = BI.inherit(Fix.VM, { computed: { b: function () { return this.comp.c + 1 + }, + c: function () { + return this.comp.name } }, actions: { @@ -10111,7 +10114,7 @@ Demo.Fix = BI.inherit(BI.Widget, { return new Demo.Store(); }, watch: { - b: function () { + "b&&c||b": function () { debugger; } }, diff --git a/dist/fix/fix.js b/dist/fix/fix.js index 7fc2bbff3..ee896237f 100644 --- a/dist/fix/fix.js +++ b/dist/fix/fix.js @@ -875,6 +875,18 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons return vm.$watch(keyOrFn, handler, options); } + function runBinaryFunction(binarys) { + var expr = ''; + for (var i = 0, len = binarys.length; i < len; i++) { + if (_.isBoolean(binarys[i]) || binarys[i] === '||' || binarys[i] === '&&' || binarys[i] === '(' || binarys[i] === ')') { + expr += binarys[i]; + } else { + expr += 'false'; + } + } + return new Function('return ' + expr)(); + } + var VM = function () { function VM(model) { _classCallCheck(this, VM); @@ -927,13 +939,42 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons } options = options || {}; options.user = true; - var watcher = new Watcher(vm.model, expOrFn, _.bind(cb, vm), options); - if (options.immediate) { - cb.call(vm, watcher.value); + var exps = void 0; + if (_.isFunction(expOrFn) || (exps = expOrFn.match(/[a-zA-Z0-9_.]+|[|][|]|[&][&]|[(]|[)]/g)) && exps.length === 1) { + var watcher = new Watcher(vm.model, expOrFn, _.bind(cb, vm), options); + if (options.immediate) { + cb.call(vm, watcher.value); + } + return function unwatchFn() { + watcher.teardown(); + }; } - return function unwatchFn() { - watcher.teardown(); - }; + var watchers = []; + var fns = exps.slice(); + var complete = false; + _.each(exps, function (exp, i) { + if (exp === '||' || exp === '&&' || exp === '(' || exp === ')') { + return; + } + var watcher = new Watcher(vm.model, exp, function () { + if (complete === true) { + return; + } + fns[i] = true; + if (runBinaryFunction(fns)) { + complete = true; + cb.call(vm); + fns = exps.slice(); + nextTick(function () { + complete = true; + }); + } + }, options); + watchers.push(function unwatchFn() { + watcher.teardown(); + }); + }); + return watchers; }; VM.prototype._init = function _init() {}; From a852815a42e226cea55be469a26c6f0bbc447e22 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 30 Oct 2017 20:49:34 +0800 Subject: [PATCH 5/6] update --- dist/fix/fix.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/dist/fix/fix.js b/dist/fix/fix.js index ee896237f..3b1cacddd 100644 --- a/dist/fix/fix.js +++ b/dist/fix/fix.js @@ -875,10 +875,18 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons return vm.$watch(keyOrFn, handler, options); } + var falsy$1; + var operators = { + '||': falsy$1, + '&&': falsy$1, + '(': falsy$1, + ')': falsy$1 + }; + function runBinaryFunction(binarys) { var expr = ''; for (var i = 0, len = binarys.length; i < len; i++) { - if (_.isBoolean(binarys[i]) || binarys[i] === '||' || binarys[i] === '&&' || binarys[i] === '(' || binarys[i] === ')') { + if (_.isBoolean(binarys[i]) || _.has(operators, binarys[i])) { expr += binarys[i]; } else { expr += 'false'; @@ -940,7 +948,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons options = options || {}; options.user = true; var exps = void 0; - if (_.isFunction(expOrFn) || (exps = expOrFn.match(/[a-zA-Z0-9_.]+|[|][|]|[&][&]|[(]|[)]/g)) && exps.length === 1) { + if (_.isFunction(expOrFn) || !(exps = expOrFn.match(/[a-zA-Z0-9_.]+|[|][|]|[&][&]|[(]|[)]/g)) || exps.length === 1) { var watcher = new Watcher(vm.model, expOrFn, _.bind(cb, vm), options); if (options.immediate) { cb.call(vm, watcher.value); @@ -953,7 +961,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons var fns = exps.slice(); var complete = false; _.each(exps, function (exp, i) { - if (exp === '||' || exp === '&&' || exp === '(' || exp === ')') { + if (_.has(operators, exp)) { return; } var watcher = new Watcher(vm.model, exp, function () { From 05a008e4cbd993e27c6c194dc7e8b17832c0fbb4 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 31 Oct 2017 00:22:59 +0800 Subject: [PATCH 6/6] update --- demo/js/config/fix.js | 22 ++- demo/js/fix-2.0/computed.js | 52 ++++++ demo/js/fix-2.0/define.js | 45 +++++ demo/js/fix-2.0/demo.js | 116 ++++++++----- demo/js/fix-2.0/store.js | 60 +++++++ demo/js/fix-2.0/watcher.js | 51 ++++++ dist/demo.js | 337 +++++++++++++++++++++++++++++++----- dist/fix/fix.js | 2 +- 8 files changed, 589 insertions(+), 96 deletions(-) create mode 100644 demo/js/fix-2.0/computed.js create mode 100644 demo/js/fix-2.0/define.js create mode 100644 demo/js/fix-2.0/store.js create mode 100644 demo/js/fix-2.0/watcher.js diff --git a/demo/js/config/fix.js b/demo/js/config/fix.js index 974671759..65a38c144 100644 --- a/demo/js/config/fix.js +++ b/demo/js/config/fix.js @@ -86,6 +86,26 @@ Demo.FIX_CONFIG = [{ }, { id: 71, pId: 7, - text: "fix框架", + text: "定义响应式数据", + value: "demo.fix1" +}, { + id: 72, + pId: 7, + text: "计算属性", + value: "demo.fix2" +}, { + id: 73, + pId: 7, + text: "store", + value: "demo.fix3" +}, { + id: 74, + pId: 7, + text: "watcher表达式", + value: "demo.fix4" +}, { + id: 75, + pId: 7, + text: "一个混合的例子", value: "demo.fix" }]; \ No newline at end of file diff --git a/demo/js/fix-2.0/computed.js b/demo/js/fix-2.0/computed.js new file mode 100644 index 000000000..347dae96b --- /dev/null +++ b/demo/js/fix-2.0/computed.js @@ -0,0 +1,52 @@ +;(function(){ + var model = Fix.define({ + name: "原始属性", + arr: [{ + n: 'a' + }, { + n: 'b' + }] + }); + var Computed = BI.inherit(Fix.VM, { + computed: { + b: function () { + return this.name + "-计算属性" + } + } + }) + + Demo.Fix = BI.inherit(BI.Widget, { + _store: function () { + return new Computed(model); + }, + watch: { + b: function () { + this.button.setText(this.model.b) + } + }, + render: function () { + var self = this; + return { + type: "bi.absolute", + items: [{ + el: { + type: "bi.button", + ref: function () { + self.button = this; + }, + handler: function () { + self.model.name = "这是改变后的属性" + }, + text: this.model.b + } + }] + } + }, + mounted: function () { + + + } + }); + + BI.shortcut("demo.fix2", Demo.Fix); +}()); \ No newline at end of file diff --git a/demo/js/fix-2.0/define.js b/demo/js/fix-2.0/define.js new file mode 100644 index 000000000..ef7ebcacc --- /dev/null +++ b/demo/js/fix-2.0/define.js @@ -0,0 +1,45 @@ +;(function () { + var model = Fix.define({ + name: "原始属性", + arr: [{ + n: 'a' + }, { + n: 'b' + }] + }); + + Demo.Fix = BI.inherit(BI.Widget, { + _store: function () { + return model; + }, + watch: { + name: function () { + this.button.setText(this.model.name) + } + }, + render: function () { + var self = this; + return { + type: "bi.absolute", + items: [{ + el: { + type: "bi.button", + ref: function () { + self.button = this; + }, + handler: function () { + self.model.name = "这是改变后的属性" + }, + text: this.model.name + } + }] + } + }, + mounted: function () { + + + } + }); + + BI.shortcut("demo.fix1", Demo.Fix); +}()); diff --git a/demo/js/fix-2.0/demo.js b/demo/js/fix-2.0/demo.js index f6d30bd71..fb946f8db 100644 --- a/demo/js/fix-2.0/demo.js +++ b/demo/js/fix-2.0/demo.js @@ -1,55 +1,75 @@ -var model = Fix.define({ - name: 1, - arr: [{ - n: 'a' - }, { - n: 'b' - }] -}); -Demo.Computed = BI.inherit(Fix.VM, { - computed: { - b: function () { - return this.name + 1 - }, - c: function () { - return this.arr[1].n + this.b +;(function () { + var model = Fix.define({ + name: 1, + arr: [{ + n: 'a' + }, { + n: 0 + }] + }); + var Computed = BI.inherit(Fix.VM, { + computed: { + b: function () { + return this.name + 1 + }, + c: function () { + return this.arr[1].n + this.b + } } - } -}) + }) -Demo.Store = BI.inherit(Fix.VM, { - _init: function () { - this.comp = new Demo.Computed(model).model; - }, - computed: { - b: function () { - return this.comp.c + 1 + var Store = BI.inherit(Fix.VM, { + _init: function () { + this.comp = new Computed(model).model; }, - c: function () { - return this.comp.name - } - }, - actions: { - run: function () { - this.comp.name = 2; - this.comp.arr[1].n = "c" + computed: { + b: function () { + return this.comp.c + 1 + }, + c: function () { + return this.comp.arr[1].n & 1; + } + }, + actions: { + run: function () { + this.comp.name++; + this.comp.arr[1].n++; + } } - } -}); + }); -Demo.Fix = BI.inherit(BI.Widget, { - _store: function () { - return new Demo.Store(); - }, - watch: { - "b&&c||b": function () { - debugger; - } - }, - mounted: function () { + Demo.Fix = BI.inherit(BI.Widget, { + _store: function () { + return new Store(); + }, + watch: { + "b&&(c||b)": function () { + this.button.setText(this.model.b) + } + }, + render: function () { + var self = this; + return { + type: "bi.absolute", + items: [{ + el: { + type: "bi.button", + ref: function () { + self.button = this; + }, + handler: function () { + self.store.run() + }, + text: this.model.b + } + }] + } + }, + mounted: function () { - this.store.run() - } -}); -BI.shortcut("demo.fix", Demo.Fix); \ No newline at end of file + } + }); + + BI.shortcut("demo.fix", Demo.Fix); +}()); \ No newline at end of file diff --git a/demo/js/fix-2.0/store.js b/demo/js/fix-2.0/store.js new file mode 100644 index 000000000..30c93e203 --- /dev/null +++ b/demo/js/fix-2.0/store.js @@ -0,0 +1,60 @@ +;(function(){ + var model = Fix.define({ + name: "原始属性", + arr: [{ + n: 'a' + }, { + n: 'b' + }] + }); + + var Store = BI.inherit(Fix.VM, { + _init: function () { + }, + computed: { + b: function () { + return model.name + '-计算属性' + } + }, + actions: { + run: function () { + model.name = "这是改变后的属性"; + } + } + }); + + Demo.Fix = BI.inherit(BI.Widget, { + _store: function () { + return new Store(); + }, + watch: { + b: function () { + this.button.setText(this.model.b) + } + }, + render: function () { + var self = this; + return { + type: "bi.absolute", + items: [{ + el: { + type: "bi.button", + ref: function () { + self.button = this; + }, + handler: function () { + self.store.run() + }, + text: this.model.b + } + }] + } + }, + mounted: function () { + + + } + }); + + BI.shortcut("demo.fix3", Demo.Fix); +}()); \ No newline at end of file diff --git a/demo/js/fix-2.0/watcher.js b/demo/js/fix-2.0/watcher.js new file mode 100644 index 000000000..dabd4a646 --- /dev/null +++ b/demo/js/fix-2.0/watcher.js @@ -0,0 +1,51 @@ +;(function () { + var model = Fix.define({ + name: "原始属性", + arr: [{ + n: 'a' + }, { + n: 0 + }] + }); + + Demo.Fix = BI.inherit(BI.Widget, { + _store: function () { + return model; + }, + watch: { + "name||arr.1.n": function () { + this.button.setText(this.model.name + "-" + this.model.arr[1].n) + } + }, + render: function () { + var self = this; + var cnt = 0; + return { + type: "bi.absolute", + items: [{ + el: { + type: "bi.button", + ref: function () { + self.button = this; + }, + handler: function () { + if (cnt & 1) { + self.model.name += 1; + } else { + self.model.arr[1].n += 1; + } + cnt++; + }, + text: this.model.name + "-" + this.model.arr[1].n + } + }] + } + }, + mounted: function () { + + + } + }); + + BI.shortcut("demo.fix4", Demo.Fix); +}()); \ No newline at end of file diff --git a/dist/demo.js b/dist/demo.js index 49edef10a..ef8ec3265 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -5381,7 +5381,27 @@ Demo.FIX_CONFIG = [{ }, { id: 71, pId: 7, - text: "fix框架", + text: "定义响应式数据", + value: "demo.fix1" +}, { + id: 72, + pId: 7, + text: "计算属性", + value: "demo.fix2" +}, { + id: 73, + pId: 7, + text: "store", + value: "demo.fix3" +}, { + id: 74, + pId: 7, + text: "watcher表达式", + value: "demo.fix4" +}, { + id: 75, + pId: 7, + text: "一个混合的例子", value: "demo.fix" }];Demo.WIDGET_CONFIG = [{ id: 4, @@ -10070,61 +10090,286 @@ Demo.Func = BI.inherit(BI.Widget, { } }); BI.shortcut("demo.tmp", Demo.Func); -var model = Fix.define({ - name: 1, - arr: [{ - n: 'a' - }, { - n: 'b' - }] -}); -Demo.Computed = BI.inherit(Fix.VM, { - computed: { - b: function () { - return this.name + 1 +;(function(){ + var model = Fix.define({ + name: "原始属性", + arr: [{ + n: 'a' + }, { + n: 'b' + }] + }); + var Computed = BI.inherit(Fix.VM, { + computed: { + b: function () { + return this.name + "-计算属性" + } + } + }) + + Demo.Fix = BI.inherit(BI.Widget, { + _store: function () { + return new Computed(model); + }, + watch: { + b: function () { + this.button.setText(this.model.b) + } }, - c: function () { - return this.arr[1].n + this.b + render: function () { + var self = this; + return { + type: "bi.absolute", + items: [{ + el: { + type: "bi.button", + ref: function () { + self.button = this; + }, + handler: function () { + self.model.name = "这是改变后的属性" + }, + text: this.model.b + } + }] + } + }, + mounted: function () { + + } - } -}) + }); -Demo.Store = BI.inherit(Fix.VM, { - _init: function () { - this.comp = new Demo.Computed(model).model; - }, - computed: { - b: function () { - return this.comp.c + 1 + BI.shortcut("demo.fix2", Demo.Fix); +}());;(function () { + var model = Fix.define({ + name: "原始属性", + arr: [{ + n: 'a' + }, { + n: 'b' + }] + }); + + Demo.Fix = BI.inherit(BI.Widget, { + _store: function () { + return model; + }, + watch: { + name: function () { + this.button.setText(this.model.name) + } }, - c: function () { - return this.comp.name + render: function () { + var self = this; + return { + type: "bi.absolute", + items: [{ + el: { + type: "bi.button", + ref: function () { + self.button = this; + }, + handler: function () { + self.model.name = "这是改变后的属性" + }, + text: this.model.name + } + }] + } + }, + mounted: function () { + + } - }, - actions: { - run: function () { - this.comp.name = 2; - this.comp.arr[1].n = "c" + }); + + BI.shortcut("demo.fix1", Demo.Fix); +}()); +;(function () { + var model = Fix.define({ + name: 1, + arr: [{ + n: 'a' + }, { + n: 0 + }] + }); + var Computed = BI.inherit(Fix.VM, { + computed: { + b: function () { + return this.name + 1 + }, + c: function () { + return this.arr[1].n + this.b + } } - } -}); + }) -Demo.Fix = BI.inherit(BI.Widget, { - _store: function () { - return new Demo.Store(); - }, - watch: { - "b&&c||b": function () { - debugger; + var Store = BI.inherit(Fix.VM, { + _init: function () { + this.comp = new Computed(model).model; + }, + computed: { + b: function () { + return this.comp.c + 1 + }, + c: function () { + return this.comp.arr[1].n & 1; + } + }, + actions: { + run: function () { + this.comp.name++; + this.comp.arr[1].n++; + } } - }, - mounted: function () { + }); - this.store.run() - } -}); + Demo.Fix = BI.inherit(BI.Widget, { + _store: function () { + return new Store(); + }, + watch: { + "b&&(c||b)": function () { + this.button.setText(this.model.b) + } + }, + render: function () { + var self = this; + return { + type: "bi.absolute", + items: [{ + el: { + type: "bi.button", + ref: function () { + self.button = this; + }, + handler: function () { + self.store.run() + }, + text: this.model.b + } + }] + } + }, + mounted: function () { + + + } + }); + + BI.shortcut("demo.fix", Demo.Fix); +}());;(function(){ + var model = Fix.define({ + name: "原始属性", + arr: [{ + n: 'a' + }, { + n: 'b' + }] + }); + + var Store = BI.inherit(Fix.VM, { + _init: function () { + }, + computed: { + b: function () { + return model.name + '-计算属性' + } + }, + actions: { + run: function () { + model.name = "这是改变后的属性"; + } + } + }); + + Demo.Fix = BI.inherit(BI.Widget, { + _store: function () { + return new Store(); + }, + watch: { + b: function () { + this.button.setText(this.model.b) + } + }, + render: function () { + var self = this; + return { + type: "bi.absolute", + items: [{ + el: { + type: "bi.button", + ref: function () { + self.button = this; + }, + handler: function () { + self.store.run() + }, + text: this.model.b + } + }] + } + }, + mounted: function () { + + + } + }); + + BI.shortcut("demo.fix3", Demo.Fix); +}());;(function () { + var model = Fix.define({ + name: "原始属性", + arr: [{ + n: 'a' + }, { + n: 0 + }] + }); + + Demo.Fix = BI.inherit(BI.Widget, { + _store: function () { + return model; + }, + watch: { + "name||arr.1.n": function () { + this.button.setText(this.model.name + "-" + this.model.arr[1].n) + } + }, + render: function () { + var self = this; + var cnt = 0; + return { + type: "bi.absolute", + items: [{ + el: { + type: "bi.button", + ref: function () { + self.button = this; + }, + handler: function () { + if (cnt & 1) { + self.model.name += 1; + } else { + self.model.arr[1].n += 1; + } + cnt++; + }, + text: this.model.name + "-" + this.model.arr[1].n + } + }] + } + }, + mounted: function () { + + + } + }); -BI.shortcut("demo.fix", Demo.Fix);Demo.Main = BI.inherit(BI.Widget, { + BI.shortcut("demo.fix4", Demo.Fix); +}());Demo.Main = BI.inherit(BI.Widget, { props: { baseCls: "demo-main bi-background" }, diff --git a/dist/fix/fix.js b/dist/fix/fix.js index 3b1cacddd..02a0b693b 100644 --- a/dist/fix/fix.js +++ b/dist/fix/fix.js @@ -974,7 +974,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons cb.call(vm); fns = exps.slice(); nextTick(function () { - complete = true; + complete = false; }); } }, options);